]> Dogcows Code - chaz/tar/commitdiff
sh-utils-2.0f
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 22 Jan 2000 14:23:13 +0000 (14:23 +0000)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 22 Jan 2000 14:23:13 +0000 (14:23 +0000)
m4/decl.m4 [new file with mode: 0644]

diff --git a/m4/decl.m4 b/m4/decl.m4
new file mode 100644 (file)
index 0000000..76fd65f
--- /dev/null
@@ -0,0 +1,37 @@
+#serial 5
+
+AC_DEFUN(jm_CHECK_DECLARATION,
+[
+  AC_MSG_CHECKING([whether $1 is declared])
+  AC_CACHE_VAL(jm_cv_func_decl_$1,
+    [AC_TRY_COMPILE($2,
+      [
+#ifndef $1
+char *(*pfn) = (char *(*)) $1
+#endif
+      ],
+      eval "jm_cv_func_decl_$1=yes",
+      eval "jm_cv_func_decl_$1=no")])
+
+  if eval "test \"`echo '$jm_cv_func_decl_'$1`\" = yes"; then
+    AC_MSG_RESULT(yes)
+    ifelse([$3], , :, [$3])
+  else
+    AC_MSG_RESULT(no)
+    ifelse([$4], , , [$4
+])dnl
+  fi
+])dnl
+
+dnl jm_CHECK_DECLARATIONS(INCLUDES, FUNCTION... [, ACTION-IF-DECLARED
+dnl                       [, ACTION-IF-NOT-DECLARED]])
+AC_DEFUN(jm_CHECK_DECLARATIONS,
+[
+  for jm_func in $2
+  do
+    jm_CHECK_DECLARATION($jm_func, $1,
+    [
+      jm_tr_func=HAVE_DECL_`echo $jm_func | tr abcdefghijklmnopqrstuvwxyz ABCDEFGHIJKLMNOPQRSTUVWXYZ`
+      AC_DEFINE_UNQUOTED($jm_tr_func) $3], $4)dnl
+  done
+])
This page took 0.025151 seconds and 4 git commands to generate.