| 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" |
| 227 echo ok |
228 echo ok |
| 228 elif [ -f "$prefix/etc/config.site" ]; then |
229 elif [ -f "$prefix/etc/config.site" ]; then |
| 229 printf "loading site defaults... " |
230 printf "loading site defaults... " |
| 230 . "$prefix/etc/config.site" |
231 . "$prefix/etc/config.site" |
| 231 echo ok |
232 echo ok |
| |
233 else |
| |
234 # try to detect the correct libdir on our own, except it was changed by the user |
| |
235 if test "$libdir" = '${exec_prefix}/lib'; then |
| |
236 if [ "$OS" = "SunOS" ]; then |
| |
237 test -d "${exec_prefix}/lib/amd64" && libdir='${exec_prefix}/lib/amd64' |
| |
238 else |
| |
239 # check if the standard libdir even exists |
| |
240 if test -d "${exec_prefix}/lib" ; then |
| |
241 : |
| |
242 else |
| |
243 # if it does not, maybe a lib32 exists |
| |
244 test -d "${exec_prefix}/lib32" && libdir='${exec_prefix}/lib32' |
| |
245 fi |
| |
246 # now check if there is a special 64bit libdir that we should use |
| |
247 for i in x86_64 ppc64 s390x aarch64 aarch64_be arm64 ; do |
| |
248 if [ $ARCH = $i ]; then |
| |
249 test -d "${exec_prefix}/lib64" && libdir='${exec_prefix}/lib64' |
| |
250 break |
| |
251 fi |
| |
252 done |
| |
253 fi |
| |
254 fi |
| 232 fi |
255 fi |
| 233 |
256 |
| 234 |
257 |
| 235 # generate vars.mk |
258 # generate vars.mk |
| 236 cat > "$TEMP_DIR/vars.mk" << __EOF__ |
259 cat > "$TEMP_DIR/vars.mk" << __EOF__ |
| 294 { |
317 { |
| 295 print_check_msg "$dep_checked_ucx" "checking for ucx... " |
318 print_check_msg "$dep_checked_ucx" "checking for ucx... " |
| 296 # dependency ucx |
319 # dependency ucx |
| 297 while true |
320 while true |
| 298 do |
321 do |
| 299 if check_lib ucx cx/list.h > /dev/null ; then |
322 if [ -z "$PKG_CONFIG" ]; then |
| 300 : |
323 break |
| |
324 fi |
| |
325 if test_pkg_config "ucx" "3.2" "" "" ; then |
| |
326 TEMP_CFLAGS="$TEMP_CFLAGS `"$PKG_CONFIG" --cflags ucx`" |
| |
327 TEMP_LDFLAGS="$TEMP_LDFLAGS `"$PKG_CONFIG" --libs ucx`" |
| 301 else |
328 else |
| 302 break |
329 break |
| 303 fi |
330 fi |
| 304 TEMP_LDFLAGS="$TEMP_LDFLAGS -lucx" |
|
| 305 print_check_msg "$dep_checked_ucx" "yes\n" |
331 print_check_msg "$dep_checked_ucx" "yes\n" |
| 306 dep_checked_ucx=1 |
332 dep_checked_ucx=1 |
| 307 return 1 |
333 return 1 |
| 308 done |
334 done |
| 309 |
335 |
| 360 break |
386 break |
| 361 done |
387 done |
| 362 |
388 |
| 363 # build type |
389 # build type |
| 364 if [ "$BUILD_TYPE" = "debug" ]; then |
390 if [ "$BUILD_TYPE" = "debug" ]; then |
| 365 TEMP_CFLAGS="\${DEBUG_CFLAGS}$TEMP_CFLAGS" |
391 TEMP_CFLAGS="\${DEBUG_CFLAGS} $TEMP_CFLAGS" |
| 366 TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS}$TEMP_CXXFLAGS" |
392 TEMP_CXXFLAGS="\${DEBUG_CXXFLAGS} $TEMP_CXXFLAGS" |
| 367 fi |
393 fi |
| 368 if [ "$BUILD_TYPE" = "release" ]; then |
394 if [ "$BUILD_TYPE" = "release" ]; then |
| 369 TEMP_CFLAGS="\${RELEASE_CFLAGS}$TEMP_CFLAGS" |
395 TEMP_CFLAGS="\${RELEASE_CFLAGS} $TEMP_CFLAGS" |
| 370 TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS}$TEMP_CXXFLAGS" |
396 TEMP_CXXFLAGS="\${RELEASE_CXXFLAGS} $TEMP_CXXFLAGS" |
| 371 fi |
397 fi |
| 372 |
398 |
| 373 # add general dependency flags to flags.mk |
399 # add general dependency flags to flags.mk |
| 374 echo "# general flags" >> "$TEMP_DIR/flags.mk" |
400 echo "# general flags" >> "$TEMP_DIR/flags.mk" |
| 375 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |
401 if [ -n "${TEMP_CFLAGS}" ] && [ -n "$lang_c" ]; then |