esac
eval val="\$${var}"
test x"$val" = x && continue
- emacs_config_options="${emacs_config_options}${emacs_config_options:+ }$var=$val"
+ emacs_config_options="${emacs_config_options}${emacs_config_options:+ }$var=\"$val\""
done
AC_CONFIG_HEADER(src/config.h:src/config.in)
fi
fi
-CRT_DIR=
-AC_ARG_WITH([crt-dir],dnl
-[AS_HELP_STRING([--with-crt-dir=DIR],[directory containing crtn.o etc.
-The default is /usr/lib, or /usr/lib64 on some platforms.])])
-CRT_DIR="${with_crt_dir}"
-
AC_ARG_WITH(gameuser,dnl
[AS_HELP_STRING([--with-gameuser=USER],[user for shared game score files])])
test "X${with_gameuser}" != X && test "${with_gameuser}" != yes \
test "x$NON_GCC_TEST_OPTIONS" != x && CC="$CC $NON_GCC_TEST_OPTIONS"
fi
-# Avoid gnulib's tests for O_NOATIME and O_NOFOLLOW, as we don't use them.
+# Avoid gnulib's tests for HAVE_WORKING_O_NOATIME and HAVE_WORKING_O_NOFOLLOW,
+# as we don't use them.
AC_DEFUN([gl_FCNTL_O_FLAGS])
# Avoid gnulib's threadlib module, as we do threads our own way.
AC_DEFUN([gl_THREADLIB])
LIB_MATH=-lm
-LIB_STANDARD=
-START_FILES=
dnl Current possibilities handled by sed (aix4-2 -> aix,
dnl gnu-linux -> gnu/linux, etc.):
dnl gnu, gnu/linux, gnu/kfreebsd, aix, cygwin, darwin, hpux, irix.
dnl And special cases: berkeley-unix, usg-unix-v, ms-dos, windows-nt.
SYSTEM_TYPE=`echo $opsys | sed -e 's/[[0-9]].*//' -e 's|-|/|'`
-dnl NB do not use CRT_DIR unquoted here, since it might not be set yet.
case $opsys in
cygwin )
LIB_MATH=
- START_FILES='pre-crt0.o'
;;
darwin )
## Adding -lm confuses the dynamic linker, so omit it.
LIB_MATH=
- START_FILES='pre-crt0.o'
;;
freebsd )
- LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtn.o'
- START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o'
SYSTEM_TYPE=berkeley-unix
;;
gnu-linux | gnu-kfreebsd )
- LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtn.o'
- START_FILES='pre-crt0.o $(CRT_DIR)/crt1.o $(CRT_DIR)/crti.o'
;;
hpux10-20 | hpux11 )
- LIB_STANDARD=-lc
- START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o'
;;
dnl NB this may be adjusted below.
netbsd | openbsd )
- LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o'
- START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crtbegin.o'
SYSTEM_TYPE=berkeley-unix
;;
esac
AC_SUBST(LIB_MATH)
-AC_SUBST(START_FILES)
AC_DEFINE_UNQUOTED(SYSTEM_TYPE, "$SYSTEM_TYPE",
[The type of system you are compiling for; sets `system-type'.])
-dnl Not all platforms use crtn.o files. Check if the current one does.
-crt_files=
-
-for file in x $LIB_STANDARD $START_FILES; do
- case "$file" in
- *CRT_DIR*) crt_files="$crt_files `echo $file | sed -e 's|.*/||'`" ;;
- esac
-done
-
-if test "x$crt_files" != x; then
-
- ## If user specified a crt-dir, use that unconditionally.
- crt_gcc=no
-
- if test "X$CRT_DIR" = "X"; then
-
- CRT_DIR=/usr/lib # default
-
- case "$canonical" in
- x86_64-*-linux-gnu* | s390x-*-linux-gnu*)
- ## On x86-64 and s390x GNU/Linux distributions, the standard library
- ## can be in a variety of places. We only try /usr/lib64 and /usr/lib.
- ## For anything else (eg /usr/lib32), it is up the user to specify
- ## the location (bug#5655).
- ## Test for crtn.o, not just the directory, because sometimes the
- ## directory exists but does not have the relevant files (bug#1287).
- ## FIXME better to test for binary compatibility somehow.
- test -e /usr/lib64/crtn.o && CRT_DIR=/usr/lib64
- ;;
-
- powerpc64-*-linux-gnu* | sparc64-*-linux-gnu*) CRT_DIR=/usr/lib64 ;;
- esac
-
- case "$opsys" in
- hpux10-20) CRT_DIR=/lib ;;
- esac
-
- test "x${GCC}" = xyes && crt_gcc=yes
-
- fi # CRT_DIR = ""
-
- crt_missing=
-
- for file in $crt_files; do
-
- ## If we're using gcc, try to determine it automatically by asking
- ## gcc. [If this doesn't work, CRT_DIR will remain at the
- ## system-dependent default from above.]
- if test $crt_gcc = yes && test ! -e $CRT_DIR/$file; then
-
- crt_file=`$CC --print-file-name=$file 2>/dev/null`
- case "$crt_file" in
- */*)
- CRT_DIR=`AS_DIRNAME(["$crt_file"])`
- ;;
- esac
- fi
-
- dnl We expect all the files to be in a single directory, so after the
- dnl first there is no point asking gcc.
- crt_gcc=no
-
- test -e $CRT_DIR/$file || crt_missing="$crt_missing $file"
- done # $crt_files
-
- test "x$crt_missing" = x || \
- AC_MSG_ERROR([Required file(s) not found:$crt_missing
-Try using the --with-crt-dir option.])
-
-fi # crt_files != ""
-
-AC_SUBST(CRT_DIR)
-
-case $opsys in
- netbsd | openbsd )
- if test -f $CRT_DIR/crti.o; then
-
- test -f $CRT_DIR/crtn.o || \
- AC_MSG_ERROR([Required file not found: crtn.o])
-
- LIB_STANDARD='-lgcc -lc -lgcc $(CRT_DIR)/crtend.o $(CRT_DIR)/crtn.o'
- START_FILES='pre-crt0.o $(CRT_DIR)/crt0.o $(CRT_DIR)/crti.o $(CRT_DIR)/crtbegin.o'
- fi
- ;;
-esac
-
pre_PKG_CONFIG_CFLAGS=$CFLAGS
pre_PKG_CONFIG_LIBS=$LIBS
AC_CHECK_HEADERS_ONCE(
linux/version.h sys/systeminfo.h
coff.h pty.h
- sys/vlimit.h sys/resource.h
+ sys/resource.h
sys/utsname.h pwd.h utmp.h util.h)
AC_MSG_CHECKING(if personality LINUX32 can be set)
CFLAGS="$CFLAGS -I${GNUSTEP_SYSTEM_HEADERS} ${GNUSTEP_LOCAL_HEADERS}"
LDFLAGS="$LDFLAGS -L${GNUSTEP_SYSTEM_LIBRARIES} ${GNUSTEP_LOCAL_LIBRARIES}"
LIBS_GNUSTEP="-lgnustep-gui -lgnustep-base -lobjc -lpthread"
- LIB_STANDARD=
- START_FILES=
dnl GNUstep defines BASE_NATIVE_OBJC_EXCEPTIONS to 0 or 1.
dnl If they had chosen to either define it or not, we could have
dnl just used AC_CHECK_DECL here.
AC_SUBST(ns_self_contained)
AC_SUBST(NS_OBJ)
AC_SUBST(NS_OBJC_OBJ)
-AC_SUBST(LIB_STANDARD)
HAVE_W32=no
W32_OBJ=
W32_RES="emacs.res"
# Tell the linker that emacs.res is an object (which we compile from
# the rc file), not a linker script.
- W32_RES_LINK="-Wl,-bpe-i386 -Wl,emacs.res"
+ W32_RES_LINK="-Wl,emacs.res"
fi
AC_SUBST(W32_OBJ)
AC_SUBST(W32_LIBS)
;;
esac
-if test -n "${term_header}"; then
- AC_DEFINE_UNQUOTED(TERM_HEADER, "${term_header}",
- [Define to the header for the built-in window system.])
-fi
-
if test "$window_system" = none && test "X$with_x" != "Xno"; then
AC_CHECK_PROG(HAVE_XSERVER, X, true, false)
if test "$HAVE_XSERVER" = true ||
else
test "$doug_lea_malloc" != "yes" && GMALLOC_OBJ=gmalloc.o
VMLIMIT_OBJ=vm-limit.o
+
+ AC_CHECK_HEADERS([sys/vlimit.h])
+ AC_CACHE_CHECK([for data_start], [emacs_cv_data_start],
+ [AC_LINK_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[extern char data_start[]; char ch;]],
+ [[return data_start < &ch;]])],
+ [emacs_cv_data_start=yes],
+ [emacs_cv_data_start=no])])
+ if test $emacs_cv_data_start = yes; then
+ AC_DEFINE([HAVE_DATA_START], 1,
+ [Define to 1 if data_start is the address of the start
+ of the main data segment.])
+ fi
fi
AC_SUBST(GMALLOC_OBJ)
AC_SUBST(VMLIMIT_OBJ)
emacs_xkb=yes, emacs_xkb=no)
AC_MSG_RESULT($emacs_xkb)
if test $emacs_xkb = yes; then
- AC_DEFINE(HAVE_XKBGETKEYBOARD, 1, [Define to 1 if you have the XkbGetKeyboard function.])
+ AC_DEFINE(HAVE_XKB, 1, [Define to 1 if you have the Xkb extension.])
fi
AC_CHECK_FUNCS(XrmSetDatabase XScreenResourceString \
## 6.2.8 is the earliest version known to work, but earlier versions
## might work - let us know if you find one.
## 6.0.7 does not work. See bug#7955.
- IMAGEMAGICK_MODULE="Wand >= 6.2.8"
+ ## 6.8.2 makes Emacs crash; see Bug#13867.
+ IMAGEMAGICK_MODULE="Wand >= 6.2.8 Wand != 6.8.2"
PKG_CHECK_MODULES(IMAGEMAGICK, $IMAGEMAGICK_MODULE, HAVE_IMAGEMAGICK=yes, :)
AC_SUBST(IMAGEMAGICK_CFLAGS)
AC_SUBST(IMAGEMAGICK_LIBS)
utimes getrlimit setrlimit shutdown getaddrinfo \
strsignal setitimer \
sendto recvfrom getsockname getpeername getifaddrs freeifaddrs \
-gai_strerror mkstemp getline getdelim fsync sync \
+gai_strerror mkstemp getline getdelim sync \
difftime posix_memalign \
getpwent endpwent getgrent endgrent \
touchlock \
esac
-dnl Used in vm-limit.c
-AH_TEMPLATE(DATA_START, [Address of the start of the data segment.])
-dnl Used in lisp.h, emacs.c, mem-limits.h
+dnl Used in lisp.h, emacs.c, vm-limit.c
dnl NEWS.18 describes this as "a number which contains
dnl the high bits to be inclusive or'ed with pointers that are unpacked."
AH_TEMPLATE(DATA_SEG_BITS, [Extra bits to be or'd in with any pointers
dnl if Emacs uses fewer than 32 bits for the value field of a LISP_OBJECT.
case $opsys in
- gnu)
- dnl libc defines data_start.
- AC_DEFINE(DATA_START, [({ extern int data_start; (char *) &data_start; })])
+ aix*)
+ dnl This works with 32-bit executables; Emacs doesn't support 64-bit.
+ AC_DEFINE(DATA_SEG_BITS, [0x20000000])
;;
-
hpux*)
dnl The data segment on this machine always starts at address 0x40000000.
- AC_DEFINE(DATA_START, [0x40000000])
AC_DEFINE(DATA_SEG_BITS, [0x40000000])
;;
irix6-5)
- AC_DEFINE(DATA_START, [0x10000000])
AC_DEFINE(DATA_SEG_BITS, [0x10000000])
;;
esac
dnl Define symbols to identify the version of Unix this is.
dnl Define all the symbols that apply correctly.
-AH_TEMPLATE(BSD_SYSTEM, [Define if the system is compatible with BSD 4.2.])
AH_TEMPLATE(DOS_NT, [Define if the system is MS DOS or MS Windows.])
AH_TEMPLATE(MSDOS, [Define if the system is MS DOS.])
AH_TEMPLATE(USG, [Define if the system is compatible with System III.])
;;
darwin)
- dnl BSD4_3 and BSD4_4 are already defined in sys/param.h.
- AC_DEFINE(BSD_SYSTEM, [])
- dnl More specific than the above two. We cannot use __APPLE__ as this
- dnl may not be defined on non-OSX Darwin, and we cannot define DARWIN
- dnl here because Panther and lower CoreFoundation.h uses DARWIN to
+ dnl Not __APPLE__, as this may not be defined on non-OSX Darwin.
+ dnl Not DARWIN, because Panther and lower CoreFoundation.h use DARWIN to
dnl distinguish OS X from pure Darwin.
AC_DEFINE(DARWIN_OS, [], [Define if the system is Darwin.])
;;
- freebsd)
- dnl Hack to avoid calling AC_PREPROC_IFELSE multiple times.
- dnl Would not be needed with autoconf >= 2.67, where the
- dnl preprocessed output is accessible in "conftest.i".
- AC_DEFINE(BSD_SYSTEM_AHB, 1, [Define if AH_BOTTOM should change BSD_SYSTEM.])
- ;;
-
- gnu | netbsd | openbsd )
- AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
-#ifndef BSD_SYSTEM
-# error "BSD_SYSTEM not defined"
-#endif
- ]], [[]])], [], AC_DEFINE(BSD_SYSTEM, 43) )
- ;;
-
gnu-linux | gnu-kfreebsd )
AC_DEFINE(USG, [])
AC_DEFINE(GNU_LINUX, [], [Define if ths system is compatible with GNU/Linux.])
LD_SWITCH_SYSTEM_TEMACS="-fno-pie -prebind $libs_nsgui -Xlinker -headerpad -Xlinker $headerpad_extra"
## This is here because src/Makefile.in did some extra fiddling around
- ## with LD_SWITCH_SYSTEM. The cpp logic was:
- ## #ifndef LD_SWITCH_SYSTEM
- ## #if !defined (__GNUC__) && ((defined (BSD_SYSTEM) && !defined (COFF)))
- ## Since all the *bsds define LD_SWITCH_SYSTEM, this simplifies to:
- ## not using gcc, darwin.
- ## Because this was done in src/Makefile.in, the resulting part of
- ## LD_SWITCH_SYSTEM was not used in configure (ie, in ac_link).
- ## It therefore seems cleaner to put this in LD_SWITCH_SYSTEM_TEMACS,
- ## rather than LD_SWITCH_SYSTEM.
+ ## with LD_SWITCH_SYSTEM. It seems cleaner to put this in
+ ## LD_SWITCH_SYSTEM_TEMACS instead,
test "x$LD_SWITCH_SYSTEM" = "x" && test "x$GCC" != "xyes" && \
LD_SWITCH_SYSTEM_TEMACS="-X $LD_SWITCH_SYSTEM_TEMACS"
;;
*) LD_SWITCH_SYSTEM_TEMACS= ;;
esac
-AC_SUBST(LD_SWITCH_SYSTEM_TEMACS)
-
-
-LD_FIRSTFLAG=
-ORDINARY_LINK=
-case "$opsys" in
- ## gnu: GNU needs its own crt0.
- aix4-2|cygwin|darwin|gnu|hpux*|irix6-5|sol2*|unixware) ORDINARY_LINK=yes ;;
-
- ## On post 1.3 releases of NetBSD, gcc -nostdlib also clears the
- ## library search parth, i.e. it won't search /usr/lib for libc and
- ## friends. Using -nostartfiles instead avoids this problem, and
- ## will also work on earlier NetBSD releases.
- netbsd|openbsd) LD_FIRSTFLAG="-nostartfiles" ;;
-
- ## powerpc*: NAKAJI Hiroyuki <nakaji@tutrp.tut.ac.jp> says
- ## MkLinux/LinuxPPC needs this.
- ## s390x-* only supports opsys = gnu-linux so it can be added here.
- gnu-*)
- case "$canonical" in
- powerpc*|s390x-*) LD_FIRSTFLAG="-nostdlib" ;;
- esac
- ;;
-esac
-
-
-if test "x$ORDINARY_LINK" = "xyes"; then
-
- LD_FIRSTFLAG=""
- AC_DEFINE(ORDINARY_LINK, 1, [Define if the C compiler is the linker.])
-
-## The system files defining neither ORDINARY_LINK nor LD_FIRSTFLAG are:
-## freebsd, gnu-* not on powerpc*|s390x*.
-elif test "x$GCC" = "xyes" && test "x$LD_FIRSTFLAG" = "x"; then
-
- ## Versions of GCC >= 2.0 put their library, libgcc.a, in obscure
- ## places that are difficult to figure out at make time. Fortunately,
- ## these same versions allow you to pass arbitrary flags on to the
- ## linker, so there is no reason not to use it as a linker.
- ##
- ## Well, it is not quite perfect. The "-nostdlib" keeps GCC from
- ## searching for libraries in its internal directories, so we have to
- ## ask GCC explicitly where to find libgcc.a (LIB_GCC below).
- LD_FIRSTFLAG="-nostdlib"
+if test x$ac_enable_profiling != x ; then
+ case $opsys in
+ *freebsd | gnu-linux) ;;
+ *) LD_SWITCH_SYSTEM_TEMACS="$LD_SWITCH_SYSTEM_TEMACS -pg" ;;
+ esac
fi
-## FIXME? What setting of EDIT_LDFLAGS should this have?
-test "$NS_IMPL_GNUSTEP" = "yes" && LD_FIRSTFLAG="-rdynamic"
-
-AC_SUBST(LD_FIRSTFLAG)
-
-
-## FIXME? The logic here is not precisely the same as that above.
-## There is no check here for a pre-defined LD_FIRSTFLAG.
-## Should we only be setting LIB_GCC if LD ~ -nostdlib?
-LIB_GCC=
-if test "x$GCC" = "xyes" && test "x$ORDINARY_LINK" != "xyes"; then
-
- case "$opsys" in
- freebsd|netbsd|openbsd) LIB_GCC= ;;
-
- gnu-*)
- ## armin76@gentoo.org reported that the lgcc_s flag is necessary to
- ## build on ARM EABI under GNU/Linux. (Bug#5518)
- case $host_cpu in
- arm*)
- LIB_GCC="-lgcc_s"
- ;;
- *)
- ## FIXME? s/gnu-linux.h used to define LIB_GCC as below, then
- ## immediately undefine it again and redefine it to empty.
- ## Was the C_SWITCH_X_SITE part really necessary?
-## LIB_GCC=`$CC $C_SWITCH_X_SITE -print-libgcc-file-name`
- LIB_GCC=
- ;;
- esac
- ;;
-
- ## Ask GCC where to find libgcc.a.
- *) LIB_GCC=`$CC -print-libgcc-file-name 2> /dev/null` ;;
- esac
-fi dnl if $GCC
-AC_SUBST(LIB_GCC)
+AC_SUBST(LD_SWITCH_SYSTEM_TEMACS)
## Common for all window systems
if test "$window_system" != "none"; then