summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@ubuntu.com>2011-12-05 16:25:36 -0800
committerChase Douglas <chase.douglas@ubuntu.com>2011-12-05 16:25:36 -0800
commit7777cbbbd16d428d68fc738a946816edcb718654 (patch)
tree654084fa722e77229bd7b57895c8c9905d2d0cab
parentad0ef22400f1b9960e15e0f6fe39b3e95701f21e (diff)
Use installed dummy.conf location
Also, set the location in the pkg-config file so other packages can find it.
-rw-r--r--Makefile.am2
-rw-r--r--configure.ac2
-rw-r--r--src/main.cpp2
-rw-r--r--xorg-gtest.pc.in3
4 files changed, 7 insertions, 2 deletions
diff --git a/Makefile.am b/Makefile.am
index 0ca1583..bfb486c 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -12,6 +12,8 @@ library_include_HEADERS = include/xorg/gtest/environment.h
library_datadir=$(datadir)/xorg/gtest
library_data_DATA=conf/dummy.conf
+libxorg_gtest_main_la_CPPFLAGS = $(AM_CPPFLAGS) -DDUMMY_CONF_PATH="\"$(library_datadir)/dummy.conf\""
+
libxorg_gtest_la_LDFLAGS = $(X11_LIBS)
libxorg_gtest_main_la_LDFLAGS = $(X11_LIBS)
diff --git a/configure.ac b/configure.ac
index ac95718..af3bffc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -36,6 +36,8 @@ AM_CONDITIONAL([HAVE_GTEST], [test "x$have_gtest" = xyes])
AC_SUBST([GTEST_LDFLAGS])
AC_SUBST([GTEST_CXXFLAGS])
+AC_SUBST(DUMMY_CONF_PATH, "$datadir/xorg/gtest/dummy.conf")
+
AC_CONFIG_FILES([Makefile
xorg-gtest.pc])
diff --git a/src/main.cpp b/src/main.cpp
index ce16dcc..bd3b40e 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -44,7 +44,7 @@ const struct option longopts[] = {
int main(int argc, char *argv[]) {
/* Default Xorg dummy conf path. */
- std::string xorg_conf_path("x11/dummy.conf");
+ std::string xorg_conf_path(DUMMY_CONF_PATH);
/* Default X display */
int xorg_display = 133;
diff --git a/xorg-gtest.pc.in b/xorg-gtest.pc.in
index 11e144c..7df6fbf 100644
--- a/xorg-gtest.pc.in
+++ b/xorg-gtest.pc.in
@@ -2,9 +2,10 @@ prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
+datarootdir=@datarootdir@
Name: xorg-gtest
Description: X.org Google Test Environment
Version: @PACKAGE_VERSION@
-Cflags: -I${includedir}
+Cflags: -I${includedir} -DDUMMY_CONF_PATH=@DUMMY_CONF_PATH@
Libs: -L${libdir} -lxorg-gtest