trawick 2002/10/17 08:04:01
Modified: build apr_common.m4
Log:
This patch:
* simplifies APR_CHECK_FILE to use an m4 translit() to avoid the evals
* uses AC_DEFUN to define macros in autoconf, not define()
* drops support for the second and third arguments to the macro, since
these aren't used anywhere. (checked apr-util, httpd-2.0, SVN)
Submitted by: Joe Orton <[EMAIL PROTECTED]>
Reviewed by: Jeff Trawick
Revision Changes Path
1.44 +11 -17 apr/build/apr_common.m4
Index: apr_common.m4
===================================================================
RCS file: /home/cvs/apr/build/apr_common.m4,v
retrieving revision 1.43
retrieving revision 1.44
diff -u -r1.43 -r1.44
--- apr_common.m4 16 Oct 2002 12:49:18 -0000 1.43
+++ apr_common.m4 17 Oct 2002 15:04:00 -0000 1.44
@@ -277,23 +277,17 @@
], ac_cv_define_$1=yes, ac_cv_define_$1=no)
])
-define(APR_CHECK_FILE,[
-ac_safe=`echo "$1" | sed 'y%./+-%__p_%'`
-AC_MSG_CHECKING([for $1])
-AC_CACHE_VAL(ac_cv_file_$ac_safe, [
- if test -r $1; then
- eval "ac_cv_file_$ac_safe=yes"
- else
- eval "ac_cv_file_$ac_safe=no"
- 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 APR_CHECK_FILE(filename); set ac_cv_file_filename to
+dnl "yes" if 'filename' is readable, else "no".
+AC_DEFUN([APR_CHECK_FILE], [
+dnl Pick a safe variable name
+define([apr_cvname], ac_cv_file_[]translit([$1], [./+-], [__p_]))
+AC_CACHE_CHECK([for $1], [apr_cvname],
+[if test -r $1; then
+ apr_cvname=yes
+ else
+ apr_cvname=no
+ fi])
])
define(APR_IFALLYES,[dnl