From mboxrd@z Thu Jan 1 00:00:00 1970 From: Roger Pau Monne Subject: Re: [PATCH 1/3] autoconf/python_dev: pass include and library dir based on prefix Date: Mon, 14 May 2012 10:51:31 +0100 Message-ID: <4FB0D5A3.9000304@citrix.com> References: <1336745632-28158-1-git-send-email-roger.pau@citrix.com> <1336745632-28158-2-git-send-email-roger.pau@citrix.com> <20397.16177.826755.879002@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <20397.16177.826755.879002@mariner.uk.xensource.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Ian Jackson Cc: "xen-devel@lists.xen.org" List-Id: xen-devel@lists.xenproject.org Ian Jackson escribi=F3: > Roger Pau Monne writes ("[Xen-devel] [PATCH 1/3] autoconf/python_dev: pas= s include and library dir based on prefix"): >> NetBSD `python-conf --ldflags` doesn't return the library dir, so we >> have to add it to LDFLAGS based on the prefix returned by `python-conf >> --prefix`. Also the include dir has been added to CFLAGS using the >> same technique. > ... >> dnl If python-config is found use it >> - CPPFLAGS=3D"$CFLAGS `$PYTHON-config --cflags`" >> - LDFLAGS=3D"$LDFLAGS `$PYTHON-config --ldflags`" >> + ac_python_prefix=3D`$PYTHON-config --prefix` >> + CPPFLAGS=3D"$CFLAGS `$PYTHON-config --cflags` -I$ac_python_prefix/i= nclude" >> + LDFLAGS=3D"$LDFLAGS `$PYTHON-config --ldflags` -L$ac_python_prefix/= lib" > > Shouldn't the -I and particulary the -L come first ? According to man ld (from Debian): "All -L options apply to all -l options, regardless of the order in = which the options appear." So it should be ok to specify -L after -l. > TBH I'm > surprised that this works since it looks like it ought to generate > -lpython2.6 -L/usr/blah/lib/bleh/python2.6 > or something, which I wouldn't expect to work. python-config --prefix on the systems I've tested (that's NetBSD and = Debian) returns the prefix path used for install, that's /usr on Debian = and /usr/pkg on NetBSD. Anyway, forget about this patch, a latter patch 3/3, fixes the library = path search, so it's just easier to pass APPEND_LIB=3D/usr/pkg/lib to = configure rather than touching the python_dev code.