summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChase Douglas <chase.douglas@canonical.com>2012-02-29 12:26:48 -0800
committerChase Douglas <chase.douglas@canonical.com>2012-03-06 09:07:46 -0800
commite888dcd08cb4b5ee332f155207a56f7098524e14 (patch)
tree16fafcb856bf52226e7e5f4ae7f5e91ef9a8cf7e
parent63a2903a15d53a19930b72ffda06b92492718e6c (diff)
Use BASE_CXXFLAGS from xorg macros
The X.org macros package version 1.16.2 is the first to define BASE_CXXFLAGS; however, we don't need to require version 1.16.2. If it's available, then great. If not, $(BASE_CXXFLAGS) will be empty and nothing terrible will happen. Included in this commit is a fix for an error, now that we are using BASE_CXXFLAGS, for shadowing variables from parent contexts. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--configure.ac11
-rw-r--r--examples/Makefile.am2
-rw-r--r--src/Makefile.am2
-rw-r--r--src/environment.cpp6
4 files changed, 12 insertions, 9 deletions
diff --git a/configure.ac b/configure.ac
index 40a0e70..e6f94df 100644
--- a/configure.ac
+++ b/configure.ac
@@ -18,16 +18,19 @@ AC_SUBST([LIB_VERSION])
# Initialize libtool
AC_PROG_LIBTOOL
+
+# Checks for programs.
+AC_PROG_CXX
+AC_PROG_INSTALL
+
+AC_LANG([C++])
+
# Require X.Org macros 1.16 or later for XORG_TESTSET_CFLAG
m4_ifndef([XORG_MACROS_VERSION],
[m4_fatal([must install xorg-macros 1.16 or later before running autoconf/autogen])])
XORG_MACROS_VERSION(1.16)
XORG_DEFAULT_OPTIONS
-# Checks for programs.
-AC_PROG_CXX
-AC_PROG_INSTALL
-
PKG_CHECK_MODULES(XSERVER, x11)
# Check for Google Test
diff --git a/examples/Makefile.am b/examples/Makefile.am
index b311687..e8f8713 100644
--- a/examples/Makefile.am
+++ b/examples/Makefile.am
@@ -29,7 +29,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 = $(XSERVER_CFLAGS) $(GTEST_CPPFLAGS) $(BASE_CXXFLAGS)
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 06a5e12..0790745 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -50,6 +50,6 @@ libxorg_gtest_main_la_LDFLAGS = \
$(XSERVER_LIBS) \
-Wl,--version-script=$(top_srcdir)/src/libxorg-gtest_main.ver
-AM_CXXFLAGS = -I$(top_srcdir)/include $(XSERVER_CFLAGS)
+AM_CXXFLAGS = -I$(top_srcdir)/include $(XSERVER_CFLAGS) $(BASE_CXXFLAGS)
EXTRA_DIST = libxorg-gtest.ver libxorg-gtest_main.ver
diff --git a/src/environment.cpp b/src/environment.cpp
index 845c1a6..3da27cb 100644
--- a/src/environment.cpp
+++ b/src/environment.cpp
@@ -113,10 +113,10 @@ void xorg::testing::Environment::SetUp() {
Process::SetEnv("DISPLAY", display_string, true);
for (int i = 0; i < 10; ++i) {
- Display* display = XOpenDisplay(NULL);
+ Display* test_display = XOpenDisplay(NULL);
- if (display) {
- XCloseDisplay(display);
+ if (test_display) {
+ XCloseDisplay(test_display);
return;
}