| 22 | | # GR_LIB64() |
|---|
| 23 | | # |
|---|
| 24 | | # Checks to see if we're on a x86_64 or powerpc64 machine, and if so, detemine |
|---|
| 25 | | # if libdir should end in "64" or not. |
|---|
| 26 | | # |
|---|
| 27 | | # May append "64" to libdir. |
|---|
| 28 | | # Sets gr_libdir_suffix to "" or "64" |
|---|
| 29 | | # |
|---|
| | 22 | dnl GR_LIB64() |
|---|
| | 23 | dnl |
|---|
| | 24 | dnl Checks to see if we're on a x86_64 or powerpc64 machine, and if so, determine |
|---|
| | 25 | dnl if libdir should end in "64" or not. |
|---|
| | 26 | dnl |
|---|
| | 27 | dnl Sets gr_libdir_suffix to "" or "64" and calls AC_SUBST(gr_libdir_suffix) |
|---|
| | 28 | dnl May append "64" to libdir. |
|---|
| | 29 | dnl |
|---|
| | 30 | dnl The current heuristic is: |
|---|
| | 31 | dnl if the host_cpu isn't x86_64 or powerpc64, then "" |
|---|
| | 32 | dnl if the host_os isn't linux, then "" |
|---|
| | 33 | dnl if we're cross-compiling, ask the linker, by way of the selected compiler |
|---|
| | 34 | dnl if we're x86_64 and there's a /lib64 and it's not a symlink, then "64", else "" |
|---|
| | 35 | dnl else ask the compiler |
|---|
| | 36 | dnl |
|---|
| 39 | | AC_MSG_CHECKING([libdir suffix]) |
|---|
| | 45 | case "$host_os" in |
|---|
| | 46 | linux*) is_linux=yes ;; |
|---|
| | 47 | *) is_linux=no ;; |
|---|
| | 48 | esac |
|---|
| | 49 | |
|---|
| | 50 | if test "$is_linux" = no || test "$host_cpu" != "x86_64" && test "$host_cpu" != "powerpc64"; then |
|---|
| | 51 | gr_libdir_suffix="" |
|---|
| | 52 | elif test "$cross_compiling" = yes; then |
|---|
| | 53 | _GR_LIB64_ASK_COMPILER |
|---|
| | 54 | elif test "$host_cpu" = "x86_64"; then |
|---|
| | 55 | if test -d /lib64 && test ! -L /lib64; then |
|---|
| | 56 | gr_libdir_suffix=64 |
|---|
| | 57 | fi |
|---|
| | 58 | else |
|---|
| | 59 | _GR_LIB64_ASK_COMPILER |
|---|
| | 60 | fi |
|---|
| | 61 | AC_MSG_RESULT([$gr_libdir_suffix]) |
|---|
| | 62 | |
|---|
| | 63 | |
|---|
| | 64 | AC_MSG_CHECKING([whether to append 64 to libdir]) |
|---|
| | 65 | t=${libdir##*/lib} |
|---|
| | 66 | if test "$t" != 64 && test "$gr_libdir_suffix" = "64"; then |
|---|
| | 67 | libdir=${libdir}64 |
|---|
| | 68 | AC_MSG_RESULT([yes. Setting libdir to $libdir]) |
|---|
| | 69 | else |
|---|
| | 70 | AC_MSG_RESULT([no]) |
|---|
| | 71 | fi |
|---|
| | 72 | ]) |
|---|
| | 73 | |
|---|
| | 74 | dnl If we're using g++, extract the first SEARCH_DIR("...") entry from the linker script |
|---|
| | 75 | dnl and see if it contains a suffix after the final .../lib part of the path. |
|---|
| | 76 | dnl (This works because the linker script varies depending on whether we're generating |
|---|
| | 77 | dnl 32-bit or 64-bit executables) |
|---|
| | 78 | dnl |
|---|
| | 79 | AC_DEFUN([_GR_LIB64_ASK_COMPILER],[ |
|---|