]> git.eshelyaron.com Git - emacs.git/commitdiff
Replace some src/s undefs by never even checking on relevant platforms
authorGlenn Morris <rgm@gnu.org>
Sat, 7 Jul 2012 01:03:46 +0000 (21:03 -0400)
committerGlenn Morris <rgm@gnu.org>
Sat, 7 Jul 2012 01:03:46 +0000 (21:03 -0400)
* configure.in: (getwd): Don't check for it on unixware.
(random, rint): Don't check for these on hpux.
(res_init, libresolv): Don't check for these on darwin.

* src/s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
* src/s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
* src/s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).

ChangeLog
configure.in
src/ChangeLog
src/s/darwin.h
src/s/hpux10-20.h
src/s/unixware.h

index d73c1f1b5399902ed45ca494bb5ef76f814ca707..1b7fa14edd39ae3f6280110434067cf6653ca7e9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2012-07-07  Glenn Morris  <rgm@gnu.org>
+
+       * configure.in: Rather than checking for things then undef'ing
+       them on some platforms, simply don't check for them.
+       (getwd): Don't check for it on unixware.
+       (random, rint): Don't check for these on hpux.
+       (res_init, libresolv): Don't check for these on darwin.
+
 2012-07-07  Juanma Barranquero  <lekktu@gmail.com>
 
        * lib/makefile.w32-in (GNULIBOBJS): Add $(BLD)/c-ctype.$(O),
index 09551ae58e986da4003067022247fc27e62bc546..fdd7ea0156c5d4188345b09758db0fd2a4b5fb8f 100644 (file)
@@ -2700,9 +2700,9 @@ AC_SUBST(BLESSMAIL_TARGET)
 
 AC_CHECK_FUNCS(gethostname \
 rename closedir mkdir rmdir getrusage get_current_dir_name \
-random lrand48 logb frexp fmod rint cbrt setsid \
+lrand48 logb frexp fmod cbrt setsid \
 strerror fpathconf select euidaccess getpagesize setlocale \
-utimes getrlimit setrlimit setpgid getcwd getwd shutdown getaddrinfo \
+utimes getrlimit setrlimit setpgid getcwd shutdown getaddrinfo \
 __fpending strsignal setitimer \
 sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \
 gai_strerror mkstemp getline getdelim fsync sync \
@@ -2711,6 +2711,22 @@ getpwent endpwent getgrent endgrent \
 touchlock \
 cfmakeraw cfsetspeed copysign __executable_start)
 
+dnl getwd appears to be buggy on SVR4.2, so we don't use it.
+if test $opsys != unixware; then
+  AC_CHECK_FUNCS(getwd)
+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/s/hpux10-20.h.
+case $opsys in
+   hpux*) : ;;
+   *) AC_CHECK_FUNCS(random rint) ;;
+esac
+
 dnl Cannot use AC_CHECK_FUNCS
 AC_CACHE_CHECK([for __builtin_unwind_init],
               emacs_cv_func___builtin_unwind_init,
@@ -2847,33 +2863,40 @@ AC_SUBST(TERMCAP_OBJ)
 
 
 # Do we have res_init, for detecting changes in /etc/resolv.conf?
+# On Darwin, res_init appears not to be useful: see bug#562 and
+# http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01467.html
 resolv=no
-AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>
+
+if test $opsys != darwin; then
+
+  AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>
 #include <arpa/nameser.h>
 #include <resolv.h>]],
     [[return res_init();]])],
     have_res_init=yes, have_res_init=no)
-if test "$have_res_init" = no; then
-  OLIBS="$LIBS"
-  LIBS="$LIBS -lresolv"
-  AC_MSG_CHECKING(for res_init with -lresolv)
-  AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>
+  if test "$have_res_init" = no; then
+    OLIBS="$LIBS"
+    LIBS="$LIBS -lresolv"
+    AC_MSG_CHECKING(for res_init with -lresolv)
+    AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <netinet/in.h>
 #include <arpa/nameser.h>
 #include <resolv.h>]],
-    [[return res_init();]])],
-    have_res_init=yes, have_res_init=no)
-  AC_MSG_RESULT($have_res_init)
-  if test "$have_res_init" = yes ; then
-    resolv=yes
+      [[return res_init();]])],
+      have_res_init=yes, have_res_init=no)
+    AC_MSG_RESULT($have_res_init)
+    if test "$have_res_init" = yes ; then
+      resolv=yes
+    fi
+    LIBS="$OLIBS"
   fi
