configure

changeset 86
db21aab20169
parent 85
6960d25eb0ba
equal deleted inserted replaced
85:6960d25eb0ba 86:db21aab20169
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"
227 echo ok 228 echo ok
228 elif [ -f "$prefix/etc/config.site" ]; then 229 elif [ -f "$prefix/etc/config.site" ]; then
229 printf "loading site defaults... " 230 printf "loading site defaults... "
230 . "$prefix/etc/config.site" 231 . "$prefix/etc/config.site"
231 echo ok 232 echo ok
233 else
234 # try to detect the correct libdir on our own, except it was changed by the user
235 if test "$libdir" = '${exec_prefix}/lib'; then
236 if [ "$OS" = "SunOS" ]; then
237 test -d "${exec_prefix}/lib/amd64" && libdir='${exec_prefix}/lib/amd64'
238 else
239 # check if the standard libdir even exists
240 if test -d "${exec_prefix}/lib" ; then
241 :
242 else
243 # if it does not, maybe a lib32 exists
244 test -d "${exec_prefix}/lib32" && libdir='${exec_prefix}/lib32'
245 fi
246 # now check if there is a special 64bit libdir that we should use
247 for i in x86_64 ppc64 s390x aarch64 aarch64_be arm64 ; do
248 if [ $ARCH = $i ]; then
249 test -d "${exec_prefix}/lib64" && libdir='${exec_prefix}/lib64'
250 break
251 fi
252 done
253 fi
254 fi
232 fi 255 fi
233 256
234 257
235 # generate vars.mk 258 # generate vars.mk
236 cat > "$TEMP_DIR/vars.mk" << __EOF__ 259 cat > "$TEMP_DIR/vars.mk" << __EOF__
314 break 337 break
315 done 338 done
316 339
317 # build type 340 # build type
318 if [ "$BUILD_TYPE" = "debug" ]; then 341 if [ "$BUILD_TYPE" = "debug" ]; then
319 TEMP_CFLAGS="\${DEBUG_CFLAGS}$TEMP_CFLAGS" 342 TEMP_CFLAGS="\${DEBUG_CFLAGS} $TEMP_CFLAGS"
320 TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS}$TEMP_CXXFLAGS" 343 TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS} $TEMP_CXXFLAGS"
321 fi 344 fi
322 if [ "$BUILD_TYPE" = "release" ]; then 345 if [ "$BUILD_TYPE" = "release" ]; then
323 TEMP_CFLAGS="\${RELEASE_CFLAGS}$TEMP_CFLAGS" 346 TEMP_CFLAGS="\${RELEASE_CFLAGS} $TEMP_CFLAGS"
324 TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS}$TEMP_CXXFLAGS" 347 TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS} $TEMP_CXXFLAGS"
325 fi 348 fi
326 349
327 # add general dependency flags to flags.mk 350 # add general dependency flags to flags.mk
328 echo "# general flags" >> "$TEMP_DIR/flags.mk" 351 echo "# general flags" >> "$TEMP_DIR/flags.mk"
329 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then 352 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then

mercurial