]> code.delx.au - gnu-emacs/blobdiff - configure.in
Test for lazy-lock-mode before swapping hooks.
[gnu-emacs] / configure.in
index a977091e79f8e56faef225228d5d750592e1c640..ae5c77ffd108de581aaa16cba659dfadef9b1878 100644 (file)
@@ -4,14 +4,14 @@ dnl   autoconf
 dnl in the directory containing this script.
 dnl
 dnl  Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
 dnl in the directory containing this script.
 dnl
 dnl  Copyright (C) 1994, 1995, 1996 Free Software Foundation, Inc.
-dnl  
+dnl
 dnl  This file is part of GNU Emacs.
 dnl  This file is part of GNU Emacs.
-dnl  
+dnl
 dnl  GNU Emacs is free software; you can redistribute it and/or modify
 dnl  it under the terms of the GNU General Public License as published by
 dnl  the Free Software Foundation; either version 2, or (at your option)
 dnl  any later version.
 dnl  GNU Emacs is free software; you can redistribute it and/or modify
 dnl  it under the terms of the GNU General Public License as published by
 dnl  the Free Software Foundation; either version 2, or (at your option)
 dnl  any later version.
-dnl  
+dnl
 dnl  GNU Emacs is distributed in the hope that it will be useful,
 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 dnl  GNU Emacs is distributed in the hope that it will be useful,
 dnl  but WITHOUT ANY WARRANTY; without even the implied warranty of
 dnl  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -21,7 +21,7 @@ dnl  You should have received a copy of the GNU General Public License
 dnl  along with GNU Emacs; see the file COPYING.  If not, write to
 dnl  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
 dnl  along with GNU Emacs; see the file COPYING.  If not, write to
 dnl  the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
 
-AC_PREREQ(2.4.1)dnl
+AC_PREREQ(2.8)dnl
 AC_INIT(src/lisp.h)
 AC_CONFIG_HEADER(src/config.h:src/config.in)
 
 AC_INIT(src/lisp.h)
 AC_CONFIG_HEADER(src/config.h:src/config.in)
 
@@ -49,7 +49,7 @@ dnl This should be the last --with option, because --with-x is
 dnl added later on when we find the path of X, and it's best to
 dnl keep them together visually.
 AC_ARG_WITH(x-toolkit,
 dnl added later on when we find the path of X, and it's best to
 dnl keep them together visually.
 AC_ARG_WITH(x-toolkit,
-[  --with-x-toolkit=KIT    use an X toolkit (KIT = yes/lucid/athena/motif)],
+[  --with-x-toolkit=KIT    use an X toolkit (KIT = yes/lucid/athena/motif/no)],
 [        case "${withval}" in
            y | ye | yes )      val=athena ;;
            n | no )            val=no  ;;
 [        case "${withval}" in
            y | ye | yes )      val=athena ;;
            n | no )            val=no  ;;
@@ -109,7 +109,8 @@ vpath %.h $(srcdir)\
 vpath %.y $(srcdir)\
 vpath %.l $(srcdir)\
 vpath %.s $(srcdir)\
 vpath %.y $(srcdir)\
 vpath %.l $(srcdir)\
 vpath %.s $(srcdir)\
-vpath %.in $(srcdir)'
+vpath %.in $(srcdir)\
+vpath %.texi $(srcdir)'
 fi
 
 #### Given the configuration name, set machfile and opsysfile to the
 fi
 
 #### Given the configuration name, set machfile and opsysfile to the
@@ -153,7 +154,7 @@ case "${canonical}" in
   *-*-netbsd* )
     opsys=netbsd
     case "${canonical}" in
   *-*-netbsd* )
     opsys=netbsd
     case "${canonical}" in
-      i[345]86-*-netbsd*) machine=intel386 ;;
+      i[3456]86-*-netbsd*) machine=intel386 ;;
       m68k-*-netbsd*)
                        # This is somewhat bogus.
                        machine=hp9000s300 ;;
       m68k-*-netbsd*)
                        # This is somewhat bogus.
                        machine=hp9000s300 ;;
