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