X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=configure.ac;h=7698bda8a333dad4282aa1ed5ebf369508accf78;hb=6dc0e0960950dfab94babbaced9626225f3f230f;hp=8c5168b1296dcff7185b85e7d72e579a0875b9d5;hpb=7f231684fd2943d4d5585022ec8595ea1b67cf8a;p=elogind.git diff --git a/configure.ac b/configure.ac index 8c5168b12..7698bda8a 100644 --- a/configure.ac +++ b/configure.ac @@ -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,33 @@ AC_CHECK_SIZEOF(rlim_t,,[ #include ]) +GPERF_TEST="$(echo foo,bar | ${GPERF} -L ANSI-C)" + +AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ + #include + const char * in_word_set(const char *, size_t); + $GPERF_TEST] + )], + [GPERF_LEN_TYPE=size_t], + [AC_COMPILE_IFELSE( + [AC_LANG_PROGRAM([ + #include + const char * in_word_set(const char *, unsigned); + $GPERF_TEST] + )], + [GPERF_LEN_TYPE=unsigned], + [AC_MSG_ERROR([** unable to determine gperf len type])] + )] +) + +AC_DEFINE_UNQUOTED([GPERF_LEN_TYPE], [$GPERF_LEN_TYPE], [gperf len type]) + # ------------------------------------------------------------------------------ # 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"], [ @@ -325,16 +350,6 @@ AC_CHECK_DECLS([IFLA_INET6_ADDR_GEN_MODE, # This makes sure pkg.m4 is available. m4_pattern_forbid([^_?PKG_[A-Z_]+$],[*** pkg.m4 missing, please install pkg-config]) -# ------------------------------------------------------------------------------ -have_dbus=no -AC_ARG_ENABLE(dbus, AS_HELP_STRING([--disable-dbus], [disable usage of dbus-1 in tests])) -AS_IF([test "x$enable_dbus" != "xno"], [ - PKG_CHECK_MODULES(DBUS, [dbus-1 >= 1.3.2], - [AC_DEFINE(HAVE_DBUS, 1, [Define if dbus-1 library is available]) have_dbus=yes], - [have_dbus=no]) - AS_IF([test "x$have_dbus" = "xno" -a "x$enable_dbus" = "xyes"], - [AC_MSG_ERROR([*** dbus-1 support requested but libraries not found])])]) -AM_CONDITIONAL(HAVE_DBUS, [test "$have_dbus" = "yes"]) # ------------------------------------------------------------------------------ PKG_CHECK_MODULES(UDEV, [libudev]) @@ -625,11 +640,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], @@ -742,7 +759,6 @@ AC_MSG_RESULT([ ACL: ${have_acl} polkit: ${have_polkit} blkid: ${have_blkid} - dbus: ${have_dbus} kdbus: ${have_kdbus} Python: ${have_python} man pages: ${have_manpages} @@ -757,7 +773,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}