[PATCH xorg-gtest 1/3] Separate XSERVER deps from X11 deps

Gaetan Nadon memsize at videotron.ca
Mon Feb 27 08:04:34 PST 2012


The previous commits fixed a compile error as there were no -I for
Xlib.h but at the same time introduced a link error for the example
subdir. The X server published C flags introduce -fvisibility=hidden.

The X server is not a build dependency for the gtest libraries, unlike
video drivers. The patch simply separates the two and now uses only
the C flags required to build the libraries. As a consequence,
XSERVER_LIBS usage is replaced as well which is a noop.

Signed-off-by: Gaetan Nadon <memsize at videotron.ca>
---
 configure.ac         |    3 ++-
 examples/Makefile.am |    2 +-
 src/Makefile.am      |    6 +++---
 3 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index da94219..807dbce 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,7 +26,8 @@ LT_INIT
 AC_PROG_CXX
 AC_PROG_INSTALL
 
-PKG_CHECK_MODULES( XSERVER, x11 [xorg-server] )
+PKG_CHECK_MODULES( GTEST_DEPS, x11 )
+PKG_CHECK_MODULES( XSERVER, [xorg-server] )
  
 # Check for Google Test
 AC_CHECK_GTEST
diff --git a/examples/Makefile.am b/examples/Makefile.am
index 7076623..13ab8ca 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -23,7 +23,7 @@ noinst_PROGRAMS = xorg-gtest-example
 xorg_gtest_example_SOURCES = xorg-gtest.cpp
 
 AM_CPPFLAGS = -I$(top_srcdir)/include
-AM_CXXFLAGS = $(XSERVER_CFLAGS) $(GTEST_CPPFLAGS)
+AM_CXXFLAGS = $(GTEST_DEPS_CFLAGS) $(GTEST_CPPFLAGS)
 
 xorg_gtest_example_LDADD = $(top_builddir)/src/libxorg-gtest.la $(top_builddir)/src/libxorg-gtest_main.la -lgtest -lpthread -lX11
 
diff --git a/src/Makefile.am b/src/Makefile.am
index 24a1b8c..2c2648a 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -28,11 +28,11 @@ libxorg_gtest_main_la_CPPFLAGS = \
 	$(AM_CPPFLAGS) \
 	$(GTEST_CPPFLAGS)
 
-libxorg_gtest_la_LDFLAGS = $(XSERVER_LIBS) -Wl,--version-script=libxorg-gtest.ver
+libxorg_gtest_la_LDFLAGS = $(GTEST_DEPS_LIBS) -Wl,--version-script=libxorg-gtest.ver
 libxorg_gtest_main_la_LDFLAGS = \
-	$(XSERVER_LIBS) \
+	$(GTEST_DEPS_LIBS) \
 	-Wl,--version-script=libxorg-gtest_main.ver
 
-AM_CXXFLAGS = -I$(top_srcdir)/include $(XSERVER_CFLAGS)
+AM_CXXFLAGS = -I$(top_srcdir)/include $(GTEST_DEPS_CFLAGS)
 
 EXTRA_DIST = libxorg-gtest.ver libxorg-gtest_main.ver
-- 
1.7.5.4



More information about the xorg-devel mailing list