* ada-mode.texi, autotype.texi, cc-mode.texi, cl.texi:
[bpt/emacs.git] / configure.in
index 0a910da..d68c8aa 100644 (file)
@@ -3,7 +3,7 @@ dnl To rebuild the `configure' script from this, execute the command
 dnl    autoconf
 dnl in the directory containing this script.
 dnl
-dnl  Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
+dnl  Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007
 dnl  Free Software Foundation, Inc.
 dnl
 dnl  This file is part of GNU Emacs.
@@ -23,7 +23,7 @@ dnl  along with GNU Emacs; see the file COPYING.  If not, write to the
 dnl  Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
 dnl  Boston, MA 02110-1301, USA.
 
-AC_PREREQ(2.54)dnl
+AC_PREREQ(2.61)dnl
 AC_INIT(src/lisp.h)
 AC_CONFIG_HEADER(src/config.h:src/config.in)
 
@@ -54,7 +54,9 @@ AC_DEFINE(MAIL_USE_POP))
 AH_TEMPLATE(MAIL_USE_POP, [Define to support POP mail retrieval.])dnl
 AC_ARG_WITH(kerberos,
 [  --with-kerberos         support Kerberos-authenticated POP],
-[AC_DEFINE(KERBEROS)])
+[if test "$withval" = yes; then
+   AC_DEFINE(KERBEROS)
+fi])
 AH_TEMPLATE(KERBEROS,
            [Define to support Kerberos-authenticated POP mail retrieval.])dnl
 AC_ARG_WITH(kerberos5,
@@ -64,11 +66,13 @@ AC_ARG_WITH(kerberos5,
     with_kerberos=yes
     AC_DEFINE(KERBEROS)
   fi
-fi
-AC_DEFINE(KERBEROS5, 1, [Define to use Kerberos 5 instead of Kerberos 4.])])
+  AC_DEFINE(KERBEROS5, 1, [Define to use Kerberos 5 instead of Kerberos 4.])
+fi])
 AC_ARG_WITH(hesiod,
 [  --with-hesiod           support Hesiod to get the POP server host],
-[AC_DEFINE(HESIOD, 1, [Define to support using a Hesiod database to find the POP server.])])
+[if test "$withval" = yes; then
+  AC_DEFINE(HESIOD, 1, [Define to support using a Hesiod database to find the POP server.])
+fi])
 
 AC_ARG_WITH(sound,
 [  --without-sound         don't compile with sound support])
@@ -260,7 +264,6 @@ dnl see the `changequote' comment above.
       m68k-*-netbsd*)
                        # This is somewhat bogus.
                        machine=hp9000s300 ;;
-      powerpc-apple-netbsd*) machine=macppc ;;
       mips-*-netbsd*)  machine=pmax ;;
       mipsel-*-netbsd*)        machine=pmax ;;
       mipseb-*-netbsd*)        machine=pmax ;;
@@ -269,6 +272,9 @@ dnl see the `changequote' comment above.
       sparc*-*-netbsd*)        machine=sparc ;;
       vax-*-netbsd*)   machine=vax ;;
       arm-*-netbsd*)   machine=arm ;;
+      x86_64-*-netbsd*)        machine=amdx86-64 ;;
+      hppa-*-netbsd*)  machine=hp800 ;;
+      shle-*-netbsd*)  machine=sh3el ;;
     esac
   ;;
 
@@ -277,13 +283,17 @@ dnl see the `changequote' comment above.
     opsys=openbsd
     case "${canonical}" in
       alpha*-*-openbsd*)       machine=alpha ;;
-      i386-*-openbsd*) machine=intel386 ;;
-      x86_64-*-openbsd*)    machine=amdx86-64 ;;
-      m68k-*-openbsd*)  machine=hp9000s300 ;;
-      mipsel-*-openbsd*) machine=pmax ;;
-      ns32k-*-openbsd*)        machine=ns32000 ;;
-      sparc-*-openbsd*)        machine=sparc ;;
-      vax-*-openbsd*)  machine=vax ;;
+      arm-*-openbsd*)          machine=arm ;;
+      hppa-*-openbsd*)         machine=hp9000s300 ;;
+      i386-*-openbsd*)         machine=intel386 ;;
+      m68k-*-openbsd*)         machine=hp9000s300 ;;
+      m88k-*-openbsd*)         machine=aviion ;;
+      mips64-*-openbsd*)       machine=mips64 ;;
+      powerpc-*-openbsd*)      machine=macppc ;;
+      sh-*-openbsd*)           machine=sh3el ;;
+      sparc*-*-openbsd*)       machine=sparc ;;
+      vax-*-openbsd*)          machine=vax ;;
+      x86_64-*-openbsd*)       machine=amdx86-64 ;;
     esac
   ;;
 
