OPTION_DEFAULT_ON([gif],[don't compile with GIF image support])
OPTION_DEFAULT_ON([png],[don't compile with PNG image support])
OPTION_DEFAULT_ON([rsvg],[don't compile with SVG image support])
+OPTION_DEFAULT_ON([libsystemd],[don't compile with libsystemd support])
OPTION_DEFAULT_OFF([cairo],[compile with Cairo drawing (experimental)])
OPTION_DEFAULT_ON([xml2],[don't compile with XML parsing support])
OPTION_DEFAULT_ON([imagemagick],[don't compile with ImageMagick image support])
esac
fi
+# gl_GCC_VERSION_IFELSE([major], [minor], [run-if-found], [run-if-not-found])
+# ---------------------------------------------------------------------------
+# If $CPP is gcc-MAJOR.MINOR or newer, then run RUN-IF-FOUND.
+# Otherwise, run RUN-IF-NOT-FOUND.
+AC_DEFUN([gl_GCC_VERSION_IFELSE],
+ [AC_PREPROC_IFELSE(
+ [AC_LANG_PROGRAM(
+ [[
+#if ($1) < __GNUC__ || (($1) == __GNUC__ && ($2) <= __GNUC_MINOR__)
+/* ok */
+#else
+# error "your version of gcc is older than $1.$2"
+#endif
+ ]]),
+ ], [$3], [$4])
+ ]
+)
+
AC_ARG_ENABLE([gcc-warnings],
- [AS_HELP_STRING([--enable-gcc-warnings],
- [turn on lots of GCC warnings/errors. This is intended for
- developers, and may generate false alarms when used
- with older or non-GNU development tools.])],
+ [AS_HELP_STRING([--enable-gcc-warnings@<:@=TYPE@:>@],
+ [control generation of GCC warnings. The TYPE 'yes'
+ means to fail if any warnings are issued; 'warn-only'
+ means issue warnings without failing (default for
+ developer builds); 'no' means disable warnings
+ (default for non-developer builds).])],
[case $enableval in
- yes|no) ;;
+ yes|no|warn-only) ;;
*) AC_MSG_ERROR([bad value $enableval for gcc-warnings option]) ;;
esac
gl_gcc_warnings=$enableval],
- [gl_gcc_warnings=no]
+ [# By default, use 'warn-only' if it looks like the invoker of 'configure'
+ # is a developer as opposed to a builder. This is most likely true
+ # if GCC is recent enough and there is a .git directory or file;
+ # however, if there is also a .tarball-version file it is probably
+ # 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])]
+ fi
)
# clang is unduly picky about some things.
# When compiling with GCC, prefer -isystem to -I when including system
# include files, to avoid generating useless diagnostics for the files.
-AS_IF([test "$gl_gcc_warnings" != yes],
+AS_IF([test $gl_gcc_warnings = no],
[
isystem='-I'
AS_IF([test "$emacs_cv_clang" = yes],
nw="$nw -Wwrite-strings"
;;
esac
- AS_IF([test -z "$nw"],
+ AS_IF([test $gl_gcc_warnings = yes],
[gl_WARN_ADD([-Werror], [WERROR_CFLAGS])])
AC_SUBST([WERROR_CFLAGS])
## $window_system is now set to the window system we will
## ultimately use.
-if test "$window_system" = none && test "$gl_gcc_warnings" = yes; then
- # Too many warnings for now.
- nw=
- nw="$nw -Wsuggest-attribute=noreturn"
- gl_MANYWARN_COMPLEMENT([WARN_CFLAGS], [$WARN_CFLAGS], [$nw])
-
- gl_WARN_ADD([-Wno-unused-variable])
- gl_WARN_ADD([-Wno-unused-but-set-variable])
- gl_WARN_ADD([-Wno-unused-but-set-parameter])
-fi
-
term_header=
HAVE_X_WINDOWS=no
HAVE_X11=no
AC_SUBST(LIBGNUTLS_LIBS)
AC_SUBST(LIBGNUTLS_CFLAGS)
+HAVE_LIBSYSTEMD=no
+if test "${with_libsystemd}" = "yes" ; then
+ dnl This code has been tested with libsystemd 222 and later.
+ dnl FIXME: Find the earliest version number for which Emacs should work,
+ dnl and change '222' to that number.
+ 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.])
+ fi
+fi
+
+AC_SUBST(LIBSYSTEMD_LIBS)
+AC_SUBST(LIBSYSTEMD_CFLAGS)
+
NOTIFY_OBJ=
NOTIFY_SUMMARY=no
MODULES_OBJ=
MODULES_SUFFIX=
if test "${with_modules}" != "no"; then
- if test "$opsys" = "gnu-linux"; then
- LIBMODULES="-ldl"
- MODULES_SUFFIX=".so"
- HAVE_MODULES=yes
- elif test "$opsys" = "cygwin"; then
- MODULES_SUFFIX=".dll"
- HAVE_MODULES=yes
- elif test "$opsys" = "darwin"; then
- MODULES_SUFFIX=".so"
- HAVE_MODULES=yes
- elif test "$opsys" = "mingw32"; then
- MODULES_SUFFIX=".dll"
- HAVE_MODULES=yes
- else
- # BSD system have dlopen in the libc
- AC_CHECK_FUNC(dlopen, [MODULES_SUFFIX=".so"]
- [HAVE_MODULES=yes], [])
- fi
+ case $opsys in
+ gnu|gnu-linux)
+ LIBMODULES="-ldl"
+ MODULES_SUFFIX=".so"
+ HAVE_MODULES=yes
+ ;;
+ cygwin|mingw32)
+ MODULES_SUFFIX=".dll"
+ HAVE_MODULES=yes
+ ;;
+ darwin)
+ MODULES_SUFFIX=".so"
+ HAVE_MODULES=yes
+ ;;
+ *)
+ # BSD systems have dlopen in libc.
+ AC_CHECK_FUNC([dlopen],
+ [MODULES_SUFFIX=".so"
+ HAVE_MODULES=yes])
+ ;;
+ esac
if test "${HAVE_MODULES}" = no; then
AC_MSG_ERROR([Dynamic modules are not supported on your system])
for opt in XAW3D XPM JPEG TIFF GIF PNG RSVG CAIRO IMAGEMAGICK SOUND GPM DBUS \
GCONF GSETTINGS NOTIFY ACL LIBSELINUX GNUTLS LIBXML2 FREETYPE M17N_FLT \
LIBOTF XFT ZLIB TOOLKIT_SCROLL_BARS X_TOOLKIT X11 NS MODULES \
- XWIDGETS; do
+ XWIDGETS LIBSYSTEMD; do
case $opt in
NOTIFY|ACL) eval val=\${${opt}_SUMMARY} ;;
Does Emacs use -lm17n-flt? ${HAVE_M17N_FLT}
Does Emacs use -lotf? ${HAVE_LIBOTF}
Does Emacs use -lxft? ${HAVE_XFT}
+ Does Emacs use -lsystemd? ${HAVE_LIBSYSTEMD}
Does Emacs directly use zlib? ${HAVE_ZLIB}
Does Emacs have dynamic modules support? ${HAVE_MODULES}
Does Emacs use toolkit scroll bars? ${USE_TOOLKIT_SCROLL_BARS}