Merge lp:~chasedouglas/xorg-gtest/configure-error into lp:~oif-team/xorg-gtest/trunk

Proposed by Chase Douglas
Status: Merged
Merged at revision: 4
Proposed branch: lp:~chasedouglas/xorg-gtest/configure-error
Merge into: lp:~oif-team/xorg-gtest/trunk
Diff against target: 36 lines (+12/-5)
2 files modified
configure.ac (+2/-1)
m4/gtest.m4 (+10/-4)
To merge this branch: bzr merge lp:~chasedouglas/xorg-gtest/configure-error
Reviewer Review Type Date Requested Status
Thomas Voß (community) Approve
Stephen M. Webb (community) Approve
Chase Douglas (community) Needs Resubmitting
Review via email: mp+85576@code.launchpad.net

Description of the change

Fix configure so it errors when gtest is not available. Two other minor fixes.

To post a comment you must log in.
6. By Chase Douglas

Move check result test to configure.ac and use standard variables

Revision history for this message
Stephen M. Webb (bregma) wrote :

AC_LANG_CPLUPLUS shouldn't appear in a defined macro like that. Use AC_LANG_PUSH(C++)/AC_LANG_POP instead. Just in case someone copies the .m4 file (and they're likely to at this point).

Other than that this is right.

review: Needs Fixing
7. By Chase Douglas

Link against pthread when checking for gtest library

8. By Chase Douglas

Use AC_LANG_PUSH(C++)/AC_LANG_POP so as not to contaminate configure.ac

Revision history for this message
Chase Douglas (chasedouglas) wrote :

Fixed the AC_LANG issue and hopefully fix an issue that Peter Hutterer was seeing with lpthreads not being linked in during the AC_CHECK_LIB test.

review: Needs Resubmitting
Revision history for this message
Stephen M. Webb (bregma) wrote :

Good.

review: Approve
Revision history for this message
Thomas Voß (thomas-voss) wrote :

Looks good to me.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'configure.ac'
--- configure.ac 2011-12-06 00:25:36 +0000
+++ configure.ac 2011-12-14 01:34:23 +0000
@@ -31,7 +31,8 @@
31# Check for Google Test31# Check for Google Test
32AC_CHECK_GTEST32AC_CHECK_GTEST
3333
34AM_CONDITIONAL([HAVE_GTEST], [test "x$have_gtest" = xyes])34AS_IF([test "x$ac_cv_lib_gtest_main" != xyes],
35 AC_MSG_ERROR([package 'gtest' not found]))
3536
36AC_SUBST([GTEST_LDFLAGS])37AC_SUBST([GTEST_LDFLAGS])
37AC_SUBST([GTEST_CXXFLAGS])38AC_SUBST([GTEST_CXXFLAGS])
3839
=== modified file 'm4/gtest.m4'
--- m4/gtest.m4 2011-12-05 16:27:29 +0000
+++ m4/gtest.m4 2011-12-14 01:34:23 +0000
@@ -16,9 +16,15 @@
16 [GTEST_LDFLAGS="-L$withval -lpthread"],16 [GTEST_LDFLAGS="-L$withval -lpthread"],
17 [GTEST_LDFLAGS='-lgtest -lpthread'])17 [GTEST_LDFLAGS='-lgtest -lpthread'])
1818
19 AC_HAVE_LIBRARY( [gtest], 19 AC_LANG_PUSH(C++)
20 [have_gtest=yes], 20
21 AC_MSG_WARN([package 'gtest' not found: tests disabled]))21 # We need to get to the 5th arg to link with -lpthread too. Mimic the default
2222 # AC_CHECK_LIB action when found.
23 AC_CHECK_LIB([gtest], [main],
24 [AC_DEFINE(HAVE_LIBGTEST) LIBS="-lgtest $LIBS"],
25 [],
26 [-lpthread])
27
28 AC_LANG_POP
23]) # AC_CHECK_GTEST29]) # AC_CHECK_GTEST
2430

Subscribers

People subscribed via source and target branches