diff -Naur mysql-5.0.67/config/ac-macros/ha_berkeley.m4 mysql-5.0.67.oden/config/ac-macros/ha_berkeley.m4 --- mysql-5.0.67/config/ac-macros/ha_berkeley.m4 2008-08-04 14:19:07.000000000 +0200 +++ mysql-5.0.67.oden/config/ac-macros/ha_berkeley.m4 2008-08-09 10:56:58.000000000 +0200 @@ -160,7 +160,7 @@ dnl echo ["MYSQL_CHECK_BDB_DIR ($1)"] dir="$1" - MYSQL_CHECK_INSTALLED_BDB([$dir/include], [$dir/lib]) + MYSQL_CHECK_INSTALLED_BDB([$dir/include], [$dir/$MYSQL_LIB]) if test X"$bdb_dir_ok" != Xinstalled; then # test to see if it's a source dir diff -Naur mysql-5.0.67/config/ac-macros/ha_ndbcluster.m4 mysql-5.0.67.oden/config/ac-macros/ha_ndbcluster.m4 --- mysql-5.0.67/config/ac-macros/ha_ndbcluster.m4 2008-08-04 14:19:07.000000000 +0200 +++ mysql-5.0.67.oden/config/ac-macros/ha_ndbcluster.m4 2008-08-09 10:56:58.000000000 +0200 @@ -8,7 +8,7 @@ AC_HELP_STRING([--with-ndb-sci=DIR], [Provide MySQL with a custom location of sci library. Given DIR, sci library is - assumed to be in $DIR/lib and header files + assumed to be in $DIR/$MYSQL_LIB and header files in $DIR/include.]), [mysql_sci_dir=${withval}], [mysql_sci_dir=""]) @@ -19,10 +19,10 @@ AC_MSG_RESULT([-- not including sci transporter]) ;; * ) - if test -f "$mysql_sci_dir/lib/libsisci.a" -a \ + if test -f "$mysql_sci_dir/$MYSQL_LIB/libsisci.a" -a \ -f "$mysql_sci_dir/include/sisci_api.h"; then NDB_SCI_INCLUDES="-I$mysql_sci_dir/include" - NDB_SCI_LIBS="$mysql_sci_dir/lib/libsisci.a" + NDB_SCI_LIBS="$mysql_sci_dir/$MYSQL_LIB/libsisci.a" AC_MSG_RESULT([-- including sci transporter]) AC_DEFINE([NDB_SCI_TRANSPORTER], [1], [Including Ndb Cluster DB sci transporter]) diff -Naur mysql-5.0.67/config/ac-macros/openssl.m4 mysql-5.0.67.oden/config/ac-macros/openssl.m4 --- mysql-5.0.67/config/ac-macros/openssl.m4 2008-08-04 14:19:07.000000000 +0200 +++ mysql-5.0.67.oden/config/ac-macros/openssl.m4 2008-08-09 10:56:58.000000000 +0200 @@ -12,9 +12,9 @@ fi done - for d in /usr/ssl/lib /usr/local/ssl/lib /usr/lib/openssl \ -/usr/lib /usr/lib64 /opt/ssl/lib /opt/openssl/lib \ -/usr/freeware/lib32 /usr/local/lib/ ; do + for d in /usr/ssl/$MYSQL_LIB /usr/local/ssl/$MYSQL_LIB /usr/lib/openssl \ +/usr/$MYSQL_LIB /usr/lib64 /opt/ssl/$MYSQL_LIB /opt/openssl/$MYSQL_LIB \ +/usr/freeware/lib32 /usr/local/$MYSQL_LIB/ ; do # Test for libssl using all known library file endings if test -f $d/libssl.a || test -f $d/libssl.so || \ test -f $d/libssl.sl || test -f $d/libssl.dylib ; then @@ -89,7 +89,7 @@ fi if test -z "$openssl_libs" then - openssl_libs="$openssl/lib" + openssl_libs="$openssl/$MYSQL_LIB" fi fi MYSQL_FIND_OPENSSL([$openssl_includes], [$openssl_libs]) diff -Naur mysql-5.0.67/config/ac-macros/zlib.m4 mysql-5.0.67.oden/config/ac-macros/zlib.m4 --- mysql-5.0.67/config/ac-macros/zlib.m4 2008-08-04 14:19:07.000000000 +0200 +++ mysql-5.0.67.oden/config/ac-macros/zlib.m4 2008-08-09 10:56:58.000000000 +0200 @@ -99,13 +99,13 @@ ;; *) # Test for libz using all known library file endings - if test \( -f "$mysql_zlib_dir/lib/libz.a" -o \ - -f "$mysql_zlib_dir/lib/libz.so" -o \ + if test \( -f "$mysql_zlib_dir/$MYSQL_LIB/libz.a" -o \ + -f "$mysql_zlib_dir/$MYSQL_LIB/libz.so" -o \ -f "$mysql_zlib_dir/lib/libz.sl" -o \ -f "$mysql_zlib_dir/lib/libz.dylib" \) \ -a -f "$mysql_zlib_dir/include/zlib.h"; then ZLIB_INCLUDES="-I$mysql_zlib_dir/include" - ZLIB_LIBS="-L$mysql_zlib_dir/lib -lz" + ZLIB_LIBS="-L$mysql_zlib_dir/$MYSQL_LIB -lz" MYSQL_CHECK_ZLIB_DIR fi if test "x$mysql_cv_compress" != "xyes"; then diff -Naur mysql-5.0.67/configure.in mysql-5.0.67.oden/configure.in --- mysql-5.0.67/configure.in 2008-08-04 14:19:07.000000000 +0200 +++ mysql-5.0.67.oden/configure.in 2008-08-09 10:56:58.000000000 +0200 @@ -593,7 +593,7 @@ upgrade the standard libc installation.], [ other_libc_include="$withval/include" - other_libc_lib="$withval/lib" + other_libc_lib="$withval/$MYSQL_LIB" with_other_libc="yes" enable_shared="no" all_is_static="yes" @@ -900,7 +900,7 @@ if test "$with_libwrap" != "yes"; then CPPFLAGS="${CPPFLAGS} -I$with_libwrap/include" - LDFLAGS="${LDFLAGS} -L$with_libwrap/lib" + LDFLAGS="${LDFLAGS} -L$with_libwrap/$MYSQL_LIB" fi _libs=${LIBS} @@ -917,7 +917,7 @@ AC_DEFINE([LIBWRAP], [1], [Define if you have -lwrap]) AC_DEFINE([HAVE_LIBWRAP], [1], [Define if have -lwrap]) if test "$with_libwrap" != "yes"; then - WRAPLIBS="-L${with_libwrap}/lib" + WRAPLIBS="-L${with_libwrap}/$MYSQL_LIB" fi WRAPLIBS="${WRAPLIBS} -lwrap", AC_MSG_RESULT(no) @@ -2448,6 +2448,32 @@ AC_SUBST(tools_dirs) +# Check for native library dir name +case $host in +*-*-linux*) + # Test if the compiler is 64bit + echo 'int i;' > conftest.$ac_ext + mysql_cv_cc_64bit_output=no + if AC_TRY_EVAL(ac_compile); then + case `/usr/bin/file conftest.$ac_objext` in + *"ELF 64"*) + mysql_cv_cc_64bit_output=yes + ;; + esac + fi + rm -rf conftest* + ;; +esac + +case $host_cpu:$mysql_cv_cc_64bit_output in +powerpc64:yes | s390x:yes | sparc64:yes | x86_64:yes) + MYSQL_LIB="lib64" + ;; +*:*) + MYSQL_LIB="lib" + ;; +esac + #MYSQL_CHECK_CPU MYSQL_CHECK_VIO MYSQL_CHECK_OPENSSL