]> git.ipfire.org Git - thirdparty/autoconf.git/commitdiff
1998-09-26 Ben Elliston <bje@cygnus.com>
authorBen Elliston <bje+keyword+gnu.7caf74@air.net.au>
Sat, 26 Sep 1998 00:41:55 +0000 (00:41 +0000)
committerBen Elliston <bje+keyword+gnu.7caf74@air.net.au>
Sat, 26 Sep 1998 00:41:55 +0000 (00:41 +0000)
* acgeneral.m4 (AC_CHECK_FILE): New macro. Checks for the
existence of a file in the file system (native only).
Contributed by Theodore Y. Ts'o <tytso@mit.edu>.
(AC_CHECK_FILES): Likewise.

ChangeLog
acgeneral.m4
lib/autoconf/general.m4

index 4c058cc581b25500f8126ec37450cf146abd0fa9..80bb1d27dc00ae26319afa79063b06070a3a5cc9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+1998-09-26  Ben Elliston  <bje@cygnus.com>
+
+       * acgeneral.m4 (AC_CHECK_FILE): New macro. Checks for the
+       existence of a file in the file system (native only).
+       Contributed by Theodore Y. Ts'o <tytso@mit.edu>.
+       (AC_CHECK_FILES): Likewise.
+
 1998-09-15  Ben Elliston  <bje@cygnus.com>
 
        * config.guess: Handle strange processor ID assignments on AIX
index 0f6ed16c5b6e6e76d0b22d52a86678c909979838..6af89acfb36424d78857907e25d04e7ce95fb6fc 100644 (file)
@@ -1766,6 +1766,48 @@ done
 ])
 
 
+dnl ### Checking for the existence of files
+
+dnl AC_CHECK_FILE(FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+AC_DEFUN(AC_CHECK_FILE,
+[AC_REQUIRE([AC_PROG_CC])
+dnl Do the transliteration at runtime so arg 1 can be a shell variable.
+ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(ac_cv_file_$ac_safe,
+[if test "$cross_compiling" = yes; then
+  errprint(__file__:__line__: warning: Cannot check for file existence when cross compiling
+)dnl
+  AC_MSG_ERROR(Cannot check for file existence when cross compiling)
+else
+  if test -r $1; then
+    eval "ac_cv_file_$ac_safe=yes"
+  else
+    eval "ac_cv_file_$ac_safe=no"
+  fi
+fi])dnl
+if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then
+  AC_MSG_RESULT(yes)
+  ifelse([$2], , :, [$2])
+else
+  AC_MSG_RESULT(no)
+ifelse([$3], , , [$3])
+fi
+])
+
+dnl AC_CHECK_FILES(FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+AC_DEFUN(AC_CHECK_FILES,
+[for ac_file in $1
+do
+AC_CHECK_FILE($ac_file,
+[changequote(, )dnl
+  ac_tr_file=HAVE`echo $ac_file | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+changequote([, ])dnl
+  AC_DEFINE_UNQUOTED($ac_tr_file) $2], $3)dnl
+done
+])
+
+
 dnl ### Checking for library functions
 
 
index 0f6ed16c5b6e6e76d0b22d52a86678c909979838..6af89acfb36424d78857907e25d04e7ce95fb6fc 100644 (file)
@@ -1766,6 +1766,48 @@ done
 ])
 
 
+dnl ### Checking for the existence of files
+
+dnl AC_CHECK_FILE(FILE, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+AC_DEFUN(AC_CHECK_FILE,
+[AC_REQUIRE([AC_PROG_CC])
+dnl Do the transliteration at runtime so arg 1 can be a shell variable.
+ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
+AC_MSG_CHECKING([for $1])
+AC_CACHE_VAL(ac_cv_file_$ac_safe,
+[if test "$cross_compiling" = yes; then
+  errprint(__file__:__line__: warning: Cannot check for file existence when cross compiling
+)dnl
+  AC_MSG_ERROR(Cannot check for file existence when cross compiling)
+else
+  if test -r $1; then
+    eval "ac_cv_file_$ac_safe=yes"
+  else
+    eval "ac_cv_file_$ac_safe=no"
+  fi
+fi])dnl
+if eval "test \"`echo '$ac_cv_file_'$ac_safe`\" = yes"; then
+  AC_MSG_RESULT(yes)
+  ifelse([$2], , :, [$2])
+else
+  AC_MSG_RESULT(no)
+ifelse([$3], , , [$3])
+fi
+])
+
+dnl AC_CHECK_FILES(FILE... [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]])
+AC_DEFUN(AC_CHECK_FILES,
+[for ac_file in $1
+do
+AC_CHECK_FILE($ac_file,
+[changequote(, )dnl
+  ac_tr_file=HAVE`echo $ac_file | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'`
+changequote([, ])dnl
+  AC_DEFINE_UNQUOTED($ac_tr_file) $2], $3)dnl
+done
+])
+
+
 dnl ### Checking for library functions