aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Eggert2014-04-13 22:23:31 -0700
committerPaul Eggert2014-04-13 22:23:31 -0700
commit93ca48872e6473db782382fc828e65e6540229d6 (patch)
treea4ce4e90eab7bcbb5494a44c6b9709a2db7c6547
parentf7993853c2512d2cb8067c37ea01db4175e37be3 (diff)
downloademacs-93ca48872e6473db782382fc828e65e6540229d6.tar.gz
emacs-93ca48872e6473db782382fc828e65e6540229d6.zip
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.
-rw-r--r--ChangeLog20
-rw-r--r--admin/CPP-DEFINES4
-rw-r--r--configure.ac176
-rw-r--r--src/conf_post.h4
4 files changed, 90 insertions, 114 deletions
diff --git a/ChangeLog b/ChangeLog
index bd710bd283d..e9836af43e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,23 @@
12014-04-14 Paul Eggert <eggert@cs.ucla.edu>
2
3 Clean up configure-time library handling a bit.
4 This patch was inspired by emacs-24 bzr 116961, which fixed
5 a bug due to sloppy library handling in 'configure'.
6 * configure.ac (LIB_MATH, LIB_PTHREAD, LIBXMU):
7 Use AC_SEARCH_LIBS instead of AC_CHECK_LIB as per Autoconf manual.
8 (LIB_MATH, LIB_PTHREAD, HAVE_X11, IMAGEMAGICK_LIBS, GTK_LIBS)
9 (DBUS_LIBS, LIBXMU, XFT_LIBS, LIBXSM, LIBXML2_LIBS, LIBS_MAIL)
10 (with_kerberos):
11 Don't let the library choice infect $LIBS.
12 (dnet_ntoa, cma_open): Remove obsolete tests.
13 (emacs_pthread_function): Probe for pthread_kill, not pthread_self,
14 as that's a bit more selective on GNU/Linux.
15 (LIBXEXT): Remove.
16 (touchlock): Test for existence when $LIBS_MAIL is in use.
17 (AC_CHECK_FUNCS): Use only $LIB_MATH in addition to $LIBS
18 when testing for typical functions like accept4, lrand48.
19 (random, rint): Remove obsolete HP-UX 9 A.09.05 test.
20
12014-04-11 Glenn Morris <rgm@gnu.org> 212014-04-11 Glenn Morris <rgm@gnu.org>
2 22
3 * make-dist: Do not distribute generated admin/grammars/Makefile. 23 * make-dist: Do not distribute generated admin/grammars/Makefile.
diff --git a/admin/CPP-DEFINES b/admin/CPP-DEFINES
index 8bfe2cac570..9d9699d8cc8 100644
--- a/admin/CPP-DEFINES
+++ b/admin/CPP-DEFINES
@@ -200,17 +200,13 @@ HAVE_KRB5_H
200HAVE_KRB_H 200HAVE_KRB_H
201HAVE_LANGINFO_CODESET 201HAVE_LANGINFO_CODESET
202HAVE_LIBDGC 202HAVE_LIBDGC
203HAVE_LIBDNET
204HAVE_LIBKSTAT 203HAVE_LIBKSTAT
205HAVE_LIBLOCKFILE 204HAVE_LIBLOCKFILE
206HAVE_LIBM
207HAVE_LIBMAIL 205HAVE_LIBMAIL
208HAVE_LIBOTF 206HAVE_LIBOTF
209HAVE_LIBPERFSTAT 207HAVE_LIBPERFSTAT
210HAVE_LIBPNG_PNG_H 208HAVE_LIBPNG_PNG_H
211HAVE_LIBPTHREADS
212HAVE_LIBSELINUX 209HAVE_LIBSELINUX
213HAVE_LIBXEXT
214HAVE_LIBXML2 210HAVE_LIBXML2
215HAVE_LIBXMU 211HAVE_LIBXMU
216HAVE_LOCALTIME_R 212HAVE_LOCALTIME_R
diff --git a/configure.ac b/configure.ac
index 9d9b8f7b8c0..ab78dc4ab07 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1294,8 +1294,17 @@ AC_DEFUN([AC_TYPE_SIZE_T])
1294# Likewise for obsolescent test for uid_t, gid_t; Emacs assumes them. 1294# Likewise for obsolescent test for uid_t, gid_t; Emacs assumes them.
1295AC_DEFUN([AC_TYPE_UID_T]) 1295AC_DEFUN([AC_TYPE_UID_T])
1296 1296
1297# sqrt and other floating-point functions such as fmod and frexp
1298# are found in -lm on many systems.
1299OLD_LIBS=$LIBS
1300AC_SEARCH_LIBS([sqrt], [m])
1301if test "X$LIBS" = "X$OLD_LIBS"; then
1302 LIB_MATH=
1303else
1304 LIB_MATH=$ac_cv_search_sqrt
1305fi
1306LIBS=$OLD_LIBS
1297 1307
1298LIB_MATH=-lm
1299dnl Current possibilities handled by sed (aix4-2 -> aix, 1308dnl Current possibilities handled by sed (aix4-2 -> aix,
1300dnl gnu-linux -> gnu/linux, etc.): 1309dnl gnu-linux -> gnu/linux, etc.):
1301dnl gnu, gnu/linux, gnu/kfreebsd, aix, cygwin, darwin, hpux, irix. 1310dnl gnu, gnu/linux, gnu/kfreebsd, aix, cygwin, darwin, hpux, irix.
@@ -2044,53 +2053,32 @@ fi
2044 2053
2045LIBS="$LIBS_SYSTEM $LIBS" 2054LIBS="$LIBS_SYSTEM $LIBS"
2046 2055
2047dnl If found, this adds -ldnet to LIBS, which Autoconf uses for checks.
2048AC_CHECK_LIB(dnet, dnet_ntoa)
2049dnl This causes -lresolv to get used in subsequent tests,
2050dnl which causes failures on some systems such as HPUX 9.
2051dnl AC_CHECK_LIB(resolv, gethostbyname)
2052
2053dnl FIXME replace main with a function we actually want from this library. 2056dnl FIXME replace main with a function we actually want from this library.
2054AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd") 2057AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd")
2055 2058
2056dnl Check if pthreads is available. 2059dnl Check for the POSIX thread library.
2057LIB_PTHREAD= 2060LIB_PTHREAD=
2058AC_CHECK_HEADERS_ONCE(pthread.h) 2061AC_CHECK_HEADERS_ONCE(pthread.h)
2059if test "$ac_cv_header_pthread_h"; then 2062if test "$ac_cv_header_pthread_h"; then
2060 dnl gmalloc.c uses pthread_atfork, which is not available on older-style 2063 dnl gmalloc.c uses pthread_atfork, which is not available on older-style
2061 dnl hosts such as MirBSD 10, so test for pthread_atfork instead of merely 2064 dnl hosts such as MirBSD 10, so test for pthread_atfork instead of merely
2062 dnl testing for pthread_self if Emacs uses gmalloc.c. 2065 dnl testing for pthread_kill if Emacs uses gmalloc.c.
2063 if test "$GMALLOC_OBJ" = gmalloc.o; then 2066 if test "$GMALLOC_OBJ" = gmalloc.o; then
2064 emacs_pthread_function=pthread_atfork 2067 emacs_pthread_function=pthread_atfork
2065 else 2068 else
2066 emacs_pthread_function=pthread_self 2069 emacs_pthread_function=pthread_kill
2067 fi 2070 fi
2068 AC_CHECK_LIB(pthread, $emacs_pthread_function, HAVE_PTHREAD=yes) 2071 OLD_LIBS=$LIBS
2069fi 2072 AC_SEARCH_LIBS([$emacs_pthread_function], [pthread],
2070if test "$HAVE_PTHREAD" = yes; then 2073 [AC_DEFINE([HAVE_PTHREAD], [1],
2071 case "${canonical}" in 2074 [Define to 1 if you have pthread (-lpthread).])])
2072 *-hpux*) ;; 2075 if test "X$LIBS" != "X$OLD_LIBS"; then
2073 *) LIB_PTHREAD="-lpthread" 2076 eval LIB_PTHREAD=\$ac_cv_search_$emacs_pthread_function
2074 LIBS="$LIB_PTHREAD $LIBS" ;; 2077 fi
2075 esac 2078 LIBS=$OLD_LIBS
2076 AC_DEFINE(HAVE_PTHREAD, 1, [Define to 1 if you have pthread (-lpthread).])
2077fi 2079fi
2078AC_SUBST([LIB_PTHREAD]) 2080AC_SUBST([LIB_PTHREAD])
2079 2081
2080AC_CHECK_LIB(pthreads, cma_open)
2081
2082## Note: when using cpp in s/aix4.2.h, this definition depended on
2083## HAVE_LIBPTHREADS. That was not defined earlier in configure when
2084## the system file was sourced. Hence the value of LIBS_SYSTEM
2085## added to LIBS in configure would never contain the pthreads part,
2086## but the value used in Makefiles might. FIXME?
2087##
2088## -lpthreads seems to be necessary for Xlib in X11R6, and should
2089## be harmless on older versions of X where it happens to exist.
2090test "$opsys" = "aix4-2" && \
2091 test $ac_cv_lib_pthreads_cma_open = yes && \
2092 LIBS_SYSTEM="$LIBS_SYSTEM -lpthreads"
2093
2094dnl Check for need for bigtoc support on IBM AIX 2082dnl Check for need for bigtoc support on IBM AIX
2095 2083
2096case ${host_os} in 2084case ${host_os} in
@@ -2107,12 +2095,12 @@ aix*)
2107 ;; 2095 ;;
2108esac 2096esac
2109 2097
2110# Change CFLAGS and CPPFLAGS temporarily so that C_SWITCH_X_SITE gets 2098# Change CFLAGS, CPPFLAGS, and LIBS temporarily so that C_SWITCH_X_SITE
2111# used for the tests that follow. We set them back to REAL_CFLAGS and 2099# is for the tests that follow. We set them back later on.
2112# REAL_CPPFLAGS later on.
2113 2100
2114REAL_CFLAGS="$CFLAGS" 2101REAL_CFLAGS="$CFLAGS"
2115REAL_CPPFLAGS="$CPPFLAGS" 2102REAL_CPPFLAGS="$CPPFLAGS"
2103REAL_LIBS="$LIBS"
2116 2104
2117if test "${HAVE_X11}" = "yes"; then 2105if test "${HAVE_X11}" = "yes"; then
2118 DEFS="$C_SWITCH_X_SITE $DEFS" 2106 DEFS="$C_SWITCH_X_SITE $DEFS"
@@ -2137,12 +2125,8 @@ if test "${HAVE_X11}" = "yes"; then
2137 [xgnu_linux_first_failure=no], 2125 [xgnu_linux_first_failure=no],
2138 [xgnu_linux_first_failure=yes]) 2126 [xgnu_linux_first_failure=yes])
2139 if test "${xgnu_linux_first_failure}" = "yes"; then 2127 if test "${xgnu_linux_first_failure}" = "yes"; then
2140 OLD_LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE"
2141 OLD_C_SWITCH_X_SITE="$C_SWITCH_X_SITE"
2142 OLD_CPPFLAGS="$CPPFLAGS" 2128 OLD_CPPFLAGS="$CPPFLAGS"
2143 OLD_LIBS="$LIBS" 2129 OLD_LIBS="$LIBS"
2144 LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout"
2145 C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
2146 CPPFLAGS="$CPPFLAGS -b i486-linuxaout" 2130 CPPFLAGS="$CPPFLAGS -b i486-linuxaout"
2147 LIBS="$LIBS -b i486-linuxaout" 2131 LIBS="$LIBS -b i486-linuxaout"
2148 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], 2132 AC_LINK_IFELSE([AC_LANG_PROGRAM([[]],
@@ -2151,15 +2135,15 @@ if test "${HAVE_X11}" = "yes"; then
2151 [xgnu_linux_second_failure=yes]) 2135 [xgnu_linux_second_failure=yes])
2152 if test "${xgnu_linux_second_failure}" = "yes"; then 2136 if test "${xgnu_linux_second_failure}" = "yes"; then
2153 # If we get the same failure with -b, there is no use adding -b. 2137 # If we get the same failure with -b, there is no use adding -b.
2154 # So take it out. This plays safe. 2138 # So leave it out. This plays safe.
2155 LD_SWITCH_X_SITE="$OLD_LD_SWITCH_X_SITE"
2156 C_SWITCH_X_SITE="$OLD_C_SWITCH_X_SITE"
2157 CPPFLAGS="$OLD_CPPFLAGS"
2158 LIBS="$OLD_LIBS"
2159 AC_MSG_RESULT(no) 2139 AC_MSG_RESULT(no)
2160 else 2140 else
2141 LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -b i486-linuxaout"
2142 C_SWITCH_X_SITE="$C_SWITCH_X_SITE -b i486-linuxaout"
2161 AC_MSG_RESULT(yes) 2143 AC_MSG_RESULT(yes)
2162 fi 2144 fi
2145 CPPFLAGS=$OLD_CPPFLAGS
2146 LIBS=$OLD_LIBS
2163 else 2147 else
2164 AC_MSG_RESULT(no) 2148 AC_MSG_RESULT(no)
2165 fi 2149 fi
@@ -2226,7 +2210,6 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${opsys}" =
2226 if test "${opsys}" = "mingw32"; then 2210 if test "${opsys}" = "mingw32"; then
2227 RSVG_LIBS= 2211 RSVG_LIBS=
2228 fi 2212 fi
2229 LIBS="$RSVG_LIBS $LIBS"
2230 fi 2213 fi
2231 fi 2214 fi
2232fi 2215fi
@@ -2245,9 +2228,13 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${HAVE_W32}"
2245 2228
2246 if test $HAVE_IMAGEMAGICK = yes; then 2229 if test $HAVE_IMAGEMAGICK = yes; then
2247 AC_DEFINE(HAVE_IMAGEMAGICK, 1, [Define to 1 if using imagemagick.]) 2230 AC_DEFINE(HAVE_IMAGEMAGICK, 1, [Define to 1 if using imagemagick.])
2231 OLD_CFLAGS=$CFLAGS
2232 OLD_LIBS=$LIBS
2248 CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS" 2233 CFLAGS="$CFLAGS $IMAGEMAGICK_CFLAGS"
2249 LIBS="$IMAGEMAGICK_LIBS $LIBS" 2234 LIBS="$IMAGEMAGICK_LIBS $LIBS"
2250 AC_CHECK_FUNCS(MagickExportImagePixels MagickMergeImageLayers) 2235 AC_CHECK_FUNCS(MagickExportImagePixels MagickMergeImageLayers)
2236 CFLAGS=$OLD_CFLAGS
2237 LIBS=$OLD_LIBS
2251 fi 2238 fi
2252 fi 2239 fi
2253fi 2240fi
@@ -2302,10 +2289,12 @@ if test "${opsys}" != "mingw32"; then
2302 fi 2289 fi
2303fi 2290fi
2304 2291
2292OLD_CFLAGS=$CFLAGS
2293OLD_LIBS=$LIBS
2294
2305if test x"$pkg_check_gtk" = xyes; then 2295if test x"$pkg_check_gtk" = xyes; then
2306 2296
2307 AC_SUBST(GTK_LIBS) 2297 AC_SUBST(GTK_LIBS)
2308 C_SWITCH_X_SITE="$C_SWITCH_X_SITE $GTK_CFLAGS"
2309 CFLAGS="$CFLAGS $GTK_CFLAGS" 2298 CFLAGS="$CFLAGS $GTK_CFLAGS"
2310 LIBS="$GTK_LIBS $LIBS" 2299 LIBS="$GTK_LIBS $LIBS"
2311 dnl Try to compile a simple GTK program. 2300 dnl Try to compile a simple GTK program.
@@ -2337,6 +2326,7 @@ if test x"$pkg_check_gtk" = xyes; then
2337 AC_MSG_ERROR([Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?]); 2326 AC_MSG_ERROR([Gtk+ wanted, but it does not compile, see config.log. Maybe some x11-devel files missing?]);
2338 fi 2327 fi
2339 else 2328 else
2329 C_SWITCH_X_SITE="$C_SWITCH_X_SITE $GTK_CFLAGS"
2340 HAVE_GTK=yes 2330 HAVE_GTK=yes
2341 AC_DEFINE(USE_GTK, 1, [Define to 1 if using GTK.]) 2331 AC_DEFINE(USE_GTK, 1, [Define to 1 if using GTK.])
2342 GTK_OBJ="gtkutil.o $GTK_OBJ" 2332 GTK_OBJ="gtkutil.o $GTK_OBJ"
@@ -2405,6 +2395,9 @@ if test "${HAVE_GTK}" = "yes"; then
2405 term_header=gtkutil.h 2395 term_header=gtkutil.h
2406fi 2396fi
2407 2397
2398CFLAGS=$OLD_CFLAGS
2399LIBS=$OLD_LIBS
2400
2408dnl D-Bus has been tested under GNU/Linux only. Must be adapted for 2401dnl D-Bus has been tested under GNU/Linux only. Must be adapted for
2409dnl other platforms. 2402dnl other platforms.
2410HAVE_DBUS=no 2403HAVE_DBUS=no
@@ -2412,17 +2405,19 @@ DBUS_OBJ=
2412if test "${with_dbus}" = "yes"; then 2405if test "${with_dbus}" = "yes"; then
2413 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, HAVE_DBUS=yes, HAVE_DBUS=no) 2406 PKG_CHECK_MODULES(DBUS, dbus-1 >= 1.0, HAVE_DBUS=yes, HAVE_DBUS=no)
2414 if test "$HAVE_DBUS" = yes; then 2407 if test "$HAVE_DBUS" = yes; then
2415 LIBS="$LIBS $DBUS_LIBS"
2416 AC_DEFINE(HAVE_DBUS, 1, [Define to 1 if using D-Bus.]) 2408 AC_DEFINE(HAVE_DBUS, 1, [Define to 1 if using D-Bus.])
2417 dnl dbus_watch_get_unix_fd has been introduced in D-Bus 1.1.1. 2409 dnl dbus_watch_get_unix_fd has been introduced in D-Bus 1.1.1.
2418 dnl dbus_type_is_valid and dbus_validate_* have been introduced in 2410 dnl dbus_type_is_valid and dbus_validate_* have been introduced in
2419 dnl D-Bus 1.5.12. 2411 dnl D-Bus 1.5.12.
2412 OLD_LIBS=$LIBS
2413 LIBS="$LIBS $DBUS_LIBS"
2420 AC_CHECK_FUNCS(dbus_watch_get_unix_fd \ 2414 AC_CHECK_FUNCS(dbus_watch_get_unix_fd \
2421 dbus_type_is_valid \ 2415 dbus_type_is_valid \
2422 dbus_validate_bus_name \ 2416 dbus_validate_bus_name \
2423 dbus_validate_path \ 2417 dbus_validate_path \
2424 dbus_validate_interface \ 2418 dbus_validate_interface \
2425 dbus_validate_member) 2419 dbus_validate_member)
2420 LIBS=$OLD_LIBS
2426 DBUS_OBJ=dbusbind.o 2421 DBUS_OBJ=dbusbind.o
2427 fi 2422 fi
2428fi 2423fi
@@ -2645,6 +2640,7 @@ fi
2645X_TOOLKIT_TYPE=$USE_X_TOOLKIT 2640X_TOOLKIT_TYPE=$USE_X_TOOLKIT
2646 2641
2647LIBXTR6= 2642LIBXTR6=
2643LIBXMU=
2648if test "${USE_X_TOOLKIT}" != "none"; then 2644if test "${USE_X_TOOLKIT}" != "none"; then
2649 AC_MSG_CHECKING(X11 toolkit version) 2645 AC_MSG_CHECKING(X11 toolkit version)
2650 AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6, 2646 AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6,
@@ -2671,37 +2667,20 @@ dnl If using toolkit, check whether libXmu.a exists.
2671dnl tranle@intellicorp.com says libXmu.a can need XtMalloc in libXt.a to link. 2667dnl tranle@intellicorp.com says libXmu.a can need XtMalloc in libXt.a to link.
2672 OLDLIBS="$LIBS" 2668 OLDLIBS="$LIBS"
2673 if test x$HAVE_X11XTR6 = xyes; then 2669 if test x$HAVE_X11XTR6 = xyes; then
2674 LIBS="-lXt -lSM -lICE $LIBS" 2670 OTHERLIBS='-lXt -lSM -lICE'
2675 else 2671 else
2676 LIBS="-lXt $LIBS" 2672 OTHERLIBS='-lXt'
2673 fi
2674 AC_SEARCH_LIBS([XmuConvertStandardSelection], [Xmu], [], [], [$OTHERLIBS])
2675 if test "X$LIBS" != "X$OLDLIBS"; then
2676 LIBXMU=$ac_cv_search_XmuConvertStandardSelection
2677 fi 2677 fi
2678 AC_CHECK_LIB(Xmu, XmuConvertStandardSelection) 2678 LIBS=$OLDLIBS
2679 test $ac_cv_lib_Xmu_XmuConvertStandardSelection = no && LIBS="$OLDLIBS" 2679 dnl ac_cv_search_XmuConvertStandardSelection is also referenced below.
2680 dnl ac_cv_lib_Xmu_XmuConvertStandardSelection is also referenced below.
2681fi 2680fi
2682AC_SUBST(LIBXTR6) 2681AC_SUBST(LIBXTR6)
2683
2684dnl FIXME the logic here seems weird, but this is what cpp was doing.
2685dnl Why not just test for libxmu in the normal way?
2686LIBXMU=-lXmu
2687case $opsys in
2688 ## These systems don't supply Xmu.
2689 hpux* | aix4-2 )
2690 test "X$ac_cv_lib_Xmu_XmuConvertStandardSelection" != "Xyes" && LIBXMU=
2691 ;;
2692 mingw32 )
2693 LIBXMU=
2694 ;;
2695esac
2696AC_SUBST(LIBXMU) 2682AC_SUBST(LIBXMU)
2697 2683
2698# On Irix 6.5, at least, we need XShapeQueryExtension from -lXext for Xaw3D.
2699if test "${HAVE_X11}" = "yes"; then
2700 if test "${USE_X_TOOLKIT}" != "none"; then
2701 AC_CHECK_LIB(Xext, XShapeQueryExtension)
2702 fi
2703fi
2704
2705LIBXP= 2684LIBXP=
2706if test "${USE_X_TOOLKIT}" = "MOTIF"; then 2685if test "${USE_X_TOOLKIT}" = "MOTIF"; then
2707 # OpenMotif may be installed in such a way on some GNU/Linux systems. 2686 # OpenMotif may be installed in such a way on some GNU/Linux systems.
@@ -2876,11 +2855,10 @@ if test "${HAVE_X11}" = "yes"; then
2876 AC_DEFINE(HAVE_XFT, 1, [Define to 1 if you have the Xft library.]) 2855 AC_DEFINE(HAVE_XFT, 1, [Define to 1 if you have the Xft library.])
2877 AC_SUBST(XFT_LIBS) 2856 AC_SUBST(XFT_LIBS)
2878 C_SWITCH_X_SITE="$C_SWITCH_X_SITE $XFT_CFLAGS" 2857 C_SWITCH_X_SITE="$C_SWITCH_X_SITE $XFT_CFLAGS"
2879 else
2880 CPPFLAGS="$OLD_CPPFLAGS"
2881 CFLAGS="$OLD_CFLAGS"
2882 LIBS="$OLD_LIBS"
2883 fi # "${HAVE_XFT}" = "yes" 2858 fi # "${HAVE_XFT}" = "yes"
2859 CPPFLAGS=$OLD_CPPFLAGS
2860 CFLAGS=$OLD_CFLAGS
2861 LIBS=$OLD_LIBS
2884 fi # "$HAVE_XFT" != no 2862 fi # "$HAVE_XFT" != no
2885 fi # "x${with_xft}" != "xno" 2863 fi # "x${with_xft}" != "xno"
2886 2864
@@ -3283,10 +3261,6 @@ if test "${HAVE_X11}" = "yes"; then
3283 if test "${HAVE_X_SM}" = "yes"; then 3261 if test "${HAVE_X_SM}" = "yes"; then
3284 AC_DEFINE(HAVE_X_SM, 1, [Define to 1 if you have the SM library (-lSM).]) 3262 AC_DEFINE(HAVE_X_SM, 1, [Define to 1 if you have the SM library (-lSM).])
3285 LIBXSM="-lSM -lICE" 3263 LIBXSM="-lSM -lICE"
3286 case "$LIBS" in
3287 *-lSM*) ;;
3288 *) LIBS="$LIBXSM $LIBS" ;;
3289 esac
3290 fi 3264 fi
3291fi 3265fi
3292AC_SUBST(LIBXSM) 3266AC_SUBST(LIBXSM)
@@ -3362,8 +3336,8 @@ if test "${with_xml2}" != "no"; then
3362 fi 3336 fi
3363 if test "${HAVE_LIBXML2}" = "yes"; then 3337 if test "${HAVE_LIBXML2}" = "yes"; then
3364 if test "${opsys}" != "mingw32"; then 3338 if test "${opsys}" != "mingw32"; then
3365 LIBS="$LIBXML2_LIBS $LIBS" 3339 AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no
3366 AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no) 3340 [$LIBXML2_LIBS])
3367 else 3341 else
3368 LIBXML2_LIBS="" 3342 LIBXML2_LIBS=""
3369 fi 3343 fi
@@ -3392,19 +3366,17 @@ if test $emacs_cv_netdb_declares_h_errno = yes; then
3392 AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.]) 3366 AC_DEFINE(HAVE_H_ERRNO, 1, [Define to 1 if netdb.h declares h_errno.])
3393fi 3367fi
3394 3368
3395# sqrt and other floating-point functions such as fmod and frexp
3396# are found in -lm on most systems, but mingw32 doesn't use -lm.
3397if test "${opsys}" != "mingw32"; then
3398 AC_CHECK_LIB(m, sqrt)
3399fi
3400
3401# Check for mail-locking functions in a "mail" library. Probably this should 3369# Check for mail-locking functions in a "mail" library. Probably this should
3402# have the same check as for liblockfile below. 3370# have the same check as for liblockfile below.
3403AC_CHECK_LIB(mail, maillock, have_mail=yes, have_mail=no) 3371AC_CHECK_LIB(mail, maillock, have_mail=yes, have_mail=no)
3404if test $have_mail = yes; then 3372if test $have_mail = yes; then
3405 LIBS_MAIL=-lmail 3373 LIBS_MAIL=-lmail
3406 LIBS="$LIBS_MAIL $LIBS"
3407 AC_DEFINE(HAVE_LIBMAIL, 1, [Define to 1 if you have the `mail' library (-lmail).]) 3374 AC_DEFINE(HAVE_LIBMAIL, 1, [Define to 1 if you have the `mail' library (-lmail).])
3375
3376 OLD_LIBS=$LIBS
3377 LIBS="$LIBS_MAIL $LIBS"
3378 AC_CHECK_FUNCS(touchlock)
3379 LIBS=$OLD_LIBS
3408else 3380else
3409 LIBS_MAIL= 3381 LIBS_MAIL=
3410fi 3382fi
@@ -3412,7 +3384,6 @@ dnl Debian, at least:
3412AC_CHECK_LIB(lockfile, maillock, have_lockfile=yes, have_lockfile=no) 3384AC_CHECK_LIB(lockfile, maillock, have_lockfile=yes, have_lockfile=no)
3413if test $have_lockfile = yes; then 3385if test $have_lockfile = yes; then
3414 LIBS_MAIL=-llockfile 3386 LIBS_MAIL=-llockfile
3415 LIBS="$LIBS_MAIL $LIBS"
3416 AC_DEFINE(HAVE_LIBLOCKFILE, 1, [Define to 1 if you have the `lockfile' library (-llockfile).]) 3387 AC_DEFINE(HAVE_LIBLOCKFILE, 1, [Define to 1 if you have the `lockfile' library (-llockfile).])
3417else 3388else
3418# If we have the shared liblockfile, assume we must use it for mail 3389# If we have the shared liblockfile, assume we must use it for mail
@@ -3477,18 +3448,19 @@ case "$mail_lock" in
3477esac 3448esac
3478AC_SUBST(BLESSMAIL_TARGET) 3449AC_SUBST(BLESSMAIL_TARGET)
3479 3450
3480 3451OLD_LIBS=$LIBS
3452LIBS="$LIB_MATH $LIBS"
3481AC_CHECK_FUNCS(accept4 gethostname \ 3453AC_CHECK_FUNCS(accept4 gethostname \
3482getrusage get_current_dir_name \ 3454getrusage get_current_dir_name \
3483lrand48 \ 3455lrand48 random rint \
3484select getpagesize setlocale \ 3456select getpagesize setlocale \
3485getrlimit setrlimit shutdown getaddrinfo \ 3457getrlimit setrlimit shutdown getaddrinfo \
3486strsignal setitimer \ 3458strsignal setitimer \
3487sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \ 3459sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \
3488gai_strerror getline getdelim sync \ 3460gai_strerror getline getdelim sync \
3489getpwent endpwent getgrent endgrent \ 3461getpwent endpwent getgrent endgrent \
3490touchlock \
3491cfmakeraw cfsetspeed copysign __executable_start log2) 3462cfmakeraw cfsetspeed copysign __executable_start log2)
3463LIBS=$OLD_LIBS
3492 3464
3493dnl No need to check for aligned_alloc and posix_memalign if using 3465dnl No need to check for aligned_alloc and posix_memalign if using
3494dnl gmalloc.o, as it supplies them. Don't use these functions on 3466dnl 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
3497 AC_CHECK_FUNCS([aligned_alloc posix_memalign], [break]) 3469 AC_CHECK_FUNCS([aligned_alloc posix_memalign], [break])
3498fi 3470fi
3499 3471
3500## Eric Backus <ericb@lsid.hp.com> says, HP-UX 9.x on HP 700 machines
3501## has a broken `rint' in some library versions including math library
3502## version number A.09.05.
3503## You can fix the math library by installing patch number PHSS_4630.
3504## But we can fix it more reliably for Emacs by just not using rint.
3505## We also skip HAVE_RANDOM - see comments in src/conf_post.h.
3506case $opsys in
3507 hpux*) : ;;
3508 *) AC_CHECK_FUNCS(random rint) ;;
3509esac
3510
3511dnl Cannot use AC_CHECK_FUNCS 3472dnl Cannot use AC_CHECK_FUNCS
3512AC_CACHE_CHECK([for __builtin_unwind_init], 3473AC_CACHE_CHECK([for __builtin_unwind_init],
3513 emacs_cv_func___builtin_unwind_init, 3474 emacs_cv_func___builtin_unwind_init,
@@ -3724,6 +3685,7 @@ DESLIB=
3724KRB4LIB= 3685KRB4LIB=
3725 3686
3726if test "${with_kerberos}" != no; then 3687if test "${with_kerberos}" != no; then
3688 OLD_LIBS=$LIBS
3727 AC_CHECK_LIB(com_err, com_err, have_com_err=yes, have_com_err=no) 3689 AC_CHECK_LIB(com_err, com_err, have_com_err=yes, have_com_err=no)
3728 if test $have_com_err = yes; then 3690 if test $have_com_err = yes; then
3729 COM_ERRLIB=-lcom_err 3691 COM_ERRLIB=-lcom_err
@@ -3780,6 +3742,7 @@ if test "${with_kerberos}" != no; then
3780 [AC_CHECK_HEADERS(kerberos/krb.h)])]) 3742 [AC_CHECK_HEADERS(kerberos/krb.h)])])
3781 fi 3743 fi
3782 AC_CHECK_HEADERS(com_err.h) 3744 AC_CHECK_HEADERS(com_err.h)
3745 LIBS=$OLD_LIBS
3783fi 3746fi
3784 3747
3785AC_SUBST(COM_ERRLIB) 3748AC_SUBST(COM_ERRLIB)
@@ -3994,7 +3957,7 @@ AH_TEMPLATE(NO_EDITRES, [Define if XEditRes should not be used.])
3994case $opsys in 3957case $opsys in
3995 aix4-2) 3958 aix4-2)
3996 dnl Unfortunately without libXmu we cannot support EditRes. 3959 dnl Unfortunately without libXmu we cannot support EditRes.
3997 if test x$ac_cv_lib_Xmu_XmuConvertStandardSelection != xyes; then 3960 if test "x$ac_cv_search_XmuConvertStandardSelection" = xno; then
3998 AC_DEFINE(NO_EDITRES, 1) 3961 AC_DEFINE(NO_EDITRES, 1)
3999 fi 3962 fi
4000 ;; 3963 ;;
@@ -4574,6 +4537,7 @@ esac
4574# Set up the CFLAGS for real compilation, so we can substitute it. 4537# Set up the CFLAGS for real compilation, so we can substitute it.
4575CFLAGS="$REAL_CFLAGS" 4538CFLAGS="$REAL_CFLAGS"
4576CPPFLAGS="$REAL_CPPFLAGS" 4539CPPFLAGS="$REAL_CPPFLAGS"
4540LIBS="$REAL_LIBS"
4577 4541
4578## Hack to detect a buggy GCC version. 4542## Hack to detect a buggy GCC version.
4579if test "x$GCC" = xyes \ 4543if test "x$GCC" = xyes \
diff --git a/src/conf_post.h b/src/conf_post.h
index 80d561090ed..05abe057afd 100644
--- a/src/conf_post.h
+++ b/src/conf_post.h
@@ -87,10 +87,6 @@ typedef bool bool_bf;
87#ifdef HPUX 87#ifdef HPUX
88#undef srandom 88#undef srandom
89#undef random 89#undef random
90/* We try to avoid checking for random and rint on hpux in
91 configure.ac, but some other configure test might check for them as
92 a dependency, so to be safe we also undefine them here.
93 */
94#undef HAVE_RANDOM 90#undef HAVE_RANDOM
95#undef HAVE_RINT 91#undef HAVE_RINT
96#endif /* HPUX */ 92#endif /* HPUX */