| 56 |
56 |
| 57 # Simple uname based platform detection |
57 # Simple uname based platform detection |
| 58 # $PLATFORM is used for platform dependent dependency selection |
58 # $PLATFORM is used for platform dependent dependency selection |
| 59 OS=`uname -s` |
59 OS=`uname -s` |
| 60 OS_VERSION=`uname -r` |
60 OS_VERSION=`uname -r` |
| |
61 ARCH=`uname -m` |
| 61 printf "detect platform... " |
62 printf "detect platform... " |
| 62 if [ "$OS" = "SunOS" ]; then |
63 if [ "$OS" = "SunOS" ]; then |
| 63 PLATFORM="solaris sunos unix svr4" |
64 PLATFORM="solaris sunos unix svr4" |
| 64 elif [ "$OS" = "Linux" ]; then |
65 elif [ "$OS" = "Linux" ]; then |
| 65 PLATFORM="linux unix" |
66 PLATFORM="linux unix" |
| 200 : ${includedir:='${prefix}/include'} |
201 : ${includedir:='${prefix}/include'} |
| 201 : ${infodir:='${datarootdir}/info'} |
202 : ${infodir:='${datarootdir}/info'} |
| 202 : ${mandir:='${datarootdir}/man'} |
203 : ${mandir:='${datarootdir}/man'} |
| 203 : ${localedir:='${datarootdir}/locale'} |
204 : ${localedir:='${datarootdir}/locale'} |
| 204 |
205 |
| |
206 # remember the above values and compare them later |
| |
207 orig_bindir="$bindir" |
| |
208 orig_sbindir="$sbindir" |
| |
209 orig_libdir="$libdir" |
| |
210 orig_libexecdir="$libexecdir" |
| |
211 orig_datarootdir="$datarootdir" |
| |
212 orig_datadir="$datadir" |
| |
213 orig_sysconfdir="$sysconfdir" |
| |
214 orig_sharedstatedir="$sharedstatedir" |
| |
215 orig_localstatedir="$localstatedir" |
| |
216 orig_runstatedir="$runstatedir" |
| |
217 orig_includedir="$includedir" |
| |
218 orig_infodir="$infodir" |
| |
219 orig_mandir="$mandir" |
| |
220 orig_localedir="$localedir" |
| |
221 |
| 205 # check if a config.site exists and load it |
222 # check if a config.site exists and load it |
| 206 if [ -n "$CONFIG_SITE" ]; then |
223 if [ -n "$CONFIG_SITE" ]; then |
| 207 # CONFIG_SITE may contain space separated file names |
224 # CONFIG_SITE may contain space separated file names |
| 208 for cs in $CONFIG_SITE; do |
225 for cs in $CONFIG_SITE; do |
| 209 printf "loading defaults from $cs... " |
226 printf "loading defaults from $cs... " |
| 216 echo ok |
233 echo ok |
| 217 elif [ -f "$prefix/etc/config.site" ]; then |
234 elif [ -f "$prefix/etc/config.site" ]; then |
| 218 printf "loading site defaults... " |
235 printf "loading site defaults... " |
| 219 . "$prefix/etc/config.site" |
236 . "$prefix/etc/config.site" |
| 220 echo ok |
237 echo ok |
| |
238 else |
| |
239 # try to detect the correct libdir on our own, except it was changed by the user |
| |
240 if test "$libdir" = '${exec_prefix}/lib'; then |
| |
241 if [ "$OS" = "SunOS" ]; then |
| |
242 test -d "${exec_prefix}/lib/amd64" && libdir='${exec_prefix}/lib/amd64' |
| |
243 else |
| |
244 # check if the standard libdir even exists |
| |
245 if test -d "${exec_prefix}/lib" ; then |
| |
246 : |
| |
247 else |
| |
248 # if it does not, maybe a lib32 exists |
| |
249 test -d "${exec_prefix}/lib32" && libdir='${exec_prefix}/lib32' |
| |
250 fi |
| |
251 # now check if there is a special 64bit libdir that we should use |
| |
252 for i in x86_64 ppc64 s390x aarch64 aarch64_be arm64 ; do |
| |
253 if [ $ARCH = $i ]; then |
| |
254 test -d "${exec_prefix}/lib64" && libdir='${exec_prefix}/lib64' |
| |
255 break |
| |
256 fi |
| |
257 done |
| |
258 fi |
| |
259 fi |
| 221 fi |
260 fi |
| 222 |
261 |
| 223 |
262 |
| 224 # generate vars.mk |
263 # generate vars.mk |
| 225 cat > "$TEMP_DIR/vars.mk" << __EOF__ |
264 cat > "$TEMP_DIR/vars.mk" << __EOF__ |
| 688 break |
729 break |
| 689 done |
730 done |
| 690 |
731 |
| 691 # build type |
732 # build type |
| 692 if [ "$BUILD_TYPE" = "debug" ]; then |
733 if [ "$BUILD_TYPE" = "debug" ]; then |
| 693 TEMP_CFLAGS="\${DEBUG_CFLAGS}$TEMP_CFLAGS" |
734 TEMP_CFLAGS="\${DEBUG_CFLAGS} $TEMP_CFLAGS" |
| 694 TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS}$TEMP_CXXFLAGS" |
735 TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS} $TEMP_CXXFLAGS" |
| 695 fi |
736 fi |
| 696 if [ "$BUILD_TYPE" = "release" ]; then |
737 if [ "$BUILD_TYPE" = "release" ]; then |
| 697 TEMP_CFLAGS="\${RELEASE_CFLAGS}$TEMP_CFLAGS" |
738 TEMP_CFLAGS="\${RELEASE_CFLAGS} $TEMP_CFLAGS" |
| 698 TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS}$TEMP_CXXFLAGS" |
739 TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS} $TEMP_CXXFLAGS" |
| 699 fi |
740 fi |
| 700 |
741 |
| 701 # add general dependency flags to flags.mk |
742 # add general dependency flags to flags.mk |
| 702 echo "# general flags" >> "$TEMP_DIR/flags.mk" |
743 echo "# general flags" >> "$TEMP_DIR/flags.mk" |
| 703 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
744 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
| 1028 abort_configure |
1069 abort_configure |
| 1029 fi |
1070 fi |
| 1030 |
1071 |
| 1031 echo "configure finished" |
1072 echo "configure finished" |
| 1032 echo |
1073 echo |
| |
1074 echo "Toolchain" |
| |
1075 echo " name: $TOOLCHAIN_NAME" |
| |
1076 if [ -n "$TOOLCHAIN_CC" ]; then |
| |
1077 echo " cc: $TOOLCHAIN_CC" |
| |
1078 fi |
| |
1079 if [ -n "$TOOLCHAIN_CXX" ]; then |
| |
1080 echo " cxx: $TOOLCHAIN_CXX" |
| |
1081 fi |
| |
1082 if [ -n "$TOOLCHAIN_WSIZE" ]; then |
| |
1083 echo " word size: $TOOLCHAIN_WSIZE bit" |
| |
1084 fi |
| |
1085 if [ -n "$TOOLCHAIN_CSTD" ]; then |
| |
1086 echo " default C std: $TOOLCHAIN_CSTD" |
| |
1087 fi |
| |
1088 echo |
| 1033 echo "Build Config:" |
1089 echo "Build Config:" |
| 1034 echo " PREFIX: $prefix" |
1090 echo " prefix: $prefix" |
| 1035 echo " TOOLCHAIN: $TOOLCHAIN_NAME" |
1091 echo " exec_prefix: $exec_prefix" |
| |
1092 if [ "$orig_bindir" != "$bindir" ]; then |
| |
1093 echo " bindir: $bindir" |
| |
1094 fi |
| |
1095 if [ "$orig_sbindir" != "$sbindir" ]; then |
| |
1096 echo " sbindir: $sbindir" |
| |
1097 fi |
| |
1098 if [ "$orig_libdir" != "$libdir" ]; then |
| |
1099 echo " libdir: $libdir" |
| |
1100 fi |
| |
1101 if [ "$orig_libexecdir" != "$libexecdir" ]; then |
| |
1102 echo " libexecdir: $libexecdir" |
| |
1103 fi |
| |
1104 if [ "$orig_datarootdir" != "$datarootdir" ]; then |
| |
1105 echo " datarootdir: $datarootdir" |
| |
1106 fi |
| |
1107 if [ "$orig_datadir" != "$datadir" ]; then |
| |
1108 echo " datadir: $datadir" |
| |
1109 fi |
| |
1110 if [ "$orig_sysconfdir" != "$sysconfdir" ]; then |
| |
1111 echo " sysconfdir: $sysconfdir" |
| |
1112 fi |
| |
1113 if [ "$orig_sharedstatedir" != "$sharedstatedir" ]; then |
| |
1114 echo " sharedstatedir: $sharedstatedir" |
| |
1115 fi |
| |
1116 if [ "$orig_localstatedir" != "$localstatedir" ]; then |
| |
1117 echo " localstatedir: $localstatedir" |
| |
1118 fi |
| |
1119 if [ "$orig_runstatedir" != "$runstatedir" ]; then |
| |
1120 echo " runstatedir: $runstatedir" |
| |
1121 fi |
| |
1122 if [ "$orig_includedir" != "$includedir" ]; then |
| |
1123 echo " includedir: $includedir" |
| |
1124 fi |
| |
1125 if [ "$orig_infodir" != "$infodir" ]; then |
| |
1126 echo " infodir: $infodir" |
| |
1127 fi |
| |
1128 if [ "$orig_mandir" != "$mandir" ]; then |
| |
1129 echo " mandir: $mandir" |
| |
1130 fi |
| |
1131 if [ "$orig_localedir" != "$localedir" ]; then |
| |
1132 echo " localedir: $localedir" |
| |
1133 fi |
| |
1134 echo |
| 1036 echo "Options:" |
1135 echo "Options:" |
| 1037 cat "$TEMP_DIR/options" |
1136 cat "$TEMP_DIR/options" |
| 1038 echo |
1137 echo |
| 1039 |
1138 |
| 1040 # generate the config.mk file |
1139 # generate the config.mk file |