MacPorts v1.4.0 release announcement

Vincent Lefevre vincent-opdarw at vinc17.org
Fri Apr 6 08:03:42 PDT 2007


On 2007-04-06 16:37:09 +0200, Vincent Lefevre wrote:
> On 2007-04-06 09:31:56 -0400, Daniel J. Luke wrote:
> >  On Apr 5, 2007, at 8:12 PM, Vincent Lefevre wrote:
> > > On 2007-04-05 16:49:38 -0400, Daniel J. Luke wrote:
> > >>  The problem IIRC has to do with mismatched headers and library.
> > >
> > > Yes, probably because the Makefile is incorrect.
> > 
> >  It is? Do you have a patch to fix it?
> 
> The use of -L/usr/lib is incorrect as it is not consistent with
> the include search path. For some reason, CURL_CONFIG seems to be
> set to /usr/bin/curl-config, though "which curl-config" outputs
> /opt/local/bin/curl-config (that's a bug since it can lead to
> inconsistent paths), and there's a bug in /usr/bin/curl-config
> too:
> 
> prunille:~> /usr/bin/curl-config --libs
> -L/usr/lib -lcurl -lssl -lcrypto -lz
> ^^^^^^^^^^
> This shouldn't be there.

Well, I think this is a more general problem, and pkg-config does
the right thing by providing --libs-only-l and --libs-only-other.

The rule is:

  * If you are linking with curl only, using the -L flags may be
    safe.

  * If you are linking with other libraries (e.g. readline), then
    the -L flags must not be used, because they may conflict with
    each other. The cleanest way to avoid such a conflict is to
    have a global setting, e.g. via LIBRARY_PATH and ditto for
    the include search path. So, the -L flags should be filtered
    out with sed 's/-L[^ ]*//g', and with --cflags, the -I flags
    should be filtered out with sed 's/-I[^ ]*//g'.

The attach patch fixes the problem here.

-- 
Vincent Lefèvre <vincent at vinc17.org> - Web: <http://www.vinc17.org/>
100% accessible validated (X)HTML - Blog: <http://www.vinc17.org/blog/>
Work: CR INRIA - computer arithmetic / Arenaire project (LIP, ENS-Lyon)
-------------- next part --------------
--- aclocal.m4.bak	2007-03-27 06:24:51.000000000 +0200
+++ aclocal.m4	2007-04-06 16:56:43.000000000 +0200
@@ -701,10 +701,10 @@
 		AC_MSG_ERROR([cannot find curl-config. Is libcurl installed?])
 	fi
 
-	CFLAGS_LIBCURL=$($CURL_CONFIG --cflags)
+	CFLAGS_LIBCURL=$($CURL_CONFIG --cflags | [sed 's/-I[^ ]*//g'])
 	# Due to a bug in dist, --arch flags are improperly supplied by curl-config.
 	# Get rid of them.
-	LDFLAGS_LIBCURL=$($CURL_CONFIG --libs | [sed 's/-arch [A-Za-z0-9]* //g'])
+	LDFLAGS_LIBCURL=$($CURL_CONFIG --libs | [sed 's/-arch [A-Za-z0-9]* //g; s/-L[^ ]*//g'])
 
 	AC_SUBST(CFLAGS_LIBCURL)
 	AC_SUBST(LDFLAGS_LIBCURL)


More information about the macports-users mailing list