autoconf
[Top][All Lists]
Advanced

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

Re: AC_SEARCH_LIBS directories on 32-bit and 64-bit


From: Eric Blake
Subject: Re: AC_SEARCH_LIBS directories on 32-bit and 64-bit
Date: Mon, 18 Oct 2010 17:07:40 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.9) Gecko/20100827 Red Hat/3.1.3-1.el6 Mnenhy/0.8.3 Thunderbird/3.1.3

On 10/18/2010 04:54 PM, Sergio Belkin wrote:
Hi,

Let's say we have the check:

AC_SEARCH_LIBS([ns_get16],[resolv])

How can I do to detect library directory path based on host
architecture, I mean, I want that if is an x86_64 bit looks on
${prefix}/lib64 and if is 32-bit look on /usr/lib. I'd want to avoid
that user has to provide manually LDFLAGS. Is that possible? If I am
thinking something wrong, correct me.

Why should you want to offload the responsibility for the user setting up their system correctly in the first place? And you can't blindly assume that ${prefix}/lib64 is the correct spelling, as there are 64-bit OSs that install their libraries directly in /usr/lib. And, per the GNU Coding Standards, a user should feel free to install libraries in ~/lib (if they don't have write access to /usr) rather than /usr/local/lib (autoconf's default, good for installing optional packages above what the distro includes); as it is, libraries installed in /usr/lib64 is already a case of distros using the GCS-mandated ability to specify an alternate $prefix of /usr instead of the default /usr/local.

In my opinion, the solution to the 32- vs. 64-bit library question SHOULD be answered by the user (and not by the configure author). Obviously, this can be done by setting LDFLAGS for every configure run of every package, but that gets tiresome. But more efficiently, this can be done by installing an appropriate config.site to answer the question up front. And the manual already mentions how to do that:

http://www.gnu.org/software/autoconf/manual/autoconf.html#Site-Defaults

If a distro wants to ship 64-bit libraries in /usr/lib64, then they should also ship a config.site that automatically uses that directory any time a configure script targets ${prefix} of /usr, so that users automatically get this default without having to set LDFLAGS themselves. But that's in the realm of the distro, not of autoconf.

As a package author, you shouldn't have to care about the distro's choice of spelling for preferred library location.

--
Eric Blake   address@hidden    +1-801-349-2682
Libvirt virtualization library http://libvirt.org



reply via email to

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