fix c++, remove NO_ARG_ARRAY, check for more X libs

This commit is contained in:
David MacKenzie 1994-08-25 21:55:22 +00:00
parent 69ed573042
commit 7ec5a7d5f8
9 changed files with 172 additions and 161 deletions

2
NEWS
View File

@ -49,8 +49,10 @@ Major changes in release 2.0:
execute on success.
* AC_REMOTE_TAPE and AC_RSH removed; too specific to tar and cpio, and
better maintained with them.
* AC_ARG_ARRAY removed because no one was likely using it.
* AC_HAVE_POUNDBANG replaced with AC_SYS_INTERPRETER, which doesn't
take arguments.
* Checking for C functions in C++ works.
** New utilities:
* autoscan to generate a preliminary configure.in for a package by

7
TODO
View File

@ -96,11 +96,8 @@ in a dnl comment. (Seems to be hard.)
------------------------------------------------------------------------------
* Prototypes and IEEE math contributed macros.
------------------------------------------------------------------------------
* Functions to check for C++ functions, or C functions under C++.
* Look at user contributed macros: prototypes, IEEE double precision math,
shared libraries, various other things.
------------------------------------------------------------------------------

View File

@ -170,10 +170,6 @@
/* Define if you have <nlist.h>. */
#undef NLIST_STRUCT
/* Define if you can't use the address of an argument to a function
as the start of an array. */
#undef NO_ARG_ARRAY
/* Define if your C compiler doesn't accept -c and -o together. */
#undef NO_MINUS_C_MINUS_O

View File