@@ -189,8 +190,8 @@ case "${canonical}" in
     machine=alpha opsys=osf1
   ;;
 
     machine=alpha opsys=osf1
   ;;
 
-  alpha-*-linux* )
-    machine=alpha opsys=linux
+  alpha-*-linux-gnu* )
+    machine=alpha opsys=gnu-linux
   ;;
 
   ## Altos 3068
   ;;
 
   ## Altos 3068
@@ -260,7 +261,7 @@ case "${canonical}" in
   ;;
 
   ## Cubix QBx/386
   ;;
 
   ## Cubix QBx/386
-  i[345]86-cubix-sysv* )
+  i[3456]86-cubix-sysv* )
     machine=intel386 opsys=usg5-3
   ;;
 
     machine=intel386 opsys=usg5-3
   ;;
 
@@ -439,10 +440,10 @@ case "${canonical}" in
   ;;
 
   ## IBM machines
   ;;
 
   ## IBM machines
-  i[345]86-ibm-aix1.1* )
+  i[3456]86-ibm-aix1.1* )
     machine=ibmps2-aix opsys=usg5-2-2
   ;;
     machine=ibmps2-aix opsys=usg5-2-2
   ;;
-  i[345]86-ibm-aix1.[23]* | i[345]86-ibm-aix* )
+  i[3456]86-ibm-aix1.[23]* | i[3456]86-ibm-aix* )
     machine=ibmps2-aix opsys=usg5-3
   ;;
   i370-ibm-aix*)
     machine=ibmps2-aix opsys=usg5-3
   ;;
   i370-ibm-aix*)
@@ -494,30 +495,30 @@ case "${canonical}" in
   ;;
 
   ## Intel 386 machines where we do care about the manufacturer
   ;;
 
   ## Intel 386 machines where we do care about the manufacturer
-  i[345]86-intsys-sysv* )
+  i[3456]86-intsys-sysv* )
     machine=is386 opsys=usg5-2-2
   ;;
 
   ## Prime EXL
     machine=is386 opsys=usg5-2-2
   ;;
 
   ## Prime EXL
-  i[345]86-prime-sysv* )
+  i[3456]86-prime-sysv* )
     machine=i386 opsys=usg5-3
   ;;
 
   ## Sequent Symmetry running Dynix
     machine=i386 opsys=usg5-3
   ;;
 
   ## Sequent Symmetry running Dynix
-  i[345]86-sequent-bsd* )
+  i[3456]86-sequent-bsd* )
     machine=symmetry opsys=bsd4-3
   ;;
 
   ## Sequent Symmetry running DYNIX/ptx
   ## Use the old cpp rather than the newer ANSI one.
     machine=symmetry opsys=bsd4-3
   ;;
 
   ## Sequent Symmetry running DYNIX/ptx
   ## Use the old cpp rather than the newer ANSI one.
-  i[345]86-sequent-ptx* )
+  i[3456]86-sequent-ptx* )
     machine=sequent-ptx opsys=ptx
     NON_GNU_CPP="/lib/cpp"
   ;;
 
   ## Unspecified sysv on an ncr machine defaults to svr4.2.
   ## (Plain usg5-4 doesn't turn on POSIX signals, which we need.)
     machine=sequent-ptx opsys=ptx
     NON_GNU_CPP="/lib/cpp"
   ;;
 
   ## Unspecified sysv on an ncr machine defaults to svr4.2.
   ## (Plain usg5-4 doesn't turn on POSIX signals, which we need.)
-  i[345]86-ncr-sysv* )
+  i[3456]86-ncr-sysv* )
     machine=ncr386 opsys=usg5-4-2
   ;;
 
     machine=ncr386 opsys=usg5-4-2
   ;;
 
@@ -678,22 +679,26 @@ case "${canonical}" in
   ;;
 
   ## Suns
   ;;
 
   ## Suns
