chiark / gitweb /
core: Forgot to dereference pointer when checking for NULL
[elogind.git] / configure.ac
index 7794541964c4e9e215171c7d81fa84759f7c76ea..5e30af3d6b7e0d45bbd09ff0893046e0081ac82c 100644 (file)
@@ -60,10 +60,7 @@ AC_PROG_SED
 AC_PROG_GREP
 AC_PROG_AWK
 
-AC_PROG_CC
 AC_PROG_CC_C99
-AM_PROG_CC_C_O
-AC_PROG_GCC_TRADITIONAL
 
 AC_PATH_PROG([M4], [m4])
 AC_PATH_PROG([XSLTPROC], [xsltproc])
@@ -79,6 +76,8 @@ AC_PATH_PROG([KMOD], [kmod], [/usr/bin/kmod])
 
 AC_PATH_PROG([KEXEC], [kexec], [/usr/sbin/kexec])
 
+M4_DEFINES=
+
 # gtkdocize greps for '^GTK_DOC_CHECK', so it needs to be on its own line
 m4_ifdef([GTK_DOC_CHECK], [
 GTK_DOC_CHECK([1.18],[--flavour no-tmpl])],
@@ -130,6 +129,7 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
         -Winit-self \
         -Wdeclaration-after-statement \
         -Wfloat-equal \
+        -Wsuggest-attribute=noreturn \
         -Wmissing-prototypes \
         -Wstrict-prototypes \
         -Wredundant-decls \
@@ -146,6 +146,8 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
         -Wno-missing-field-initializers \
         -Wno-unused-result \
         -Werror=overflow \
+        -Wdate-time \
+        -Wnested-externs \
         -ffast-math \
         -fno-common \
         -fdiagnostics-show-option \
@@ -156,6 +158,10 @@ CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
         -fdata-sections \
         -fstack-protector \
         --param=ssp-buffer-size=4])
+AS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
+        [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
+               -flto])],
+        [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
 AC_SUBST([OUR_CFLAGS], "$with_cflags $address_sanitizer_cflags")
 
 AS_CASE([$CFLAGS], [*-O[[12345\ ]]*],
@@ -790,6 +796,24 @@ if test "x$enable_efi" != "xno"; then
 fi
 AM_CONDITIONAL(ENABLE_EFI, [test "x$have_efi" = "xyes"])
 
+# ------------------------------------------------------------------------------
+have_multi_seat_x=no
+AC_ARG_ENABLE(multi_seat_x, AS_HELP_STRING([--disable-multi-seat-x], [do not build multi-seat-x]))
+if test "x$enable_multi_seat_x" != "xno"; then
+        have_multi_seat_x=yes
+fi
+AM_CONDITIONAL(ENABLE_MULTI_SEAT_X, [test "$have_multi_seat_x" = "yes"])
+
+# ------------------------------------------------------------------------------
+have_kdbus=no
+AC_ARG_ENABLE(kdbus, AS_HELP_STRING([--enable-kdbus], [do connect to kdbus by default]))
+if test "x$enable_kdbus" == "xyes"; then
+        AC_DEFINE(ENABLE_KDBUS, 1, [Define if kdbus support is to be enabled])
+        have_kdbus=yes
+        M4_DEFINES="$M4_DEFINES -DENABLE_KDBUS"
+fi
+AM_CONDITIONAL(ENABLE_KDBUS, [test "$have_kdbus" = "yes"])
+
 # ------------------------------------------------------------------------------
 AC_ARG_WITH(rc-local-script-path-start,
         AS_HELP_STRING([--with-rc-local-script-path-start=PATH],
@@ -902,7 +926,6 @@ AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
 # Location of the init scripts as mandated by LSB
 SYSTEM_SYSVINIT_PATH=/etc/init.d
 SYSTEM_SYSVRCND_PATH=/etc/rc.d
-M4_DEFINES=
 
 AC_ARG_WITH([sysvinit-path],
         [AS_HELP_STRING([--with-sysvinit-path=PATH],
@@ -1074,6 +1097,8 @@ AC_MSG_RESULT([
         nss-myhostname:          ${have_myhostname}
         gudev:                   ${enable_gudev}
         gintrospection:          ${enable_introspection}
+        multi-seat-x:            ${have_multi_seat_x}
+        kdbus:                   ${have_kdbus}
         Python:                  ${have_python}
         Python Headers:          ${have_python_devel}
         man pages:               ${have_manpages}