108 |
108 |
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 Options: |
|
114 --with-docs=(all|html|api|none) |
|
115 |
|
116 Optional Features: |
113 Optional Features: |
|
114 --enable-api-docs |
117 --enable-coverage |
115 --enable-coverage |
118 --disable-cxx-tests the check-cxx makefile target |
116 --disable-cxx-tests the check-cxx makefile target |
119 --disable-szmul-builtin use custom implementation, instead |
117 --disable-szmul-builtin use custom implementation, instead |
120 |
118 |
121 __EOF__ |
119 __EOF__ |
188 "--mandir"*) mandir=${ARG#--mandir} ;; |
185 "--mandir"*) mandir=${ARG#--mandir} ;; |
189 "--localedir"*) localedir=${ARG#--localedir} ;; |
186 "--localedir"*) localedir=${ARG#--localedir} ;; |
190 "--help"*) printhelp; abort_configure ;; |
187 "--help"*) printhelp; abort_configure ;; |
191 "--debug") BUILD_TYPE="debug" ;; |
188 "--debug") BUILD_TYPE="debug" ;; |
192 "--release") BUILD_TYPE="release" ;; |
189 "--release") BUILD_TYPE="release" ;; |
193 "--with-docs="*) OPT_WITH_DOCS=${ARG#--with-docs=} ;; |
190 "--enable-api-docs") FEATURE_API_DOCS=on ;; |
194 "--with-docs") echo "option '$ARG' needs a value:"; echo " $ARG=(all|html|api|none)"; abort_configure ;; |
191 "--disable-api-docs") unset FEATURE_API_DOCS ;; |
195 "--enable-coverage") FEATURE_COVERAGE=on ;; |
192 "--enable-coverage") FEATURE_COVERAGE=on ;; |
196 "--disable-coverage") unset FEATURE_COVERAGE ;; |
193 "--disable-coverage") unset FEATURE_COVERAGE ;; |
197 "--enable-cxx-tests") FEATURE_CXX_TESTS=on ;; |
194 "--enable-cxx-tests") FEATURE_CXX_TESTS=on ;; |
198 "--disable-cxx-tests") unset FEATURE_CXX_TESTS ;; |
195 "--disable-cxx-tests") unset FEATURE_CXX_TESTS ;; |
199 "--enable-szmul-builtin") FEATURE_SZMUL_BUILTIN=on ;; |
196 "--enable-szmul-builtin") FEATURE_SZMUL_BUILTIN=on ;; |
324 |
321 |
325 print_check_msg "$dep_checked_coverage" "no\n" |
322 print_check_msg "$dep_checked_coverage" "no\n" |
326 dep_checked_coverage=1 |
323 dep_checked_coverage=1 |
327 return 0 |
324 return 0 |
328 } |
325 } |
329 dependency_error_pandoc() |
|
330 { |
|
331 print_check_msg "$dep_checked_pandoc" "checking for pandoc... " |
|
332 # dependency pandoc |
|
333 while true |
|
334 do |
|
335 if test -n "$PANDOC" > /dev/null ; then |
|
336 : |
|
337 else |
|
338 break |
|
339 fi |
|
340 cat >> $TEMP_DIR/make.mk << __EOF__ |
|
341 # Dependency: pandoc |
|
342 PANDOC=$PANDOC |
|
343 __EOF__ |
|
344 print_check_msg "$dep_checked_pandoc" "yes\n" |
|
345 dep_checked_pandoc=1 |
|
346 return 1 |
|
347 done |
|
348 |
|
349 print_check_msg "$dep_checked_pandoc" "no\n" |
|
350 dep_checked_pandoc=1 |
|
351 return 0 |
|
352 } |
|
353 dependency_error_cxx() |
326 dependency_error_cxx() |
354 { |
327 { |
355 print_check_msg "$dep_checked_cxx" "checking for cxx... " |
328 print_check_msg "$dep_checked_cxx" "checking for cxx... " |
356 # dependency cxx |
329 # dependency cxx |
357 while true |
330 while true |
564 fi |
537 fi |
565 |
538 |
566 # |
539 # |
567 # OPTION VALUES |
540 # OPTION VALUES |
568 # |
541 # |
569 checkopt_with_docs_all() |
|
570 { |
|
571 VERR=0 |
|
572 if dependency_error_pandoc ; then |
|
573 VERR=1 |
|
574 fi |
|
575 if dependency_error_doxygen ; then |
|
576 VERR=1 |
|
577 fi |
|
578 if [ $VERR -ne 0 ]; then |
|
579 return 1 |
|
580 fi |
|
581 cat >> "$TEMP_DIR/make.mk" << __EOF__ |
|
582 # Documentation |
|
583 WITH_DOCS_API=yes |
|
584 WITH_DOCS_HTML=yes |
|
585 __EOF__ |
|
586 return 0 |
|
587 } |
|
588 checkopt_with_docs_html() |
|
589 { |
|
590 VERR=0 |
|
591 if dependency_error_pandoc ; then |
|
592 VERR=1 |
|
593 fi |
|
594 if [ $VERR -ne 0 ]; then |
|
595 return 1 |
|
596 fi |
|
597 cat >> "$TEMP_DIR/make.mk" << __EOF__ |
|
598 # Documentation |
|
599 WITH_DOCS_HTML=yes |
|
600 __EOF__ |
|
601 return 0 |
|
602 } |
|
603 checkopt_with_docs_api() |
|
604 { |
|
605 VERR=0 |
|
606 if dependency_error_doxygen ; then |
|
607 VERR=1 |
|
608 fi |
|
609 if [ $VERR -ne 0 ]; then |
|
610 return 1 |
|
611 fi |
|
612 cat >> "$TEMP_DIR/make.mk" << __EOF__ |
|
613 # Documentation |
|
614 WITH_DOCS_API=yes |
|
615 __EOF__ |
|
616 return 0 |
|
617 } |
|
618 checkopt_with_docs_none() |
|
619 { |
|
620 VERR=0 |
|
621 if [ $VERR -ne 0 ]; then |
|
622 return 1 |
|
623 fi |
|
624 return 0 |
|
625 } |
|
626 |
542 |
627 # |
543 # |
628 # TARGETS |
544 # TARGETS |
629 # |
545 # |
630 |
546 |
643 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED file_tools " |
559 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED file_tools " |
644 ERROR=1 |
560 ERROR=1 |
645 fi |
561 fi |
646 |
562 |
647 # Features |
563 # Features |
|
564 if [ -n "$FEATURE_API_DOCS" ]; then |
|
565 # check dependency |
|
566 if dependency_error_doxygen ; then |
|
567 # "auto" features can fail and are just disabled in this case |
|
568 if [ "$FEATURE_API_DOCS" = "auto" ]; then |
|
569 DISABLE_FEATURE_API_DOCS=1 |
|
570 else |
|
571 DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED doxygen " |
|
572 ERROR=1 |
|
573 fi |
|
574 fi |
|
575 if [ -n "$DISABLE_FEATURE_API_DOCS" ]; then |
|
576 unset FEATURE_API_DOCS |
|
577 fi |
|
578 fi |
|
579 if [ -n "$FEATURE_API_DOCS" ]; then |
|
580 : |
|
581 cat >> "$TEMP_DIR/make.mk" << __EOF__ |
|
582 # Documentation |
|
583 WITH_API_DOCS=yes |
|
584 __EOF__ |
|
585 else |
|
586 : |
|
587 fi |
648 if [ -n "$FEATURE_COVERAGE" ]; then |
588 if [ -n "$FEATURE_COVERAGE" ]; then |
649 # check dependency |
589 # check dependency |
650 if dependency_error_coverage ; then |
590 if dependency_error_coverage ; then |
651 # "auto" features can fail and are just disabled in this case |
591 # "auto" features can fail and are just disabled in this case |
652 if [ "$FEATURE_COVERAGE" = "auto" ]; then |
592 if [ "$FEATURE_COVERAGE" = "auto" ]; then |
710 : |
650 : |
711 TEMP_CFLAGS="$TEMP_CFLAGS -DCX_NO_SZMUL_BUILTIN" |
651 TEMP_CFLAGS="$TEMP_CFLAGS -DCX_NO_SZMUL_BUILTIN" |
712 TEMP_CXXFLAGS="$TEMP_CXXFLAGS -DCX_NO_SZMUL_BUILTIN" |
652 TEMP_CXXFLAGS="$TEMP_CXXFLAGS -DCX_NO_SZMUL_BUILTIN" |
713 fi |
653 fi |
714 |
654 |
715 # Option: --with-docs |
|
716 if [ -z "$OPT_WITH_DOCS" ]; then |
|
717 echo "auto-detecting option 'with-docs'" |
|
718 SAVED_ERROR="$ERROR" |
|
719 SAVED_DEPENDENCIES_FAILED="$DEPENDENCIES_FAILED" |
|
720 ERROR=1 |
|
721 while true |
|
722 do |
|
723 if checkopt_with_docs_all ; then |
|
724 echo " with-docs: all" >> "$TEMP_DIR/options" |
|
725 ERROR=0 |
|
726 break |
|
727 fi |
|
728 if checkopt_with_docs_html ; then |
|
729 echo " with-docs: html" >> "$TEMP_DIR/options" |
|
730 ERROR=0 |
|
731 break |
|
732 fi |
|
733 if checkopt_with_docs_api ; then |
|
734 echo " with-docs: api" >> "$TEMP_DIR/options" |
|
735 ERROR=0 |
|
736 break |
|
737 fi |
|
738 if checkopt_with_docs_none ; then |
|
739 echo " with-docs: none" >> "$TEMP_DIR/options" |
|
740 ERROR=0 |
|
741 break |
|
742 fi |
|
743 break |
|
744 done |
|
745 if [ $ERROR -ne 0 ]; then |
|
746 SAVED_ERROR=1 |
|
747 SAVED_DEPENDENCIES_FAILED="option 'with-docs' $SAVED_DEPENDENCIES_FAILED" |
|
748 fi |
|
749 ERROR="$SAVED_ERROR" |
|
750 DEPENDENCIES_FAILED="$SAVED_DEPENDENCIES_FAILED" |
|
751 else |
|
752 echo "checking option with-docs = $OPT_WITH_DOCS" |
|
753 if false; then |
|
754 false |
|
755 elif [ "$OPT_WITH_DOCS" = "all" ]; then |
|
756 echo " with-docs: $OPT_WITH_DOCS" >> $TEMP_DIR/options |
|
757 if checkopt_with_docs_all ; then |
|
758 : |
|
759 else |
|
760 ERROR=1 |
|
761 DEPENDENCIES_FAILED="option 'with-docs' $DEPENDENCIES_FAILED" |
|
762 fi |
|
763 elif [ "$OPT_WITH_DOCS" = "html" ]; then |
|
764 echo " with-docs: $OPT_WITH_DOCS" >> $TEMP_DIR/options |
|
765 if checkopt_with_docs_html ; then |
|
766 : |
|
767 else |
|
768 ERROR=1 |
|
769 DEPENDENCIES_FAILED="option 'with-docs' $DEPENDENCIES_FAILED" |
|
770 fi |
|
771 elif [ "$OPT_WITH_DOCS" = "api" ]; then |
|
772 echo " with-docs: $OPT_WITH_DOCS" >> $TEMP_DIR/options |
|
773 if checkopt_with_docs_api ; then |
|
774 : |
|
775 else |
|
776 ERROR=1 |
|
777 DEPENDENCIES_FAILED="option 'with-docs' $DEPENDENCIES_FAILED" |
|
778 fi |
|
779 elif [ "$OPT_WITH_DOCS" = "none" ]; then |
|
780 echo " with-docs: $OPT_WITH_DOCS" >> $TEMP_DIR/options |
|
781 if checkopt_with_docs_none ; then |
|
782 : |
|
783 else |
|
784 ERROR=1 |
|
785 DEPENDENCIES_FAILED="option 'with-docs' $DEPENDENCIES_FAILED" |
|
786 fi |
|
787 else |
|
788 echo |
|
789 echo "Invalid option value - usage:" |
|
790 echo " --with-docs=(all|html|api|none)" |
|
791 abort_configure |
|
792 fi |
|
793 fi |
|
794 |
655 |
795 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
656 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
796 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
657 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
797 fi |
658 fi |
798 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
659 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
830 echo "configure finished" |
691 echo "configure finished" |
831 echo |
692 echo |
832 echo "Build Config:" |
693 echo "Build Config:" |
833 echo " PREFIX: $prefix" |
694 echo " PREFIX: $prefix" |
834 echo " TOOLCHAIN: $TOOLCHAIN_NAME" |
695 echo " TOOLCHAIN: $TOOLCHAIN_NAME" |
835 echo "Options:" |
|
836 cat "$TEMP_DIR/options" |
|
837 echo "Features:" |
696 echo "Features:" |
|
697 if [ -n "$FEATURE_API_DOCS" ]; then |
|
698 echo " api-docs: on" |
|
699 else |
|
700 echo " api-docs: off" |
|
701 fi |
838 if [ -n "$FEATURE_COVERAGE" ]; then |
702 if [ -n "$FEATURE_COVERAGE" ]; then |
839 echo " coverage: on" |
703 echo " coverage: on" |
840 else |
704 else |
841 echo " coverage: off" |
705 echo " coverage: off" |
842 fi |
706 fi |