Clean up configure-time library handling a bit.

This patch was inspired by emacs-24 2014-04-09T13:37:49Z!sdl.web@gmail.com, which fixed
a bug due to sloppy library handling in 'configure'.
* configure.ac (LIB_MATH, LIB_PTHREAD, LIBXMU):
Use AC_SEARCH_LIBS instead of AC_CHECK_LIB as per Autoconf manual.
(LIB_MATH, LIB_PTHREAD, HAVE_X11, IMAGEMAGICK_LIBS, GTK_LIBS)
(DBUS_LIBS, LIBXMU, XFT_LIBS, LIBXSM, LIBXML2_LIBS, LIBS_MAIL)
(with_kerberos):
Don't let the library choice infect $LIBS.
(dnet_ntoa, cma_open): Remove obsolete tests.
(emacs_pthread_function): Probe for pthread_kill, not pthread_self,
as that's a bit more selective on GNU/Linux.
(LIBXEXT): Remove.
(touchlock): Test for existence when $LIBS_MAIL is in use.
(AC_CHECK_FUNCS): Use only $LIB_MATH in addition to $LIBS
when testing for typical functions like accept4, lrand48.
(random, rint): Remove obsolete HP-UX 9 A.09.05 test.
This commit is contained in:
Paul Eggert 2014-04-13 22:23:31 -07:00
parent f7993853c2
commit 93ca48872e
4 changed files with 90 additions and 114 deletions

View file

@ -1,3 +1,23 @@
2014-04-14 Paul Eggert <eggert@cs.ucla.edu>
Clean up configure-time library handling a bit.
This patch was inspired by emacs-24 bzr 116961, which fixed
a bug due to sloppy library handling in 'configure'.
* configure.ac (LIB_MATH, LIB_PTHREAD, LIBXMU):
Use AC_SEARCH_LIBS instead of AC_CHECK_LIB as per Autoconf manual.
(LIB_MATH, LIB_PTHREAD, HAVE_X11, IMAGEMAGICK_LIBS, GTK_LIBS)
(DBUS_LIBS, LIBXMU, XFT_LIBS, LIBXSM, LIBXML2_LIBS, LIBS_MAIL)
(with_kerberos):
Don't let the library choice infect $LIBS.
(dnet_ntoa, cma_open): Remove obsolete tests.
(emacs_pthread_function): Probe for pthread_kill, not pthread_self,
as that's a bit more selective on GNU/Linux.
(LIBXEXT): Remove.
(touchlock): Test for existence when $LIBS_MAIL is in use.
(AC_CHECK_FUNCS): Use only $LIB_MATH in addition to $LIBS
when testing for typical functions like accept4, lrand48.
(random, rint): Remove obsolete HP-UX 9 A.09.05 test.
2014-04-11 Glenn Morris <rgm@gnu.org> 2014-04-11 Glenn Morris <rgm@gnu.org>
* make-dist: Do not distribute generated admin/grammars/Makefile. * make-dist: Do not distribute generated admin/grammars/Makefile.

View file

@ -200,17 +200,13 @@ HAVE_KRB5_H
HAVE_KRB_H HAVE_KRB_H
HAVE_LANGINFO_CODESET HAVE_LANGINFO_CODESET
HAVE_LIBDGC HAVE_LIBDGC
HAVE_LIBDNET
HAVE_LIBKSTAT HAVE_LIBKSTAT
HAVE_LIBLOCKFILE HAVE_LIBLOCKFILE
HAVE_LIBM
HAVE_LIBMAIL HAVE_LIBMAIL
HAVE_LIBOTF HAVE_LIBOTF
HAVE_LIBPERFSTAT HAVE_LIBPERFSTAT
HAVE_LIBPNG_PNG_H HAVE_LIBPNG_PNG_H
HAVE_LIBPTHREADS
HAVE_LIBSELINUX HAVE_LIBSELINUX
HAVE_LIBXEXT
HAVE_LIBXML2 HAVE_LIBXML2
HAVE_LIBXMU HAVE_LIBXMU
HAVE_LOCALTIME_R HAVE_LOCALTIME_R

View file

