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