** Specific Macros
-- AC_FUNC_CHOWN, AC_FUNC_MALLOC.
+- AC_FUNC_CHOWN, AC_FUNC_MALLOC, AC_FUNC_STRERROR_R,
+ AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
New.
- AC_FUNC_GETGROUPS
getpgrp AC_FUNC_GETPGRP
index AC_HEADER_STDC
ioctl AC_PROG_GCC_TRADITIONAL
+lstat AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
major AC_HEADER_MAJOR
malloc AC_FUNC_MALLOC
makedev AC_HEADER_MAJOR
setvbuf AC_FUNC_SETVBUF_REVERSED
signal AC_TYPE_SIGNAL
strcoll AC_FUNC_STRCOLL
+strerror_r AC_FUNC_STRERROR_R
strftime AC_FUNC_STRFTIME
utime AC_FUNC_UTIME_NULL
vfork AC_FUNC_VFORK
# for (if not specified, a default list is used). This just gives the
# user an opportunity to specify an alternative search list for the C++
# compiler.
-# aCC HP-UX C++ compiler
+# aCC HP-UX C++ compiler much better than `CC', so test before.
# KCC KAI C++ compiler
# RCC Rational C++
# xlC_r AIX C Set++ (with support for reentrant code)
AC_LANG_PUSH(C++)
AC_CHECK_TOOLS(CXX,
$CCC m4_default([$1],
- [g++ c++ gpp CC cxx cc++ cl aCC KCC RCC xlC_r xlC]),
+ [g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r xlC]),
g++)
_AC_LANG_COMPILER_WORKS
[ac_cv_c_inline=$ac_kw; break])
done
])
-case "$ac_cv_c_inline" in
+case $ac_cv_c_inline in
inline | yes) ;;
no) AC_DEFINE(inline,,
[Define as `__inline' if that's what the C compiler calls it,
# an argument.
ac_previous_arg=$ac_save_arg
echo $ac_arg | grep '^[^-]' >/dev/null 2>&1 && ac_previous_arg=
- case "$ac_previous_arg" in
+ case $ac_previous_arg in
'')
- case "$ac_arg" in
+ case $ac_arg in
/*.a)
# Append to AC_SEEN if it's not already there.
AC_LIST_MEMBER_OF($ac_arg, $ac_seen,
case), which must not contain underscores, for linking with Fortran.])dnl
AH_TEMPLATE([F77_FUNC_],
[As F77_FUNC, but for C identifiers containing underscores.])dnl
-case "$f77_case,$f77_underscore" in
+case $f77_case,$f77_underscore in
lower,no)
AC_DEFINE([F77_FUNC(name,NAME)], [name])
AC_DEFINE([F77_FUNC_(name,NAME)], [name]) ;;
AC_CHECK_PROG(LEX, flex, flex, lex)
if test -z "$LEXLIB"
then
- case "$LEX" in
+ case $LEX in
flex*) ac_lib=fl ;;
*) ac_lib=l ;;
esac
[ ac_save_IFS=$IFS; IFS=':'
for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
+ 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.
[AC_MSG_CHECKING(whether ln -s works)
AC_CACHE_VAL(ac_cv_prog_LN_S,
[rm -f conftestdata
-if ln -s X conftestdata 2>/dev/null
-then
+if ln -s X conftestdata 2>/dev/null; then
rm -f conftestdata
ac_cv_prog_LN_S="ln -s"
else
])# AC_FUNC_GETPGRP
+# AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
+# -------------------------------------
+# When crosscompiling, be pessimistic so we will end up using the
+# replacement version of lstat that checkes for trailing slashes and
+# calls lstat a second time when necessary.
+AC_DEFUN([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
+[AC_CACHE_CHECK(
+ [whether lstat dereferences a symlink specified with a trailing slash],
+ [ac_cv_func_lstat_dereferences_slashed_symlink],
+[rm -f conftest.sym conftest.file
+echo >conftest.file
+if ln -s conftest.file conftest.sym; then
+ AC_TRY_RUN([
+# include <sys/types.h>
+# include <sys/stat.h>
+
+ int
+ main ()
+ {
+ struct stat sbuf;
+ /* Linux will dereference the symlink and fail.
+ That is better in the sense that it means we will not
+ have to compile and use the lstat wrapper. */
+ exit (lstat ("conftest.sym/", &sbuf) ? 0 : 1);
+ }
+ ],
+ ac_cv_func_lstat_dereferences_slashed_symlink=yes,
+ ac_cv_func_lstat_dereferences_slashed_symlink=no,
+ ac_cv_func_lstat_dereferences_slashed_symlink=no
+ )
+else
+ # If the `ln -s' command failed, then we probably don't even
+ # have an lstat function.
+ ac_cv_func_lstat_dereferences_slashed_symlink=no
+fi
+])
+
+test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
+ AC_DEFINE_UNQUOTED(LSTAT_FOLLOWS_SLASHED_SYMLINK, 1,
+ [Define if `lstat' dereferences a symlink specified
+ with a trailing slash.])
+
+if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
+ AC_LIBOBJ(lstat)
+fi
+])
+
+
# AC_FUNC_MALLOC
# --------------
# Is `malloc (0)' properly handled?
])# AC_FUNC_SETPGRP
+# AC_FUNC_STRERROR_R
+# ------------------
+AC_DEFUN([AC_FUNC_STRERROR_R],
+[# Check strerror_r
+AC_CHECK_FUNCS([strerror_r])
+if test $ac_cv_func_strerror_r = yes; then
+ AC_CHECK_HEADERS(string.h)
+ AC_CACHE_CHECK([for working strerror_r],
+ ac_cv_func_strerror_r_works,
+ [
+ AC_TRY_COMPILE(
+ [
+# include <stdio.h>
+# if HAVE_STRING_H
+# include <string.h>
+# endif
+ ],
+ [
+ int buf; /* avoiding square brackets makes this easier */
+ char x = *strerror_r (0, buf, sizeof buf);
+ ],
+ ac_cv_func_strerror_r_works=yes,
+ ac_cv_func_strerror_r_works=no
+ )
+ if test $ac_cv_func_strerror_r_works = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_WORKING_STRERROR_R, 1,
+ [Define to 1 if `strerror_r' returns a string.])
+ fi
+ ])
+fi
+])# AC_FUNC_STRERROR_R
+
+
# AC_FUNC_STRFTIME
# ----------------
AC_DEFUN([AC_FUNC_STRFTIME],
# Screen out bogus values from the imake configuration. They are
# bogus both because they are the default anyway, and because
# using them would break gcc on systems where it needs fixed includes.
- case "$ac_im_incroot" in
+ case $ac_im_incroot in
/usr/include) ;;
*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
esac
- case "$ac_im_usrlibdir" in
+ case $ac_im_usrlibdir in
/usr/lib | /lib) ;;
*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
esac
overridden in the site shell script).
-@node Invoking configure
-@section Invoking @code{configure}
+@node configure Invocation
+@section @code{configure} Invocation
@code{configure} recognizes the following options to control how it
operates.
# for (if not specified, a default list is used). This just gives the
# user an opportunity to specify an alternative search list for the C++
# compiler.
-# aCC HP-UX C++ compiler
+# aCC HP-UX C++ compiler much better than `CC', so test before.
# KCC KAI C++ compiler
# RCC Rational C++
# xlC_r AIX C Set++ (with support for reentrant code)
AC_LANG_PUSH(C++)
AC_CHECK_TOOLS(CXX,
$CCC m4_default([$1],
- [g++ c++ gpp CC cxx cc++ cl aCC KCC RCC xlC_r xlC]),
+ [g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r xlC]),
g++)
_AC_LANG_COMPILER_WORKS
[ac_cv_c_inline=$ac_kw; break])
done
])
-case "$ac_cv_c_inline" in
+case $ac_cv_c_inline in
inline | yes) ;;
no) AC_DEFINE(inline,,
[Define as `__inline' if that's what the C compiler calls it,
# an argument.
ac_previous_arg=$ac_save_arg
echo $ac_arg | grep '^[^-]' >/dev/null 2>&1 && ac_previous_arg=
- case "$ac_previous_arg" in
+ case $ac_previous_arg in
'')
- case "$ac_arg" in
+ case $ac_arg in
/*.a)
# Append to AC_SEEN if it's not already there.
AC_LIST_MEMBER_OF($ac_arg, $ac_seen,
case), which must not contain underscores, for linking with Fortran.])dnl
AH_TEMPLATE([F77_FUNC_],
[As F77_FUNC, but for C identifiers containing underscores.])dnl
-case "$f77_case,$f77_underscore" in
+case $f77_case,$f77_underscore in
lower,no)
AC_DEFINE([F77_FUNC(name,NAME)], [name])
AC_DEFINE([F77_FUNC_(name,NAME)], [name]) ;;
# for (if not specified, a default list is used). This just gives the
# user an opportunity to specify an alternative search list for the C++
# compiler.
-# aCC HP-UX C++ compiler
+# aCC HP-UX C++ compiler much better than `CC', so test before.
# KCC KAI C++ compiler
# RCC Rational C++
# xlC_r AIX C Set++ (with support for reentrant code)
AC_LANG_PUSH(C++)
AC_CHECK_TOOLS(CXX,
$CCC m4_default([$1],
- [g++ c++ gpp CC cxx cc++ cl aCC KCC RCC xlC_r xlC]),
+ [g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r xlC]),
g++)
_AC_LANG_COMPILER_WORKS
[ac_cv_c_inline=$ac_kw; break])
done
])
-case "$ac_cv_c_inline" in
+case $ac_cv_c_inline in
inline | yes) ;;
no) AC_DEFINE(inline,,
[Define as `__inline' if that's what the C compiler calls it,
# an argument.
ac_previous_arg=$ac_save_arg
echo $ac_arg | grep '^[^-]' >/dev/null 2>&1 && ac_previous_arg=
- case "$ac_previous_arg" in
+ case $ac_previous_arg in
'')
- case "$ac_arg" in
+ case $ac_arg in
/*.a)
# Append to AC_SEEN if it's not already there.
AC_LIST_MEMBER_OF($ac_arg, $ac_seen,
case), which must not contain underscores, for linking with Fortran.])dnl
AH_TEMPLATE([F77_FUNC_],
[As F77_FUNC, but for C identifiers containing underscores.])dnl
-case "$f77_case,$f77_underscore" in
+case $f77_case,$f77_underscore in
lower,no)
AC_DEFINE([F77_FUNC(name,NAME)], [name])
AC_DEFINE([F77_FUNC_(name,NAME)], [name]) ;;
# for (if not specified, a default list is used). This just gives the
# user an opportunity to specify an alternative search list for the C++
# compiler.
-# aCC HP-UX C++ compiler
+# aCC HP-UX C++ compiler much better than `CC', so test before.
# KCC KAI C++ compiler
# RCC Rational C++
# xlC_r AIX C Set++ (with support for reentrant code)
AC_LANG_PUSH(C++)
AC_CHECK_TOOLS(CXX,
$CCC m4_default([$1],
- [g++ c++ gpp CC cxx cc++ cl aCC KCC RCC xlC_r xlC]),
+ [g++ c++ gpp aCC CC cxx cc++ cl KCC RCC xlC_r xlC]),
g++)
_AC_LANG_COMPILER_WORKS
[ac_cv_c_inline=$ac_kw; break])
done
])
-case "$ac_cv_c_inline" in
+case $ac_cv_c_inline in
inline | yes) ;;
no) AC_DEFINE(inline,,
[Define as `__inline' if that's what the C compiler calls it,
# an argument.
ac_previous_arg=$ac_save_arg
echo $ac_arg | grep '^[^-]' >/dev/null 2>&1 && ac_previous_arg=
- case "$ac_previous_arg" in
+ case $ac_previous_arg in
'')
- case "$ac_arg" in
+ case $ac_arg in
/*.a)
# Append to AC_SEEN if it's not already there.
AC_LIST_MEMBER_OF($ac_arg, $ac_seen,
case), which must not contain underscores, for linking with Fortran.])dnl
AH_TEMPLATE([F77_FUNC_],
[As F77_FUNC, but for C identifiers containing underscores.])dnl
-case "$f77_case,$f77_underscore" in
+case $f77_case,$f77_underscore in
lower,no)
AC_DEFINE([F77_FUNC(name,NAME)], [name])
AC_DEFINE([F77_FUNC_(name,NAME)], [name]) ;;
AC_CHECK_PROG(LEX, flex, flex, lex)
if test -z "$LEXLIB"
then
- case "$LEX" in
+ case $LEX in
flex*) ac_lib=fl ;;
*) ac_lib=l ;;
esac
[ ac_save_IFS=$IFS; IFS=':'
for ac_dir in $PATH; do
# Account for people who put trailing slashes in PATH elements.
- case "$ac_dir/" in
+ 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.
[AC_MSG_CHECKING(whether ln -s works)
AC_CACHE_VAL(ac_cv_prog_LN_S,
[rm -f conftestdata
-if ln -s X conftestdata 2>/dev/null
-then
+if ln -s X conftestdata 2>/dev/null; then
rm -f conftestdata
ac_cv_prog_LN_S="ln -s"
else
])# AC_FUNC_GETPGRP
+# AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
+# -------------------------------------
+# When crosscompiling, be pessimistic so we will end up using the
+# replacement version of lstat that checkes for trailing slashes and
+# calls lstat a second time when necessary.
+AC_DEFUN([AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK],
+[AC_CACHE_CHECK(
+ [whether lstat dereferences a symlink specified with a trailing slash],
+ [ac_cv_func_lstat_dereferences_slashed_symlink],
+[rm -f conftest.sym conftest.file
+echo >conftest.file
+if ln -s conftest.file conftest.sym; then
+ AC_TRY_RUN([
+# include <sys/types.h>
+# include <sys/stat.h>
+
+ int
+ main ()
+ {
+ struct stat sbuf;
+ /* Linux will dereference the symlink and fail.
+ That is better in the sense that it means we will not
+ have to compile and use the lstat wrapper. */
+ exit (lstat ("conftest.sym/", &sbuf) ? 0 : 1);
+ }
+ ],
+ ac_cv_func_lstat_dereferences_slashed_symlink=yes,
+ ac_cv_func_lstat_dereferences_slashed_symlink=no,
+ ac_cv_func_lstat_dereferences_slashed_symlink=no
+ )
+else
+ # If the `ln -s' command failed, then we probably don't even
+ # have an lstat function.
+ ac_cv_func_lstat_dereferences_slashed_symlink=no
+fi
+])
+
+test $ac_cv_func_lstat_dereferences_slashed_symlink = yes &&
+ AC_DEFINE_UNQUOTED(LSTAT_FOLLOWS_SLASHED_SYMLINK, 1,
+ [Define if `lstat' dereferences a symlink specified
+ with a trailing slash.])
+
+if test $ac_cv_func_lstat_dereferences_slashed_symlink = no; then
+ AC_LIBOBJ(lstat)
+fi
+])
+
+
# AC_FUNC_MALLOC
# --------------
# Is `malloc (0)' properly handled?
])# AC_FUNC_SETPGRP
+# AC_FUNC_STRERROR_R
+# ------------------
+AC_DEFUN([AC_FUNC_STRERROR_R],
+[# Check strerror_r
+AC_CHECK_FUNCS([strerror_r])
+if test $ac_cv_func_strerror_r = yes; then
+ AC_CHECK_HEADERS(string.h)
+ AC_CACHE_CHECK([for working strerror_r],
+ ac_cv_func_strerror_r_works,
+ [
+ AC_TRY_COMPILE(
+ [
+# include <stdio.h>
+# if HAVE_STRING_H
+# include <string.h>
+# endif
+ ],
+ [
+ int buf; /* avoiding square brackets makes this easier */
+ char x = *strerror_r (0, buf, sizeof buf);
+ ],
+ ac_cv_func_strerror_r_works=yes,
+ ac_cv_func_strerror_r_works=no
+ )
+ if test $ac_cv_func_strerror_r_works = yes; then
+ AC_DEFINE_UNQUOTED(HAVE_WORKING_STRERROR_R, 1,
+ [Define to 1 if `strerror_r' returns a string.])
+ fi
+ ])
+fi
+])# AC_FUNC_STRERROR_R
+
+
# AC_FUNC_STRFTIME
# ----------------
AC_DEFUN([AC_FUNC_STRFTIME],
# Screen out bogus values from the imake configuration. They are
# bogus both because they are the default anyway, and because
# using them would break gcc on systems where it needs fixed includes.
- case "$ac_im_incroot" in
+ case $ac_im_incroot in
/usr/include) ;;
*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
esac
- case "$ac_im_usrlibdir" in
+ case $ac_im_usrlibdir in
/usr/lib | /lib) ;;
*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
esac
getpgrp AC_FUNC_GETPGRP
index AC_HEADER_STDC
ioctl AC_PROG_GCC_TRADITIONAL
+lstat AC_FUNC_LSTAT_FOLLOWS_SLASHED_SYMLINK
major AC_HEADER_MAJOR
malloc AC_FUNC_MALLOC
makedev AC_HEADER_MAJOR
setvbuf AC_FUNC_SETVBUF_REVERSED
signal AC_TYPE_SIGNAL
strcoll AC_FUNC_STRCOLL
+strerror_r AC_FUNC_STRERROR_R
strftime AC_FUNC_STRFTIME
utime AC_FUNC_UTIME_NULL
vfork AC_FUNC_VFORK