-  LIBS="$OLIBS"
-fi
 
-if test "$have_res_init" = yes; then
-  AC_DEFINE(HAVE_RES_INIT, 1, [Define to 1 if res_init is available.])
-fi
+  if test "$have_res_init" = yes; then
+    AC_DEFINE(HAVE_RES_INIT, 1, [Define to 1 if res_init is available.])
+  fi
+fi                              dnl !darwin
 
 # Do we need the Hesiod library to provide the support routines?
+dnl FIXME?  Should we be skipping this on Darwin too?
 LIBHESIOD=
 if test "$with_hesiod" != no ; then
   # Don't set $LIBS here -- see comments above.  FIXME which comments?
@@ -2897,7 +2920,7 @@ fi
 AC_SUBST(LIBHESIOD)
 
 # Do we need libresolv (due to res_init or Hesiod)?
-if test "$resolv" = yes ; then
+if test "$resolv" = yes && test $opsys != darwin; then
   AC_DEFINE(HAVE_LIBRESOLV, 1,
             [Define to 1 if you have the resolv library (-lresolv).])
   LIBRESOLV=-lresolv
index ef2d06dc5b04fe0adc53690ad4b85e7b5ac9cbb1..03c92804fb8874c252525f7a532c63511b2edf18 100644 (file)
@@ -1,3 +1,9 @@
+2012-07-07  Glenn Morris  <rgm@gnu.org>
+
+       * s/darwin.h (HAVE_RES_INIT, HAVE_LIBRESOLV):
+       * s/hpux10-20.h (HAVE_RINT, HAVE_RANDOM):
+       * s/unixware.h (HAVE_GETWD): Move undefs to configure (effectively).
+
 2012-07-07  Juanma Barranquero  <lekktu@gmail.com>
 
        * makefile.w32-in (DISPEXTERN_H, $(BLD)/regex.$(O)):
index ce86bc5f5787d86bcb43bb84dfa4273e0dff32ec..b042630ee91a34d1a11ba22a1d25c9bb2a081762 100644 (file)
@@ -106,11 +106,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 #define SYSTEM_PURESIZE_EXTRA 200000
 #endif
 
-/* On Darwin, res_init appears not to be useful: see bug#562 and
-   http://lists.gnu.org/archive/html/emacs-devel/2007-11/msg01467.html  */
-#undef HAVE_RES_INIT
-#undef HAVE_LIBRESOLV
-
 #ifdef emacs
 #define malloc unexec_malloc
 #define realloc unexec_realloc
index 683837891f42dc65bbf11eedf9333a133fcd1149..62bb0f4e344c7d8b029eaf22cc67ceb4bc7f6a65 100644 (file)
@@ -61,23 +61,14 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
    HP-UX 10.20, and that it works for HP-UX 0 as well.  */
 #define NO_EDITRES
 
-/* 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 like this.  */
-#undef HAVE_RINT
-
 /* We have to go this route, rather than hpux9's approach of renaming the
    functions via macros.  The system's stdlib.h has fully prototyped
    declarations, which yields a conflicting definition of srand48; it
    tries to redeclare what was once srandom to be srand48.  So we go
-   with HAVE_LRAND48 being defined.  */
+   with HAVE_LRAND48 being defined.
+   Note we also undef HAVE_RANDOM via configure.  */
 #undef srandom
 #undef random
-#undef HAVE_RANDOM
-
 
 /* Rainer Malzbender <rainer@displaytech.com> says defining
    HAVE_XRMSETDATABASE allows Emacs to compile on HP-UX 10.20 using GCC.  */
index 18d24b28507be16b4f8d471e26f7cebb5d13b99e..1f35287f6d13be484d253e1fb79af8e7b991c97f 100644 (file)
@@ -20,9 +20,6 @@ along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "usg5-4-common.h"
 
-/* #define HAVE_GETWD  (appears to be buggy on SVR4.2) */
-#undef HAVE_GETWD
-
 /* This is the same definition as in usg5-4-common.h, but with sigblock/sigunblock
    rather than sighold/sigrelse, which appear to be BSD4.1 specific.
    It may also be appropriate for SVR4.x