chiark / gitweb /
Cleanup Makefile.am a bit more and disable -flto support.
[elogind.git] / configure.ac
index 8c5168b1296dcff7185b85e7d72e579a0875b9d5..8e3f7b3cd043d35919d7aaa03bf902d353cd22d4 100644 (file)
@@ -20,7 +20,7 @@
 AC_PREREQ([2.64])
 
 AC_INIT([elogind],
-        [223],
+        [226],
         [https://github.com/elogind/elogind/issues],
         [elogind],
         [https://github.com/elogind/elogind])
@@ -39,9 +39,14 @@ AM_SILENT_RULES([yes])
 AC_CANONICAL_HOST
 AC_DEFINE_UNQUOTED([CANONICAL_HOST], "$host", [Canonical host string.])
 
-AC_CHECK_TOOLS([AR], [gcc-ar ar], [:])
-AC_CHECK_TOOLS([NM], [gcc-nm nm], [:])
-AC_CHECK_TOOLS([RANLIB], [gcc-ranlib ranlib], [:])
+AC_PROG_CC_C99
+
+AX_COMPILER_VENDOR
+AS_IF([test "x$ax_cv_c_compiler_vendor" = "xgnu"], [
+      AC_CHECK_TOOLS([AR], [gcc-ar ar], [:])
+      AC_CHECK_TOOLS([NM], [gcc-nm nm], [:])
+      AC_CHECK_TOOLS([RANLIB], [gcc-ranlib ranlib], [:])
+])
 
 LT_PREREQ(2.2)
 LT_INIT([disable-static])
@@ -87,8 +92,6 @@ AC_PROG_SED
 AC_PROG_GREP
 AC_PROG_AWK
 
-AC_PROG_CC_C99
-
 AC_PATH_PROG([M4], [m4])
 AC_PATH_PROG([XSLTPROC], [xsltproc])
 
@@ -186,11 +189,11 @@ AS_CASE([$CC], [*clang*],
                -Wno-gnu-variable-sized-type-not-at-end \
         ])])
 
-AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
-        [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
-               -flto])],
-        [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
-AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
+dnl AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
+dnl         [CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\
+dnl                -flto])],
+dnl         [AC_MSG_RESULT([skipping -flto, optimization not enabled])])
+dnl AC_SUBST([OUR_CFLAGS], "$with_cflags $sanitizer_cflags")
 
 AS_CASE([$CFLAGS], [*-O[[12345sz\ ]]*],
         [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\
@@ -229,11 +232,11 @@ AC_CHECK_SIZEOF(rlim_t,,[
        #include <sys/resource.h>
 ])
 
-# ------------------------------------------------------------------------------
+ # ------------------------------------------------------------------------------
 # we use python to build the man page index
 have_python=no
 AC_ARG_WITH([python],
-        [AS_HELP_STRING([--without-python], [Disable building the man page index and systemd-python (default: test)])])
+        [AS_HELP_STRING([--without-python], [Disable building the man page index (default: test)])])
 
 have_lxml=no
 AS_IF([test "x$with_python" != "xno"], [
@@ -625,11 +628,13 @@ AC_ARG_WITH([bashcompletiondir],
         ] , [
                 with_bashcompletiondir=${datadir}/bash-completion/completions
         ])])
+AM_CONDITIONAL(ENABLE_BASH_COMPLETION, [test "$with_bashcompletiondir" != "no"])
 AX_NORMALIZE_PATH([with_bashcompletiondir])
 
 AC_ARG_WITH([zshcompletiondir],
         AS_HELP_STRING([--with-zshcompletiondir=DIR], [Zsh completions directory]),
         [], [with_zshcompletiondir=${datadir}/zsh/site-functions])
+AM_CONDITIONAL(ENABLE_ZSH_COMPLETION, [test "$with_zshcompletiondir" != "no"])
 AX_NORMALIZE_PATH([with_zshcompletiondir])
 
 AC_ARG_WITH([rootprefix],
@@ -757,7 +762,6 @@ AC_MSG_RESULT([
         includedir:              ${includedir}
         lib dir:                 ${libdir}
         rootlib dir:             ${with_rootlibdir}
-        Build Python:            ${PYTHON}
         PAM modules dir:         ${with_pamlibdir}
         PAM configuration dir:   ${with_pamconfdir}
         D-Bus policy dir:        ${with_dbuspolicydir}