(abbreviate-file-name): Handle drive letters on windows-nt as on ms-dos.
[bpt/emacs.git] / configure.in
index e3ff1cd..b5d9d1c 100644 (file)
@@ -2,59 +2,52 @@ dnl This is an autoconf script.
 dnl To rebuild the `configure' script from this, execute the command
 dnl    autoconf
 dnl in the directory containing this script.
-AC_PREREQ(1.111)dnl
+AC_PREREQ(2.0)dnl
 AC_INIT(src/lisp.h)
 AC_CONFIG_HEADER(src/config.h)
 
 bindir='${exec_prefix}/bin'
-datadir='${prefix}/lib'
-statedir='${prefix}/lib'
-libdir='${exec_prefix}/lib'
+datadir='${prefix}/share'
+sharedstatedir='${prefix}/com'
+libexecdir='${exec_prefix}/libexec'
 mandir='${prefix}/man/man1'
 infodir='${prefix}/info'
 lispdir='${datadir}/emacs/${version}/lisp'
 locallisppath='${datadir}/emacs/site-lisp'
 lisppath='${locallisppath}:${lispdir}'
 etcdir='${datadir}/emacs/${version}/etc'
-lockdir='${statedir}/emacs/lock'
-archlibdir='${libdir}/emacs/${version}/${configuration}'
+lockdir='${sharedstatedir}/emacs/lock'
+archlibdir='${libexecdir}/emacs/${version}/${configuration}'
 docdir='${datadir}/emacs/${version}/etc'
 
+AC_ARG_WITH(gcc,
+[  --with-gcc              Use GCC to compile Emacs])
 AC_ARG_WITH(x-toolkit,
-[  --with-x-toolkit=KIT    Use an X toolkit (KIT = lucid or athena)],
+[  --with-x-toolkit=KIT    Use an X toolkit (KIT = yes/lucid/athena/motif)],
 [        case "${withval}" in
            y | ye | yes )      val=athena ;;
            n | no )            val=no  ;;
            l | lu | luc | luci | lucid )       val=lucid ;;
            a | at | ath | athe | athena )      val=athena ;;
+           m | mo | mot | moti | motif )       val=motif ;;
 dnl These don't currently work.
-dnl        m | mo | mot | moti | motif )       val=motif ;;
 dnl        o | op | ope | open | open- | open-l | open-lo \
 dnl            | open-loo | open-look )        val=open-look ;;
            * )
 dnl AC_MSG_ERROR([the \`--with-x-toolkit' option is supposed to have a value
 dnl which is \`yes', \`no', \`lucid', \`athena', \`motif' or \`open-look'.])
 AC_MSG_ERROR([the \`--with-x-toolkit' option is supposed to have a value
-which is \`yes', \`no', \`lucid', or \`athena'.
+which is \`yes', \`no', \`lucid', \`athena', or \`motif'.
 Currently, \`yes', \`athena' and \`lucid' are synonyms.])
            ;;
          esac
          with_x_toolkit=$val
 ])
-AC_ARG_WITH(gcc,
-[  --with-gcc              Use GCC to compile Emacs])
-dnl AC_ARG_ENABLE(single-tree,
-dnl [  --enable-single-tree    Create a directory tree at DIR which looks like:
-dnl                           .../DIR/bin/CONFIGNAME (emacs, etags, etc.)
-dnl                           .../DIR/bin/CONFIGNAME/etc (movemail, etc.)
-dnl                           .../DIR/common/lisp  (emacs' lisp files)
-dnl                           .../DIR/common/site-lisp (local lisp files)
-dnl                           .../DIR/common/lib (DOC, TUTORIAL, etc.)
-dnl                           .../DIR/common/lock (lockfiles)])
 
 #### Make srcdir absolute, if it isn't already.  It's important to
 #### avoid running the path through pwd unnecessary, since pwd can
-#### give you automounter prefixes, which can go away.
+#### give you automounter prefixes, which can go away.  We do all this
+#### so Emacs can find its files when run uninstalled.
 case "${srcdir}" in
   /* ) ;;
   . )
@@ -140,6 +133,14 @@ case "${canonical}" in
     esac
   ;;
 
+  ## Acorn RISCiX:
+  arm-acorn-riscix1.1* )
+    machine=acorn opsys=riscix1-1
+  ;;
+  arm-acorn-riscix1.2* | arm-acorn-riscix )
+    machine=acorn opsys=riscix1-2
+  ;;
+
   ## Alliant machines
   ## Strictly speaking, we need the version of the alliant operating
   ## system to choose the right machine file, but currently the
@@ -153,6 +154,10 @@ case "${canonical}" in
     machine=alliant-2800 opsys=bsd4-3
   ;;
 
+  alpha-dec-osf* )
+    machine=alpha opsys=osf1
+  ;;
+
   ## Altos 3068
   m68*-altos-sysv* )
     machine=altos opsys=usg5-2
@@ -381,13 +386,13 @@ case "${canonical}" in
   i370-ibm-aix*)
     machine=ibm370aix opsys=usg5-3
   ;;
-  rs6000-ibm-aix3.1* )
+  rs6000-ibm-aix3.1* | powerpc-ibm-aix3.1*  )
     machine=ibmrs6000 opsys=aix3-1
   ;;
-  rs6000-ibm-aix3.2.5)
+  rs6000-ibm-aix3.2.5 | powerpc-ibm-aix3.2.5 )
     machine=ibmrs6000 opsys=aix3-2-5
   ;;
-  rs6000-ibm-aix3.2* | rs6000-ibm-aix* )
+  rs6000-ibm-aix* | powerpc-ibm-aix* )
     machine=ibmrs6000 opsys=aix3-2
   ;;
   romp-ibm-bsd4.3* )
@@ -430,11 +435,18 @@ case "${canonical}" in
     machine=i386 opsys=usg5-3
   ;;
 
-  ## Sequent Symmetry
+  ## Sequent Symmetry running Dynix
   i[345]86-sequent-bsd* )
     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* )
+    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* )
@@ -761,7 +773,7 @@ test -n "$CC" && cc_specified=yes
 
 case ${with_gcc} in
   "yes" ) CC="gcc" GCC=yes ;;
-  "no"  ) test -z "$CC" && CC=cc ;;
+  "no"  ) : ${CC=cc} ;;
   * ) AC_PROG_CC
 esac
 
@@ -802,38 +814,73 @@ fi
 #### #undef clause to src/config.h.in for autoconf to modify.
 
 dnl checks for programs
-AC_LN_S
+AC_PROG_LN_S
 AC_PROG_CPP
 AC_PROG_INSTALL
 AC_PROG_YACC
 
+dnl checks for Unix variants
+AC_AIX
+
 dnl checks for header files
-AC_HAVE_HEADERS(sys/timeb.h sys/time.h unistd.h)
-AC_STDC_HEADERS
-AC_TIME_WITH_SYS_TIME
-AC_SYS_SIGLIST_DECLARED
+AC_CHECK_HEADERS(sys/timeb.h sys/time.h unistd.h utime.h)
+AC_HEADER_STDC
+AC_HEADER_TIME
+AC_DECL_SYS_SIGLIST
+
+dnl Some systems have utime.h but don't declare the struct anyplace.
+AC_MSG_CHECKING(for struct utimbuf)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif
+#ifdef HAVE_UTIME_H
+#include <utime.h>
+#endif], [static struct utimbuf x; x.actime = x.modtime;],
+  [AC_MSG_RESULT(yes)
+   AC_DEFINE(HAVE_STRUCT_UTIMBUF)],
+  AC_MSG_RESULT(no))
 
 dnl checks for typedefs
-AC_RETSIGTYPE
+AC_TYPE_SIGNAL
+
+AC_MSG_CHECKING(for struct timeval)
+AC_TRY_COMPILE([#ifdef TIME_WITH_SYS_TIME
+#include <sys/time.h>
+#include <time.h>
+#else
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#else
+#include <time.h>
+#endif
+#endif], [static struct timeval x; x.tv_sec = x.tv_usec;],
+  [AC_MSG_RESULT(yes)
+   AC_DEFINE(HAVE_TIMEVAL)],
+  AC_MSG_RESULT(no))
 
 dnl checks for structure members
 AC_STRUCT_TM
-AC_TIMEZONE
+AC_STRUCT_TIMEZONE
 
 dnl checks for compiler characteristics
-AC_CONST
+AC_C_CONST
 
 dnl check for Make feature
-AC_SET_MAKE
+AC_PROG_MAKE_SET
 
 dnl checks for operating system services
-AC_LONG_FILE_NAMES
-
-dnl other checks for UNIX variants
+AC_SYS_LONG_FILE_NAMES
 
 #### Choose a window system.
 
-AC_FIND_X
+AC_PATH_X
 if test "$no_x" = yes; then
   window_system=none
 else
@@ -844,13 +891,19 @@ test "${x_libraries}" != NONE && LD_SWITCH_X_SITE="-L${x_libraries}"
 test "${x_libraries}" != NONE && LD_SWITCH_X_SITE_AUX="-R${x_libraries}"
 test "${x_includes}" != NONE && C_SWITCH_X_SITE="-I${x_includes}"
 
+if test x"${x_includes}" = x; then
+  bitmapdir=/usr/include/X11/bitmaps
+else
+  bitmapdir="${x_includes}/bitmaps"
+fi
+
 case "${window_system}" in
   x11 )
     HAVE_X_WINDOWS=yes
     HAVE_X11=yes
     case "${with_x_toolkit}" in
       athena | lucid ) USE_X_TOOLKIT=LUCID ;;  
-dnl      motif ) USE_X_TOOLKIT=MOTIF ;;        
+      motif ) USE_X_TOOLKIT=MOTIF ;;   
 dnl      open-look ) USE_X_TOOLKIT=OPEN_LOOK ;;        
       * ) USE_X_TOOLKIT=none ;;
     esac
@@ -1014,12 +1067,12 @@ AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd")
 
 AC_MSG_CHECKING(for XFree86)
 if test -d /usr/X386/include; then
-  AC_MSG_RESULT(yes)
   HAVE_XFREE386=yes
-  test -z "${C_SWITCH_X_SITE}" && C_SWITCH_X_SITE="-I/usr/X386/include"
+  : ${C_SWITCH_X_SITE="-I/usr/X386/include"}
 else
-  AC_MSG_RESULT(no)
+  HAVE_XFREE386=no
 fi
+AC_MSG_RESULT($HAVE_XFREE386)
 
 # We change CFLAGS temporarily so that C_SWITCH_X_SITE gets used
 # for the tests that follow.
@@ -1028,13 +1081,13 @@ if test "${HAVE_X11}" = "yes"; then
   DEFS="$C_SWITCH_X_SITE $DEFS"
   LIBS="$LD_SWITCH_X_SITE $LIBX $LIBS"
   CFLAGS="$C_SWITCH_X_SITE $CFLAGS"
-  AC_HAVE_FUNCS(XrmSetDatabase XScreenResourceString \
+  AC_CHECK_FUNCS(XrmSetDatabase XScreenResourceString \
 XScreenNumberOfScreen XSetWMProtocols)
 fi
 
 if test "${USE_X_TOOLKIT}" != "none"; then
   AC_MSG_CHECKING(X11 toolkit version)
-  AC_COMPILE_CHECK(, [#include <X11/Intrinsic.h>],
+  AC_TRY_LINK([#include <X11/Intrinsic.h>],
 [#if XtSpecificationRelease < 6
 fail;
 #endif
@@ -1045,7 +1098,7 @@ fi
 
 # If netdb.h doesn't declare h_errno, we must declare it by hand.
 AC_MSG_CHECKING(whether netdb declarares h_errno)
-AC_COMPILE_CHECK(, [#include <netdb.h>],
+AC_TRY_LINK([#include <netdb.h>],
 [int
 foo ()
 {
@@ -1055,21 +1108,21 @@ foo ()
     AC_DEFINE(HAVE_H_ERRNO)],
    [AC_MSG_RESULT(no)])
 
-AC_ALLOCA
+AC_FUNC_ALLOCA
 
 # logb and frexp are found in -lm on most systems.
 AC_CHECK_LIB(m, logb)
-AC_HAVE_FUNCS(gettimeofday gethostname dup2 rename closedir mkdir rmdir \
-random rand48 bcopy bcmp logb frexp fmod drem ftime res_init setsid strerror \
-fpathconf)
+AC_CHECK_FUNCS(gettimeofday gethostname dup2 rename closedir mkdir rmdir \
+random lrand48 bcopy bcmp logb frexp fmod drem ftime res_init setsid \
+strerror fpathconf select mktime eaccess getpagesize)
 
 ok_so_far=yes
-AC_FUNC_CHECK(socket, , ok_so_far=no)
+AC_CHECK_FUNC(socket, , ok_so_far=no)
 if test $ok_so_far = yes; then
-  AC_HEADER_CHECK(netinet/in.h, , ok_so_far=no)
+  AC_CHECK_HEADER(netinet/in.h, , ok_so_far=no)
 fi
 if test $ok_so_far = yes; then
-  AC_HEADER_CHECK(arpa/inet.h, , ok_so_far=no)
+  AC_CHECK_HEADER(arpa/inet.h, , ok_so_far=no)
 fi
 if test $ok_so_far = yes; then
   AC_DEFINE(HAVE_INET_SOCKETS)
@@ -1095,13 +1148,14 @@ fi
 ### Use configuration here uncanonicalized to avoid exceeding size limits.
 AC_SUBST(version)
 AC_SUBST(configuration)
+AC_SUBST(canonical)
 AC_SUBST(srcdir)
 AC_SUBST(prefix)
 AC_SUBST(exec_prefix)
 AC_SUBST(bindir)
 AC_SUBST(datadir)
-AC_SUBST(statedir)
-AC_SUBST(libdir)
+AC_SUBST(sharedstatedir)
+AC_SUBST(libexecdir)
 AC_SUBST(mandir)
 AC_SUBST(infodir)
 AC_SUBST(lispdir)
@@ -1111,6 +1165,7 @@ AC_SUBST(etcdir)
 AC_SUBST(lockdir)
 AC_SUBST(archlibdir)
 AC_SUBST(docdir)
+AC_SUBST(bitmapdir)
 AC_SUBST(c_switch_system)
 AC_SUBST(c_switch_machine)
 AC_SUBST(LD_SWITCH_X_SITE)
@@ -1121,7 +1176,8 @@ AC_SUBST(X_TOOLKIT_TYPE)
 AC_SUBST(machfile)
 AC_SUBST(opsysfile)
 
-AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION,  "${configuration}")
+AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION,  "${canonical}")
+AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${config_options}")
 AC_DEFINE_UNQUOTED(config_machfile,  "${machfile}")
 AC_DEFINE_UNQUOTED(config_opsysfile, "${opsysfile}")
 AC_DEFINE_UNQUOTED(LD_SWITCH_X_SITE, ${LD_SWITCH_X_SITE})
@@ -1154,27 +1210,6 @@ if test "${LISP_FLOAT_TYPE}" = "yes" ; then
   AC_DEFINE(LISP_FLOAT_TYPE)
 fi
 
-dnl # ====================== Developer's configuration =======================
-dnl 
-dnl # The following assignments make sense if you're running Emacs on a single
-dnl # machine, one version at a time, and  you want changes to the lisp and etc
-dnl # directories in the source tree to show up immediately in your working
-dnl # environment.  It saves a great deal of disk space by not duplicating the
-dnl # lisp and etc directories.
-dnl 
-dnl if test "$enable_single_tree" = "yes"; then
-dnl    bindir='${exec_prefix}/bin/${configuration}'
-dnl    datadir='${prefix}/common'
-dnl    statedir='${prefix}/common'
-dnl    libdir='${bindir}'
-dnl    lispdir='${prefix}/common/lisp'
-dnl    locallisppath='${prefix}/common/site-lisp'
-dnl    lockdir='${prefix}/common/lock'
-dnl    archlibdir='${libdir}/etc'
-dnl    etcdir='${prefix}/common/data'
-dnl    docdir='${prefix}/common/data'
-dnl fi
-
 #### Report on what we decided to do.
 echo "