Change libX11 variables to not conflict with AC_PATH_XTRA
authorDan Nicholson <dbn.lists@gmail.com>
Tue, 16 Mar 2010 03:53:56 +0000 (20:53 -0700)
committerDan Nicholson <dbn.lists@gmail.com>
Tue, 20 Apr 2010 03:21:57 +0000 (20:21 -0700)
The variable X_LIBS from AC_PATH_XTRA contains only the -L searchdir
parameter and not the -lX11 to link to Xlib. Use X11 prefixed build vars
for linking with Xlib to avoid the conflict.

Signed-off-by: Dan Nicholson <dbn.lists@gmail.com>
(cherry picked from commit e725ef171b5a4d5425461f237d9ccab223806913)

configs/autoconf.in
configure.ac
progs/egl/Makefile
progs/xdemos/Makefile
src/gallium/state_trackers/glx/xlib/Makefile
src/gallium/winsys/xlib/Makefile

index f07035a0985833aa0e9e177997e68ffda32c09f4..fbd5faa5f2d44bea04b1f65337426087d5e8e619 100644 (file)
@@ -24,8 +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@
+X11_LIBS = @X11_LIBS@
+X11_CFLAGS = @X11_CFLAGS@
 
 # Assembler
 MESA_ASM_SOURCES = @MESA_ASM_SOURCES@
index 5f3d02d5671a3bf3007d707f973559177b0a7dc7..4e43683df6c635b2510d8b98ff1ddd123bdc003c 100644 (file)
@@ -548,9 +548,13 @@ else
 fi
 dnl Use the autoconf macro if no pkg-config files
 if test "$x11_pkgconfig" = yes; then
-    PKG_CHECK_MODULES([X], [x11])
+    PKG_CHECK_MODULES([X11], [x11])
 else
     AC_PATH_XTRA
+    test -z "$X11_CFLAGS" && X11_CFLAGS="$X_CFLAGS"
+    test -z "$X11_LIBS" && X11_LIBS="$X_LIBS -lX11"
+    AC_SUBST([X11_CFLAGS])
+    AC_SUBST([X11_LIBS])
 fi
 
 dnl Try to tell the user that the --x-* options are only used when
index 5f51104fed6fbc6d3bda0f8d852e260fbf49180a..8dfcb4eabcbd1c1892ce6714dd23f9ed7e388219 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 $(X_LIBS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm $(X11_LIBS)
 
 xeglthreads: xeglthreads.o $(HEADERS) $(LIB_DEP)
-       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm $(X_LIBS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm $(X11_LIBS)
 
 xegl_tri: xegl_tri.o $(HEADERS) $(LIB_DEP)
-       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm $(X_LIBS)
+       $(CC) $(CFLAGS) $(LDFLAGS) -o $@ $< $(LIBS) -lm $(X11_LIBS)
 
 clean:
        -rm -f *.o *~
index 038e21cf9ac368ed30a7948c88f66ac8dca662f0..2663015b2c7b315a266f6bf41d5038907651fb86 100644 (file)
@@ -9,7 +9,7 @@ INCDIR = $(TOP)/include
 LIB_DEP = $(TOP)/$(LIB_DIR)/$(GL_LIB_NAME)
 
 # Add X11 and pthread libs to satisfy GNU gold.
-APP_LIB_DEPS += $(X_LIBS) -lpthread
+APP_LIB_DEPS += $(X11_LIBS) -lpthread
 
 LIBS = -L$(TOP)/$(LIB_DIR) -l$(GL_LIB) $(APP_LIB_DEPS)
 
index 8c7cc524dfc393e07441b1ba2059ed5bfce12da0..b64dcbcd102fc4b00a5e25e5d024fd83d3c8c745 100644 (file)
@@ -6,7 +6,7 @@ LIBNAME = xlib
 LIBRARY_INCLUDES = \
        -I$(TOP)/include \
        -I$(TOP)/src/mesa \
-       $(X_CFLAGS)
+       $(X11_CFLAGS)
 
 C_SOURCES = \
        glx_api.c \
index 76f073e38d0ba6ecacf7f39e666e24d8233b21d3..50b00e0addfa0ce422b388afb60f7ede56c0eb50 100644 (file)
@@ -21,7 +21,7 @@ INCLUDE_DIRS = \
        -I$(TOP)/src/gallium/drivers \
        -I$(TOP)/src/gallium/state_trackers/glx/xlib \
        -I$(TOP)/src/gallium/auxiliary \
-       $(X_CFLAGS)
+       $(X11_CFLAGS)
 
 DEFINES += \
        -DGALLIUM_SOFTPIPE