[PATCH] Link libraries through LIBS instead of LD_FLAGS
Nick Fortino
nfortino at gmail.com
Sun May 3 08:52:29 UTC 2009
Follows convetion, and fixes compilation with the --as-needed flag
---
configure.ac | 24 ++++++++++++------------
1 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/configure.ac b/configure.ac
index 5c649e8..2301179 100644
--- a/configure.ac
+++ b/configure.ac
@@ -266,19 +266,19 @@ AC_CHECK_LIB([lockdev], [dev_lock],
AC_SUBST([LOCKDEV_LIBS])
AC_MSG_CHECKING([for boost::program_options::variables_map in -lboost_program_options-mt])
-saved_ldflags="${LDFLAGS}"
-LDFLAGS="${LDFLAGS} -lboost_program_options-mt"
+saved_LIBS="${LIBS}"
+LIBS="${LIBS} -lboost_program_options-mt"
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/program_options.hpp>],
[boost::program_options::variables_map::variables_map dummy()])],
[AC_MSG_RESULT([yes])
BOOST_LIBS="${BOOST_LIBS} -lboost_program_options-mt"],
[AC_MSG_RESULT([no])
AC_MSG_FAILURE([libboost_program_options (Boost C++ Libraries) is not installed, but is required by schroot])])
-LDFLAGS="${saved_ldflags}"
+LIBS="${saved_LIBS}"
AC_MSG_CHECKING([for boost::program_options::options_description::options() in -lboost_program_options-mt])
-saved_ldflags="${LDFLAGS}"
-LDFLAGS="${LDFLAGS} -lboost_program_options-mt"
+saved_LIBS="${LIBS}"
+LIBS="${LIBS} -lboost_program_options-mt"
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/program_options.hpp>],
[boost::program_options::options_description testgrp("test group");
bool notused = testgrp.options().empty();
@@ -287,33 +287,33 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/program_options.hpp>],
BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS="current"],
[AC_MSG_RESULT([no])
BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS="old"])
-LDFLAGS="${saved_ldflags}"
+LIBS="${saved_LIBS}"
AH_TEMPLATE(BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD, [Set if boost::program_options::options_description::options() is not available])
if test "$BOOST_PROGRAM_OPTIONS_DESCRIPTION_METHODS" = "old"; then
AC_DEFINE(BOOST_PROGRAM_OPTIONS_DESCRIPTION_OLD, 1)
fi
AC_MSG_CHECKING([for boost::regex in -lboost_regex-mt])
-saved_ldflags="${LDFLAGS}"
-LDFLAGS="${LDFLAGS} -lboost_regex-mt"
+saved_LIBS="${LIBS}"
+LIBS="${LIBS} -lboost_regex-mt"
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/regex.hpp>],
[boost::regex("^foo[bar]$")])],
[AC_MSG_RESULT([yes])
BOOST_LIBS="${BOOST_LIBS} -lboost_regex-mt"],
[AC_MSG_RESULT([no])
AC_MSG_FAILURE([libboost_regex (Boost C++ Libraries) is not installed, but is required by schroot])])
-LDFLAGS="${saved_ldflags}"
+LIBS="${saved_LIBS}"
AC_MSG_CHECKING([for boost::filesystem in -lboost_filesystem-mt])
-saved_ldflags="${LDFLAGS}"
-LDFLAGS="${LDFLAGS} -lboost_filesystem-mt"
+saved_LIBS="${LIBS}"
+LIBS="${LIBS} -lboost_filesystem-mt"
AC_LINK_IFELSE([AC_LANG_PROGRAM([#include <boost/filesystem.hpp>],
[boost::filesystem::is_directory("/")])],
[AC_MSG_RESULT([yes])
BOOST_FILESYSTEM_LIBS="-lboost_filesystem-mt"],
[AC_MSG_RESULT([no])
AC_MSG_FAILURE([libboost_filesystem (Boost C++ Libraries) is not installed, but is required by schroot])])
-LDFLAGS="${saved_ldflags}"
+LIBS="${saved_LIBS}"
AC_SUBST([BOOST_LIBS])
AC_SUBST([BOOST_FILESYSTEM_LIBS])
--
1.6.2.3
--------------040205090407030107020406--
------------=_1263598927-2203-0
Content-Type: message/rfc822
Content-Disposition: inline
Content-Transfer-Encoding: 7bit
Received: (at 526860-done) by bugs.debian.org; 15 Jan 2010 23:37:40 +0000
X-Spam-Checker-Version: SpamAssassin 3.2.3-bugs.debian.org_2005_01_02
(2007-08-08) on rietz.debian.org
X-Spam-Level:
X-Spam-Bayes: score:0.0000 Tokens: new, 18; hammy, 150; neutral, 52; spammy,
1. spammytokens:0.945-+--month hammytokens:0.000-+--H*u:1.5.20,
0.000-+--H*UA:1.5.20, 0.000-+--H*u:2009-06-14, 0.000-+--H*UA:2009-06-14,
0.000-+--H*c:protocol
X-Spam-Status: No, score=-11.9 required=4.0 tests=BAYES_00,FOURLA,
HAS_BUG_NUMBER,IMPRONONCABLE_2,MURPHY_DRUGS_REL8,PGPSIGNATURE,VERSION
autolearn=ham version=3.2.3-bugs.debian.org_2005_01_02
Return-path: <rleigh at codelibre.net>
Received: from nagini.codelibre.net ([80.68.93.164])
by rietz.debian.org with esmtp (Exim 4.63)
(envelope-from <rleigh at codelibre.net>)
id 1NVvjY-0008UC-6U
for 526860-done at bugs.debian.org; Fri, 15 Jan 2010 23:37:40 +0000
Received: by nagini.codelibre.net (Postfix, from userid 107)
id 9264C183B5; Fri, 15 Jan 2010 23:37:39 +0000 (GMT)
Received: from hardknott (5ad6a7a3.bb.sky.com [90.214.167.163])
by nagini.codelibre.net (Postfix) with ESMTPSA id CE4E2180EE;
Fri, 15 Jan 2010 23:37:37 +0000 (GMT)
Received: by hardknott (Postfix, from userid 1000)
id 88EA035F9; Fri, 15 Jan 2010 23:37:29 +0000 (GMT)
Date: Fri, 15 Jan 2010 23:37:29 +0000
From: Roger Leigh <rleigh at codelibre.net>
To: Nick Fortino <nfortino at gmail.com>, 526860-done at bugs.debian.org
Subject: Re: [buildd-tools-devel] Bug#526860: Bug#526860: schroot links
library dependencies through LD_FLAGS instead of LIBS
Message-ID: <20100115233728.GD15464 at codelibre.net>
References: <49FE54CD.3020809 at gmail.com>
<20090504102024.GF21332 at codelibre.net>
MIME-Version: 1.0
Content-Type: multipart/signed; micalg=pgp-ripemd160;
protocol="application/pgp-signature"; boundary="LTeJQqWS0MN7I/qa"
Content-Disposition: inline
In-Reply-To: <20090504102024.GF21332 at codelibre.net>
X-GPG-Key: 0x25BFB848
X-Debian: testing/unstable
X-OS-Uptime: 21:57:52 up 3:33, 6 users, load average: 0.01, 0.02, 0.00
User-Agent: Mutt/1.5.20 (2009-06-14)
X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.1.7
--LTeJQqWS0MN7I/qa
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
Version: 1.3.0-1
On Mon, May 04, 2009 at 11:20:24AM +0100, Roger Leigh wrote:
> tags 526860 + fixed-upstream pending
> thanks
>=20
> On Sun, May 03, 2009 at 07:37:01PM -0700, Nick Fortino wrote:
> >
> > From configure.ac, schroot links in libraries via the LD_FLAGS variable=
,=20
> > rather than the standard LIBS variable. This causes failures in the=20
> > configure stage when the --as-needed is used, as the link order is wron=
g.
>=20
> I've applied the patch, thanks.
> http://git.debian.org/?p=3Dbuildd-tools/schroot.git;a=3Dcommitdiff;h=3Daf=
486d2b89d79eb1ea81181da6a6e1281561385b
Closing by hand; this was fixed a few month back but not closed
automatically.
Regards,
Roger
--=20
.''`. Roger Leigh
: :' : Debian GNU/Linux http://people.debian.org/~rleigh/
`. `' Printing on GNU/Linux? http://gutenprint.sourceforge.net/
`- GPG Public Key: 0x25BFB848 Please GPG sign your mail.
--LTeJQqWS0MN7I/qa
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
iEYEAREDAAYFAktQ/DgACgkQVcFcaSW/uEjoWQCfabjBNSKWpQO2P0eprWgsUyxu
v/sAn1T2vrN2H7/aI6y8YrmIcOQLPv8P
=FIuF
-----END PGP SIGNATURE-----
--LTeJQqWS0MN7I/qa--
------------=_1263598927-2203-0--
More information about the Buildd-tools-devel
mailing list