3

I'm maintaining an autotools-configured project, and I've noticed in a plain autotool setup:

libtoolize --verbose --copy --force
aclocal --verbose -I m4 -Wall
autoheader -Wall --verbose
autoconf -Wall --verbose
automake --add-missing --force-missing --copy --warnings=override -Wall
./configure --prefix=/usr
make 
make install
Installing libexample.so in /usr/lib

that the make install resulting from my build (on x86_64 arch, linux) puts generated libraries in $prefix/lib.

I was expecting the library(s) to have an $LIBDIR set to $prefix/lib64.

  • Is there something I should do differently, or
  • is there a 'secret' m4 macro to automatically determine this, or
  • is the the expected behavior?
John Greene
  • 2,239
  • 3
  • 26
  • 37
  • 1
    With more recent versions of autotools, it tries to determine whether to install to `/usr/lib` or `/usr/lib64` by examining `configure`'s `--host` flag. You didn't say what version of autotools you are using. – ldav1s Oct 19 '17 at 22:45
  • By any chance, you don’t mean the —target flag? – John Greene Oct 20 '17 at 02:16
  • Autoconf 2.63 is the version in question. Automake 1.11 – John Greene Oct 20 '17 at 02:17
  • I meant `--host` @EgbertS: you are performing a [native](https://gcc.gnu.org/onlinedocs/gccint/Configure-Terms.html) build. – ldav1s Oct 22 '17 at 00:00

1 Answers1

3

I was able to reproduce this on CentOS 6.9. Unfortunately, the official Upstream Vendor response to having a reasonable config.site installed is CLOSED WONTFIX. I also was able to reproduce this on CentOS 7.4.

config.site is the usual way this works on most distros. They do provide suggestions for a workaround: Basically backport whatever Fedora's config.site does.

FWIW, the distro I'm currently using where this works does this by exporting CONFIG_SITE in /etc/profile.d/site.sh:

CONFIG_SITE="/usr/share/site/x86_64-unknown-linux-gnu"
export CONFIG_SITE

and the relevant part of /usr/share/site/x86_64-unknown-linux-gnu does something like:

 if test "$libdir" = '${exec_prefix}/lib' ; then 
       ac_config_site_64bit_host=NONE

       case "$host" in
       "" )
       ... sort through 32-bit cross-compilation ...

       *x86_64* | ... other 64-bit architectures ...)
               ac_config_site_64bit_host=YES
               ;;
       esac

       if test "x$ac_config_site_64bit_host" = xYES; then
               libdir='${exec_prefix}/lib64'
       fi
  fi

something similar could work for you.

Alternatively, you could just specify --libdir as the RPM packages apparently do.

ldav1s
  • 15,885
  • 2
  • 53
  • 56