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
------------------------------------------------------------------------------
-* 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.
------------------------------------------------------------------------------
/* 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
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
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
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:
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() {
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
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
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 ();
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])
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"
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.
@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
@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
@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
# 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
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
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.
@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{]})
@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
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
# 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
@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}
@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
@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
@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
# 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
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
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.
@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{]})
@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
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
# 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
@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}
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
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
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:
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() {
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
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
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 ();
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])
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"
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.