diff --git a/autogen.sh b/autogen.sh index 03f647e576c..041468edcd9 100755 --- a/autogen.sh +++ b/autogen.sh @@ -35,7 +35,7 @@ progs="autoconf" ## Minimum versions we need: -autoconf_min=`sed -n 's/^ *AC_PREREQ(\([0-9\.]*\)).*/\1/p' configure.ac` +autoconf_min=`sed -n 's/^ *AC_PREREQ(\[\([0-9\.]*\)]).*/\1/p' configure.ac` ## $1 = program, eg "autoconf". diff --git a/configure.ac b/configure.ac index 3afe2e01140..45b62647e71 100644 --- a/configure.ac +++ b/configure.ac @@ -21,9 +21,10 @@ dnl dnl You should have received a copy of the GNU General Public License dnl along with GNU Emacs. If not, see . -AC_PREREQ(2.65) +AC_PREREQ([2.65]) dnl Note this is parsed by (at least) make-dist and lisp/cedet/ede/emacs.el. -AC_INIT(GNU Emacs, 29.0.50, bug-gnu-emacs@gnu.org, , https://www.gnu.org/software/emacs/) +AC_INIT([GNU Emacs], [29.0.50], [bug-gnu-emacs@gnu.org], [], + [https://www.gnu.org/software/emacs/]) dnl Set emacs_config_options to the options of 'configure', quoted for the shell, dnl and then quoted again for a C string. Separate options with spaces. @@ -64,13 +65,13 @@ for opt in "$@" CFLAGS CPPFLAGS LDFLAGS; do optsep=' ' done -AC_CONFIG_HEADERS(src/config.h:src/config.in) -AC_CONFIG_SRCDIR(src/lisp.h) -AC_CONFIG_AUX_DIR(build-aux) -AC_CONFIG_MACRO_DIR(m4) +AC_CONFIG_HEADERS([src/config.h:src/config.in]) +AC_CONFIG_SRCDIR([src/lisp.h]) +AC_CONFIG_AUX_DIR([build-aux]) +AC_CONFIG_MACRO_DIR([m4]) xcsdkdir= -AC_CHECK_PROGS(XCRUN, [xcrun]) +AC_CHECK_PROGS([XCRUN], [xcrun]) if test -n "$XCRUN"; then if test -z "$MAKE"; then dnl Call the variable MAKE_PROG, not MAKE, to avoid confusion with @@ -199,7 +200,7 @@ etcdocdir='${datadir}/emacs/${version}/etc' gamedir='${localstatedir}/games/emacs' dnl Special option to disable the most of other options. -AC_ARG_WITH(all, +AC_ARG_WITH([all], [AS_HELP_STRING([--without-all], [omit almost all features and build small executable with minimal dependencies])], @@ -278,41 +279,45 @@ AC_ARG_WITH([pop], *) with_pop=no-by-default;; esac]) if test "$with_pop" = yes; then - AC_DEFINE(MAIL_USE_POP) + AC_DEFINE([MAIL_USE_POP]) fi -AH_TEMPLATE(MAIL_USE_POP, [Define to support POP mail retrieval.])dnl +AH_TEMPLATE([MAIL_USE_POP], [Define to support POP mail retrieval.])dnl OPTION_DEFAULT_OFF([kerberos],[support Kerberos-authenticated POP]) if test "$with_kerberos" != no; then - AC_DEFINE(KERBEROS) + AC_DEFINE([KERBEROS]) fi -AH_TEMPLATE(KERBEROS, +AH_TEMPLATE([KERBEROS], [Define to support Kerberos-authenticated POP mail retrieval.])dnl OPTION_DEFAULT_OFF([kerberos5],[support Kerberos version 5 authenticated POP]) if test "${with_kerberos5}" != no; then if test "${with_kerberos}" = no; then with_kerberos=yes - AC_DEFINE(KERBEROS) + AC_DEFINE([KERBEROS]) 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 OPTION_DEFAULT_OFF([hesiod],[support Hesiod to get the POP server host]) dnl FIXME hesiod support may not be present, so it seems like an error dnl to define, or at least use, this unconditionally. if test "$with_hesiod" != no; then - AC_DEFINE(HESIOD, 1, [Define to support using a Hesiod database to find the POP server.]) + AC_DEFINE([HESIOD], [1], + [Define to support using a Hesiod database to find the POP server.]) fi OPTION_DEFAULT_OFF([mail-unlink],[unlink, rather than empty, mail spool after reading]) if test "$with_mail_unlink" != no; then - AC_DEFINE(MAIL_UNLINK_SPOOL, 1, [Define to unlink, rather than empty, mail spool after reading.]) + AC_DEFINE([MAIL_UNLINK_SPOOL], [1], + [Define to unlink, rather than empty, mail spool after reading.]) fi AC_ARG_WITH([mailhost],[AS_HELP_STRING([--with-mailhost=HOSTNAME], [string giving default POP mail host])], - AC_DEFINE_UNQUOTED(MAILHOST, ["$withval"], [String giving fallback POP mail host.])) + AC_DEFINE_UNQUOTED([MAILHOST], ["$withval"], + [String giving fallback POP mail host.])) AC_ARG_WITH([sound],[AS_HELP_STRING([--with-sound=VALUE], [compile with sound support (VALUE one of: yes, alsa, oss, bsd-ossaudio, no; @@ -395,7 +400,8 @@ if test "$with_dumping" = "unexec" && test "$with_unexec" = "no"; then fi if test "$with_pdumper" = "yes"; then - AC_DEFINE([HAVE_PDUMPER], 1, [Define to build with portable dumper support]) + AC_DEFINE([HAVE_PDUMPER], [1], + [Define to build with portable dumper support]) HAVE_PDUMPER=yes else HAVE_PDUMPER=no @@ -403,7 +409,7 @@ fi AC_SUBST([HAVE_PDUMPER]) DUMPING=$with_dumping -AC_SUBST(DUMPING) +AC_SUBST([DUMPING]) dnl FIXME currently it is not the last. dnl This should be the last --with option, because --with-x is @@ -436,7 +442,7 @@ OPTION_DEFAULT_OFF([wide-int], at the cost of 10% to 30% slowdown of Lisp interpreter and larger memory footprint]) if test "$with_wide_int" = yes; then - AC_DEFINE([WIDE_EMACS_INT], 1, [Use long long for EMACS_INT if available.]) + AC_DEFINE([WIDE_EMACS_INT], [1], [Use long long for EMACS_INT if available.]) fi dnl _ON results in a '--without' option in the --help output, so @@ -522,7 +528,7 @@ OPTION_DEFAULT_OFF([be-cairo], [enable use of cairo under Haiku's Application Kit]) ## Makefile.in needs the cache file name. -AC_SUBST(cache_file) +AC_SUBST([cache_file]) ## This is an option because I do not know if all info/man support ## compressed files, nor how to test if they do so. @@ -530,7 +536,7 @@ OPTION_DEFAULT_ON([compress-install], [don't compress some files (.el, .info, etc.) when installing. Equivalent to: make GZIP_PROG= install]) -AC_ARG_WITH(gameuser,dnl +AC_ARG_WITH([gameuser], [AS_HELP_STRING([--with-gameuser=USER_OR_GROUP], [user for shared game score files. An argument prefixed by ':' specifies a group instead.])]) @@ -543,7 +549,7 @@ case ${with_gameuser} in *) gameuser=${with_gameuser} ;; esac -AC_ARG_WITH([gnustep-conf],dnl +AC_ARG_WITH([gnustep-conf], [AS_HELP_STRING([--with-gnustep-conf=FILENAME], [name of GNUstep configuration file to use on systems where the command 'gnustep-config' does not work; default $GNUSTEP_CONFIG_FILE, or @@ -553,24 +559,24 @@ test "X${with_gnustep_conf}" != X && test "${with_gnustep_conf}" != yes && \ test "X$GNUSTEP_CONFIG_FILE" = "X" && \ GNUSTEP_CONFIG_FILE=/etc/GNUstep/GNUstep.conf -AC_ARG_ENABLE(ns-self-contained, +AC_ARG_ENABLE([ns-self-contained], [AS_HELP_STRING([--disable-ns-self-contained], [disable self contained build under NeXTstep])], - EN_NS_SELF_CONTAINED=$enableval, - EN_NS_SELF_CONTAINED=yes) + [EN_NS_SELF_CONTAINED=$enableval], + [EN_NS_SELF_CONTAINED=yes]) locallisppathset=no -AC_ARG_ENABLE(locallisppath, +AC_ARG_ENABLE([locallisppath], [AS_HELP_STRING([--enable-locallisppath=PATH], [directories Emacs should search for lisp files specific to this site])], -if test "${enableval}" = "no"; then +[if test "${enableval}" = "no"; then locallisppath= elif test "${enableval}" != "yes"; then locallisppath=${enableval} locallisppathset=yes -fi) +fi]) -AC_ARG_ENABLE(checking, +AC_ARG_ENABLE([checking], [AS_HELP_STRING([--enable-checking@<:@=LIST@:>@], [enable expensive checks. With LIST, enable only specific categories of checks. @@ -603,17 +609,17 @@ do stringfreelist) ac_gc_check_string_free_list=1 ;; structs) CHECK_STRUCTS=true ;; glyphs) ac_glyphs_debug=1 ;; - *) AC_MSG_ERROR(unknown check category $check) ;; + *) AC_MSG_ERROR([unknown check category $check]) ;; esac done IFS="$ac_save_IFS" if test x$ac_enable_checking != x ; then - AC_DEFINE(ENABLE_CHECKING, 1, + AC_DEFINE([ENABLE_CHECKING], [1], [Define to 1 if expensive run-time data type and consistency checks are enabled.]) fi if $CHECK_STRUCTS; then - AC_DEFINE([CHECK_STRUCTS], 1, + AC_DEFINE([CHECK_STRUCTS], [1], [Define this to check whether someone updated the portable dumper code after changing the layout of a structure that it uses. If you change one of these structures, check that the pdumper.c @@ -622,21 +628,21 @@ if $CHECK_STRUCTS; then fi AC_SUBST([CHECK_STRUCTS]) if test x$ac_gc_check_stringbytes != x ; then - AC_DEFINE(GC_CHECK_STRING_BYTES, 1, + AC_DEFINE([GC_CHECK_STRING_BYTES], [1], [Define this temporarily to hunt a bug. If defined, the size of strings is redundantly recorded in sdata structures so that it can be compared to the sizes recorded in Lisp strings.]) fi if test x$ac_gc_check_string_overrun != x ; then - AC_DEFINE(GC_CHECK_STRING_OVERRUN, 1, + AC_DEFINE([GC_CHECK_STRING_OVERRUN], [1], [Define this to check for short string overrun.]) fi if test x$ac_gc_check_string_free_list != x ; then - AC_DEFINE(GC_CHECK_STRING_FREE_LIST, 1, + AC_DEFINE([GC_CHECK_STRING_FREE_LIST], [1], [Define this to check the string free list.]) fi if test x$ac_glyphs_debug != x ; then - AC_DEFINE(GLYPH_DEBUG, 1, + AC_DEFINE([GLYPH_DEBUG], [1], [Define this to enable glyphs debugging code.]) fi @@ -644,7 +650,7 @@ dnl The name of this option is unfortunate. It predates, and has no dnl relation to, the "sampling-based elisp profiler" added in 24.3. dnl Actually, it stops it working. dnl https://lists.gnu.org/r/emacs-devel/2012-11/msg00393.html -AC_ARG_ENABLE(profiling, +AC_ARG_ENABLE([profiling], [AS_HELP_STRING([--enable-profiling], [build emacs with low-level, gprof profiling support. Mainly useful for debugging Emacs itself. May not work on @@ -655,15 +661,15 @@ if test x$ac_enable_profiling != x ; then else PROFILING_CFLAGS= fi -AC_SUBST(PROFILING_CFLAGS) +AC_SUBST([PROFILING_CFLAGS]) -AC_ARG_ENABLE(autodepend, +AC_ARG_ENABLE([autodepend], [AS_HELP_STRING([--enable-autodepend], [automatically generate dependencies to .h-files. Requires gcc, enabled if found.])], [ac_enable_autodepend="${enableval}"],[ac_enable_autodepend=yes]) -AC_ARG_ENABLE(gtk-deprecation-warnings, +AC_ARG_ENABLE([gtk-deprecation-warnings], [AS_HELP_STRING([--enable-gtk-deprecation-warnings], [Show Gtk+/Gdk deprecation warnings for Gtk+ >= 3.0])], [ac_enable_gtk_deprecation_warnings="${enableval}"],[]) @@ -866,7 +872,7 @@ AC_DEFUN([_AC_PROG_CC_C89], [$2]) dnl Sets GCC=yes if using gcc. AC_PROG_CC([gcc cc cl clang "$XCRUN gcc" "$XCRUN clang"]) if test -n "$XCRUN"; then - AC_CHECK_PROGS(AR, [ar "$XCRUN ar"]) + AC_CHECK_PROGS([AR], [ar "$XCRUN ar"]) test -n "$AR" && export AR fi @@ -1008,7 +1014,7 @@ AC_ARG_ENABLE([check-lisp-object-type], [Enable compile time checks for the Lisp_Object data type, which can catch some bugs during development.])]) if test "$enable_check_lisp_object_type" = yes; then - AC_DEFINE([CHECK_LISP_OBJECT_TYPE], 1, + AC_DEFINE([CHECK_LISP_OBJECT_TYPE], [1], [Define to enable compile-time checks for the Lisp_Object data type.]) fi @@ -1157,7 +1163,7 @@ edit_cflags=" s/^ // " -AC_ARG_ENABLE(link-time-optimization, +AC_ARG_ENABLE([link-time-optimization], [AS_HELP_STRING([--enable-link-time-optimization], [build with link-time optimization (experimental; see INSTALL)])], @@ -1267,7 +1273,7 @@ fi rm -f conf$$ conf$$.file]) LN_S_FILEONLY=$emacs_cv_ln_s_fileonly -AC_SUBST(LN_S_FILEONLY) +AC_SUBST([LN_S_FILEONLY]) dnl AC_PROG_LN_S sets LN_S to 'cp -pR' for MinGW, on the premise that 'ln' @@ -1286,13 +1292,13 @@ dnl if called via an absolute file name. dnl Use the entirely-identical-but-quieter ginstall-info instead if present. dnl Sadly some people may have an old ginstall-info installed on dnl non-Debian systems, so we can't use this. -dnl AC_PATH_PROGS(INSTALL_INFO, [ginstall-info install-info], :, -dnl $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin) +dnl AC_PATH_PROGS([INSTALL_INFO], [ginstall-info install-info], [:], +dnl [$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin]) -AC_PATH_PROG(INSTALL_INFO, install-info, :, - $PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin) +AC_PATH_PROG([INSTALL_INFO], [install-info], [:], + [$PATH$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/sbin]) dnl Don't use GZIP, which is used by gzip for additional parameters. -AC_PATH_PROG(GZIP_PROG, gzip) +AC_PATH_PROG([GZIP_PROG], [gzip]) test $with_compress_install != yes && test -n "$GZIP_PROG" && \ GZIP_PROG=" # $GZIP_PROG # (disabled by configure --without-compress-install)" @@ -1361,7 +1367,7 @@ AC_SUBST([SETFATTR]) # Makeinfo on macOS is ancient, check whether there is a more recent # version installed by Homebrew. -AC_CHECK_PROGS(BREW, [brew]) +AC_CHECK_PROGS([BREW], [brew]) if test -n "$BREW"; then AC_PATH_PROG([MAKEINFO], [makeinfo], [], [`$BREW --prefix texinfo 2>/dev/null`/bin$PATH_SEPARATOR$PATH]) @@ -1369,7 +1375,7 @@ fi # Check MacPorts on macOS. if test $opsys = darwin; then - AC_PATH_PROG(HAVE_MACPORTS, port) + AC_PATH_PROG([HAVE_MACPORTS], [port]) fi ## Require makeinfo >= 4.13 (last of the 4.x series) to build the manuals. @@ -1409,7 +1415,7 @@ if test $opsys = mingw32; then else DOCMISC_W32= fi -AC_SUBST(DOCMISC_W32) +AC_SUBST([DOCMISC_W32]) dnl Add our options to ac_link now, after it is set up. @@ -1468,7 +1474,7 @@ AC_CACHE_CHECK([whether addresses are sanitized], [emacs_cv_sanitize_address=no])]) if test $with_unexec = yes; then - AC_DEFINE([HAVE_UNEXEC], 1, [Define if Emacs supports unexec.]) + AC_DEFINE([HAVE_UNEXEC], [1], [Define if Emacs supports unexec.]) if test "$emacs_cv_sanitize_address" = yes; then AC_MSG_WARN([[Addresses are sanitized; suggest --without-unexec]]) fi @@ -1505,7 +1511,7 @@ case "$opsys" in UNEXEC_OBJ=unexelf.o ;; esac -AC_SUBST(UNEXEC_OBJ) +AC_SUBST([UNEXEC_OBJ]) LD_SWITCH_SYSTEM= test "$with_unexec" = no || case "$opsys" in @@ -1535,7 +1541,7 @@ test "$with_unexec" = no || case "$opsys" in LD_SWITCH_SYSTEM="-Z" ;; esac -AC_SUBST(LD_SWITCH_SYSTEM) +AC_SUBST([LD_SWITCH_SYSTEM]) ac_link="$ac_link $LD_SWITCH_SYSTEM" @@ -1571,7 +1577,7 @@ case $canonical in fi ;; esac -AC_SUBST(C_SWITCH_MACHINE) +AC_SUBST([C_SWITCH_MACHINE]) C_SWITCH_SYSTEM= ## Some programs in src produce warnings saying certain subprograms @@ -1587,7 +1593,7 @@ if test "$opsys" = "mingw32"; then fi ## gnu-linux might need -D_BSD_SOURCE on old libc5 systems. ## It is redundant in glibc2, since we define _GNU_SOURCE. -AC_SUBST(C_SWITCH_SYSTEM) +AC_SUBST([C_SWITCH_SYSTEM]) LIBS_SYSTEM= @@ -1609,7 +1615,7 @@ case "$opsys" in haiku) LIBS_SYSTEM="-lnetwork" ;; esac -AC_SUBST(LIBS_SYSTEM) +AC_SUBST([LIBS_SYSTEM]) ### Make sure subsequent tests use flags consistent with the build flags. @@ -1717,8 +1723,8 @@ case $opsys in esac -AC_SUBST(LIB_MATH) -AC_DEFINE_UNQUOTED(SYSTEM_TYPE, "$SYSTEM_TYPE", +AC_SUBST([LIB_MATH]) +AC_DEFINE_UNQUOTED([SYSTEM_TYPE], ["$SYSTEM_TYPE"], [The type of system you are compiling for; sets 'system-type'.]) AC_SUBST([SYSTEM_TYPE]) @@ -1726,11 +1732,11 @@ AC_SUBST([SYSTEM_TYPE]) pre_PKG_CONFIG_CFLAGS=$CFLAGS pre_PKG_CONFIG_LIBS=$LIBS -PKG_PROG_PKG_CONFIG(0.9.0) +PKG_PROG_PKG_CONFIG([0.9.0]) -dnl EMACS_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4) -dnl acts like PKG_CHECK_MODULES(GSTUFF, gtk+-2.0 >= 1.3 glib = 1.3.4, -dnl HAVE_GSTUFF=yes, HAVE_GSTUFF=no) -- see pkg-config man page -- +dnl EMACS_CHECK_MODULES([GSTUFF], [gtk+-2.0 >= 1.3 glib = 1.3.4]) +dnl acts like PKG_CHECK_MODULES([GSTUFF], [gtk+-2.0 >= 1.3 glib = 1.3.4], +dnl [HAVE_GSTUFF=yes], [HAVE_GSTUFF=no]) -- see pkg-config man page -- dnl except that it postprocesses CFLAGS as needed for --enable-gcc-warnings. dnl EMACS_CHECK_MODULES accepts optional 3rd and 4th arguments that dnl can take the place of the default HAVE_GSTUFF=yes and HAVE_GSTUFF=no @@ -1745,7 +1751,7 @@ HAVE_SOUND=no if test "${with_sound}" != "no"; then # Sound support for GNU/Linux, the free BSDs, MinGW, and Cygwin. AC_CHECK_HEADERS([machine/soundcard.h sys/soundcard.h soundcard.h mmsystem.h], - have_sound_header=yes, [], [ + [have_sound_header=yes], [], [ #ifdef __MINGW32__ #define WIN32_LEAN_AND_MEAN #include @@ -1756,13 +1762,13 @@ if test "${with_sound}" != "no"; then if test "${with_sound}" = "bsd-ossaudio" || test "${with_sound}" = "yes"; then # Emulation library used on NetBSD. - AC_CHECK_LIB(ossaudio, _oss_ioctl, LIBSOUND=-lossaudio, LIBSOUND=) + AC_CHECK_LIB([ossaudio], [_oss_ioctl], [LIBSOUND=-lossaudio], [LIBSOUND=]) test "${with_sound}" = "bsd-ossaudio" && test -z "$LIBSOUND" && \ AC_MSG_ERROR([bsd-ossaudio sound support requested but not found.]) dnl FIXME? If we did find ossaudio, should we set with_sound=bsd-ossaudio? dnl Traditionally, we go on to check for alsa too. Does that make sense? fi - AC_SUBST(LIBSOUND) + AC_SUBST([LIBSOUND]) if test "${with_sound}" = "alsa" || test "${with_sound}" = "yes"; then ALSA_REQUIRED=1.0.0 @@ -1771,7 +1777,7 @@ if test "${with_sound}" != "no"; then if test $HAVE_ALSA = yes; then LIBSOUND="$LIBSOUND $ALSA_LIBS" CFLAGS_SOUND="$CFLAGS_SOUND $ALSA_CFLAGS" - AC_DEFINE(HAVE_ALSA, 1, [Define to 1 if ALSA is available.]) + AC_DEFINE([HAVE_ALSA], [1], [Define to 1 if ALSA is available.]) elif test "${with_sound}" = "alsa"; then AC_MSG_ERROR([ALSA sound support requested but not found.]) fi @@ -1787,25 +1793,25 @@ if test "${with_sound}" != "no"; then dnl defined __FreeBSD__ || defined __NetBSD__ || defined __linux__ dnl Adjust the --with-sound help text if you change this. gnu-linux|freebsd|netbsd|mingw32|cygwin) - AC_DEFINE(HAVE_SOUND, 1, [Define to 1 if you have sound support.]) + AC_DEFINE([HAVE_SOUND], [1], [Define to 1 if you have sound support.]) HAVE_SOUND=yes ;; esac fi - AC_SUBST(CFLAGS_SOUND) + AC_SUBST([CFLAGS_SOUND]) fi dnl checks for header files AC_CHECK_HEADERS_ONCE( - linux/fs.h + [linux/fs.h malloc.h sys/systeminfo.h sys/sysinfo.h coff.h pty.h sys/resource.h sys/utsname.h pwd.h utmp.h util.h - sanitizer/lsan_interface.h) + sanitizer/lsan_interface.h]) AC_CACHE_CHECK([for ADDR_NO_RANDOMIZE], [emacs_cv_personality_addr_no_randomize], @@ -1832,10 +1838,11 @@ if test "$ac_cv_header_sys_sysinfo_h" = yes; then emacs_cv_linux_sysinfo=yes, emacs_cv_linux_sysinfo=no)]) if test $emacs_cv_linux_sysinfo = yes; then - AC_DEFINE([HAVE_LINUX_SYSINFO], 1, [Define to 1 if you have Linux sysinfo function.]) + AC_DEFINE([HAVE_LINUX_SYSINFO], [1], + [Define to 1 if you have Linux sysinfo function.]) AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[struct sysinfo si; return si.mem_unit]])], - AC_DEFINE(LINUX_SYSINFO_UNIT, 1, + AC_DEFINE([LINUX_SYSINFO_UNIT], [1], [Define to 1 if Linux sysinfo sizes are in multiples of mem_unit bytes.])) fi fi @@ -1843,19 +1850,20 @@ fi dnl On Solaris 8 there's a compilation warning for term.h because dnl it doesn't define 'bool'. AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[#include ]],[[]])], - AC_DEFINE(HAVE_TERM_H, 1, [Define to 1 if you have the header file.])) + [AC_DEFINE([HAVE_TERM_H], [1], + [Define to 1 if you have the header file.])]) AC_HEADER_SYS_WAIT -AC_CHECK_HEADERS_ONCE(sys/socket.h) -AC_CHECK_HEADERS(net/if.h, , , [AC_INCLUDES_DEFAULT +AC_CHECK_HEADERS_ONCE([sys/socket.h]) +AC_CHECK_HEADERS([net/if.h], [], [], [AC_INCLUDES_DEFAULT #if HAVE_SYS_SOCKET_H #include #endif]) -AC_CHECK_HEADERS(ifaddrs.h, , , [AC_INCLUDES_DEFAULT +AC_CHECK_HEADERS([ifaddrs.h], [], [], [AC_INCLUDES_DEFAULT #if HAVE_SYS_SOCKET_H #include #endif]) -AC_CHECK_HEADERS(net/if_dl.h, , , [AC_INCLUDES_DEFAULT +AC_CHECK_HEADERS([net/if_dl.h], [], [], [AC_INCLUDES_DEFAULT #if HAVE_SYS_SOCKET_H #include #endif]) @@ -1864,7 +1872,7 @@ dnl checks for structure members AC_CHECK_MEMBERS([struct ifreq.ifr_flags, struct ifreq.ifr_hwaddr, struct ifreq.ifr_netmask, struct ifreq.ifr_broadaddr, struct ifreq.ifr_addr, - struct ifreq.ifr_addr.sa_len], , , + struct ifreq.ifr_addr.sa_len], [], [], [AC_INCLUDES_DEFAULT #if HAVE_SYS_SOCKET_H #include @@ -1894,7 +1902,7 @@ if test "$GCC" = yes && test "$ac_enable_autodepend" = yes; then AUTO_DEPEND=yes fi fi -AC_SUBST(AUTO_DEPEND) +AC_SUBST([AUTO_DEPEND]) #### Choose a window system. @@ -1944,7 +1952,7 @@ ${x_library}/X11/%T/%N%S" fi done fi -AC_SUBST(LD_SWITCH_X_SITE_RPATH) +AC_SUBST([LD_SWITCH_X_SITE_RPATH]) if test "${x_includes}" != NONE && test -n "${x_includes}"; then C_SWITCH_X_SITE=$isystem`AS_ECHO(["$x_includes"]) | sed -e "s/:/ $isystem/g"` @@ -2028,17 +2036,20 @@ if test "${with_ns}" != no; then 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_CACHE_CHECK(if GNUstep defines BASE_NATIVE_OBJC_EXCEPTIONS, - emacs_cv_objc_exceptions, -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], + AC_CACHE_CHECK([if GNUstep defines BASE_NATIVE_OBJC_EXCEPTIONS], + [emacs_cv_objc_exceptions], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([[#include ]], [[#if defined BASE_NATIVE_OBJC_EXCEPTIONS && BASE_NATIVE_OBJC_EXCEPTIONS > 0 1; #else fail; -#endif]])], emacs_cv_objc_exceptions=yes, emacs_cv_objc_exceptions=no ) ) +#endif]])], + [emacs_cv_objc_exceptions=yes], + [emacs_cv_objc_exceptions=no])]) if test $emacs_cv_objc_exceptions = yes; then dnl _NATIVE_OBJC_EXCEPTIONS is used by the GNUstep headers. - AC_DEFINE(_NATIVE_OBJC_EXCEPTIONS, 1, + AC_DEFINE([_NATIVE_OBJC_EXCEPTIONS], [1], [Define if GNUstep uses ObjC exceptions.]) GNU_OBJC_CFLAGS="$GNU_OBJC_CFLAGS -fobjc-exceptions" fi @@ -2075,8 +2086,8 @@ Either fix this, or re-configure with the option '--without-ns'.])]) #endif #endif ])], - ns_osx_have_106=yes, - ns_osx_have_106=no) + [ns_osx_have_106=yes], + [ns_osx_have_106=no]) AC_MSG_RESULT([$ns_osx_have_106]) if test $ns_osx_have_106 = no; then @@ -2095,12 +2106,13 @@ Mac OS X 12.x or later. [emacs_cv_macosx_12_0=yes])) if test "${with_native_image_api}" = yes; then - AC_DEFINE(HAVE_NATIVE_IMAGE_API, 1, [Define to use native OS APIs for images.]) + AC_DEFINE([HAVE_NATIVE_IMAGE_API], [1], + [Define to use native OS APIs for images.]) NATIVE_IMAGE_API="yes (ns)" fi fi -AC_SUBST(LIBS_GNUSTEP) +AC_SUBST([LIBS_GNUSTEP]) INSTALL_ARCH_INDEP_EXTRA=install-etc ns_self_contained=no @@ -2114,7 +2126,7 @@ if test "${HAVE_NS}" = yes; then window_system=nextstep # set up packaging dirs if test "${EN_NS_SELF_CONTAINED}" = yes; then - AC_DEFINE(NS_SELF_CONTAINED, 1, [Build an NS bundled app]) + AC_DEFINE([NS_SELF_CONTAINED], [1], [Build an NS bundled app]) ns_self_contained=yes prefix=${ns_appresdir} exec_prefix=${ns_appbindir} @@ -2137,10 +2149,10 @@ if test "${HAVE_NS}" = yes; then fi CFLAGS="$tmp_CFLAGS" CPPFLAGS="$tmp_CPPFLAGS" -AC_SUBST(INSTALL_ARCH_INDEP_EXTRA) -AC_SUBST(ns_self_contained) -AC_SUBST(NS_OBJ) -AC_SUBST(NS_OBJC_OBJ) +AC_SUBST([INSTALL_ARCH_INDEP_EXTRA]) +AC_SUBST([ns_self_contained]) +AC_SUBST([NS_OBJ]) +AC_SUBST([NS_OBJC_OBJ]) if test "${HAVE_NS}" = yes; then AC_CACHE_CHECK( @@ -2151,12 +2163,12 @@ if test "${HAVE_NS}" = yes; then [AC_LANG_SOURCE([[@interface Test + (instancetype)test; @end]])], - emacs_cv_objc_instancetype=yes, - emacs_cv_objc_instancetype=no) + [emacs_cv_objc_instancetype=yes], + [emacs_cv_objc_instancetype=no]) AC_LANG_POP([Objective C])]) if test x$emacs_cv_objc_instancetype = xyes ; then - AC_DEFINE(NATIVE_OBJC_INSTANCETYPE, 1, + AC_DEFINE([NATIVE_OBJC_INSTANCETYPE], [1], [Define if ObjC compiler supports instancetype natively.]) fi @@ -2166,8 +2178,8 @@ if test "${HAVE_NS}" = yes; then [AC_LANG_PUSH([Objective C]) AC_COMPILE_IFELSE( [AC_LANG_PROGRAM([], [[for (int i = 0;;);]])], - emacs_cv_objc_c99=yes, - emacs_cv_objc_c99=no) + [emacs_cv_objc_c99=yes], + [emacs_cv_objc_c99=no]) AC_LANG_POP([Objective C])]) if test x$emacs_cv_objc_c99 = xno ; then @@ -2189,7 +2201,7 @@ re-configure with the option '--without-be-app'.])]) AC_LANG_POP([C++]) fi -AC_SUBST(HAVE_BE_APP) +AC_SUBST([HAVE_BE_APP]) HAVE_W32=no W32_OBJ= @@ -2237,11 +2249,11 @@ NTLIB= CM_OBJ="cm.o" XARGS_LIMIT= if test "${HAVE_W32}" = "yes"; then - AC_DEFINE(HAVE_NTGUI, 1, [Define to use native MS Windows GUI.]) + AC_DEFINE([HAVE_NTGUI], [1], [Define to use native MS Windows GUI.]) if test "$with_toolkit_scroll_bars" = "no"; then AC_MSG_ERROR([Non-toolkit scroll bars are not implemented for w32 build.]) fi - AC_CHECK_TOOL(WINDRES, [windres], + AC_CHECK_TOOL([WINDRES], [windres], [AC_MSG_ERROR([No resource compiler found.])]) W32_OBJ="w32fns.o w32menu.o w32reg.o w32font.o w32term.o" W32_OBJ="$W32_OBJ w32xfns.o w32select.o w32uniscribe.o w32cygwinx.o" @@ -2254,8 +2266,8 @@ if test "${HAVE_W32}" = "yes"; then comma_version=`echo "${PACKAGE_VERSION}.0.0" | sed -e 's/\./,/g' -e 's/^\([[^,]]*,[[^,]]*,[[^,]]*,[[^,]]*\).*/\1/'` comma_space_version=`echo "$comma_version" | sed 's/,/, /g'` - AC_SUBST(comma_version) - AC_SUBST(comma_space_version) + AC_SUBST([comma_version]) + AC_SUBST([comma_space_version]) AC_CONFIG_FILES([nt/emacs.rc nt/emacsclient.rc]) if test "${opsys}" = "cygwin"; then W32_LIBS="$W32_LIBS -lkernel32 -luser32 -lusp10 -lgdi32" @@ -2268,7 +2280,8 @@ if test "${HAVE_W32}" = "yes"; then dnl FIXME: This should probably be supported for Cygwin/w32 as dnl well, but the Cygwin build needs to link against -lgdiplus if test "${with_native_image_api}" = yes; then - AC_DEFINE(HAVE_NATIVE_IMAGE_API, 1, [Define to use native OS APIs for images.]) + AC_DEFINE([HAVE_NATIVE_IMAGE_API], [1], + [Define to use native OS APIs for images.]) NATIVE_IMAGE_API="yes (w32)" W32_OBJ="$W32_OBJ w32image.o" fi @@ -2292,20 +2305,20 @@ if test "${HAVE_W32}" = "no" && test "${opsys}" = "cygwin"; then W32_OBJ="w32cygwinx.o" fi -AC_SUBST(W32_OBJ) -AC_SUBST(W32_LIBS) -AC_SUBST(EMACSRES) -AC_SUBST(EMACS_MANIFEST) -AC_SUBST(CLIENTRES) -AC_SUBST(CLIENTW) -AC_SUBST(W32_RES_LINK) -AC_SUBST(FIRSTFILE_OBJ) -AC_SUBST(NTDIR) -AC_SUBST(CM_OBJ) -AC_SUBST(LIBS_ECLIENT) -AC_SUBST(LIB_WSOCK32) -AC_SUBST(NTLIB) -AC_SUBST(XARGS_LIMIT) +AC_SUBST([W32_OBJ]) +AC_SUBST([W32_LIBS]) +AC_SUBST([EMACSRES]) +AC_SUBST([EMACS_MANIFEST]) +AC_SUBST([CLIENTRES]) +AC_SUBST([CLIENTW]) +AC_SUBST([W32_RES_LINK]) +AC_SUBST([FIRSTFILE_OBJ]) +AC_SUBST([NTDIR]) +AC_SUBST([CM_OBJ]) +AC_SUBST([LIBS_ECLIENT]) +AC_SUBST([LIB_WSOCK32]) +AC_SUBST([NTLIB]) +AC_SUBST([XARGS_LIMIT]) if test "${HAVE_W32}" = "yes"; then window_system=w32 @@ -2322,7 +2335,7 @@ if test "$opsys" = "haiku"; then fi if test "${HAVE_BE_APP}" = "yes"; then - AC_DEFINE([HAVE_HAIKU], 1, + AC_DEFINE([HAVE_HAIKU], [1], [Define if Emacs will be built with Haiku windowing support]) fi @@ -2334,16 +2347,17 @@ if test "${HAVE_BE_APP}" = "yes"; then HAIKU_LIBS="-lbe -lgame -ltranslation -ltracker" # -lgame is needed for set_mouse_position. if test "${with_native_image_api}" = yes; then - AC_DEFINE(HAVE_NATIVE_IMAGE_API, 1, [Define to use native OS APIs for images.]) + AC_DEFINE([HAVE_NATIVE_IMAGE_API], [1], + [Define to use native OS APIs for images.]) NATIVE_IMAGE_API="yes (haiku)" HAIKU_OBJ="$HAIKU_OBJ haikuimage.o" fi fi -AC_SUBST(HAIKU_LIBS) -AC_SUBST(HAIKU_OBJ) -AC_SUBST(HAIKU_CXX_OBJ) -AC_SUBST(HAIKU_CFLAGS) +AC_SUBST([HAIKU_LIBS]) +AC_SUBST([HAIKU_OBJ]) +AC_SUBST([HAIKU_CXX_OBJ]) +AC_SUBST([HAIKU_CFLAGS]) ## $window_system is now set to the window system we will ## ultimately use. @@ -2390,16 +2404,16 @@ dnl use the toolkit if we have gtk, or X11R5 or newer. with_gtk3=yes USE_X_TOOLKIT=none HAVE_PGTK=yes - AC_DEFINE([HAVE_PGTK], 1, [Define to 1 if you have pure Gtk+-3.]) + AC_DEFINE([HAVE_PGTK], [1], [Define to 1 if you have pure Gtk+-3.]) ;; haiku ) term_header=haikuterm.h ;; esac -AC_SUBST(HAVE_PGTK) +AC_SUBST([HAVE_PGTK]) if test "$window_system" = none && test "X$with_x" != "Xno"; then - AC_CHECK_PROG(HAVE_XSERVER, X, true, false) + AC_CHECK_PROG([HAVE_XSERVER], [X], [true], [false]) if test "$HAVE_XSERVER" = true || test -n "$DISPLAY" || { @@ -2463,7 +2477,7 @@ fi GMALLOC_OBJ= HYBRID_MALLOC= if test "${system_malloc}" = "yes"; then - AC_DEFINE([SYSTEM_MALLOC], 1, + AC_DEFINE([SYSTEM_MALLOC], [1], [Define to 1 to use the system memory allocator, even if it is not Doug Lea style.]) GNU_MALLOC=no @@ -2471,7 +2485,7 @@ if test "${system_malloc}" = "yes"; then (The GNU allocators don't work with this system configuration.)" VMLIMIT_OBJ= elif test "$hybrid_malloc" = yes; then - AC_DEFINE(HYBRID_MALLOC, 1, + AC_DEFINE([HYBRID_MALLOC], [1], [Define to use gmalloc before dumping and the system malloc after.]) HYBRID_MALLOC=1 GNU_MALLOC=no @@ -2491,21 +2505,21 @@ else [emacs_cv_data_start=yes], [emacs_cv_data_start=no])]) if test $emacs_cv_data_start = yes; then - AC_DEFINE([HAVE_DATA_START], 1, + 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([HYBRID_MALLOC]) -AC_SUBST(GMALLOC_OBJ) -AC_SUBST(VMLIMIT_OBJ) +AC_SUBST([GMALLOC_OBJ]) +AC_SUBST([VMLIMIT_OBJ]) if test "$doug_lea_malloc" = "yes" && test "$hybrid_malloc" != yes; then if test "$GNU_MALLOC" = yes ; then GNU_MALLOC_reason=" (Using Doug Lea's new malloc from the GNU C Library.)" fi - AC_DEFINE(DOUG_LEA_MALLOC, 1, + AC_DEFINE([DOUG_LEA_MALLOC], [1], [Define to 1 if the system memory allocator is Doug Lea style, with malloc hooks and malloc_set_state.]) @@ -2529,18 +2543,19 @@ esac AC_FUNC_MMAP if test $use_mmap_for_buffers = yes; then - AC_DEFINE(USE_MMAP_FOR_BUFFERS, 1, [Define to use mmap to allocate buffer text.]) + AC_DEFINE([USE_MMAP_FOR_BUFFERS], [1], + [Define to use mmap to allocate buffer text.]) REL_ALLOC=no fi LIBS="$LIBS_SYSTEM $LIBS" dnl FIXME replace main with a function we actually want from this library. -AC_CHECK_LIB(Xbsd, main, LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd") +AC_CHECK_LIB([Xbsd], [main], [LD_SWITCH_X_SITE="$LD_SWITCH_X_SITE -lXbsd"]) dnl Check for the POSIX thread library. LIB_PTHREAD= -AC_CHECK_HEADERS_ONCE(pthread.h) +AC_CHECK_HEADERS_ONCE([pthread.h]) if test "$ac_cv_header_pthread_h" && test "$opsys" != "mingw32"; then AC_CACHE_CHECK([for pthread library], [emacs_cv_pthread_lib], @@ -2575,7 +2590,7 @@ if test "$ac_cv_header_pthread_h" && test "$opsys" != "mingw32"; then fi done]) if test "$emacs_cv_pthread_lib" != no; then - AC_DEFINE([HAVE_PTHREAD], 1, [Define to 1 if you have POSIX threads.]) + AC_DEFINE([HAVE_PTHREAD], [1], [Define to 1 if you have POSIX threads.]) case $emacs_cv_pthread_lib in -*) LIB_PTHREAD=$emacs_cv_pthread_lib;; esac @@ -2585,10 +2600,10 @@ if test "$ac_cv_header_pthread_h" && test "$opsys" != "mingw32"; then # definition of 'errno' in . case $opsys in hpux* | solaris) - AC_DEFINE([_REENTRANT], 1, + AC_DEFINE([_REENTRANT], [1], [Define to 1 if your system requires this in multithreaded code.]);; aix4-2) - AC_DEFINE([_THREAD_SAFE], 1, + AC_DEFINE([_THREAD_SAFE], [1], [Define to 1 if your system requires this in multithreaded code.]);; esac fi @@ -2599,12 +2614,12 @@ AC_MSG_CHECKING([for thread support]) threads_enabled=no if test "$with_threads" = yes; then if test "$emacs_cv_pthread_lib" != no; then - AC_DEFINE(THREADS_ENABLED, 1, + AC_DEFINE([THREADS_ENABLED], [1], [Define to 1 if you want elisp thread support.]) threads_enabled=yes elif test "${opsys}" = "mingw32"; then dnl MinGW can do native Windows threads even without pthreads - AC_DEFINE(THREADS_ENABLED, 1, + AC_DEFINE([THREADS_ENABLED], [1], [Define to 1 if you want elisp thread support.]) threads_enabled=yes fi @@ -2689,40 +2704,42 @@ if test "${HAVE_X11}" = "yes"; then [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include #include ]], [[XkbDescPtr kb = XkbGetKeyboard (0, XkbAllComponentsMask, XkbUseCoreKbd);]])], - emacs_cv_xkb=yes, emacs_cv_xkb=no)]) + [emacs_cv_xkb=yes], + [emacs_cv_xkb=no])]) if test $emacs_cv_xkb = yes; then - AC_DEFINE(HAVE_XKB, 1, [Define to 1 if you have the Xkb extension.]) - AC_CHECK_FUNCS(XkbRefreshKeyboardMapping XkbFreeNames) + AC_DEFINE([HAVE_XKB], [1], [Define to 1 if you have the Xkb extension.]) + AC_CHECK_FUNCS([XkbRefreshKeyboardMapping XkbFreeNames]) fi - AC_CHECK_FUNCS(XrmSetDatabase XScreenResourceString XScreenNumberOfScreen) - AC_CHECK_FUNCS(XDisplayCells XDestroySubwindows) + AC_CHECK_FUNCS([XrmSetDatabase XScreenResourceString XScreenNumberOfScreen]) + AC_CHECK_FUNCS([XDisplayCells XDestroySubwindows]) fi if test "${window_system}" = "x11"; then - AC_MSG_CHECKING(X11 version 6) - AC_CACHE_VAL(emacs_cv_x11_version_6, + AC_MSG_CHECKING([X11 version 6]) + AC_CACHE_VAL([emacs_cv_x11_version_6], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[#if XlibSpecificationRelease < 6 fail; #endif -]])], emacs_cv_x11_version_6=yes, emacs_cv_x11_version_6=no)]) +]])], [emacs_cv_x11_version_6=yes], + [emacs_cv_x11_version_6=no])]) if test $emacs_cv_x11_version_6 = yes; then - AC_MSG_RESULT(6 or newer) - AC_DEFINE(HAVE_X11R6, 1, + AC_MSG_RESULT([6 or newer]) + AC_DEFINE([HAVE_X11R6], [1], [Define to 1 if you have the X11R6 or newer version of Xlib.]) - AC_DEFINE(HAVE_X_I18N, 1, [Define if you have usable i18n support.]) + AC_DEFINE([HAVE_X_I18N], [1], [Define if you have usable i18n support.]) AC_CHECK_MEMBERS([XICCallback.callback], [], [], [#include ]) ## inoue@ainet.or.jp says Solaris has a bug related to X11R6-style ## XIM support. case "$opsys" in solaris) : ;; - *) AC_DEFINE(HAVE_X11R6_XIM, 1, + *) AC_DEFINE([HAVE_X11R6_XIM], [1], [Define if you have usable X11R6-style XIM support.]) ;; esac else - AC_MSG_RESULT(before 6) + AC_MSG_RESULT([before 6]) fi fi @@ -2737,11 +2754,11 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" \ RSVG_MODULE="librsvg-2.0 >= $RSVG_REQUIRED" EMACS_CHECK_MODULES([RSVG], [$RSVG_MODULE]) - AC_SUBST(RSVG_CFLAGS) - AC_SUBST(RSVG_LIBS) + AC_SUBST([RSVG_CFLAGS]) + AC_SUBST([RSVG_LIBS]) if test $HAVE_RSVG = yes; then - AC_DEFINE(HAVE_RSVG, 1, [Define to 1 if using librsvg.]) + AC_DEFINE([HAVE_RSVG], [1], [Define to 1 if using librsvg.]) CFLAGS="$CFLAGS $RSVG_CFLAGS" # Windows loads librsvg dynamically if test "${opsys}" = "mingw32"; then @@ -2764,11 +2781,11 @@ if test "${with_webp}" != "no"; then if test "$HAVE_WEBP" = "yes"; then WEBP_LIBS="-lwebp -lwebpdemux" fi - AC_SUBST(WEBP_CFLAGS) - AC_SUBST(WEBP_LIBS) + AC_SUBST([WEBP_CFLAGS]) + AC_SUBST([WEBP_LIBS]) fi if test $HAVE_WEBP = yes; then - AC_DEFINE(HAVE_WEBP, 1, [Define to 1 if using libwebp.]) + AC_DEFINE([HAVE_WEBP], [1], [Define to 1 if using libwebp.]) CFLAGS="$CFLAGS $WEBP_CFLAGS" # Windows loads libwebp dynamically if test "${opsys}" = "mingw32"; then @@ -2780,20 +2797,25 @@ fi ### Use -lsqlite3 if available, unless '--with-sqlite3=no' HAVE_SQLITE3=no if test "${with_sqlite3}" != "no"; then - AC_CHECK_LIB(sqlite3, sqlite3_open_v2, HAVE_SQLITE3=yes, HAVE_SQLITE3=no) + AC_CHECK_LIB([sqlite3], [sqlite3_open_v2], + [HAVE_SQLITE3=yes], + [HAVE_SQLITE3=no]) if test "$HAVE_SQLITE3" = "yes"; then SQLITE3_LIBS=-lsqlite3 - AC_SUBST(SQLITE3_LIBS) + AC_SUBST([SQLITE3_LIBS]) LIBS="$SQLITE3_LIBS $LIBS" - AC_DEFINE(HAVE_SQLITE3, 1, [Define to 1 if you have the libsqlite3 library (-lsqlite).]) + AC_DEFINE([HAVE_SQLITE3], [1], + [Define to 1 if you have the libsqlite3 library (-lsqlite).]) # Windows loads libsqlite dynamically if test "${opsys}" = "mingw32"; then SQLITE3_LIBS= fi - AC_CHECK_LIB(sqlite3, sqlite3_load_extension, - HAVE_SQLITE3_LOAD_EXTENSION=yes, HAVE_SQLITE3_LOAD_EXTENSION=no) + AC_CHECK_LIB([sqlite3], [sqlite3_load_extension], + [HAVE_SQLITE3_LOAD_EXTENSION=yes], + [HAVE_SQLITE3_LOAD_EXTENSION=no]) if test "$HAVE_SQLITE3_LOAD_EXTENSION" = "yes"; then - AC_DEFINE(HAVE_SQLITE3_LOAD_EXTENSION, 1, [Define to 1 if sqlite3 supports loading extensions.]) + AC_DEFINE([HAVE_SQLITE3_LOAD_EXTENSION], [1], + [Define to 1 if sqlite3 supports loading extensions.]) fi fi fi @@ -2810,7 +2832,8 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${HAVE_W32}" EMACS_CHECK_MODULES([IMAGEMAGICK], [MagickWand >= 7]) if test $HAVE_IMAGEMAGICK = yes; then - AC_DEFINE([HAVE_IMAGEMAGICK7], 1, [Define to 1 if using ImageMagick7.]) + AC_DEFINE([HAVE_IMAGEMAGICK7], [1], + [Define to 1 if using ImageMagick7.]) else ## 6.3.5 is the earliest version known to work; see Bug#17339. ## 6.8.2 makes Emacs crash; see Bug#13867. @@ -2834,7 +2857,7 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${HAVE_W32}" fi fi if test $HAVE_IMAGEMAGICK = yes; then - AC_DEFINE([HAVE_IMAGEMAGICK], 1, [Define to 1 if using ImageMagick.]) + AC_DEFINE([HAVE_IMAGEMAGICK], [1], [Define to 1 if using ImageMagick.]) else if test "${with_imagemagick}" != "no"; then AC_MSG_ERROR([ImageMagick wanted, but it does not compile. Maybe some library files are missing?]); @@ -2847,12 +2870,12 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_NS}" = "yes" || test "${HAVE_W32}" fi fi -AC_CHECK_LIB(anl, getaddrinfo_a, HAVE_GETADDRINFO_A=yes) +AC_CHECK_LIB([anl], [getaddrinfo_a], [HAVE_GETADDRINFO_A=yes]) if test "${HAVE_GETADDRINFO_A}" = "yes"; then - AC_DEFINE(HAVE_GETADDRINFO_A, 1, + AC_DEFINE([HAVE_GETADDRINFO_A], [1], [Define to 1 if you have getaddrinfo_a for asynchronous DNS resolution.]) GETADDRINFO_A_LIBS="-lanl" - AC_SUBST(GETADDRINFO_A_LIBS) + AC_SUBST([GETADDRINFO_A_LIBS]) fi HAVE_GTK=no @@ -2874,10 +2897,10 @@ if test "${opsys}" != "mingw32"; then EMACS_CHECK_MODULES([GTK], [$GTK_MODULES], [pkg_check_gtk=yes], [pkg_check_gtk=no]) if test "$pkg_check_gtk" = "no" && test "$with_gtk3" = "yes"; then - AC_MSG_ERROR($GTK_PKG_ERRORS) + AC_MSG_ERROR([$GTK_PKG_ERRORS]) fi if test "$pkg_check_gtk" = "yes"; then - AC_DEFINE(HAVE_GTK3, 1, [Define to 1 if using GTK 3 or later.]) + AC_DEFINE([HAVE_GTK3], [1], [Define to 1 if using GTK 3 or later.]) GTK_OBJ=emacsgtkfixed.o gtk_term_header=gtkutil.h USE_GTK_TOOLKIT="GTK3" @@ -2904,7 +2927,7 @@ if test "${opsys}" != "mingw32"; then if test "$pkg_check_gtk" = "no" && { test "$with_gtk" = yes || test "$with_gtk2" = "yes"; } then - AC_MSG_ERROR($gtk3_pkg_errors$GTK_PKG_ERRORS) + AC_MSG_ERROR([$gtk3_pkg_errors$GTK_PKG_ERRORS]) fi test "$pkg_check_gtk" = "yes" && USE_GTK_TOOLKIT="GTK2" fi @@ -2915,7 +2938,7 @@ OLD_LIBS=$LIBS if test x"$pkg_check_gtk" = xyes; then - AC_SUBST(GTK_LIBS) + AC_SUBST([GTK_LIBS]) CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$GTK_LIBS $LIBS" dnl Try to compile a simple GTK program. @@ -2947,7 +2970,7 @@ if test x"$pkg_check_gtk" = xyes; then else C_SWITCH_X_SITE="$C_SWITCH_X_SITE $GTK_CFLAGS" HAVE_GTK=yes - AC_DEFINE(USE_GTK, 1, [Define to 1 if using GTK.]) + AC_DEFINE([USE_GTK], [1], [Define to 1 if using GTK.]) GTK_OBJ="gtkutil.o $GTK_OBJ" term_header=$gtk_term_header USE_X_TOOLKIT=none @@ -2959,7 +2982,7 @@ if test x"$pkg_check_gtk" = xyes; then fi fi -AC_SUBST(GTK_OBJ) +AC_SUBST([GTK_OBJ]) if test "${HAVE_GTK}" = "yes"; then @@ -2979,15 +3002,17 @@ if test "${HAVE_GTK}" = "yes"; then dnl but not declared if deprecated featured has been selected out. dnl AC_CHECK_DECL checks for a macro, so check for GTK_TYPE_FILE_SELECTION. HAVE_GTK_FILE_SELECTION=no - AC_CHECK_DECL(GTK_TYPE_FILE_SELECTION, HAVE_GTK_FILE_SELECTION=yes, - HAVE_GTK_FILE_SELECTION=no, [AC_INCLUDES_DEFAULT + AC_CHECK_DECL([GTK_TYPE_FILE_SELECTION], + [HAVE_GTK_FILE_SELECTION=yes], + [HAVE_GTK_FILE_SELECTION=no], + [AC_INCLUDES_DEFAULT #include ]) if test "$HAVE_GTK_FILE_SELECTION" = yes; then - AC_CHECK_FUNCS(gtk_file_selection_new) + AC_CHECK_FUNCS([gtk_file_selection_new]) fi dnl This procedure causes a bug on certain Ubuntu GTK+2 builds - AC_CHECK_FUNCS(gtk_window_set_has_resize_grip) + AC_CHECK_FUNCS([gtk_window_set_has_resize_grip]) fi fi @@ -3000,10 +3025,10 @@ if test "$window_system" = "pgtk"; then PGTK_OBJ="pgtkfns.o pgtkterm.o pgtkselect.o pgtkmenu.o pgtkim.o xsettings.o" PGTK_LIBS="$GTK_LIBS" fi -AC_SUBST(PGTK_OBJ) -AC_SUBST(PGTK_LIBS) +AC_SUBST([PGTK_OBJ]) +AC_SUBST([PGTK_LIBS]) -AC_CHECK_FUNCS(malloc_trim) +AC_CHECK_FUNCS([malloc_trim]) dnl D-Bus has been tested under GNU/Linux only. Must be adapted for dnl other platforms. @@ -3012,25 +3037,25 @@ DBUS_OBJ= if test "${with_dbus}" = "yes"; then EMACS_CHECK_MODULES([DBUS], [dbus-1 >= 1.0]) if test "$HAVE_DBUS" = yes; then - AC_DEFINE(HAVE_DBUS, 1, [Define to 1 if using D-Bus.]) + AC_DEFINE([HAVE_DBUS], [1], [Define to 1 if using D-Bus.]) dnl dbus_watch_get_unix_fd has been introduced in D-Bus 1.1.1. dnl dbus_type_is_valid and dbus_validate_* have been introduced in dnl D-Bus 1.5.12. OLD_LIBS=$LIBS LIBS="$LIBS $DBUS_LIBS" - AC_CHECK_FUNCS(dbus_watch_get_unix_fd \ + AC_CHECK_FUNCS([dbus_watch_get_unix_fd \ dbus_type_is_valid \ dbus_validate_bus_name \ dbus_validate_path \ dbus_validate_interface \ - dbus_validate_member) + dbus_validate_member]) LIBS=$OLD_LIBS DBUS_OBJ=dbusbind.o fi fi -AC_SUBST(DBUS_CFLAGS) -AC_SUBST(DBUS_LIBS) -AC_SUBST(DBUS_OBJ) +AC_SUBST([DBUS_CFLAGS]) +AC_SUBST([DBUS_LIBS]) +AC_SUBST([DBUS_OBJ]) dnl GSettings has been tested under GNU/Linux only. HAVE_GSETTINGS=no @@ -3055,7 +3080,7 @@ if test "${HAVE_X11}" = "yes" -o "${window_system}" = "pgtk" && test "${with_gse [emacs_cv_gsettings_in_gio=yes], [emacs_cv_gsettings_in_gio=no])]) if test "$emacs_cv_gsettings_in_gio" = "yes"; then - AC_DEFINE(HAVE_GSETTINGS, 1, [Define to 1 if using GSettings.]) + AC_DEFINE([HAVE_GSETTINGS], [1], [Define to 1 if using GSettings.]) SETTINGS_CFLAGS="$GSETTINGS_CFLAGS" SETTINGS_LIBS="$GSETTINGS_LIBS" test "$with_gconf" = "yes" || with_gconf=no @@ -3064,7 +3089,7 @@ if test "${HAVE_X11}" = "yes" -o "${window_system}" = "pgtk" && test "${with_gse LIBS=$old_LIBS fi fi -AC_SUBST(HAVE_GSETTINGS) +AC_SUBST([HAVE_GSETTINGS]) dnl GConf has been tested under GNU/Linux only. dnl The version is really arbitrary, it is about the same age as Gtk+ 2.6. @@ -3072,7 +3097,7 @@ HAVE_GCONF=no if test "${HAVE_X11}" = "yes" -o "${window_system}" = "pgtk" && test "${with_gconf}" != "no"; then EMACS_CHECK_MODULES([GCONF], [gconf-2.0 >= 2.13]) if test "$HAVE_GCONF" = yes; then - AC_DEFINE(HAVE_GCONF, 1, [Define to 1 if using GConf.]) + AC_DEFINE([HAVE_GCONF], [1], [Define to 1 if using GConf.]) dnl Newer GConf doesn't link with g_objects, so this is not defined. SETTINGS_CFLAGS="$SETTINGS_CFLAGS $GCONF_CFLAGS" SETTINGS_LIBS="$SETTINGS_LIBS $GCONF_LIBS" @@ -3092,33 +3117,35 @@ if test "$HAVE_GSETTINGS" = "yes" || test "$HAVE_GCONF" = "yes"; then CFLAGS="$SAVE_CFLAGS" LIBS="$SAVE_LIBS" fi -AC_SUBST(SETTINGS_CFLAGS) -AC_SUBST(SETTINGS_LIBS) +AC_SUBST([SETTINGS_CFLAGS]) +AC_SUBST([SETTINGS_LIBS]) USE_STARTUP_NOTIFICATION=no if test "${HAVE_GTK}" = "yes"; then USE_STARTUP_NOTIFICATION=yes fi -AC_SUBST(USE_STARTUP_NOTIFICATION) +AC_SUBST([USE_STARTUP_NOTIFICATION]) dnl SELinux is available for GNU/Linux only. HAVE_LIBSELINUX=no LIBSELINUX_LIBS= if test "${with_selinux}" = "yes"; then - AC_CHECK_LIB([selinux], [lgetfilecon], HAVE_LIBSELINUX=yes, HAVE_LIBSELINUX=no) + AC_CHECK_LIB([selinux], [lgetfilecon], + [HAVE_LIBSELINUX=yes], + [HAVE_LIBSELINUX=no]) if test "$HAVE_LIBSELINUX" = yes; then - AC_DEFINE(HAVE_LIBSELINUX, 1, [Define to 1 if using SELinux.]) + AC_DEFINE([HAVE_LIBSELINUX], [1], [Define to 1 if using SELinux.]) LIBSELINUX_LIBS=-lselinux fi fi -AC_SUBST(LIBSELINUX_LIBS) +AC_SUBST([LIBSELINUX_LIBS]) HAVE_GNUTLS=no if test "${with_gnutls}" != "no" ; then EMACS_CHECK_MODULES([LIBGNUTLS], [gnutls >= 2.12.2], [HAVE_GNUTLS=yes], [HAVE_GNUTLS=no]) if test "${HAVE_GNUTLS}" = "yes"; then - AC_DEFINE(HAVE_GNUTLS, 1, [Define if using GnuTLS.]) + AC_DEFINE([HAVE_GNUTLS], [1], [Define if using GnuTLS.]) fi # Windows loads GnuTLS dynamically @@ -3127,8 +3154,8 @@ if test "${with_gnutls}" != "no" ; then fi fi -AC_SUBST(LIBGNUTLS_LIBS) -AC_SUBST(LIBGNUTLS_CFLAGS) +AC_SUBST([LIBGNUTLS_LIBS]) +AC_SUBST([LIBGNUTLS_CFLAGS]) HAVE_LIBSYSTEMD=no if test "${with_libsystemd}" = "yes" ; then @@ -3138,12 +3165,12 @@ if test "${with_libsystemd}" = "yes" ; then EMACS_CHECK_MODULES([LIBSYSTEMD], [libsystemd >= 222], [HAVE_LIBSYSTEMD=yes], [HAVE_LIBSYSTEMD=no]) if test "${HAVE_LIBSYSTEMD}" = "yes"; then - AC_DEFINE(HAVE_LIBSYSTEMD, 1, [Define if using libsystemd.]) + AC_DEFINE([HAVE_LIBSYSTEMD], [1], [Define if using libsystemd.]) fi fi -AC_SUBST(LIBSYSTEMD_LIBS) -AC_SUBST(LIBSYSTEMD_CFLAGS) +AC_SUBST([LIBSYSTEMD_LIBS]) +AC_SUBST([LIBSYSTEMD_CFLAGS]) HAVE_JSON=no JSON_OBJ= @@ -3152,7 +3179,7 @@ if test "${with_json}" != no; then EMACS_CHECK_MODULES([JSON], [jansson >= 2.7], [HAVE_JSON=yes], [HAVE_JSON=no]) if test "${HAVE_JSON}" = yes; then - AC_DEFINE(HAVE_JSON, 1, [Define if using Jansson.]) + AC_DEFINE([HAVE_JSON], [1], [Define if using Jansson.]) JSON_OBJ=json.o fi @@ -3162,9 +3189,9 @@ if test "${with_json}" != no; then fi fi -AC_SUBST(JSON_LIBS) -AC_SUBST(JSON_CFLAGS) -AC_SUBST(JSON_OBJ) +AC_SUBST([JSON_LIBS]) +AC_SUBST([JSON_CFLAGS]) +AC_SUBST([JSON_OBJ]) NOTIFY_OBJ= NOTIFY_SUMMARY=no @@ -3177,9 +3204,9 @@ case $with_file_notification,$opsys in Consider using gfile instead.]) ;; w32,* | yes,mingw32) - AC_CHECK_HEADER(windows.h) + AC_CHECK_HEADER([windows.h]) if test "$ac_cv_header_windows_h" = yes ; then - AC_DEFINE(HAVE_W32NOTIFY, 1, [Define to 1 to use w32notify.]) + AC_DEFINE([HAVE_W32NOTIFY], [1], [Define to 1 to use w32notify.]) NOTIFY_OBJ=w32notify.o NOTIFY_SUMMARY="yes (w32)" fi ;; @@ -3188,11 +3215,11 @@ esac dnl inotify is available only on GNU/Linux. case $with_file_notification,$NOTIFY_OBJ in inotify, | yes,) - AC_CHECK_HEADER(sys/inotify.h) + AC_CHECK_HEADER([sys/inotify.h]) if test "$ac_cv_header_sys_inotify_h" = yes ; then - AC_CHECK_FUNC(inotify_init1) + AC_CHECK_FUNC([inotify_init1]) if test "$ac_cv_func_inotify_init1" = yes; then - AC_DEFINE(HAVE_INOTIFY, 1, [Define to 1 to use inotify.]) + AC_DEFINE([HAVE_INOTIFY], [1], [Define to 1 to use inotify.]) NOTIFY_OBJ=inotify.o NOTIFY_SUMMARY="yes -lglibc (inotify)" fi @@ -3204,16 +3231,16 @@ case $with_file_notification,$NOTIFY_OBJ in kqueue,* | yes,) EMACS_CHECK_MODULES([KQUEUE], [libkqueue]) if test "$HAVE_KQUEUE" = "yes"; then - AC_DEFINE(HAVE_KQUEUE, 1, [Define to 1 to use kqueue.]) + AC_DEFINE([HAVE_KQUEUE], [1], [Define to 1 to use kqueue.]) CPPFLAGS="$CPPFLAGS -I/usr/include/kqueue" NOTIFY_CFLAGS=$KQUEUE_CFLAGS NOTIFY_LIBS=$KQUEUE_LIBS NOTIFY_OBJ=kqueue.o NOTIFY_SUMMARY="yes -lkqueue" else - AC_SEARCH_LIBS(kqueue, []) + AC_SEARCH_LIBS([kqueue], []) if test "$ac_cv_search_kqueue" != no; then - AC_DEFINE(HAVE_KQUEUE, 1, [Define to 1 to use kqueue.]) + AC_DEFINE([HAVE_KQUEUE], [1], [Define to 1 to use kqueue.]) NOTIFY_OBJ=kqueue.o NOTIFY_SUMMARY="yes (kqueue)" fi @@ -3231,7 +3258,7 @@ Consider kqueue instead.]) else EMACS_CHECK_MODULES([GFILENOTIFY], [gio-2.0 >= 2.24]) if test "$HAVE_GFILENOTIFY" = "yes"; then - AC_DEFINE(HAVE_GFILENOTIFY, 1, [Define to 1 if using GFile.]) + AC_DEFINE([HAVE_GFILENOTIFY], [1], [Define to 1 if using GFile.]) NOTIFY_CFLAGS=$GFILENOTIFY_CFLAGS NOTIFY_LIBS=$GFILENOTIFY_LIBS NOTIFY_OBJ=gfilenotify.o @@ -3246,11 +3273,12 @@ case $with_file_notification,$NOTIFY_OBJ in esac if test -n "$NOTIFY_OBJ"; then - AC_DEFINE(USE_FILE_NOTIFY, 1, [Define to 1 if using file notifications.]) + AC_DEFINE([USE_FILE_NOTIFY], [1], + [Define to 1 if using file notifications.]) fi -AC_SUBST(NOTIFY_CFLAGS) -AC_SUBST(NOTIFY_LIBS) -AC_SUBST(NOTIFY_OBJ) +AC_SUBST([NOTIFY_CFLAGS]) +AC_SUBST([NOTIFY_LIBS]) +AC_SUBST([NOTIFY_OBJ]) dnl Do not put whitespace before the #include statements below. dnl Older compilers (eg sunos4 cc) choke on it. @@ -3258,36 +3286,37 @@ HAVE_XAW3D=no LUCID_LIBW= if test x"${USE_X_TOOLKIT}" = xmaybe || test x"${USE_X_TOOLKIT}" = xLUCID; then if test "$with_xaw3d" != no; then - AC_CACHE_VAL(emacs_cv_xaw3d, + AC_CACHE_VAL([emacs_cv_xaw3d], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include ]], [[]])], - [AC_CHECK_LIB(Xaw3d, XawScrollbarSetThumb, - emacs_cv_xaw3d=yes, emacs_cv_xaw3d=no)], - emacs_cv_xaw3d=no)]) + [AC_CHECK_LIB([Xaw3d], [XawScrollbarSetThumb], + [emacs_cv_xaw3d=yes], + [emacs_cv_xaw3d=no])], + [emacs_cv_xaw3d=no])]) else emacs_cv_xaw3d=no fi if test $emacs_cv_xaw3d = yes; then - AC_MSG_CHECKING(for xaw3d) + AC_MSG_CHECKING([for xaw3d]) AC_MSG_RESULT([yes; using Lucid toolkit]) USE_X_TOOLKIT=LUCID HAVE_XAW3D=yes LUCID_LIBW=-lXaw3d - AC_DEFINE(HAVE_XAW3D, 1, + AC_DEFINE([HAVE_XAW3D], [1], [Define to 1 if you have the Xaw3d library (-lXaw3d).]) else - AC_MSG_CHECKING(for xaw3d) - AC_MSG_RESULT(no) - AC_MSG_CHECKING(for libXaw) - AC_CACHE_VAL(emacs_cv_xaw, + AC_MSG_CHECKING([for xaw3d]) + AC_MSG_RESULT([no]) + AC_MSG_CHECKING([for libXaw]) + AC_CACHE_VAL([emacs_cv_xaw], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[ #include #include ]], [[]])], - emacs_cv_xaw=yes, - emacs_cv_xaw=no)]) + [emacs_cv_xaw=yes], + [emacs_cv_xaw=no])]) if test $emacs_cv_xaw = yes; then AC_MSG_RESULT([yes; using Lucid toolkit]) USE_X_TOOLKIT=LUCID @@ -3309,17 +3338,18 @@ X_TOOLKIT_TYPE=$USE_X_TOOLKIT LIBXTR6= LIBXMU= if test "${USE_X_TOOLKIT}" != "none"; then - AC_MSG_CHECKING(X11 toolkit version) - AC_CACHE_VAL(emacs_cv_x11_toolkit_version_6, + AC_MSG_CHECKING([X11 toolkit version]) + AC_CACHE_VAL([emacs_cv_x11_toolkit_version_6], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[#if XtSpecificationRelease < 6 fail; #endif -]])], emacs_cv_x11_toolkit_version_6=yes, emacs_cv_x11_toolkit_version_6=no)]) +]])], [emacs_cv_x11_toolkit_version_6=yes], + [emacs_cv_x11_toolkit_version_6=no])]) HAVE_X11XTR6=$emacs_cv_x11_toolkit_version_6 if test $emacs_cv_x11_toolkit_version_6 = yes; then - AC_MSG_RESULT(6 or newer) - AC_DEFINE(HAVE_X11XTR6, 1, + AC_MSG_RESULT([6 or newer]) + AC_DEFINE([HAVE_X11XTR6], [1], [Define to 1 if you have the X11R6 or newer version of Xt.]) LIBXTR6="-lSM -lICE" case "$opsys" in @@ -3327,7 +3357,7 @@ fail; unixware) LIBXTR6="$LIBXTR6 -lw" ;; esac else - AC_MSG_RESULT(before 6) + AC_MSG_RESULT([before 6]) fi dnl If using toolkit, check whether libXmu.a exists. @@ -3345,8 +3375,8 @@ dnl tranle@intellicorp.com says libXmu.a can need XtMalloc in libXt.a to link. LIBS=$OLDLIBS dnl ac_cv_search_XmuConvertStandardSelection is also referenced below. fi -AC_SUBST(LIBXTR6) -AC_SUBST(LIBXMU) +AC_SUBST([LIBXTR6]) +AC_SUBST([LIBXMU]) LIBXP= if test "${USE_X_TOOLKIT}" = "MOTIF"; then @@ -3364,16 +3394,17 @@ if test "${USE_X_TOOLKIT}" = "MOTIF"; then else emacs_cv_openmotif=no fi - AC_CACHE_CHECK(for (Open)Motif version 2.1, emacs_cv_motif_version_2_1, + AC_CACHE_CHECK([for (Open)Motif version 2.1], [emacs_cv_motif_version_2_1], [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[#if XmVERSION > 2 || (XmVERSION == 2 && XmREVISION >= 1) int x = 5; #else Motif version prior to 2.1. #endif]])], - emacs_cv_motif_version_2_1=yes, emacs_cv_motif_version_2_1=no)]) + [emacs_cv_motif_version_2_1=yes], + [emacs_cv_motif_version_2_1=no])]) if test $emacs_cv_motif_version_2_1 = yes; then - AC_CHECK_LIB(Xp, XpCreateContext, LIBXP=-lXp) + AC_CHECK_LIB([Xp], [XpCreateContext], [LIBXP=-lXp]) if test x$emacs_cv_openmotif = xyes; then REAL_CPPFLAGS="-I/usr/include/openmotif $REAL_CPPFLAGS" fi @@ -3385,10 +3416,14 @@ Motif version prior to 2.1. OLD_CFLAGS=$CFLAGS CPPFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CPPFLAGS" CFLAGS="-I/usr/X11R6/LessTif/Motif1.2/include $CFLAGS" - AC_CACHE_CHECK(for LessTif where some systems put it, emacs_cv_lesstif, - [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[int x = 5;]])], - emacs_cv_lesstif=yes, emacs_cv_lesstif=no)]) + AC_CACHE_CHECK([for LessTif where some systems put it], [emacs_cv_lesstif], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM( + [[#include + ]], + [[int x = 5;]])], + [emacs_cv_lesstif=yes], + [emacs_cv_lesstif=no])]) if test $emacs_cv_lesstif = yes; then # Make sure this -I option remains in CPPFLAGS after it is set # back to REAL_CPPFLAGS. @@ -3410,34 +3445,34 @@ dnl Use toolkit scroll bars if configured for GTK or X toolkit and either dnl using Motif or Xaw3d is available, and unless dnl --with-toolkit-scroll-bars=no was specified. -AH_TEMPLATE(USE_TOOLKIT_SCROLL_BARS, +AH_TEMPLATE([USE_TOOLKIT_SCROLL_BARS], [Define to 1 if we should use toolkit scroll bars.])dnl USE_TOOLKIT_SCROLL_BARS=no if test "${with_toolkit_scroll_bars}" != "no"; then if test "${USE_X_TOOLKIT}" != "none"; then if test "${USE_X_TOOLKIT}" = "MOTIF"; then - AC_DEFINE(USE_TOOLKIT_SCROLL_BARS) + AC_DEFINE([USE_TOOLKIT_SCROLL_BARS]) HAVE_XAW3D=no USE_TOOLKIT_SCROLL_BARS=yes elif test "${HAVE_XAW3D}" = "yes" || test "${USE_X_TOOLKIT}" = "LUCID"; then - AC_DEFINE(USE_TOOLKIT_SCROLL_BARS) + AC_DEFINE([USE_TOOLKIT_SCROLL_BARS]) USE_TOOLKIT_SCROLL_BARS=yes fi elif test "${HAVE_GTK}" = "yes"; then - AC_DEFINE(USE_TOOLKIT_SCROLL_BARS) + AC_DEFINE([USE_TOOLKIT_SCROLL_BARS]) USE_TOOLKIT_SCROLL_BARS=yes elif test "${HAVE_NS}" = "yes"; then - AC_DEFINE(USE_TOOLKIT_SCROLL_BARS) + AC_DEFINE([USE_TOOLKIT_SCROLL_BARS]) USE_TOOLKIT_SCROLL_BARS=yes elif test "${HAVE_W32}" = "yes"; then - AC_DEFINE(USE_TOOLKIT_SCROLL_BARS) + AC_DEFINE([USE_TOOLKIT_SCROLL_BARS]) USE_TOOLKIT_SCROLL_BARS=yes elif test "${HAVE_BE_APP}" = "yes"; then - AC_DEFINE(USE_TOOLKIT_SCROLL_BARS) + AC_DEFINE([USE_TOOLKIT_SCROLL_BARS]) USE_TOOLKIT_SCROLL_BARS=yes fi elif test "${window_system}" != "x11" && test "${window_system}" != "none"; then - AC_MSG_ERROR(Non-toolkit scroll bars are not implemented for your system) + AC_MSG_ERROR([Non-toolkit scroll bars are not implemented for your system]) fi dnl See if XIM is available. @@ -3446,14 +3481,14 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ #include ]], [[XIMProc callback;]])], [HAVE_XIM=yes - AC_DEFINE(HAVE_XIM, 1, [Define to 1 if XIM is available])], - HAVE_XIM=no) + AC_DEFINE([HAVE_XIM], [1], [Define to 1 if XIM is available])], + [HAVE_XIM=no]) dnl Note this is non-standard. --with-xim does not control whether dnl XIM support is compiled in, it only affects the runtime default of dnl use_xim in xterm.c. if test "${with_xim}" != "no"; then - AC_DEFINE(USE_XIM, 1, + AC_DEFINE([USE_XIM], [1], [Define to 1 to default runtime use of XIM to on.]) fi @@ -3469,8 +3504,8 @@ if test "${HAVE_X11}" = "yes"; then [AC_CHECK_LIB([Xrender], [XRenderQueryExtension], [HAVE_XRENDER=yes])]) if test $HAVE_XRENDER = yes; then XRENDER_LIBS="-lXrender" - AC_SUBST(XRENDER_LIBS) - AC_DEFINE([HAVE_XRENDER], 1, [Define to 1 if XRender is available.]) + AC_SUBST([XRENDER_LIBS]) + AC_DEFINE([HAVE_XRENDER], [1], [Define to 1 if XRender is available.]) fi fi @@ -3479,20 +3514,21 @@ if test "${HAVE_X11}" = "yes"; then if test "${with_cairo}" != "no"; then CAIRO_REQUIRED=1.8.0 CAIRO_MODULE="cairo >= $CAIRO_REQUIRED" - EMACS_CHECK_MODULES(CAIRO, $CAIRO_MODULE) + EMACS_CHECK_MODULES([CAIRO], [$CAIRO_MODULE]) if test $HAVE_CAIRO = yes; then CAIRO_XCB_MODULE="cairo-xcb >= $CAIRO_REQUIRED" - EMACS_CHECK_MODULES(CAIRO_XCB, $CAIRO_XCB_MODULE) + EMACS_CHECK_MODULES([CAIRO_XCB], [$CAIRO_XCB_MODULE]) if test $HAVE_CAIRO_XCB = yes; then CAIRO_CFLAGS="$CAIRO_CFLAGS $CAIRO_XCB_CFLAGS" CAIRO_LIBS="$CAIRO_LIBS $CAIRO_XCB_LIBS" - AC_DEFINE(USE_CAIRO_XCB, 1, [Define to 1 if cairo XCB surfaces are available.]) + AC_DEFINE([USE_CAIRO_XCB], [1], + [Define to 1 if cairo XCB surfaces are available.]) fi - AC_DEFINE(USE_CAIRO, 1, [Define to 1 if using cairo.]) + AC_DEFINE([USE_CAIRO], [1], [Define to 1 if using cairo.]) CFLAGS="$CFLAGS $CAIRO_CFLAGS" LIBS="$LIBS $CAIRO_LIBS" - AC_SUBST(CAIRO_CFLAGS) - AC_SUBST(CAIRO_LIBS) + AC_SUBST([CAIRO_CFLAGS]) + AC_SUBST([CAIRO_LIBS]) else AC_MSG_WARN([cairo requested but not found.]) fi @@ -3512,12 +3548,12 @@ if test "$with_xwidgets" != "no"; then XWIDGETS_OBJ="xwidget.o" if test "$HAVE_X_WINDOWS" = "yes" && test "${with_cairo}" = "no"; then CAIRO_XLIB_MODULES="cairo >= 1.8.0 cairo-xlib >= 1.8.0" - EMACS_CHECK_MODULES(CAIRO_XLIB, $CAIRO_XLIB_MODULES) + EMACS_CHECK_MODULES([CAIRO_XLIB], [$CAIRO_XLIB_MODULES]) if test $HAVE_CAIRO_XLIB = "yes"; then CAIRO_CFLAGS="$CAIRO_XLIB_CFLAGS" CAIRO_LIBS="$CAIRO_XLIB_LIBS" - AC_SUBST(CAIRO_CFLAGS) - AC_SUBST(CAIRO_LIBS) + AC_SUBST([CAIRO_CFLAGS]) + AC_SUBST([CAIRO_LIBS]) else AC_MSG_ERROR([xwidgets requested, but a suitable cairo installation wasn't found]) fi @@ -3532,7 +3568,7 @@ if test "$with_xwidgets" != "no"; then XWIDGETS_OBJ="xwidget.o" NS_OBJC_OBJ="$NS_OBJC_OBJ nsxwidget.o" dnl Update NS_OBJC_OBJ with added nsxwidget.o - AC_SUBST(NS_OBJC_OBJ) + AC_SUBST([NS_OBJC_OBJ]) else AC_MSG_ERROR([xwidgets requested, it requires GTK3 as X window toolkit or macOS Cocoa as window system.]) fi @@ -3540,37 +3576,37 @@ if test "$with_xwidgets" != "no"; then test $HAVE_XWIDGETS = yes || AC_MSG_ERROR([xwidgets requested but WebKitGTK+ or WebKit framework not found.]) - AC_DEFINE([HAVE_XWIDGETS], 1, [Define to 1 if you have xwidgets support.]) + AC_DEFINE([HAVE_XWIDGETS], [1], [Define to 1 if you have xwidgets support.]) fi -AC_SUBST(XWIDGETS_OBJ) +AC_SUBST([XWIDGETS_OBJ]) if test "$window_system" = "pgtk"; then CAIRO_REQUIRED=1.12.0 CAIRO_MODULE="cairo >= $CAIRO_REQUIRED" - EMACS_CHECK_MODULES(CAIRO, $CAIRO_MODULE) + EMACS_CHECK_MODULES([CAIRO], [$CAIRO_MODULE]) if test $HAVE_CAIRO = yes; then - AC_DEFINE(USE_CAIRO, 1, [Define to 1 if using cairo.]) + AC_DEFINE([USE_CAIRO], [1], [Define to 1 if using cairo.]) else AC_MSG_ERROR([cairo required but not found.]) fi CFLAGS="$CFLAGS $CAIRO_CFLAGS" LIBS="$LIBS $CAIRO_LIBS" - AC_SUBST(CAIRO_CFLAGS) - AC_SUBST(CAIRO_LIBS) + AC_SUBST([CAIRO_CFLAGS]) + AC_SUBST([CAIRO_LIBS]) fi if test "${HAVE_BE_APP}" = "yes"; then if test "${with_be_cairo}" != "no"; then CAIRO_REQUIRED=1.8.0 CAIRO_MODULE="cairo >= $CAIRO_REQUIRED" - EMACS_CHECK_MODULES(CAIRO, $CAIRO_MODULE) + EMACS_CHECK_MODULES([CAIRO], [$CAIRO_MODULE]) if test $HAVE_CAIRO = yes; then - AC_DEFINE(USE_BE_CAIRO, 1, [Define to 1 if using cairo on Haiku.]) + AC_DEFINE([USE_BE_CAIRO], [1], [Define to 1 if using cairo on Haiku.]) CFLAGS="$CFLAGS $CAIRO_CFLAGS" LIBS="$LIBS $CAIRO_LIBS" - AC_SUBST(CAIRO_CFLAGS) - AC_SUBST(CAIRO_LIBS) + AC_SUBST([CAIRO_CFLAGS]) + AC_SUBST([CAIRO_LIBS]) else AC_MSG_WARN([cairo requested but not found.]) fi @@ -3590,11 +3626,12 @@ if test "${HAVE_X11}" = "yes"; then dnl The following is needed to set FREETYPE_LIBS. EMACS_CHECK_MODULES([FREETYPE], [freetype2]) - test "$HAVE_FREETYPE" = "no" && AC_MSG_ERROR(cairo requires libfreetype) + test "$HAVE_FREETYPE" = "no" && AC_MSG_ERROR([cairo requires libfreetype]) EMACS_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0]) - test "$HAVE_FONTCONFIG" = "no" && AC_MSG_ERROR(cairo requires libfontconfig) + test "$HAVE_FONTCONFIG" = "no" && + AC_MSG_ERROR([cairo requires libfontconfig]) dnl For the "Does Emacs use" message at the end. HAVE_XFT=no else @@ -3621,13 +3658,15 @@ if test "${HAVE_X11}" = "yes"; then CPPFLAGS="$CPPFLAGS $XFT_CFLAGS" CFLAGS="$CFLAGS $XFT_CFLAGS" LIBS="$XFT_LIBS $LIBS" - AC_CHECK_HEADER(X11/Xft/Xft.h, - [AC_CHECK_LIB(Xft, XftFontOpen, HAVE_XFT=yes, , $XFT_LIBS)] , , + AC_CHECK_HEADER([X11/Xft/Xft.h], + [AC_CHECK_LIB([Xft], [XftFontOpen], [HAVE_XFT=yes], + [], [$XFT_LIBS])], + [], [[#include ]]) if test "${HAVE_XFT}" = "yes"; then - AC_DEFINE(HAVE_XFT, 1, [Define to 1 if you have the Xft library.]) - AC_SUBST(XFT_LIBS) + AC_DEFINE([HAVE_XFT], [1], [Define to 1 if you have the Xft library.]) + AC_SUBST([XFT_LIBS]) C_SWITCH_X_SITE="$C_SWITCH_X_SITE $XFT_CFLAGS" fi # "${HAVE_XFT}" = "yes" CPPFLAGS=$OLD_CPPFLAGS @@ -3650,34 +3689,35 @@ if test "${HAVE_X11}" = "yes"; then dnl The following is needed to set FREETYPE_LIBS. EMACS_CHECK_MODULES([FREETYPE], [freetype2]) - test "$HAVE_FREETYPE" = "no" && AC_MSG_ERROR(libxft requires libfreetype) + test "$HAVE_FREETYPE" = "no" && + AC_MSG_ERROR([libxft requires libfreetype]) fi fi # $HAVE_CAIRO != yes HAVE_LIBOTF=no if test "${HAVE_FREETYPE}" = "yes"; then - AC_DEFINE(HAVE_FREETYPE, 1, + AC_DEFINE([HAVE_FREETYPE], [1], [Define to 1 if using the freetype and fontconfig libraries.]) OLD_CFLAGS=$CFLAGS OLD_LIBS=$LIBS CFLAGS="$CFLAGS $FREETYPE_CFLAGS" LIBS="$FREETYPE_LIBS $LIBS" - AC_CHECK_FUNCS(FT_Face_GetCharVariantIndex) + AC_CHECK_FUNCS([FT_Face_GetCharVariantIndex]) CFLAGS=$OLD_CFLAGS LIBS=$OLD_LIBS if test "${with_libotf}" != "no"; then EMACS_CHECK_MODULES([LIBOTF], [libotf]) if test "$HAVE_LIBOTF" = "yes"; then - AC_DEFINE(HAVE_LIBOTF, 1, [Define to 1 if using libotf.]) - AC_CHECK_LIB(otf, OTF_get_variation_glyphs, - HAVE_OTF_GET_VARIATION_GLYPHS=yes, - HAVE_OTF_GET_VARIATION_GLYPHS=no) + AC_DEFINE([HAVE_LIBOTF], [1], [Define to 1 if using libotf.]) + AC_CHECK_LIB([otf], [OTF_get_variation_glyphs], + [HAVE_OTF_GET_VARIATION_GLYPHS=yes], + [HAVE_OTF_GET_VARIATION_GLYPHS=no]) if test "${HAVE_OTF_GET_VARIATION_GLYPHS}" = "yes"; then - AC_DEFINE(HAVE_OTF_GET_VARIATION_GLYPHS, 1, + AC_DEFINE([HAVE_OTF_GET_VARIATION_GLYPHS], [1], [Define to 1 if libotf has OTF_get_variation_glyphs.]) fi if ! $PKG_CONFIG --atleast-version=0.9.16 libotf; then - AC_DEFINE(HAVE_OTF_KANNADA_BUG, 1, + AC_DEFINE([HAVE_OTF_KANNADA_BUG], [1], [Define to 1 if libotf is affected by https://debbugs.gnu.org/28110.]) fi fi @@ -3691,7 +3731,7 @@ if test "${HAVE_X11}" = "yes"; then if test "${with_m17n_flt}" != "no"; then EMACS_CHECK_MODULES([M17N_FLT], [m17n-flt]) if test "$HAVE_M17N_FLT" = "yes"; then - AC_DEFINE(HAVE_M17N_FLT, 1, [Define to 1 if using libm17n-flt.]) + AC_DEFINE([HAVE_M17N_FLT], [1], [Define to 1 if using libm17n-flt.]) fi fi fi @@ -3700,20 +3740,20 @@ else # "${HAVE_X11}" != "yes" EMACS_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0]) EMACS_CHECK_MODULES([FREETYPE], [freetype2]) if test "$HAVE_FONTCONFIG" != yes -o "$HAVE_FREETYPE" != yes; then - AC_MSG_ERROR(fontconfig and freetype is required.) + AC_MSG_ERROR([fontconfig and freetype is required.]) fi HAVE_LIBOTF=no - AC_DEFINE(HAVE_FREETYPE, 1, + AC_DEFINE([HAVE_FREETYPE], [1], [Define to 1 if using the freetype and fontconfig libraries.]) if test "${with_libotf}" != "no"; then EMACS_CHECK_MODULES([LIBOTF], [libotf]) if test "$HAVE_LIBOTF" = "yes"; then - AC_DEFINE(HAVE_LIBOTF, 1, [Define to 1 if using libotf.]) - AC_CHECK_LIB(otf, OTF_get_variation_glyphs, - HAVE_OTF_GET_VARIATION_GLYPHS=yes, - HAVE_OTF_GET_VARIATION_GLYPHS=no) + AC_DEFINE([HAVE_LIBOTF], [1], [Define to 1 if using libotf.]) + AC_CHECK_LIB([otf], [OTF_get_variation_glyphs], + [HAVE_OTF_GET_VARIATION_GLYPHS=yes], + [HAVE_OTF_GET_VARIATION_GLYPHS=no]) if test "${HAVE_OTF_GET_VARIATION_GLYPHS}" = "yes"; then - AC_DEFINE(HAVE_OTF_GET_VARIATION_GLYPHS, 1, + AC_DEFINE([HAVE_OTF_GET_VARIATION_GLYPHS], [1], [Define to 1 if libotf has OTF_get_variation_glyphs.]) fi fi @@ -3740,7 +3780,7 @@ if test "${HAVE_X11}" = "yes" && test "${HAVE_FREETYPE}" = "yes" \ if test "${with_harfbuzz}" != "no"; then EMACS_CHECK_MODULES([HARFBUZZ], [harfbuzz >= $harfbuzz_required_ver]) if test "$HAVE_HARFBUZZ" = "yes"; then - AC_DEFINE(HAVE_HARFBUZZ, 1, [Define to 1 if using HarfBuzz.]) + AC_DEFINE([HAVE_HARFBUZZ], [1], [Define to 1 if using HarfBuzz.]) ### mingw32 and Cygwin-w32 don't use -lharfbuzz, since they load ### the library dynamically. if test "${HAVE_W32}" = "yes"; then @@ -3754,36 +3794,38 @@ fi if test "${HAVE_BE_APP}" = "yes"; then if test $HAVE_CAIRO = "yes"; then EMACS_CHECK_MODULES([FREETYPE], [freetype2 >= 2.5.0]) - test "$HAVE_FREETYPE" = "no" && AC_MSG_ERROR(cairo on Haiku requires libfreetype) + test "$HAVE_FREETYPE" = "no" && + AC_MSG_ERROR([cairo on Haiku requires libfreetype]) EMACS_CHECK_MODULES([FONTCONFIG], [fontconfig >= 2.2.0]) - test "$HAVE_FONTCONFIG" = "no" && AC_MSG_ERROR(cairo on Haiku requires libfontconfig) + test "$HAVE_FONTCONFIG" = "no" && + AC_MSG_ERROR([cairo on Haiku requires libfontconfig]) fi HAVE_LIBOTF=no if test "${HAVE_FREETYPE}" = "yes"; then - AC_DEFINE(HAVE_FREETYPE, 1, + AC_DEFINE([HAVE_FREETYPE], [1], [Define to 1 if using the freetype and fontconfig libraries.]) OLD_CFLAGS=$CFLAGS OLD_LIBS=$LIBS CFLAGS="$CFLAGS $FREETYPE_CFLAGS" LIBS="$FREETYPE_LIBS $LIBS" - AC_CHECK_FUNCS(FT_Face_GetCharVariantIndex) + AC_CHECK_FUNCS([FT_Face_GetCharVariantIndex]) CFLAGS=$OLD_CFLAGS LIBS=$OLD_LIBS if test "${with_libotf}" != "no"; then EMACS_CHECK_MODULES([LIBOTF], [libotf]) if test "$HAVE_LIBOTF" = "yes"; then - AC_DEFINE(HAVE_LIBOTF, 1, [Define to 1 if using libotf.]) - AC_CHECK_LIB(otf, OTF_get_variation_glyphs, - HAVE_OTF_GET_VARIATION_GLYPHS=yes, - HAVE_OTF_GET_VARIATION_GLYPHS=no) + AC_DEFINE([HAVE_LIBOTF], [1], [Define to 1 if using libotf.]) + AC_CHECK_LIB([otf], [OTF_get_variation_glyphs], + [HAVE_OTF_GET_VARIATION_GLYPHS=yes], + [HAVE_OTF_GET_VARIATION_GLYPHS=no]) if test "${HAVE_OTF_GET_VARIATION_GLYPHS}" = "yes"; then - AC_DEFINE(HAVE_OTF_GET_VARIATION_GLYPHS, 1, + AC_DEFINE([HAVE_OTF_GET_VARIATION_GLYPHS], [1], [Define to 1 if libotf has OTF_get_variation_glyphs.]) fi if ! $PKG_CONFIG --atleast-version=0.9.16 libotf; then - AC_DEFINE(HAVE_OTF_KANNADA_BUG, 1, + AC_DEFINE([HAVE_OTF_KANNADA_BUG], [1], [Define to 1 if libotf is affected by https://debbugs.gnu.org/28110.]) fi fi @@ -3797,41 +3839,41 @@ if test "${HAVE_BE_APP}" = "yes" && test "${HAVE_FREETYPE}" = "yes"; then if test "${with_harfbuzz}" != "no"; then EMACS_CHECK_MODULES([HARFBUZZ], [harfbuzz >= $harfbuzz_required_ver]) if test "$HAVE_HARFBUZZ" = "yes"; then - AC_DEFINE(HAVE_HARFBUZZ, 1, [Define to 1 if using HarfBuzz.]) + AC_DEFINE([HAVE_HARFBUZZ], [1], [Define to 1 if using HarfBuzz.]) fi fi fi ### End of font-backend section. -AC_SUBST(FREETYPE_CFLAGS) -AC_SUBST(FREETYPE_LIBS) -AC_SUBST(FONTCONFIG_CFLAGS) -AC_SUBST(FONTCONFIG_LIBS) -AC_SUBST(HARFBUZZ_CFLAGS) -AC_SUBST(HARFBUZZ_LIBS) -AC_SUBST(LIBOTF_CFLAGS) -AC_SUBST(LIBOTF_LIBS) -AC_SUBST(M17N_FLT_CFLAGS) -AC_SUBST(M17N_FLT_LIBS) +AC_SUBST([FREETYPE_CFLAGS]) +AC_SUBST([FREETYPE_LIBS]) +AC_SUBST([FONTCONFIG_CFLAGS]) +AC_SUBST([FONTCONFIG_LIBS]) +AC_SUBST([HARFBUZZ_CFLAGS]) +AC_SUBST([HARFBUZZ_LIBS]) +AC_SUBST([LIBOTF_CFLAGS]) +AC_SUBST([LIBOTF_LIBS]) +AC_SUBST([M17N_FLT_CFLAGS]) +AC_SUBST([M17N_FLT_LIBS]) XCB_LIBS= if test "${HAVE_X11}" = "yes"; then - AC_CHECK_HEADER(X11/Xlib-xcb.h, - [AC_CHECK_LIB(xcb, xcb_translate_coordinates, HAVE_XCB=yes)]) + AC_CHECK_HEADER([X11/Xlib-xcb.h], + [AC_CHECK_LIB([xcb], [xcb_translate_coordinates], [HAVE_XCB=yes])]) if test "${HAVE_XCB}" = "yes"; then - AC_CHECK_LIB(X11-xcb, XGetXCBConnection, HAVE_X11_XCB=yes) + AC_CHECK_LIB([X11-xcb], [XGetXCBConnection], [HAVE_X11_XCB=yes]) if test "${HAVE_X11_XCB}" = "yes"; then - AC_CHECK_LIB(xcb-util, xcb_aux_sync, HAVE_XCB_UTIL=yes) + AC_CHECK_LIB([xcb-util], [xcb_aux_sync], [HAVE_XCB_UTIL=yes]) if test "${HAVE_XCB_UTIL}" = "yes"; then - AC_DEFINE(USE_XCB, 1, + AC_DEFINE([USE_XCB], [1], [Define to 1 if you have the XCB library and X11-XCB library for mixed X11/XCB programming.]) XCB_LIBS="-lX11-xcb -lxcb -lxcb-util" else - AC_CHECK_LIB(xcb-aux, xcb_aux_sync, HAVE_XCB_AUX=yes) + AC_CHECK_LIB([xcb-aux], [xcb_aux_sync], [HAVE_XCB_AUX=yes]) if test "${HAVE_XCB_AUX}" = "yes"; then - AC_DEFINE(USE_XCB, 1, + AC_DEFINE([USE_XCB], [1], [Define to 1 if you have the XCB library and X11-XCB library for mixed X11/XCB programming.]) XCB_LIBS="-lX11-xcb -lxcb -lxcb-aux" @@ -3840,7 +3882,7 @@ if test "${HAVE_X11}" = "yes"; then fi fi fi -AC_SUBST(XCB_LIBS) +AC_SUBST([XCB_LIBS]) ### Use -lXpm if available, unless '--with-xpm=no'. ### mingw32 doesn't use -lXpm, since it loads the library dynamically. @@ -3852,18 +3894,18 @@ if test "${HAVE_W32}" = "yes" && test "${opsys}" = "cygwin"; then if test "${with_xpm}" != "no"; then SAVE_LDFLAGS="$LDFLAGS" LDFLAGS="$LDFLAGS -L/usr/lib/noX" - AC_CHECK_HEADER(noX/xpm.h, - [AC_CHECK_LIB(Xpm, XpmReadFileToImage, HAVE_XPM=yes)]) + AC_CHECK_HEADER([noX/xpm.h], + [AC_CHECK_LIB([Xpm], [XpmReadFileToImage], [HAVE_XPM=yes])]) if test "${HAVE_XPM}" = "yes"; then AC_CACHE_CHECK([for XpmReturnAllocPixels preprocessor define], [emacs_cv_cpp_xpm_return_alloc_pixels], - [AC_EGREP_CPP(no_return_alloc_pixels, + [AC_EGREP_CPP([no_return_alloc_pixels], [#include "noX/xpm.h" #ifndef XpmReturnAllocPixels no_return_alloc_pixels #endif - ], emacs_cv_cpp_xpm_return_alloc_pixels=no, - emacs_cv_cpp_xpm_return_alloc_pixels=yes)]) + ], [emacs_cv_cpp_xpm_return_alloc_pixels=no], + [emacs_cv_cpp_xpm_return_alloc_pixels=yes])]) if test "$emacs_cv_cpp_xpm_return_alloc_pixels" = "no"; then HAVE_XPM=no @@ -3873,7 +3915,8 @@ no_return_alloc_pixels fi if test "${HAVE_XPM}" = "yes"; then - AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm library (-lXpm).]) + AC_DEFINE([HAVE_XPM], [1], + [Define to 1 if you have the Xpm library (-lXpm).]) LIBXPM=-lXpm fi fi @@ -3886,18 +3929,19 @@ if test "${HAVE_X11}" = "yes"; then esac if test "${with_xpm}" != "no"; then - AC_CHECK_HEADER(X11/xpm.h, - [AC_CHECK_LIB(Xpm, XpmReadFileToPixmap, HAVE_XPM=yes, , -lX11)]) + AC_CHECK_HEADER([X11/xpm.h], + [AC_CHECK_LIB([Xpm], [XpmReadFileToPixmap], + [HAVE_XPM=yes], [], [-lX11])]) if test "${HAVE_XPM}" = "yes"; then AC_CACHE_CHECK([for XpmReturnAllocPixels preprocessor define], [emacs_cv_cpp_xpm_return_alloc_pixels], - [AC_EGREP_CPP(no_return_alloc_pixels, + [AC_EGREP_CPP([no_return_alloc_pixels], [#include "X11/xpm.h" #ifndef XpmReturnAllocPixels no_return_alloc_pixels #endif - ], emacs_cv_cpp_xpm_return_alloc_pixels=no, - emacs_cv_cpp_xpm_return_alloc_pixels=yes)]) + ], [emacs_cv_cpp_xpm_return_alloc_pixels=no], + [emacs_cv_cpp_xpm_return_alloc_pixels=yes])]) if test "$emacs_cv_cpp_xpm_return_alloc_pixels" = "no"; then HAVE_XPM=no @@ -3906,7 +3950,8 @@ no_return_alloc_pixels fi if test "${HAVE_XPM}" = "yes"; then - AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm library (-lXpm).]) + AC_DEFINE([HAVE_XPM], [1], + [Define to 1 if you have the Xpm library (-lXpm).]) LIBXPM=-lXpm elif test "$opsys,$LUCID_LIBW" = aix4-2,-lXaw; then dnl AIX -lXaw needs -lXpm linked too; see Bug#17598 Message#152. @@ -3920,16 +3965,17 @@ fi ### run time). if test "${opsys}" = "mingw32"; then if test "${with_xpm}" != "no"; then - AC_CHECK_HEADER(X11/xpm.h, HAVE_XPM=yes, HAVE_XPM=no, [ + AC_CHECK_HEADER([X11/xpm.h], [HAVE_XPM=yes], [HAVE_XPM=no], [ #define FOR_MSW 1]) fi if test "${HAVE_XPM}" = "yes"; then - AC_DEFINE(HAVE_XPM, 1, [Define to 1 if you have the Xpm library (-lXpm).]) + AC_DEFINE([HAVE_XPM], [1], + [Define to 1 if you have the Xpm library (-lXpm).]) fi fi -AC_SUBST(LIBXPM) +AC_SUBST([LIBXPM]) ### Use -ljpeg if available, unless '--with-jpeg=no'. HAVE_JPEG=no @@ -3968,7 +4014,7 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes" \ done]) if test "$emacs_cv_jpeglib" != no; then HAVE_JPEG=yes - AC_DEFINE([HAVE_JPEG], 1, + AC_DEFINE([HAVE_JPEG], [1], [Define to 1 if you have the jpeg library (typically -ljpeg).]) ### mingw32 doesn't use -ljpeg, since it loads the library ### dynamically when needed, and doesn't want a run-time @@ -3978,7 +4024,7 @@ if test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes" \ fi fi fi -AC_SUBST(LIBJPEG) +AC_SUBST([LIBJPEG]) HAVE_LCMS2=no LCMS2_CFLAGS= @@ -3987,14 +4033,15 @@ if test "${with_lcms2}" != "no"; then EMACS_CHECK_MODULES([LCMS2], [lcms2]) fi if test "${HAVE_LCMS2}" = "yes"; then - AC_DEFINE([HAVE_LCMS2], 1, [Define to 1 if you have the lcms2 library (-llcms2).]) + AC_DEFINE([HAVE_LCMS2], [1], + [Define to 1 if you have the lcms2 library (-llcms2).]) ### mingw32 doesn't use -llcms2, since it loads the library dynamically. if test "${opsys}" = "mingw32"; then LCMS2_LIBS= fi fi -AC_SUBST(LCMS2_CFLAGS) -AC_SUBST(LCMS2_LIBS) +AC_SUBST([LCMS2_CFLAGS]) +AC_SUBST([LCMS2_LIBS]) HAVE_ZLIB=no LIBZ= @@ -4007,13 +4054,14 @@ if test "${with_zlib}" != "no"; then esac fi if test "${HAVE_ZLIB}" = "yes"; then - AC_DEFINE([HAVE_ZLIB], 1, [Define to 1 if you have the zlib library (-lz).]) + AC_DEFINE([HAVE_ZLIB], [1], + [Define to 1 if you have the zlib library (-lz).]) ### mingw32 doesn't use -lz, since it loads the library dynamically. if test "${opsys}" = "mingw32"; then LIBZ= fi fi -AC_SUBST(LIBZ) +AC_SUBST([LIBZ]) ### Dynamic modules support LIBMODULES= @@ -4067,19 +4115,20 @@ fi if test "${HAVE_MODULES}" = yes; then MODULES_OBJ="emacs-module.o" NEED_DYNLIB=yes - AC_DEFINE(HAVE_MODULES, 1, [Define to 1 if dynamic modules are enabled]) - AC_DEFINE_UNQUOTED(MODULES_SUFFIX, "$MODULES_SUFFIX", + AC_DEFINE([HAVE_MODULES], [1], [Define to 1 if dynamic modules are enabled]) + AC_DEFINE_UNQUOTED([MODULES_SUFFIX], ["$MODULES_SUFFIX"], [System extension for dynamic libraries]) if test -n "${MODULES_SECONDARY_SUFFIX}"; then - AC_DEFINE_UNQUOTED(MODULES_SECONDARY_SUFFIX, "$MODULES_SECONDARY_SUFFIX", + AC_DEFINE_UNQUOTED([MODULES_SECONDARY_SUFFIX], + ["$MODULES_SECONDARY_SUFFIX"], [Alternative system extension for dynamic libraries.]) fi fi -AC_SUBST(MODULES_OBJ) -AC_SUBST(LIBMODULES) -AC_SUBST(HAVE_MODULES) -AC_SUBST(MODULES_SUFFIX) -AC_SUBST(MODULES_SECONDARY_SUFFIX) +AC_SUBST([MODULES_OBJ]) +AC_SUBST([LIBMODULES]) +AC_SUBST([HAVE_MODULES]) +AC_SUBST([MODULES_SUFFIX]) +AC_SUBST([MODULES_SECONDARY_SUFFIX]) AC_CONFIG_FILES([src/emacs-module.h]) AC_SUBST_FILE([module_env_snippet_25]) @@ -4093,7 +4142,7 @@ module_env_snippet_27="$srcdir/src/module-env-27.h" module_env_snippet_28="$srcdir/src/module-env-28.h" module_env_snippet_29="$srcdir/src/module-env-29.h" emacs_major_version="${PACKAGE_VERSION%%.*}" -AC_SUBST(emacs_major_version) +AC_SUBST([emacs_major_version]) ### Emacs Lisp native compiler support @@ -4220,8 +4269,9 @@ if test "${with_native_compilation}" != "no"; then fi # Check if libgccjit is available. - AC_CHECK_LIB(gccjit, gcc_jit_context_acquire, [], [libgccjit_not_found]) - AC_CHECK_HEADERS(libgccjit.h, [], [libgccjit_dev_not_found]) + AC_CHECK_LIB([gccjit], [gcc_jit_context_acquire], + [], [libgccjit_not_found]) + AC_CHECK_HEADERS([libgccjit.h], [], [libgccjit_dev_not_found]) # Check if libgccjit really works. AC_RUN_IFELSE([libgccjit_smoke_test], [], [libgccjit_broken]) HAVE_NATIVE_COMP=yes @@ -4238,22 +4288,23 @@ if test "${with_native_compilation}" != "no"; then LIBGCCJIT_LIBS="-lgccjit -ldl" ;; esac NEED_DYNLIB=yes - AC_DEFINE(HAVE_NATIVE_COMP, 1, [Define to 1 if native compiler is available.]) + AC_DEFINE([HAVE_NATIVE_COMP], [1], + [Define to 1 if native compiler is available.]) CFLAGS=$SAVE_CFLAGS LIBS=$SAVE_LIBS fi -AC_DEFINE_UNQUOTED(NATIVE_ELISP_SUFFIX, ".eln", +AC_DEFINE_UNQUOTED([NATIVE_ELISP_SUFFIX], [".eln"], [System extension for native compiled elisp]) -AC_SUBST(HAVE_NATIVE_COMP) -AC_SUBST(LIBGCCJIT_CFLAGS) -AC_SUBST(LIBGCCJIT_LIBS) +AC_SUBST([HAVE_NATIVE_COMP]) +AC_SUBST([LIBGCCJIT_CFLAGS]) +AC_SUBST([LIBGCCJIT_LIBS]) DYNLIB_OBJ= if test "${NEED_DYNLIB}" = yes; then DYNLIB_OBJ="dynlib.o" fi -AC_SUBST(DYNLIB_OBJ) +AC_SUBST([DYNLIB_OBJ]) ### Use -lpng if available, unless '--with-png=no'. HAVE_PNG=no @@ -4325,8 +4376,8 @@ if test $HAVE_PNG = yes; then ]]) CFLAGS=$SAVE_CFLAGS fi -AC_SUBST(LIBPNG) -AC_SUBST(PNG_CFLAGS) +AC_SUBST([LIBPNG]) +AC_SUBST([PNG_CFLAGS]) ### Use -ltiff if available, unless '--with-tiff=no'. ### mingw32 doesn't use -ltiff, since it loads the library dynamically. @@ -4334,29 +4385,32 @@ HAVE_TIFF=no LIBTIFF= if test "${opsys}" = "mingw32"; then if test "${with_tiff}" != "no"; then - AC_CHECK_HEADER(tiffio.h, HAVE_TIFF=yes, HAVE_TIFF=no) + AC_CHECK_HEADER([tiffio.h], [HAVE_TIFF=yes], [HAVE_TIFF=no]) fi if test "${HAVE_TIFF}" = "yes"; then - AC_DEFINE(HAVE_TIFF, 1, [Define to 1 if you have the tiff library (-ltiff).]) + AC_DEFINE([HAVE_TIFF], [1], + [Define to 1 if you have the tiff library (-ltiff).]) fi elif test "${HAVE_X11}" = "yes" || test "${HAVE_W32}" = "yes" \ || test "${HAVE_NS}" = "yes" || test "${HAVE_BE_APP}" = "yes" \ || test "$window_system" = "pgtk"; then if test "${with_tiff}" != "no"; then - AC_CHECK_HEADER(tiffio.h, + AC_CHECK_HEADER([tiffio.h], [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)]) + AC_CHECK_LIB([tiff], [TIFFGetVersion], [HAVE_TIFF=yes], [], + [$tifflibs])]) fi if test "${HAVE_TIFF}" = "yes"; then - AC_DEFINE(HAVE_TIFF, 1, [Define to 1 if you have the tiff library (-ltiff).]) + AC_DEFINE([HAVE_TIFF], [1], + [Define to 1 if you have the tiff library (-ltiff).]) dnl FIXME -lz -lm, as per libpng? LIBTIFF=-ltiff fi fi -AC_SUBST(LIBTIFF) +AC_SUBST([LIBTIFF]) ### Use -lgif or -lungif if available, unless '--with-gif=no'. ### mingw32 doesn't use -lgif/-lungif, since it loads the library dynamically. @@ -4364,34 +4418,40 @@ HAVE_GIF=no LIBGIF= if test "${opsys}" = "mingw32"; then if test "${with_gif}" != "no"; then - AC_CHECK_HEADER(gif_lib.h, HAVE_GIF=yes, HAVE_GIF=no) + AC_CHECK_HEADER([gif_lib.h], [HAVE_GIF=yes], [HAVE_GIF=no]) fi if test "${HAVE_GIF}" = "yes"; then - AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have a gif (or ungif) library.]) + AC_DEFINE([HAVE_GIF], [1], + [Define to 1 if you have a gif (or ungif) library.]) fi elif test "${HAVE_X11}" = "yes" && test "${with_gif}" != "no" \ || test "${HAVE_W32}" = "yes" || test "${HAVE_NS}" = "yes" \ || test "${HAVE_BE_APP}" = "yes" || test "$window_system" = "pgtk" \ && test "${with_gif}" != "no"; then - AC_CHECK_HEADER(gif_lib.h, + AC_CHECK_HEADER([gif_lib.h], # EGifPutExtensionLast only exists from version libungif-4.1.0b1. # Earlier versions can crash Emacs, but version 5.0 removes EGifPutExtensionLast. - [AC_CHECK_LIB(gif, GifMakeMapObject, HAVE_GIF=yes, - [AC_CHECK_LIB(gif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=maybe)])]) + [AC_CHECK_LIB([gif], [GifMakeMapObject], [HAVE_GIF=yes], + [AC_CHECK_LIB([gif], [EGifPutExtensionLast], + [HAVE_GIF=yes], + [HAVE_GIF=maybe])])]) if test "$HAVE_GIF" = yes; then LIBGIF=-lgif elif test "$HAVE_GIF" = maybe; then # If gif_lib.h but no libgif, try libungif. - AC_CHECK_LIB(ungif, EGifPutExtensionLast, HAVE_GIF=yes, HAVE_GIF=no) + AC_CHECK_LIB([ungif], [EGifPutExtensionLast], + [HAVE_GIF=yes], + [HAVE_GIF=no]) test "$HAVE_GIF" = yes && LIBGIF=-lungif fi if test "${HAVE_GIF}" = "yes"; then - AC_DEFINE(HAVE_GIF, 1, [Define to 1 if you have a gif (or ungif) library.]) + AC_DEFINE([HAVE_GIF], [1], + [Define to 1 if you have a gif (or ungif) library.]) fi fi -AC_SUBST(LIBGIF) +AC_SUBST([LIBGIF]) dnl Check for required libraries. MISSING= @@ -4451,28 +4511,33 @@ fi HAVE_GPM=no LIBGPM= if test "${with_gpm}" != "no"; then - AC_CHECK_HEADER(gpm.h, - [AC_CHECK_LIB(gpm, Gpm_Open, HAVE_GPM=yes)]) + AC_CHECK_HEADER([gpm.h], + [AC_CHECK_LIB([gpm], [Gpm_Open], [HAVE_GPM=yes])]) if test "${HAVE_GPM}" = "yes"; then - AC_DEFINE(HAVE_GPM, 1, [Define to 1 if you have the gpm library (-lgpm).]) + AC_DEFINE([HAVE_GPM], [1], + [Define to 1 if you have the gpm library (-lgpm).]) LIBGPM=-lgpm fi fi -AC_SUBST(LIBGPM) +AC_SUBST([LIBGPM]) dnl Check for malloc/malloc.h on darwin -AC_CHECK_HEADERS_ONCE(malloc/malloc.h) +AC_CHECK_HEADERS_ONCE([malloc/malloc.h]) GNUSTEP_CFLAGS= ### Use NeXTstep API to implement GUI. if test "${HAVE_NS}" = "yes"; then - AC_DEFINE(HAVE_NS, 1, [Define to 1 if you are using the NeXTstep API, either GNUstep or Cocoa on macOS.]) + AC_DEFINE([HAVE_NS], [1], + [Define to 1 if you are using the NeXTstep API, + either GNUstep or Cocoa on macOS.]) if test "${NS_IMPL_COCOA}" = "yes"; then - AC_DEFINE(NS_IMPL_COCOA, 1, [Define to 1 if you are using NS windowing under macOS.]) + AC_DEFINE([NS_IMPL_COCOA], [1], + [Define to 1 if you are using NS windowing under macOS.]) fi if test "${NS_IMPL_GNUSTEP}" = "yes"; then - AC_DEFINE(NS_IMPL_GNUSTEP, 1, [Define to 1 if you are using NS windowing under GNUstep.]) + AC_DEFINE([NS_IMPL_GNUSTEP], [1], + [Define to 1 if you are using NS windowing under GNUstep.]) if test $NS_GNUSTEP_CONFIG != yes; then # See also .m.o rule in src/Makefile.in. */ # FIXME: are all these flags really needed? Document here why. */ @@ -4488,15 +4553,16 @@ fi HAVE_X_SM=no LIBXSM= if test "${HAVE_X11}" = "yes"; then - AC_CHECK_HEADER(X11/SM/SMlib.h, - [AC_CHECK_LIB(SM, SmcOpenConnection, HAVE_X_SM=yes, , -lICE)]) + 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, 1, [Define to 1 if you have the SM library (-lSM).]) + AC_DEFINE([HAVE_X_SM], [1], + [Define to 1 if you have the SM library (-lSM).]) LIBXSM="-lSM -lICE" fi fi -AC_SUBST(LIBXSM) +AC_SUBST([LIBXSM]) ### Use XRandr (-lXrandr) if available HAVE_XRANDR=no @@ -4508,8 +4574,8 @@ if test "${HAVE_X11}" = "yes"; then # Test old way in case pkg-config doesn't have it (older machines). # Include Xrender.h by hand to work around bug in older Xrandr.h # (e.g. RHEL5) and silence (harmless) configure warning (bug#18465). - AC_CHECK_HEADER(X11/extensions/Xrandr.h, - [AC_CHECK_LIB(Xrandr, XRRGetScreenResources, HAVE_XRANDR=yes)], + AC_CHECK_HEADER([X11/extensions/Xrandr.h], + [AC_CHECK_LIB([Xrandr], [XRRGetScreenResources], [HAVE_XRANDR=yes])], [], [AC_INCLUDES_DEFAULT #include ]) if test $HAVE_XRANDR = yes; then @@ -4517,11 +4583,12 @@ if test "${HAVE_X11}" = "yes"; then fi fi if test $HAVE_XRANDR = yes; then - AC_DEFINE(HAVE_XRANDR, 1, [Define to 1 if you have the XRandr extension.]) + AC_DEFINE([HAVE_XRANDR], [1], + [Define to 1 if you have the XRandr extension.]) fi fi -AC_SUBST(XRANDR_CFLAGS) -AC_SUBST(XRANDR_LIBS) +AC_SUBST([XRANDR_CFLAGS]) +AC_SUBST([XRANDR_LIBS]) ### Use Xinerama (-lXinerama) if available HAVE_XINERAMA=no @@ -4531,18 +4598,20 @@ if test "${HAVE_X11}" = "yes"; then EMACS_CHECK_MODULES([XINERAMA], [$XINERAMA_MODULES]) if test $HAVE_XINERAMA = no; then # Test old way in case pkg-config doesn't have it (older machines). - AC_CHECK_HEADER(X11/extensions/Xinerama.h, - [AC_CHECK_LIB(Xinerama, XineramaQueryExtension, HAVE_XINERAMA=yes)]) + AC_CHECK_HEADER([X11/extensions/Xinerama.h], + [AC_CHECK_LIB([Xinerama], [XineramaQueryExtension], + [HAVE_XINERAMA=yes])]) if test $HAVE_XINERAMA = yes; then XINERAMA_LIBS=-lXinerama fi fi if test $HAVE_XINERAMA = yes; then - AC_DEFINE(HAVE_XINERAMA, 1, [Define to 1 if you have the Xinerama extension.]) + AC_DEFINE([HAVE_XINERAMA], [1], + [Define to 1 if you have the Xinerama extension.]) fi fi -AC_SUBST(XINERAMA_CFLAGS) -AC_SUBST(XINERAMA_LIBS) +AC_SUBST([XINERAMA_CFLAGS]) +AC_SUBST([XINERAMA_LIBS]) ### Use Xfixes (-lXfixes) if available HAVE_XFIXES=no @@ -4552,18 +4621,19 @@ if test "${HAVE_X11}" = "yes"; then EMACS_CHECK_MODULES([XFIXES], [$XFIXES_MODULES]) if test $HAVE_XFIXES = no; then # Test old way in case pkg-config doesn't have it (older machines). - AC_CHECK_HEADER(X11/extensions/Xfixes.h, - [AC_CHECK_LIB(Xfixes, XFixesHideCursor, HAVE_XFIXES=yes)]) + AC_CHECK_HEADER([X11/extensions/Xfixes.h], + [AC_CHECK_LIB([Xfixes], [XFixesHideCursor], [HAVE_XFIXES=yes])]) if test $HAVE_XFIXES = yes; then XFIXES_LIBS=-lXfixes fi fi if test $HAVE_XFIXES = yes; then - AC_DEFINE(HAVE_XFIXES, 1, [Define to 1 if you have the Xfixes extension.]) + AC_DEFINE([HAVE_XFIXES], [1], + [Define to 1 if you have the Xfixes extension.]) fi fi -AC_SUBST(XFIXES_CFLAGS) -AC_SUBST(XFIXES_LIBS) +AC_SUBST([XFIXES_CFLAGS]) +AC_SUBST([XFIXES_LIBS]) ## Use XInput 2.0 if available HAVE_XINPUT2=no @@ -4571,11 +4641,12 @@ if test "${HAVE_X11}" = "yes" && test "${with_xinput2}" != "no"; then EMACS_CHECK_MODULES([XINPUT], [xi]) if test $HAVE_XINPUT = yes; then # Now check for XInput2.h - AC_CHECK_HEADER(X11/extensions/XInput2.h, - [AC_CHECK_LIB(Xi, XIGrabButton, HAVE_XINPUT2=yes)]) + AC_CHECK_HEADER([X11/extensions/XInput2.h], + [AC_CHECK_LIB([Xi], [XIGrabButton], [HAVE_XINPUT2=yes])]) fi if test $HAVE_XINPUT2 = yes; then - AC_DEFINE(HAVE_XINPUT2, 1, [Define to 1 if the X Input Extension version 2.0 or later is present.]) + AC_DEFINE([HAVE_XINPUT2], [1], + [Define to 1 if the X Input Extension version 2.0 or later is present.]) if test "$USE_GTK_TOOLKIT" = "GTK2"; then AC_MSG_WARN([You are building Emacs with GTK+ 2 and the X Input Extension version 2. This might lead to problems if your version of GTK+ is not built with support for XInput 2.]) @@ -4589,31 +4660,32 @@ This might lead to problems if your version of GTK+ is not built with support fo [], [], [#include ]) fi fi -AC_SUBST(XINPUT_CFLAGS) -AC_SUBST(XINPUT_LIBS) +AC_SUBST([XINPUT_CFLAGS]) +AC_SUBST([XINPUT_LIBS]) XSYNC_LIBS= XSYNC_CFLAGS= HAVE_XSYNC=no if test "${HAVE_X11}" = "yes"; then - AC_CHECK_HEADER(X11/extensions/sync.h, - [AC_CHECK_LIB(Xext, XSyncQueryExtension, HAVE_XSYNC=yes)], + AC_CHECK_HEADER([X11/extensions/sync.h], + [AC_CHECK_LIB([Xext], [XSyncQueryExtension], [HAVE_XSYNC=yes])], [], [#include ]) if test "${HAVE_XSYNC}" = "yes"; then - AC_DEFINE(HAVE_XSYNC, 1, [Define to 1 if the X Synchronization Extension is available.]) + AC_DEFINE([HAVE_XSYNC], [1], + [Define to 1 if the X Synchronization Extension is available.]) XSYNC_LIBS="-lXext" fi fi -AC_SUBST(XSYNC_LIBS) -AC_SUBST(XSYNC_CFLAGS) +AC_SUBST([XSYNC_LIBS]) +AC_SUBST([XSYNC_CFLAGS]) ### Use Xdbe (-lXdbe) if available HAVE_XDBE=no if test "${HAVE_X11}" = "yes"; then if test "${with_xdbe}" != "no"; then - AC_CHECK_HEADER(X11/extensions/Xdbe.h, - [AC_CHECK_LIB(Xext, XdbeAllocateBackBufferName, HAVE_XDBE=yes)], + AC_CHECK_HEADER([X11/extensions/Xdbe.h], + [AC_CHECK_LIB([Xext], [XdbeAllocateBackBufferName], [HAVE_XDBE=yes])], [], [#include ]) @@ -4622,44 +4694,49 @@ if test "${HAVE_X11}" = "yes"; then XDBE_LIBS=-lXext fi if test $HAVE_XDBE = yes; then - AC_DEFINE(HAVE_XDBE, 1, [Define to 1 if you have the Xdbe extension.]) + AC_DEFINE([HAVE_XDBE], [1], [Define to 1 if you have the Xdbe extension.]) fi fi -AC_SUBST(XDBE_CFLAGS) -AC_SUBST(XDBE_LIBS) +AC_SUBST([XDBE_CFLAGS]) +AC_SUBST([XDBE_LIBS]) ### Use the Nonrectangular Window Shape extension if available. HAVE_XSHAPE=no HAVE_XCB_SHAPE=no if test "${HAVE_X11}" = "yes"; then - AC_CHECK_HEADER(X11/extensions/shape.h, - [AC_CHECK_LIB(Xext, XShapeQueryVersion, HAVE_XSHAPE=yes)], + AC_CHECK_HEADER([X11/extensions/shape.h], + [AC_CHECK_LIB([Xext], [XShapeQueryVersion], [HAVE_XSHAPE=yes])], [], [#include ]) if test $HAVE_XSHAPE = yes; then XSHAPE_LIBS=-lXext - AC_CHECK_HEADER(xcb/shape.h, - [AC_CHECK_LIB(xcb-shape, xcb_shape_combine, HAVE_XCB_SHAPE=yes)], [], + AC_CHECK_HEADER([xcb/shape.h], + [AC_CHECK_LIB([xcb-shape], [xcb_shape_combine], [HAVE_XCB_SHAPE=yes])], + [], [#include ]) if test $HAVE_XCB_SHAPE = yes && test "$XCB_LIBS" != ""; then XSHAPE_LIBS="$XSHAPE_LIBS -lxcb-shape" - AC_DEFINE(HAVE_XCB_SHAPE, 1, [Define to 1 if XCB supports the Nonrectangular Window Shape extension.]) + AC_DEFINE([HAVE_XCB_SHAPE], [1], + [Define to 1 if XCB supports the + Nonrectangular Window Shape extension.]) fi fi if test $HAVE_XSHAPE = yes; then - AC_DEFINE(HAVE_XSHAPE, 1, [Define to 1 if you have the Nonrectangular Window Shape extension.]) + AC_DEFINE([HAVE_XSHAPE], [1], + [Define to 1 if you have the Nonrectangular Window Shape extension.]) fi fi -AC_SUBST(XSHAPE_CFLAGS) -AC_SUBST(XSHAPE_LIBS) +AC_SUBST([XSHAPE_CFLAGS]) +AC_SUBST([XSHAPE_LIBS]) ### Use Xcomposite (-lXcomposite) if available HAVE_XCOMPOSITE=no if test "${HAVE_X11}" = "yes"; then - AC_CHECK_HEADER(X11/extensions/Xcomposite.h, - [AC_CHECK_LIB(Xcomposite, XCompositeRedirectWindow, HAVE_XCOMPOSITE=yes)], + AC_CHECK_HEADER([X11/extensions/Xcomposite.h], + [AC_CHECK_LIB([Xcomposite], [XCompositeRedirectWindow], + [HAVE_XCOMPOSITE=yes])], [], [#include ]) @@ -4667,11 +4744,12 @@ if test "${HAVE_X11}" = "yes"; then XCOMPOSITE_LIBS=-lXcomposite fi if test $HAVE_XCOMPOSITE = yes; then - AC_DEFINE(HAVE_XCOMPOSITE, 1, [Define to 1 if you have the XCOMPOSITE extension.]) + AC_DEFINE([HAVE_XCOMPOSITE], [1], + [Define to 1 if you have the XCOMPOSITE extension.]) fi fi -AC_SUBST(XCOMPOSITE_CFLAGS) -AC_SUBST(XCOMPOSITE_LIBS) +AC_SUBST([XCOMPOSITE_CFLAGS]) +AC_SUBST([XCOMPOSITE_LIBS]) ### Use libxml (-lxml2) if available ### mingw32 doesn't use -lxml2, since it loads the library dynamically. @@ -4691,8 +4769,8 @@ if test "${with_xml2}" != "no"; then esac fi CPPFLAGS="$CPPFLAGS -isystem${xcsdkdir}/usr/include/libxml2" - AC_CHECK_HEADER(libxml/HTMLparser.h, - [AC_CHECK_DECL(HTML_PARSE_RECOVER, HAVE_LIBXML2=yes, , + AC_CHECK_HEADER([libxml/HTMLparser.h], + [AC_CHECK_DECL([HTML_PARSE_RECOVER], [HAVE_LIBXML2=yes], [], [#include ])]) CPPFLAGS="$SAVE_CPPFLAGS" if test "${HAVE_LIBXML2}" = "yes"; then @@ -4702,21 +4780,24 @@ if test "${with_xml2}" != "no"; then fi if test "${HAVE_LIBXML2}" = "yes"; then if test "${opsys}" != "mingw32"; then - AC_CHECK_LIB(xml2, htmlReadMemory, HAVE_LIBXML2=yes, HAVE_LIBXML2=no, + AC_CHECK_LIB([xml2], [htmlReadMemory], + [HAVE_LIBXML2=yes], + [HAVE_LIBXML2=no], [$LIBXML2_LIBS]) else LIBXML2_LIBS="" fi if test "${HAVE_LIBXML2}" = "yes"; then - AC_DEFINE(HAVE_LIBXML2, 1, [Define to 1 if you have the libxml library (-lxml2).]) + AC_DEFINE([HAVE_LIBXML2], [1], + [Define to 1 if you have the libxml library (-lxml2).]) else LIBXML2_LIBS="" LIBXML2_CFLAGS="" fi fi fi -AC_SUBST(LIBXML2_LIBS) -AC_SUBST(LIBXML2_CFLAGS) +AC_SUBST([LIBXML2_LIBS]) +AC_SUBST([LIBXML2_CFLAGS]) BLESSMAIL_TARGET= LIBS_MAIL= @@ -4822,7 +4903,7 @@ AC_SUBST([LIBSECCOMP_CFLAGS]) OLD_LIBS=$LIBS LIBS="$LIB_PTHREAD $LIB_MATH $LIBS" -AC_CHECK_FUNCS(accept4 fchdir gethostname \ +AC_CHECK_FUNCS([accept4 fchdir gethostname \ getrusage get_current_dir_name \ lrand48 random rint trunc \ select getpagesize setlocale newlocale \ @@ -4832,7 +4913,7 @@ sendto recvfrom getsockname getifaddrs freeifaddrs \ gai_strerror sync \ getpwent endpwent getgrent endgrent \ cfmakeraw cfsetspeed __executable_start log2 pthread_setname_np \ -pthread_set_name_np) +pthread_set_name_np]) LIBS=$OLD_LIBS if test "$ac_cv_func_pthread_setname_np" = "yes"; then @@ -4847,7 +4928,7 @@ if test "$ac_cv_func_pthread_setname_np" = "yes"; then [emacs_cv_pthread_setname_np_1arg=no])]) if test "$emacs_cv_pthread_setname_np_1arg" = "yes"; then AC_DEFINE( - HAVE_PTHREAD_SETNAME_NP_1ARG, 1, + [HAVE_PTHREAD_SETNAME_NP_1ARG], [1], [Define to 1 if pthread_setname_np takes a single argument.]) else AC_CACHE_CHECK( @@ -4861,7 +4942,7 @@ if test "$ac_cv_func_pthread_setname_np" = "yes"; then [emacs_cv_pthread_setname_np_3arg=no])]) if test "$emacs_cv_pthread_setname_np_3arg" = "yes"; then AC_DEFINE( - HAVE_PTHREAD_SETNAME_NP_3ARG, 1, + [HAVE_PTHREAD_SETNAME_NP_3ARG], [1], [Define to 1 if pthread_setname_np takes three arguments.]) fi fi @@ -4894,28 +4975,28 @@ AC_CACHE_CHECK([for __builtin_frame_address], [emacs_cv_func___builtin_frame_address=yes], [emacs_cv_func___builtin_frame_address=no])]) if test $emacs_cv_func___builtin_frame_address = yes; then - AC_DEFINE([HAVE___BUILTIN_FRAME_ADDRESS], 1, + AC_DEFINE([HAVE___BUILTIN_FRAME_ADDRESS], [1], [Define to 1 if you have the '__builtin_frame_address' function.]) fi AC_CACHE_CHECK([for __builtin_unwind_init], - emacs_cv_func___builtin_unwind_init, + [emacs_cv_func___builtin_unwind_init], [AC_LINK_IFELSE([AC_LANG_PROGRAM([], [__builtin_unwind_init ();])], - emacs_cv_func___builtin_unwind_init=yes, - emacs_cv_func___builtin_unwind_init=no)]) + [emacs_cv_func___builtin_unwind_init=yes], + [emacs_cv_func___builtin_unwind_init=no])]) if test $emacs_cv_func___builtin_unwind_init = yes; then - AC_DEFINE(HAVE___BUILTIN_UNWIND_INIT, 1, + AC_DEFINE([HAVE___BUILTIN_UNWIND_INIT], [1], [Define to 1 if you have the '__builtin_unwind_init' function.]) fi -AC_CHECK_HEADERS_ONCE(sys/un.h) +AC_CHECK_HEADERS_ONCE([sys/un.h]) AC_FUNC_FSEEKO # UNIX98 PTYs. -AC_CHECK_FUNCS(grantpt) +AC_CHECK_FUNCS([grantpt]) # PTY-related GNU extensions. -AC_CHECK_FUNCS(getpt posix_openpt) +AC_CHECK_FUNCS([getpt posix_openpt]) dnl Run a test program that contains a call to tputs, a call that is dnl never executed. This tests whether a pre-'main' dynamic linker @@ -4987,14 +5068,15 @@ case "$opsys" in freebsd) AC_MSG_CHECKING([whether FreeBSD is new enough to use terminfo]) - AC_CACHE_VAL(emacs_cv_freebsd_terminfo, + AC_CACHE_VAL([emacs_cv_freebsd_terminfo], [AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[#if __FreeBSD_version < 400000 fail; #endif -]])], emacs_cv_freebsd_terminfo=yes, emacs_cv_freebsd_terminfo=no)]) +]])], [emacs_cv_freebsd_terminfo=yes], + [emacs_cv_freebsd_terminfo=no])]) - AC_MSG_RESULT($emacs_cv_freebsd_terminfo) + AC_MSG_RESULT([$emacs_cv_freebsd_terminfo]) if test $emacs_cv_freebsd_terminfo = yes; then LIBS_TERMCAP="-lncurses" @@ -5029,7 +5111,8 @@ esac TERMCAP_OBJ=tparam.o if test $TERMINFO = yes; then - AC_DEFINE(TERMINFO, 1, [Define to 1 if you use terminfo instead of termcap.]) + AC_DEFINE([TERMINFO], [1], + [Define to 1 if you use terminfo instead of termcap.]) TERMCAP_OBJ=terminfo.o AC_CACHE_CHECK([whether $LIBS_TERMCAP library defines BC], [emacs_cv_terminfo_defines_BC], @@ -5040,15 +5123,15 @@ if test $TERMINFO = yes; then [emacs_cv_terminfo_defines_BC=no]) LIBS=$OLD_LIBS]) if test "$emacs_cv_terminfo_defines_BC" = yes; then - AC_DEFINE([TERMINFO_DEFINES_BC], 1, [Define to 1 if the + AC_DEFINE([TERMINFO_DEFINES_BC], [1], [Define to 1 if the terminfo library defines the variables BC, PC, and UP.]) fi fi if test "X$LIBS_TERMCAP" = "X-lncurses"; then - AC_DEFINE(USE_NCURSES, 1, [Define to 1 if you use ncurses.]) + AC_DEFINE([USE_NCURSES], [1], [Define to 1 if you use ncurses.]) fi -AC_SUBST(LIBS_TERMCAP) -AC_SUBST(TERMCAP_OBJ) +AC_SUBST([LIBS_TERMCAP]) +AC_SUBST([TERMCAP_OBJ]) # GNU/Linux-specific timer functions. AC_CACHE_CHECK([for timerfd interface], [emacs_cv_have_timerfd], @@ -5061,7 +5144,7 @@ AC_CACHE_CHECK([for timerfd interface], [emacs_cv_have_timerfd], [emacs_cv_have_timerfd=yes], [emacs_cv_have_timerfd=no])]) if test "$emacs_cv_have_timerfd" = yes; then - AC_DEFINE([HAVE_TIMERFD], 1, + AC_DEFINE([HAVE_TIMERFD], [1], [Define to 1 if timerfd functions are supported as in GNU/Linux.]) fi @@ -5088,25 +5171,26 @@ LIBRESOLV= if test "$with_hesiod" != no ; then # Don't set $LIBS here -- see comments above. FIXME which comments? 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)])])]) + 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 else RESOLVLIB= fi hesiod=no - AC_CHECK_FUNC(hes_getmailhost, , [AC_CHECK_LIB(hesiod, hes_getmailhost, - hesiod=yes, :, $RESOLVLIB)]) + AC_CHECK_FUNC([hes_getmailhost], [], + [AC_CHECK_LIB([hesiod], [hes_getmailhost], + [hesiod=yes], [:], [$RESOLVLIB])]) if test x"$hesiod" = xyes; then LIBHESIOD=-lhesiod LIBRESOLV=$RESOLVLIB fi fi -AC_SUBST(LIBHESIOD) -AC_SUBST(LIBRESOLV) +AC_SUBST([LIBHESIOD]) +AC_SUBST([LIBRESOLV]) # These tell us which Kerberos-related libraries to use. COM_ERRLIB= @@ -5117,45 +5201,51 @@ KRB4LIB= if test "${with_kerberos}" != no; then OLD_LIBS=$LIBS - AC_CHECK_LIB(com_err, com_err, have_com_err=yes, have_com_err=no) + AC_CHECK_LIB([com_err], [com_err], [have_com_err=yes], [have_com_err=no]) if test $have_com_err = yes; then COM_ERRLIB=-lcom_err LIBS="$COM_ERRLIB $LIBS" fi - AC_CHECK_LIB(crypto, mit_des_cbc_encrypt, have_crypto=yes, have_crypto=no) + AC_CHECK_LIB([crypto], [mit_des_cbc_encrypt], + [have_crypto=yes], + [have_crypto=no]) if test $have_crypto = yes; then CRYPTOLIB=-lcrypto LIBS="$CRYPTOLIB $LIBS" fi - AC_CHECK_LIB(k5crypto, mit_des_cbc_encrypt, have_k5crypto=yes, have_k5crypto=no) + AC_CHECK_LIB([k5crypto], [mit_des_cbc_encrypt], + [have_k5crypto=yes], + [have_k5crypto=no]) if test $have_k5crypto = yes; then CRYPTOLIB=-lk5crypto LIBS="$CRYPTOLIB $LIBS" fi - AC_CHECK_LIB(krb5, krb5_init_context, have_krb5=yes, have_krb5=no) + AC_CHECK_LIB([krb5], [krb5_init_context], [have_krb5=yes], [have_krb5=no]) if test $have_krb5=yes; then KRB5LIB=-lkrb5 LIBS="$KRB5LIB $LIBS" fi dnl FIXME Simplify. Does not match 22 logic, thanks to default_off? if test "${with_kerberos5}" = no; then - AC_CHECK_LIB(des425, des_cbc_encrypt, have_des425=yes, have_des425=no ) + AC_CHECK_LIB([des425], [des_cbc_encrypt], + [have_des425=yes], + [have_des425=no]) if test $have_des425 = yes; then DESLIB=-ldes425 LIBS="$DESLIB $LIBS" else - AC_CHECK_LIB(des, des_cbc_encrypt, have_des=yes, have_des=no) + AC_CHECK_LIB([des], [des_cbc_encrypt], [have_des=yes], [have_des=no]) if test $have_des = yes; then DESLIB=-ldes LIBS="$DESLIB $LIBS" fi fi - AC_CHECK_LIB(krb4, krb_get_cred, have_krb4=yes, have_krb4=no) + AC_CHECK_LIB([krb4], [krb_get_cred], [have_krb4=yes], [have_krb4=no]) if test $have_krb4 = yes; then KRB4LIB=-lkrb4 LIBS="$KRB4LIB $LIBS" else - AC_CHECK_LIB(krb, krb_get_cred, have_krb=yes, have_krb=no) + AC_CHECK_LIB([krb], [krb_get_cred], [have_krb=yes], [have_krb=no]) if test $have_krb = yes; then KRB4LIB=-lkrb LIBS="$KRB4LIB $LIBS" @@ -5164,25 +5254,25 @@ if test "${with_kerberos}" != no; then fi if test "${with_kerberos5}" != no; then - AC_CHECK_HEADERS(krb5.h, - [AC_CHECK_MEMBERS([krb5_error.text, krb5_error.e_text],,, + AC_CHECK_HEADERS([krb5.h], + [AC_CHECK_MEMBERS([krb5_error.text, krb5_error.e_text], [], [], [#include ])]) else - AC_CHECK_HEADERS(krb.h,, - [AC_CHECK_HEADERS(kerberosIV/krb.h,, - [AC_CHECK_HEADERS(kerberos/krb.h)])]) + AC_CHECK_HEADERS([krb.h], [], + [AC_CHECK_HEADERS([kerberosIV/krb.h], [], + [AC_CHECK_HEADERS([kerberos/krb.h])])]) fi - AC_CHECK_HEADERS(com_err.h) + AC_CHECK_HEADERS([com_err.h]) LIBS=$OLD_LIBS fi -AC_SUBST(COM_ERRLIB) -AC_SUBST(CRYPTOLIB) -AC_SUBST(KRB5LIB) -AC_SUBST(DESLIB) -AC_SUBST(KRB4LIB) +AC_SUBST([COM_ERRLIB]) +AC_SUBST([CRYPTOLIB]) +AC_SUBST([KRB5LIB]) +AC_SUBST([DESLIB]) +AC_SUBST([KRB4LIB]) -AC_CHECK_HEADERS(valgrind/valgrind.h) +AC_CHECK_HEADERS([valgrind/valgrind.h]) AC_CHECK_MEMBERS([struct unipair.unicode], [], [], [[#include ]]) @@ -5192,7 +5282,7 @@ AC_FUNC_FORK dnl AC_CHECK_FUNCS_ONCE wouldn’t be right for snprintf, which needs dnl the current CFLAGS etc. -AC_CHECK_FUNCS(snprintf) +AC_CHECK_FUNCS([snprintf]) dnl posix_spawn. The chdir and setsid functionality is relatively dnl recent, so we check for it specifically. @@ -5236,12 +5326,12 @@ AC_LINK_IFELSE([AC_LANG_PROGRAM( CFLAGS="$OLDCFLAGS" LIBS="$OLDLIBS"]) if test "${emacs_cv_links_glib}" = "yes"; then - AC_DEFINE(HAVE_GLIB, 1, [Define to 1 if GLib is linked in.]) + AC_DEFINE([HAVE_GLIB], [1], [Define to 1 if GLib is linked in.]) if test "$HAVE_NS" = no ; then XGSELOBJ=xgselect.o fi fi -AC_SUBST(XGSELOBJ) +AC_SUBST([XGSELOBJ]) dnl Adapted from Haible's version. AC_CACHE_CHECK([for nl_langinfo and CODESET], [emacs_cv_langinfo_codeset], @@ -5251,7 +5341,7 @@ AC_CACHE_CHECK([for nl_langinfo and CODESET], [emacs_cv_langinfo_codeset], [emacs_cv_langinfo_codeset=no]) ]) if test "$emacs_cv_langinfo_codeset" = yes; then - AC_DEFINE([HAVE_LANGINFO_CODESET], 1, + AC_DEFINE([HAVE_LANGINFO_CODESET], [1], [Define if you have and nl_langinfo (CODESET).]) AC_CACHE_CHECK([for nl_langinfo and _NL_PAPER_WIDTH], @@ -5262,7 +5352,7 @@ if test "$emacs_cv_langinfo_codeset" = yes; then [emacs_cv_langinfo__nl_paper_width=no]) ]) if test "$emacs_cv_langinfo__nl_paper_width" = yes; then - AC_DEFINE([HAVE_LANGINFO__NL_PAPER_WIDTH], 1, + AC_DEFINE([HAVE_LANGINFO__NL_PAPER_WIDTH], [1], [Define if you have and nl_langinfo (_NL_PAPER_WIDTH).]) fi fi @@ -5275,15 +5365,17 @@ dnl The following looks like a useful start. dnl dnl AC_SYS_POSIX_TERMIOS dnl if test $ac_cv_sys_posix_termios = yes; then -dnl AC_DEFINE(HAVE_TERMIOS, 1, [Define to 1 if you have POSIX-style functions -dnl and macros for terminal control.]) -dnl AC_DEFINE(HAVE_TCATTR, 1, [Define to 1 if you have tcgetattr and tcsetattr.]) +dnl AC_DEFINE([HAVE_TERMIOS], [1], +dnl [Define to 1 if you have POSIX-style +dnl functions and macros for terminal control.]) +dnl AC_DEFINE([HAVE_TCATTR], [1], +dnl [Define to 1 if you have tcgetattr and tcsetattr.]) dnl fi dnl Turned on June 1996 supposing nobody will mind it. dnl MinGW emulates passwd database, so this feature doesn't make sense there. if test "${opsys}" != "mingw32"; then - AC_DEFINE(AMPERSAND_FULL_NAME, 1, [Define to use the convention that & + AC_DEFINE([AMPERSAND_FULL_NAME], [1], [Define to use the convention that & in the full name stands for the login id.]) fi @@ -5291,22 +5383,23 @@ dnl Everybody supports this, except MS. dnl Seems like the kind of thing we should be testing for, though. ## Note: PTYs are broken on darwin <6. Use at your own risk. if test "${opsys}" != "mingw32"; then - AC_DEFINE(HAVE_PTYS, 1, [Define if the system supports pty devices.]) + AC_DEFINE([HAVE_PTYS], [1], [Define if the system supports pty devices.]) fi dnl Everybody supports this, except MS-DOS. dnl Seems like the kind of thing we should be testing for, though. -AC_DEFINE(HAVE_SOCKETS, 1, [Define if the system supports +AC_DEFINE([HAVE_SOCKETS], [1], [Define if the system supports 4.2-compatible sockets.]) -AH_TEMPLATE(INTERNAL_TERMINAL, [This is substituted when $TERM is "internal".]) +AH_TEMPLATE([INTERNAL_TERMINAL], + [This is substituted when $TERM is "internal".]) -AH_TEMPLATE(NULL_DEVICE, [Name of the file to open to get +AH_TEMPLATE([NULL_DEVICE], [Name of the file to open to get a null file, or a data sink.]) if test "${opsys}" = "mingw32"; then - AC_DEFINE(NULL_DEVICE, ["NUL:"]) + AC_DEFINE([NULL_DEVICE], ["NUL:"]) else - AC_DEFINE(NULL_DEVICE, ["/dev/null"]) + AC_DEFINE([NULL_DEVICE], ["/dev/null"]) fi if test "${opsys}" = "mingw32"; then @@ -5314,7 +5407,8 @@ if test "${opsys}" = "mingw32"; then else SEPCHAR=':' fi -AC_DEFINE_UNQUOTED(SEPCHAR, ['$SEPCHAR'], [Character that separates PATH elements.]) +AC_DEFINE_UNQUOTED([SEPCHAR], ['$SEPCHAR'], + [Character that separates PATH elements.]) dnl This is for MinGW, and is used in test/Makefile.in. dnl The MSYS Bash has heuristics for replacing ':' with ';' when it dnl decides that a command-line argument to be passed to a MinGW program @@ -5324,34 +5418,35 @@ dnl sees a colon-separated list of file names; e.g. ":." is left alone, dnl which breaks in-tree builds. So we do this manually instead. dnl Note that we cannot rely on PATH_SEPARATOR, as that one will always dnl be computed as ':' in MSYS Bash. -AC_SUBST(SEPCHAR) +AC_SUBST([SEPCHAR]) dnl Everybody supports this, except MS-DOS. -AC_DEFINE(subprocesses, 1, [Define to enable asynchronous subprocesses.]) +AC_DEFINE([subprocesses], [1], [Define to enable asynchronous subprocesses.]) -AC_DEFINE(USER_FULL_NAME, [pw->pw_gecos], [How to get a user's full name.]) +AC_DEFINE([USER_FULL_NAME], [pw->pw_gecos], [How to get a user's full name.]) -AC_DEFINE(DIRECTORY_SEP, ['/'], +AC_DEFINE([DIRECTORY_SEP], ['/'], [Character that separates directories in a file name.]) if test "${opsys}" = "mingw32"; then - AC_DEFINE(IS_DEVICE_SEP(_c_), [((_c_) == ':')], + AC_DEFINE([IS_DEVICE_SEP(_c_)], [((_c_) == ':')], [Returns true if character is a device separator.]) - AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == '/' || (_c_) == '\\')], + AC_DEFINE([IS_DIRECTORY_SEP(_c_)], [((_c_) == '/' || (_c_) == '\\')], [Returns true if character is a directory separator.]) - AC_DEFINE(IS_ANY_SEP(_c_), [(IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP(_c_))], + AC_DEFINE([IS_ANY_SEP(_c_)], + [(IS_DIRECTORY_SEP (_c_) || IS_DEVICE_SEP (_c_))], [Returns true if character is any form of separator.]) else - AC_DEFINE(IS_DEVICE_SEP(_c_), 0, + AC_DEFINE([IS_DEVICE_SEP(_c_)], 0, [Returns true if character is a device separator.]) - AC_DEFINE(IS_DIRECTORY_SEP(_c_), [((_c_) == DIRECTORY_SEP)], + AC_DEFINE([IS_DIRECTORY_SEP(_c_)], [((_c_) == DIRECTORY_SEP)], [Returns true if character is a directory separator.]) - AC_DEFINE(IS_ANY_SEP(_c_), [(IS_DIRECTORY_SEP (_c_))], + AC_DEFINE([IS_ANY_SEP(_c_)], [(IS_DIRECTORY_SEP (_c_))], [Returns true if character is any form of separator.]) fi @@ -5376,7 +5471,7 @@ if test "$USE_X_TOOLKIT" != "none"; then [[#include #include ]], [[_XEditResCheckMessages (0, 0, 0, 0);]])], - [AC_DEFINE([X_TOOLKIT_EDITRES], 1, + [AC_DEFINE([X_TOOLKIT_EDITRES], [1], [Define to 1 if we should use XEditRes.])]) LIBS=$OLDLIBS fi @@ -5388,7 +5483,7 @@ case $opsys in dnl instead, there's a system variable _sys_nsig. Unfortunately, we dnl need the constant to dimension an array. So wire in the appropriate dnl value here. - AC_DEFINE(NSIG_MINIMUM, 32, [Minimum value of NSIG.]) + AC_DEFINE([NSIG_MINIMUM], [32], [Minimum value of NSIG.]) ;; esac @@ -5421,7 +5516,7 @@ case $opsys in dnl of this file, so that we do not check for get_current_dir_name dnl on AIX. But that might be fragile if something else ends dnl up testing for get_current_dir_name as a dependency. - AC_DEFINE(BROKEN_GET_CURRENT_DIR_NAME, 1, [Define if + AC_DEFINE([BROKEN_GET_CURRENT_DIR_NAME], [1], [Define if get_current_dir_name should not be used.]) ;; @@ -5439,7 +5534,7 @@ case $opsys in dnl successfully after processing (for example with CRs added if the dnl terminal is set up that way which it is here). The same bytes will dnl be seen again in a later read(2), without the CRs. - AC_DEFINE(BROKEN_PTY_READ_AFTER_EAGAIN, 1, [Define on FreeBSD to + AC_DEFINE([BROKEN_PTY_READ_AFTER_EAGAIN], [1], [Define on FreeBSD to work around an issue when reading from a PTY.]) ;; esac @@ -5447,13 +5542,13 @@ esac case $opsys in gnu-* | solaris ) dnl FIXME Can't we test if this exists (eg /proc/$$)? - AC_DEFINE(HAVE_PROCFS, 1, [Define if you have the /proc filesystem.]) + AC_DEFINE([HAVE_PROCFS], [1], [Define if you have the /proc filesystem.]) ;; esac case $opsys in darwin | dragonfly | freebsd | netbsd | openbsd ) - AC_DEFINE(DONT_REOPEN_PTY, 1, [Define if process.c does not need to + AC_DEFINE([DONT_REOPEN_PTY], [1], [Define if process.c does not need to close a pty to make it a controlling terminal (it is already a controlling terminal of the subprocess, because we did ioctl TIOCSCTTY).]) ;; @@ -5466,7 +5561,7 @@ case $opsys in esac dnl Used in sound.c -AC_DEFINE_UNQUOTED(DEFAULT_SOUND_DEVICE, "$sound_device", +AC_DEFINE_UNQUOTED([DEFAULT_SOUND_DEVICE], ["$sound_device"], [Name of the default sound device.]) @@ -5493,7 +5588,7 @@ dnl to read the input and send it to the true Emacs process dnl through a pipe. case $opsys in darwin | gnu-linux | gnu-kfreebsd) - AC_DEFINE(INTERRUPT_INPUT, 1, [Define to read input using SIGIO.]) + AC_DEFINE([INTERRUPT_INPUT], [1], [Define to read input using SIGIO.]) ;; esac @@ -5505,73 +5600,78 @@ dnl NARROWPROTO, we will see the wrong function prototypes for X functions dnl taking float or double parameters. case $opsys in cygwin|gnu|gnu-linux|gnu-kfreebsd|freebsd|netbsd|openbsd) - AC_DEFINE(NARROWPROTO, 1, [Define if system's imake configuration + AC_DEFINE([NARROWPROTO], [1], [Define if system's imake configuration file defines 'NeedWidePrototypes' as 'NO'.]) ;; esac dnl Used in process.c, this must be a loop, even if it only runs once. -AH_TEMPLATE(PTY_ITERATION, [How to iterate over PTYs.]) +AH_TEMPLATE([PTY_ITERATION], [How to iterate over PTYs.]) dnl Only used if !PTY_ITERATION. Iterate from FIRST_PTY_LETTER to z, dnl trying suffixes 0-16. -AH_TEMPLATE(FIRST_PTY_LETTER, [Letter to use in finding device name of +AH_TEMPLATE([FIRST_PTY_LETTER], [Letter to use in finding device name of first PTY, if PTYs are supported.]) -AH_TEMPLATE(PTY_OPEN, [How to open a PTY, if non-standard.]) -AH_TEMPLATE(PTY_NAME_SPRINTF, [How to get the device name of the control +AH_TEMPLATE([PTY_OPEN], [How to open a PTY, if non-standard.]) +AH_TEMPLATE([PTY_NAME_SPRINTF], [How to get the device name of the control end of a PTY, if non-standard.]) -AH_TEMPLATE(PTY_TTY_NAME_SPRINTF, [How to get device name of the tty +AH_TEMPLATE([PTY_TTY_NAME_SPRINTF], [How to get device name of the tty end of a PTY, if non-standard.]) case $opsys in aix4-2 ) - AC_DEFINE(PTY_ITERATION, [int c; for (c = 0; !c ; c++)]) + AC_DEFINE([PTY_ITERATION], [int c; for (c = 0; !c ; c++)]) dnl You allocate a pty by opening /dev/ptc to get the master side. dnl To get the name of the slave side, you just ttyname() the master side. - AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptc");]) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, [strcpy (pty_name, ttyname (fd));]) + AC_DEFINE([PTY_NAME_SPRINTF], [strcpy (pty_name, "/dev/ptc");]) + AC_DEFINE([PTY_TTY_NAME_SPRINTF], [strcpy (pty_name, ttyname (fd));]) ;; cygwin ) - AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)]) + AC_DEFINE([PTY_ITERATION], [int i; for (i = 0; i < 1; i++)]) dnl multi-line AC_DEFINEs are hard. :( - AC_DEFINE(PTY_OPEN, [ do { int dummy; sigset_t blocked, procmask; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, &procmask); if (-1 == openpty (&fd, &dummy, pty_name, 0, 0)) fd = -1; pthread_sigmask (SIG_SETMASK, &procmask, 0); if (fd >= 0) emacs_close (dummy); } while (false)]) - AC_DEFINE(PTY_NAME_SPRINTF, []) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, []) + AC_DEFINE([PTY_OPEN], + [ do { int dummy; sigset_t blocked, procmask; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, &procmask); if (-1 == openpty (&fd, &dummy, pty_name, 0, 0)) fd = -1; pthread_sigmask (SIG_SETMASK, &procmask, 0); if (fd >= 0) emacs_close (dummy); } while (false)]) + AC_DEFINE([PTY_NAME_SPRINTF], []) + AC_DEFINE([PTY_TTY_NAME_SPRINTF], []) ;; gnu | qnxnto ) - AC_DEFINE(FIRST_PTY_LETTER, ['p']) + AC_DEFINE([FIRST_PTY_LETTER], ['p']) ;; gnu-linux | gnu-kfreebsd | dragonfly | freebsd | openbsd | netbsd | darwin | nacl ) dnl if HAVE_GRANTPT if test "x$ac_cv_func_grantpt" = xyes; then - AC_DEFINE(UNIX98_PTYS, 1, [Define if the system has Unix98 PTYs.]) - AC_DEFINE(PTY_ITERATION, [int i; for (i = 0; i < 1; i++)]) + AC_DEFINE([UNIX98_PTYS], [1], [Define if the system has Unix98 PTYs.]) + AC_DEFINE([PTY_ITERATION], [int i; for (i = 0; i < 1; i++)]) dnl Note that grantpt and unlockpt may fork. We must block SIGCHLD dnl to prevent sigchld_handler from intercepting the child's death. - AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptyname = 0; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); if (grantpt (fd) != -1 && unlockpt (fd) != -1) ptyname = ptsname(fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (!ptyname) { emacs_close (fd); return -1; } snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }]) + AC_DEFINE([PTY_TTY_NAME_SPRINTF], + [{ char *ptyname = 0; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); if (grantpt (fd) != -1 && unlockpt (fd) != -1) ptyname = ptsname(fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (!ptyname) { emacs_close (fd); return -1; } snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }]) dnl if HAVE_POSIX_OPENPT if test "x$ac_cv_func_posix_openpt" = xyes; then - AC_DEFINE(PTY_OPEN, [do { fd = posix_openpt (O_RDWR | O_CLOEXEC | O_NOCTTY); if (fd < 0 && errno == EINVAL) fd = posix_openpt (O_RDWR | O_NOCTTY); } while (false)]) - AC_DEFINE(PTY_NAME_SPRINTF, []) + AC_DEFINE([PTY_OPEN], + [do { fd = posix_openpt (O_RDWR | O_CLOEXEC | O_NOCTTY); if (fd < 0 && errno == EINVAL) fd = posix_openpt (O_RDWR | O_NOCTTY); } while (false)]) + AC_DEFINE([PTY_NAME_SPRINTF], []) dnl if HAVE_GETPT elif test "x$ac_cv_func_getpt" = xyes; then - AC_DEFINE(PTY_OPEN, [fd = getpt ()]) - AC_DEFINE(PTY_NAME_SPRINTF, []) + AC_DEFINE([PTY_OPEN], [fd = getpt ()]) + AC_DEFINE([PTY_NAME_SPRINTF], []) else - AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptmx");]) + AC_DEFINE([PTY_NAME_SPRINTF], [strcpy (pty_name, "/dev/ptmx");]) fi else - AC_DEFINE(FIRST_PTY_LETTER, ['p']) + AC_DEFINE([FIRST_PTY_LETTER], ['p']) fi ;; hpux*) - AC_DEFINE(FIRST_PTY_LETTER, ['p']) - AC_DEFINE(PTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/ptym/pty%c%x", c, i);]) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, [sprintf (pty_name, "/dev/pty/tty%c%x", c, i);]) + AC_DEFINE([FIRST_PTY_LETTER], ['p']) + AC_DEFINE([PTY_NAME_SPRINTF], + [sprintf (pty_name, "/dev/ptym/pty%c%x", c, i);]) + AC_DEFINE([PTY_TTY_NAME_SPRINTF], + [sprintf (pty_name, "/dev/pty/tty%c%x", c, i);]) ;; solaris ) @@ -5579,22 +5679,25 @@ case $opsys in dnl O_CLOEXEC when opening the pty, and keep the SIGCHLD handler dnl from intercepting that death. If any child but grantpt's should die dnl within, it should be caught after sigrelse(2). - AC_DEFINE(PTY_OPEN, [fd = open (pty_name, O_RDWR | O_NONBLOCK)]) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }]) + AC_DEFINE([PTY_OPEN], [fd = open (pty_name, O_RDWR | O_NONBLOCK)]) + AC_DEFINE([PTY_TTY_NAME_SPRINTF], + [{ char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1 || unlockpt (fd) == -1 || !(ptyname = ptsname (fd))) { emacs_close (fd); return -1; } snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }]) ;; unixware ) dnl Comments are as per solaris. - AC_DEFINE(PTY_OPEN, [fd = open (pty_name, O_RDWR | O_NONBLOCK)]) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1) fatal("could not grant slave pty"); if (unlockpt(fd) == -1) fatal("could not unlock slave pty"); if (!(ptyname = ptsname(fd))) fatal ("could not enable slave pty"); snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }]) + AC_DEFINE([PTY_OPEN], [fd = open (pty_name, O_RDWR | O_NONBLOCK)]) + AC_DEFINE([PTY_TTY_NAME_SPRINTF], + [{ char *ptsname (int), *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1) fatal("could not grant slave pty"); if (unlockpt(fd) == -1) fatal("could not unlock slave pty"); if (!(ptyname = ptsname(fd))) fatal ("could not enable slave pty"); snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }]) ;; haiku*) - AC_DEFINE(FIRST_PTY_LETTER, ['s']) - AC_DEFINE(PTY_NAME_SPRINTF, []) + AC_DEFINE([FIRST_PTY_LETTER], ['s']) + AC_DEFINE([PTY_NAME_SPRINTF], []) dnl on Haiku pty names aren't distinctive, thus the use of posix_openpt - AC_DEFINE(PTY_OPEN, [fd = posix_openpt (O_RDWR | O_NONBLOCK)]) - AC_DEFINE(PTY_TTY_NAME_SPRINTF, [{ char *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1) fatal("could not grant slave pty"); if (unlockpt(fd) == -1) fatal("could not unlock slave pty"); if (!(ptyname = ptsname(fd))) fatal ("could not enable slave pty"); snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }]) + AC_DEFINE([PTY_OPEN], [fd = posix_openpt (O_RDWR | O_NONBLOCK)]) + AC_DEFINE([PTY_TTY_NAME_SPRINTF], + [{ char *ptyname; int grantpt_result; sigset_t blocked; sigemptyset (&blocked); sigaddset (&blocked, SIGCHLD); pthread_sigmask (SIG_BLOCK, &blocked, 0); grantpt_result = grantpt (fd); pthread_sigmask (SIG_UNBLOCK, &blocked, 0); if (grantpt_result == -1) fatal("could not grant slave pty"); if (unlockpt(fd) == -1) fatal("could not unlock slave pty"); if (!(ptyname = ptsname(fd))) fatal ("could not enable slave pty"); snprintf (pty_name, PTY_NAME_SIZE, "%s", ptyname); }]) ;; esac @@ -5603,21 +5706,22 @@ case $opsys in solaris | unixware ) dnl This change means that we don't loop through allocate_pty too dnl many times in the (rare) event of a failure. - AC_DEFINE(FIRST_PTY_LETTER, ['z']) - AC_DEFINE(PTY_NAME_SPRINTF, [strcpy (pty_name, "/dev/ptmx");]) + AC_DEFINE([FIRST_PTY_LETTER], ['z']) + AC_DEFINE([PTY_NAME_SPRINTF], [strcpy (pty_name, "/dev/ptmx");]) dnl Push various streams modules onto a PTY channel. Used in process.c. - AC_DEFINE(SETUP_SLAVE_PTY, [if (ioctl (std_in, I_PUSH, "ptem") == -1) fatal ("ioctl I_PUSH ptem"); if (ioctl (std_in, I_PUSH, "ldterm") == -1) fatal ("ioctl I_PUSH ldterm"); if (ioctl (std_in, I_PUSH, "ttcompat") == -1) fatal ("ioctl I_PUSH ttcompat");], [How to set up a slave PTY, if needed.]) + AC_DEFINE([SETUP_SLAVE_PTY], + [if (ioctl (std_in, I_PUSH, "ptem") == -1) fatal ("ioctl I_PUSH ptem"); if (ioctl (std_in, I_PUSH, "ldterm") == -1) fatal ("ioctl I_PUSH ldterm"); if (ioctl (std_in, I_PUSH, "ttcompat") == -1) fatal ("ioctl I_PUSH ttcompat");], [How to set up a slave PTY, if needed.]) ;; esac -AH_TEMPLATE(SIGNALS_VIA_CHARACTERS, [Make process_send_signal work by +AH_TEMPLATE([SIGNALS_VIA_CHARACTERS], [Make process_send_signal work by "typing" a signal character on the pty.]) case $opsys in dnl Perry Smith says this is correct for AIX. aix4-2 | cygwin | gnu | dragonfly | freebsd | netbsd | openbsd | darwin ) - AC_DEFINE(SIGNALS_VIA_CHARACTERS, 1) + AC_DEFINE([SIGNALS_VIA_CHARACTERS], [1]) ;; dnl 21 Jun 06: Eric Hanchrow says this works. @@ -5630,35 +5734,41 @@ case $opsys in #if LINUX_VERSION_CODE < 0x20400 # error "Linux version too old" #endif - ]], [[]])], emacs_cv_signals_via_chars=yes, emacs_cv_signals_via_chars=no)]) + ]], [[]])], + [emacs_cv_signals_via_chars=yes], + [emacs_cv_signals_via_chars=no])]) - test "$emacs_cv_signals_via_chars" = yes && AC_DEFINE(SIGNALS_VIA_CHARACTERS, 1) + test "$emacs_cv_signals_via_chars" = yes && + AC_DEFINE([SIGNALS_VIA_CHARACTERS], [1]) ;; esac -AH_TEMPLATE(TAB3, [Undocumented.]) +AH_TEMPLATE([TAB3], [Undocumented.]) case $opsys in - darwin) AC_DEFINE(TAB3, OXTABS) ;; + darwin) AC_DEFINE([TAB3], [OXTABS]) ;; gnu | dragonfly | freebsd | netbsd | openbsd ) - AC_DEFINE(TABDLY, OXTABS, [Undocumented.]) - AC_DEFINE(TAB3, OXTABS) + AC_DEFINE([TABDLY], [OXTABS], [Undocumented.]) + AC_DEFINE([TAB3], [OXTABS]) ;; gnu-linux | gnu-kfreebsd ) - AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ + AC_PREPROC_IFELSE( + [AC_LANG_PROGRAM( + [[ #ifndef __ia64__ # error "not ia64" #endif - ]], [[]])], AC_DEFINE(GC_MARK_SECONDARY_STACK(), + ]], [[]])], + [AC_DEFINE([GC_MARK_SECONDARY_STACK()], [do { extern void *__libc_ia64_register_backing_store_base; __builtin_ia64_flushrs (); mark_memory (__libc_ia64_register_backing_store_base, __builtin_ia64_bsp ());} while (false)], - [Mark a secondary stack, like the register stack on the ia64.]), []) + [Mark a secondary stack, like the register stack on the ia64.])], []) ;; hpux*) - AC_DEFINE(RUN_TIME_REMAP, 1, [Define if emacs.c needs to call + AC_DEFINE([RUN_TIME_REMAP], [1], [Define if emacs.c needs to call run_time_remap; for HPUX.]) ;; esac @@ -5666,7 +5776,7 @@ esac dnl This won't be used automatically yet. We also need to know, at least, dnl that the stack is continuous. -AH_TEMPLATE(GC_SETJMP_WORKS, [Define if setjmp is known to save all +AH_TEMPLATE([GC_SETJMP_WORKS], [Define if setjmp is known to save all registers relevant for conservative garbage collection in the jmp_buf.]) @@ -5686,18 +5796,18 @@ case $opsys in #else # error "setjmp not known to work on this arch" #endif - ]], [[]])], AC_DEFINE(GC_SETJMP_WORKS, 1)) + ]], [[]])], [AC_DEFINE([GC_SETJMP_WORKS], [1])]) ;; esac if test x$GCC = xyes; then dnl GC_SETJMP_WORKS is nearly always appropriate for GCC. - AC_DEFINE(GC_SETJMP_WORKS, 1) + AC_DEFINE([GC_SETJMP_WORKS], [1]) else case $opsys in aix* | dragonfly | freebsd | netbsd | openbsd | solaris ) - AC_DEFINE(GC_SETJMP_WORKS, 1) + AC_DEFINE([GC_SETJMP_WORKS], [1]) ;; esac fi dnl GCC? @@ -5717,7 +5827,7 @@ AC_CACHE_CHECK([for _setjmp], [emacs_cv_func__setjmp], [emacs_cv_func__setjmp=yes], [emacs_cv_func__setjmp=no])]) if test $emacs_cv_func__setjmp = yes; then - AC_DEFINE([HAVE__SETJMP], 1, [Define to 1 if _setjmp and _longjmp work.]) + AC_DEFINE([HAVE__SETJMP], [1], [Define to 1 if _setjmp and _longjmp work.]) fi # We need to preserve signal mask to handle C stack overflows. @@ -5732,13 +5842,13 @@ AC_CACHE_CHECK([for sigsetjmp], [emacs_cv_func_sigsetjmp], [emacs_cv_func_sigsetjmp=yes], [emacs_cv_func_sigsetjmp=no])]) if test $emacs_cv_func_sigsetjmp = yes; then - AC_DEFINE([HAVE_SIGSETJMP], 1, + AC_DEFINE([HAVE_SIGSETJMP], [1], [Define to 1 if sigsetjmp and siglongjmp work.]) fi case $emacs_cv_func_sigsetjmp,$emacs_cv_alternate_stack,$opsys in yes,yes,* | *,*,mingw32) - AC_DEFINE([HAVE_STACK_OVERFLOW_HANDLING], 1, + AC_DEFINE([HAVE_STACK_OVERFLOW_HANDLING], [1], [Define to 1 if C stack overflow can be handled in some cases.]);; esac @@ -5747,7 +5857,7 @@ case $opsys in dnl TIOCGPGRP is broken in SysVr4, so we can't send signals to PTY dnl subprocesses the usual way. But TIOCSIGNAL does work for PTYs, dnl and this is all we need. - AC_DEFINE(TIOCSIGSEND, TIOCSIGNAL, [Some platforms redefine this.]) + AC_DEFINE([TIOCSIGSEND], [TIOCSIGNAL], [Some platforms redefine this.]) ;; esac @@ -5755,7 +5865,7 @@ esac case $opsys in hpux* | solaris ) dnl Used in xfaces.c. - AC_DEFINE(XOS_NEEDS_TIME_H, 1, [Compensate for a bug in Xos.h on + AC_DEFINE([XOS_NEEDS_TIME_H], [1], [Compensate for a bug in Xos.h on some systems, where it requires time.h.]) ;; esac @@ -5763,64 +5873,67 @@ esac dnl Define symbols to identify the version of Unix this is. dnl Define all the symbols that apply correctly. -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.]) -AH_TEMPLATE(USG5_4, [Define if the system is compatible with System V Release 4.]) +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.]) +AH_TEMPLATE([USG5_4], + [Define if the system is compatible with System V Release 4.]) case $opsys in aix4-2) - AC_DEFINE(USG, []) + AC_DEFINE([USG], []) dnl This symbol should be defined on AIX Version 3 ??????? AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[ #ifndef _AIX # error "_AIX not defined" #endif - ]], [[]])], [], AC_DEFINE(_AIX, [], [Define if the system is AIX.])) + ]], [[]])], [], [AC_DEFINE([_AIX], [], [Define if the system is AIX.])]) ;; cygwin) - AC_DEFINE(CYGWIN, 1, [Define if the system is Cygwin.]) + AC_DEFINE([CYGWIN], [1], [Define if the system is Cygwin.]) ;; darwin) dnl Not __APPLE__, as this may not be defined on non-macOS Darwin. dnl Not DARWIN, because Panther and lower CoreFoundation.h use DARWIN to dnl distinguish macOS from pure Darwin. - AC_DEFINE(DARWIN_OS, [], [Define if the system is Darwin.]) + AC_DEFINE([DARWIN_OS], [], [Define if the system is Darwin.]) ;; gnu-linux | gnu-kfreebsd ) - AC_DEFINE(USG, []) - AC_DEFINE(GNU_LINUX, [], [Define if ths system is compatible with GNU/Linux.]) + AC_DEFINE([USG], []) + AC_DEFINE([GNU_LINUX], [], + [Define if ths system is compatible with GNU/Linux.]) ;; hpux*) - AC_DEFINE(USG, []) - AC_DEFINE(HPUX, [], [Define if the system is HPUX.]) + AC_DEFINE([USG], []) + AC_DEFINE([HPUX], [], [Define if the system is HPUX.]) ;; mingw32) - AC_DEFINE(DOS_NT, []) - AC_DEFINE(WINDOWSNT, 1, [Define if compiling for native MS Windows.]) + AC_DEFINE([DOS_NT], []) + AC_DEFINE([WINDOWSNT], [1], [Define if compiling for native MS Windows.]) if test "x$ac_enable_checking" != "x" ; then - AC_DEFINE(EMACSDEBUG, 1, [Define to 1 to enable w32 debug facilities.]) + AC_DEFINE([EMACSDEBUG], [1], + [Define to 1 to enable w32 debug facilities.]) fi ;; solaris) - AC_DEFINE(USG, []) - AC_DEFINE(USG5_4, []) - AC_DEFINE(SOLARIS2, [], [Define if the system is Solaris.]) + AC_DEFINE([USG], []) + AC_DEFINE([USG5_4], []) + AC_DEFINE([SOLARIS2], [], [Define if the system is Solaris.]) ;; unixware) - AC_DEFINE(USG, []) - AC_DEFINE(USG5_4, []) + AC_DEFINE([USG], []) + AC_DEFINE([USG5_4], []) ;; haiku) - AC_DEFINE(HAIKU, [], [Define if the system is Haiku.]) + AC_DEFINE([HAIKU], [], [Define if the system is Haiku.]) ;; esac @@ -5901,13 +6014,13 @@ case $opsys in hpux11) dnl It works to open the pty's tty in the parent (Emacs), then dnl close and reopen it in the child. - AC_DEFINE(USG_SUBTTY_WORKS, 1, [Define for USG systems where it + AC_DEFINE([USG_SUBTTY_WORKS], [1], [Define for USG systems where it works to open a pty's tty in the parent process, then close and reopen it in the child.]) ;; solaris) - AC_DEFINE(_STRUCTURED_PROC, 1, [Needed for system_process_attributes + AC_DEFINE([_STRUCTURED_PROC], [1], [Needed for system_process_attributes on Solaris.]) ;; esac @@ -5930,72 +6043,72 @@ fi version=$PACKAGE_VERSION copyright="Copyright (C) 2022 Free Software Foundation, Inc." -AC_DEFINE_UNQUOTED(COPYRIGHT, ["$copyright"], +AC_DEFINE_UNQUOTED([COPYRIGHT], ["$copyright"], [Short copyright string for this version of Emacs.]) -AC_SUBST(copyright) +AC_SUBST([copyright]) ### Specify what sort of things we'll be editing into Makefile and config.h. ### Use configuration here uncanonicalized to avoid exceeding size limits. -AC_SUBST(version) -AC_SUBST(configuration) +AC_SUBST([version]) +AC_SUBST([configuration]) ## Unused? -AC_SUBST(canonical) -AC_SUBST(srcdir) -AC_SUBST(prefix) -AC_SUBST(exec_prefix) -AC_SUBST(bindir) -AC_SUBST(datadir) -AC_SUBST(gsettingsschemadir) -AC_SUBST(sharedstatedir) -AC_SUBST(libexecdir) -AC_SUBST(mandir) -AC_SUBST(infodir) -AC_SUBST(lispdirrel) -AC_SUBST(lispdir) -AC_SUBST(standardlisppath) -AC_SUBST(locallisppath) -AC_SUBST(lisppath) -AC_SUBST(x_default_search_path) -AC_SUBST(etcdir) -AC_SUBST(archlibdir) -AC_SUBST(etcdocdir) -AC_SUBST(bitmapdir) -AC_SUBST(gamedir) -AC_SUBST(gameuser) -AC_SUBST(gamegroup) +AC_SUBST([canonical]) +AC_SUBST([srcdir]) +AC_SUBST([prefix]) +AC_SUBST([exec_prefix]) +AC_SUBST([bindir]) +AC_SUBST([datadir]) +AC_SUBST([gsettingsschemadir]) +AC_SUBST([sharedstatedir]) +AC_SUBST([libexecdir]) +AC_SUBST([mandir]) +AC_SUBST([infodir]) +AC_SUBST([lispdirrel]) +AC_SUBST([lispdir]) +AC_SUBST([standardlisppath]) +AC_SUBST([locallisppath]) +AC_SUBST([lisppath]) +AC_SUBST([x_default_search_path]) +AC_SUBST([etcdir]) +AC_SUBST([archlibdir]) +AC_SUBST([etcdocdir]) +AC_SUBST([bitmapdir]) +AC_SUBST([gamedir]) +AC_SUBST([gameuser]) +AC_SUBST([gamegroup]) ## FIXME? Nothing uses @LD_SWITCH_X_SITE@. ## src/Makefile.in did add LD_SWITCH_X_SITE (as a cpp define) to the ## end of LIBX_BASE, but nothing ever set it. -AC_SUBST(LD_SWITCH_X_SITE) -AC_SUBST(C_SWITCH_X_SITE) -AC_SUBST(GNUSTEP_CFLAGS) -AC_SUBST(CFLAGS) +AC_SUBST([LD_SWITCH_X_SITE]) +AC_SUBST([C_SWITCH_X_SITE]) +AC_SUBST([GNUSTEP_CFLAGS]) +AC_SUBST([CFLAGS]) ## Used in lwlib/Makefile.in. -AC_SUBST(X_TOOLKIT_TYPE) -AC_SUBST(ns_appdir) -AC_SUBST(ns_appbindir) -AC_SUBST(ns_applibexecdir) -AC_SUBST(ns_applibdir) -AC_SUBST(ns_appresdir) -AC_SUBST(ns_appsrc) -AC_SUBST(GNU_OBJC_CFLAGS) -AC_SUBST(OTHER_FILES) +AC_SUBST([X_TOOLKIT_TYPE]) +AC_SUBST([ns_appdir]) +AC_SUBST([ns_appbindir]) +AC_SUBST([ns_applibexecdir]) +AC_SUBST([ns_applibdir]) +AC_SUBST([ns_appresdir]) +AC_SUBST([ns_appsrc]) +AC_SUBST([GNU_OBJC_CFLAGS]) +AC_SUBST([OTHER_FILES]) if test -n "${term_header}"; then - AC_DEFINE_UNQUOTED(TERM_HEADER, "${term_header}", + AC_DEFINE_UNQUOTED([TERM_HEADER], ["${term_header}"], [Define to the header for the built-in window system.]) fi -AC_DEFINE_UNQUOTED(EMACS_CONFIGURATION, "${canonical}", +AC_DEFINE_UNQUOTED([EMACS_CONFIGURATION], ["${canonical}"], [Define to the canonical Emacs configuration name.]) -AC_DEFINE_UNQUOTED(EMACS_CONFIG_OPTIONS, "${emacs_config_options}", +AC_DEFINE_UNQUOTED([EMACS_CONFIG_OPTIONS], "${emacs_config_options}", [Define to the options passed to configure.]) XMENU_OBJ= XOBJ= FONT_OBJ= if test "${HAVE_X_WINDOWS}" = "yes" ; then - AC_DEFINE(HAVE_X_WINDOWS, 1, + AC_DEFINE([HAVE_X_WINDOWS], [1], [Define to 1 if you want to use the X window system.]) XMENU_OBJ=xmenu.o XOBJ="xterm.o xfns.o xselect.o xrdb.o xsmfns.o xsettings.o" @@ -6022,20 +6135,20 @@ fi if test "${HAVE_HARFBUZZ}" = "yes" ; then FONT_OBJ="$FONT_OBJ hbfont.o" fi -AC_SUBST(FONT_OBJ) -AC_SUBST(XMENU_OBJ) -AC_SUBST(XOBJ) -AC_SUBST(FONT_OBJ) +AC_SUBST([FONT_OBJ]) +AC_SUBST([XMENU_OBJ]) +AC_SUBST([XOBJ]) +AC_SUBST([FONT_OBJ]) WIDGET_OBJ= MOTIF_LIBW= if test "${USE_X_TOOLKIT}" != "none" ; then WIDGET_OBJ=widget.o - AC_DEFINE(USE_X_TOOLKIT, 1, [Define to 1 if using an X toolkit.]) + AC_DEFINE([USE_X_TOOLKIT], [1], [Define to 1 if using an X toolkit.]) if test "${USE_X_TOOLKIT}" = "LUCID"; then - AC_DEFINE(USE_LUCID, 1, [Define to 1 if using the Lucid X toolkit.]) + AC_DEFINE([USE_LUCID], [1], [Define to 1 if using the Lucid X toolkit.]) elif test "${USE_X_TOOLKIT}" = "MOTIF"; then - AC_DEFINE(USE_MOTIF, 1, [Define to 1 if using the Motif X toolkit.]) + AC_DEFINE([USE_MOTIF], [1], [Define to 1 if using the Motif X toolkit.]) MOTIF_LIBW=-lXm case "$opsys" in gnu-linux) @@ -6057,7 +6170,7 @@ if test "${USE_X_TOOLKIT}" != "none" ; then MOTIF_LIBW="$MOTIF_LIBW $LIBXP" fi fi -AC_SUBST(WIDGET_OBJ) +AC_SUBST([WIDGET_OBJ]) TOOLKIT_LIBW= case "$USE_X_TOOLKIT" in @@ -6068,7 +6181,7 @@ esac if test "$HAVE_XWIDGETS" = "yes"; then TOOLKIT_LIBW="$TOOLKIT_LIBW -lXcomposite" fi -AC_SUBST(TOOLKIT_LIBW) +AC_SUBST([TOOLKIT_LIBW]) if test "${opsys}" != "mingw32"; then if test "$USE_X_TOOLKIT" = "none"; then @@ -6077,16 +6190,16 @@ if test "${opsys}" != "mingw32"; then LIBXT_OTHER="\$(LIBXMU) -lXt \$(LIBXTR6) -lXext" fi fi -AC_SUBST(LIBXT_OTHER) +AC_SUBST([LIBXT_OTHER]) if test "${HAVE_X11}" = "yes" ; then - AC_DEFINE(HAVE_X11, 1, + AC_DEFINE([HAVE_X11], [1], [Define to 1 if you want to use version 11 of X windows.]) LIBX_OTHER="\$(LIBXT) \$(LIBX_EXTRA)" else LIBX_OTHER= fi -AC_SUBST(LIBX_OTHER) +AC_SUBST([LIBX_OTHER]) HAVE_OLDXMENU=no if test "$HAVE_GTK" = yes || test "$HAVE_X11" != yes; then @@ -6099,7 +6212,7 @@ else LIBXMENU='$(lwlibdir)/liblw.a' AUTODEPEND_PARENTS="$AUTODEPEND_PARENTS lwlib" fi -AC_SUBST(LIBXMENU) +AC_SUBST([LIBXMENU]) AC_CACHE_CHECK([for struct alignment], [emacs_cv_struct_alignment], @@ -6112,7 +6225,7 @@ AC_CACHE_CHECK([for struct alignment], [emacs_cv_struct_alignment=yes], [emacs_cv_struct_alignment=no])]) if test "$emacs_cv_struct_alignment" = yes; then - AC_DEFINE([HAVE_STRUCT_ATTRIBUTE_ALIGNED], 1, + AC_DEFINE([HAVE_STRUCT_ATTRIBUTE_ALIGNED], [1], [Define to 1 if 'struct __attribute__ ((aligned (N)))' aligns the structure to an N-byte boundary.]) fi @@ -6126,24 +6239,24 @@ AC_CACHE_CHECK([for statement expressions], [emacs_cv_statement_expressions=yes], [emacs_cv_statement_expressions=no])]) if test "$emacs_cv_statement_expressions" = yes; then - AC_DEFINE([HAVE_STATEMENT_EXPRESSIONS], 1, + AC_DEFINE([HAVE_STATEMENT_EXPRESSIONS], [1], [Define to 1 if statement expressions work.]) fi if test "${GNU_MALLOC}" = "yes" ; then - AC_DEFINE(GNU_MALLOC, 1, + AC_DEFINE([GNU_MALLOC], [1], [Define to 1 if you want to use the GNU memory allocator.]) fi RALLOC_OBJ= if test "${REL_ALLOC}" = "yes" ; then - AC_DEFINE(REL_ALLOC, 1, + AC_DEFINE([REL_ALLOC], [1], [Define REL_ALLOC if you want to use the relocating allocator for buffer space.]) test "$system_malloc" != "yes" && RALLOC_OBJ=ralloc.o fi -AC_SUBST(RALLOC_OBJ) +AC_SUBST([RALLOC_OBJ]) if test "$opsys" = "cygwin"; then CYGWIN_OBJ="cygw32.o" @@ -6159,9 +6272,9 @@ else PRE_ALLOC_OBJ=lastfile.o POST_ALLOC_OBJ= fi -AC_SUBST(CYGWIN_OBJ) -AC_SUBST(PRE_ALLOC_OBJ) -AC_SUBST(POST_ALLOC_OBJ) +AC_SUBST([CYGWIN_OBJ]) +AC_SUBST([PRE_ALLOC_OBJ]) +AC_SUBST([POST_ALLOC_OBJ]) dnl Call this 'FORTIFY_SOUR' so that it sorts before the 'FORTIFY_SOURCE' dnl verbatim defined above. The tricky name is apropos, as this hack @@ -6209,7 +6322,7 @@ LIBS=$SAVE_LIBS # timer_getoverrun needs the same library as timer_settime OLD_LIBS=$LIBS LIBS="$LIB_TIMER_TIME $LIBS" -AC_CHECK_FUNCS(timer_getoverrun) +AC_CHECK_FUNCS([timer_getoverrun]) LIBS=$OLD_LIBS if test "${opsys}" = "mingw32"; then @@ -6323,16 +6436,17 @@ fi LD_SWITCH_SYSTEM_TEMACS="$LDFLAGS_NOCOMBRELOC $LD_SWITCH_SYSTEM_TEMACS" -AC_SUBST(LD_SWITCH_SYSTEM_TEMACS) +AC_SUBST([LD_SWITCH_SYSTEM_TEMACS]) ## Common for all window systems if test "$window_system" != "none"; then - AC_DEFINE(HAVE_WINDOW_SYSTEM, 1, [Define if you have a window system.]) - AC_DEFINE(POLL_FOR_INPUT, 1, [Define if you poll periodically to detect C-g.]) + AC_DEFINE([HAVE_WINDOW_SYSTEM], [1], [Define if you have a window system.]) + AC_DEFINE([POLL_FOR_INPUT], [1], + [Define if you poll periodically to detect C-g.]) WINDOW_SYSTEM_OBJ="fontset.o fringe.o image.o" fi -AC_SUBST(WINDOW_SYSTEM_OBJ) +AC_SUBST([WINDOW_SYSTEM_OBJ]) AH_TOP([/* GNU Emacs site configuration template file. @@ -6449,7 +6563,7 @@ for opt in ACL BE_APP CAIRO DBUS FREETYPE GCONF GIF GLIB GMP GNUTLS GPM GSETTING AS_VAR_APPEND([emacs_config_features], ["$optsep$opt"]) optsep=' ' done -AC_DEFINE_UNQUOTED(EMACS_CONFIG_FEATURES, "${emacs_config_features}", +AC_DEFINE_UNQUOTED([EMACS_CONFIG_FEATURES], ["${emacs_config_features}"], [Summary of some of the main features enabled by configure.]) AS_ECHO([" Does Emacs use -lXaw3d? ${HAVE_XAW3D} @@ -6527,7 +6641,7 @@ case $opsys,$emacs_uname_r in echo ;; cygwin,3.0.[[0-7]]'('* | cygwin,3.1.[[0-2]]'('*) - AC_DEFINE([HAVE_CYGWIN_O_PATH_BUG], 1, + AC_DEFINE([HAVE_CYGWIN_O_PATH_BUG], [1], [Define to 1 if opening a FIFO, socket, or symlink with O_PATH is buggy.]);; esac @@ -6549,7 +6663,7 @@ if test "$HAVE_NS" = "yes"; then nextstep/Cocoa/Emacs.base/Contents/Resources/English.lproj/InfoPlist.strings:nextstep/templates/InfoPlist.strings.in]) ns_check_file=Contents/Info.plist fi - AC_SUBST(ns_check_file) + AC_SUBST([ns_check_file]) fi AC_CONFIG_FILES([Makefile lib/gnulib.mk]) @@ -6590,10 +6704,10 @@ fi dnl -d admin SUBDIR_MAKEFILES_IN=`echo " ${SUBDIR_MAKEFILES}" | sed -e 's| | $(srcdir)/|g' -e 's|Makefile|Makefile.in|g'` -AC_SUBST(SUBDIR_MAKEFILES_IN) +AC_SUBST([SUBDIR_MAKEFILES_IN]) SMALL_JA_DIC=$with_small_ja_dic -AC_SUBST(SMALL_JA_DIC) +AC_SUBST([SMALL_JA_DIC]) dnl You might wonder (I did) why epaths.h is generated by running make, dnl rather than just letting configure generate it from epaths.in. diff --git a/etc/compilation.txt b/etc/compilation.txt index e286b5a77de..111b2a37dce 100644 --- a/etc/compilation.txt +++ b/etc/compilation.txt @@ -542,7 +542,7 @@ cf90-113 f90comp: ERROR NSE, File = Hoved.f90, Line = 16, Column = 3 * ShellCheck In autogen.sh line 38: -autoconf_min=`sed -n 's/^ *AC_PREREQ(\([0-9\.]*\)).*/\1/p' configure.ac` +autoconf_min=`sed -n 's/^ *AC_PREREQ(\[\([0-9\.]*\)]).*/\1/p' configure.ac` ^----------^ SC2034: autoconf_min appears unused. Verify use (or export if used externally). ^-- SC2006: Use $(...) notation instead of legacy backticked `...`.