(find-source-lisp-file): New function.
[bpt/emacs.git] / configure.in
index b64c30b..a8e9aec 100644 (file)
@@ -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])
@@ -109,6 +113,8 @@ AC_ARG_WITH(gif,
 [  --with-gif              use -lungif for displaying GIF images])
 AC_ARG_WITH(png,
 [  --with-png              use -lpng for displaying PNG images])
+AC_ARG_WITH(gpm,
+[  --with-gpm              use -lgpm for mouse support on a GNU/Linux console])
 AC_ARG_WITH(gtk,
 [  --with-gtk              use GTK (same as --with-x-toolkit=gtk)])
 AC_ARG_WITH(pkg-config-prog,
@@ -279,13 +285,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
   ;;
 
@@ -585,6 +595,13 @@ dnl see the `changequote' comment above.
     machine=nh6000 opsys=powerunix
     NON_GNU_CPP="cc -Xo -E -P"
   ;;
+  ## SR2001/SR2201 running HI-UX/MPP
+  hppa1.1-hitachi-hiuxmpp* )
+    machine=sr2k opsys=hiuxmpp
+  ;;
+  hppa1.1-hitachi-hiuxwe2* )
+    machine=sr2k opsys=hiuxwe2
+  ;;
   ## Honeywell XPS100
   xps*-honeywell-sysv* )
     machine=xps100 opsys=usg5-2
@@ -607,10 +624,46 @@ dnl see the `changequote' comment above.
     esac
   ;;
 
+  ## HP 9000 series 700 and 800, running HP/UX
+  hppa*-hp-hpux7* )
+    machine=hp800 opsys=hpux
+  ;;
+  hppa*-hp-hpux8* )
+    machine=hp800 opsys=hpux8
+  ;;
+  hppa*-hp-hpux9shr* )
+    machine=hp800 opsys=hpux9shr
+  ;;
+  hppa*-hp-hpux9* )
+    machine=hp800 opsys=hpux9
+  ;;
+  hppa*-hp-hpux10.2* )
+    machine=hp800 opsys=hpux10-20
+  ;;
+  hppa*-hp-hpux10* )
+    machine=hp800 opsys=hpux10
+  ;;
+  hppa*-hp-hpux1[1-9]* )
+    machine=hp800 opsys=hpux11
+    CFLAGS="-D_INCLUDE__STDC_A1_SOURCE $CFLAGS"
+  ;;
+
   hppa*-*-linux-gnu* )
     machine=hp800 opsys=gnu-linux
   ;;
 
+  ## HP 9000 series 700 and 800, running HP/UX
+  hppa*-hp-hpux* )
+    ## Cross-compilation?  Nah!
+    case "`uname -r`" in
+      ## Someone's system reports A.B8.05 for this.
+      ## I wonder what other possibilities there are.
+      *.B8.* ) machine=hp800 opsys=hpux8 ;;
+      *.08.* ) machine=hp800 opsys=hpux8 ;;
+      *.09.* ) machine=hp800 opsys=hpux9 ;;
+      *) machine=hp800 opsys=hpux10 ;;
+    esac
+  ;;
   hppa*-*-nextstep* )
     machine=hp800 opsys=nextstep
   ;;
@@ -651,6 +704,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
   ;;
@@ -976,7 +1032,14 @@ dnl see the `changequote' comment above.
                ;;
       *-sunos5* | *-solaris* )
                opsys=sol2-6
-               NON_GNU_CPP=/usr/ccs/lib/cpp
+## FIXME: make this into a proper fix that checks the compiler type,
+## rather than relying on path. Or is /usr/ccs/lib/cpp a bad default now?
+               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
@@ -1559,7 +1622,6 @@ if test "${with_sound}" != "no"; then
     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
@@ -2123,7 +2185,7 @@ if test "${HAVE_GTK}" = "yes"; then
   PKG_CHECK_MODULES(XFT, xft >= 0.13.0, , HAVE_XFT=no)
   if test "$HAVE_XFT" != no; then
     OLD_CFLAGS="$CPPFLAGS"
-    OLD_CFLAGS="$CFLAGS"
+    OLD_CPPFLAGS="$CFLAGS"
     OLD_LIBS="$LIBS"
     CPPFLAGS="$CPPFLAGS $XFT_CFLAGS"
     CFLAGS="$CFLAGS $XFT_CFLAGS"
@@ -2145,7 +2207,7 @@ 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
+if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then
   if test x"${HAVE_X11R5}" = xyes; then
     AC_MSG_CHECKING(X11 version 5 with Xaw)
     AC_CACHE_VAL(emacs_cv_x11_version_5_with_xaw,
@@ -2159,8 +2221,12 @@ if test x"${USE_X_TOOLKIT}" = xmaybe; then
       AC_MSG_RESULT([5 or newer, with Xaw; use toolkit by default])
       USE_X_TOOLKIT=LUCID
     else
-      AC_MSG_RESULT(before 5 or no Xaw; do not use toolkit by default)
-      USE_X_TOOLKIT=none
+      if test x"${USE_X_TOOLKIT}" = xLUCID; then
+        AC_MSG_ERROR([Lucid toolkit requires X11/Xaw include files])
+      else
+        AC_MSG_RESULT(before 5 or no Xaw; do not use toolkit by default)
+        USE_X_TOOLKIT=none
+      fi
     fi
   else
     USE_X_TOOLKIT=none
@@ -2442,6 +2508,17 @@ if test "${HAVE_X11}" = "yes"; then
   fi
 fi
 
+### Use -lgpm if available, unless `--with-gpm=no'.
+HAVE_GPM=no
+if test "${with_gpm}" != "no"; then
+  AC_CHECK_HEADER(gpm.h,
+    AC_CHECK_LIB(gpm, Gpm_Open, HAVE_GPM=yes))
+fi
+
+if test "${HAVE_GPM}" = "yes"; then
+  AC_DEFINE(HAVE_GPM, 1, [Define to 1 if you have the gpm library (-lgpm).])
+fi
+
 dnl Check for malloc/malloc.h on darwin
 AC_CHECK_HEADER(malloc/malloc.h, AC_DEFINE(HAVE_MALLOC_MALLOC_H, 1, [Define to 1 if you have the <malloc/malloc.h> header file.]))
 
@@ -3202,6 +3279,7 @@ echo "  Does Emacs use -ljpeg?                                  ${HAVE_JPEG}"
 echo "  Does Emacs use -ltiff?                                  ${HAVE_TIFF}"
 echo "  Does Emacs use -lungif?                                 ${HAVE_GIF}"
 echo "  Does Emacs use -lpng?                                   ${HAVE_PNG}"
+echo "  Does Emacs use -lgpm?                                   ${HAVE_GPM}"
 echo "  Does Emacs use X toolkit scroll bars?                   ${USE_TOOLKIT_SCROLL_BARS}"
 echo