From: David MacKenzie Date: Tue, 19 Apr 1994 18:14:23 +0000 (+0000) Subject: Generate entries for AC_SIZEOF_TYPE automatically. X-Git-Tag: fsf-origin~692 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=dc7cdb7420cd0789ef9a42d32dc477c461241e94;p=thirdparty%2Fautoconf.git Generate entries for AC_SIZEOF_TYPE automatically. --- diff --git a/autoheader.in b/autoheader.in index 8db5a70c5..4114ce3f6 100644 --- a/autoheader.in +++ b/autoheader.in @@ -85,6 +85,9 @@ esac frob='define([AC_DEFINE],[# @@@syms="$syms $1"@@@ ])dnl +define([AC_SIZEOF_TYPE],[# +@@@types="$types,$1"@@@ +])dnl define([AC_HAVE_FUNCS],[# @@@funcs="$funcs $1"@@@ ])dnl @@ -109,11 +112,12 @@ $3 config_h=config.h syms= +types= funcs= headers= libs= -# We extract assignments of SYMS, FUNCS, HEADERS, and LIBS from the +# We extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the # modified autoconf processing of the input file. The sed hair is # necessary to win for multi-line macro invocations. eval "`echo \"$frob\" \ @@ -168,6 +172,14 @@ if test -n "$syms"; then tr @ \\012 fi +echo "$types" | tr , \\012 | sort | uniq | while read ctype; do + test -z "$ctype" && continue + sym="`echo "${ctype}" | tr '[a-z *]' '[A-Z_P]'`" + echo " +/* The number of bytes in a ${ctype}. */ +#undef SIZEOF_${sym}" +done + for func in `for x in $funcs; do echo $x; done | sort | uniq`; do sym="`echo ${func} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" echo " diff --git a/autoheader.sh b/autoheader.sh index 8db5a70c5..4114ce3f6 100644 --- a/autoheader.sh +++ b/autoheader.sh @@ -85,6 +85,9 @@ esac frob='define([AC_DEFINE],[# @@@syms="$syms $1"@@@ ])dnl +define([AC_SIZEOF_TYPE],[# +@@@types="$types,$1"@@@ +])dnl define([AC_HAVE_FUNCS],[# @@@funcs="$funcs $1"@@@ ])dnl @@ -109,11 +112,12 @@ $3 config_h=config.h syms= +types= funcs= headers= libs= -# We extract assignments of SYMS, FUNCS, HEADERS, and LIBS from the +# We extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the # modified autoconf processing of the input file. The sed hair is # necessary to win for multi-line macro invocations. eval "`echo \"$frob\" \ @@ -168,6 +172,14 @@ if test -n "$syms"; then tr @ \\012 fi +echo "$types" | tr , \\012 | sort | uniq | while read ctype; do + test -z "$ctype" && continue + sym="`echo "${ctype}" | tr '[a-z *]' '[A-Z_P]'`" + echo " +/* The number of bytes in a ${ctype}. */ +#undef SIZEOF_${sym}" +done + for func in `for x in $funcs; do echo $x; done | sort | uniq`; do sym="`echo ${func} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" echo " diff --git a/bin/autoheader.in b/bin/autoheader.in index 8db5a70c5..4114ce3f6 100644 --- a/bin/autoheader.in +++ b/bin/autoheader.in @@ -85,6 +85,9 @@ esac frob='define([AC_DEFINE],[# @@@syms="$syms $1"@@@ ])dnl +define([AC_SIZEOF_TYPE],[# +@@@types="$types,$1"@@@ +])dnl define([AC_HAVE_FUNCS],[# @@@funcs="$funcs $1"@@@ ])dnl @@ -109,11 +112,12 @@ $3 config_h=config.h syms= +types= funcs= headers= libs= -# We extract assignments of SYMS, FUNCS, HEADERS, and LIBS from the +# We extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the # modified autoconf processing of the input file. The sed hair is # necessary to win for multi-line macro invocations. eval "`echo \"$frob\" \ @@ -168,6 +172,14 @@ if test -n "$syms"; then tr @ \\012 fi +echo "$types" | tr , \\012 | sort | uniq | while read ctype; do + test -z "$ctype" && continue + sym="`echo "${ctype}" | tr '[a-z *]' '[A-Z_P]'`" + echo " +/* The number of bytes in a ${ctype}. */ +#undef SIZEOF_${sym}" +done + for func in `for x in $funcs; do echo $x; done | sort | uniq`; do sym="`echo ${func} | sed 's/[^a-zA-Z0-9_]/_/g' | tr '[a-z]' '[A-Z]'`" echo "