From: Jeremy Sowden <jeremy@azazel.net>
To: Netfilter Devel <netfilter-devel@vger.kernel.org>
Subject: [ulogd2 PATCH 12/13] build: reformat autoconf AC_ARG_WITH, AC_ARG_ENABLE and related macros
Date: Sat, 30 Oct 2021 17:01:40 +0100 [thread overview]
Message-ID: <20211030160141.1132819-13-jeremy@azazel.net> (raw)
In-Reply-To: <20211030160141.1132819-1-jeremy@azazel.net>
Signed-off-by: Jeremy Sowden <jeremy@azazel.net>
---
configure.ac | 169 +++++++++++++++++++++------------------------------
1 file changed, 68 insertions(+), 101 deletions(-)
diff --git a/configure.ac b/configure.ac
index e69beb2b49ce..ea245dae3796 100644
--- a/configure.ac
+++ b/configure.ac
@@ -37,122 +37,89 @@ AC_CHECK_FUNCS([socket strerror])
AC_SEARCH_LIBS([pthread_create], [pthread], [libpthread_LIBS="$LIBS"; LIBS=""])
AC_SUBST([libpthread_LIBS])
-AC_ARG_ENABLE(ulog,
- AS_HELP_STRING([--enable-ulog], [Enable ulog module [default=yes]]),[enable_ulog=$enableval],[enable_ulog=yes])
+AC_ARG_ENABLE([ulog],
+ [AS_HELP_STRING([--enable-ulog], [Enable ulog module [default=yes]])],
+ [enable_ulog=$enableval],
+ [enable_ulog=yes])
AM_CONDITIONAL([BUILD_ULOG], [test "x$enable_ulog" = "xyes"])
-if [! test "x$enable_ulog" = "xyes"]; then
- enable_ulog="no"
-fi
+AS_IF([test "x$enable_ulog" != "xyes"], [enable_ulog=no])
dnl Check for the right nfnetlink version
PKG_CHECK_MODULES([LIBNFNETLINK], [libnfnetlink >= 1.0.1])
-AC_ARG_ENABLE(nflog,
- AS_HELP_STRING([--enable-nflog], [Enable nflog module [default=yes]]),[enable_nflog=$enableval],[enable_nflog=yes])
-AS_IF([test "x$enable_nflog" = "xyes"], [
- PKG_CHECK_MODULES([LIBNETFILTER_LOG], [libnetfilter_log >= 1.0.0])
- AC_DEFINE([BUILD_NFLOG], [1], [Building nflog module])
-])
-AM_CONDITIONAL([BUILD_NFLOG], [test "x$enable_nflog" = "xyes"])
-if [! test "x$enable_nflog" = "xyes"]; then
- enable_nflog="no"
-fi
-AC_ARG_ENABLE(nfct,
- AS_HELP_STRING([--enable-nfct], [Enable nfct module [default=yes]]),[enable_nfct=$enableval],[enable_nfct=yes])
-AS_IF([test "x$enable_nfct" = "xyes"], [
- PKG_CHECK_MODULES([LIBNETFILTER_CONNTRACK], [libnetfilter_conntrack >= 1.0.2])
- AC_DEFINE([BUILD_NFCT], [1], [Building nfct module])
-])
+AC_ARG_ENABLE([nflog],
+ [AS_HELP_STRING([--enable-nflog], [Enable nflog module [default=yes]])],
+ [enable_nflog=$enableval],
+ [enable_nflog=yes])
+AM_CONDITIONAL([BUILD_NFLOG], [test "x$enable_nflog" = "xyes"])
+AS_IF([test "x$enable_nflog" = "xyes"],
+ [PKG_CHECK_MODULES([LIBNETFILTER_LOG], [libnetfilter_log >= 1.0.0])
+ AC_DEFINE([BUILD_NFLOG], [1], [Building nflog module])],
+ [enable_nflog=no])
+
+AC_ARG_ENABLE([nfct],
+ [AS_HELP_STRING([--enable-nfct],[Enable nfct module [default=yes]])],
+ [enable_nfct=$enableval],
+ [enable_nfct=yes])
AM_CONDITIONAL([BUILD_NFCT], [test "x$enable_nfct" = "xyes"])
-if [! test "x$enable_nfct" = "xyes"]; then
- enable_nfct="no"
-fi
-
-AC_ARG_ENABLE(nfacct,
- AS_HELP_STRING([--enable-nfacct], [Enable nfacct module [default=yes]]),[enable_nfacct=$enableval],[enable_nfacct=yes])
-AS_IF([test "x$enable_nfacct" = "xyes"], [
- PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.3])
- PKG_CHECK_MODULES([LIBNETFILTER_ACCT], [libnetfilter_acct >= 1.0.1])
- AC_DEFINE([BUILD_NFACCT], [1], [Building nfacct module])
-])
+AS_IF([test "x$enable_nfct" = "xyes"],
+ [PKG_CHECK_MODULES([LIBNETFILTER_CONNTRACK], [libnetfilter_conntrack >= 1.0.2])
+ AC_DEFINE([BUILD_NFCT], [1], [Building nfct module])],
+ [enable_nfct=no])
+
+AC_ARG_ENABLE([nfacct],
+ [AS_HELP_STRING([--enable-nfacct], [Enable nfacct module [default=yes]])],
+ [enable_nfacct=$enableval],
+ [enable_nfacct=yes])
AM_CONDITIONAL([BUILD_NFACCT], [test "x$enable_nfacct" = "xyes"])
-if [! test "x$enable_nfacct" = "xyes"]; then
- enable_nfacct="no"
-fi
-
-AC_ARG_WITH([pgsql], AS_HELP_STRING([--without-pgsql], [Build without postgresql output plugin [default=test]]))
-AS_IF([test "x$with_pgsql" != "xno"], [
- CT_CHECK_POSTGRES_DB()
-])
-AM_CONDITIONAL(HAVE_PGSQL, test "x$PQLIBPATH" != "x")
-if test "x$PQLIBPATH" != "x"; then
- enable_pgsql="yes"
-else
- enable_pgsql="no"
-fi
-
-AC_ARG_WITH([mysql], AS_HELP_STRING([--without-mysql], [Build without mysql output plugin [default=test]]))
-AS_IF([test "x$with_mysql" != "xno"], [
- CT_CHECK_MYSQL_DB()
-])
+AS_IF([test "x$enable_nfacct" = "xyes"],
+ [PKG_CHECK_MODULES([LIBMNL], [libmnl >= 1.0.3])
+ PKG_CHECK_MODULES([LIBNETFILTER_ACCT], [libnetfilter_acct >= 1.0.1])
+ AC_DEFINE([BUILD_NFACCT], [1], [Building nfacct module])],
+ [enable_nfacct=no])
+
+AC_ARG_WITH([pgsql], [AS_HELP_STRING([--without-pgsql], [Build without postgresql output plugin [default=test]])])
+AS_IF([test "x$with_pgsql" != "xno"],
+ [CT_CHECK_POSTGRES_DB()])
+AM_CONDITIONAL([HAVE_PGSQL], [test "x$PQLIBPATH" != "x"])
+AS_IF([test "x$PQLIBPATH" != "x"], [enable_pgsql=yes], [enable_pgsql=no])
+
+AC_ARG_WITH([mysql], [AS_HELP_STRING([--without-mysql], [Build without mysql output plugin [default=test]])])
+AS_IF([test "x$with_mysql" != "xno"],
+ [CT_CHECK_MYSQL_DB()])
AM_CONDITIONAL(HAVE_MYSQL, test "x$MYSQL_LIB" != "x")
-if test "x$MYSQL_LIB" != "x"; then
- enable_mysql="yes"
-else
- enable_mysql="no"
-fi
-
+AS_IF([test "x$MYSQL_LIB" != "x"], [enable_mysql=yes], [enable_mysql=no])
-AC_ARG_WITH([sqlite], AS_HELP_STRING([--without-sqlite], [Build without SQLITE3 output plugin [default=test]]))
-AS_IF([test "x$with_sqlite" != "xno"], [
- PKG_CHECK_MODULES([libsqlite3], [sqlite3], [], [:])
-])
-AM_CONDITIONAL([HAVE_SQLITE3], [test -n "$libsqlite3_LIBS"])
-if test "x$libsqlite3_LIBS" != "x"; then
- enable_sqlite3="yes"
-else
- enable_sqlite3="no"
-fi
+AC_ARG_WITH([sqlite], [AS_HELP_STRING([--without-sqlite], [Build without SQLITE3 output plugin [default=test]])])
+AS_IF([test "x$with_sqlite" != "xno"],
+ [PKG_CHECK_MODULES([libsqlite3], [sqlite3], [], [:])])
+AM_CONDITIONAL([HAVE_SQLITE3], [test "x$libsqlite3_LIBS" != "x"])
+AS_IF([test "x$libsqlite3_LIBS" != "x"], [enable_sqlite3=yes], [enable_sqlite3=no])
-AC_ARG_WITH([dbi], AS_HELP_STRING([--without-dbi], [Build without DBI output plugin [default=test]]))
-AS_IF([test "x$with_dbi" != "xno"], [
- CT_CHECK_DBI()
-])
+AC_ARG_WITH([dbi], [AS_HELP_STRING([--without-dbi], [Build without DBI output plugin [default=test]])])
+AS_IF([test "x$with_dbi" != "xno"],
+ [CT_CHECK_DBI()])
AM_CONDITIONAL(HAVE_DBI, test "x$DBI_LIB" != "x")
-if test "x$DBI_LIB" != "x"; then
- enable_dbi="yes"
-else
- enable_dbi="no"
-fi
+AS_IF([test "x$DBI_LIB" != "x"], [enable_dbi=yes], [enable_dbi=no])
-AC_ARG_WITH([pcap], AS_HELP_STRING([--without-pcap], [Build without PCAP output plugin [default=test]]))
-AS_IF([test "x$with_pcap" != "xno"], [
- AC_SEARCH_LIBS([pcap_close], [pcap], [libpcap_LIBS="-lpcap"; LIBS=""])
- AC_SUBST([libpcap_LIBS])
-])
-AM_CONDITIONAL([HAVE_PCAP], [test -n "$libpcap_LIBS"])
-if test "x$libpcap_LIBS" != "x"; then
- enable_pcap="yes"
-else
- enable_pcap="no"
-fi
+AC_ARG_WITH([pcap], [AS_HELP_STRING([--without-pcap], [Build without PCAP output plugin [default=test]])])
+AS_IF([test "x$with_pcap" != "xno"],
+ [AC_SEARCH_LIBS([pcap_close], [pcap], [libpcap_LIBS="-lpcap"; LIBS=""])
+ AC_SUBST([libpcap_LIBS])])
+AM_CONDITIONAL([HAVE_PCAP], [test "x$libpcap_LIBS" != "x"])
+AS_IF([test "x$libpcap_LIBS" != "x"], [enable_pcap=yes], [enable_pcap=no])
-AC_ARG_WITH([jansson], AS_HELP_STRING([--without-jansson], [Build without JSON output plugin [default=test]]))
-AS_IF([test "x$with_jansson" != "xno"], [
- PKG_CHECK_MODULES([libjansson], [jansson], [], [:])
-])
-AM_CONDITIONAL([HAVE_JANSSON], [test -n "$libjansson_LIBS"])
-if test "x$libjansson_LIBS" != "x"; then
- enable_jansson="yes"
-else
- enable_jansson="no"
-fi
+AC_ARG_WITH([jansson], [AS_HELP_STRING([--without-jansson], [Build without JSON output plugin [default=test]])])
+AS_IF([test "x$with_jansson" != "xno"],
+ [PKG_CHECK_MODULES([libjansson], [jansson], [], [:])])
+AM_CONDITIONAL([HAVE_JANSSON], [test "x$libjansson_LIBS" != "x"])
+AS_IF([test "x$libjansson_LIBS" != "x"], [enable_jansson=yes], [enable_jansson=no])
AC_ARG_WITH([ulogd2libdir],
- AS_HELP_STRING([--with-ulogd2libdir=PATH],
- [Default directory to load ulogd2 plugin from [[LIBDIR/ulogd]]]),
- [ulogd2libdir="$withval"],
- [ulogd2libdir="${libdir}/ulogd"])
+ [AS_HELP_STRING([--with-ulogd2libdir=PATH],
+ [Default directory to load ulogd2 plugin from [[LIBDIR/ulogd]]])],
+ [ulogd2libdir="$withval"],
+ [ulogd2libdir="${libdir}/ulogd"])
AC_SUBST([ulogd2libdir])
AC_CONFIG_FILES([include/Makefile
--
2.33.0
next prev parent reply other threads:[~2021-10-30 16:10 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-30 16:01 [ulogd2 PATCH 00/13] Build Improvements Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 01/13] gitignore: Add Emacs artefacts Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 02/13] gitignore: ignore util/.dirstamp Jeremy Sowden
2021-10-30 17:05 ` Jan Engelhardt
2021-11-06 11:06 ` Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 03/13] build: remove unused Makefile fragment Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 04/13] build: remove empty filter sub-directory Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 05/13] build: move cpp flag to the only Makefile.am file where it's needed Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 06/13] build: add Make_global.am for common flags and include it where necessary Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 07/13] build: use `dist_man_MANS` Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 08/13] build: only conditionally enter sub-directories containing optional code Jeremy Sowden
2021-10-30 17:15 ` Jan Engelhardt
2021-11-06 11:06 ` Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 09/13] build: move library dependencies from LDFLAGS to LIBADD Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 10/13] build: update obsolete autoconf macros Jeremy Sowden
2021-10-30 17:16 ` Jan Engelhardt
2021-11-06 11:07 ` Jeremy Sowden
2021-10-30 16:01 ` [ulogd2 PATCH 11/13] build: quote and reformat some autoconf macro arguments Jeremy Sowden
2021-10-30 16:01 ` Jeremy Sowden [this message]
2021-10-30 16:01 ` [ulogd2 PATCH 13/13] build: bump autoconf version to 2.71 Jeremy Sowden
2021-10-30 17:21 ` Jan Engelhardt
2021-11-06 11:07 ` Jeremy Sowden
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211030160141.1132819-13-jeremy@azazel.net \
--to=jeremy@azazel.net \
--cc=netfilter-devel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).