On Fri, Mar 12, 2010 at 5:25 PM, Jeff Smith <whydo...@yahoo.com> wrote:
>>From: Dan Nicholson <dbn.li...@gmail.com>
>
>>To: Brian Paul <bri...@vmware.com>
>>Cc: Jeff Smith <whydo...@yahoo.com>; David Miller <da...@davemloft.net>; 
>>"mesa3d-dev@lists.sourceforge.net" <mesa3d-dev@lists.sourceforge.net>
>>Sent: Fri, March 12, 2010 10:51:29 AM
>>Subject: Re: [Mesa3d-dev] xdemos build breakage...
>>
>>>>That's not really the right thing, though. You're assuming that I have
>>>>libX11 in the same libdir as I'm installing to and I want to use it.
>>>>The fact is that configure uses pkg-config to check for x11 and other
>>>>libraries needed to link the demos. It certainly was working before
>>>>without requiring hardcoding things into the Makefiles.
>>>
>>> Oops, I didn't see your reply, Dan.  I already committed Jeff's patch.  If 
>>> you have  better fix, please revert.
>>
>>No problem. I'll look at it a little later and see if there's more of
>>a general fix from autoconf. I imagine it's not the last time we'll
>>see build breakage in the demos.
>>
>>--
>>Dan
>
>
> Dan,
>   Can you please review this patch?  I believe it handles the case described.

Yeah, I think this is a better way to handle it. Still not 100%
foolproof, and we've still got -lpthread kludged in there, but this
should work for more people. Some comments below.

diff --git a/configs/autoconf.in b/configs/autoconf.in
index bf34f3b..66c1ee4 100644
--- a/configs/autoconf.in
+++ b/configs/autoconf.in
@@ -24,6 +24,8 @@ RADEON_CFLAGS = @RADEON_CFLAGS@
 RADEON_LDFLAGS = @RADEON_LDFLAGS@
 INTEL_LIBS = @INTEL_LIBS@
 INTEL_CFLAGS = @INTEL_CFLAGS@
+X11_LIBS = @X11_LIBS@
+X11_CFLAGS = @X11_CFLAGS@

 # Assembler
 MESA_ASM_SOURCES = @MESA_ASM_SOURCES@
diff --git a/configure.ac b/configure.ac
index c5ff8dc..ccc3107 100644
--- a/configure.ac
+++ b/configure.ac
@@ -547,8 +547,16 @@ else
     x11_pkgconfig=no
 fi
 dnl Use the autoconf macro if no pkg-config files
-if test "$x11_pkgconfig" = no; then
+if test "$x11_pkgconfig" = yes; then
+    PKG_CHECK_MODULES([X11], [x11])
+else
     AC_PATH_XTRA
+    if test -z "$X11_CFLAGS"; then
+        X11_CFLAGS="$X_CFLAGS"
+    fi
+    if test -z "$X11_LIBS"; then
+        X11_LIBS="$X_LIBS -lX11"
+    fi
 fi

If we just use X_{CFLAGS,LIBS}, then we don't have to do the dance
with X11_{CFLAGS,LIBS} and it will work for manual overrides whether
people have pkg-config or not. So, I'd suggest changing the first
argument to PKG_CHECK_MODULES to just X and using X_{CFLAGS,LIBS}
everywhere else.

--
Dan

------------------------------------------------------------------------------
Download Intel&#174; Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Mesa3d-dev mailing list
Mesa3d-dev@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mesa3d-dev

Reply via email to