summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorYuan Fu <casouri@gmail.com>2022-05-07 01:57:39 -0700
committerYuan Fu <casouri@gmail.com>2022-05-07 01:57:39 -0700
commit82d5e902af68695481b8809e511a7913ef9a75aa (patch)
treee6a366278590e8906a9282d04e48de2061b6fe3f /configure.ac
parent84847cad82e3b667c82f411627cd58d236f55e84 (diff)
parent293a97d61e1977440f96b7fc91f281a06250ea72 (diff)
downloademacs-82d5e902af68695481b8809e511a7913ef9a75aa.tar.gz
; Merge from master.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac113
1 files changed, 97 insertions, 16 deletions
diff --git a/configure.ac b/configure.ac
index 0c174c6a7b5..bf97dd017c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -491,7 +491,7 @@ OPTION_DEFAULT_ON([modules],[don't compile with dynamic modules support])
OPTION_DEFAULT_ON([threads],[don't compile with elisp threading support])
OPTION_DEFAULT_OFF([native-compilation],[compile with Emacs Lisp native compiler support])
OPTION_DEFAULT_OFF([cygwin32-native-compilation],[use native compilation on 32-bit Cygwin])
-OPTION_DEFAULT_OFF([xinput2],[use version 2 of the X Input Extension for input])
+OPTION_DEFAULT_ON([xinput2],[don't use version 2 of the X Input Extension for input])
AC_ARG_WITH([file-notification],[AS_HELP_STRING([--with-file-notification=LIB],
[use a file notification library (LIB one of: yes, inotify, kqueue, gfile, w32, no)])],
@@ -966,6 +966,17 @@ AC_DEFUN([gl_GCC_VERSION_IFELSE],
]
)
+# clang is unduly picky about some things.
+AC_CACHE_CHECK([whether the compiler is clang], [emacs_cv_clang],
+ [AC_COMPILE_IFELSE(
+ [AC_LANG_PROGRAM([[
+ #ifndef __clang__
+ error "not clang";
+ #endif
+ ]])],
+ [emacs_cv_clang=yes],
+ [emacs_cv_clang=no])])
+
AC_ARG_ENABLE([gcc-warnings],
[AS_HELP_STRING([--enable-gcc-warnings@<:@=TYPE@:>@],
[control generation of GCC warnings. The TYPE 'yes'
@@ -985,7 +996,11 @@ AC_ARG_ENABLE([gcc-warnings],
# just a release imported into Git for patch management.
gl_gcc_warnings=no
if test -e "$srcdir"/.git && test ! -f "$srcdir"/.tarball-version; then
- gl_GCC_VERSION_IFELSE([5], [3], [gl_gcc_warnings=warn-only])
+ # Clang typically identifies itself as GCC 4.2 or something similar
+ # even if it is recent enough to accept the warnings we enable.
+ AS_IF([test "$emacs_cv_clang" = yes],
+ [gl_gcc_warnings=warn-only],
+ [gl_GCC_VERSION_IFELSE([5], [3], [gl_gcc_warnings=warn-only])])
fi])
AC_ARG_ENABLE([check-lisp-object-type],
@@ -997,17 +1012,6 @@ if test "$enable_check_lisp_object_type" = yes; then
[Define to enable compile-time checks for the Lisp_Object data type.])
fi
-# clang is unduly picky about some things.
-AC_CACHE_CHECK([whether the compiler is clang], [emacs_cv_clang],
- [AC_COMPILE_IFELSE(
- [AC_LANG_PROGRAM([[
- #ifndef __clang__
- error "not clang";
- #endif
- ]])],
- [emacs_cv_clang=yes],
- [emacs_cv_clang=no])])
-
WERROR_CFLAGS=
# When compiling with GCC, prefer -isystem to -I when including system
# include files, to avoid generating useless diagnostics for the files.
@@ -1102,6 +1106,8 @@ AS_IF([test $gl_gcc_warnings = no],
if test "$emacs_cv_clang" = yes; then
gl_WARN_ADD([-Wno-missing-braces])
gl_WARN_ADD([-Wno-null-pointer-arithmetic])
+ gl_WARN_ADD([-Wno-implicit-const-int-float-conversion])
+ gl_WARN_ADD([-Wno-int-in-bool-context])
fi
# This causes too much noise in the MinGW build
@@ -2692,6 +2698,9 @@ if test "${with_webp}" != "no"; then
WEBP_MODULE="libwebp >= $WEBP_REQUIRED"
EMACS_CHECK_MODULES([WEBP], [$WEBP_MODULE])
+ if test "$HAVE_WEBP" = "yes"; then
+ WEBP_LIBS="-lwebp -lwebpdemux"
+ fi
AC_SUBST(WEBP_CFLAGS)
AC_SUBST(WEBP_LIBS)
fi
@@ -2791,7 +2800,11 @@ gtk3_pkg_errors=
if test "${opsys}" != "mingw32"; then
if test "${with_gtk3}" = "yes" || test "${with_gtk}" = "yes" || test "$USE_X_TOOLKIT" = "maybe"; then
GLIB_REQUIRED=2.37.5
- GTK_REQUIRED=3.10
+ if test "${window_system}" = "x11"; then
+ GTK_REQUIRED=3.10
+ else
+ GTK_REQUIRED=3.20
+ fi
GTK_MODULES="gtk+-3.0 >= $GTK_REQUIRED glib-2.0 >= $GLIB_REQUIRED"
dnl Checks for libraries.
@@ -2927,6 +2940,8 @@ fi
AC_SUBST(PGTK_OBJ)
AC_SUBST(PGTK_LIBS)
+AC_CHECK_FUNCS(malloc_trim)
+
dnl D-Bus has been tested under GNU/Linux only. Must be adapted for
dnl other platforms.
HAVE_DBUS=no
@@ -3379,6 +3394,8 @@ if test "${with_toolkit_scroll_bars}" != "no"; then
AC_DEFINE(USE_TOOLKIT_SCROLL_BARS)
USE_TOOLKIT_SCROLL_BARS=yes
fi
+elif test "${window_system}" != "x11" && "${window_system}" != "none"; then
+ AC_MSG_ERROR(Non-toolkit scroll bars are not implemented for your system)
fi
dnl See if XIM is available.
@@ -3769,6 +3786,14 @@ if test "${HAVE_X11}" = "yes"; then
[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)
+ if test "${HAVE_XCB_AUX}" = "yes"; then
+ 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"
+ fi
fi
fi
fi
@@ -3973,6 +3998,16 @@ MODULES_OBJ=
NEED_DYNLIB=no
MODULES_SUFFIX="${DYNAMIC_LIB_SUFFIX}"
MODULES_SECONDARY_SUFFIX="${DYNAMIC_LIB_SECONDARY_SUFFIX}"
+
+# pgtkterm.c uses dlsym
+if test $window_system = pgtk; then
+ case $opsys in
+ gnu|gnu-linux)
+ LIBMODULES="-ldl"
+ ;;
+ esac
+fi
+
if test "${with_modules}" != "no"; then
case $opsys in
gnu|gnu-linux)
@@ -4126,7 +4161,7 @@ if test "${with_native_compilation}" != "no"; then
MAC_CFLAGS="-I$(dirname $($BREW ls -v libgccjit | \
grep libgccjit.h))"
MAC_LIBS="-L$(dirname $($BREW ls -v libgccjit| \
- grep libgccjit.so\$))"
+ grep -E 'libgccjit\.(so|dylib)$'))"
fi
fi
@@ -4305,7 +4340,8 @@ if test "${opsys}" = "mingw32"; then
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"; then
+ || test "${HAVE_BE_APP}" = "yes" || test "$window_system" = "pgtk" \
+ && test "${with_gif}" != "no"; then
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.
@@ -4567,6 +4603,51 @@ fi
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)],
+ [],
+ [#include <X11/extensions/shape.h>
+ ])
+ 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)], [],
+ [#include <xcb/shape.h>])
+
+ 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.])
+ fi
+ fi
+ if test $HAVE_XSHAPE = yes; then
+ 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)
+
+### 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)],
+ [],
+ [#include <X11/extensions/Xcomposite.h>
+ ])
+ if test $HAVE_XCOMPOSITE = 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.])
+ fi
+fi
+AC_SUBST(XCOMPOSITE_CFLAGS)
+AC_SUBST(XCOMPOSITE_LIBS)
+
### Use libxml (-lxml2) if available
### mingw32 doesn't use -lxml2, since it loads the library dynamically.
HAVE_LIBXML2=no