[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: method for altering installation location

From: Eric Blake
Subject: Re: method for altering installation location
Date: Fri, 13 Nov 2015 12:57:06 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0

On 11/13/2015 12:11 PM, Andy Falanga (afalanga) wrote:
> How does one properly make a build system install to the 
> system-preferred locations for 64-bit binaries?  I'm wondering how to 
> properly make my build system choose "/usr/lib64" over simply "/usr/lib" 
> when configure is run.  I know this can be done simply via 
> "--prefix=/usr --libdir=lib64", and maybe this is what it should be 

Yes, that IS the preferred way (although autoconf's can make
it easier).  Your configure script should not hard code any knowledge,
rather the user of your configure script should supply their knowledge.

It's also recommended that you convince your distro to install a
/usr/share/ file, which is the easiest way to get
'./configure --prefix=/usr' to just do the right things for all the
other variables.  Fedora has already done so:

$ rpm -qf /usr/share/
$ cat /usr/share/
# This is the file to satisfy FHS defaults when installing below
# /usr.
# You may override this file by your using the CONFIG_SITE env
# variable.
# Note: This file includes also RHEL/Fedora fix for installing libraries
# "/lib/lib64" on 64bit systems.

if test -n "$host"; then
    # skip when cross-compiling
    return 0

if test "$prefix" = /usr \
   || { test "$prefix" = NONE && test "$ac_default_prefix" = /usr ; }
    test "$sysconfdir" = '${prefix}/etc' && sysconfdir=/etc
    test "$sharedstatedir" = '${prefix}/com' && sharedstatedir=/var
    test "$localstatedir" = '${prefix}/var' && localstatedir=/var

    ARCH=`uname -m`
    for i in x86_64 ppc64 s390x aarch64; do
        if test $ARCH = $i; then
            test "$libdir" = '${exec_prefix}/lib' &&

> (along with some type of bootstrap script).  I was just wondering if 
> there are already elegant/"smiled upon" methods for doing this in 
> configure (i.e.

There's nothing for you to do in (that doesn't scale -
you'd have to modify every packages' to get them to all act
the same).  Rather, the work should be done by whoever wants
installation of things into /usr to just work.

See also the autoconf manual:

Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library

Attachment: signature.asc
Description: OpenPGP digital signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]