mirror of
git://git.sv.gnu.org/autoconf
synced 2025-03-19 14:40:24 +08:00
* Merged from the experimental branch.
This commit is contained in:
parent
a0e65b3fd7
commit
7e49021235
280
acconfig.h
280
acconfig.h
@ -1,280 +0,0 @@
|
||||
/* acconfig.h
|
||||
This file is in the public domain.
|
||||
|
||||
Descriptive text for the C preprocessor macros that
|
||||
the distributed Autoconf macros can define.
|
||||
No software package will use all of them; autoheader copies the ones
|
||||
your configure.in uses into your configuration header file templates.
|
||||
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). Although this order
|
||||
can split up related entries, it makes it easier to check whether
|
||||
a given entry is in the file.
|
||||
|
||||
Leave the following blank line there!! Autoheader needs it. */
|
||||
|
||||
|
||||
/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
#undef _ALL_SOURCE
|
||||
#endif
|
||||
|
||||
/* Define if using alloca.c. */
|
||||
#undef C_ALLOCA
|
||||
|
||||
/* Define if type char is unsigned and you are not using gcc. */
|
||||
#ifndef __CHAR_UNSIGNED__
|
||||
#undef __CHAR_UNSIGNED__
|
||||
#endif
|
||||
|
||||
/* Define if the closedir function returns void instead of int. */
|
||||
#undef CLOSEDIR_VOID
|
||||
|
||||
/* Define to empty if the keyword does not work. */
|
||||
#undef const
|
||||
|
||||
/* Define to empty if the volatile keyword does not work. */
|
||||
#undef volatile
|
||||
|
||||
/* Define to one of _getb67, GETB67, getb67 for Cray-2 and Cray-YMP systems.
|
||||
This function is required for alloca.c support on those systems. */
|
||||
#undef CRAY_STACKSEG_END
|
||||
|
||||
/* Define for DGUX with <sys/dg_sys_info.h>. */
|
||||
#undef DGUX
|
||||
|
||||
/* Define if you have <dirent.h>. */
|
||||
#undef DIRENT
|
||||
|
||||
/* Define to the type of elements in the array set by `getgroups'.
|
||||
Usually this is either `int' or `gid_t'. */
|
||||
#undef GETGROUPS_T
|
||||
|
||||
/* Define if the `getloadavg' function needs to be run setuid or setgid. */
|
||||
#undef GETLOADAVG_PRIVILEGED
|
||||
|
||||
/* Define if the `getpgrp' function takes no argument. */
|
||||
#undef GETPGRP_VOID
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef gid_t
|
||||
|
||||
/* Define if you have alloca, as a function or macro. */
|
||||
#undef HAVE_ALLOCA
|
||||
|
||||
/* Define if you have <alloca.h> and it should be used (not on Ultrix). */
|
||||
#undef HAVE_ALLOCA_H
|
||||
|
||||
/* Define if you don't have vprintf but do have _doprnt. */
|
||||
#undef HAVE_DOPRNT
|
||||
|
||||
/* Define if your system has a working fnmatch function. */
|
||||
#undef HAVE_FNMATCH
|
||||
|
||||
/* Define if your system has its own `getloadavg' function. */
|
||||
#undef HAVE_GETLOADAVG
|
||||
|
||||
/* Define if you have the getmntent function. */
|
||||
#undef HAVE_GETMNTENT
|
||||
|
||||
/* Define if the `long double' type works. */
|
||||
#undef HAVE_LONG_DOUBLE
|
||||
|
||||
/* Define if you support file names longer than 14 characters. */
|
||||
#undef HAVE_LONG_FILE_NAMES
|
||||
|
||||
/* Define if you have a working `mmap' system call. */
|
||||
#undef HAVE_MMAP
|
||||
|
||||
/* Define if system calls automatically restart after interruption
|
||||
by a signal. */
|
||||
#undef HAVE_RESTARTABLE_SYSCALLS
|
||||
|
||||
/* Define if your struct stat has st_blksize. */
|
||||
#undef HAVE_ST_BLKSIZE
|
||||
|
||||
/* Define if your struct stat has st_blocks. */
|
||||
#undef HAVE_ST_BLOCKS
|
||||
|
||||
/* Define if you have the strcoll function and it is properly defined. */
|
||||
#undef HAVE_STRCOLL
|
||||
|
||||
/* Define if your struct stat has st_rdev. */
|
||||
#undef HAVE_ST_RDEV
|
||||
|
||||
/* Define if you have the strftime function. */
|
||||
#undef HAVE_STRFTIME
|
||||
|
||||
/* Define if you have the ANSI # stringizing operator in cpp. */
|
||||
#undef HAVE_STRINGIZE
|
||||
|
||||
/* Define if you have <sys/wait.h> that is POSIX.1 compatible. */
|
||||
#undef HAVE_SYS_WAIT_H
|
||||
|
||||
/* Define if your struct tm has tm_zone. */
|
||||
#undef HAVE_TM_ZONE
|
||||
|
||||
/* Define if you don't have tm_zone but do have the external array
|
||||
tzname. */
|
||||
#undef HAVE_TZNAME
|
||||
|
||||
/* Define if you have <unistd.h>. */
|
||||
#undef HAVE_UNISTD_H
|
||||
|
||||
/* Define if utime(file, NULL) sets file's timestamp to the present. */
|
||||
#undef HAVE_UTIME_NULL
|
||||
|
||||
/* Define if you have <vfork.h>. */
|
||||
#undef HAVE_VFORK_H
|
||||
|
||||
/* Define if you have the vprintf function. */
|
||||
#undef HAVE_VPRINTF
|
||||
|
||||
/* Define if you have the wait3 system call. */
|
||||
#undef HAVE_WAIT3
|
||||
|
||||
/* Define as __inline if that's what the C compiler calls it. */
|
||||
#undef inline
|
||||
|
||||
/* Define if int is 16 bits instead of 32. */
|
||||
#undef INT_16_BITS
|
||||
|
||||
/* Define if long int is 64 bits. */
|
||||
#undef LONG_64_BITS
|
||||
|
||||
/* Define if major, minor, and makedev are declared in <mkdev.h>. */
|
||||
#undef MAJOR_IN_MKDEV
|
||||
|
||||
/* Define if major, minor, and makedev are declared in <sysmacros.h>. */
|
||||
#undef MAJOR_IN_SYSMACROS
|
||||
|
||||
/* Define if on MINIX. */
|
||||
#undef _MINIX
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef mode_t
|
||||
|
||||
/* Define if you don't have <dirent.h>, but have <ndir.h>. */
|
||||
#undef NDIR
|
||||
|
||||
/* Define if you have <memory.h>, and <string.h> doesn't declare the
|
||||
mem* functions. */
|
||||
#undef NEED_MEMORY_H
|
||||
|
||||
/* Define if your struct nlist has an n_un member. */
|
||||
#undef NLIST_NAME_UNION
|
||||
|
||||
/* Define if you have <nlist.h>. */
|
||||
#undef NLIST_STRUCT
|
||||
|
||||
/* Define if your C compiler doesn't accept -c and -o together. */
|
||||
#undef NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Define if your Fortran 77 compiler doesn't accept -c and -o together. */
|
||||
#undef F77_NO_MINUS_C_MINUS_O
|
||||
|
||||
/* Define to `long' if <sys/types.h> doesn't define. */
|
||||
#undef off_t
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef pid_t
|
||||
|
||||
/* Define if the system does not provide POSIX.1 features except
|
||||
with this defined. */
|
||||
#undef _POSIX_1_SOURCE
|
||||
|
||||
/* Define if you need to in order for stat and other things to work. */
|
||||
#undef _POSIX_SOURCE
|
||||
|
||||
/* Define as the return type of signal handlers (int or void). */
|
||||
#undef RETSIGTYPE
|
||||
|
||||
/* Define to the type of arg1 for select(). */
|
||||
#undef SELECT_TYPE_ARG1
|
||||
|
||||
/* Define to the type of args 2, 3 and 4 for select(). */
|
||||
#undef SELECT_TYPE_ARG234
|
||||
|
||||
/* Define to the type of arg5 for select(). */
|
||||
#undef SELECT_TYPE_ARG5
|
||||
|
||||
/* Define if the `setpgrp' function takes no argument. */
|
||||
#undef SETPGRP_VOID
|
||||
|
||||
/* Define if the setvbuf function takes the buffering type as its second
|
||||
argument and the buffer pointer as the third, as on System V
|
||||
before release 3. */
|
||||
#undef SETVBUF_REVERSED
|
||||
|
||||
/* Define to `unsigned' if <sys/types.h> doesn't define. */
|
||||
#undef size_t
|
||||
|
||||
/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown
|
||||
*/
|
||||
#undef STACK_DIRECTION
|
||||
|
||||
/* Define if the `S_IS*' macros in <sys/stat.h> do not work properly. */
|
||||
#undef STAT_MACROS_BROKEN
|
||||
|
||||
/* Define if you have the ANSI C header files. */
|
||||
#undef STDC_HEADERS
|
||||
|
||||
/* Define on System V Release 4. */
|
||||
#undef SVR4
|
||||
|
||||
/* Define if you don't have <dirent.h>, but have <sys/dir.h>. */
|
||||
#undef SYSDIR
|
||||
|
||||
/* Define if you don't have <dirent.h>, but have <sys/ndir.h>. */
|
||||
#undef SYSNDIR
|
||||
|
||||
/* Define if `sys_siglist' is declared by <signal.h>. */
|
||||
#undef SYS_SIGLIST_DECLARED
|
||||
|
||||
/* Define if you can safely include both <sys/time.h> and <time.h>. */
|
||||
#undef TIME_WITH_SYS_TIME
|
||||
|
||||
/* Define if your <sys/time.h> declares struct tm. */
|
||||
#undef TM_IN_SYS_TIME
|
||||
|
||||
/* Define to `int' if <sys/types.h> doesn't define. */
|
||||
#undef uid_t
|
||||
|
||||
/* Define for Encore UMAX. */
|
||||
#undef UMAX
|
||||
|
||||
/* Define for Encore UMAX 4.3 that has <inq_status/cpustats.h>
|
||||
instead of <sys/cpustats.h>. */
|
||||
#undef UMAX4_3
|
||||
|
||||
/* Define if you do not have <strings.h>, index, bzero, etc.. */
|
||||
#undef USG
|
||||
|
||||
/* Define vfork as fork if vfork does not work. */
|
||||
#undef vfork
|
||||
|
||||
/* Define if the closedir function returns void instead of int. */
|
||||
#undef VOID_CLOSEDIR
|
||||
|
||||
/* Define if your processor stores words with the most significant
|
||||
byte first (like Motorola and SPARC, unlike Intel and VAX). */
|
||||
#undef WORDS_BIGENDIAN
|
||||
|
||||
/* Define if the X Window System is missing or not being used. */
|
||||
#undef X_DISPLAY_MISSING
|
||||
|
||||
/* Define if lex declares yytext as a char * by default, not a char[]. */
|
||||
#undef YYTEXT_POINTER
|
||||
|
||||
|
||||
/* Leave that blank line there!! Autoheader needs it.
|
||||
If you're adding to this file, keep in mind:
|
||||
The entries are in sort -df order: alphabetical, case insensitive,
|
||||
ignoring punctuation (such as underscores). */
|
1914
acgeneral.m4
1914
acgeneral.m4
File diff suppressed because it is too large
Load Diff
1128
acspecific.m4
1128
acspecific.m4
File diff suppressed because it is too large
Load Diff
137
autoheader.in
137
autoheader.in
@ -1,6 +1,6 @@
|
||||
#! @SHELL@
|
||||
# autoheader -- create `config.h.in' from `configure.in'
|
||||
# Copyright (C) 1992, 1993, 1994, 1996, 1998 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1992, 1993, 1994, 1996, 1998, 1999 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -30,6 +30,7 @@ Create a template file of C \`#define' statements for \`configure' to
|
||||
use. To this end, scan TEMPLATE-FILE, or \`configure.in' if none
|
||||
given.
|
||||
|
||||
-d, --debug don't remove temporary files
|
||||
-m, --macrodir=DIR directory storing macro files
|
||||
-l, --localdir=DIR directory storing \`aclocal.m4' and \`acconfig.h'
|
||||
-v, --verbose verbosely report processing
|
||||
@ -56,15 +57,27 @@ case "${M4}" in
|
||||
test -f "${M4}" || M4=m4 ;;
|
||||
esac
|
||||
|
||||
# ac_LF_and_DOT
|
||||
# We use echo to avoid assuming a particular line-breaking character.
|
||||
# The extra dot is to prevent the shell from consuming trailing
|
||||
# line-breaks from the sub-command output. A line-break within
|
||||
# single-quotes doesn't work because, if this script is created in a
|
||||
# platform that uses two characters for line-breaks (e.g., DOS), tr
|
||||
# would break.
|
||||
ac_LF_and_DOT="`echo; echo .`"
|
||||
|
||||
localdir=.
|
||||
show_version=no
|
||||
debug=0
|
||||
# Basename for temporary files.
|
||||
ah_base=autoh$$
|
||||
|
||||
while test $# -gt 0 ; do
|
||||
case "${1}" in
|
||||
-h | --help | --h* )
|
||||
echo "${usage}"; exit 0 ;;
|
||||
-d | --debug | --d* )
|
||||
debug=1; shift ;;
|
||||
--localdir=* | --l*=* )
|
||||
localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
|
||||
shift ;;
|
||||
@ -101,8 +114,8 @@ if test $show_version = yes; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TEMPLATES="${AC_MACRODIR}/acconfig.h"
|
||||
test -r $localdir/acconfig.h && TEMPLATES="${TEMPLATES} $localdir/acconfig.h"
|
||||
acconfigs="${AC_MACRODIR}/acconfig.h"
|
||||
test -r $localdir/acconfig.h && acconfigs="${acconfigs} $localdir/acconfig.h"
|
||||
|
||||
case $# in
|
||||
0) infile=configure.in ;;
|
||||
@ -116,6 +129,7 @@ types=
|
||||
funcs=
|
||||
headers=
|
||||
libs=
|
||||
decls=
|
||||
|
||||
if test "$localdir" != .; then
|
||||
use_localdir="-I$localdir -DAC_LOCALDIR=$localdir"
|
||||
@ -132,19 +146,21 @@ case `$M4 --help < /dev/null 2>&1` in
|
||||
*) echo Autoconf requires GNU m4 1.1 or later >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
# Extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the
|
||||
# Extract assignments of `ah_verbatim_SYMBOL' and `syms' from the
|
||||
# modified autoconf processing of the input file. The sed hair is
|
||||
# necessary to win for multi-line macro invocations.
|
||||
eval "`$M4 -I$AC_MACRODIR $use_localdir $r autoheader.m4$f $infile |
|
||||
sed -n -e '
|
||||
: again
|
||||
/^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
|
||||
/^@@@/{
|
||||
s/^@@@//p
|
||||
n
|
||||
s/^/@@@/
|
||||
b again
|
||||
}'`"
|
||||
$M4 -I$AC_MACRODIR $use_localdir $r autoheader.m4$f $infile |
|
||||
sed -n -e '
|
||||
: again
|
||||
/^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
|
||||
/^@@@/{
|
||||
s/^@@@//p
|
||||
n
|
||||
s/^/@@@/
|
||||
b again
|
||||
}' >$ah_base.decls
|
||||
. ./$ah_base.decls
|
||||
if test $debug -eq 0; then rm ./$ah_base.decls; fi
|
||||
|
||||
# Make SYMS newline-separated rather than blank-separated, and remove dups.
|
||||
# Start each symbol with a blank (to match the blank after "#undef")
|
||||
@ -160,31 +176,27 @@ undefined) echo "error: AC_CONFIG_HEADER not found in $infile" >&2; exit 1 ;;
|
||||
*) config_h_in="${config_h}.in" ;;
|
||||
esac
|
||||
|
||||
if test $# -eq 0; then
|
||||
tmpout=autoh$$
|
||||
trap "rm -f $tmpout; exit 1" 1 2 15
|
||||
exec > $tmpout
|
||||
fi
|
||||
|
||||
tmpout=$ah_base.out
|
||||
if test $debug -eq 0; then trap "rm -f $ah_base*; exit 1" 1 2 15; fi
|
||||
# Don't write "do not edit" -- it will get copied into the
|
||||
# config.h, which it's ok to edit.
|
||||
cat <<EOF
|
||||
cat <<EOF >$tmpout
|
||||
/* ${config_h_in}. Generated automatically from $infile by autoheader. */
|
||||
EOF
|
||||
|
||||
test -r ${config_h}.top && cat ${config_h}.top
|
||||
test -r ${config_h}.top && cat ${config_h}.top >>$tmpout
|
||||
test -r $localdir/acconfig.h &&
|
||||
grep @TOP@ $localdir/acconfig.h >/dev/null &&
|
||||
sed '/@TOP@/,$d' $localdir/acconfig.h
|
||||
sed '/@TOP@/,$d' $localdir/acconfig.h >>$tmpout
|
||||
|
||||
# This puts each template paragraph on its own line, separated by @s.
|
||||
if test -n "$syms"; then
|
||||
# Make sure the boundary of template files is also the boundary
|
||||
# of the paragraph. Extra newlines don't hurt since they will
|
||||
# be removed.
|
||||
# Undocumented useless feature: stuff outside of @TOP@ and @BOTTOM@
|
||||
# Undocumented useless feature: stuff outside of @TOP@ and @BOTTOM@
|
||||
# is ignored in the systemwide acconfig.h too.
|
||||
for t in $TEMPLATES; do
|
||||
for t in $acconfigs; do
|
||||
sedscript=""
|
||||
grep @TOP@ $t >/dev/null && sedscript="1,/@TOP@/d;"
|
||||
grep @BOTTOM@ $t >/dev/null && sedscript="$sedscript /@BOTTOM@/,\$d;"
|
||||
@ -208,94 +220,55 @@ if test -n "$syms"; then
|
||||
# Some fgrep's have limits on the number of lines that can be in the
|
||||
# pattern on the command line, so use a temporary file containing the
|
||||
# pattern.
|
||||
(fgrep_tmp=${TMPDIR-/tmp}/autoh$$
|
||||
(fgrep_tmp=$ah_base.fgrep
|
||||
trap "rm -f $fgrep_tmp; exit 1" 1 2 15
|
||||
cat > $fgrep_tmp <<EOF
|
||||
$syms
|
||||
EOF
|
||||
fgrep -f $fgrep_tmp
|
||||
rm -f $fgrep_tmp) |
|
||||
tr @. "$ac_LF_and_DOT"
|
||||
# We use echo to avoid assuming a particular line-breaking character.
|
||||
# The extra dot is to prevent the shell from consuming trailing
|
||||
# line-breaks from the sub-command output. A line-break within
|
||||
# single-quotes doesn't work because, if this script is created in a
|
||||
# platform that uses two characters for line-breaks (e.g., DOS), tr
|
||||
# would break.
|
||||
tr @. "$ac_LF_and_DOT" >>$tmpout
|
||||
fi
|
||||
|
||||
echo "$types" | tr ,. "$ac_LF_and_DOT" | sort | uniq | while read ctype; do
|
||||
test -z "$ctype" && continue
|
||||
sym="`echo "${ctype}" | tr 'abcdefghijklmnopqrstuvwxyz *' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_P'`"
|
||||
echo "
|
||||
/* The number of bytes in a ${ctype}. */
|
||||
#undef SIZEOF_${sym}"
|
||||
for verb in `(set) 2>&1 | sed -n -e '/^ac_verbatim/s/^\([^=]*\)=.*$/\1/p'`; do
|
||||
echo >>$tmpout
|
||||
eval echo >>$tmpout '"${'$verb'}"'
|
||||
done
|
||||
|
||||
# /bin/sh on the Alpha gives `for' a random value if $funcs is empty.
|
||||
if test -n "$funcs"; then
|
||||
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 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
|
||||
echo "
|
||||
/* Define if you have the ${func} function. */
|
||||
#undef HAVE_${sym}"
|
||||
done
|
||||
fi
|
||||
|
||||
if test -n "$headers"; then
|
||||
for header in `for x in $headers; do echo $x; done | sort | uniq`; do
|
||||
|
||||
sym="`echo ${header} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
|
||||
echo "
|
||||
/* Define if you have the <${header}> header file. */
|
||||
#undef HAVE_${sym}"
|
||||
done
|
||||
fi
|
||||
|
||||
if test -n "$libs"; then
|
||||
for lib in `for x in $libs; do echo $x; done | sort | uniq`; do
|
||||
sym="`echo ${lib} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
|
||||
echo "
|
||||
/* Define if you have the ${lib} library (-l${lib}). */
|
||||
#undef HAVE_LIB${sym}"
|
||||
done
|
||||
fi
|
||||
|
||||
if test -n "$verbatim"; then
|
||||
echo "$verbatim"
|
||||
fi
|
||||
|
||||
# Handle the case where @BOTTOM@ is the first line of acconfig.h.
|
||||
test -r $localdir/acconfig.h &&
|
||||
grep @BOTTOM@ $localdir/acconfig.h >/dev/null &&
|
||||
sed -n '/@BOTTOM@/,${/@BOTTOM@/!p;}' $localdir/acconfig.h
|
||||
test -f ${config_h}.bot && cat ${config_h}.bot
|
||||
sed -n '/@BOTTOM@/,${/@BOTTOM@/!p;}' $localdir/acconfig.h >>$tmpout
|
||||
test -f ${config_h}.bot && cat ${config_h}.bot >>$tmpout
|
||||
|
||||
# Check that all the symbols have a template
|
||||
status=0
|
||||
|
||||
if test -n "$syms"; then
|
||||
for sym in $syms; do
|
||||
if fgrep $sym $TEMPLATES >/dev/null; then
|
||||
if grep "^#[a-z]*[ ][ ]*$sym[ ]*$" $tmpout >/dev/null; then
|
||||
: # All is well.
|
||||
else
|
||||
echo "$0: Symbol \`${sym}' is not covered by $TEMPLATES" >&2
|
||||
echo "$0: No template for symbol \`${sym}'" >&2
|
||||
status=1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
# Force $tmpout to close to avoid Windows file sharing conflicts.
|
||||
exec 1>&2
|
||||
if test $status -eq 0; then
|
||||
# If the run was successful, output the result.
|
||||
if test $status -eq 0; then
|
||||
if test $# -eq 0; then
|
||||
# Output is a file
|
||||
if test -f ${config_h_in} && cmp -s $tmpout ${config_h_in}; then
|
||||
rm -f $tmpout # File didn't change, so don't update its mod time.
|
||||
: # File didn't change, so don't update its mod time.
|
||||
else
|
||||
mv -f $tmpout ${config_h_in}
|
||||
fi
|
||||
else
|
||||
rm -f $tmpout
|
||||
# Output is stdout
|
||||
cat $tmpout
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -f $tmpout
|
||||
exit $status
|
||||
|
211
autoheader.m4
211
autoheader.m4
@ -1,6 +1,6 @@
|
||||
dnl Driver and redefinitions of some Autoconf macros for autoheader.
|
||||
dnl This file is part of Autoconf.
|
||||
dnl Copyright (C) 1994, 1995 Free Software Foundation, Inc.
|
||||
dnl Copyright (C) 1994, 1995, 1999 Free Software Foundation, Inc.
|
||||
dnl
|
||||
dnl This program is free software; you can redistribute it and/or modify
|
||||
dnl it under the terms of the GNU General Public License as published by
|
||||
@ -20,8 +20,9 @@ dnl
|
||||
dnl Written by Roland McGrath.
|
||||
dnl
|
||||
include(acgeneral.m4)dnl
|
||||
builtin(include, acspecific.m4)dnl
|
||||
builtin(include, acoldnames.m4)dnl
|
||||
m4_include(acspecific.m4)dnl
|
||||
m4_include(acoldnames.m4)dnl
|
||||
|
||||
|
||||
dnl These are alternate definitions of some macros, which produce
|
||||
dnl strings in the output marked with "@@@" so we can easily extract
|
||||
@ -30,89 +31,153 @@ dnl each definition seems to be necessary to prevent m4 from eating
|
||||
dnl the newline, which makes the @@@ not always be at the beginning of
|
||||
dnl a line.
|
||||
|
||||
define([AC_CHECK_FUNCS], [#
|
||||
@@@funcs="$funcs $1"@@@
|
||||
ifelse([$2], , , [
|
||||
# If it was found, we do:
|
||||
dnl AH_DEFINE(VARIABLE [, VALUE[, DESCRIPTION]])
|
||||
dnl --------------------------------------------
|
||||
dnl When running autoheader, this macro replaces AC_DEFINE and
|
||||
dnl AC_DEFINE_UNQUOTED.
|
||||
dnl
|
||||
dnl We remember the symbols we already defined to avoid to define
|
||||
dnl them twice. In the future we may want to use another program
|
||||
dnl than sh to issue the templates. For instance with AWK, we
|
||||
dnl may fill an associative array (key is $1, value is the template).
|
||||
dnl This garantees that there is a unique prototype issued, and also
|
||||
dnl that it will be sorted!
|
||||
define([AH_DEFINE],
|
||||
[ifset([$3],
|
||||
[AH_TEMPLATE([$1], [$3])],
|
||||
[#
|
||||
dnl Ignore CPP macro arguments.
|
||||
@@@syms="$syms patsubst($1, [(.*$])"@@@
|
||||
])])
|
||||
|
||||
dnl AH_TEMPLATE(KEY, DESCRIPTION)
|
||||
dnl Issue an autoheader template for KEY, i.e., a comment composed
|
||||
dnl of DESCRIPTION (properly wrapped), and then #undef KEY.
|
||||
define([AH_TEMPLATE],
|
||||
[AH_VERBATIM([$1],
|
||||
AC_WRAP(_AC_SH_QUOTE([[$2 */]]), [ ], [/* ])[
|
||||
#undef $1])])
|
||||
|
||||
dnl AH_VERBATIM(KEY, TEMPLATE)
|
||||
dnl --------------------------
|
||||
dnl If KEY is direct (i.e., no indirection such as in KEY=$my_func which may
|
||||
dnl occur if there is AC_CHECK_FUNCS($my_func)), issue an autoheader TEMPLATE
|
||||
dnl associated to the KEY. Otherwise, do nothing.
|
||||
dnl TEMPLATE is output as is, with no formating.
|
||||
define([AH_VERBATIM],
|
||||
[AC_VAR_IF_INDIR([$1],,
|
||||
[#
|
||||
@@@
|
||||
ac_verbatim_$1="\
|
||||
[$2]"
|
||||
@@@
|
||||
])])
|
||||
|
||||
define([AH_CHECK_LIB],
|
||||
[AH_TEMPLATE(AC_TR_CPP(HAVE_$1),
|
||||
[Define if you have the `]$1[' library (-l]$1[).])
|
||||
# Success
|
||||
$3
|
||||
# Failure
|
||||
$4])
|
||||
|
||||
define([AH_CHECK_HEADERS],
|
||||
[AC_FOREACH([AC_Header], [$1],
|
||||
[AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Header),
|
||||
[Define if you have the <]AC_Header[> header file.])
|
||||
# Success
|
||||
$2
|
||||
# If it was not found, we do:
|
||||
$3
|
||||
])
|
||||
])
|
||||
# Failure
|
||||
$3])])
|
||||
|
||||
define([AC_CHECK_HEADERS], [#
|
||||
@@@headers="$headers $1"@@@
|
||||
ifelse([$2], , , [
|
||||
# If it was found, we do:
|
||||
define([AH_NEED_DECLS],
|
||||
[AC_FOREACH([AC_Symbol], [$1],
|
||||
[AH_TEMPLATE(AC_TR_CPP(NEED_DECL_[]AC_Symbol),
|
||||
[Define if you need the declaration of `]AC_Symbol['.])
|
||||
# Success
|
||||
$2
|
||||
# If it was not found, we do:
|
||||
$3
|
||||
])
|
||||
])
|
||||
# Failure
|
||||
$3])])
|
||||
|
||||
define([AC_CHECK_HEADER], [AC_CHECK_HEADERS($1,$2,$3)])
|
||||
|
||||
define([AC_CHECK_HEADERS_DIRENT], [#
|
||||
@@@headers="$headers $1"@@@
|
||||
])
|
||||
|
||||
define([AC_CHECK_LIB], [#
|
||||
ifelse([$3], , [
|
||||
@@@libs="$libs $1"@@@
|
||||
], [
|
||||
# If it was found, we do:
|
||||
$3
|
||||
# If it was not found, we do:
|
||||
$4
|
||||
])
|
||||
])
|
||||
|
||||
define([AC_HAVE_LIBRARY], [#
|
||||
changequote(<<, >>)dnl
|
||||
define(<<AC_LIB_NAME>>, dnl
|
||||
patsubst(patsubst($1, <<lib\([^\.]*\)\.a>>, <<\1>>), <<-l>>, <<>>))dnl
|
||||
changequote([, ])dnl
|
||||
ifelse([$2], , [
|
||||
@@@libs="$libs AC_LIB_NAME"@@@
|
||||
], [
|
||||
# If it was found, we do:
|
||||
define([AH_CHECK_FUNCS],
|
||||
[AC_FOREACH([AC_Func], [$1],
|
||||
[AH_TEMPLATE(AC_TR_CPP(HAVE_[]AC_Func),
|
||||
[Define if you have the `]AC_Func[' function.])
|
||||
# Success
|
||||
$2
|
||||
# If it was not found, we do:
|
||||
$3
|
||||
])
|
||||
])
|
||||
# Failure
|
||||
$3])])
|
||||
|
||||
define([AH_CHECK_SIZEOF],
|
||||
[AH_TEMPLATE(AC_TR_CPP(SIZEOF_$1),
|
||||
[The number of bytes in a `]$1['.])])
|
||||
|
||||
define([AH_PROG_LEX],
|
||||
[AH_CHECK_LIB(fl)
|
||||
AH_CHECK_LIB(l)])
|
||||
|
||||
define([AC_FUNC_ALLOCA],
|
||||
[AH_VERBATIM([STACK_DIRECTION],
|
||||
[/* If using the C implementation of alloca, define if you know the
|
||||
direction of stack growth for your system; otherwise it will be
|
||||
automatically deduced at run-time.
|
||||
STACK_DIRECTION > 0 => grows toward higher addresses
|
||||
STACK_DIRECTION < 0 => grows toward lower addresses
|
||||
STACK_DIRECTION = 0 => direction of growth unknown */
|
||||
#undef STACK_DIRECTION
|
||||
])])
|
||||
|
||||
define([AC_C_CHAR_UNSIGNED],
|
||||
[AH_VERBATIM([__CHAR_UNSIGNED__],
|
||||
[/* Define if type `char' is unsigned and you are not using gcc. */
|
||||
#ifndef __CHAR_UNSIGNED__
|
||||
# undef __CHAR_UNSIGNED__
|
||||
#endif])])
|
||||
|
||||
define([AH_AIX],
|
||||
[AH_VERBATIM([_ALL_SOURCE],
|
||||
[/* Define if on AIX 3.
|
||||
System headers sometimes define this.
|
||||
We just want to avoid a redefinition error message. */
|
||||
#ifndef _ALL_SOURCE
|
||||
# undef _ALL_SOURCE
|
||||
#endif])])
|
||||
|
||||
|
||||
define([AH_F77_WRAPPERS],
|
||||
[AH_TEMPLATE([F77_FUNC],
|
||||
[Define to a macro that performs the appropriate name
|
||||
mangling on its argument to make the C identifier, which
|
||||
*does not* contain underscores, match the name mangling
|
||||
scheme of the Fortran 77 compiler.])
|
||||
AH_TEMPLATE([F77_FUNC_],
|
||||
[Define to a macro that performs the appropriate name
|
||||
mangling on its argument to make the C identifier, which
|
||||
*does* contain underscores, match the name mangling
|
||||
scheme of the Fortran 77 compiler.])])
|
||||
|
||||
define([AC_CHECK_SIZEOF], [#
|
||||
@@@types="$types,$1"@@@
|
||||
])
|
||||
|
||||
define([AC_CONFIG_HEADER], [#
|
||||
define([AC_CONFIG_H], patsubst($1, [ .*$], []))dnl
|
||||
@@@config_h=AC_CONFIG_H@@@
|
||||
])
|
||||
|
||||
define([AC_DEFINE], [#
|
||||
ifelse([$3],,[#
|
||||
@@@syms="$syms $1"@@@
|
||||
], [#
|
||||
@@@verbatim="$verbatim
|
||||
/* $3 */
|
||||
#undef $1
|
||||
"@@@
|
||||
])])
|
||||
|
||||
define([AC_DEFINE_UNQUOTED], [#
|
||||
ifelse([$3],,[#
|
||||
@@@syms="$syms $1"@@@
|
||||
], [#
|
||||
@@@verbatim="$verbatim
|
||||
/* $3 */
|
||||
#undef $1
|
||||
"@@@
|
||||
])])
|
||||
|
||||
dnl Autoheader is not the right program to complain about cross-compiling
|
||||
dnl Autoheader is not the right program to complain about cross-compiling.
|
||||
define([AC_TRY_RUN], [
|
||||
$2
|
||||
$3
|
||||
$4])
|
||||
|
||||
define([AC_DEFINE], [AH_DEFINE($@)])
|
||||
define([AC_DEFINE_UNQUOTED], [AH_DEFINE($@)])
|
||||
define([AC_NEED_DECLS], [AH_NEED_DECLS($@)])
|
||||
define([AC_CHECK_SIZEOF], [AH_CHECK_SIZEOF($@)])
|
||||
define([AC_CHECK_FUNCS], [AH_CHECK_FUNCS($@)])
|
||||
define([AC_CHECK_HEADERS], [AH_CHECK_HEADERS($@)])
|
||||
define([AC_CHECK_HEADERS_DIRENT], [AH_CHECK_HEADERS($@)])
|
||||
define([AC_CHECK_LIB], [AH_CHECK_LIB($@)])
|
||||
define([AC_PROG_LEX], [AH_PROG_LEX($@)])
|
||||
define([AC_FUNC_ALLOCA], [AH_FUNC_ALLOCA($@)])
|
||||
define([AC_C_CHAR_UNSIGNED], [AH_C_CHAR_UNSIGNED($@)])
|
||||
define([AC_AIX], [AH_AIX($@)])
|
||||
define([AC_F77_WRAPPERS], [AH_F77_WRAPPERS($@)])
|
||||
|
137
autoheader.sh
137
autoheader.sh
@ -1,6 +1,6 @@
|
||||
#! @SHELL@
|
||||
# autoheader -- create `config.h.in' from `configure.in'
|
||||
# Copyright (C) 1992, 1993, 1994, 1996, 1998 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1992, 1993, 1994, 1996, 1998, 1999 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -30,6 +30,7 @@ Create a template file of C \`#define' statements for \`configure' to
|
||||
use. To this end, scan TEMPLATE-FILE, or \`configure.in' if none
|
||||
given.
|
||||
|
||||
-d, --debug don't remove temporary files
|
||||
-m, --macrodir=DIR directory storing macro files
|
||||
-l, --localdir=DIR directory storing \`aclocal.m4' and \`acconfig.h'
|
||||
-v, --verbose verbosely report processing
|
||||
@ -56,15 +57,27 @@ case "${M4}" in
|
||||
test -f "${M4}" || M4=m4 ;;
|
||||
esac
|
||||
|
||||
# ac_LF_and_DOT
|
||||
# We use echo to avoid assuming a particular line-breaking character.
|
||||
# The extra dot is to prevent the shell from consuming trailing
|
||||
# line-breaks from the sub-command output. A line-break within
|
||||
# single-quotes doesn't work because, if this script is created in a
|
||||
# platform that uses two characters for line-breaks (e.g., DOS), tr
|
||||
# would break.
|
||||
ac_LF_and_DOT="`echo; echo .`"
|
||||
|
||||
localdir=.
|
||||
show_version=no
|
||||
debug=0
|
||||
# Basename for temporary files.
|
||||
ah_base=autoh$$
|
||||
|
||||
while test $# -gt 0 ; do
|
||||
case "${1}" in
|
||||
-h | --help | --h* )
|
||||
echo "${usage}"; exit 0 ;;
|
||||
-d | --debug | --d* )
|
||||
debug=1; shift ;;
|
||||
--localdir=* | --l*=* )
|
||||
localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
|
||||
shift ;;
|
||||
@ -101,8 +114,8 @@ if test $show_version = yes; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TEMPLATES="${AC_MACRODIR}/acconfig.h"
|
||||
test -r $localdir/acconfig.h && TEMPLATES="${TEMPLATES} $localdir/acconfig.h"
|
||||
acconfigs="${AC_MACRODIR}/acconfig.h"
|
||||
test -r $localdir/acconfig.h && acconfigs="${acconfigs} $localdir/acconfig.h"
|
||||
|
||||
case $# in
|
||||
0) infile=configure.in ;;
|
||||
@ -116,6 +129,7 @@ types=
|
||||
funcs=
|
||||
headers=
|
||||
libs=
|
||||
decls=
|
||||
|
||||
if test "$localdir" != .; then
|
||||
use_localdir="-I$localdir -DAC_LOCALDIR=$localdir"
|
||||
@ -132,19 +146,21 @@ case `$M4 --help < /dev/null 2>&1` in
|
||||
*) echo Autoconf requires GNU m4 1.1 or later >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
# Extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the
|
||||
# Extract assignments of `ah_verbatim_SYMBOL' and `syms' from the
|
||||
# modified autoconf processing of the input file. The sed hair is
|
||||
# necessary to win for multi-line macro invocations.
|
||||
eval "`$M4 -I$AC_MACRODIR $use_localdir $r autoheader.m4$f $infile |
|
||||
sed -n -e '
|
||||
: again
|
||||
/^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
|
||||
/^@@@/{
|
||||
s/^@@@//p
|
||||
n
|
||||
s/^/@@@/
|
||||
b again
|
||||
}'`"
|
||||
$M4 -I$AC_MACRODIR $use_localdir $r autoheader.m4$f $infile |
|
||||
sed -n -e '
|
||||
: again
|
||||
/^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
|
||||
/^@@@/{
|
||||
s/^@@@//p
|
||||
n
|
||||
s/^/@@@/
|
||||
b again
|
||||
}' >$ah_base.decls
|
||||
. ./$ah_base.decls
|
||||
if test $debug -eq 0; then rm ./$ah_base.decls; fi
|
||||
|
||||
# Make SYMS newline-separated rather than blank-separated, and remove dups.
|
||||
# Start each symbol with a blank (to match the blank after "#undef")
|
||||
@ -160,31 +176,27 @@ undefined) echo "error: AC_CONFIG_HEADER not found in $infile" >&2; exit 1 ;;
|
||||
*) config_h_in="${config_h}.in" ;;
|
||||
esac
|
||||
|
||||
if test $# -eq 0; then
|
||||
tmpout=autoh$$
|
||||
trap "rm -f $tmpout; exit 1" 1 2 15
|
||||
exec > $tmpout
|
||||
fi
|
||||
|
||||
tmpout=$ah_base.out
|
||||
if test $debug -eq 0; then trap "rm -f $ah_base*; exit 1" 1 2 15; fi
|
||||
# Don't write "do not edit" -- it will get copied into the
|
||||
# config.h, which it's ok to edit.
|
||||
cat <<EOF
|
||||
cat <<EOF >$tmpout
|
||||
/* ${config_h_in}. Generated automatically from $infile by autoheader. */
|
||||
EOF
|
||||
|
||||
test -r ${config_h}.top && cat ${config_h}.top
|
||||
test -r ${config_h}.top && cat ${config_h}.top >>$tmpout
|
||||
test -r $localdir/acconfig.h &&
|
||||
grep @TOP@ $localdir/acconfig.h >/dev/null &&
|
||||
sed '/@TOP@/,$d' $localdir/acconfig.h
|
||||
sed '/@TOP@/,$d' $localdir/acconfig.h >>$tmpout
|
||||
|
||||
# This puts each template paragraph on its own line, separated by @s.
|
||||
if test -n "$syms"; then
|
||||
# Make sure the boundary of template files is also the boundary
|
||||
# of the paragraph. Extra newlines don't hurt since they will
|
||||
# be removed.
|
||||
# Undocumented useless feature: stuff outside of @TOP@ and @BOTTOM@
|
||||
# Undocumented useless feature: stuff outside of @TOP@ and @BOTTOM@
|
||||
# is ignored in the systemwide acconfig.h too.
|
||||
for t in $TEMPLATES; do
|
||||
for t in $acconfigs; do
|
||||
sedscript=""
|
||||
grep @TOP@ $t >/dev/null && sedscript="1,/@TOP@/d;"
|
||||
grep @BOTTOM@ $t >/dev/null && sedscript="$sedscript /@BOTTOM@/,\$d;"
|
||||
@ -208,94 +220,55 @@ if test -n "$syms"; then
|
||||
# Some fgrep's have limits on the number of lines that can be in the
|
||||
# pattern on the command line, so use a temporary file containing the
|
||||
# pattern.
|
||||
(fgrep_tmp=${TMPDIR-/tmp}/autoh$$
|
||||
(fgrep_tmp=$ah_base.fgrep
|
||||
trap "rm -f $fgrep_tmp; exit 1" 1 2 15
|
||||
cat > $fgrep_tmp <<EOF
|
||||
$syms
|
||||
EOF
|
||||
fgrep -f $fgrep_tmp
|
||||
rm -f $fgrep_tmp) |
|
||||
tr @. "$ac_LF_and_DOT"
|
||||
# We use echo to avoid assuming a particular line-breaking character.
|
||||
# The extra dot is to prevent the shell from consuming trailing
|
||||
# line-breaks from the sub-command output. A line-break within
|
||||
# single-quotes doesn't work because, if this script is created in a
|
||||
# platform that uses two characters for line-breaks (e.g., DOS), tr
|
||||
# would break.
|
||||
tr @. "$ac_LF_and_DOT" >>$tmpout
|
||||
fi
|
||||
|
||||
echo "$types" | tr ,. "$ac_LF_and_DOT" | sort | uniq | while read ctype; do
|
||||
test -z "$ctype" && continue
|
||||
sym="`echo "${ctype}" | tr 'abcdefghijklmnopqrstuvwxyz *' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_P'`"
|
||||
echo "
|
||||
/* The number of bytes in a ${ctype}. */
|
||||
#undef SIZEOF_${sym}"
|
||||
for verb in `(set) 2>&1 | sed -n -e '/^ac_verbatim/s/^\([^=]*\)=.*$/\1/p'`; do
|
||||
echo >>$tmpout
|
||||
eval echo >>$tmpout '"${'$verb'}"'
|
||||
done
|
||||
|
||||
# /bin/sh on the Alpha gives `for' a random value if $funcs is empty.
|
||||
if test -n "$funcs"; then
|
||||
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 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
|
||||
echo "
|
||||
/* Define if you have the ${func} function. */
|
||||
#undef HAVE_${sym}"
|
||||
done
|
||||
fi
|
||||
|
||||
if test -n "$headers"; then
|
||||
for header in `for x in $headers; do echo $x; done | sort | uniq`; do
|
||||
|
||||
sym="`echo ${header} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
|
||||
echo "
|
||||
/* Define if you have the <${header}> header file. */
|
||||
#undef HAVE_${sym}"
|
||||
done
|
||||
fi
|
||||
|
||||
if test -n "$libs"; then
|
||||
for lib in `for x in $libs; do echo $x; done | sort | uniq`; do
|
||||
sym="`echo ${lib} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
|
||||
echo "
|
||||
/* Define if you have the ${lib} library (-l${lib}). */
|
||||
#undef HAVE_LIB${sym}"
|
||||
done
|
||||
fi
|
||||
|
||||
if test -n "$verbatim"; then
|
||||
echo "$verbatim"
|
||||
fi
|
||||
|
||||
# Handle the case where @BOTTOM@ is the first line of acconfig.h.
|
||||
test -r $localdir/acconfig.h &&
|
||||
grep @BOTTOM@ $localdir/acconfig.h >/dev/null &&
|
||||
sed -n '/@BOTTOM@/,${/@BOTTOM@/!p;}' $localdir/acconfig.h
|
||||
test -f ${config_h}.bot && cat ${config_h}.bot
|
||||
sed -n '/@BOTTOM@/,${/@BOTTOM@/!p;}' $localdir/acconfig.h >>$tmpout
|
||||
test -f ${config_h}.bot && cat ${config_h}.bot >>$tmpout
|
||||
|
||||
# Check that all the symbols have a template
|
||||
status=0
|
||||
|
||||
if test -n "$syms"; then
|
||||
for sym in $syms; do
|
||||
if fgrep $sym $TEMPLATES >/dev/null; then
|
||||
if grep "^#[a-z]*[ ][ ]*$sym[ ]*$" $tmpout >/dev/null; then
|
||||
: # All is well.
|
||||
else
|
||||
echo "$0: Symbol \`${sym}' is not covered by $TEMPLATES" >&2
|
||||
echo "$0: No template for symbol \`${sym}'" >&2
|
||||
status=1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
# Force $tmpout to close to avoid Windows file sharing conflicts.
|
||||
exec 1>&2
|
||||
if test $status -eq 0; then
|
||||
# If the run was successful, output the result.
|
||||
if test $status -eq 0; then
|
||||
if test $# -eq 0; then
|
||||
# Output is a file
|
||||
if test -f ${config_h_in} && cmp -s $tmpout ${config_h_in}; then
|
||||
rm -f $tmpout # File didn't change, so don't update its mod time.
|
||||
: # File didn't change, so don't update its mod time.
|
||||
else
|
||||
mv -f $tmpout ${config_h_in}
|
||||
fi
|
||||
else
|
||||
rm -f $tmpout
|
||||
# Output is stdout
|
||||
cat $tmpout
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -f $tmpout
|
||||
exit $status
|
||||
|
@ -1,6 +1,6 @@
|
||||
#! @SHELL@
|
||||
# autoheader -- create `config.h.in' from `configure.in'
|
||||
# Copyright (C) 1992, 1993, 1994, 1996, 1998 Free Software Foundation, Inc.
|
||||
# Copyright (C) 1992, 1993, 1994, 1996, 1998, 1999 Free Software Foundation, Inc.
|
||||
|
||||
# This program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -30,6 +30,7 @@ Create a template file of C \`#define' statements for \`configure' to
|
||||
use. To this end, scan TEMPLATE-FILE, or \`configure.in' if none
|
||||
given.
|
||||
|
||||
-d, --debug don't remove temporary files
|
||||
-m, --macrodir=DIR directory storing macro files
|
||||
-l, --localdir=DIR directory storing \`aclocal.m4' and \`acconfig.h'
|
||||
-v, --verbose verbosely report processing
|
||||
@ -56,15 +57,27 @@ case "${M4}" in
|
||||
test -f "${M4}" || M4=m4 ;;
|
||||
esac
|
||||
|
||||
# ac_LF_and_DOT
|
||||
# We use echo to avoid assuming a particular line-breaking character.
|
||||
# The extra dot is to prevent the shell from consuming trailing
|
||||
# line-breaks from the sub-command output. A line-break within
|
||||
# single-quotes doesn't work because, if this script is created in a
|
||||
# platform that uses two characters for line-breaks (e.g., DOS), tr
|
||||
# would break.
|
||||
ac_LF_and_DOT="`echo; echo .`"
|
||||
|
||||
localdir=.
|
||||
show_version=no
|
||||
debug=0
|
||||
# Basename for temporary files.
|
||||
ah_base=autoh$$
|
||||
|
||||
while test $# -gt 0 ; do
|
||||
case "${1}" in
|
||||
-h | --help | --h* )
|
||||
echo "${usage}"; exit 0 ;;
|
||||
-d | --debug | --d* )
|
||||
debug=1; shift ;;
|
||||
--localdir=* | --l*=* )
|
||||
localdir="`echo \"${1}\" | sed -e 's/^[^=]*=//'`"
|
||||
shift ;;
|
||||
@ -101,8 +114,8 @@ if test $show_version = yes; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
TEMPLATES="${AC_MACRODIR}/acconfig.h"
|
||||
test -r $localdir/acconfig.h && TEMPLATES="${TEMPLATES} $localdir/acconfig.h"
|
||||
acconfigs="${AC_MACRODIR}/acconfig.h"
|
||||
test -r $localdir/acconfig.h && acconfigs="${acconfigs} $localdir/acconfig.h"
|
||||
|
||||
case $# in
|
||||
0) infile=configure.in ;;
|
||||
@ -116,6 +129,7 @@ types=
|
||||
funcs=
|
||||
headers=
|
||||
libs=
|
||||
decls=
|
||||
|
||||
if test "$localdir" != .; then
|
||||
use_localdir="-I$localdir -DAC_LOCALDIR=$localdir"
|
||||
@ -132,19 +146,21 @@ case `$M4 --help < /dev/null 2>&1` in
|
||||
*) echo Autoconf requires GNU m4 1.1 or later >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
# Extract assignments of SYMS, TYPES, FUNCS, HEADERS, and LIBS from the
|
||||
# Extract assignments of `ah_verbatim_SYMBOL' and `syms' from the
|
||||
# modified autoconf processing of the input file. The sed hair is
|
||||
# necessary to win for multi-line macro invocations.
|
||||
eval "`$M4 -I$AC_MACRODIR $use_localdir $r autoheader.m4$f $infile |
|
||||
sed -n -e '
|
||||
: again
|
||||
/^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
|
||||
/^@@@/{
|
||||
s/^@@@//p
|
||||
n
|
||||
s/^/@@@/
|
||||
b again
|
||||
}'`"
|
||||
$M4 -I$AC_MACRODIR $use_localdir $r autoheader.m4$f $infile |
|
||||
sed -n -e '
|
||||
: again
|
||||
/^@@@.*@@@$/s/^@@@\(.*\)@@@$/\1/p
|
||||
/^@@@/{
|
||||
s/^@@@//p
|
||||
n
|
||||
s/^/@@@/
|
||||
b again
|
||||
}' >$ah_base.decls
|
||||
. ./$ah_base.decls
|
||||
if test $debug -eq 0; then rm ./$ah_base.decls; fi
|
||||
|
||||
# Make SYMS newline-separated rather than blank-separated, and remove dups.
|
||||
# Start each symbol with a blank (to match the blank after "#undef")
|
||||
@ -160,31 +176,27 @@ undefined) echo "error: AC_CONFIG_HEADER not found in $infile" >&2; exit 1 ;;
|
||||
*) config_h_in="${config_h}.in" ;;
|
||||
esac
|
||||
|
||||
if test $# -eq 0; then
|
||||
tmpout=autoh$$
|
||||
trap "rm -f $tmpout; exit 1" 1 2 15
|
||||
exec > $tmpout
|
||||
fi
|
||||
|
||||
tmpout=$ah_base.out
|
||||
if test $debug -eq 0; then trap "rm -f $ah_base*; exit 1" 1 2 15; fi
|
||||
# Don't write "do not edit" -- it will get copied into the
|
||||
# config.h, which it's ok to edit.
|
||||
cat <<EOF
|
||||
cat <<EOF >$tmpout
|
||||
/* ${config_h_in}. Generated automatically from $infile by autoheader. */
|
||||
EOF
|
||||
|
||||
test -r ${config_h}.top && cat ${config_h}.top
|
||||
test -r ${config_h}.top && cat ${config_h}.top >>$tmpout
|
||||
test -r $localdir/acconfig.h &&
|
||||
grep @TOP@ $localdir/acconfig.h >/dev/null &&
|
||||
sed '/@TOP@/,$d' $localdir/acconfig.h
|
||||
sed '/@TOP@/,$d' $localdir/acconfig.h >>$tmpout
|
||||
|
||||
# This puts each template paragraph on its own line, separated by @s.
|
||||
if test -n "$syms"; then
|
||||
# Make sure the boundary of template files is also the boundary
|
||||
# of the paragraph. Extra newlines don't hurt since they will
|
||||
# be removed.
|
||||
# Undocumented useless feature: stuff outside of @TOP@ and @BOTTOM@
|
||||
# Undocumented useless feature: stuff outside of @TOP@ and @BOTTOM@
|
||||
# is ignored in the systemwide acconfig.h too.
|
||||
for t in $TEMPLATES; do
|
||||
for t in $acconfigs; do
|
||||
sedscript=""
|
||||
grep @TOP@ $t >/dev/null && sedscript="1,/@TOP@/d;"
|
||||
grep @BOTTOM@ $t >/dev/null && sedscript="$sedscript /@BOTTOM@/,\$d;"
|
||||
@ -208,94 +220,55 @@ if test -n "$syms"; then
|
||||
# Some fgrep's have limits on the number of lines that can be in the
|
||||
# pattern on the command line, so use a temporary file containing the
|
||||
# pattern.
|
||||
(fgrep_tmp=${TMPDIR-/tmp}/autoh$$
|
||||
(fgrep_tmp=$ah_base.fgrep
|
||||
trap "rm -f $fgrep_tmp; exit 1" 1 2 15
|
||||
cat > $fgrep_tmp <<EOF
|
||||
$syms
|
||||
EOF
|
||||
fgrep -f $fgrep_tmp
|
||||
rm -f $fgrep_tmp) |
|
||||
tr @. "$ac_LF_and_DOT"
|
||||
# We use echo to avoid assuming a particular line-breaking character.
|
||||
# The extra dot is to prevent the shell from consuming trailing
|
||||
# line-breaks from the sub-command output. A line-break within
|
||||
# single-quotes doesn't work because, if this script is created in a
|
||||
# platform that uses two characters for line-breaks (e.g., DOS), tr
|
||||
# would break.
|
||||
tr @. "$ac_LF_and_DOT" >>$tmpout
|
||||
fi
|
||||
|
||||
echo "$types" | tr ,. "$ac_LF_and_DOT" | sort | uniq | while read ctype; do
|
||||
test -z "$ctype" && continue
|
||||
sym="`echo "${ctype}" | tr 'abcdefghijklmnopqrstuvwxyz *' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ_P'`"
|
||||
echo "
|
||||
/* The number of bytes in a ${ctype}. */
|
||||
#undef SIZEOF_${sym}"
|
||||
for verb in `(set) 2>&1 | sed -n -e '/^ac_verbatim/s/^\([^=]*\)=.*$/\1/p'`; do
|
||||
echo >>$tmpout
|
||||
eval echo >>$tmpout '"${'$verb'}"'
|
||||
done
|
||||
|
||||
# /bin/sh on the Alpha gives `for' a random value if $funcs is empty.
|
||||
if test -n "$funcs"; then
|
||||
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 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
|
||||
echo "
|
||||
/* Define if you have the ${func} function. */
|
||||
#undef HAVE_${sym}"
|
||||
done
|
||||
fi
|
||||
|
||||
if test -n "$headers"; then
|
||||
for header in `for x in $headers; do echo $x; done | sort | uniq`; do
|
||||
|
||||
sym="`echo ${header} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
|
||||
echo "
|
||||
/* Define if you have the <${header}> header file. */
|
||||
#undef HAVE_${sym}"
|
||||
done
|
||||
fi
|
||||
|
||||
if test -n "$libs"; then
|
||||
for lib in `for x in $libs; do echo $x; done | sort | uniq`; do
|
||||
sym="`echo ${lib} | sed 's/[^a-zA-Z0-9_]/_/g' | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'`"
|
||||
echo "
|
||||
/* Define if you have the ${lib} library (-l${lib}). */
|
||||
#undef HAVE_LIB${sym}"
|
||||
done
|
||||
fi
|
||||
|
||||
if test -n "$verbatim"; then
|
||||
echo "$verbatim"
|
||||
fi
|
||||
|
||||
# Handle the case where @BOTTOM@ is the first line of acconfig.h.
|
||||
test -r $localdir/acconfig.h &&
|
||||
grep @BOTTOM@ $localdir/acconfig.h >/dev/null &&
|
||||
sed -n '/@BOTTOM@/,${/@BOTTOM@/!p;}' $localdir/acconfig.h
|
||||
test -f ${config_h}.bot && cat ${config_h}.bot
|
||||
sed -n '/@BOTTOM@/,${/@BOTTOM@/!p;}' $localdir/acconfig.h >>$tmpout
|
||||
test -f ${config_h}.bot && cat ${config_h}.bot >>$tmpout
|
||||
|
||||
# Check that all the symbols have a template
|
||||
status=0
|
||||
|
||||
if test -n "$syms"; then
|
||||
for sym in $syms; do
|
||||
if fgrep $sym $TEMPLATES >/dev/null; then
|
||||
if grep "^#[a-z]*[ ][ ]*$sym[ ]*$" $tmpout >/dev/null; then
|
||||
: # All is well.
|
||||
else
|
||||
echo "$0: Symbol \`${sym}' is not covered by $TEMPLATES" >&2
|
||||
echo "$0: No template for symbol \`${sym}'" >&2
|
||||
status=1
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
if test $# -eq 0; then
|
||||
# Force $tmpout to close to avoid Windows file sharing conflicts.
|
||||
exec 1>&2
|
||||
if test $status -eq 0; then
|
||||
# If the run was successful, output the result.
|
||||
if test $status -eq 0; then
|
||||
if test $# -eq 0; then
|
||||
# Output is a file
|
||||
if test -f ${config_h_in} && cmp -s $tmpout ${config_h_in}; then
|
||||
rm -f $tmpout # File didn't change, so don't update its mod time.
|
||||
: # File didn't change, so don't update its mod time.
|
||||
else
|
||||
mv -f $tmpout ${config_h_in}
|
||||
fi
|
||||
else
|
||||
rm -f $tmpout
|
||||
# Output is stdout
|
||||
cat $tmpout
|
||||
fi
|
||||
fi
|
||||
|
||||
rm -f $tmpout
|
||||
exit $status
|
||||
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user