| 105 --infodir=DIR info documentation [DATAROOTDIR/info] |
105 --infodir=DIR info documentation [DATAROOTDIR/info] |
| 106 --mandir=DIR man documentation [DATAROOTDIR/man] |
106 --mandir=DIR man documentation [DATAROOTDIR/man] |
| 107 --localedir=DIR locale-dependent data [DATAROOTDIR/locale] |
107 --localedir=DIR locale-dependent data [DATAROOTDIR/locale] |
| 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 Optional Features: |
113 Optional Features: |
| 114 --enable-api-docs |
114 --enable-api-docs |
| 115 --enable-coverage |
115 --enable-coverage |
| 116 --disable-cxx-tests the check-cxx makefile target |
116 --disable-cxx-tests the check-cxx makefile target |
| 216 : ${includedir:='${prefix}/include'} |
216 : ${includedir:='${prefix}/include'} |
| 217 : ${infodir:='${datarootdir}/info'} |
217 : ${infodir:='${datarootdir}/info'} |
| 218 : ${mandir:='${datarootdir}/man'} |
218 : ${mandir:='${datarootdir}/man'} |
| 219 : ${localedir:='${datarootdir}/locale'} |
219 : ${localedir:='${datarootdir}/locale'} |
| 220 |
220 |
| |
221 # remember the above values and compare them later |
| |
222 orig_bindir="$bindir" |
| |
223 orig_sbindir="$sbindir" |
| |
224 orig_libdir="$libdir" |
| |
225 orig_libexecdir="$libexecdir" |
| |
226 orig_datarootdir="$datarootdir" |
| |
227 orig_datadir="$datadir" |
| |
228 orig_sysconfdir="$sysconfdir" |
| |
229 orig_sharedstatedir="$sharedstatedir" |
| |
230 orig_localstatedir="$localstatedir" |
| |
231 orig_runstatedir="$runstatedir" |
| |
232 orig_includedir="$includedir" |
| |
233 orig_infodir="$infodir" |
| |
234 orig_mandir="$mandir" |
| |
235 orig_localedir="$localedir" |
| |
236 |
| 221 # check if a config.site exists and load it |
237 # check if a config.site exists and load it |
| 222 if [ -n "$CONFIG_SITE" ]; then |
238 if [ -n "$CONFIG_SITE" ]; then |
| 223 # CONFIG_SITE may contain space separated file names |
239 # CONFIG_SITE may contain space separated file names |
| 224 for cs in $CONFIG_SITE; do |
240 for cs in $CONFIG_SITE; do |
| 225 printf "loading defaults from $cs... " |
241 printf "loading defaults from $cs... " |
| 522 break |
538 break |
| 523 done |
539 done |
| 524 break |
540 break |
| 525 done |
541 done |
| 526 |
542 |
| |
543 # build type |
| |
544 if [ "$BUILD_TYPE" = "debug" ]; then |
| |
545 TEMP_CFLAGS="\${DEBUG_CFLAGS}$TEMP_CFLAGS" |
| |
546 TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS}$TEMP_CXXFLAGS" |
| |
547 fi |
| |
548 if [ "$BUILD_TYPE" = "release" ]; then |
| |
549 TEMP_CFLAGS="\${RELEASE_CFLAGS}$TEMP_CFLAGS" |
| |
550 TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS}$TEMP_CXXFLAGS" |
| |
551 fi |
| |
552 |
| 527 # add general dependency flags to flags.mk |
553 # add general dependency flags to flags.mk |
| 528 echo "# general flags" >> "$TEMP_DIR/flags.mk" |
554 echo "# general flags" >> "$TEMP_DIR/flags.mk" |
| 529 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
555 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
| 530 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
556 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
| 531 fi |
557 fi |
| 657 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
683 echo "CFLAGS += $TEMP_CFLAGS" >> "$TEMP_DIR/flags.mk" |
| 658 fi |
684 fi |
| 659 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
685 if [ -n "${TEMP_CXXFLAGS}" ] && [ -n "$lang_cpp" ]; then |
| 660 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
686 echo "CXXFLAGS += $TEMP_CXXFLAGS" >> "$TEMP_DIR/flags.mk" |
| 661 fi |
687 fi |
| 662 if [ "$BUILD_TYPE" = "debug" ]; then |
|
| 663 if [ -n "$lang_c" ]; then |
|
| 664 echo 'CFLAGS += ${DEBUG_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
|
| 665 fi |
|
| 666 if [ -n "$lang_cpp" ]; then |
|
| 667 echo 'CXXFLAGS += ${DEBUG_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" |
|
| 668 fi |
|
| 669 fi |
|
| 670 if [ "$BUILD_TYPE" = "release" ]; then |
|
| 671 if [ -n "$lang_c" ]; then |
|
| 672 echo 'CFLAGS += ${RELEASE_CC_FLAGS}' >> "$TEMP_DIR/flags.mk" |
|
| 673 fi |
|
| 674 if [ -n "$lang_cpp" ]; then |
|
| 675 echo 'CXXFLAGS += ${RELEASE_CXX_FLAGS}' >> "$TEMP_DIR/flags.mk" |
|
| 676 fi |
|
| 677 fi |
|
| 678 if [ -n "${TEMP_LDFLAGS}" ]; then |
688 if [ -n "${TEMP_LDFLAGS}" ]; then |
| 679 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
689 echo "LDFLAGS += $TEMP_LDFLAGS" >> "$TEMP_DIR/flags.mk" |
| 680 fi |
690 fi |
| 681 |
691 |
| 682 |
692 |
| 688 abort_configure |
698 abort_configure |
| 689 fi |
699 fi |
| 690 |
700 |
| 691 echo "configure finished" |
701 echo "configure finished" |
| 692 echo |
702 echo |
| |
703 echo "Toolchain" |
| |
704 echo " name: $TOOLCHAIN_NAME" |
| |
705 if [ -n "$TOOLCHAIN_CC" ]; then |
| |
706 echo " cc: $TOOLCHAIN_CC" |
| |
707 fi |
| |
708 if [ -n "$TOOLCHAIN_CXX" ]; then |
| |
709 echo " cxx: $TOOLCHAIN_CXX" |
| |
710 fi |
| |
711 if [ -n "$TOOLCHAIN_WSIZE" ]; then |
| |
712 echo " word size: $TOOLCHAIN_WSIZE bit" |
| |
713 fi |
| |
714 if [ -n "$TOOLCHAIN_CSTD" ]; then |
| |
715 echo " default C std: $TOOLCHAIN_CSTD" |
| |
716 fi |
| |
717 echo |
| 693 echo "Build Config:" |
718 echo "Build Config:" |
| 694 echo " PREFIX: $prefix" |
719 echo " prefix: $prefix" |
| 695 echo " TOOLCHAIN: $TOOLCHAIN_NAME" |
720 echo " exec_prefix: $exec_prefix" |
| |
721 if [ "$orig_bindir" != "$bindir" ]; then |
| |
722 echo " bindir: $bindir" |
| |
723 fi |
| |
724 if [ "$orig_sbindir" != "$sbindir" ]; then |
| |
725 echo " sbindir: $sbindir" |
| |
726 fi |
| |
727 if [ "$orig_libdir" != "$libdir" ]; then |
| |
728 echo " libdir: $libdir" |
| |
729 fi |
| |
730 if [ "$orig_libexecdir" != "$libexecdir" ]; then |
| |
731 echo " libexecdir: $libexecdir" |
| |
732 fi |
| |
733 if [ "$orig_datarootdir" != "$datarootdir" ]; then |
| |
734 echo " datarootdir: $datarootdir" |
| |
735 fi |
| |
736 if [ "$orig_datadir" != "$datadir" ]; then |
| |
737 echo " datadir: $datadir" |
| |
738 fi |
| |
739 if [ "$orig_sysconfdir" != "$sysconfdir" ]; then |
| |
740 echo " sysconfdir: $sysconfdir" |
| |
741 fi |
| |
742 if [ "$orig_sharedstatedir" != "$sharedstatedir" ]; then |
| |
743 echo " sharedstatedir: $sharedstatedir" |
| |
744 fi |
| |
745 if [ "$orig_localstatedir" != "$localstatedir" ]; then |
| |
746 echo " localstatedir: $localstatedir" |
| |
747 fi |
| |
748 if [ "$orig_runstatedir" != "$runstatedir" ]; then |
| |
749 echo " runstatedir: $runstatedir" |
| |
750 fi |
| |
751 if [ "$orig_includedir" != "$includedir" ]; then |
| |
752 echo " includedir: $includedir" |
| |
753 fi |
| |
754 if [ "$orig_infodir" != "$infodir" ]; then |
| |
755 echo " infodir: $infodir" |
| |
756 fi |
| |
757 if [ "$orig_mandir" != "$mandir" ]; then |
| |
758 echo " mandir: $mandir" |
| |
759 fi |
| |
760 if [ "$orig_localedir" != "$localedir" ]; then |
| |
761 echo " localedir: $localedir" |
| |
762 fi |
| |
763 echo |
| 696 echo "Features:" |
764 echo "Features:" |
| 697 if [ -n "$FEATURE_API_DOCS" ]; then |
765 if [ -n "$FEATURE_API_DOCS" ]; then |
| 698 echo " api-docs: on" |
766 echo " api-docs: on" |
| 699 else |
767 else |
| 700 echo " api-docs: off" |
768 echo " api-docs: off" |
| 715 echo " szmul-builtin: off" |
783 echo " szmul-builtin: off" |
| 716 fi |
784 fi |
| 717 echo |
785 echo |
| 718 |
786 |
| 719 # generate the config.mk file |
787 # generate the config.mk file |
| |
788 pwd=`pwd` |
| 720 cat > "$TEMP_DIR/config.mk" << __EOF__ |
789 cat > "$TEMP_DIR/config.mk" << __EOF__ |
| 721 # |
790 # |
| 722 # config.mk generated by configure |
791 # config.mk generated by: |
| |
792 # pwd: $pwd |
| |
793 # $0 $@ |
| 723 # |
794 # |
| 724 |
795 |
| 725 __EOF__ |
796 __EOF__ |
| 726 write_toolchain_defaults "$TEMP_DIR/toolchain.mk" |
797 write_toolchain_defaults "$TEMP_DIR/toolchain.mk" |
| 727 cat "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk |
798 cat "$TEMP_DIR/config.mk" "$TEMP_DIR/vars.mk" "$TEMP_DIR/toolchain.mk" "$TEMP_DIR/flags.mk" "$TEMP_DIR/make.mk" > config.mk |
| 728 rm -Rf "$TEMP_DIR" |
799 rm -Rf "$TEMP_DIR" |