+  sparc-*-linux-gnu* )
+    machine=sparc opsys=gnu-linux
+  ;;
+
   *-sun-sunos* | *-sun-bsd* | *-sun-solaris* \
   *-sun-sunos* | *-sun-bsd* | *-sun-solaris* \
-    | i[345]86-*-solaris2* | i[345]86-*-sunos5* | powerpc*-*-solaris2* \
+    | i[3456]86-*-solaris2* | i[3456]86-*-sunos5* | powerpc*-*-solaris2* \
     | rs6000-*-solaris2*)
     case "${canonical}" in
       m68*-sunos1* )   machine=sun1 ;;
       m68*-sunos2* )   machine=sun2 ;;
       m68* )           machine=sun3 ;;
     | rs6000-*-solaris2*)
     case "${canonical}" in
       m68*-sunos1* )   machine=sun1 ;;
       m68*-sunos2* )   machine=sun2 ;;
       m68* )           machine=sun3 ;;
-      i[345]86-sun-sunos[34]* )        machine=sun386 ;;
-      i[345]86-*-* )     machine=intel386 ;;
-      powerpc* | rs6000* )  machine=rs6000 ;;
+      i[3456]86-sun-sunos[34]* )       machine=sun386 ;;
+      i[3456]86-*-* )     machine=intel386 ;;
+      powerpc* | rs6000* )  machine=ibmrs6000 ;;
       sparc* )         machine=sparc ;;
       * )              unported=yes ;;
     esac
     case "${canonical}" in
       ## The Sun386 didn't get past 4.0.
       sparc* )         machine=sparc ;;
       * )              unported=yes ;;
     esac
     case "${canonical}" in
       ## The Sun386 didn't get past 4.0.
-      i[345]86-*-sunos4          ) opsys=sunos4-0 ;;
+      i[3456]86-*-sunos4         ) opsys=sunos4-0 ;;
       *-sunos4.0*        ) opsys=sunos4-0 ;;
       *-sunos4.1.[3-9]* | *-sunos4shr*)
                opsys=sunos4shr
       *-sunos4.0*        ) opsys=sunos4-0 ;;
       *-sunos4.1.[3-9]* | *-sunos4shr*)
                opsys=sunos4shr
@@ -817,7 +822,7 @@ case "${canonical}" in
   ;;
 
   ## Intel 386 machines where we don't care about the manufacturer
   ;;
 
   ## Intel 386 machines where we don't care about the manufacturer
-  i[345]86-*-* )
+  i[3456]86-*-* )
     machine=intel386
     case "${canonical}" in
       *-isc1.* | *-isc2.[01]* )        opsys=386-ix ;;
     machine=intel386
     case "${canonical}" in
       *-isc1.* | *-isc2.[01]* )        opsys=386-ix ;;
@@ -831,8 +836,14 @@ case "${canonical}" in
       *-esix5* )               opsys=esix5r4; NON_GNU_CPP=/usr/lib/cpp ;;
       *-esix* )                        opsys=esix ;;
       *-xenix* )               opsys=xenix ;;
       *-esix5* )               opsys=esix5r4; NON_GNU_CPP=/usr/lib/cpp ;;
       *-esix* )                        opsys=esix ;;
       *-xenix* )               opsys=xenix ;;
-      *-linux* )               opsys=linux ;;
+      *-linux-gnu* )           opsys=gnu-linux ;;
       *-sco3.2v4* )            opsys=sco4 ; NON_GNU_CPP=/lib/cpp  ;;
       *-sco3.2v4* )            opsys=sco4 ; NON_GNU_CPP=/lib/cpp  ;;
+      *-sco3.2v5* )            opsys=sco5 
+                               NON_GNU_CPP=/lib/cpp
+                               # Prevent -belf from being passed to $CPP.
+                               # /lib/cpp does not accept it.
+                               OVERRIDE_CPPFLAGS=
+                               ;;
       *-bsd386* | *-bsdi1* )   opsys=bsd386 ;;
       *-bsdi2* )               opsys=bsdos2 ;;
       *-386bsd* )              opsys=386bsd ;;
       *-bsd386* | *-bsdi1* )   opsys=bsd386 ;;
       *-bsdi2* )               opsys=bsdos2 ;;
       *-386bsd* )              opsys=386bsd ;;
