diff options
author | Guillem Jover <guillem@debian.org> | 2016-08-28 18:59:03 +0200 |
---|---|---|
committer | Guillem Jover <guillem@debian.org> | 2016-10-29 16:02:49 +0200 |
commit | 9aa458e8a34bdef30538a84e6cf74bc4ac5d4d6c (patch) | |
tree | 1487e2cf26e3e3749ea131e5e7936429b9f07132 /configure.ac | |
parent | 758ecf7fe1cb15abb87c796fb3a7f15933c56f67 (diff) | |
download | dpkg-9aa458e8a34bdef30538a84e6cf74bc4ac5d4d6c.tar.gz |
build: Fix M4sh/Autoconf coding style
Indent the code in a way that makes it easier to follow. Use AS_IF
instead of shell constructs. Quote all autoconf macro arguments.
Add a new section to coding-style.txt describing M4sh/Autoconf.
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 128 |
1 files changed, 82 insertions, 46 deletions
diff --git a/configure.ac b/configure.ac index 7f22d8edd..9ab683b4f 100644 --- a/configure.ac +++ b/configure.ac @@ -16,8 +16,11 @@ AM_SILENT_RULES([yes]) # Do not unconditionally use the following macro, as Debian jessie does not # have a recent enough gettext. -m4_ifdef([AM_GNU_GETTEXT_REQUIRE_VERSION], - [AM_GNU_GETTEXT_REQUIRE_VERSION([0.19])]) +m4_ifdef([ + AM_GNU_GETTEXT_REQUIRE_VERSION +], [ + AM_GNU_GETTEXT_REQUIRE_VERSION([0.19]) +]) # We cannot remove the following macro due to backwards compatibility reasons. # In the future when the gettext version is bumped, we have to set the above # macro unconditionally to the minimal version, and set the below to 0.19.6, @@ -25,7 +28,7 @@ m4_ifdef([AM_GNU_GETTEXT_REQUIRE_VERSION], AM_GNU_GETTEXT_VERSION([0.19]) AM_GNU_GETTEXT([external]) DPKG_DIST_CHECK([test "$GMSGFMT" = ":" && test "$USE_NLS" = "yes"], - [gettext required when NLS support enabled]) + [gettext required when NLS support enabled]) # Shared libraries are disabled on purpose, currently there is no ABI stability # guarantee, and it will be broken at will. The infrastructure is in place just @@ -44,13 +47,13 @@ DPKG_BUILD_DEVEL_DOCS # Allow alternate directories DPKG_WITH_DIR([devlibdir], [${libdir}], - [dpkg development library directory [LIBDIR]]) + [dpkg development library directory [LIBDIR]]) DPKG_WITH_DIR([pkgconfdir], [${sysconfdir}/${PACKAGE_NAME}], - [dpkg configuration directory [SYSCONFDIR/dpkg]]) + [dpkg configuration directory [SYSCONFDIR/dpkg]]) DPKG_WITH_DIR([admindir], [${localstatedir}/lib/${PACKAGE_NAME}], - [dpkg database directory [LOCALSTATEDIR/lib/dpkg]]) + [dpkg database directory [LOCALSTATEDIR/lib/dpkg]]) DPKG_WITH_DIR([logdir], [${localstatedir}/log], - [system logging directory [LOCALSTATEDIR/log]]) + [system logging directory [LOCALSTATEDIR/log]]) # Set default dpkg-deb values DPKG_DEB_COMPRESSOR([xz]) @@ -77,19 +80,31 @@ DPKG_LIB_Z DPKG_LIB_BZ2 DPKG_LIB_LZMA DPKG_LIB_SELINUX -if test "x$build_dselect" = "xyes"; then - DPKG_LIB_CURSES -fi -if test "x$build_start_stop_daemon" = "xyes"; then - DPKG_LIB_PS - DPKG_LIB_KVM -fi +AS_IF([test "x$build_dselect" = "xyes"], [ + DPKG_LIB_CURSES +]) +AS_IF([test "x$build_start_stop_daemon" = "xyes"], [ + DPKG_LIB_PS + DPKG_LIB_KVM +]) # Checks for header files. AC_HEADER_STDC -AC_CHECK_HEADERS([stddef.h error.h err.h locale.h libintl.h kvm.h \ - sys/param.h sys/sysctl.h sys/syscall.h sys/user.h \ - sys/proc.h sys/pstat.h linux/fiemap.h]) +AC_CHECK_HEADERS([\ + stddef.h \ + error.h \ + err.h \ + locale.h \ + libintl.h \ + kvm.h \ + sys/param.h \ + sys/sysctl.h \ + sys/syscall.h \ + sys/user.h \ + sys/proc.h \ + sys/pstat.h \ + linux/fiemap.h \ +]) # Checks for typedefs, structures, and compiler characteristics. AC_C_BIGENDIAN @@ -118,45 +133,66 @@ DPKG_CHECK_DECL([F_ALLOCSP64], [fcntl.h]) DPKG_CHECK_DECL([F_PREALLOCATE], [fcntl.h]) DPKG_CHECK_DECL([P_tmpdir], [stdio.h]) DPKG_CHECK_PROGNAME -DPKG_CHECK_COMPAT_FUNCS([getopt getopt_long obstack_free \ - strnlen strndup strerror strsignal asprintf \ - scandir alphasort unsetenv]) +DPKG_CHECK_COMPAT_FUNCS([\ + getopt \ + getopt_long \ + obstack_free \ + strnlen \ + strndup \ + strerror \ + strsignal \ + asprintf \ + scandir \ + alphasort \ + unsetenv \ +]) AC_CHECK_FUNCS([memcpy lchown], - [], [AC_MSG_ERROR([missing required function])]) -AC_CHECK_FUNCS([strtoimax isascii setsid getdtablesize \ - getprogname getexecname lutimes \ - fallocate posix_fallocate posix_fadvise]) + [], [AC_MSG_ERROR([missing required function])]) +AC_CHECK_FUNCS([\ + strtoimax \ + isascii \ + setsid \ + getdtablesize \ + getprogname \ + getexecname \ + lutimes \ + fallocate \ + posix_fallocate \ + posix_fadvise \ +]) DPKG_MMAP # Checks for the build machinery. -AC_DEFINE(LIBDPKG_VOLATILE_API, 1, [Acknowledge the volatility of the API.]) +AC_DEFINE([LIBDPKG_VOLATILE_API], [1], [Acknowledge the volatility of the API.]) DPKG_COMPILER_WARNINGS DPKG_COMPILER_OPTIMIZATIONS DPKG_LINKER_OPTIMIZATIONS DPKG_ARCHITECTURE AC_DEFINE([PACKAGE_RELEASE], [PACKAGE_VERSION " (" ARCHITECTURE ")"], - [Define the project release information, version and architecture]) - -AC_CONFIG_FILES([ Makefile - dpkg-deb/Makefile - dpkg-split/Makefile - dselect/Makefile - dselect/methods/Makefile - dselect/po/Makefile.in - lib/Makefile - lib/compat/Makefile - lib/dpkg/Makefile - lib/dpkg/libdpkg.pc - lib/dpkg/t/Makefile - doc/Doxyfile - man/Makefile - po/Makefile.in - scripts/Makefile - scripts/mk/Makefile - scripts/po/Makefile.in - src/Makefile - utils/Makefile ]) + [Define the project release information, version and architecture]) + +AC_CONFIG_FILES([ + Makefile + dpkg-deb/Makefile + dpkg-split/Makefile + dselect/Makefile + dselect/methods/Makefile + dselect/po/Makefile.in + lib/Makefile + lib/compat/Makefile + lib/dpkg/Makefile + lib/dpkg/libdpkg.pc + lib/dpkg/t/Makefile + doc/Doxyfile + man/Makefile + po/Makefile.in + scripts/Makefile + scripts/mk/Makefile + scripts/po/Makefile.in + src/Makefile + utils/Makefile +]) AC_CONFIG_HEADERS([config.h]) AC_OUTPUT |