dnl autoconf
dnl in the directory containing this script.
dnl
-dnl Copyright (C) 1994, 1995, 1996, 1999, 2000 Free Software Foundation, Inc.
+dnl Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001
+dnl Free Software Foundation, Inc.
dnl
dnl This file is part of GNU Emacs.
dnl
case "${canonical}" in
i[345]86-*-bsdi*) machine=intel386 ;;
sparc-*-bsdi*) machine=sparc ;;
- powerpc-*-bsdi*) machine=powerpc ;;
+ powerpc-*-bsdi*) machine=macppc ;;
esac
case "${canonical}" in
*-*-bsd386* | *-*-bsdi1* ) opsys=bsd386 ;;
# This is needed to find X11R6.1 libraries for certain tests.
NON_GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib
GCC_LINK_TEST_OPTIONS=-Wl,-rpath,/usr/X11R6/lib
- # This is necessary on 5.0 to avoid mangling src/Makefile due to
- # non-traditional preprocessing with the current compiler defaults.
- # OSF 4 can also have that compiler version, and there seems always
- # to have been a usable /usr/bin/cpp.
- NON_GNU_CPP='cpp'
+ # NON_GNU_CPP is necessary on 5.0 to avoid mangling src/Makefile
+ # due to non-traditional preprocessing with the current compiler
+ # defaults. OSF 4 can also have that compiler version, and there
+ # seems always to have been a usable /usr/bin/cpp.
+ NON_GNU_CPP=/usr/bin/cpp
case "${canonical}" in
alpha*-dec-osf[5-9]*)
opsys=osf5-0 ;;
ppc-*-linux | \
powerpc-*-linux* )
- machine=powerpc opsys=gnu-linux
+ machine=macppc opsys=gnu-linux
;;
## Altos 3068
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
LD_SWITCH_X_SITE_AUX=-R`echo ${x_libraries} | sed -e "s/:/ -R/g"`
x_default_search_path=""
for x_library in `echo ${x_libraries} | sed -e "s/:/ /g"`; do
- x_search_path="${x_library}/X11/%L/%T/%N%C%S:\
-${x_library}/X11/%L/%T/%N%C%S:${x_libary}/X11/%l/%T/%N%C%S:\
-${x_library}/X11/%T/%N%C%S:${x_library}/X11/%L/%T/%N%S:\
-${x_library}/X11/%l/%T/%N%S:${x_library}/X11/%T/%N%S"
+ x_search_path="\
+${x_library}/X11/%L/%T/%N%C%S:\
+${x_library}/X11/%l/%T/%N%C%S:\
+${x_library}/X11/%T/%N%C%S:\
+${x_library}/X11/%L/%T/%N%S:\
+${x_library}/X11/%l/%T/%N%S:\
+${x_library}/X11/%T/%N%S"
if test x"${x_default_search_path}" = x; then
x_default_search_path=${x_search_path}
else
fi
fi
+ # Reportedly, some broken Solaris systems have XKBlib.h but are missing
+ # header files included from there.
+ AC_MSG_CHECKING(for Xkb)
+ AC_TRY_LINK([#include <X11/Xlib.h>
+#include <X11/XKBlib.h>],
+ [XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);],
+ emacs_xkb=yes, emacs_xkb=no)
+ AC_MSG_RESULT($emacs_xkb)
+ if test $emacs_xkb = yes; then
+ AC_DEFINE(HAVE_XKBGETKEYBOARD)
+ fi
+
AC_CHECK_FUNCS(XrmSetDatabase XScreenResourceString \
XScreenNumberOfScreen XSetWMProtocols)
fi
LIBS="-lXt $LIBS"
fi
AC_CHECK_LIB(Xmu, XmuConvertStandardSelection)
- LIBS="$OLDLIBS"
+ test $ac_cv_lib_Xmu_XmuConvertStandardSelection = no && LIBS="$OLDLIBS"
+fi
+
+# On Irix 6.5, at least, we need XShapeQueryExtension from -lXext for Xaw3D.
+if test "${HAVE_X11}" = "yes"; then
+ if test "${USE_X_TOOLKIT}" != "none"; then
+ AC_CHECK_LIB(Xext, XShapeQueryExtension)
+ fi
fi
if test "${USE_X_TOOLKIT}" = "MOTIF"; then
emacs_cv_motif_version_2_1=yes, emacs_cv_motif_version_2_1=no))
HAVE_MOTIF_2_1=$emacs_cv_motif_version_2_1
if test $emacs_cv_motif_version_2_1 = yes; then
+ HAVE_LIBXP=no
AC_DEFINE(HAVE_MOTIF_2_1)
- AC_CHECK_LIB(Xp, XpCreateContext, HAVE_LIBXP=yes, , -lXext)
+ AC_CHECK_LIB(Xp, XpCreateContext, HAVE_LIBXP=yes)
if test ${HAVE_LIBXP} = yes; then
AC_DEFINE(HAVE_LIBXP)
fi
HAVE_XAW3D=no
if test "${HAVE_X11}" = "yes"; then
if test "${USE_X_TOOLKIT}" != "none"; then
- old_c_flags="${CFLAGS}"
- CFLAGS="${LD_SWITCH_X_SITE}"
AC_CHECK_HEADER(X11/Xaw3d/Scrollbar.h,
- AC_CHECK_LIB(Xaw3d, XawScrollbarSetThumb, HAVE_XAW3D=yes, , -lX11))
- CFLAGS="${old_c_flags}"
-
+ AC_CHECK_LIB(Xaw3d, XawScrollbarSetThumb, HAVE_XAW3D=yes))
if test "${HAVE_XAW3D}" = "yes"; then
AC_DEFINE(HAVE_XAW3D)
fi
HAVE_XPM=no
if test "${HAVE_X11}" = "yes"; then
if test "${with_xpm}" != "no"; then
- old_c_flags="${CFLAGS}"
- CFLAGS="${LD_SWITCH_X_SITE}"
AC_CHECK_HEADER(X11/xpm.h,
AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, HAVE_XPM=yes, , -lX11))
if test "${HAVE_XPM}" = "yes"; then
- AC_MSG_CHECKING(for XpmReturnAllocPixels preprocessor define)
- AC_EGREP_CPP(no_return_alloc_pixels,
- [#include "X11/xpm.h"
+ AC_MSG_CHECKING(for XpmReturnAllocPixels preprocessor define)
+ AC_EGREP_CPP(no_return_alloc_pixels,
+ [#include "X11/xpm.h"
#ifndef XpmReturnAllocPixels
no_return_alloc_pixels
#endif
- ], HAVE_XPM=no, HAVE_XPM=yes)
- fi
- CFLAGS="${old_c_flags}"
- if test "${HAVE_XPM}" = "yes"; then
- AC_MSG_RESULT(yes)
- else
- AC_MSG_RESULT(no)
+ ], HAVE_XPM=no, HAVE_XPM=yes)
+
+ if test "${HAVE_XPM}" = "yes"; then
+ AC_MSG_RESULT(yes)
+ else
+ AC_MSG_RESULT(no)
+ fi
fi
fi
HAVE_JPEG=no
if test "${HAVE_X11}" = "yes"; then
if test "${with_jpeg}" != "no"; then
- old_c_flags="${CFLAGS}"
- CFLAGS="${LD_SWITCH_X_SITE} ${CFLAGS}"
dnl Checking for jpeglib.h can lose becsue of a redefinition of
dnl HAVE_STDLIB_H.
AC_CHECK_HEADER(jerror.h,
- AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes, , -lX11))
- CFLAGS="${old_c_flags}"
+ AC_CHECK_LIB(jpeg, jpeg_destroy_compress, HAVE_JPEG=yes))
fi
if test "${HAVE_JPEG}" = "yes"; then
HAVE_PNG=no
if test "${HAVE_X11}" = "yes"; then
if test "${with_png}" != "no"; then
- old_c_flags="${CFLAGS}"
- CFLAGS="${LD_SWITCH_X_SITE} ${CFLAGS}"
AC_CHECK_HEADER(png.h,
- AC_CHECK_LIB(png, png_set_expand, HAVE_PNG=yes, , -lX11 -lz -lm))
- CFLAGS="${old_c_flags}"
+ AC_CHECK_LIB(png, png_get_channels, HAVE_PNG=yes, , -lz -lm))
fi
if test "${HAVE_PNG}" = "yes"; then
HAVE_TIFF=no
if test "${HAVE_X11}" = "yes"; then
if test "${with_tiff}" != "no"; then
- old_c_flags="${CFLAGS}"
- CFLAGS="${LD_SWITCH_X_SITE} ${CFLAGS}"
AC_CHECK_HEADER(tiffio.h,
- tifflibs="-lX11 -lz -lm"
+ tifflibs="-lz -lm"
# At least one tiff package requires the jpeg library.
if test "${HAVE_JPEG}" = yes; then tifflibs="-ljpeg $tifflibs"; fi
AC_CHECK_LIB(tiff, TIFFGetVersion, HAVE_TIFF=yes, , $tifflibs))
- CFLAGS="${old_c_flags}"
fi
if test "${HAVE_TIFF}" = "yes"; then
HAVE_GIF=no
if test "${HAVE_X11}" = "yes"; then
if test "${with_gif}" != "no"; then
- old_c_flags="${CFLAGS}"
- CFLAGS="${LD_SWITCH_X_SITE} ${CFLAGS}"
AC_CHECK_HEADER(gif_lib.h,
- AC_CHECK_LIB(ungif, DGifOpen, HAVE_GIF=yes, , -lX11))
- CFLAGS="${old_c_flags}"
+ AC_CHECK_LIB(ungif, DGifOpen, HAVE_GIF=yes))
fi
if test "${HAVE_GIF}" = "yes"; then
AC_FUNC_GETLOADAVG
-AC_CHECK_FUNCS(ftello)
+AC_FUNC_FSEEKO
-# UNIX98 PTYs. AC_SYS_LARGEFILE should have defined _XOPEN_SOURCE
-# if we need it.
+# UNIX98 PTYs.
AC_CHECK_FUNCS(grantpt)
# PTY-related GNU extensions.
exec_prefix=`echo "${exec_prefix}" | sed 's,\([^/]\)/*$,\1,'`
changequote([, ])dnl
+## Check if the C preprocessor will convert `..' to `. .'. If so, set
+## CPP_NEED_TRADITIONAL to `yes' so that the code to generate Makefile
+## from Makefile.c can correctly provide the arg `-traditional' to the
+## C preprocessor.
+
+AC_EGREP_CPP(yes..yes,
+ [yes..yes],
+ CPP_NEED_TRADITIONAL=no,
+ CPP_NEED_TRADITIONAL=yes)
+
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, [
# As of 2000-11-19, newest development versions of GNU cpp preprocess
# `..' to `. .' unless invoked with -traditional
-if [ x$GCC = xyes && x$NON_GNU_CPP" = x ]; then
+if test "x$GCC" = xyes && test "x$CPP_NEED_TRADITIONAL" = xyes; then
CPPFLAGS="$CPPFLAGS -traditional"
fi
sed -e '/start of cpp stuff/q' \
< Makefile.c > junk1.c
sed -e '1,/start of cpp stuff/d'\
- -e 's@/\*\*/#\(.*\)$@/* \1 */@' \
+ -e 's,/\*\*/#\(.*\)$,/* \1 */,' \
< Makefile.c > junk.c
$CPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \
sed -e 's/^ / /' -e '/^#/d' -e '/^[ \f]*$/d' > junk2.c
sed -e '/start of cpp stuff/q' \
< Makefile.c > junk1.c
sed -e '1,/start of cpp stuff/d'\
- -e 's@/\*\*/#\(.*\)$@/* \1 */@' \
+ -e 's,/\*\*/#\(.*\)$,/* \1 */,' \
< Makefile.c > junk.c
$CPP $undefs -I. -I$top_srcdir/src $CPPFLAGS junk.c | \
sed -e 's/^ / /' -e '/^#/d' -e '/^[ \f]*$/d' > junk2.c
# This is how we know whether to re-run configure in certain cases.
touch src/config.stamp
-], [CPP="$CPP" CPPFLAGS="$CPPFLAGS"])
+], [GCC="$GCC" NON_GNU_CPP="$NON_GNU_CPP" CPP="$CPP" CPP_NEED_TRADITIONAL="$CPP_NEED_TRADITIONAL" CPPFLAGS="$CPPFLAGS"])
+