X-Git-Url: http://git.ipfire.org/?p=network.git;a=blobdiff_plain;f=configure.ac;h=37c17e3e42ecbb1d87605c2b0b3ae98462859fe9;hp=df6d64993027ea5450508fb638dd4f0b8cc48e54;hb=HEAD;hpb=ccc9e6fdbc61bb61c889f4282b058825372de6cd diff --git a/configure.ac b/configure.ac index df6d6499..7883ae9e 100644 --- a/configure.ac +++ b/configure.ac @@ -21,13 +21,15 @@ AC_PREREQ([2.64]) AC_INIT([network], - [009], + [011], [info@ipfire.org], [network], [http://www.ipfire.org/]) AC_CONFIG_AUX_DIR([build-aux]) +AC_USE_SYSTEM_EXTENSIONS +AC_SYS_LARGEFILE AC_PREFIX_DEFAULT([/usr]) AM_INIT_AUTOMAKE([ @@ -41,10 +43,17 @@ AM_INIT_AUTOMAKE([ ]) AM_SILENT_RULES([yes]) +LT_INIT([ + disable-static + pic-only +]) + AC_PROG_LN_S AC_PROG_MKDIR_P AC_PROG_SED +AC_PATH_PROG([NITSI], [nitsi]) +AC_PATH_PROG([WGET], [wget]) AC_PATH_PROG([XSLTPROC], [xsltproc]) # pkg-config @@ -59,34 +68,93 @@ AC_PROG_CC_C_O AC_PROG_GCC_TRADITIONAL CC_CHECK_FLAGS_APPEND([with_cflags], [CFLAGS], [\ - -pipe \ -Wall \ - -Wextra \ - -Wno-inline \ - -Wundef \ - "-Wformat=2 -Wformat-security -Wformat-nonliteral" \ - -Wno-unused-parameter \ - -Wno-unused-result \ - -fno-strict-aliasing \ - -ffunction-sections \ - -fdata-sections \ - -fstack-protector-all \ - --param=ssp-buffer-size=4]) + -Wchar-subscripts \ + -Wformat-security \ + -Wmissing-declarations \ + -Wmissing-prototypes \ + -Wnested-externs \ + -Wpointer-arith \ + -Wshadow \ + -Wsign-compare \ + -Wstrict-prototypes \ + -Wtype-limits \ +]) + AC_SUBST([OUR_CFLAGS], $with_cflags) -AS_CASE([$CFLAGS], [*-O[[12345g\ ]]*], - [CC_CHECK_FLAGS_APPEND([with_cppflags], [CPPFLAGS], [\ - -Wp,-D_FORTIFY_SOURCE=2])], - [AC_MSG_RESULT([skipping -D_FORTIFY_SOURCE, optimization not enabled])]) -AC_SUBST([OUR_CPPFLAGS], $with_cppflags) +# ------------------------------------------------------------------------------ + +AC_CHECK_HEADERS_ONCE([ + ctype.h + errno.h + linux/netlink.h + net/if.h + stdarg.h + stdio.h + stdlib.h + string.h + syslog.h +]) + +AC_CHECK_FUNCS([ \ + __secure_getenv \ + secure_getenv \ +]) + +# ------------------------------------------------------------------------------ + +AC_ARG_ENABLE([debug], + AS_HELP_STRING([--enable-debug], [enable debug messages @<:@default=disabled@:>@]), + [], [enable_debug=no]) +AS_IF([test "x$enable_debug" = "xyes"], [ + AC_DEFINE(ENABLE_DEBUG, [1], [Debug messages.]) +]) + +# ------------------------------------------------------------------------------ -CC_CHECK_FLAGS_APPEND([with_ldflags], [LDFLAGS], [\ - -Wl,--as-needed \ - -Wl,--no-undefined \ - -Wl,--gc-sections \ - -Wl,-z,relro \ - -Wl,-z,now]) -AC_SUBST([OUR_LDFLAGS], $with_ldflags) +have_manpages=no +AC_ARG_ENABLE(manpages, AS_HELP_STRING([--disable-man-pages], + [do not install man pages])) +AS_IF([test "x$enable_manpages" != xno], [have_manpages=yes]) +AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"]) + +# ------------------------------------------------------------------------------ + +AC_ARG_WITH( + [dbuspolicydir], + AS_HELP_STRING( + [--with-dbuspolicydir=arg], + [directory for D-Bus policies (default: ${dbusdatadir|datarootdir}/dbus-1/system.d)] + ), + [dbuspolicydir="$withval"], + [PKG_CHECK_VAR([dbusdatadir], [dbus-1], [datadir],, [dbusdatadir="${datarootdir}"]) + dbuspolicydir="${dbusdatadir}/dbus-1/system.d"] +) +AC_SUBST(dbuspolicydir) + +AC_ARG_WITH( + [dbussystembusdir], + AS_HELP_STRING( + [--with-dbussystembusdir=arg], + [path to D-Bus system bus services directory] + ), + [dbussystembusdir="$withval"], + [PKG_CHECK_VAR([dbussystembusdir], [dbus-1], [system_bus_services_dir],, [dbussystembusdir="${datarootdir}"])] +) +AC_SUBST(dbuspolicydir) + +AC_ARG_WITH( + [polkitpolicydir], + AS_HELP_STRING( + [--with-polkitpolicydir=arg], + [directory for PolicyKit policies] + ), + [polkitpolicydir="$withval"], + [PKG_CHECK_VAR([polkitpolicydir], [polkit], [actiondir]) + polkitpolicydir="${datadir}/polkit-1/actions"] +) +AC_SUBST(polkitpolicydir) # ------------------------------------------------------------------------------ AC_ARG_WITH([systemdsystemunitdir], @@ -103,6 +171,22 @@ AC_SUBST([udevdir], [$with_udevdir]) AM_CONDITIONAL(HAVE_UDEV, [test -n "$with_udevdir"]) # ------------------------------------------------------------------------------ + +PKG_CHECK_MODULES([CAP], [libcap]) +PKG_CHECK_MODULES([JSON_C], [json-c]) +PKG_CHECK_MODULES([LIBNL], [libnl-3.0 libnl-genl-3.0]) +PKG_CHECK_MODULES([SYSTEMD], [libsystemd]) + +# ------------------------------------------------------------------------------ + +AC_CHECK_PROGS(ASCIIDOC, [asciidoc]) +if test "${have_manpages}" = "yes" && test -z "${ASCIIDOC}"; then + AC_MSG_ERROR([Required program 'asciidoc' not found]) +fi + +# ------------------------------------------------------------------------------ + +AC_CONFIG_HEADERS(config.h) AC_CONFIG_FILES([ Makefile ]) @@ -117,6 +201,11 @@ AC_MSG_RESULT([ prefix: $prefix + dbuspolicydir: ${dbuspolicydir} + dbussystembusdir: ${dbussystembusdir} + polkitpolicydir: ${polkitpolicydir} systemdsystemunitdir: $systemdsystemunitdir udevdir: $udevdir + + Generate man-pages: ${have_manpages} ])