@@ -376,6 +386,24 @@ dnl see the `changequote' comment above.
     machine=apollo opsys=bsd4-3
   ;;
 
+  ## Apple Darwin / Mac OS X
+  *-apple-darwin* )
+    case "${canonical}" in
+      i[3456]86-* )  machine=intel386 ;;
+      powerpc-* )    machine=powermac ;;
+      * )            unported=yes ;;
+    esac
+    opsys=darwin
+    # Define CPP as follows to make autoconf work correctly.
+    CPP="${CC-cc} -E -no-cpp-precomp"
+    # Use fink packages if available.
+    if test -d /sw/include && test -d /sw/lib; then
+      GCC_TEST_OPTIONS="-I/sw/include -L/sw/lib"
+      CPP="${CPP} ${GCC_TEST_OPTIONS}"
+      NON_GCC_TEST_OPTIONS=${GCC_TEST_OPTIONS}
+    fi
+  ;;
+
   ## AT&T 3b2, 3b5, 3b15, 3b20
   we32k-att-sysv* )
     machine=att3b opsys=usg5-2-2
@@ -674,6 +702,9 @@ dnl see the `changequote' comment above.
   rs6000-ibm-aix4.2* | powerpc-ibm-aix4.2*  )
     machine=ibmrs6000 opsys=aix4-2
   ;;
+  rs6000-ibm-aix4.3* | powerpc-ibm-aix4.3*  )
+    machine=ibmrs6000 opsys=aix4-2
+  ;;
   rs6000-ibm-aix5* | powerpc-ibm-aix5*  )
     machine=ibmrs6000 opsys=aix4-2
   ;;
@@ -999,7 +1030,12 @@ dnl see the `changequote' comment above.
                ;;
       *-sunos5* | *-solaris* )
                opsys=sol2-6
-               NON_GNU_CPP=/usr/ccs/lib/cpp
+               if [ "x$CC" = x/opt/SUNWspro/bin/cc ]; then
+                 ## -Xs prevents spurious whitespace.
+                 NON_GNU_CPP="/opt/SUNWspro/bin/cc -E -Xs"
+               else
+                 NON_GNU_CPP=/usr/ccs/lib/cpp
+               fi
                ;;
       *                          ) opsys=bsd4-2   ;;
     esac
@@ -1152,24 +1188,16 @@ dnl see the `changequote' comment above.
     machine=f301 opsys=uxpv
   ;;
 
-  ## Darwin / Mac OS X
-  powerpc-apple-darwin* )
-    machine=powermac opsys=darwin
-    # Define CPP as follows to make autoconf work correctly.
-    CPP="${CC-cc} -E -no-cpp-precomp"
-    # Use fink packages if available.
-    if test -d /sw/include && test -d /sw/lib; then
-       GCC_TEST_OPTIONS="-I/sw/include -L/sw/lib"
-        CPP="${CPP} ${GCC_TEST_OPTIONS}"
-       NON_GCC_TEST_OPTIONS=${GCC_TEST_OPTIONS}
-    fi
-  ;;
-
   ## AMD x86-64 Linux-based GNU system
   x86_64-*-linux-gnu* )
     machine=amdx86-64 opsys=gnu-linux
   ;;
 
+  ## Tensilica Xtensa Linux-based GNU system    
+  xtensa-*-linux-gnu* )
+    machine=xtensa opsys=gnu-linux
+    ;;
+
   * )
     unported=yes
   ;;
