apr-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "William A. Rowe, Jr." <wr...@rowe-clan.net>
Subject APR_CHECK_FILE considered harmful
Date Thu, 31 Aug 2006 22:30:14 GMT
translit() on Solaris 8 m4 1.4 et al seemed to have a bug I'm working
around, the resulting name of /dev/zero/ test was ac_cv_file__dv_zro.
Not healthy.  translit() was original not intended for the abuse that
we provided it, so I'm doing-over with sed y, and not getting far enough.
The way the code is structured, leaving it as a config-time macro is fine
but resulting in a bogus expression...

echo "$ac_t""$ac_cv_file_$apr_safe" 1>&6

checking for /dev/zero... (cached) _dev_zero

It occurs to me WHY did we use APR_CHECK_FILE() instead of AC_CHECK_FILE()?
What does it buy us?

I'd rather just chuck crufty macros rather than 'fix' them, when it's
sufficiently covered already by autoconf.

My draft fix before I gave up on fixing looked like...

 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
 apr_safe=`echo "$1" | sed 'y%./+-%__p_%'`
 AC_CACHE_CHECK([for $1], [ac_cv_file_$apr_safe], [
  if test -r $1; then
    eval "ac_cv_file_$apr_safe=yes"
  else
    eval "ac_cv_file_$apr_safe=no"
  fi])
 ])

Mime
View raw message