Use X_LIBS from pkg-config, instead of libdir, for locating libX11
authorJeff Smith <whydoubt@yahoo.com>
Sat, 13 Mar 2010 00:55:09 +0000 (18:55 -0600)
committerDan Nicholson <dbn.lists@gmail.com>
Tue, 20 Apr 2010 03:21:57 +0000 (20:21 -0700)
Signed-off-by: Jeff Smith <whydoubt@yahoo.com>
Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
(cherry picked from commit 8d86d395dcf6a5f192b6987485bb7aef49f1fefc)

configs/autoconf.in
configure.ac
progs/egl/Makefile
progs/xdemos/Makefile

index 30637877f3b37ddcd614ba496da1f689f7534c71..f07035a0985833aa0e9e177997e68ffda32c09f4 100644 (file)
@@ -24,6 +24,8 @@ RADEON_CFLAGS = @RADEON_CFLAGS@
 RADEON_LDFLAGS = @RADEON_LDFLAGS@
 INTEL_LIBS = @INTEL_LIBS@
 INTEL_CFLAGS = @INTEL_CFLAGS@
+X_LIBS = @X_LIBS@
+X_CFLAGS = @X_CFLAGS@
 
 # Assembler
 MESA_ASM_SOURCES = @MESA_ASM_SOURCES@
index 61487c3905ef61e3c014ade038c8ba0477ce28b6..5f3d02d5671a3bf3007d707f973559177b0a7dc7 100644 (file)
@@ -547,7 +547,9 @@ 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([X], [x11])
+else
     AC_PATH_XTRA
 fi
 
index 25de6e1f70387504f6c89fe4a3a74dc4029121a8..5f51104fed6fbc6d3bda0f8d852e260fbf49180a 100644 (file)
@@ -57,13 +57,13 @@ peglgears: peglgears.o $(HEADERS) $(LIB_DEP)
        $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) $(LIBDRM_LIB) -lm
 
 xeglgears: xeglgears.o $(HEADERS) $(LIB_DEP)
-       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm -L$(libdir) -lX11
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm $(X_LIBS)
 
 xeglthreads: xeglthreads.o $(HEADERS) $(LIB_DEP)
-       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm -L$(libdir) -lX11
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm $(X_LIBS)
 
 xegl_tri: xegl_tri.o $(HEADERS) $(LIB_DEP)
-       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm -L$(libdir) -lX11
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm $(X_LIBS)
 
 clean:
        -rm -f *.o *~
index d81caab4dd3d1999847f4bc47cc4960f32a33ca4..038e21cf9ac368ed30a7948c88f66ac8dca662f0 100644 (file)
@@ -9,9 +9,9 @@ INCDIR = $(TOP)/include
 LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
 
 # Add X11 and pthread libs to satisfy GNU gold.
-APP_LIB_DEPS += -lX11 -lpthread
+APP_LIB_DEPS += $(X_LIBS) -lpthread
 
-LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) -L$(libdir) $(APP_LIB_DEPS)
+LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(APP_LIB_DEPS)
 
 PROGS = \
        corender \