~bregma/grail/add-autopkgtest

« back to all changes in this revision

Viewing changes to m4/gtest.m4

  • Committer: Tarmac
  • Author(s): Colin Watson
  • Date: 2012-12-06 16:44:16 UTC
  • mfrom: (249.1.2 cross)
  • Revision ID: tarmac-20121206164416-fnwylojuouhrwghj
Remove _CHECK_GTEST macro, and fix CHECK_GTEST to work correctly when cross-compiling. Fixes: https://bugs.launchpad.net/bugs/1087313.

Approved by Daniel d'Andrada.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# serial 1
 
1
# serial 2
2
2
 
3
3
# Copyright (C) 2012 Canonical, Ltd.
4
4
#
40
40
 
41
41
  GTEST_CPPFLAGS="$GTEST_CPPFLAGS -I$GTEST_SOURCE"
42
42
 
43
 
  AC_CHECK_FILES([$GTEST_SOURCE/src/gtest-all.cc]
44
 
                 [$GTEST_SOURCE/src/gtest_main.cc],
45
 
                 [have_gtest=yes],
46
 
                 [have_gtest=no])
 
43
  AC_LANG_PUSH(C++)
 
44
  gtest_save_CPPFLAGS=$CPPFLAGS
 
45
  CPPFLAGS="$CPPFLAGS $GTEST_CPPFLAGS"
 
46
  AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include "src/gtest-all.cc"]])],
 
47
                    [have_gtest=yes],
 
48
                    [have_gtest=no])
 
49
  AS_IF([test "x$have_gtest" = xyes],
 
50
        [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include "src/gtest_main.cc"]])],
 
51
                           [],
 
52
                           [have_gtest=no])])
 
53
  CPPFLAGS=$gtest_save_CPPFLAGS
 
54
  AC_LANG_POP(C++)
47
55
 
48
56
  AS_IF([test "x$have_gtest" = xyes],
49
57
        [GTEST_LIBS=-lpthread