| 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" |
| 245 echo ok |
246 echo ok |
| 246 elif [ -f "$prefix/etc/config.site" ]; then |
247 elif [ -f "$prefix/etc/config.site" ]; then |
| 247 printf "loading site defaults... " |
248 printf "loading site defaults... " |
| 248 . "$prefix/etc/config.site" |
249 . "$prefix/etc/config.site" |
| 249 echo ok |
250 echo ok |
| |
251 else |
| |
252 # try to detect the correct libdir on our own, except it was changed by the user |
| |
253 if test "$libdir" = '${exec_prefix}/lib'; then |
| |
254 if [ "$OS" = "SunOS" ]; then |
| |
255 test -d "${exec_prefix}/lib/amd64" && libdir='${exec_prefix}/lib/amd64' |
| |
256 else |
| |
257 # check if the standard libdir even exists |
| |
258 if test -d "${exec_prefix}/lib" ; then |
| |
259 : |
| |
260 else |
| |
261 # if it does not, maybe a lib32 exists |
| |
262 test -d "${exec_prefix}/lib32" && libdir='${exec_prefix}/lib32' |
| |
263 fi |
| |
264 # now check if there is a special 64bit libdir that we should use |
| |
265 for i in x86_64 ppc64 s390x aarch64 aarch64_be arm64 ; do |
| |
266 if [ $ARCH = $i ]; then |
| |
267 test -d "${exec_prefix}/lib64" && libdir='${exec_prefix}/lib64' |
| |
268 break |
| |
269 fi |
| |
270 done |
| |
271 fi |
| |
272 fi |
| 250 fi |
273 fi |
| 251 |
274 |
| 252 |
275 |
| 253 # generate vars.mk |
276 # generate vars.mk |
| 254 cat > "$TEMP_DIR/vars.mk" << __EOF__ |
277 cat > "$TEMP_DIR/vars.mk" << __EOF__ |