configure

changeset 988
15b3ca7ee33f
parent 987
53e22f112b11
equal deleted inserted replaced
987:53e22f112b11 988:15b3ca7ee33f
111 --release add extra compile flags for release builds 111 --release add extra compile flags for release builds
112 --with-docs=(all|html|api|none) 112 --with-docs=(all|html|api|none)
113 113
114 Optional Features: 114 Optional Features:
115 --enable-coverage 115 --enable-coverage
116 --disable-cxx-tests the check-cxx makefile target
116 --disable-szmul-builtin use custom implementation, instead 117 --disable-szmul-builtin use custom implementation, instead
117 118
118 __EOF__ 119 __EOF__
119 } 120 }
120 121
157 DOXYGEN=`command -v doxygen` 158 DOXYGEN=`command -v doxygen`
158 PANDOC=`command -v pandoc` 159 PANDOC=`command -v pandoc`
159 fi 160 fi
160 161
161 # features 162 # features
163 FEATURE_CXX_TESTS=auto
162 FEATURE_SZMUL_BUILTIN=auto 164 FEATURE_SZMUL_BUILTIN=auto
163 165
164 # 166 #
165 # parse arguments 167 # parse arguments
166 # 168 #
187 "--debug") BUILD_TYPE="debug" ;; 189 "--debug") BUILD_TYPE="debug" ;;
188 "--release") BUILD_TYPE="release" ;; 190 "--release") BUILD_TYPE="release" ;;
189 "--with-docs="*) OPT_WITH_DOCS=${ARG#--with-docs=} ;; 191 "--with-docs="*) OPT_WITH_DOCS=${ARG#--with-docs=} ;;
190 "--enable-coverage") FEATURE_COVERAGE=on ;; 192 "--enable-coverage") FEATURE_COVERAGE=on ;;
191 "--disable-coverage") unset FEATURE_COVERAGE ;; 193 "--disable-coverage") unset FEATURE_COVERAGE ;;
194 "--enable-cxx-tests") FEATURE_CXX_TESTS=on ;;
195 "--disable-cxx-tests") unset FEATURE_CXX_TESTS ;;
192 "--enable-szmul-builtin") FEATURE_SZMUL_BUILTIN=on ;; 196 "--enable-szmul-builtin") FEATURE_SZMUL_BUILTIN=on ;;
193 "--disable-szmul-builtin") unset FEATURE_SZMUL_BUILTIN ;; 197 "--disable-szmul-builtin") unset FEATURE_SZMUL_BUILTIN ;;
194 "-"*) echo "unknown option: $ARG"; abort_configure ;; 198 "-"*) echo "unknown option: $ARG"; abort_configure ;;
195 esac 199 esac
196 done 200 done
261 # 265 #
262 266
263 # check languages 267 # check languages
264 lang_c= 268 lang_c=
265 lang_cpp= 269 lang_cpp=
270 if detect_cpp_compiler ; then
271 lang_cpp=1
272 fi
266 if detect_c_compiler ; then 273 if detect_c_compiler ; then
267 lang_c=1 274 lang_c=1
268 fi 275 fi
269 276
270 # create buffer for make variables required by dependencies 277 # create buffer for make variables required by dependencies
331 return 1 338 return 1
332 done 339 done
333 340
334 print_check_msg "$dep_checked_pandoc" "no\n" 341 print_check_msg "$dep_checked_pandoc" "no\n"
335 dep_checked_pandoc=1 342 dep_checked_pandoc=1
343 return 0
344 }
345 dependency_error_cxx()
346 {
347 print_check_msg "$dep_checked_cxx" "checking for cxx... "
348 # dependency cxx
349 while true
350 do
351 if [ -z "$lang_cpp" ] ; then
352 break
353 fi
354 print_check_msg "$dep_checked_cxx" "yes\n"
355 dep_checked_cxx=1
356 return 1
357 done
358
359 print_check_msg "$dep_checked_cxx" "no\n"
360 dep_checked_cxx=1
336 return 0 361 return 0
337 } 362 }
338 dependency_error_c() 363 dependency_error_c()
339 { 364 {
340 print_check_msg "$dep_checked_c" "checking for c... " 365 print_check_msg "$dep_checked_c" "checking for c... "
607 unset FEATURE_COVERAGE 632 unset FEATURE_COVERAGE
608 fi 633 fi
609 fi 634 fi
610 if [ -n "$FEATURE_COVERAGE" ]; then 635 if [ -n "$FEATURE_COVERAGE" ]; then
611 : 636 :
637 else
638 :
639 fi
640 if [ -n "$FEATURE_CXX_TESTS" ]; then
641 # check dependency
642 if dependency_error_cxx ; then
643 # "auto" features can fail and are just disabled in this case
644 if [ "$FEATURE_CXX_TESTS" = "auto" ]; then
645 DISABLE_FEATURE_CXX_TESTS=1
646 else
647 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED cxx "
648 ERROR=1
649 fi
650 fi
651 if [ -n "$DISABLE_FEATURE_CXX_TESTS" ]; then
652 unset FEATURE_CXX_TESTS
653 fi
654 fi
655 if [ -n "$FEATURE_CXX_TESTS" ]; then
656 :
657 cat >> "$TEMP_DIR/make.mk" << __EOF__
658 # Enable the check-cxx target
659 WITH_CXX_TEST=yes
660 __EOF__
612 else 661 else
613 : 662 :
614 fi 663 fi
615 if [ -n "$FEATURE_SZMUL_BUILTIN" ]; then 664 if [ -n "$FEATURE_SZMUL_BUILTIN" ]; then
616 if [ -n "$DISABLE_FEATURE_SZMUL_BUILTIN" ]; then 665 if [ -n "$DISABLE_FEATURE_SZMUL_BUILTIN" ]; then
746 if [ -n "$FEATURE_COVERAGE" ]; then 795 if [ -n "$FEATURE_COVERAGE" ]; then
747 echo " coverage: on" 796 echo " coverage: on"
748 else 797 else
749 echo " coverage: off" 798 echo " coverage: off"
750 fi 799 fi
800 if [ -n "$FEATURE_CXX_TESTS" ]; then
801 echo " cxx-tests: on"
802 else
803 echo " cxx-tests: off"
804 fi
751 if [ -n "$FEATURE_SZMUL_BUILTIN" ]; then 805 if [ -n "$FEATURE_SZMUL_BUILTIN" ]; then
752 echo " szmul-builtin: on" 806 echo " szmul-builtin: on"
753 else 807 else
754 echo " szmul-builtin: off" 808 echo " szmul-builtin: off"
755 fi 809 fi

mercurial