| 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 |
| 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 |