various bug fixes

This commit is contained in:
David MacKenzie 1995-02-09 22:44:35 +00:00
parent 897e4e09a8
commit bb41a196e7
15 changed files with 336 additions and 89 deletions

View File

@ -26,6 +26,7 @@ INSTALL_DATA = @INSTALL_DATA@
MAKEINFO = makeinfo MAKEINFO = makeinfo
TEXI2DVI = texi2dvi TEXI2DVI = texi2dvi
M4 = @M4@ M4 = @M4@
AWK = @AWK@
PERL = @PERL@ PERL = @PERL@
# Programs that are always installed. # Programs that are always installed.
@ -70,7 +71,8 @@ DISTFILES = COPYING ChangeLog ChangeLog.1 INSTALL \
testsuite/lib/*.exp testsuite/autoconf.[gs]/*.exp \ testsuite/lib/*.exp testsuite/autoconf.[gs]/*.exp \
standards.texi make-stds.texi standards.info* standards.texi make-stds.texi standards.info*
editsh = sed -e 's,@''datadir''@,$(acdatadir),g' -e 's,@''M4''@,$(M4),g' editsh = sed -e 's,@''datadir''@,$(acdatadir),g' -e \
's,@''M4''@,$(M4),g' -e 's,@''AWK''@,$(AWK),g'
editpl = sed -e 's,@''datadir''@,$(acdatadir),g' -e 's,@''PERL''@,$(PERL),g' editpl = sed -e 's,@''datadir''@,$(acdatadir),g' -e 's,@''PERL''@,$(PERL),g'
all: ${SCRIPTS} all: ${SCRIPTS}

6
NEWS
View File

@ -1,5 +1,11 @@
Major changes in release 2.2: Major changes in release 2.2:
* The ifnames utility is much faster but requires a "new awk" interpreter.
* AC_CHECK_LIB and AC_HAVE_LIBRARY check and add the new
library before existing libs, not after, in case it uses them.
* New macros: AC_FUNC_GETPGRP, AC_CHECK_TOOL.
* Many additions to the TODO file :-)
* Lots of bug fixes.
Major changes in release 2.1: Major changes in release 2.1:

21
TODO
View File

@ -116,13 +116,8 @@ Have AC_CANONICAL_* cache the host/build/target types.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Look at contributions: Look at contributions:
ifnames rewrite using nawk (Paul Eggert)
ac_include (Karl Berry) ac_include (Karl Berry)
tool_prefix (Roland McGrath)
aclocal.h tom@basil.icce.rug.NL (Tom R.Hageman) aclocal.h tom@basil.icce.rug.NL (Tom R.Hageman)
inline rewrite (Jim Avera)
getpgrp and stringize (Arnold Robbins)
caching AC_DECL_YYTEXT (Karl Berry, John something)
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
@ -203,11 +198,6 @@ From: "Randall S. Winchester" <rsw@eng.umd.edu>
------------------------------------------------------------------------------ ------------------------------------------------------------------------------
Handle trailing slashes in PATH elements in AC_CHECK_PROG,
AC_PATH_PROG, AC_PROG_INSTALL.
------------------------------------------------------------------------------
In libc and make in aclocal.m4 I have AC_CHECK_SYMBOL, which checks for In libc and make in aclocal.m4 I have AC_CHECK_SYMBOL, which checks for
sys_siglist et al. Using AC_CHECK_FUNC doesn't work on some system that sys_siglist et al. Using AC_CHECK_FUNC doesn't work on some system that
winds up caring that you reference it as a function and it is really a winds up caring that you reference it as a function and it is really a
@ -215,16 +205,7 @@ variable. My version always declares the symbol as a char *[]; if that
ends up a bad idea, we can have it take an arg with the C decl, but that is ends up a bad idea, we can have it take an arg with the C decl, but that is
a bit verbose to write if it's actually superfluous. a bit verbose to write if it's actually superfluous.
From Roland McGrath. From Roland McGrath.
[I'd call it AC_CHECK_VAR, I think. -djm]
------------------------------------------------------------------------------
In /gd4/gnu/hurd/aclocal.m4 I wrote AC_CHECK_TOOL, which is a boon when
doing a lot of cross compilation, and I think a good thing to use
generically (AC_PROG_{CC,RANLIB} should use it). I want this merged so I
can convert mach4's configure.in to stop using local hack macros, and
finally get a configure.in up for hurd (and then rewrite its makefiles
again).
From Roland McGrath.
------------------------------------------------------------------------------ ------------------------------------------------------------------------------

View File

@ -52,6 +52,9 @@
/* Define if the `getloadavg' function needs to be run setuid or setgid. */ /* Define if the `getloadavg' function needs to be run setuid or setgid. */
#undef GETLOADAVG_PRIVILEGED #undef GETLOADAVG_PRIVILEGED
/* Define if the `getpgrp' function takes no argument. */
#undef GETPGRP_VOID
/* Define to `int' if <sys/types.h> doesn't define. */ /* Define to `int' if <sys/types.h> doesn't define. */
#undef gid_t #undef gid_t

View File