@@ -842,9 +853,9 @@ case "${canonical}" in
     esac
   ;;
 
     esac
   ;;
 
-  ## Linux/68k
-  m68k-*-linux* )
-    machine=m68k opsys=linux
+  ## Linux/68k-based GNU system
+  m68k-*-linux-gnu* )
+    machine=m68k opsys=gnu-linux
   ;;
 
   * )
   ;;
 
   * )
@@ -873,7 +884,11 @@ if test x"${opsys}" = x; then
        opsys=usg5-4 ;;
     *-sysv4.[2-9]* | *-sysvr4.[2-9]* )
        if [ x$NON_GNU_CPP = x ]; then
        opsys=usg5-4 ;;
     *-sysv4.[2-9]* | *-sysvr4.[2-9]* )
        if [ x$NON_GNU_CPP = x ]; then
-         NON_GNU_CPP=/usr/ccs/lib/cpp
+         if [ -f /usr/ccs/lib/cpp ]; then
+           NON_GNU_CPP=/usr/ccs/lib/cpp
+         else
+           NON_GNU_CPP=/lib/cpp
+         fi
        fi
        opsys=usg5-4-2 ;;
     *-sysv4* | *-sysvr4* )             opsys=usg5-4 ;;
        fi
        opsys=usg5-4-2 ;;
     *-sysv4* | *-sysvr4* )             opsys=usg5-4 ;;
@@ -956,7 +971,7 @@ dnl checks for Unix variants
 AC_AIX
 
 dnl checks for header files
 AC_AIX
 
 dnl checks for header files
-AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h)
+AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h linux/version.h)
 AC_HEADER_STDC
 AC_HEADER_TIME
 AC_DECL_SYS_SIGLIST
 AC_HEADER_STDC
 AC_HEADER_TIME
 AC_DECL_SYS_SIGLIST
