| 154 |
154 |
| 155 Optional Features: |
155 Optional Features: |
| 156 --enable-api-docs run Doxygen during build |
156 --enable-api-docs run Doxygen during build |
| 157 --enable-coverage test coverage with gcov |
157 --enable-coverage test coverage with gcov |
| 158 --enable-asan address sanitizer |
158 --enable-asan address sanitizer |
| 159 --disable-memrchr |
|
| 160 --disable-cxx-tests the check-cxx makefile target |
159 --disable-cxx-tests the check-cxx makefile target |
| 161 --disable-szmul-builtin use custom implementation, instead |
160 --disable-szmul-builtin use custom implementation, instead |
| |
161 --disable-memrchr |
| |
162 --disable-qsort_r |
| 162 |
163 |
| 163 __EOF__ |
164 __EOF__ |
| 164 abort_configure |
165 abort_configure |
| 165 } |
166 } |
| 166 |
167 |
| 302 "--disable-api-docs") unset FEATURE_API_DOCS ;; |
304 "--disable-api-docs") unset FEATURE_API_DOCS ;; |
| 303 "--enable-coverage") FEATURE_COVERAGE=on ;; |
305 "--enable-coverage") FEATURE_COVERAGE=on ;; |
| 304 "--disable-coverage") unset FEATURE_COVERAGE ;; |
306 "--disable-coverage") unset FEATURE_COVERAGE ;; |
| 305 "--enable-asan") FEATURE_ASAN=on ;; |
307 "--enable-asan") FEATURE_ASAN=on ;; |
| 306 "--disable-asan") unset FEATURE_ASAN ;; |
308 "--disable-asan") unset FEATURE_ASAN ;; |
| 307 "--enable-memrchr") FEATURE_MEMRCHR=on ;; |
|
| 308 "--disable-memrchr") unset FEATURE_MEMRCHR ;; |
|
| 309 "--enable-cxx-tests") FEATURE_CXX_TESTS=on ;; |
309 "--enable-cxx-tests") FEATURE_CXX_TESTS=on ;; |
| 310 "--disable-cxx-tests") unset FEATURE_CXX_TESTS ;; |
310 "--disable-cxx-tests") unset FEATURE_CXX_TESTS ;; |
| 311 "--enable-szmul-builtin") FEATURE_SZMUL_BUILTIN=on ;; |
311 "--enable-szmul-builtin") FEATURE_SZMUL_BUILTIN=on ;; |
| 312 "--disable-szmul-builtin") unset FEATURE_SZMUL_BUILTIN ;; |
312 "--disable-szmul-builtin") unset FEATURE_SZMUL_BUILTIN ;; |
| |
313 "--enable-memrchr") FEATURE_MEMRCHR=on ;; |
| |
314 "--disable-memrchr") unset FEATURE_MEMRCHR ;; |
| |
315 "--enable-qsort_r") FEATURE_QSORT_R=on ;; |
| |
316 "--disable-qsort_r") unset FEATURE_QSORT_R ;; |
| 313 "-"*) echo "unknown option: $ARG"; abort_configure ;; |
317 "-"*) echo "unknown option: $ARG"; abort_configure ;; |
| 314 esac |
318 esac |
| 315 done |
319 done |
| 316 |
320 |
| 317 # toolchain detection utilities |
321 # toolchain detection utilities |
| 586 return 1 |
590 return 1 |
| 587 done |
591 done |
| 588 |
592 |
| 589 print_check_msg "$dep_checked_no_coverage" "no\n" |
593 print_check_msg "$dep_checked_no_coverage" "no\n" |
| 590 dep_checked_no_coverage=1 |
594 dep_checked_no_coverage=1 |
| |
595 return 0 |
| |
596 } |
| |
597 dependency_error_qsort_r() |
| |
598 { |
| |
599 print_check_msg "$dep_checked_qsort_r" "checking for qsort_r... " |
| |
600 # dependency qsort_r |
| |
601 while true |
| |
602 do |
| |
603 if $TOOLCHAIN_CC $CFLAGS $LDFLAGS -o /dev/null make/test_qsort_r.c > /dev/null 2>&1 ; then |
| |
604 : |
| |
605 else |
| |
606 break |
| |
607 fi |
| |
608 TEMP_CFLAGS="$TEMP_CFLAGS -DWITH_QSORT_R" |
| |
609 print_check_msg "$dep_checked_qsort_r" "yes\n" |
| |
610 dep_checked_qsort_r=1 |
| |
611 return 1 |
| |
612 done |
| |
613 |
| |
614 print_check_msg "$dep_checked_qsort_r" "no\n" |
| |
615 dep_checked_qsort_r=1 |
| 591 return 0 |
616 return 0 |
| 592 } |
617 } |
| 593 |
618 |
| 594 # start collecting dependency information |
619 # start collecting dependency information |
| 595 echo > "$TEMP_DIR/flags.mk" |
620 echo > "$TEMP_DIR/flags.mk" |
| 799 if [ -n "$FEATURE_ASAN" ]; then |
824 if [ -n "$FEATURE_ASAN" ]; then |
| 800 : |
825 : |
| 801 else |
826 else |
| 802 : |
827 : |
| 803 fi |
828 fi |
| |
829 if [ -n "$FEATURE_CXX_TESTS" ]; then |
| |
830 # check dependency |
| |
831 if dependency_error_cxx ; then |
| |
832 # "auto" features can fail and are just disabled in this case |
| |
833 if [ "$FEATURE_CXX_TESTS" = "auto" ]; then |
| |
834 DISABLE_FEATURE_CXX_TESTS=1 |
| |
835 else |
| |
836 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED cxx " |
| |
837 ERROR=1 |
| |
838 fi |
| |
839 fi |
| |
840 if [ -n "$DISABLE_FEATURE_CXX_TESTS" ]; then |
| |
841 unset FEATURE_CXX_TESTS |
| |
842 fi |
| |
843 fi |
| |
844 if [ -n "$FEATURE_CXX_TESTS" ]; then |
| |
845 : |
| |
846 cat >> "$TEMP_DIR/make.mk" << __EOF__ |
| |
847 # Enable the check-cxx target |
| |
848 WITH_CXX_TEST=yes |
| |
849 __EOF__ |
| |
850 else |
| |
851 : |
| |
852 fi |
| |
853 if [ -n "$FEATURE_SZMUL_BUILTIN" ]; then |
| |
854 # check dependency |
| |
855 if dependency_error_no_coverage ; then |
| |
856 # "auto" features can fail and are just disabled in this case |
| |
857 if [ "$FEATURE_SZMUL_BUILTIN" = "auto" ]; then |
| |
858 DISABLE_FEATURE_SZMUL_BUILTIN=1 |
| |
859 else |
| |
860 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED no_coverage " |
| |
861 ERROR=1 |
| |
862 fi |
| |
863 fi |
| |
864 if [ -n "$DISABLE_FEATURE_SZMUL_BUILTIN" ]; then |
| |
865 unset FEATURE_SZMUL_BUILTIN |
| |
866 fi |
| |
867 fi |
| |
868 if [ -n "$FEATURE_SZMUL_BUILTIN" ]; then |
| |
869 : |
| |
870 else |
| |
871 : |
| |
872 TEMP_CFLAGS="$TEMP_CFLAGS -DCX_NO_SZMUL_BUILTIN" |
| |
873 TEMP_CXXFLAGS="$TEMP_CXXFLAGS -DCX_NO_SZMUL_BUILTIN" |
| |
874 fi |
| 804 if [ -n "$FEATURE_MEMRCHR" ]; then |
875 if [ -n "$FEATURE_MEMRCHR" ]; then |
| 805 # check dependency |
876 # check dependency |
| 806 if dependency_error_memrchr ; then |
877 if dependency_error_memrchr ; then |
| 807 # "auto" features can fail and are just disabled in this case |
878 # "auto" features can fail and are just disabled in this case |
| 808 if [ "$FEATURE_MEMRCHR" = "auto" ]; then |
879 if [ "$FEATURE_MEMRCHR" = "auto" ]; then |
| 819 if [ -n "$FEATURE_MEMRCHR" ]; then |
890 if [ -n "$FEATURE_MEMRCHR" ]; then |
| 820 : |
891 : |
| 821 else |
892 else |
| 822 : |
893 : |
| 823 fi |
894 fi |
| 824 if [ -n "$FEATURE_CXX_TESTS" ]; then |
895 if [ -n "$FEATURE_QSORT_R" ]; then |
| 825 # check dependency |
896 # check dependency |
| 826 if dependency_error_cxx ; then |
897 if dependency_error_qsort_r ; then |
| 827 # "auto" features can fail and are just disabled in this case |
898 # "auto" features can fail and are just disabled in this case |
| 828 if [ "$FEATURE_CXX_TESTS" = "auto" ]; then |
899 if [ "$FEATURE_QSORT_R" = "auto" ]; then |
| 829 DISABLE_FEATURE_CXX_TESTS=1 |
900 DISABLE_FEATURE_QSORT_R=1 |
| 830 else |
901 else |
| 831 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED cxx " |
902 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED qsort_r " |
| 832 ERROR=1 |
903 ERROR=1 |
| 833 fi |
904 fi |
| 834 fi |
905 fi |
| 835 if [ -n "$DISABLE_FEATURE_CXX_TESTS" ]; then |
906 if [ -n "$DISABLE_FEATURE_QSORT_R" ]; then |
| 836 unset FEATURE_CXX_TESTS |
907 unset FEATURE_QSORT_R |
| 837 fi |
908 fi |
| 838 fi |
909 fi |
| 839 if [ -n "$FEATURE_CXX_TESTS" ]; then |
910 if [ -n "$FEATURE_QSORT_R" ]; then |
| 840 : |
911 : |
| 841 cat >> "$TEMP_DIR/make.mk" << __EOF__ |
912 else |
| 842 # Enable the check-cxx target |
913 : |
| 843 WITH_CXX_TEST=yes |
|
| 844 __EOF__ |
|
| 845 else |
|
| 846 : |
|
| 847 fi |
|
| 848 if [ -n "$FEATURE_SZMUL_BUILTIN" ]; then |
|
| 849 # check dependency |
|
| 850 if dependency_error_no_coverage ; then |
|
| 851 # "auto" features can fail and are just disabled in this case |
|
| 852 if [ "$FEATURE_SZMUL_BUILTIN" = "auto" ]; then |
|
| 853 DISABLE_FEATURE_SZMUL_BUILTIN=1 |
|
| 854 else |
|
| 855 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED no_coverage " |
|
| 856 ERROR=1 |
|
| 857 fi |
|
| 858 fi |
|
| 859 if [ -n "$DISABLE_FEATURE_SZMUL_BUILTIN" ]; then |
|
| 860 unset FEATURE_SZMUL_BUILTIN |
|
| 861 fi |
|
| 862 fi |
|
| 863 if [ -n "$FEATURE_SZMUL_BUILTIN" ]; then |
|
| 864 : |
|
| 865 else |
|
| 866 : |
|
| 867 TEMP_CFLAGS="$TEMP_CFLAGS -DCX_NO_SZMUL_BUILTIN" |
|
| 868 TEMP_CXXFLAGS="$TEMP_CXXFLAGS -DCX_NO_SZMUL_BUILTIN" |
|
| 869 fi |
914 fi |
| 870 |
915 |
| 871 |
916 |
| 872 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
917 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
| 873 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
918 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
| 936 if [ -n "$FEATURE_ASAN" ]; then |
981 if [ -n "$FEATURE_ASAN" ]; then |
| 937 echo 'on' |
982 echo 'on' |
| 938 else |
983 else |
| 939 echo 'off' |
984 echo 'off' |
| 940 fi |
985 fi |
| |
986 printf ' %-16s' 'cxx-tests:' |
| |
987 if [ -n "$FEATURE_CXX_TESTS" ]; then |
| |
988 echo 'on' |
| |
989 else |
| |
990 echo 'off' |
| |
991 fi |
| |
992 printf ' %-16s' 'szmul-builtin:' |
| |
993 if [ -n "$FEATURE_SZMUL_BUILTIN" ]; then |
| |
994 echo 'on' |
| |
995 else |
| |
996 echo 'off' |
| |
997 fi |
| 941 printf ' %-16s' 'memrchr:' |
998 printf ' %-16s' 'memrchr:' |
| 942 if [ -n "$FEATURE_MEMRCHR" ]; then |
999 if [ -n "$FEATURE_MEMRCHR" ]; then |
| 943 echo 'on' |
1000 echo 'on' |
| 944 else |
1001 else |
| 945 echo 'off' |
1002 echo 'off' |
| 946 fi |
1003 fi |
| 947 printf ' %-16s' 'cxx-tests:' |
1004 printf ' %-16s' 'qsort_r:' |
| 948 if [ -n "$FEATURE_CXX_TESTS" ]; then |
1005 if [ -n "$FEATURE_QSORT_R" ]; then |
| 949 echo 'on' |
|
| 950 else |
|
| 951 echo 'off' |
|
| 952 fi |
|
| 953 printf ' %-16s' 'szmul-builtin:' |
|
| 954 if [ -n "$FEATURE_SZMUL_BUILTIN" ]; then |
|
| 955 echo 'on' |
1006 echo 'on' |
| 956 else |
1007 else |
| 957 echo 'off' |
1008 echo 'off' |
| 958 fi |
1009 fi |
| 959 echo |
1010 echo |