Ralf Wildenhues wrote:
> You should be able to rewrite this to use shell loops for the most part;
> similar to how I started in this thread:
> http://lists.gnu.org/archive/html/autoconf-patches/2006-04/msg00161.html
> but never finished the last bits.

Actually, that's how I started doing it:

  for type in int8_t int16_t int32_t int64_t \
              uint8_t uint16_t uint32_t uint64_t \
              int_least8_t int_least16_t int_least32_t int_least64_t \
              uint_least8_t uint_least16_t uint_least32_t uint_least64_t \
              int_fast8_t int_fast16_t int_fast32_t int_fast64_t \
              uint_fast8_t uint_fast16_t uint_fast32_t uint_fast64_t \
              intptr_t uintptr_t \
              intmax_t uintmax_t ; do
    AC_MSG_CHECKING([for $type])
    AC_COMPILE_IFELSE([
      AC_LANG_PROGRAM([$other_includes
/* Test if the type exists.  */
$type x = 17;
      ])],
      result=yes, result=no)
    eval gl_cv_type_${type}=\$result
    AC_MSG_RESULT($result)
    if test $result = yes; then
      TYPE=`echo $type | sed -e y/aefilmnprstux/AEFILMNPRSTUX/`
      AC_DEFINE_UNQUOTED(HAVE_${TYPE}, 1,
        [Define to 1 if the type '$type' is already defined.])
    fi
  done

But this way, autoheader didn't recognise the AC_DEFINE_UNQUOTED
invocations, i.e. in the end, HAVE_INT8_T etc. were not present in
config.h.in.

> Without the rewrite of macros to work with shell variables, even
> Autoconf 3 won't be able to save you.

Ouch. I imagined most of the autoconf built-in macro invocations would
be transformed into a single shell function call. Is this not the plan?

Bruno


Reply via email to