@ -755,7 +755,8 @@ AC_CANONICAL_TARGET
AC_CANONICAL_BUILD AC_CANONICAL_BUILD
test "$host_alias" != "$target_alias" && test "$host_alias" != "$target_alias" &&
test "$program_prefix$program_suffix$program_transform_name" = \ test "$program_prefix$program_suffix$program_transform_name" = \
NONENONEs,x,x, && program_prefix=${target_alias}- NONENONEs,x,x, &&
program_prefix=${target_alias}-
]) ])
dnl Subroutines of AC_CANONICAL_SYSTEM. dnl Subroutines of AC_CANONICAL_SYSTEM.
@ -770,6 +771,7 @@ fi
AC_MSG_CHECKING(host system type) AC_MSG_CHECKING(host system type)
dnl Set host_alias.
host_alias=$host host_alias=$host
case "$host_alias" in case "$host_alias" in
NONE) NONE)
@ -782,6 +784,7 @@ NONE)
esac ;; esac ;;
esac esac
dnl Set the other host vars.
host=`$ac_config_sub $host_alias` host=`$ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
@ -799,6 +802,7 @@ AC_DEFUN(AC_CANONICAL_TARGET,
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
AC_MSG_CHECKING(target system type) AC_MSG_CHECKING(target system type)
dnl Set target_alias.
target_alias=$target target_alias=$target
case "$target_alias" in case "$target_alias" in
NONE) NONE)
@ -808,6 +812,7 @@ NONE)
esac ;; esac ;;
esac esac
dnl Set the other target vars.
target=`$ac_config_sub $target_alias` target=`$ac_config_sub $target_alias`
target_cpu=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` target_cpu=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
target_vendor=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` target_vendor=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
@ -825,6 +830,7 @@ AC_DEFUN(AC_CANONICAL_BUILD,
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
AC_MSG_CHECKING(build system type) AC_MSG_CHECKING(build system type)
dnl Set build_alias.
build_alias=$build build_alias=$build
case "$build_alias" in case "$build_alias" in
NONE) NONE)
@ -834,6 +840,7 @@ NONE)
esac ;; esac ;;
esac esac
dnl Set the other build vars.
build=`$ac_config_sub $build_alias` build=`$ac_config_sub $build_alias`
build_cpu=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` build_cpu=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
build_vendor=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` build_vendor=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
@ -1151,6 +1158,22 @@ done
ifelse([$3], , , [test -n "[$]$1" || $1="$3" ifelse([$3], , , [test -n "[$]$1" || $1="$3"
])]) ])])
dnl Internal subroutine.
AC_DEFUN(AC_CHECK_TOOL_PREFIX,
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
if test $host != $build; then
ac_tool_prefix=${host_alias}-
else
ac_tool_prefix=
fi
])
dnl AC_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR)
AC_DEFUN(AC_CHECK_TOOL,
[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
AC_CHECK_PROG($1, ${ac_tool_prefix}$2, ${ac_tool_prefix}$2, $2)
])
dnl Guess the value for the `prefix' variable by looking for dnl Guess the value for the `prefix' variable by looking for
dnl the argument program along PATH and taking its parent. dnl the argument program along PATH and taking its parent.
dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc, dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc,
@ -1168,7 +1191,7 @@ AC_MSG_CHECKING([for prefix by ])
AC_PATH_PROG(AC_VAR_NAME, $1) AC_PATH_PROG(AC_VAR_NAME, $1)
changequote(<<, >>)dnl changequote(<<, >>)dnl
if test -n "$ac_cv_path_<<>>AC_VAR_NAME"; then if test -n "$ac_cv_path_<<>>AC_VAR_NAME"; then
prefix=`echo $ac_cv_path_<<>>AC_VAR_NAME|sed 's%/[^/][^/]*/[^/][^/]*$%%'` prefix=`echo $ac_cv_path_<<>>AC_VAR_NAME|sed 's%/[^/][^/]*//*[^/][^/]*$%%'`
changequote([, ])dnl changequote([, ])dnl
fi fi
fi fi

View File