@@ -1100,7 +1115,7 @@ AC_CHECKING([the machine- and system-dependent files to find out
 ### and REAL_CFLAGS (which we use for real compilation).
 ### The two are the same except on a few systems, where they are made
 ### different to work around various lossages.  For example,
 ### and REAL_CFLAGS (which we use for real compilation).
 ### The two are the same except on a few systems, where they are made
 ### different to work around various lossages.  For example,
-### GCC 2.5 on Linux needs them to be different because it treats -g
+### GCC 2.5 on GNU/Linux needs them to be different because it treats -g
 ### as implying static linking.
 
 ### If the CFLAGS env var is specified, we use that value
 ### as implying static linking.
 
 ### If the CFLAGS env var is specified, we use that value
@@ -1220,7 +1235,12 @@ LISP_FLOAT_TYPE=yes
 
 #### Add the libraries to LIBS and check for some functions.
 
 
 #### Add the libraries to LIBS and check for some functions.
 
-CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS"
+if test x"${OVERRIDE_CPPFLAGS}" != x; then
+  CPPFLAGS="$(OVERRIDE_CPPFLAGS)"
+else
+  CPPFLAGS="$c_switch_system $c_switch_machine $CPPFLAGS"
+fi
+
 LIBS="$libsrc_libs $LIBS"
 
 dnl If found, this defines HAVE_LIBDNET, which m/pmax.h checks,
 LIBS="$libsrc_libs $LIBS"
 
 dnl If found, this defines HAVE_LIBDNET, which m/pmax.h checks,
@@ -1262,7 +1282,7 @@ if test "${HAVE_X11}" = "yes"; then
     export LD_RUN_PATH
   fi
 
     export LD_RUN_PATH
   fi
 
-  if test "${opsys}" = "linux"; then
+  if test "${opsys}" = "gnu-linux"; then
     AC_MSG_CHECKING(whether X on GNU/Linux needs -b to link)
     AC_TRY_LINK([],
      [XOpenDisplay ("foo");],
     AC_MSG_CHECKING(whether X on GNU/Linux needs -b to link)
     AC_TRY_LINK([],
      [XOpenDisplay ("foo");],
@@ -1312,17 +1332,34 @@ fail;
    [AC_MSG_RESULT(before 6)])
 fi
 
    [AC_MSG_RESULT(before 6)])
 fi
 
-if test x"${USE_X_TOOLKIT}" = xmaybe; then
+if test "${window_system}" = "x11"; then
   AC_MSG_CHECKING(X11 version 5)
   AC_TRY_LINK([#include <X11/Xlib.h>],
 [#if XlibSpecificationRelease < 5
 fail;
 #endif
   AC_MSG_CHECKING(X11 version 5)
   AC_TRY_LINK([#include <X11/Xlib.h>],
 [#if XlibSpecificationRelease < 5
 fail;
 #endif
-], [AC_MSG_RESULT(5 or newer; use toolkit by default)
-    USE_X_TOOLKIT=LUCID
+], [AC_MSG_RESULT(5 or newer)
+    HAVE_X11R5=yes
     AC_DEFINE(HAVE_X11R5)],
     AC_DEFINE(HAVE_X11R5)],
-   [AC_MSG_RESULT(before 5; do not use toolkit by default)
-    USE_X_TOOLKIT=none])
+   [
+    HAVE_X11R5=no
+    AC_MSG_RESULT(before 5)])
+fi
+
+if test x"${USE_X_TOOLKIT}" = xmaybe; then
+  if test x"${HAVE_X11R5}" = xyes; then
+    AC_MSG_CHECKING(X11 version 5 with Xaw)
+    AC_TRY_LINK([
+         #include <X11/Intrinsic.h>
+         #include <X11/Xaw/Simple.h>],
+      [],
+      [AC_MSG_RESULT(5 or newer, with Xaw; use toolkit by default)
+       USE_X_TOOLKIT=LUCID],
+      [AC_MSG_RESULT(before 5 or no Xaw; do not use toolkit by default)
+       USE_X_TOOLKIT=none])
+  else
+    USE_X_TOOLKIT=none
+  fi
 fi
 
 X_TOOLKIT_TYPE=$USE_X_TOOLKIT
 fi
 
 X_TOOLKIT_TYPE=$USE_X_TOOLKIT
@@ -1363,10 +1400,17 @@ AC_FUNC_ALLOCA
 
 # fmod, logb, and frexp are found in -lm on most systems.
 # On HPUX 9.01, -lm does not contain logb, so check for sqrt.
 
 # fmod, logb, and frexp are found in -lm on most systems.
 # On HPUX 9.01, -lm does not contain logb, so check for sqrt.
-AC_CHECK_LIB(m, sqrt(0.0) + t)
+AC_CHECK_LIB(m, sqrt)
+
 AC_CHECK_FUNCS(gettimeofday gethostname dup2 rename closedir mkdir rmdir \
 random lrand48 bcopy bcmp logb frexp fmod ftime res_init setsid \
 AC_CHECK_FUNCS(gettimeofday gethostname dup2 rename closedir mkdir rmdir \
 random lrand48 bcopy bcmp logb frexp fmod ftime res_init setsid \
-strerror fpathconf select mktime eaccess getpagesize tzset)
+strerror fpathconf select mktime eaccess getpagesize tzset setlocale)
+
+# Check this now, so that we will NOT find the above functions in ncurses.
+# That is because we have not set up to link ncurses in lib-src.
+# It's better to believe a function is not available
+# than to expect to find it in ncurses.
+AC_CHECK_LIB(ncurses, tparm)
 
 AC_MSG_CHECKING(whether localtime caches TZ)
 AC_CACHE_VAL(emacs_cv_localtime_cache,
 
 AC_MSG_CHECKING(whether localtime caches TZ)
 AC_CACHE_VAL(emacs_cv_localtime_cache,