From 4f8bf353bd7e896268e0eb445c61270a8823892a Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Fri, 2 Apr 2010 06:33:48 -0700 Subject: gallium: Respect user's CFLAGS for including X headers This can break on systems that don't have a system X installation. Signed-off-by: Dan Nicholson (cherry picked from commit de4ee20578a79e024b0de83c40648112f42c994e) Conflicts: src/gallium/winsys/xlib/Makefile --- src/gallium/state_trackers/glx/xlib/Makefile | 3 ++- src/gallium/winsys/xlib/Makefile | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'src/gallium') diff --git a/src/gallium/state_trackers/glx/xlib/Makefile b/src/gallium/state_trackers/glx/xlib/Makefile index 7b2adc62c3..8c7cc524df 100644 --- a/src/gallium/state_trackers/glx/xlib/Makefile +++ b/src/gallium/state_trackers/glx/xlib/Makefile @@ -5,7 +5,8 @@ LIBNAME = xlib LIBRARY_INCLUDES = \ -I$(TOP)/include \ - -I$(TOP)/src/mesa + -I$(TOP)/src/mesa \ + $(X_CFLAGS) C_SOURCES = \ glx_api.c \ diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile index 824c666ae3..76f073e38d 100644 --- a/src/gallium/winsys/xlib/Makefile +++ b/src/gallium/winsys/xlib/Makefile @@ -20,7 +20,8 @@ INCLUDE_DIRS = \ -I$(TOP)/src/gallium/include \ -I$(TOP)/src/gallium/drivers \ -I$(TOP)/src/gallium/state_trackers/glx/xlib \ - -I$(TOP)/src/gallium/auxiliary + -I$(TOP)/src/gallium/auxiliary \ + $(X_CFLAGS) DEFINES += \ -DGALLIUM_SOFTPIPE -- cgit v1.2.3 From 4e7a4bed372a6da4dde8926f3bc30c56e3fbe07b Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Mon, 15 Mar 2010 20:53:56 -0700 Subject: Change libX11 variables to not conflict with AC_PATH_XTRA 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 (cherry picked from commit e725ef171b5a4d5425461f237d9ccab223806913) --- configs/autoconf.in | 4 ++-- configure.ac | 6 +++++- progs/egl/Makefile | 6 +++--- progs/xdemos/Makefile | 2 +- src/gallium/state_trackers/glx/xlib/Makefile | 2 +- src/gallium/winsys/xlib/Makefile | 2 +- 6 files changed, 13 insertions(+), 9 deletions(-) (limited to 'src/gallium') diff --git a/configs/autoconf.in b/configs/autoconf.in index f07035a098..fbd5faa5f2 100644 --- a/configs/autoconf.in +++ b/configs/autoconf.in @@ -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@ diff --git a/configure.ac b/configure.ac index 5f3d02d567..4e43683df6 100644 --- a/configure.ac +++ b/configure.ac @@ -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 diff --git a/progs/egl/Makefile b/progs/egl/Makefile index 5f51104fed..8dfcb4eabc 100644 --- a/progs/egl/Makefile +++ b/progs/egl/Makefile @@ -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 *~ diff --git a/progs/xdemos/Makefile b/progs/xdemos/Makefile index 038e21cf9a..2663015b2c 100644 --- a/progs/xdemos/Makefile +++ b/progs/xdemos/Makefile @@ -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) diff --git a/src/gallium/state_trackers/glx/xlib/Makefile b/src/gallium/state_trackers/glx/xlib/Makefile index 8c7cc524df..b64dcbcd10 100644 --- a/src/gallium/state_trackers/glx/xlib/Makefile +++ b/src/gallium/state_trackers/glx/xlib/Makefile @@ -6,7 +6,7 @@ LIBNAME = xlib LIBRARY_INCLUDES = \ -I$(TOP)/include \ -I$(TOP)/src/mesa \ - $(X_CFLAGS) + $(X11_CFLAGS) C_SOURCES = \ glx_api.c \ diff --git a/src/gallium/winsys/xlib/Makefile b/src/gallium/winsys/xlib/Makefile index 76f073e38d..50b00e0add 100644 --- a/src/gallium/winsys/xlib/Makefile +++ b/src/gallium/winsys/xlib/Makefile @@ -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 -- cgit v1.2.3 From 88be2171e7336201e5ee97ade36ba3de4fe939bf Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Sun, 18 Apr 2010 09:33:03 -0700 Subject: egl: Pass flags to locate Xlib headers and libraries eglplatform.h pulls in Xlib.h on X11 platforms. Likewise, the egl glx driver and egl programs needs to link to libX11. Make sure we use the locations the user told us about. Signed-off-by: Dan Nicholson --- progs/egl/Makefile | 2 +- src/egl/drivers/glx/Makefile | 4 ++-- src/egl/main/Makefile | 2 +- src/gallium/state_trackers/egl/Makefile | 1 + 4 files changed, 5 insertions(+), 4 deletions(-) (limited to 'src/gallium') diff --git a/progs/egl/Makefile b/progs/egl/Makefile index 8dfcb4eabc..fe490c2f8e 100644 --- a/progs/egl/Makefile +++ b/progs/egl/Makefile @@ -4,7 +4,7 @@ TOP = ../.. include $(TOP)/configs/current -INCLUDE_DIRS = -I$(TOP)/include +INCLUDE_DIRS = -I$(TOP)/include $(X11_CFLAGS) HEADERS = $(TOP)/include/GLES/egl.h LIB_DEP = $(TOP)/$(LIB_DIR)/libEGL.so diff --git a/src/egl/drivers/glx/Makefile b/src/egl/drivers/glx/Makefile index 634638f538..d976b91a74 100644 --- a/src/egl/drivers/glx/Makefile +++ b/src/egl/drivers/glx/Makefile @@ -10,7 +10,7 @@ EGL_INCLUDES = \ -I$(TOP)/include \ -I$(TOP)/src/egl/main -EGL_CFLAGS = -EGL_LIBS = -lX11 -lGL +EGL_CFLAGS = $(X11_CFLAGS) +EGL_LIBS = $(X11_LIBS) -lGL include ../Makefile.template diff --git a/src/egl/main/Makefile b/src/egl/main/Makefile index 31f214cf6f..3b4ebf7fec 100644 --- a/src/egl/main/Makefile +++ b/src/egl/main/Makefile @@ -7,7 +7,7 @@ include $(TOP)/configs/current EGL_MAJOR = 1 EGL_MINOR = 0 -INCLUDE_DIRS = -I$(TOP)/include +INCLUDE_DIRS = -I$(TOP)/include $(X11_CFLAGS) HEADERS = \ eglcompiler.h \ diff --git a/src/gallium/state_trackers/egl/Makefile b/src/gallium/state_trackers/egl/Makefile index 794785006f..1768241352 100644 --- a/src/gallium/state_trackers/egl/Makefile +++ b/src/gallium/state_trackers/egl/Makefile @@ -16,6 +16,7 @@ x11_INCLUDES = \ -I$(TOP)/src/gallium/drivers \ -I$(TOP)/src/glx \ -I$(TOP)/src/mesa \ + $(X11_CFLAGS) \ $(shell pkg-config --cflags-only-I libdrm) x11_SOURCES = $(wildcard x11/*.c) \ -- cgit v1.2.3