[PATCH xorg-gtest 7/8] Install, but do not build into a library, the xorg-gtest sources

Chase Douglas chase.douglas at canonical.com
Fri Mar 9 12:45:36 PST 2012


This mimics the Google Test distribution mechanism. See:

http://code.google.com/p/googletest/wiki/FAQ#Why_is_it_not_recommended_to_install_a_pre-compiled_copy_of_Goog

Signed-off-by: Chase Douglas <chase.douglas at canonical.com>
---
 configure.ac               |   10 +++-------
 src/Makefile.am            |   41 +++++++++--------------------------------
 src/libxorg-gtest.ver      |   24 ------------------------
 src/libxorg-gtest_main.ver |    7 -------
 xorg-gtest.pc.in           |    6 ++----
 5 files changed, 14 insertions(+), 74 deletions(-)
 delete mode 100644 src/libxorg-gtest.ver
 delete mode 100644 src/libxorg-gtest_main.ver

diff --git a/configure.ac b/configure.ac
index b5fa25d..b1d7723 100644
--- a/configure.ac
+++ b/configure.ac
@@ -11,13 +11,6 @@ AC_CONFIG_MACRO_DIR([m4])
 AM_INIT_AUTOMAKE([foreign dist-bzip2])
 AM_MAINTAINER_MODE([enable])
 
-LIB_VERSION=0:0:0
-AC_SUBST([LIB_VERSION])
-
-# Initialize libtool
-AC_PROG_LIBTOOL
-
-
 # Checks for programs.
 AC_PROG_CXX
 AC_PROG_RANLIB
@@ -55,6 +48,9 @@ AS_IF([test "x$with_evemu" == xyes],
 AM_CONDITIONAL([HAVE_EVEMU], [test "x$have_evemu" = "xyes"])
 AS_IF([test "x$have_evemu" = xyes], [AC_DEFINE([HAVE_EVEMU])])
 
+AC_SUBST(SOURCEDIR, ['${prefix}/src/xorg-gtest'])
+AC_SUBST(DUMMY_CONF_PATH, ['${datarootdir}/xorg/gtest/dummy.conf'])
+
 AC_CONFIG_FILES([Makefile
                  data/Makefile
                  doc/Makefile
diff --git a/src/Makefile.am b/src/Makefile.am
index e12e772..c5a8413 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -23,39 +23,16 @@
 # SOFTWARE.
 #
 
-lib_LTLIBRARIES = libxorg-gtest.la libxorg-gtest_main.la
-
-AM_CXXFLAGS = -I$(top_srcdir)/include $(XSERVER_CFLAGS) $(BASE_CXXFLAGS)
-
-libxorg_gtest_la_SOURCES = xorg-gtest-all.cpp
-
-libxorg_gtest_la_CPPFLAGS = \
-	$(AM_CPPFLAGS) \
-	$(GTEST_CPPFLAGS) \
-	-DDUMMY_CONF_PATH="\"$(datadir)/xorg/gtest/dummy.conf\""
-
-libxorg_gtest_main_la_SOURCES = \
+libxorg_gtest_sources = \
+	environment.cpp \
+	device.cpp \
+	process.cpp \
+	test.cpp \
+	xorg-gtest-all.cpp
+
+libxorg_gtest_main_sources = \
 	defines.h \
 	xorg-gtest_main.cpp
 
-libxorg_gtest_main_la_LIBADD = libxorg-gtest.la
-
-libxorg_gtest_main_la_CPPFLAGS = \
-	$(AM_CPPFLAGS) \
-	$(GTEST_CPPFLAGS)
-
-libxorg_gtest_la_LDFLAGS = $(XSERVER_LIBS) -Wl,--version-script=$(top_srcdir)/src/libxorg-gtest.ver
-libxorg_gtest_main_la_LDFLAGS = \
-	$(XSERVER_LIBS) \
-	-Wl,--version-script=$(top_srcdir)/src/libxorg-gtest_main.ver
-
-if HAVE_EVEMU
-libxorg_gtest_la_SOURCES += device.cpp
-
-libxorg_gtest_la_LIBADD = $(EVEMU_LIBS)
-endif
-
 srcinstalldir = $(prefix)/src/xorg-gtest/src
-dist_srcinstall_DATA = $(libxorg_gtest_la_SOURCES) $(libxorg_gtest_main_la_SOURCES)
-
-EXTRA_DIST = libxorg-gtest.ver libxorg-gtest_main.ver
+dist_srcinstall_DATA = $(libxorg_gtest_sources) $(libxorg_gtest_main_sources)
diff --git a/src/libxorg-gtest.ver b/src/libxorg-gtest.ver
deleted file mode 100644
index c617446..0000000
--- a/src/libxorg-gtest.ver
+++ /dev/null
@@ -1,24 +0,0 @@
-XORG_GTEST_1.0 {
-    global:
-        extern "C++" {
-            xorg::testing::Environment::*;
-            xorg::testing::Process::*;
-            xorg::testing::Test::*;
-            "typeinfo for xorg::testing::Environment";
-            "typeinfo for xorg::testing::Test";
-            "typeinfo name for xorg::testing::Environment";
-            "typeinfo name for xorg::testing::Test";
-            "vtable for xorg::testing::Environment";
-            "vtable for xorg::testing::Test";
-        };
-
-    local:
-        *;
-};
-
-XORG_GTEST_1.1 {
-    global:
-        extern "C++" {
-            xorg::testing::evemu::*;
-        };
-} XORG_GTEST_1.0;
diff --git a/src/libxorg-gtest_main.ver b/src/libxorg-gtest_main.ver
deleted file mode 100644
index 001ce91..0000000
--- a/src/libxorg-gtest_main.ver
+++ /dev/null
@@ -1,7 +0,0 @@
-XORG_GTEST_1.0 {
-    global:
-        main;
-
-    local:
-        *;
-};
diff --git a/xorg-gtest.pc.in b/xorg-gtest.pc.in
index 7df6fbf..a80f666 100644
--- a/xorg-gtest.pc.in
+++ b/xorg-gtest.pc.in
@@ -1,11 +1,9 @@
 prefix=@prefix@
-exec_prefix=@exec_prefix@
-libdir=@libdir@
 includedir=@includedir@
+sourcedir=@SOURCEDIR@
 datarootdir=@datarootdir@
+CPPflags=-I${includedir} -I${sourcedir} -DDUMMY_CONF_PATH=\"@DUMMY_CONF_PATH@\"
 
 Name: xorg-gtest
 Description: X.org Google Test Environment
 Version: @PACKAGE_VERSION@
-Cflags: -I${includedir} -DDUMMY_CONF_PATH=@DUMMY_CONF_PATH@
-Libs: -L${libdir} -lxorg-gtest
-- 
1.7.9



More information about the xorg-devel mailing list