@@ -1520,11 +1548,11 @@ AC_DEFUN([PKG_CHECK_MODULES], [
             succeeded=yes
 
             AC_MSG_CHECKING($1_CFLAGS)
-            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"`
+            $1_CFLAGS=`$PKG_CONFIG --cflags "$2"|sed -e 's,///*,/,g'`
             AC_MSG_RESULT($$1_CFLAGS)
 
             AC_MSG_CHECKING($1_LIBS)
-            $1_LIBS=`$PKG_CONFIG --libs "$2"`
+            $1_LIBS=`$PKG_CONFIG --libs "$2"|sed -e 's,///*,/,g'`
             AC_MSG_RESULT($$1_LIBS)
         else
             AC_MSG_RESULT(no)
@@ -1567,9 +1595,30 @@ if test "${with_sound}" != "no"; then
   fi
   PKG_CHECK_MODULES(ALSA, $ALSA_MODULES, HAVE_ALSA=yes, HAVE_ALSA=no)
   if test $HAVE_ALSA = yes; then
+    SAVE_CFLAGS="$CFLAGS"
+    SAVE_LDFLAGS="$LDFLAGS"
+    CFLAGS="$ALSA_CFLAGS $CFLAGS"
+    LDFLAGS="$ALSA_LIBS $LDFLAGS"
+    AC_TRY_COMPILE([#include <asoundlib.h>], [snd_lib_error_set_handler (0);],
+                    emacs_alsa_normal=yes,
+                   emacs_alsa_normal=no)
+    if test "$emacs_alsa_normal" != yes; then
+      AC_TRY_COMPILE([#include <alsa/asoundlib.h>],
+                     [snd_lib_error_set_handler (0);],
+                     emacs_alsa_subdir=yes,
+                    emacs_alsa_subdir=no)
+      if test "$emacs_alsa_subdir" != yes; then
+        AC_MSG_ERROR([pkg-config found alsa, but it does not compile.  See config.log for error messages.])
+      fi
+      ALSA_CFLAGS="$ALSA_CFLAGS -DALSA_SUBDIR_INCLUDE"
+    fi
+
+    CFLAGS="$SAVE_CFLAGS"
+    LDFLAGS="$SAVE_LDFLAGS"
     LIBSOUND="$LIBSOUND $ALSA_LIBS"
     CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS"
     AC_DEFINE(HAVE_ALSA, 1, [Define to 1 if ALSA is available.])
+    AC_SUBST()
   fi
   AC_SUBST(CFLAGS_SOUND)
 fi
@@ -2122,6 +2171,37 @@ if test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "gtk"; then
   fi
 fi
 
+### Link with -lXft if available to work around a bug.
+HAVE_XFT=maybe
+if test "${HAVE_GTK}" = "yes"; then
+  dnl Check if --with-pkg-config-prog has been given.
+  if test "X${with_pkg_config_prog}" != X; then
+    PKG_CONFIG="${with_pkg_config_prog}"
+  fi
+
+  PKG_CHECK_MODULES(XFT, xft >= 0.13.0, , HAVE_XFT=no)
+  if test "$HAVE_XFT" != no; then
+    OLD_CFLAGS="$CPPFLAGS"
+    OLD_CPPFLAGS="$CFLAGS"
+    OLD_LIBS="$LIBS"
+    CPPFLAGS="$CPPFLAGS $XFT_CFLAGS"
+    CFLAGS="$CFLAGS $XFT_CFLAGS"
+    LIBS="$XFT_LIBS $LIBS"
+    AC_CHECK_HEADER(X11/Xft/Xft.h,
+      AC_CHECK_LIB(Xft, XftFontOpen, HAVE_XFT=yes, , $XFT_LIBS))
+
+    if test "${HAVE_XFT}" = "yes"; then
+      AC_DEFINE(HAVE_XFT, 1, [Define to 1 if you have the Xft library.])
+      AC_SUBST(XFT_LIBS)
+      C_SWITCH_X_SITE="$C_SWITCH_X_SITE $XFT_CFLAGS"
+    else
+      CFLAGS="$OLD_CPPFLAGS"
+      CFLAGS="$OLD_CFLAGS"
+      LIBS="$OLD_LIBS"
+    fi
+  fi
+fi
+
 dnl Do not put whitespace before the #include statements below.
 dnl Older compilers (eg sunos4 cc) choke on it.
 if test x"${USE_X_TOOLKIT}" = xmaybe; then
@@ -2853,7 +2933,7 @@ if test "${REL_ALLOC}" = "yes" ; then
 fi
 
 AH_TOP([/* GNU Emacs site configuration template file.
-   Copyright (C) 1988, 1993, 1994, 1999, 2000, 2001, 2002, 2004, 2005, 2006
+   Copyright (C) 1988, 1993, 1994, 1999, 2000, 2001, 2002, 2004, 2005, 2006, 2007
              Free Software Foundation, Inc.
 
 This file is part of GNU Emacs.
@@ -3190,6 +3270,16 @@ if test $USE_XASSERTS = yes; then
    echo
 fi
 
+if test "$USE_X_TOOLKIT" = GTK; then
+  case "$canonical" in
+  *cygwin*)
+    echo "There are known problems with Emacs and Gtk+ on cygwin, so you
+  will probably get a crash on startup.  If this happens, please use another
+  toolkit for Emacs.  See etc/PROBLEMS for more information."
+  ;;
+  esac
+fi
+
 
 
 # Remove any trailing slashes in these variables.