dnl autoconf
dnl in the directory containing this script.
dnl
-dnl Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001
+dnl Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002
dnl Free Software Foundation, Inc.
dnl
dnl This file is part of GNU Emacs.
dnl Free Software Foundation, Inc., 59 Temple Place - Suite 330,
dnl Boston, MA 02111-1307, USA.
-AC_PREREQ(2.50)dnl
+AC_PREREQ(2.51)dnl
AC_INIT(src/lisp.h)
AC_CONFIG_HEADER(src/config.h:src/config.in)
+dnl Support for --program-prefix, --program-suffix and
+dnl --program-transform-name options
+AC_ARG_PROGRAM
+
lispdir='${datadir}/emacs/${version}/lisp'
locallisppath='${datadir}/emacs/${version}/site-lisp:'\
'${datadir}/emacs/site-lisp:${datadir}/emacs/${version}/leim'
etcdir='${datadir}/emacs/${version}/etc'
archlibdir='${libexecdir}/emacs/${version}/${configuration}'
docdir='${datadir}/emacs/${version}/etc'
+gamedir=yes
+
+AC_ARG_WITH(game-dir,
+[ --with-game-dir use a shared game directory if possible],
+ [if test "$withval" = yes; then
+ gamedir="${localstatedir}/games/emacs"
+ else
+ if test "$withval" = no; then
+ gamedir=no
+ else
+ gamedir="$withval"
+ fi
+ fi
+])
+
+gameuser=games
+AC_ARG_WITH(game-user,
+[ --with-game-user use specified user for game directory],
+ [gameuser="$withval"])
AC_ARG_WITH(gcc,
[ --without-gcc don't use GCC to compile Emacs if GCC is found])
AC_ARG_WITH(hesiod,
[ --with-hesiod support Hesiod to get the POP server host],
[AC_DEFINE(HESIOD)])
+
+AC_ARG_WITH(sound,
+[ --without-sound don't compile with sound support])
+
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.
[ --with-png use -lpng for displaying PNG images])
AC_ARG_WITH(toolkit-scroll-bars,
[ --without-toolkit-scroll-bars
- don't use Motif or Xaw3d scroll bars])
+ don't use Motif or Xaw3d scroll bars])
AC_ARG_WITH(xim,
-[ --without-xim don't use X11 XIM])
+[ --without-xim don't use X11 XIM])
#### Make srcdir absolute, if it isn't already. It's important to
#### avoid running the path through pwd unnecessarily, since pwd can
. )
## We may be able to use the $PWD environment variable to make this
## absolute. But sometimes PWD is inaccurate.
- if test ".${PWD}" != "." && test ".`(cd ${PWD} ; sh -c pwd)`" = ".${PWD}" ;
+ ## Note: we used to use ${PWD} at the end instead of `pwd`,
+ ## but that tested only for a well-formed and valid PWD,
+ ## it did not object when PWD was well-formed and valid but just wrong.
+ if test ".${PWD}" != "." && test ".`(cd ${PWD} ; sh -c pwd)`" = ".`pwd`" ;
then
srcdir="$PWD"
else
machine='' opsys='' unported=no
case "${canonical}" in
+ ## FreeBSD ports
+ *-*-freebsd* )
+ opsys=freebsd
+ case "${canonical}" in
+ alpha*-*-freebsd*) machine=alpha ;;
+ i[3456]86-*-freebsd*) machine=intel386 ;;
+ esac
+ ;;
+
## NetBSD ports
*-*-netbsd* )
opsys=netbsd
*-*-bsdi2.0* ) opsys=bsdos2 ;;
*-*-bsdi2* ) opsys=bsdos2-1 ;;
*-*-bsdi3* ) opsys=bsdos3 ;;
- *-*-bsdi4* ) opsys=bsdos4 ;;
+ *-*-bsdi[45]* ) opsys=bsdos4 ;;
esac
;;
## operating system.
;;
+ ## Compaq Nonstop
+ mips-compaq-nonstopux* )
+ machine=nonstopux opsys=nonstopux
+ ;;
+
## Convex
*-convex-bsd* | *-convex-convexos* )
machine=convex opsys=bsd4-3
hppa*-hp-hpux9* )
machine=hp800 opsys=hpux9
;;
- hppa*-hp-hpux1[0-9]* )
+ hppa*-hp-hpux10* )
machine=hp800 opsys=hpux10
;;
+ hppa*-hp-hpux1[1-9]* )
+ machine=hp800 opsys=hpux11
+ ;;
+
+ hppa*-*-linux-gnu* )
+ machine=hp800 opsys=gnu-linux
+ ;;
## HP 9000 series 700 and 800, running HP/UX
hppa*-hp-hpux* )
i370-ibm-aix*)
machine=ibm370aix opsys=usg5-3
;;
+ s390-*-linux-gnu)
+ machine=ibms390 opsys=gnu-linux
+ ;;
rs6000-ibm-aix3.1* | powerpc-ibm-aix3.1* )
machine=ibmrs6000 opsys=aix3-1
;;
rs6000-ibm-aix4.2* | powerpc-ibm-aix4.2* )
machine=ibmrs6000 opsys=aix4-2
;;
+ rs6000-ibm-aix5.1* | powerpc-ibm-aix5.1* )
+ machine=ibmrs6000 opsys=aix4-2
+ ;;
rs6000-ibm-aix4.0* | powerpc-ibm-aix4.0* )
machine=ibmrs6000 opsys=aix4
;;
;;
*-sysv4.2uw* ) opsys=unixware; NON_GNU_CPP=/lib/cpp ;;
*-386bsd* ) opsys=386bsd ;;
- *-freebsd* ) opsys=freebsd ;;
*-nextstep* ) opsys=nextstep ;;
## Otherwise, we'll fall through to the generic opsys code at the bottom.
esac
dnl Do this early because it can frob feature test macros for Unix-98 &c.
AC_SYS_LARGEFILE
-# Sound support for GNU/Linux and the free BSDs.
-AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h)
-# Emulation library used on NetBSD.
-AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=)
-AC_SUBST(LIBSOUND)
+if test "${with_sound}" != "no"; then
+ # Sound support for GNU/Linux and the free BSDs.
+ AC_CHECK_HEADERS(machine/soundcard.h sys/soundcard.h soundcard.h)
+ # Emulation library used on NetBSD.
+ AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=)
+ AC_SUBST(LIBSOUND)
+fi
dnl checks for header files
AC_CHECK_HEADERS(sys/select.h sys/timeb.h sys/time.h unistd.h utime.h \
linux/version.h sys/systeminfo.h termios.h limits.h string.h stdlib.h \
- termcap.h stdio_ext.h fcntl.h term.h strings.h)
+ termcap.h stdio_ext.h fcntl.h term.h strings.h coff.h)
AC_HEADER_STDC
AC_HEADER_TIME
AC_DECL_SYS_SIGLIST
dnl checks for operating system services
AC_SYS_LONG_FILE_NAMES
+if test "$gamedir" = no; then :
+else
+ AC_MSG_CHECKING([for access to game group "$gameuser"])
+ rm -f conf$$chown.file
+ touch conf$$chown.file
+ dnl If we can't chown a file to group games, then the users
+ dnl can't share scores.
+ if chown "$gameuser" conf$$chown.file 1>/dev/null 2>&1; then
+ AC_MSG_RESULT([yes])
+ if test "$gamedir" = "yes"; then
+ gamedir="${localstatedir}/games/emacs"
+ fi
+ tgamedir=`eval "echo $gamedir"`
+ AC_DEFINE_UNQUOTED(HAVE_SHARED_GAME_DIR, "$tgamedir")
+ else
+ AC_MSG_RESULT([no])
+ gamedir=no
+ fi
+fi
#### Choose a window system.
AC_PATH_X
if test "${HAVE_JPEG}" = "yes"; then
AC_DEFINE(HAVE_JPEG)
+ AC_EGREP_CPP(
+changequote({, })dnl avoid leadingspace on the next line
+{version= *(6[2-9]|[7-9][0-9])},
+changequote([, ])dnl
+ [#include <jpeglib.h>
+ version=JPEG_LIB_VERSION
+],
+ AC_DEFINE(HAVE_JPEG),
+ [AC_MSG_WARN([libjpeg found, but not version 6b or later])
+ HAVE_JPEG=no])
fi
fi
if test "${HAVE_X11}" = "yes"; then
if test "${with_gif}" != "no"; then
AC_CHECK_HEADER(gif_lib.h,
- AC_CHECK_LIB(ungif, DGifOpen, HAVE_GIF=yes))
+# EGifPutExtensionLast only exists from version libungif-4.1.0b1.
+# Earlier versions can crash Emacs.
+ AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes))
fi
if test "${HAVE_GIF}" = "yes"; then
fi
fi
+### Use session management (-lSM -lICE) if available
+HAVE_X_SM=no
+if test "${HAVE_X11}" = "yes"; then
+ AC_CHECK_HEADER(X11/SM/SMlib.h,
+ AC_CHECK_LIB(SM, SmcOpenConnection, HAVE_X_SM=yes, -lICE))
+
+ if test "${HAVE_X_SM}" = "yes"; then
+ AC_DEFINE(HAVE_X_SM)
+ case "$LIBS" in
+ *-lSM*) ;;
+ *) LIBS="-lSM -lICE $LIBS" ;;
+ esac
+ fi
+fi
+
# If netdb.h doesn't declare h_errno, we must declare it by hand.
AC_CACHE_CHECK(whether netdb declares h_errno,
emacs_cv_netdb_declares_h_errno,
random lrand48 bcopy bcmp logb frexp fmod rint cbrt ftime res_init setsid \
strerror fpathconf select mktime euidaccess getpagesize tzset setlocale \
utimes setrlimit setpgid getcwd getwd shutdown strftime getaddrinfo \
-__fpending mblen mbrlen strsignal setitimer ualarm index rindex \
-gai_strerror mkstemp)
+__fpending mblen mbrlen mbsinit strsignal setitimer ualarm index rindex \
+sendto recvfrom getsockopt setsockopt getsockname getpeername \
+gai_strerror mkstemp getline getdelim)
+
+AC_CHECK_HEADERS(sys/un.h)
AC_FUNC_MKTIME
if test "$ac_cv_func_working_mktime" = no; then
# than to expect to find it in ncurses.
AC_CHECK_LIB(ncurses, tparm)
+# Do we need the Hesiod library to provide the support routines?
+if test "$with_hesiod" = yes ; then
+ # Don't set $LIBS here -- see comments above.
+ resolv=no
+ AC_CHECK_FUNC(res_send, , [AC_CHECK_FUNC(__res_send, ,
+ [AC_CHECK_LIB(resolv, res_send, resolv=yes,
+ [AC_CHECK_LIB(resolv, __res_send, resolv=yes)])])])
+ if test "$resolv" = yes ; then
+ RESOLVLIB=-lresolv
+ AC_DEFINE(HAVE_LIBRESOLV)
+ else
+ RESOLVLIB=
+ fi
+ AC_CHECK_FUNC(hes_getmailhost, , [AC_CHECK_LIB(hesiod, hes_getmailhost,
+ AC_DEFINE(HAVE_LIBHESIOD), :, $RESOLVLIB)])
+fi
+
# These tell us which Kerberos-related libraries to use.
if test "${with_kerberos+set}" = set; then
AC_CHECK_LIB(com_err, com_err)
AC_CHECK_HEADERS(krb5.h)
else
AC_CHECK_HEADERS(des.h,,
- AC_CHECK_HEADERS(kerberosIV/des.h,,
- AC_CHECK_HEADERS(kerberos/des.h)))
+ [AC_CHECK_HEADERS(kerberosIV/des.h,,
+ [AC_CHECK_HEADERS(kerberos/des.h)])])
AC_CHECK_HEADERS(krb.h,,
- AC_CHECK_HEADERS(kerberosIV/krb.h,,
- AC_CHECK_HEADERS(kerberos/krb.h)))
+ [AC_CHECK_HEADERS(kerberosIV/krb.h,,
+ [AC_CHECK_HEADERS(kerberos/krb.h)])])
fi
AC_CHECK_HEADERS(com_err.h)
fi
AC_MSG_RESULT(no)
fi
-AC_FUNC_VFORK
+AC_FUNC_FORK
# Fixme: This should be replaced when we have autoconf 2.14.
AC_SIZE_T
AC_SUBST(archlibdir)
AC_SUBST(docdir)
AC_SUBST(bitmapdir)
+AC_SUBST(gamedir)
+AC_SUBST(gameuser)
AC_SUBST(c_switch_system)
AC_SUBST(c_switch_machine)
AC_SUBST(LD_SWITCH_X_SITE)
AC_DEFINE(REL_ALLOC)
fi
+AC_CHECK_HEADERS(nlist.h, [AC_DEFINE(NLIST_STRUCT, 1,
+ [Define if you have <nlist.h>.])])
+
#### Report on what we decided to do.
echo "
Configured for \`${canonical}'.
Should Emacs use a relocating allocator for buffers? ${REL_ALLOC}
Should Emacs use mmap(2) for buffer allocation? $use_mmap_for_buffers
What window system should Emacs use? ${window_system}
- What toolkit should Emacs use? ${USE_X_TOOLKIT}"
+ What toolkit should Emacs use? ${USE_X_TOOLKIT}
+ Should Emacs use a shared game state directory? ${gamedir}"
if test -n "${x_includes}"; then
echo " Where do we find X Windows header files? ${x_includes}"
AC_OUTPUT(Makefile lib-src/Makefile.c:lib-src/Makefile.in oldXMenu/Makefile \
man/Makefile lwlib/Makefile src/Makefile.c:src/Makefile.in \
- lisp/Makefile leim/Makefile, [
+ lisp/Makefile lispref/Makefile lispintro/Makefile leim/Makefile, [
### Make the necessary directories, if they don't exist.
for dir in etc lisp ; do