@ -35,7 +35,7 @@ Install it before installing Autoconf or set the
M4 environment variable to its path name.
)m4exit(2)])dnl
dnl
define(AC_ACVERSION, 1.103)dnl
define(AC_ACVERSION, 1.104)dnl
dnl This is defined by the --version option of the autoconf script.
ifdef([AC_PRINT_VERSION], [Autoconf version AC_ACVERSION
m4exit(0)])dnl
@ -84,9 +84,7 @@ ac_help=])dnl
dnl
dnl AC_INIT_PARSE_ARGS()
AC_DEFUN(AC_INIT_PARSE_ARGS,
[AC_BEFORE([$0], [AC_ARG_ENABLE])dnl
AC_BEFORE([$0], [AC_ARG_WITH])dnl
# Save the original args to write them into config.status later.
[# Save the original args to write them into config.status later.
configure_args="[$]@"
# Omit some internal, obsolete, or unimplemented options to make the
@ -381,13 +379,7 @@ divert(AC_DIVERSION_NORMAL)dnl
dnl
dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
AC_DEFUN(AC_INIT_PREPARE,
[AC_BEFORE([$0], [AC_ARG_ENABLE])dnl
AC_BEFORE([$0], [AC_ARG_WITH])dnl
AC_BEFORE([$0], [AC_CONFIG_HEADER])dnl
AC_BEFORE([$0], [AC_REVISION])dnl
AC_BEFORE([$0], [AC_PREREQ])dnl
dnl AC_BEFORE([$0], [AC_CONFIG_SUBDIRS])dnl
trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
[trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
trap 'rm -fr confdefs* $ac_clean_files' 0
# File descriptor usage:
@ -1139,12 +1131,15 @@ dnl
dnl AC_TRY_LINK(INCLUDES, FUNCTION-BODY,
dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
AC_DEFUN(AC_TRY_LINK,
[dnl We use return because because C++ requires a prototype for exit.
cat > conftest.${ac_ext} <<EOF
[cat > conftest.${ac_ext} <<EOF
dnl This sometimes fails to find confdefs.h, for some reason.
dnl [#]line __LINE__ "[$]0"
#line __LINE__ "configure"
#include "confdefs.h"
ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
extern "C" void exit(int);
#endif
])dnl
[$1]
int main() { return 0; }
int t() {
@ -1175,6 +1170,10 @@ else
cat > conftest.${ac_ext} <<EOF
#line __LINE__ "configure"
#include "confdefs.h"
ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
extern "C" void exit(int);
#endif
])dnl
[$1]
EOF
eval $ac_compile
@ -1243,7 +1242,11 @@ AC_CACHE_VAL(ac_cv_func_$1,
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char $1(); $1();
]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
extern "C"
#endif
])dnl
[char $1(); $1();
#endif
], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")])dnl
if eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then

View File

@ -702,7 +702,12 @@ AC_TRY_RUN([/* Thanks to Paul Eggert for this test. */
Test for this by using a static variable whose address
is put into a register that is clobbered by the vfork. */
static
sparc_address_test (arg) int arg; {
#ifdef __cplusplus
sparc_address_test (int arg)
#else
sparc_address_test (arg) int arg;
#endif
{
static pid_t child;
if (!child) {
child = vfork ();
@ -1248,27 +1253,6 @@ if test $ac_cv_c_bigendian = yes; then
fi
])dnl
dnl
AC_DEFUN(AC_C_ARG_ARRAY,
[AC_MSG_CHECKING(whether the address of an argument can be used as an array)
AC_CACHE_VAL(ac_cv_c_arg_array,
[AC_TRY_RUN([main() {
/* Return 0 iff arg arrays are ok. */
exit(!x(1, 2, 3, 4));
}
x(a, b, c, d) {
return y(a, &b);
}
/* Return 1 iff arg arrays are ok. */
y(a, b) int *b; {
return a == 1 && b[0] == 2 && b[1] == 3 && b[2] == 4;
}], ac_cv_c_arg_array=no, ac_cv_c_arg_array=yes)
rm -f core])dnl
AC_MSG_RESULT($ac_cv_c_arg_array)
if test $ac_cv_c_arg_array = no; then
AC_DEFINE(NO_ARG_ARRAY)
fi
])dnl
dnl
AC_DEFUN(AC_C_INLINE,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_MSG_CHECKING([for inline])
@ -1610,7 +1594,15 @@ else
fi
fi
# Check for additional X libraries.
# Check for libraries that R6 introduced. Xt/Xaw programs need these.
ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -L$x_libraries"
AC_HAVE_LIBRARY(ICE, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lICE"])
AC_HAVE_LIBRARY(SM, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM"])
LDFLAGS="$ac_save_LDFLAGS"
# Check for system-dependent libraries X programs must link with.
if test "$ISC" = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
@ -1624,6 +1616,12 @@ else
AC_CHECK_LIB(dnet_stub, dnet_ntoa,
[X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
fi
# msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT.
# Not sure which flavor of 386 Unix this is, but it seems harmless to
# check for it.
AC_HAVE_LIBRARY(nsl, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"])
# lieder@skyler.mavd.honeywell.com says without -lsocket,
# socket/setsockopt and other routines are undefined under SCO ODT 2.0.
# But -lsocket is broken on IRIX, according to simon@lia.di.epfl.ch.

View File

@ -6,8 +6,8 @@
@c @setchapternewpage odd
@c %**end of header
@set EDITION 1.103
@set VERSION 1.103
@set EDITION 1.104
@set VERSION 1.104
@set UPDATED August 1994
@iftex
@ -954,26 +954,26 @@ something like the following, which assumes that you have also called
@example
@group
#ifdef HAVE_UNISTD_H
#include <sys/types.h>
#include <unistd.h>
# include <sys/types.h>
# include <unistd.h>
#endif
#ifdef HAVE_DIRENT_H
# include <dirent.h>
# define NAMLEN(dirent) (strlen((dirent)->d_name))
#else /* !HAVE_DIRENT_H */
#else
# define dirent direct
# define NAMLEN(dirent) ((dirent)->d_namlen)
# ifdef HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif /* HAVE_SYS_NDIR_H */
# endif
# ifdef HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif /* HAVE_SYS_DIR_H */
# endif
# ifdef HAVE_NDIR_H
# include <ndir.h>
# endif /* HAVE_NDIR_H */
#endif /* !HAVE_DIRENT_H */
# endif
#endif
@end group
@end example
@ -1024,15 +1024,14 @@ Then, in the code, use a test like this:
@example
@group
/* memory.h might conflict with an ANSI string.h, or strings.h. */
#if STDC_HEADERS || HAVE_STRING_H
# include <string.h>
/* An ANSI string.h and pre-ANSI memory.h might conflict. */
# if !STDC_HEADERS && HAVE_MEMORY_H
# include <memory.h>
# endif /* not STDC_HEADERS and HAVE_MEMORY_H */
#else /* not STDC_HEADERS and not HAVE_STRING_H */
# endif
#else
# include <strings.h>
/* memory.h and strings.h conflict on some systems. */
# ifndef strchr
# define strchr index
# endif
@ -1045,7 +1044,7 @@ Then, in the code, use a test like this:
# ifndef memcmp
# define memcmp(s1, s2, n) bcmp ((s1), (s2), (n))
# endif
#endif /* not STDC_HEADERS and not HAVE_STRING_H */
#endif
@end group
@end example
@ -1424,15 +1423,6 @@ macro calls @code{AC_STRUCT_TM} if it hasn't been called already.
The following macros check for C compiler or machine architecture
features:
@defmac AC_C_ARG_ARRAY
@maindex C_ARG_ARRAY
@cvindex NO_ARG_ARRAY
If the address of an argument to a C function can not be used like
the start of an array, define @code{NO_ARG_ARRAY}. This ability allows
a sequence of arguments with the same type to be accessed as if they
were an array of values.
@end defmac
@defmac AC_C_BIGENDIAN
@maindex C_BIGENDIAN
@cvindex WORDS_BIGENDIAN
@ -1991,7 +1981,8 @@ macro uses @code{CFLAGS} or @code{CXXFLAGS}, @code{CPPFLAGS},
backquote substitutions are performed. If it compiles and links
successfully and returns an exit status of 0 when executed, run shell
commands @var{action-if-true}. Otherwise run shell commands
@var{action-if-false}. This macro uses @code{CFLAGS} or
@var{action-if-false}; the exit status of the program is available in
the shell variable @samp{$?}. This macro uses @code{CFLAGS} or
@code{CXXFLAGS}, @code{CPPFLAGS}, @code{LDFLAGS}, and @code{LIBS} when
compiling.
@ -2015,12 +2006,15 @@ future use (@pxref{Caching Values}, for more information).
@defmac AC_CHECK_FUNC (@var{function}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
@maindex CHECK_FUNC
If @var{function} is available, run shell commands
If C function @var{function} is available, run shell commands
@var{action-if-found}, otherwise @var{action-if-not-found}. If the
functions might be in libraries other than the default C library, first
call @code{AC_CHECK_LIB} for those libraries. If you just want to
define a symbol if the function is available, consider using
@code{AC_CHECK_FUNCS} instead.
@code{AC_CHECK_FUNCS} instead. This macro checks for functions with C
linkage even when @code{AC_LANG_CPLUSPLUS} has been called, since C++ is
more standardized than C is. (@pxref{Language Choice}, for more
information about selecting the language for checks.)
@end defmac
@defmac AC_CHECK_FUNCS (@var{function}@dots{} @r{[}, @var{action}@r{]})
@ -2983,13 +2977,23 @@ tests impossible. You do this by passing the optional last argument to
@node Guidelines, Tricks, , Test Programs
@subsection Guidelines for Test Programs
Test programs should return 0 if the test succeeds, nonzero otherwise,
so that success can be distinguished easily from a core dump or other
failure; segmentation violations and other failures produce a nonzero
exit status. Test programs should @code{exit}, not @code{return}, from
@code{main}, because on some systems the argument to @code{return} in
@code{main} is ignored. They should not write anything to the standard
output.
Test programs should not write anything to the standard output. They
should return 0 if the test succeeds, nonzero otherwise, so that success
can be distinguished easily from a core dump or other failure;
segmentation violations and other failures produce a nonzero exit
status. Test programs should @code{exit}, not @code{return}, from
@code{main}, because on some systems (old Suns, at least) the argument
to @code{return} in @code{main} is ignored. Functions that take
arguments should have a prototype conditionalized for C++. In practice,
test programs rarely need functions that take arguments.
@example
#ifdef __cplusplus
foo(int i)
#else
foo(i) int i;
#endif
@end example
Test programs can use @code{#if} or @code{#ifdef} to check the values of
preprocessor macros defined by tests that have already run. For
@ -3108,11 +3112,13 @@ By default, configure uses @file{./config.cache} as the cache file,
creating it if it does not exist already. @code{configure} accepts the
@samp{--cache-file=@var{file}} option to use a different cache file;
that is what @code{configure} does when it calls @code{configure}
scripts in subdirectories, so they share the cache. @xref{Setup}, for
information on configuring subdirectories with the
@code{AC_CONFIG_SUBDIRS} macro. @file{config.status} only pays
attention to the cache file if it is given the @samp{--recheck} option,
which makes it rerun @code{configure}.
scripts in subdirectories, so they share the cache. Giving
@samp{--cache-file=/dev/null} disables caching, for debugging
@code{configure}. @xref{Setup}, for information on configuring
subdirectories with the @code{AC_CONFIG_SUBDIRS} macro.
@file{config.status} only pays attention to the cache file if it is
given the @samp{--recheck} option, which makes it rerun
@code{configure}.
It is wrong to try to distribute cache files for particular system types.
There is too much room for error in doing that, and too much
@ -3349,6 +3355,7 @@ stamp-h.in: configure.in aclocal.m4 acconfig.h config.h.top config.h.bot
# config.status might not change config.h
# Don't rerun config.status if we just configured.
# Use || so the command line always returns success.
config.h: stamp-h
stamp-h: config.h.in config.status
test ! -f stamp-h || ./config.status
@ -3543,7 +3550,7 @@ for backward compatibility, the old names are considered obsolete.
@code{AC_FUNC_ALLOCA}
@item AC_ARG_ARRAY
@maindex ARG_ARRAY
@code{AC_C_ARG_ARRAY}
removed because of limited usefulness
@item AC_CHAR_UNSIGNED
@maindex CHAR_UNSIGNED
@code{AC_C_CHAR_UNSIGNED}

View File

@ -6,8 +6,8 @@
@c @setchapternewpage odd
@c %**end of header
@set EDITION 1.103
@set VERSION 1.103
@set EDITION 1.104
@set VERSION 1.104
@set UPDATED August 1994
@iftex
@ -954,26 +954,26 @@ something like the following, which assumes that you have also called
@example
@group
#ifdef HAVE_UNISTD_H
#include <sys/types.h>
#include <unistd.h>
# include <sys/types.h>
# include <unistd.h>
#endif
#ifdef HAVE_DIRENT_H
# include <dirent.h>
# define NAMLEN(dirent) (strlen((dirent)->d_name))
#else /* !HAVE_DIRENT_H */
#else
# define dirent direct
# define NAMLEN(dirent) ((dirent)->d_namlen)
# ifdef HAVE_SYS_NDIR_H
# include <sys/ndir.h>
# endif /* HAVE_SYS_NDIR_H */
# endif
# ifdef HAVE_SYS_DIR_H
# include <sys/dir.h>
# endif /* HAVE_SYS_DIR_H */
# endif
# ifdef HAVE_NDIR_H
# include <ndir.h>
# endif /* HAVE_NDIR_H */
#endif /* !HAVE_DIRENT_H */
# endif
#endif
@end group
@end example
@ -1024,15 +1024,14 @@ Then, in the code, use a test like this:
@example
@group
/* memory.h might conflict with an ANSI string.h, or strings.h. */
#if STDC_HEADERS || HAVE_STRING_H
# include <string.h>
/* An ANSI string.h and pre-ANSI memory.h might conflict. */
# if !STDC_HEADERS && HAVE_MEMORY_H
# include <memory.h>
# endif /* not STDC_HEADERS and HAVE_MEMORY_H */
#else /* not STDC_HEADERS and not HAVE_STRING_H */
# endif
#else
# include <strings.h>
/* memory.h and strings.h conflict on some systems. */
# ifndef strchr
# define strchr index
# endif
@ -1045,7 +1044,7 @@ Then, in the code, use a test like this:
# ifndef memcmp
# define memcmp(s1, s2, n) bcmp ((s1), (s2), (n))
# endif
#endif /* not STDC_HEADERS and not HAVE_STRING_H */
#endif
@end group
@end example
@ -1424,15 +1423,6 @@ macro calls @code{AC_STRUCT_TM} if it hasn't been called already.
The following macros check for C compiler or machine architecture
features:
@defmac AC_C_ARG_ARRAY
@maindex C_ARG_ARRAY
@cvindex NO_ARG_ARRAY
If the address of an argument to a C function can not be used like
the start of an array, define @code{NO_ARG_ARRAY}. This ability allows
a sequence of arguments with the same type to be accessed as if they
were an array of values.
@end defmac
@defmac AC_C_BIGENDIAN
@maindex C_BIGENDIAN
@cvindex WORDS_BIGENDIAN
@ -1991,7 +1981,8 @@ macro uses @code{CFLAGS} or @code{CXXFLAGS}, @code{CPPFLAGS},
backquote substitutions are performed. If it compiles and links
successfully and returns an exit status of 0 when executed, run shell
commands @var{action-if-true}. Otherwise run shell commands
@var{action-if-false}. This macro uses @code{CFLAGS} or
@var{action-if-false}; the exit status of the program is available in
the shell variable @samp{$?}. This macro uses @code{CFLAGS} or
@code{CXXFLAGS}, @code{CPPFLAGS}, @code{LDFLAGS}, and @code{LIBS} when
compiling.
@ -2015,12 +2006,15 @@ future use (@pxref{Caching Values}, for more information).
@defmac AC_CHECK_FUNC (@var{function}, @var{action-if-found} @r{[}, @var{action-if-not-found}@r{]})
@maindex CHECK_FUNC
If @var{function} is available, run shell commands
If C function @var{function} is available, run shell commands
@var{action-if-found}, otherwise @var{action-if-not-found}. If the
functions might be in libraries other than the default C library, first
call @code{AC_CHECK_LIB} for those libraries. If you just want to
define a symbol if the function is available, consider using
@code{AC_CHECK_FUNCS} instead.
@code{AC_CHECK_FUNCS} instead. This macro checks for functions with C
linkage even when @code{AC_LANG_CPLUSPLUS} has been called, since C++ is
more standardized than C is. (@pxref{Language Choice}, for more
information about selecting the language for checks.)
@end defmac
@defmac AC_CHECK_FUNCS (@var{function}@dots{} @r{[}, @var{action}@r{]})
@ -2983,13 +2977,23 @@ tests impossible. You do this by passing the optional last argument to
@node Guidelines, Tricks, , Test Programs
@subsection Guidelines for Test Programs
Test programs should return 0 if the test succeeds, nonzero otherwise,
so that success can be distinguished easily from a core dump or other
failure; segmentation violations and other failures produce a nonzero
exit status. Test programs should @code{exit}, not @code{return}, from
@code{main}, because on some systems the argument to @code{return} in
@code{main} is ignored. They should not write anything to the standard
output.
Test programs should not write anything to the standard output. They
should return 0 if the test succeeds, nonzero otherwise, so that success
can be distinguished easily from a core dump or other failure;
segmentation violations and other failures produce a nonzero exit
status. Test programs should @code{exit}, not @code{return}, from
@code{main}, because on some systems (old Suns, at least) the argument
to @code{return} in @code{main} is ignored. Functions that take
arguments should have a prototype conditionalized for C++. In practice,
test programs rarely need functions that take arguments.
@example
#ifdef __cplusplus
foo(int i)
#else
foo(i) int i;
#endif
@end example
Test programs can use @code{#if} or @code{#ifdef} to check the values of
preprocessor macros defined by tests that have already run. For
@ -3108,11 +3112,13 @@ By default, configure uses @file{./config.cache} as the cache file,
creating it if it does not exist already. @code{configure} accepts the
@samp{--cache-file=@var{file}} option to use a different cache file;
that is what @code{configure} does when it calls @code{configure}
scripts in subdirectories, so they share the cache. @xref{Setup}, for
information on configuring subdirectories with the
@code{AC_CONFIG_SUBDIRS} macro. @file{config.status} only pays
attention to the cache file if it is given the @samp{--recheck} option,
which makes it rerun @code{configure}.
scripts in subdirectories, so they share the cache. Giving
@samp{--cache-file=/dev/null} disables caching, for debugging
@code{configure}. @xref{Setup}, for information on configuring
subdirectories with the @code{AC_CONFIG_SUBDIRS} macro.
@file{config.status} only pays attention to the cache file if it is
given the @samp{--recheck} option, which makes it rerun
@code{configure}.
It is wrong to try to distribute cache files for particular system types.
There is too much room for error in doing that, and too much
@ -3349,6 +3355,7 @@ stamp-h.in: configure.in aclocal.m4 acconfig.h config.h.top config.h.bot
# config.status might not change config.h
# Don't rerun config.status if we just configured.
# Use || so the command line always returns success.
config.h: stamp-h
stamp-h: config.h.in config.status
test ! -f stamp-h || ./config.status
@ -3543,7 +3550,7 @@ for backward compatibility, the old names are considered obsolete.
@code{AC_FUNC_ALLOCA}
@item AC_ARG_ARRAY
@maindex ARG_ARRAY
@code{AC_C_ARG_ARRAY}
removed because of limited usefulness
@item AC_CHAR_UNSIGNED
@maindex CHAR_UNSIGNED
@code{AC_C_CHAR_UNSIGNED}

View File

@ -35,7 +35,7 @@ Install it before installing Autoconf or set the
M4 environment variable to its path name.
)m4exit(2)])dnl
dnl
define(AC_ACVERSION, 1.103)dnl
define(AC_ACVERSION, 1.104)dnl
dnl This is defined by the --version option of the autoconf script.
ifdef([AC_PRINT_VERSION], [Autoconf version AC_ACVERSION
m4exit(0)])dnl
@ -84,9 +84,7 @@ ac_help=])dnl
dnl
dnl AC_INIT_PARSE_ARGS()
AC_DEFUN(AC_INIT_PARSE_ARGS,
[AC_BEFORE([$0], [AC_ARG_ENABLE])dnl
AC_BEFORE([$0], [AC_ARG_WITH])dnl
# Save the original args to write them into config.status later.
[# Save the original args to write them into config.status later.
configure_args="[$]@"
# Omit some internal, obsolete, or unimplemented options to make the
@ -381,13 +379,7 @@ divert(AC_DIVERSION_NORMAL)dnl
dnl
dnl AC_INIT_PREPARE(UNIQUE-FILE-IN-SOURCE-DIR)
AC_DEFUN(AC_INIT_PREPARE,
[AC_BEFORE([$0], [AC_ARG_ENABLE])dnl
AC_BEFORE([$0], [AC_ARG_WITH])dnl
AC_BEFORE([$0], [AC_CONFIG_HEADER])dnl
AC_BEFORE([$0], [AC_REVISION])dnl
AC_BEFORE([$0], [AC_PREREQ])dnl
dnl AC_BEFORE([$0], [AC_CONFIG_SUBDIRS])dnl
trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
[trap 'rm -fr conftest* confdefs* core $ac_clean_files; exit 1' 1 2 15
trap 'rm -fr confdefs* $ac_clean_files' 0
# File descriptor usage:
@ -1139,12 +1131,15 @@ dnl
dnl AC_TRY_LINK(INCLUDES, FUNCTION-BODY,
dnl ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND])
AC_DEFUN(AC_TRY_LINK,
[dnl We use return because because C++ requires a prototype for exit.
cat > conftest.${ac_ext} <<EOF
[cat > conftest.${ac_ext} <<EOF
dnl This sometimes fails to find confdefs.h, for some reason.
dnl [#]line __LINE__ "[$]0"
#line __LINE__ "configure"
#include "confdefs.h"
ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
extern "C" void exit(int);
#endif
])dnl
[$1]
int main() { return 0; }
int t() {
@ -1175,6 +1170,10 @@ else
cat > conftest.${ac_ext} <<EOF
#line __LINE__ "configure"
#include "confdefs.h"
ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
extern "C" void exit(int);
#endif
])dnl
[$1]
EOF
eval $ac_compile
@ -1243,7 +1242,11 @@ AC_CACHE_VAL(ac_cv_func_$1,
choke me
#else
/* Override any gcc2 internal prototype to avoid an error. */
extern char $1(); $1();
]ifelse(AC_LANG, CPLUSPLUS, [#ifdef __cplusplus
extern "C"
#endif
])dnl
[char $1(); $1();
#endif
], eval "ac_cv_func_$1=yes", eval "ac_cv_func_$1=no")])dnl
if eval "test \"`echo '$ac_cv_func_'$1`\" = yes"; then

View File

@ -702,7 +702,12 @@ AC_TRY_RUN([/* Thanks to Paul Eggert for this test. */
Test for this by using a static variable whose address
is put into a register that is clobbered by the vfork. */
static
sparc_address_test (arg) int arg; {
#ifdef __cplusplus
sparc_address_test (int arg)
#else
sparc_address_test (arg) int arg;
#endif
{
static pid_t child;
if (!child) {
child = vfork ();
@ -1248,27 +1253,6 @@ if test $ac_cv_c_bigendian = yes; then
fi
])dnl
dnl
AC_DEFUN(AC_C_ARG_ARRAY,
[AC_MSG_CHECKING(whether the address of an argument can be used as an array)
AC_CACHE_VAL(ac_cv_c_arg_array,
[AC_TRY_RUN([main() {
/* Return 0 iff arg arrays are ok. */
exit(!x(1, 2, 3, 4));
}
x(a, b, c, d) {
return y(a, &b);
}
/* Return 1 iff arg arrays are ok. */
y(a, b) int *b; {
return a == 1 && b[0] == 2 && b[1] == 3 && b[2] == 4;
}], ac_cv_c_arg_array=no, ac_cv_c_arg_array=yes)
rm -f core])dnl
AC_MSG_RESULT($ac_cv_c_arg_array)
if test $ac_cv_c_arg_array = no; then
AC_DEFINE(NO_ARG_ARRAY)
fi
])dnl
dnl
AC_DEFUN(AC_C_INLINE,
[AC_REQUIRE([AC_PROG_CC])dnl
AC_MSG_CHECKING([for inline])
@ -1610,7 +1594,15 @@ else
fi
fi
# Check for additional X libraries.
# Check for libraries that R6 introduced. Xt/Xaw programs need these.
ac_save_LDFLAGS="$LDFLAGS"
LDFLAGS="$LDFLAGS -L$x_libraries"
AC_HAVE_LIBRARY(ICE, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lICE"])
AC_HAVE_LIBRARY(SM, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lSM"])
LDFLAGS="$ac_save_LDFLAGS"
# Check for system-dependent libraries X programs must link with.
if test "$ISC" = yes; then
X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl_s -linet"
@ -1624,6 +1616,12 @@ else
AC_CHECK_LIB(dnet_stub, dnet_ntoa,
[X_EXTRA_LIBS="$X_EXTRA_LIBS -ldnet_stub"])
fi
# msh@cis.ufl.edu says -lnsl (and -lsocket) are needed for his 386/AT.
# Not sure which flavor of 386 Unix this is, but it seems harmless to
# check for it.
AC_HAVE_LIBRARY(nsl, [X_EXTRA_LIBS="$X_EXTRA_LIBS -lnsl"])
# lieder@skyler.mavd.honeywell.com says without -lsocket,
# socket/setsockopt and other routines are undefined under SCO ODT 2.0.
# But -lsocket is broken on IRIX, according to simon@lia.di.epfl.ch.