make/configure.vm

changeset 94
48ebc3dd34a5
parent 93
661dd5f26bfd
equal deleted inserted replaced
93:661dd5f26bfd 94:48ebc3dd34a5
57 57
58 # Simple uname based platform detection 58 # Simple uname based platform detection
59 # $PLATFORM is used for platform dependent dependency selection 59 # $PLATFORM is used for platform dependent dependency selection
60 OS=`uname -s` 60 OS=`uname -s`
61 OS_VERSION=`uname -r` 61 OS_VERSION=`uname -r`
62 ARCH=`uname -m`
62 printf "detect platform... " 63 printf "detect platform... "
63 if [ "$OS" = "SunOS" ]; then 64 if [ "$OS" = "SunOS" ]; then
64 PLATFORM="solaris sunos unix svr4" 65 PLATFORM="solaris sunos unix svr4"
65 elif [ "$OS" = "Linux" ]; then 66 elif [ "$OS" = "Linux" ]; then
66 PLATFORM="linux unix" 67 PLATFORM="linux unix"
274 echo ok 275 echo ok
275 elif [ -f "$prefix/etc/config.site" ]; then 276 elif [ -f "$prefix/etc/config.site" ]; then
276 printf "loading site defaults... " 277 printf "loading site defaults... "
277 . "$prefix/etc/config.site" 278 . "$prefix/etc/config.site"
278 echo ok 279 echo ok
280 else
281 # try to detect the correct libdir on our own, except it was changed by the user
282 if test "$libdir" = '${exec_prefix}/lib'; then
283 if [ "$OS" = "SunOS" ]; then
284 test -d "${exec_prefix}/lib/amd64" && libdir='${exec_prefix}/lib/amd64'
285 else
286 # check if the standard libdir even exists
287 if test -d "${exec_prefix}/lib" ; then
288 :
289 else
290 # if it does not, maybe a lib32 exists
291 test -d "${exec_prefix}/lib32" && libdir='${exec_prefix}/lib32'
292 fi
293 # now check if there is a special 64bit libdir that we should use
294 for i in x86_64 ppc64 s390x aarch64 aarch64_be arm64 ; do
295 if [ $ARCH = $i ]; then
296 test -d "${exec_prefix}/lib64" && libdir='${exec_prefix}/lib64'
297 break
298 fi
299 done
300 fi
301 fi
279 fi 302 fi
280 ]]# 303 ]]#
281 ## End of unparsed content ** 304 ## End of unparsed content **
282 305
283 # generate vars.mk 306 # generate vars.mk
375 if [ -z "$PKG_CONFIG" ]; then 398 if [ -z "$PKG_CONFIG" ]; then
376 break 399 break
377 fi 400 fi
378 #end 401 #end
379 #foreach( $test in $sub.tests ) 402 #foreach( $test in $sub.tests )
380 if $test > /dev/null ; then 403 if $test > /dev/null 2>&1 ; then
381 : 404 :
382 else 405 else
383 break 406 break
384 fi 407 fi
385 #end 408 #end
477 fi 500 fi
478 #end 501 #end
479 502
480 #foreach( $flags in $dependency.flags ) 503 #foreach( $flags in $dependency.flags )
481 #if( $flags.exec ) 504 #if( $flags.exec )
482 $flags.value > /dev/null
483 if tmp_flags=`$flags.value` ; then 505 if tmp_flags=`$flags.value` ; then
484 TEMP_$flags.varName="$TEMP_$flags.varName $tmp_flags" 506 TEMP_$flags.varName="$TEMP_$flags.varName $tmp_flags"
485 else 507 else
486 ERROR=1 508 ERROR=1
487 break 509 break
501 done 523 done
502 #end 524 #end
503 525
504 # build type 526 # build type
505 if [ "$BUILD_TYPE" = "debug" ]; then 527 if [ "$BUILD_TYPE" = "debug" ]; then
506 TEMP_CFLAGS="\${DEBUG_CFLAGS}$TEMP_CFLAGS" 528 TEMP_CFLAGS="\${DEBUG_CFLAGS} $TEMP_CFLAGS"
507 TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS}$TEMP_CXXFLAGS" 529 TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS} $TEMP_CXXFLAGS"
508 fi 530 fi
509 if [ "$BUILD_TYPE" = "release" ]; then 531 if [ "$BUILD_TYPE" = "release" ]; then
510 TEMP_CFLAGS="\${RELEASE_CFLAGS}$TEMP_CFLAGS" 532 TEMP_CFLAGS="\${RELEASE_CFLAGS} $TEMP_CFLAGS"
511 TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS}$TEMP_CXXFLAGS" 533 TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS} $TEMP_CXXFLAGS"
512 fi 534 fi
513 535
514 # add general dependency flags to flags.mk 536 # add general dependency flags to flags.mk
515 echo "# general flags" >> "$TEMP_DIR/flags.mk" 537 echo "# general flags" >> "$TEMP_DIR/flags.mk"
516 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then 538 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then

mercurial