source: trunk/FACT++/.macro_dir/ac_check_cpp.m4@ 13449

Last change on this file since 13449 was 11722, checked in by tbretz, 13 years ago
File size: 969 bytes
Line 
1# AC_CHECK_CPPB(LIBRARY, [PROLOGUE], [BODY], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND], [OTHER-LIBRARIES])
2#
3# AC_LANG_PUSH([C++])
4# AC_CHECK_CPP(gmock,
5# [#include ],
6# [testing::Cardinality dummy],
7# [HAVE_GMOCK=1],
8# [AC_MSG_WARN([libgmock is not installed.])
9# AC_LANG_POP([C++])
10#
11
12AC_DEFUN([AC_CHECK_CPP],
13[
14
15 m4_ifval([$4], , [AH_CHECK_LIB([$1])])
16
17 AS_LITERAL_IF([$1],
18 [AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1_$3])],
19 [AS_VAR_PUSHDEF([ac_Lib], [ac_cv_lib_$1''_$3])])
20
21 AC_CACHE_CHECK([for $3 in -l$1], [ac_Lib], [
22 ac_check_lib_save_LIBS=$LIBS
23 LIBS="-l$1 $6 $LIBS"
24 AC_LINK_IFELSE([AC_LANG_PROGRAM([$2], [$3])],
25 [AS_VAR_SET([ac_Lib], [yes])],
26 [AS_VAR_SET([ac_Lib], [no])])
27 LIBS=$ac_check_lib_save_LIBS])
28 AS_IF([test AS_VAR_GET([ac_Lib]) = yes], [
29 m4_default([$4], [
30 AC_DEFINE_UNQUOTED(AS_TR_CPP(HAVE_LIB$1))
31 LIBS="-l$1 $LIBS"
32 ])
33 ],
34 [$5])
35 AS_VAR_POPDEF([ac_Lib])
36
37])
38
Note: See TracBrowser for help on using the repository browser.