From bc7a99fb50e48130408d3db1119611264e693ffe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niels=20M=C3=B6ller?= <nisse@lysator.liu.se> Date: Wed, 15 Jun 2011 21:52:27 +0200 Subject: [PATCH] (libdir): On 64-bit Linux, we used to assume that libraries are installed according to the FHS. Since at least Fedora and Gentoo follow the FHS convention, while at least Debian doesn't, we have to try to figure out which convention is used. Rev: nettle/ChangeLog:1.190 Rev: nettle/configure.ac:1.33 --- ChangeLog | 7 +++++++ configure.ac | 29 +++++++++++++++++++++-------- 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 96de7028..435c8af2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2011-06-15 Niels M�ller <nisse@lysator.liu.se> + + * configure.ac (libdir): On 64-bit Linux, we used to assume that + libraries are installed according to the FHS. Since at least + Fedora and Gentoo follow the FHS convention, while at least Debian + doesn't, we have to try to figure out which convention is used. + 2011-06-14 Niels M�ller <nisse@lysator.liu.se> * x86_64/serpent-encrypt.asm: Slight simplification of loop logic. diff --git a/configure.ac b/configure.ac index e849434b..ce3b7595 100644 --- a/configure.ac +++ b/configure.ac @@ -159,13 +159,26 @@ if test "x$ABI" != xstandard ; then *:solaris*:64|*:sunos*:64) libdir='${exec_prefix}/lib/64' ;; - # According to the fhs, all architectures except IA64 - # puts 32-bit libraries in lib, and 64-bit in lib64. - *:linux*:32) - libdir='${exec_prefix}/lib' - ;; - *:linux*:64) - libdir='${exec_prefix}/lib64' + # Linux conventions are a mess... According to the Linux File + # Hierarchy Standard, all architectures except IA64 puts 32-bit + # libraries in lib, and 64-bit in lib64. Some distributions, + # e.g., Fedora and Gentoo, adhere to this standard, while at + # least Debian has decided to put 64-bit libraries in lib and + # 32-bit libraries in lib32. + + # We try to figure out the convention, except if we're cross + # compiling. We use lib${ABI} if /usr/lib${ABI} exists and + # appears to not be a symlink to a different name. + *:linux*:32|*:linux*:64) + if test "$cross_compiling" = yes ; then + AC_MSG_WARN([Cross compiling for linux. Can't guess if libraries go in lib${ABI} or lib.]); dnl ' + else + # The dash builtin pwd tries to be "helpful" and remember + # symlink names. Use /bin/pwd instead. + test -d /usr/lib${ABI} \ + && (cd /usr/lib${ABI} && /bin/pwd | grep >/dev/null "/lib${ABI}"'$') \ + && libdir='${exec_prefix}/'"lib${ABI}" + fi ;; # On freebsd, it seems 32-bit libraries are in lib32, # and 64-bit in lib. Don't know about "kfreebsd", does @@ -177,7 +190,7 @@ if test "x$ABI" != xstandard ; then libdir='${exec_prefix}/lib' ;; *) - AC_MSG_WARN([Don't know where to install $ABI-bit libraries on this system.]); #' + AC_MSG_WARN([Don't know where to install $ABI-bit libraries on this system.]); dnl ' esac AC_MSG_NOTICE([Libraries to be installed in $libdir.]) -- GitLab