@ -250,7 +250,7 @@ AC_SUBST([SET_MAKE])dnl
AC_DEFUN(AC_PROG_RANLIB, AC_DEFUN(AC_PROG_RANLIB,
[AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)]) [AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)])
dnl Check for mawk first since it's said to be faster. dnl Check for mawk first since it's generally faster.
AC_DEFUN(AC_PROG_AWK, AC_DEFUN(AC_PROG_AWK,
[AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )]) [AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )])
@ -317,27 +317,34 @@ then
fi fi
AC_SUBST(LEXLIB)]) AC_SUBST(LEXLIB)])
dnl Check if lex declares yytext as a char * by default, not a char[].
undefine([AC_DECL_YYTEXT])
AC_DEFUN(AC_DECL_YYTEXT, AC_DEFUN(AC_DECL_YYTEXT,
[AC_REQUIRE_CPP()dnl [AC_REQUIRE_CPP()dnl
AC_REQUIRE([AC_PROG_LEX])dnl AC_REQUIRE([AC_PROG_LEX])dnl
AC_MSG_CHECKING(lex output file root)
AC_CACHE_VAL(ac_cv_prog_lex_root,
[# The minimal lex program is just a single line: %%. But some broken lexes
# (Solaris, I think it was) want two %% lines, so accommodate them.
echo '%%
%%' | $LEX
if test -f lex.yy.c; then
ac_cv_prog_lex_root=lex.yy
elif test -f lexyy.c; then
ac_cv_prog_lex_root=lexyy
else
AC_MSG_ERROR(cannot find output from $LEX; giving up)
fi])dnl
LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
AC_MSG_RESULT($ac_cv_prog_lex_root)
AC_SUBST(LEX_OUTPUT_ROOT)dnl
AC_MSG_CHECKING(whether yytext is a pointer) AC_MSG_CHECKING(whether yytext is a pointer)
AC_CACHE_VAL(ac_cv_prog_lex_yytext_pointer, AC_CACHE_VAL(ac_cv_prog_lex_yytext_pointer,
[# POSIX says lex can declare yytext either as a pointer or an array; the [# POSIX says lex can declare yytext either as a pointer or an array; the
# default is implementation-dependent. Figure out which it is, since # default is implementation-dependent. Figure out which it is, since
# not all implementations provide the %pointer and %array declarations. # not all implementations provide the %pointer and %array declarations.
#
# The minimal lex program is just a single line: %%. But some broken lexes
# (Solaris, I think it was) want two %% lines, so accommodate them.
ac_cv_prog_lex_yytext_pointer=no ac_cv_prog_lex_yytext_pointer=no
echo '%%
%%' | $LEX
if test -f lex.yy.c; then
LEX_OUTPUT_ROOT=lex.yy
elif test -f lexyy.c; then
LEX_OUTPUT_ROOT=lexyy
else
AC_MSG_ERROR([cannot find output from $LEX, giving up])
fi
echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="$LIBS $LEXLIB" LIBS="$LIBS $LEXLIB"
@ -348,7 +355,6 @@ AC_MSG_RESULT($ac_cv_prog_lex_yytext_pointer)
if test $ac_cv_prog_lex_yytext_pointer = yes; then if test $ac_cv_prog_lex_yytext_pointer = yes; then
AC_DEFINE(YYTEXT_POINTER) AC_DEFINE(YYTEXT_POINTER)
fi fi
AC_SUBST(LEX_OUTPUT_ROOT)dnl
]) ])
AC_DEFUN(AC_PROG_INSTALL, AC_DEFUN(AC_PROG_INSTALL,
@ -368,8 +374,9 @@ if test -z "$INSTALL"; then
AC_CACHE_VAL(ac_cv_path_install, AC_CACHE_VAL(ac_cv_path_install,
[ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" [ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do for ac_dir in $PATH; do
case "$ac_dir" in # Account for people who put trailing slashes in PATH elements.
''|.|/etc|/usr/sbin|/usr/etc|/sbin|/usr/afsws/bin|/usr/ucb) ;; case "$ac_dir/" in
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
*) *)
# OSF1 and SCO ODT 3.0 have their own names for install. # OSF1 and SCO ODT 3.0 have their own names for install.
for ac_prog in ginstall installbsd scoinst install; do for ac_prog in ginstall installbsd scoinst install; do
@ -838,6 +845,69 @@ if test $ac_cv_func_mmap = yes; then
fi fi
]) ])
AC_DEFUN(AC_FUNC_GETPGRP,
[AC_MSG_CHECKING(whether getpgrp takes no argument)
AC_CACHE_VAL(ac_cv_func_getpgrp_void,
[AC_TRY_RUN([
/*
* If this system has a BSD-style getpgrp(),
* which takes a pid argument, exit unsuccessfully.
*
* Snarfed from Chet Ramey's bash pgrp.c test program
*/
#include <stdio.h>
#include <sys/types.h>
int pid;
int pg1, pg2, pg3, pg4;
int ng, np, s, child;
main()
{
pid = getpid();
pg1 = getpgrp(0);
pg2 = getpgrp();
pg3 = getpgrp(pid);
pg4 = getpgrp(1);
/*
* If all of these values are the same, it's pretty sure that
* we're on a system that ignores getpgrp's first argument.
*/
if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
exit(0);
child = fork();
if (child < 0)
exit(1);
else if (child == 0) {
np = getpid();
/*
* If this is Sys V, this will not work; pgrp will be
* set to np because setpgrp just changes a pgrp to be
* the same as the pid.
*/
setpgrp(np, pg1);
ng = getpgrp(0); /* Same result for Sys V and BSD */
if (ng == pg1) {
exit(1);
} else {
exit(0);
}
} else {
wait(&s);
exit(s>>8);
}
}
], ac_cv_func_getpgrp_void=yes, ac_cv_func_getpgrp_void=no,
AC_MSG_ERROR(cannot check getpgrp if cross compiling))
])
AC_MSG_RESULT($ac_cv_func_getpgrp_void)
if test $ac_cv_func_getpgrp_void = yes; then
AC_DEFINE(GETPGRP_VOID)
fi
])
AC_DEFUN(AC_FUNC_VPRINTF, AC_DEFUN(AC_FUNC_VPRINTF,
[AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF)) [AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF))
if test "$ac_cv_func_vprintf" != yes; then if test "$ac_cv_func_vprintf" != yes; then
@ -1460,18 +1530,23 @@ if test $ac_cv_c_bigendian = yes; then
fi fi
]) ])
dnl Do nothing if the compiler accepts the inline keyword.
dnl Otherwise define inline to __inline__ or __inline if one of those work,
dnl otherwise define inline to be empty.
AC_DEFUN(AC_C_INLINE, AC_DEFUN(AC_C_INLINE,
[AC_MSG_CHECKING([for inline]) [AC_MSG_CHECKING([for inline])
AC_CACHE_VAL(ac_cv_c_inline, AC_CACHE_VAL(ac_cv_c_inline,
[if test "$GCC" = yes; then [ac_cv_c_inline=no
AC_TRY_COMPILE(, [} inline foo() {], ac_cv_c_inline=yes, ac_cv_c_inline=no) for ac_kw in inline __inline__ __inline; do
else AC_TRY_COMPILE(, [} $ac_kw foo() {], [ac_cv_c_inline=$ac_kw; break])
ac_cv_c_inline=no done
fi])dnl ])dnl
AC_MSG_RESULT($ac_cv_c_inline) AC_MSG_RESULT($ac_cv_c_inline)
if test $ac_cv_c_inline = no; then case "$ac_cv_c_inline" in
AC_DEFINE(inline, __inline) inline | yes) ;;
fi no) AC_DEFINE(inline, ) ;;
*) AC_DEFINE_UNQUOTED(inline, $ac_cv_c_inline) ;;
esac
]) ])
AC_DEFUN(AC_C_CONST, AC_DEFUN(AC_C_CONST,

View File

@ -1606,6 +1606,20 @@ list are found, set @var{variable} to @var{value-if-not-found}; if
is not changed. Calls @code{AC_SUBST} for @var{variable}. is not changed. Calls @code{AC_SUBST} for @var{variable}.
@end defmac @end defmac
@defmac AC_CHECK_TOOL (@var{variable}, @var{prog-to-check-for})
@maindex CHECK_TOOL
Like @code{AC_CHECK_PROG}, but first looks for @var{prog-to-check-for}
with a prefix of the host type as determined by @code{AC_CANONICAL_HOST},
followed by a dash (@pxref{Canonicalizing}). For example, if the user
runs @samp{configure --host=i386-gnu}, then this call:
@example
AC_CHECK_TOOL(AR, ar)
@end example
@noindent
sets @code{AR} to @file{i386-gnu-ar} if that program exists in
@code{PATH}, or to @samp{ar} if not.
@end defmac
@defmac AC_PATH_PROG (@var{variable}, @var{prog-to-check-for} @r{[}, @var{value-if-not-found}@r{]}) @defmac AC_PATH_PROG (@var{variable}, @var{prog-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
@maindex PATH_PROG @maindex PATH_PROG
Like @code{AC_CHECK_PROG}, but set @var{variable} to the entire Like @code{AC_CHECK_PROG}, but set @var{variable} to the entire
@ -1789,11 +1803,21 @@ to the name of the group that should own the installed program.
@defmac AC_FUNC_GETMNTENT @defmac AC_FUNC_GETMNTENT
@maindex FUNC_GETMNTENT @maindex FUNC_GETMNTENT
@cvindex HAVE_GETMNTENT @cvindex HAVE_GETMNTENT
Check for the @code{getmntent} in the @file{sun} and @file{seq} Check for @code{getmntent} in the @file{sun} and @file{seq}
libraries, for Irix 4 and PTX, respectively. Then, if @code{getmntent} is libraries, for Irix 4 and PTX, respectively. Then, if @code{getmntent} is
available, define @code{HAVE_GETMNTENT}. available, define @code{HAVE_GETMNTENT}.
@end defmac @end defmac
@defmac AC_FUNC_GETPGRP
@maindex FUNC_GETPGRP
@cvindex GETPGRP_VOID
If @code{getpgrp} takes no argument (the POSIX.1 version), define
@code{GETPGRP_VOID}. Otherwise, it is the BSD version, which takes a
process ID as an argument. This macro does not check whether
@code{getpgrp} exists at all; if you need to work in that situation,
first call @code{AC_CHECK_FUNC} for @code{getpgrp}.
@end defmac
@defmac AC_FUNC_MEMCMP @defmac AC_FUNC_MEMCMP
@maindex FUNC_MEMCMP @maindex FUNC_MEMCMP
@ovindex LIBOBJS @ovindex LIBOBJS
@ -2403,9 +2427,9 @@ it as empty.
@defmac AC_C_INLINE @defmac AC_C_INLINE
@maindex C_INLINE @maindex C_INLINE
@cvindex inline @cvindex inline
If the C compiler is a version of GCC that supports the keyword If the C compiler supports the keyword @code{inline}, do nothing.
@code{__inline} but not @code{inline} (such as some NeXT versions), Otherwise define @code{inline} to @code{__inline__} or @code{__inline}
define @code{inline} to be @code{__inline}. if it accepts one of those, otherwise define @code{inline} to be empty.
@end defmac @end defmac
@defmac AC_C_CHAR_UNSIGNED @defmac AC_C_CHAR_UNSIGNED
@ -3677,8 +3701,8 @@ a suggestion for what to use instead of @var{this-macro-name}.
A few kinds of features can't be guessed automatically by running test A few kinds of features can't be guessed automatically by running test
programs. For example, the details of the object file format, or programs. For example, the details of the object file format, or
special options that need to be passed to the compiler or linker. It is special options that need to be passed to the compiler or linker. You
possible to check for such features using ad-hoc means, such as having can check for such features using ad-hoc means, such as having
@code{configure} check the output of the @code{uname} program, or @code{configure} check the output of the @code{uname} program, or
looking for libraries that are unique to particular systems. However, looking for libraries that are unique to particular systems. However,
Autoconf provides a uniform method for handling unguessable features. Autoconf provides a uniform method for handling unguessable features.
@ -3843,6 +3867,10 @@ creates in the current directory @file{host.h}, which is a link to
to @file{@var{srcdir}/config/$@{obj_format@}.h}. to @file{@var{srcdir}/config/$@{obj_format@}.h}.
@end defmac @end defmac
You can also use the host system type to find cross-compilation tools.
@xref{Generic Programs}, for information about the @code{AC_CHECK_TOOL}
macro which does that.
@node Site Configuration, Invoking configure, Manual Configuration, Top @node Site Configuration, Invoking configure, Manual Configuration, Top
@chapter Site Configuration @chapter Site Configuration

View File

@ -56,7 +56,7 @@ if test $show_version = yes; then
exit 0 exit 0
fi fi
mawk ' @AWK@ '
# Record that sym was found in FILENAME. # Record that sym was found in FILENAME.
function file_sym(sym, i, fs) { function file_sym(sym, i, fs) {
if (sym ~ /^[A-Za-z_]/) { if (sym ~ /^[A-Za-z_]/) {

View File

@ -8,6 +8,7 @@ dnl their path, the installer can configure with a path that has GNU m4
dnl first and get that path embedded in the installed autoconf and dnl first and get that path embedded in the installed autoconf and
dnl autoheader scripts. dnl autoheader scripts.
AC_PATH_PROGS(M4, gm4 gnum4 m4, m4) AC_PATH_PROGS(M4, gm4 gnum4 m4, m4)
AC_PROG_AWK
dnl We use a path for perl so the #! line in autoscan will work. dnl We use a path for perl so the #! line in autoscan will work.
AC_PATH_PROG(PERL, perl, no) AC_PATH_PROG(PERL, perl, no)

View File

@ -26,6 +26,7 @@ INSTALL_DATA = @INSTALL_DATA@
MAKEINFO = makeinfo MAKEINFO = makeinfo
TEXI2DVI = texi2dvi TEXI2DVI = texi2dvi
M4 = @M4@ M4 = @M4@
AWK = @AWK@
PERL = @PERL@ PERL = @PERL@
# Programs that are always installed. # Programs that are always installed.
@ -70,7 +71,8 @@ DISTFILES = COPYING ChangeLog ChangeLog.1 INSTALL \
testsuite/lib/*.exp testsuite/autoconf.[gs]/*.exp \ testsuite/lib/*.exp testsuite/autoconf.[gs]/*.exp \
standards.texi make-stds.texi standards.info* standards.texi make-stds.texi standards.info*
editsh = sed -e 's,@''datadir''@,$(acdatadir),g' -e 's,@''M4''@,$(M4),g' editsh = sed -e 's,@''datadir''@,$(acdatadir),g' -e \
's,@''M4''@,$(M4),g' -e 's,@''AWK''@,$(AWK),g'
editpl = sed -e 's,@''datadir''@,$(acdatadir),g' -e 's,@''PERL''@,$(PERL),g' editpl = sed -e 's,@''datadir''@,$(acdatadir),g' -e 's,@''PERL''@,$(PERL),g'
all: ${SCRIPTS} all: ${SCRIPTS}

View File

@ -1606,6 +1606,20 @@ list are found, set @var{variable} to @var{value-if-not-found}; if
is not changed. Calls @code{AC_SUBST} for @var{variable}. is not changed. Calls @code{AC_SUBST} for @var{variable}.
@end defmac @end defmac
@defmac AC_CHECK_TOOL (@var{variable}, @var{prog-to-check-for})
@maindex CHECK_TOOL
Like @code{AC_CHECK_PROG}, but first looks for @var{prog-to-check-for}
with a prefix of the host type as determined by @code{AC_CANONICAL_HOST},
followed by a dash (@pxref{Canonicalizing}). For example, if the user
runs @samp{configure --host=i386-gnu}, then this call:
@example
AC_CHECK_TOOL(AR, ar)
@end example
@noindent
sets @code{AR} to @file{i386-gnu-ar} if that program exists in
@code{PATH}, or to @samp{ar} if not.
@end defmac
@defmac AC_PATH_PROG (@var{variable}, @var{prog-to-check-for} @r{[}, @var{value-if-not-found}@r{]}) @defmac AC_PATH_PROG (@var{variable}, @var{prog-to-check-for} @r{[}, @var{value-if-not-found}@r{]})
@maindex PATH_PROG @maindex PATH_PROG
Like @code{AC_CHECK_PROG}, but set @var{variable} to the entire Like @code{AC_CHECK_PROG}, but set @var{variable} to the entire
@ -1789,11 +1803,21 @@ to the name of the group that should own the installed program.
@defmac AC_FUNC_GETMNTENT @defmac AC_FUNC_GETMNTENT
@maindex FUNC_GETMNTENT @maindex FUNC_GETMNTENT
@cvindex HAVE_GETMNTENT @cvindex HAVE_GETMNTENT
Check for the @code{getmntent} in the @file{sun} and @file{seq} Check for @code{getmntent} in the @file{sun} and @file{seq}
libraries, for Irix 4 and PTX, respectively. Then, if @code{getmntent} is libraries, for Irix 4 and PTX, respectively. Then, if @code{getmntent} is
available, define @code{HAVE_GETMNTENT}. available, define @code{HAVE_GETMNTENT}.
@end defmac @end defmac
@defmac AC_FUNC_GETPGRP
@maindex FUNC_GETPGRP
@cvindex GETPGRP_VOID
If @code{getpgrp} takes no argument (the POSIX.1 version), define
@code{GETPGRP_VOID}. Otherwise, it is the BSD version, which takes a
process ID as an argument. This macro does not check whether
@code{getpgrp} exists at all; if you need to work in that situation,
first call @code{AC_CHECK_FUNC} for @code{getpgrp}.
@end defmac
@defmac AC_FUNC_MEMCMP @defmac AC_FUNC_MEMCMP
@maindex FUNC_MEMCMP @maindex FUNC_MEMCMP
@ovindex LIBOBJS @ovindex LIBOBJS
@ -2403,9 +2427,9 @@ it as empty.
@defmac AC_C_INLINE @defmac AC_C_INLINE
@maindex C_INLINE @maindex C_INLINE
@cvindex inline @cvindex inline
If the C compiler is a version of GCC that supports the keyword If the C compiler supports the keyword @code{inline}, do nothing.
@code{__inline} but not @code{inline} (such as some NeXT versions), Otherwise define @code{inline} to @code{__inline__} or @code{__inline}
define @code{inline} to be @code{__inline}. if it accepts one of those, otherwise define @code{inline} to be empty.
@end defmac @end defmac
@defmac AC_C_CHAR_UNSIGNED @defmac AC_C_CHAR_UNSIGNED
@ -3677,8 +3701,8 @@ a suggestion for what to use instead of @var{this-macro-name}.
A few kinds of features can't be guessed automatically by running test A few kinds of features can't be guessed automatically by running test
programs. For example, the details of the object file format, or programs. For example, the details of the object file format, or
special options that need to be passed to the compiler or linker. It is special options that need to be passed to the compiler or linker. You
possible to check for such features using ad-hoc means, such as having can check for such features using ad-hoc means, such as having
@code{configure} check the output of the @code{uname} program, or @code{configure} check the output of the @code{uname} program, or
looking for libraries that are unique to particular systems. However, looking for libraries that are unique to particular systems. However,
Autoconf provides a uniform method for handling unguessable features. Autoconf provides a uniform method for handling unguessable features.
@ -3843,6 +3867,10 @@ creates in the current directory @file{host.h}, which is a link to
to @file{@var{srcdir}/config/$@{obj_format@}.h}. to @file{@var{srcdir}/config/$@{obj_format@}.h}.
@end defmac @end defmac
You can also use the host system type to find cross-compilation tools.
@xref{Generic Programs}, for information about the @code{AC_CHECK_TOOL}
macro which does that.
@node Site Configuration, Invoking configure, Manual Configuration, Top @node Site Configuration, Invoking configure, Manual Configuration, Top
@chapter Site Configuration @chapter Site Configuration

View File

@ -56,7 +56,7 @@ if test $show_version = yes; then
exit 0 exit 0
fi fi
mawk ' @AWK@ '
# Record that sym was found in FILENAME. # Record that sym was found in FILENAME.
function file_sym(sym, i, fs) { function file_sym(sym, i, fs) {
if (sym ~ /^[A-Za-z_]/) { if (sym ~ /^[A-Za-z_]/) {

View File

@ -56,7 +56,7 @@ if test $show_version = yes; then
exit 0 exit 0
fi fi
mawk ' @AWK@ '
# Record that sym was found in FILENAME. # Record that sym was found in FILENAME.
function file_sym(sym, i, fs) { function file_sym(sym, i, fs) {
if (sym ~ /^[A-Za-z_]/) { if (sym ~ /^[A-Za-z_]/) {

View File

@ -755,7 +755,8 @@ AC_CANONICAL_TARGET
AC_CANONICAL_BUILD AC_CANONICAL_BUILD
test "$host_alias" != "$target_alias" && test "$host_alias" != "$target_alias" &&
test "$program_prefix$program_suffix$program_transform_name" = \ test "$program_prefix$program_suffix$program_transform_name" = \
NONENONEs,x,x, && program_prefix=${target_alias}- NONENONEs,x,x, &&
program_prefix=${target_alias}-
]) ])
dnl Subroutines of AC_CANONICAL_SYSTEM. dnl Subroutines of AC_CANONICAL_SYSTEM.
@ -770,6 +771,7 @@ fi
AC_MSG_CHECKING(host system type) AC_MSG_CHECKING(host system type)
dnl Set host_alias.
host_alias=$host host_alias=$host
case "$host_alias" in case "$host_alias" in
NONE) NONE)
@ -782,6 +784,7 @@ NONE)
esac ;; esac ;;
esac esac
dnl Set the other host vars.
host=`$ac_config_sub $host_alias` host=`$ac_config_sub $host_alias`
host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` host_cpu=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` host_vendor=`echo $host | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
@ -799,6 +802,7 @@ AC_DEFUN(AC_CANONICAL_TARGET,
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
AC_MSG_CHECKING(target system type) AC_MSG_CHECKING(target system type)
dnl Set target_alias.
target_alias=$target target_alias=$target
case "$target_alias" in case "$target_alias" in
NONE) NONE)
@ -808,6 +812,7 @@ NONE)
esac ;; esac ;;
esac esac
dnl Set the other target vars.
target=`$ac_config_sub $target_alias` target=`$ac_config_sub $target_alias`
target_cpu=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` target_cpu=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
target_vendor=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` target_vendor=`echo $target | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
@ -825,6 +830,7 @@ AC_DEFUN(AC_CANONICAL_BUILD,
[AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl [AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT])dnl
AC_MSG_CHECKING(build system type) AC_MSG_CHECKING(build system type)
dnl Set build_alias.
build_alias=$build build_alias=$build
case "$build_alias" in case "$build_alias" in
NONE) NONE)
@ -834,6 +840,7 @@ NONE)
esac ;; esac ;;
esac esac
dnl Set the other build vars.
build=`$ac_config_sub $build_alias` build=`$ac_config_sub $build_alias`
build_cpu=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'` build_cpu=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\1/'`
build_vendor=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'` build_vendor=`echo $build | sed 's/^\(.*\)-\(.*\)-\(.*\)$/\2/'`
@ -1151,6 +1158,22 @@ done
ifelse([$3], , , [test -n "[$]$1" || $1="$3" ifelse([$3], , , [test -n "[$]$1" || $1="$3"
])]) ])])
dnl Internal subroutine.
AC_DEFUN(AC_CHECK_TOOL_PREFIX,
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
if test $host != $build; then
ac_tool_prefix=${host_alias}-
else
ac_tool_prefix=
fi
])
dnl AC_CHECK_TOOL(VARIABLE, PROG-TO-CHECK-FOR)
AC_DEFUN(AC_CHECK_TOOL,
[AC_REQUIRE([AC_CHECK_TOOL_PREFIX])dnl
AC_CHECK_PROG($1, ${ac_tool_prefix}$2, ${ac_tool_prefix}$2, $2)
])
dnl Guess the value for the `prefix' variable by looking for dnl Guess the value for the `prefix' variable by looking for
dnl the argument program along PATH and taking its parent. dnl the argument program along PATH and taking its parent.
dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc, dnl Example: if the argument is `gcc' and we find /usr/local/gnu/bin/gcc,
@ -1168,7 +1191,7 @@ AC_MSG_CHECKING([for prefix by ])
AC_PATH_PROG(AC_VAR_NAME, $1) AC_PATH_PROG(AC_VAR_NAME, $1)
changequote(<<, >>)dnl changequote(<<, >>)dnl
if test -n "$ac_cv_path_<<>>AC_VAR_NAME"; then if test -n "$ac_cv_path_<<>>AC_VAR_NAME"; then
prefix=`echo $ac_cv_path_<<>>AC_VAR_NAME|sed 's%/[^/][^/]*/[^/][^/]*$%%'` prefix=`echo $ac_cv_path_<<>>AC_VAR_NAME|sed 's%/[^/][^/]*//*[^/][^/]*$%%'`
changequote([, ])dnl changequote([, ])dnl
fi fi
fi fi

View File

@ -250,7 +250,7 @@ AC_SUBST([SET_MAKE])dnl
AC_DEFUN(AC_PROG_RANLIB, AC_DEFUN(AC_PROG_RANLIB,
[AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)]) [AC_CHECK_PROG(RANLIB, ranlib, ranlib, :)])
dnl Check for mawk first since it's said to be faster. dnl Check for mawk first since it's generally faster.
AC_DEFUN(AC_PROG_AWK, AC_DEFUN(AC_PROG_AWK,
[AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )]) [AC_CHECK_PROGS(AWK, mawk gawk nawk awk, )])
@ -317,27 +317,34 @@ then
fi fi
AC_SUBST(LEXLIB)]) AC_SUBST(LEXLIB)])
dnl Check if lex declares yytext as a char * by default, not a char[].
undefine([AC_DECL_YYTEXT])
AC_DEFUN(AC_DECL_YYTEXT, AC_DEFUN(AC_DECL_YYTEXT,
[AC_REQUIRE_CPP()dnl [AC_REQUIRE_CPP()dnl
AC_REQUIRE([AC_PROG_LEX])dnl AC_REQUIRE([AC_PROG_LEX])dnl
AC_MSG_CHECKING(lex output file root)
AC_CACHE_VAL(ac_cv_prog_lex_root,
[# The minimal lex program is just a single line: %%. But some broken lexes
# (Solaris, I think it was) want two %% lines, so accommodate them.
echo '%%
%%' | $LEX
if test -f lex.yy.c; then
ac_cv_prog_lex_root=lex.yy
elif test -f lexyy.c; then
ac_cv_prog_lex_root=lexyy
else
AC_MSG_ERROR(cannot find output from $LEX; giving up)
fi])dnl
LEX_OUTPUT_ROOT=$ac_cv_prog_lex_root
AC_MSG_RESULT($ac_cv_prog_lex_root)
AC_SUBST(LEX_OUTPUT_ROOT)dnl
AC_MSG_CHECKING(whether yytext is a pointer) AC_MSG_CHECKING(whether yytext is a pointer)
AC_CACHE_VAL(ac_cv_prog_lex_yytext_pointer, AC_CACHE_VAL(ac_cv_prog_lex_yytext_pointer,
[# POSIX says lex can declare yytext either as a pointer or an array; the [# POSIX says lex can declare yytext either as a pointer or an array; the
# default is implementation-dependent. Figure out which it is, since # default is implementation-dependent. Figure out which it is, since
# not all implementations provide the %pointer and %array declarations. # not all implementations provide the %pointer and %array declarations.
#
# The minimal lex program is just a single line: %%. But some broken lexes
# (Solaris, I think it was) want two %% lines, so accommodate them.
ac_cv_prog_lex_yytext_pointer=no ac_cv_prog_lex_yytext_pointer=no
echo '%%
%%' | $LEX
if test -f lex.yy.c; then
LEX_OUTPUT_ROOT=lex.yy
elif test -f lexyy.c; then
LEX_OUTPUT_ROOT=lexyy
else
AC_MSG_ERROR([cannot find output from $LEX, giving up])
fi
echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c echo 'extern char *yytext;' >>$LEX_OUTPUT_ROOT.c
ac_save_LIBS="$LIBS" ac_save_LIBS="$LIBS"
LIBS="$LIBS $LEXLIB" LIBS="$LIBS $LEXLIB"
@ -348,7 +355,6 @@ AC_MSG_RESULT($ac_cv_prog_lex_yytext_pointer)
if test $ac_cv_prog_lex_yytext_pointer = yes; then if test $ac_cv_prog_lex_yytext_pointer = yes; then
AC_DEFINE(YYTEXT_POINTER) AC_DEFINE(YYTEXT_POINTER)
fi fi
AC_SUBST(LEX_OUTPUT_ROOT)dnl
]) ])
AC_DEFUN(AC_PROG_INSTALL, AC_DEFUN(AC_PROG_INSTALL,
@ -368,8 +374,9 @@ if test -z "$INSTALL"; then
AC_CACHE_VAL(ac_cv_path_install, AC_CACHE_VAL(ac_cv_path_install,
[ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:" [ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}:"
for ac_dir in $PATH; do for ac_dir in $PATH; do
case "$ac_dir" in # Account for people who put trailing slashes in PATH elements.
''|.|/etc|/usr/sbin|/usr/etc|/sbin|/usr/afsws/bin|/usr/ucb) ;; case "$ac_dir/" in
/|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;;
*) *)
# OSF1 and SCO ODT 3.0 have their own names for install. # OSF1 and SCO ODT 3.0 have their own names for install.
for ac_prog in ginstall installbsd scoinst install; do for ac_prog in ginstall installbsd scoinst install; do
@ -838,6 +845,69 @@ if test $ac_cv_func_mmap = yes; then
fi fi
]) ])
AC_DEFUN(AC_FUNC_GETPGRP,
[AC_MSG_CHECKING(whether getpgrp takes no argument)
AC_CACHE_VAL(ac_cv_func_getpgrp_void,
[AC_TRY_RUN([
/*
* If this system has a BSD-style getpgrp(),
* which takes a pid argument, exit unsuccessfully.
*
* Snarfed from Chet Ramey's bash pgrp.c test program
*/
#include <stdio.h>
#include <sys/types.h>
int pid;
int pg1, pg2, pg3, pg4;
int ng, np, s, child;
main()
{
pid = getpid();
pg1 = getpgrp(0);
pg2 = getpgrp();
pg3 = getpgrp(pid);
pg4 = getpgrp(1);
/*
* If all of these values are the same, it's pretty sure that
* we're on a system that ignores getpgrp's first argument.
*/
if (pg2 == pg4 && pg1 == pg3 && pg2 == pg3)
exit(0);
child = fork();
if (child < 0)
exit(1);
else if (child == 0) {
np = getpid();
/*
* If this is Sys V, this will not work; pgrp will be
* set to np because setpgrp just changes a pgrp to be
* the same as the pid.
*/
setpgrp(np, pg1);
ng = getpgrp(0); /* Same result for Sys V and BSD */
if (ng == pg1) {
exit(1);
} else {
exit(0);
}
} else {
wait(&s);
exit(s>>8);
}
}
], ac_cv_func_getpgrp_void=yes, ac_cv_func_getpgrp_void=no,
AC_MSG_ERROR(cannot check getpgrp if cross compiling))
])
AC_MSG_RESULT($ac_cv_func_getpgrp_void)
if test $ac_cv_func_getpgrp_void = yes; then
AC_DEFINE(GETPGRP_VOID)
fi
])
AC_DEFUN(AC_FUNC_VPRINTF, AC_DEFUN(AC_FUNC_VPRINTF,
[AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF)) [AC_CHECK_FUNC(vprintf, AC_DEFINE(HAVE_VPRINTF))
if test "$ac_cv_func_vprintf" != yes; then if test "$ac_cv_func_vprintf" != yes; then
@ -1460,18 +1530,23 @@ if test $ac_cv_c_bigendian = yes; then
fi fi
]) ])
dnl Do nothing if the compiler accepts the inline keyword.
dnl Otherwise define inline to __inline__ or __inline if one of those work,
dnl otherwise define inline to be empty.
AC_DEFUN(AC_C_INLINE, AC_DEFUN(AC_C_INLINE,
[AC_MSG_CHECKING([for inline]) [AC_MSG_CHECKING([for inline])
AC_CACHE_VAL(ac_cv_c_inline, AC_CACHE_VAL(ac_cv_c_inline,
[if test "$GCC" = yes; then [ac_cv_c_inline=no
AC_TRY_COMPILE(, [} inline foo() {], ac_cv_c_inline=yes, ac_cv_c_inline=no) for ac_kw in inline __inline__ __inline; do
else AC_TRY_COMPILE(, [} $ac_kw foo() {], [ac_cv_c_inline=$ac_kw; break])
ac_cv_c_inline=no done
fi])dnl ])dnl
AC_MSG_RESULT($ac_cv_c_inline) AC_MSG_RESULT($ac_cv_c_inline)
if test $ac_cv_c_inline = no; then case "$ac_cv_c_inline" in
AC_DEFINE(inline, __inline) inline | yes) ;;
fi no) AC_DEFINE(inline, ) ;;
*) AC_DEFINE_UNQUOTED(inline, $ac_cv_c_inline) ;;
esac
]) ])
AC_DEFUN(AC_C_CONST, AC_DEFUN(AC_C_CONST,