summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWichert Akkerman <wakkerma@debian.org>2002-02-01 23:18:41 +0000
committerWichert Akkerman <wakkerma@debian.org>2002-02-01 23:18:41 +0000
commit561c6a51ae22fd7bde6af309206e292b8f22e776 (patch)
treeb030f65da9db8759c3295e8563753e9e8cfb674d
parente4e0ab15efc87e8214ee83f736c98cb23437f9b3 (diff)
downloaddpkg-561c6a51ae22fd7bde6af309206e292b8f22e776.tar.gz
Add DPKG_CHECK_DEFINE which tests for a define in an include file
-rw-r--r--automake/dpkg.m422
1 files changed, 19 insertions, 3 deletions
diff --git a/automake/dpkg.m4 b/automake/dpkg.m4
index c5f2611e4..80460c567 100644
--- a/automake/dpkg.m4
+++ b/automake/dpkg.m4
@@ -1,6 +1,3 @@
-dnl Moved from configure.in, modified to use AC_DEFUN
-dnl -- Tom Lees <tom@lpsg.demon.co.uk>
-
dnl DPKG_CACHED_TRY_COMPILE(<description>,<cachevar>,<include>,<program>,<ifyes>,<ifno>)
AC_DEFUN(DPKG_CACHED_TRY_COMPILE,[
AC_MSG_CHECKING($1)
@@ -43,3 +40,22 @@ AC_DEFUN(DPKG_C_GCC_TRY_WARNS,[
fi
])
dnl DPKG_CACHED_TRY_COMPILE(<description>,<cachevar>,<include>,<program>,<ifyes>,<ifno>)
+
+
+dnl Check if a #define is present in an include file
+AC_DEFUN(DPKG_CHECK_DEFINE,
+ [AC_CACHE_CHECK(if $1 is defined in $2,
+ ac_cv_define_$1,
+ [AC_TRY_COMPILE([
+#include <$2>
+ ],[
+int i = $1;
+ ],
+ ac_cv_define_$1=yes,
+ ac_cv_define_$1=no)
+ ])
+ if test "$ac_cv_define_$1" = yes ; then
+ AC_DEFINE(HAVE_$1,,[define if $1 is defined])
+ fi
+])
+