| 109 Build Types: |
109 Build Types: |
| 110 --debug add extra compile flags for debug builds |
110 --debug add extra compile flags for debug builds |
| 111 --release add extra compile flags for release builds |
111 --release add extra compile flags for release builds |
| 112 |
112 |
| 113 Optional Features: |
113 Optional Features: |
| 114 --enable-api-docs |
114 --enable-api-docs run Doxygen during build |
| 115 --enable-coverage |
115 --enable-coverage test coverage with gcov |
| |
116 --enable-asan address sanitizer |
| 116 --disable-cxx-tests the check-cxx makefile target |
117 --disable-cxx-tests the check-cxx makefile target |
| 117 --disable-szmul-builtin use custom implementation, instead |
118 --disable-szmul-builtin use custom implementation, instead |
| 118 |
119 |
| 119 __EOF__ |
120 __EOF__ |
| 120 } |
121 } |
| 189 "--release") BUILD_TYPE="release" ;; |
190 "--release") BUILD_TYPE="release" ;; |
| 190 "--enable-api-docs") FEATURE_API_DOCS=on ;; |
191 "--enable-api-docs") FEATURE_API_DOCS=on ;; |
| 191 "--disable-api-docs") unset FEATURE_API_DOCS ;; |
192 "--disable-api-docs") unset FEATURE_API_DOCS ;; |
| 192 "--enable-coverage") FEATURE_COVERAGE=on ;; |
193 "--enable-coverage") FEATURE_COVERAGE=on ;; |
| 193 "--disable-coverage") unset FEATURE_COVERAGE ;; |
194 "--disable-coverage") unset FEATURE_COVERAGE ;; |
| |
195 "--enable-asan") FEATURE_ASAN=on ;; |
| |
196 "--disable-asan") unset FEATURE_ASAN ;; |
| 194 "--enable-cxx-tests") FEATURE_CXX_TESTS=on ;; |
197 "--enable-cxx-tests") FEATURE_CXX_TESTS=on ;; |
| 195 "--disable-cxx-tests") unset FEATURE_CXX_TESTS ;; |
198 "--disable-cxx-tests") unset FEATURE_CXX_TESTS ;; |
| 196 "--enable-szmul-builtin") FEATURE_SZMUL_BUILTIN=on ;; |
199 "--enable-szmul-builtin") FEATURE_SZMUL_BUILTIN=on ;; |
| 197 "--disable-szmul-builtin") unset FEATURE_SZMUL_BUILTIN ;; |
200 "--disable-szmul-builtin") unset FEATURE_SZMUL_BUILTIN ;; |
| 198 "-"*) echo "unknown option: $ARG"; abort_configure ;; |
201 "-"*) echo "unknown option: $ARG"; abort_configure ;; |
| 337 |
340 |
| 338 print_check_msg "$dep_checked_coverage" "no\n" |
341 print_check_msg "$dep_checked_coverage" "no\n" |
| 339 dep_checked_coverage=1 |
342 dep_checked_coverage=1 |
| 340 return 0 |
343 return 0 |
| 341 } |
344 } |
| |
345 dependency_error_asan() |
| |
346 { |
| |
347 print_check_msg "$dep_checked_asan" "checking for asan... " |
| |
348 # dependency asan toolchain="gnuc" |
| |
349 while true |
| |
350 do |
| |
351 if notistoolchain "gnuc"; then |
| |
352 break |
| |
353 fi |
| |
354 TEMP_CFLAGS="$TEMP_CFLAGS -fsanitize=address" |
| |
355 TEMP_LDFLAGS="$TEMP_LDFLAGS -fsanitize=address" |
| |
356 print_check_msg "$dep_checked_asan" "yes\n" |
| |
357 dep_checked_asan=1 |
| |
358 return 1 |
| |
359 done |
| |
360 |
| |
361 print_check_msg "$dep_checked_asan" "no\n" |
| |
362 dep_checked_asan=1 |
| |
363 return 0 |
| |
364 } |
| 342 dependency_error_cxx() |
365 dependency_error_cxx() |
| 343 { |
366 { |
| 344 print_check_msg "$dep_checked_cxx" "checking for cxx... " |
367 print_check_msg "$dep_checked_cxx" "checking for cxx... " |
| 345 # dependency cxx |
368 # dependency cxx |
| 346 while true |
369 while true |
| 629 if [ -n "$FEATURE_COVERAGE" ]; then |
652 if [ -n "$FEATURE_COVERAGE" ]; then |
| 630 : |
653 : |
| 631 else |
654 else |
| 632 : |
655 : |
| 633 fi |
656 fi |
| |
657 if [ -n "$FEATURE_ASAN" ]; then |
| |
658 # check dependency |
| |
659 if dependency_error_asan ; then |
| |
660 # "auto" features can fail and are just disabled in this case |
| |
661 if [ "$FEATURE_ASAN" = "auto" ]; then |
| |
662 DISABLE_FEATURE_ASAN=1 |
| |
663 else |
| |
664 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED asan " |
| |
665 ERROR=1 |
| |
666 fi |
| |
667 fi |
| |
668 if [ -n "$DISABLE_FEATURE_ASAN" ]; then |
| |
669 unset FEATURE_ASAN |
| |
670 fi |
| |
671 fi |
| |
672 if [ -n "$FEATURE_ASAN" ]; then |
| |
673 : |
| |
674 else |
| |
675 : |
| |
676 fi |
| 634 if [ -n "$FEATURE_CXX_TESTS" ]; then |
677 if [ -n "$FEATURE_CXX_TESTS" ]; then |
| 635 # check dependency |
678 # check dependency |
| 636 if dependency_error_cxx ; then |
679 if dependency_error_cxx ; then |
| 637 # "auto" features can fail and are just disabled in this case |
680 # "auto" features can fail and are just disabled in this case |
| 638 if [ "$FEATURE_CXX_TESTS" = "auto" ]; then |
681 if [ "$FEATURE_CXX_TESTS" = "auto" ]; then |
| 770 if [ -n "$FEATURE_COVERAGE" ]; then |
813 if [ -n "$FEATURE_COVERAGE" ]; then |
| 771 echo " coverage: on" |
814 echo " coverage: on" |
| 772 else |
815 else |
| 773 echo " coverage: off" |
816 echo " coverage: off" |
| 774 fi |
817 fi |
| |
818 if [ -n "$FEATURE_ASAN" ]; then |
| |
819 echo " asan: on" |
| |
820 else |
| |
821 echo " asan: off" |
| |
822 fi |
| 775 if [ -n "$FEATURE_CXX_TESTS" ]; then |
823 if [ -n "$FEATURE_CXX_TESTS" ]; then |
| 776 echo " cxx-tests: on" |
824 echo " cxx-tests: on" |
| 777 else |
825 else |
| 778 echo " cxx-tests: off" |
826 echo " cxx-tests: off" |
| 779 fi |
827 fi |