summaryrefslogtreecommitdiff
path: root/aclocal.m4
diff options
context:
space:
mode:
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m477
1 files changed, 77 insertions, 0 deletions
diff --git a/aclocal.m4 b/aclocal.m4
new file mode 100644
index 0000000..2adafba
--- /dev/null
+++ b/aclocal.m4
@@ -0,0 +1,77 @@
+dnl RCSid:
+dnl $Id: aclocal.m4,v 1.5 2003/03/06 21:21:30 sjg Exp $
+dnl
+
+dnl
+dnl AC_CHECK_HEADER_HAS(HEADER, PATTERN, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]))
+
+AC_DEFUN(AC_CHECK_HEADER_HAS,
+[dnl first check if header exists and if so, see if it contains PATTERN
+ac_has_hdr=`echo "ac_cv_header_$1" | sed 'y%./+-%__p_%'`
+ac_has_it=`echo "ac_cv_header_$1"_$2 | sed 'y%./+-%__p_%'`
+if eval "test \"`echo x'$'$ac_has_hdr`\" = x"; then
+ AC_CHECK_HEADER($1)
+fi
+if eval "test \"`echo '$'$ac_has_hdr`\" = yes"; then
+ ac_x=HAVE_`echo "$1" | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ AC_DEFINE_UNQUOTED($ac_x)
+ AC_MSG_CHECKING([if $1 has $2])
+ AC_CACHE_VAL($ac_has_it,
+ [eval $ac_has_it=no
+ AC_EGREP_HEADER($2, $1, eval "$ac_has_it=yes")])
+
+ if eval "test \"`echo '$'$ac_has_it`\" = yes"; then
+ AC_MSG_RESULT(yes)
+ ac_x=HAVE_`echo "$1"_$2 | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+ AC_DEFINE_UNQUOTED($ac_x)
+ ifelse([$3], , :, [$3])
+ else
+ AC_MSG_RESULT(no)
+ ifelse([$4], , , [$4
+])dnl
+ fi
+fi
+])
+
+dnl AC_EGREP(PATTERN, FILE, ACTION-IF-FOUND [,
+dnl ACTION-IF-NOT-FOUND])
+AC_DEFUN(AC_EGREP,
+[
+dnl Prevent m4 from eating character classes:
+changequote(, )dnl
+if egrep "$1" $2 >/dev/null 2>&1; then
+changequote([, ])dnl
+ ifelse([$3], , :, [$3])
+ifelse([$4], , , [else
+ $4
+])dnl
+fi
+])
+
+dnl
+dnl Test for __attribute__
+dnl
+
+AC_DEFUN(AC_C___ATTRIBUTE__, [
+AC_MSG_CHECKING(for __attribute__)
+AC_CACHE_VAL(ac_cv___attribute__, [
+AC_TRY_COMPILE([
+#include <stdlib.h>
+],
+[
+static void foo(void) __attribute__ ((noreturn));
+
+static void
+foo(void)
+{
+ exit(1);
+}
+],
+ac_cv___attribute__=yes,
+ac_cv___attribute__=no)])
+if test "$ac_cv___attribute__" = "yes"; then
+ AC_DEFINE(HAVE___ATTRIBUTE__, 1, [define if your compiler has __attribute__])
+fi
+AC_MSG_RESULT($ac_cv___attribute__)
+])
+