@ -1294,8 +1294,17 @@ AC_DEFUN([AC_TYPE_SIZE_T])
# Likewise for obsolescent test for uid_t, gid_t; Emacs assumes them. # Likewise for obsolescent test for uid_t, gid_t; Emacs assumes them.
AC_DEFUN([AC_TYPE_UID_T]) AC_DEFUN([AC_TYPE_UID_T])
# sqrt and other floating-point functions such as fmod and frexp
# are found in -lm on many systems.
OLD_LIBS=$LIBS
AC_SEARCH_LIBS([sqrt], [m])
if test "X$LIBS" = "X$OLD_LIBS"; then
LIB_MATH=
else
LIB_MATH=$ac_cv_search_sqrt
fi
LIBS=$OLD_LIBS
LIB_MATH=-lm
dnl Current possibilities handled by sed (aix4-2 -> aix, dnl Current possibilities handled by sed (aix4-2 -> aix,
dnl gnu-linux -> gnu/linux, etc.): dnl gnu-linux -> gnu/linux, etc.):
dnl gnu, gnu/linux, gnu/kfreebsd, aix, cygwin, darwin, hpux, irix. dnl gnu, gnu/linux, gnu/kfreebsd, aix, cygwin, darwin, hpux, irix.
@ -2044,53 +2053,32 @@ fi
LIBS="$LIBS_SYSTEM $LIBS" LIBS="$LIBS_SYSTEM $LIBS"
dnl If found, this adds -ldnet to LIBS, which Autoconf uses for checks.
AC_CHECK_LIB(dnet, dnet_ntoa)
dnl This causes -lresolv to get used in subsequent tests,
dnl which causes failures on some systems such as HPUX 9.
dnl AC_CHECK_LIB(resolv, gethostbyname)
dnl FIXME replace main with a function we actually want from this library. dnl FIXME replace main with a function we actually want from this library.
AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd") AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd")
dnl Check if pthreads is available. dnl Check for the POSIX thread library.
LIB_PTHREAD= LIB_PTHREAD=
AC_CHECK_HEADERS_ONCE(pthread.h) AC_CHECK_HEADERS_ONCE(pthread.h)
if test "$ac_cv_header_pthread_h"; then if test "$ac_cv_header_pthread_h"; then
dnl gmalloc.c uses pthread_atfork, which is not available on older-style dnl gmalloc.c uses pthread_atfork, which is not available on older-style
dnl hosts such as MirBSD 10, so test for pthread_atfork instead of merely dnl hosts such as MirBSD 10, so test for pthread_atfork instead of merely
dnl testing for pthread_self if Emacs uses gmalloc.c. dnl testing for pthread_kill if Emacs uses gmalloc.c.
if test "$GMALLOC_OBJ" = gmalloc.o; then if test "$GMALLOC_OBJ" = gmalloc.o; then
emacs_pthread_function=pthread_atfork emacs_pthread_function=pthread_atfork
else else
emacs_pthread_function=pthread_self emacs_pthread_function=pthread_kill
fi fi
AC_CHECK_LIB(pthread, $emacs_pthread_function, HAVE_PTHREAD=yes) OLD_LIBS=$LIBS
AC_SEARCH_LIBS([$emacs_pthread_function], [pthread],
[AC_DEFINE([HAVE_PTHREAD], [1],
[Define to 1 if you have pthread (-lpthread).])])
if test "X$LIBS" != "X$OLD_LIBS"; then
eval LIB_PTHREAD=\$ac_cv_search_$emacs_pthread_function
fi fi
if test "$HAVE_PTHREAD" = yes; then LIBS=$OLD_LIBS
case "${canonical}" in
*-hpux*) ;;
*) LIB_PTHREAD="-lpthread"
LIBS="$LIB_PTHREAD $LIBS" ;;
esac
AC_DEFINE(HAVE_PTHREAD, 1, [Define to 1 if you have pthread (-lpthread).])
fi fi
AC_SUBST([LIB_PTHREAD]) AC_SUBST([LIB_PTHREAD])
AC_CHECK_LIB(pthreads, cma_open)
## Note: when using cpp in s/aix4.2.h, this definition depended on
## HAVE_LIBPTHREADS. That was not defined earlier in configure when
## the system file was sourced. Hence the value of LIBS_SYSTEM
## added to LIBS in configure would never contain the pthreads part,
## but the value used in Makefiles might. FIXME?
##
## -lpthreads seems to be necessary for Xlib in X11R6, and should
## be harmless on older versions of X where it happens to exist.
test "$opsys" = "aix4-2" && \
test $ac_cv_lib_pthreads_cma_open = yes && \
LIBS_SYSTEM="$LIBS_SYSTEM -lpthreads"
dnl Check for need for bigtoc support on IBM AIX dnl Check for need for bigtoc support on IBM AIX
case ${host_os} in case ${host_os} in
@ -2107,12 +2095,12 @@ aix*)
;; ;;
esac esac
# Change CFLAGS and CPPFLAGS temporarily so that C_SWITCH_X_SITE gets # Change CFLAGS, CPPFLAGS, and LIBS temporarily so that C_SWITCH_X_SITE
# used for the tests that follow. We set them back to REAL_CFLAGS and # is for the tests that follow. We set them back later on.
# REAL_CPPFLAGS later on.
REAL_CFLAGS="$CFLAGS" REAL_CFLAGS="$CFLAGS"
REAL_CPPFLAGS="$CPPFLAGS" REAL_CPPFLAGS="$CPPFLAGS"
REAL_LIBS="$LIBS"
if test "${HAVE_X11}" = "yes"; then if test "${HAVE_X11}" = "yes"; then
DEFS="$C_SWITCH_X_SITE $DEFS" DEFS="$C_SWITCH_X_SITE $DEFS"
@ -2137,12 +2125,8 @@ if test "${HAVE_X11}" = "yes"; then
[xgnu_linux_first_failure=no], [xgnu_linux_first_failure=no],
[xgnu_linux_first_failure=yes]) [xgnu_linux_first_failure=yes])
if test "${xgnu_linux_first_failure}" = "yes"; then if test "${xgnu_linux_first_failure}" = "yes"; then
OLD_LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE"
OLD_C_SWITCH_X_SITE="$C_SWITCH_X_SITE"
OLD_CPPFLAGS="$CPPFLAGS" OLD_CPPFLAGS="$CPPFLAGS"
OLD_LIBS="$LIBS" OLD_LIBS="$LIBS"
LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout"
C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
CPPFLAGS="$CPPFLAGS -b i486-linuxaout" CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
LIBS="$LIBS -b i486-linuxaout" LIBS="$LIBS -b i486-linuxaout"
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
@ -2151,15 +2135,15 @@ if test "${HAVE_X11}" = "yes"; then
[xgnu_linux_second_failure=yes]) [xgnu_linux_second_failure=yes])
if test "${xgnu_linux_second_failure}" = "yes"; then if test "${xgnu_linux_second_failure}" = "yes"; then
# If we get the same failure with -b, there is no use adding -b. # If we get the same failure with -b, there is no use adding -b.
# So take it out. This plays safe. # So leave it out. This plays safe.
LD_SWITCH_X_SITE="$OLD_LD_SWITCH_X_SITE"
C_SWITCH_X_SITE="$OLD_C_SWITCH_X_SITE"
CPPFLAGS="$OLD_CPPFLAGS"
LIBS="$OLD_LIBS"
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
else else
LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout"
C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
AC_MSG_RESULT(yes) AC_MSG_RESULT(yes)
fi fi
CPPFLAGS=$OLD_CPPFLAGS
LIBS=$OLD_LIBS
else else
AC_MSG_RESULT(no) AC_MSG_RESULT(no)
fi fi
@ -2226,7 +2210,6 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${opsys}" =
if test "${opsys}" = "mingw32"; then if test "${opsys}" = "mingw32"; then
RSVG_LIBS= RSVG_LIBS=
fi fi
LIBS="$RSVG_LIBS $LIBS"
fi fi
fi fi
fi fi
@ -2245,9 +2228,13 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${HAVE_W32}"
if test $HAVE_IMAGEMAGICK = yes; then if test $HAVE_IMAGEMAGICK = yes; then
AC_DEFINE(HAVE_IMAGEMAGICK, 1, [Define to 1 if using imagemagick.]) AC_DEFINE(HAVE_IMAGEMAGICK, 1, [Define to 1 if using imagemagick.])
OLD_CFLAGS=$CFLAGS
OLD_LIBS=$LIBS
CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS" CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS"
LIBS="$IMAGEMAGICK_LIBS $LIBS" LIBS="$IMAGEMAGICK_LIBS $LIBS"
AC_CHECK_FUNCS(MagickExportImagePixels MagickMergeImageLayers) AC_CHECK_FUNCS(MagickExportImagePixels MagickMergeImageLayers)
CFLAGS=$OLD_CFLAGS
LIBS=$OLD_LIBS
fi fi
fi fi
fi fi
@ -2302,10 +2289,12 @@ if test "${opsys}" != "mingw32"; then
fi fi
fi fi
OLD_CFLAGS=$CFLAGS
OLD_LIBS=$LIBS
if test x"$pkg_check_gtk" = xyes; then if test x"$pkg_check_gtk" = xyes; then
AC_SUBST(GTK_LIBS) AC_SUBST(GTK_LIBS)
C_SWITCH_X_SITE="$C_SWITCH_X_SITE $GTK_CFLAGS"
CFLAGS="$CFLAGS $GTK_CFLAGS" CFLAGS="$CFLAGS $GTK_CFLAGS"
LIBS="$GTK_LIBS $LIBS" LIBS="$GTK_LIBS $LIBS"
dnl Try to compile a simple GTK program. dnl Try to compile a simple GTK program.
@ -2337,6 +2326,7 @@ if test x"$pkg_check_gtk" = xyes; then
AC_MSG_ERROR([Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?]); AC_MSG_ERROR([Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?]);
fi fi
else else
C_SWITCH_X_SITE="$C_SWITCH_X_SITE $GTK_CFLAGS"
HAVE_GTK=yes HAVE_GTK=yes
AC_DEFINE(USE_GTK, 1, [Define to 1 if using GTK.]) AC_DEFINE(USE_GTK, 1, [Define to 1 if using GTK.])
GTK_OBJ="gtkutil.o $GTK_OBJ" GTK_OBJ="gtkutil.o $GTK_OBJ"
@ -2405,6 +2395,9 @@ if test "${HAVE_GTK}" = "yes"; then
term_header=gtkutil.h term_header=gtkutil.h
fi fi
CFLAGS=$OLD_CFLAGS
LIBS=$OLD_LIBS
dnl D-Bus has been tested under GNU/Linux only. Must be adapted for dnl D-Bus has been tested under GNU/Linux only. Must be adapted for
dnl other platforms. dnl other platforms.
HAVE_DBUS=no HAVE_DBUS=no
@ -2412,17 +2405,19 @@ DBUS_OBJ=
if test "${with_dbus}" = "yes"; then if test "${with_dbus}" = "yes"; then
PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, HAVE_DBUS=yes, HAVE_DBUS=no) PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, HAVE_DBUS=yes, HAVE_DBUS=no)
if test "$HAVE_DBUS" = yes; then if test "$HAVE_DBUS" = yes; then
LIBS="$LIBS $DBUS_LIBS"
AC_DEFINE(HAVE_DBUS, 1, [Define to 1 if using D-Bus.]) AC_DEFINE(HAVE_DBUS, 1, [Define to 1 if using D-Bus.])
dnl dbus_watch_get_unix_fd has been introduced in D-Bus 1.1.1. dnl dbus_watch_get_unix_fd has been introduced in D-Bus 1.1.1.
dnl dbus_type_is_valid and dbus_validate_* have been introduced in dnl dbus_type_is_valid and dbus_validate_* have been introduced in
dnl D-Bus 1.5.12. dnl D-Bus 1.5.12.
OLD_LIBS=$LIBS
LIBS="$LIBS $DBUS_LIBS"
AC_CHECK_FUNCS(dbus_watch_get_unix_fd \ AC_CHECK_FUNCS(dbus_watch_get_unix_fd \
dbus_type_is_valid \ dbus_type_is_valid \
dbus_validate_bus_name \ dbus_validate_bus_name \
dbus_validate_path \ dbus_validate_path \
dbus_validate_interface \ dbus_validate_interface \
dbus_validate_member) dbus_validate_member)
LIBS=$OLD_LIBS
DBUS_OBJ=dbusbind.o DBUS_OBJ=dbusbind.o
fi fi
fi fi
@ -2645,6 +2640,7 @@ fi
X_TOOLKIT_TYPE=$USE_X_TOOLKIT X_TOOLKIT_TYPE=$USE_X_TOOLKIT
LIBXTR6= LIBXTR6=
LIBXMU=
if test "${USE_X_TOOLKIT}" != "none"; then if test "${USE_X_TOOLKIT}" != "none"; then
AC_MSG_CHECKING(X11 toolkit version) AC_MSG_CHECKING(X11 toolkit version)
AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6, AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6,
@ -2671,37 +2667,20 @@ dnl If using toolkit, check whether libXmu.a exists.
dnl tranle@intellicorp.com says libXmu.a can need XtMalloc in libXt.a to link. dnl tranle@intellicorp.com says libXmu.a can need XtMalloc in libXt.a to link.
OLDLIBS="$LIBS" OLDLIBS="$LIBS"
if test x$HAVE_X11XTR6 = xyes; then if test x$HAVE_X11XTR6 = xyes; then
LIBS="-lXt -lSM -lICE $LIBS" OTHERLIBS='-lXt -lSM -lICE'
else else
LIBS="-lXt $LIBS" OTHERLIBS='-lXt'
fi fi
AC_CHECK_LIB(Xmu, XmuConvertStandardSelection) AC_SEARCH_LIBS([XmuConvertStandardSelection], [Xmu], [], [], [$OTHERLIBS])
test $ac_cv_lib_Xmu_XmuConvertStandardSelection = no && LIBS="$OLDLIBS" if test "X$LIBS" != "X$OLDLIBS"; then
dnl ac_cv_lib_Xmu_XmuConvertStandardSelection is also referenced below. LIBXMU=$ac_cv_search_XmuConvertStandardSelection
fi
LIBS=$OLDLIBS
dnl ac_cv_search_XmuConvertStandardSelection is also referenced below.
fi fi
AC_SUBST(LIBXTR6) AC_SUBST(LIBXTR6)
dnl FIXME the logic here seems weird, but this is what cpp was doing.
dnl Why not just test for libxmu in the normal way?
LIBXMU=-lXmu
case $opsys in
## These systems don't supply Xmu.
hpux* | aix4-2 )
test "X$ac_cv_lib_Xmu_XmuConvertStandardSelection" != "Xyes" && LIBXMU=
;;
mingw32 )
LIBXMU=
;;
esac
AC_SUBST(LIBXMU) AC_SUBST(LIBXMU)
# On Irix 6.5, at least, we need XShapeQueryExtension from -lXext for Xaw3D.
if test "${HAVE_X11}" = "yes"; then
if test "${USE_X_TOOLKIT}" != "none"; then
AC_CHECK_LIB(Xext, XShapeQueryExtension)
fi
fi
LIBXP= LIBXP=
if test "${USE_X_TOOLKIT}" = "MOTIF"; then if test "${USE_X_TOOLKIT}" = "MOTIF"; then
# OpenMotif may be installed in such a way on some GNU/Linux systems. # OpenMotif may be installed in such a way on some GNU/Linux systems.
@ -2876,11 +2855,10 @@ if test "${HAVE_X11}" = "yes"; then
AC_DEFINE(HAVE_XFT, 1, [Define to 1 if you have the Xft library.]) AC_DEFINE(HAVE_XFT, 1, [Define to 1 if you have the Xft library.])
AC_SUBST(XFT_LIBS) AC_SUBST(XFT_LIBS)
C_SWITCH_X_SITE="$C_SWITCH_X_SITE $XFT_CFLAGS" C_SWITCH_X_SITE="$C_SWITCH_X_SITE $XFT_CFLAGS"
else
CPPFLAGS="$OLD_CPPFLAGS"
CFLAGS="$OLD_CFLAGS"
LIBS="$OLD_LIBS"
fi # "${HAVE_XFT}" = "yes" fi # "${HAVE_XFT}" = "yes"
CPPFLAGS=$OLD_CPPFLAGS
CFLAGS=$OLD_CFLAGS
LIBS=$OLD_LIBS
fi # "$HAVE_XFT" != no fi # "$HAVE_XFT" != no
fi # "x${with_xft}" != "xno" fi # "x${with_xft}" != "xno"
@ -3283,10 +3261,6 @@ if test "${HAVE_X11}" = "yes"; then
if test "${HAVE_X_SM}" = "yes"; then if test "${HAVE_X_SM}" = "yes"; then
AC_DEFINE(HAVE_X_SM, 1, [Define to 1 if you have the SM library (-lSM).]) AC_DEFINE(HAVE_X_SM, 1, [Define to 1 if you have the SM library (-lSM).])
LIBXSM="-lSM -lICE" LIBXSM="-lSM -lICE"
case "$LIBS" in
*-lSM*) ;;
*) LIBS="$LIBXSM $LIBS" ;;
esac
fi fi
fi fi
AC_SUBST(LIBXSM) AC_SUBST(LIBXSM)
@ -3362,8 +3336,8 @@ if test "${with_xml2}" != "no"; then
fi fi
if test "${HAVE_LIBXML2}" = "yes"; then if test "${HAVE_LIBXML2}" = "yes"; then
if test "${opsys}" != "mingw32"; then if test "${opsys}" != "mingw32"; then
LIBS="$LIBXML2_LIBS $LIBS" AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no
AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no) [$LIBXML2_LIBS])
else else
LIBXML2_LIBS="" LIBXML2_LIBS=""
fi fi
@ -3392,19 +3366,17 @@ if test $emacs_cv_netdb_declares_h_errno = yes; then
AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.]) AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.])
fi fi
# sqrt and other floating-point functions such as fmod and frexp
# are found in -lm on most systems, but mingw32 doesn't use -lm.
if test "${opsys}" != "mingw32"; then
AC_CHECK_LIB(m, sqrt)
fi
# Check for mail-locking functions in a "mail" library. Probably this should # Check for mail-locking functions in a "mail" library. Probably this should
# have the same check as for liblockfile below. # have the same check as for liblockfile below.
AC_CHECK_LIB(mail, maillock, have_mail=yes, have_mail=no) AC_CHECK_LIB(mail, maillock, have_mail=yes, have_mail=no)
if test $have_mail = yes; then if test $have_mail = yes; then
LIBS_MAIL=-lmail LIBS_MAIL=-lmail
LIBS="$LIBS_MAIL $LIBS"
AC_DEFINE(HAVE_LIBMAIL, 1, [Define to 1 if you have the `mail' library (-lmail).]) AC_DEFINE(HAVE_LIBMAIL, 1, [Define to 1 if you have the `mail' library (-lmail).])
OLD_LIBS=$LIBS
LIBS="$LIBS_MAIL $LIBS"
AC_CHECK_FUNCS(touchlock)
LIBS=$OLD_LIBS
else else
LIBS_MAIL= LIBS_MAIL=
fi fi
@ -3412,7 +3384,6 @@ dnl Debian, at least:
AC_CHECK_LIB(lockfile, maillock, have_lockfile=yes, have_lockfile=no) AC_CHECK_LIB(lockfile, maillock, have_lockfile=yes, have_lockfile=no)
if test $have_lockfile = yes; then if test $have_lockfile = yes; then
LIBS_MAIL=-llockfile LIBS_MAIL=-llockfile
LIBS="$LIBS_MAIL $LIBS"
AC_DEFINE(HAVE_LIBLOCKFILE, 1, [Define to 1 if you have the `lockfile' library (-llockfile).]) AC_DEFINE(HAVE_LIBLOCKFILE, 1, [Define to 1 if you have the `lockfile' library (-llockfile).])
else else
# If we have the shared liblockfile, assume we must use it for mail # If we have the shared liblockfile, assume we must use it for mail
@ -3477,18 +3448,19 @@ case "$mail_lock" in
esac esac
AC_SUBST(BLESSMAIL_TARGET) AC_SUBST(BLESSMAIL_TARGET)
OLD_LIBS=$LIBS
LIBS="$LIB_MATH $LIBS"
AC_CHECK_FUNCS(accept4 gethostname \ AC_CHECK_FUNCS(accept4 gethostname \
getrusage get_current_dir_name \ getrusage get_current_dir_name \
lrand48 \ lrand48 random rint \
select getpagesize setlocale \ select getpagesize setlocale \
getrlimit setrlimit shutdown getaddrinfo \ getrlimit setrlimit shutdown getaddrinfo \
strsignal setitimer \ strsignal setitimer \
sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \ sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \
gai_strerror getline getdelim sync \ gai_strerror getline getdelim sync \
getpwent endpwent getgrent endgrent \ getpwent endpwent getgrent endgrent \
touchlock \
cfmakeraw cfsetspeed copysign __executable_start log2) cfmakeraw cfsetspeed copysign __executable_start log2)
LIBS=$OLD_LIBS
dnl No need to check for aligned_alloc and posix_memalign if using dnl No need to check for aligned_alloc and posix_memalign if using
dnl gmalloc.o, as it supplies them. Don't use these functions on dnl gmalloc.o, as it supplies them. Don't use these functions on
@ -3497,17 +3469,6 @@ if test -z "$GMALLOC_OBJ" && test "$opsys" != darwin; then
AC_CHECK_FUNCS([aligned_alloc posix_memalign], [break]) AC_CHECK_FUNCS([aligned_alloc posix_memalign], [break])
fi fi
## Eric Backus <ericb@lsid.hp.com> says, HP-UX 9.x on HP 700 machines
## has a broken `rint' in some library versions including math library
## version number A.09.05.
## You can fix the math library by installing patch number PHSS_4630.
## But we can fix it more reliably for Emacs by just not using rint.
## We also skip HAVE_RANDOM - see comments in src/conf_post.h.
case $opsys in
hpux*) : ;;
*) AC_CHECK_FUNCS(random rint) ;;
esac
dnl Cannot use AC_CHECK_FUNCS dnl Cannot use AC_CHECK_FUNCS
AC_CACHE_CHECK([for __builtin_unwind_init], AC_CACHE_CHECK([for __builtin_unwind_init],
emacs_cv_func___builtin_unwind_init, emacs_cv_func___builtin_unwind_init,
@ -3724,6 +3685,7 @@ DESLIB=
KRB4LIB= KRB4LIB=
if test "${with_kerberos}" != no; then if test "${with_kerberos}" != no; then
OLD_LIBS=$LIBS
AC_CHECK_LIB(com_err, com_err, have_com_err=yes, have_com_err=no) AC_CHECK_LIB(com_err, com_err, have_com_err=yes, have_com_err=no)
if test $have_com_err = yes; then if test $have_com_err = yes; then
COM_ERRLIB=-lcom_err COM_ERRLIB=-lcom_err
@ -3780,6 +3742,7 @@ if test "${with_kerberos}" != no; then
[AC_CHECK_HEADERS(kerberos/krb.h)])]) [AC_CHECK_HEADERS(kerberos/krb.h)])])
fi fi
AC_CHECK_HEADERS(com_err.h) AC_CHECK_HEADERS(com_err.h)
LIBS=$OLD_LIBS
fi fi
AC_SUBST(COM_ERRLIB) AC_SUBST(COM_ERRLIB)
@ -3994,7 +3957,7 @@ AH_TEMPLATE(NO_EDITRES, [Define if XEditRes should not be used.])
case $opsys in case $opsys in
aix4-2) aix4-2)
dnl Unfortunately without libXmu we cannot support EditRes. dnl Unfortunately without libXmu we cannot support EditRes.
if test x$ac_cv_lib_Xmu_XmuConvertStandardSelection != xyes; then if test "x$ac_cv_search_XmuConvertStandardSelection" = xno; then
AC_DEFINE(NO_EDITRES, 1) AC_DEFINE(NO_EDITRES, 1)
fi fi
;; ;;
@ -4574,6 +4537,7 @@ esac
# Set up the CFLAGS for real compilation, so we can substitute it. # Set up the CFLAGS for real compilation, so we can substitute it.
CFLAGS="$REAL_CFLAGS" CFLAGS="$REAL_CFLAGS"
CPPFLAGS="$REAL_CPPFLAGS" CPPFLAGS="$REAL_CPPFLAGS"
LIBS="$REAL_LIBS"
## Hack to detect a buggy GCC version. ## Hack to detect a buggy GCC version.
if test "x$GCC" = xyes \ if test "x$GCC" = xyes \

View file

@ -87,10 +87,6 @@ typedef bool bool_bf;
#ifdef HPUX #ifdef HPUX
#undef srandom #undef srandom
#undef random #undef random
/* We try to avoid checking for random and rint on hpux in
configure.ac, but some other configure test might check for them as
a dependency, so to be safe we also undefine them here.
*/
#undef HAVE_RANDOM #undef HAVE_RANDOM
#undef HAVE_RINT #undef HAVE_RINT
#endif /* HPUX */ #endif /* HPUX */