From: Dan N. <dbn...@gm...> - 2010-03-13 20:02:28
|
On Sat, Mar 13, 2010 at 11:18 AM, Dan Nicholson <dbn...@gm...> wrote: > On Fri, Mar 12, 2010 at 5:25 PM, Jeff Smith <why...@ya...> wrote: >>>From: Dan Nicholson <dbn...@gm...> >> >>>To: Brian Paul <br...@vm...> >>>Cc: Jeff Smith <why...@ya...>; David Miller <da...@da...>; "mes...@li..." <mes...@li...> >>>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. I went ahead and committed the patch with these changes since I needed it for something else. See 8d86d395dcf6a5f192b6987485bb7aef49f1fefc. Thanks. -- Dan |