The following commit has been merged in the master branch:
commit bbf1c10064958da1ebb5a8d2da0bc170dd1c994a
Author: Guillem Jover <[email protected]>
Date: Tue Nov 2 05:53:30 2010 +0100
build: Refactor --with/out options into DPKG_WITH_PROG and DPKG_WITH_DIR
diff --git a/configure.ac b/configure.ac
index b741769..0ba059a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -17,69 +17,17 @@ m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])],
AM_GNU_GETTEXT_VERSION([0.18])
AM_GNU_GETTEXT([external])
-# Allow compilation without dselect
-AC_ARG_WITH(dselect,
- AS_HELP_STRING([--without-dselect],
- [do not build dselect package-management frontend]),
- [build_dselect=$with_dselect],
- [build_dselect=yes])
-AM_CONDITIONAL(WITH_DSELECT, [test "x$build_dselect" = "xyes"])
-
-# Allow compilation without start-stop-daemon
-AC_ARG_WITH(start-stop-daemon,
- AS_HELP_STRING([--without-start-stop-daemon],
- [do not build or use start-stop-daemon]),
- [build_start_stop_daemon=$with_start_stop_daemon],
- [build_start_stop_daemon=yes])
-AM_CONDITIONAL(WITH_START_STOP_DAEMON,
- [test "x$build_start_stop_daemon" = "xyes"])
-if test "x$build_start_stop_daemon" = "xyes"; then
- AC_DEFINE(WITH_START_STOP_DAEMON, 1,
- [Define to 1 if start-stop-daemon is compiled.])
-else
- AC_DEFINE(WITH_START_STOP_DAEMON, 0)
-fi
-
-# Allow compilation without update-alternatives
-AC_ARG_WITH(update-alternatives,
- AS_HELP_STRING([--without-update-alternatives],
- [do not build or use update-alternatives]),
- [build_update_alternatives=$with_update_alternatives],
- [build_update_alternatives=yes])
-AM_CONDITIONAL(WITH_UPDATE_ALTERNATIVES,
- [test "x$build_update_alternatives" = "xyes"])
-
-# Allow compilation without install-info
-AC_ARG_WITH(install-info,
- AS_HELP_STRING([--without-install-info],
- [do not build or use install-info]),
- [build_install_info=$with_install_info],
- [build_install_info=yes])
-AM_CONDITIONAL(WITH_INSTALL_INFO,
- [test "x$build_install_info" = "xyes"])
-
-# Allow alternate admin directory
-admindir="${localstatedir}/lib/${PACKAGE_NAME}"
-AC_ARG_WITH(admindir,
- AS_HELP_STRING([--with-admindir=DIR],
- [dpkg database directory [[LOCALSTATEDIR/lib/dpkg]]]),
-[case "$with_admindir" in
- "") AC_MSG_ERROR([invalid admindir specified]) ;;
- *) admindir="$with_admindir" ;;
-esac])
-AC_SUBST(admindir)
-
-# Allow alternate log directory
-logdir="${localstatedir}/log"
-AC_ARG_WITH(logdir,
- AS_HELP_STRING([--with-logdir=DIR],
- [system logging directory [[LOCALSTATEDIR/log]]]),
-[case "$with_logdir" in
- "") AC_MSG_ERROR([invalid logdir specified]) ;;
- *) logdir="$with_logdir" ;;
-esac])
-AC_SUBST(logdir)
-
+# Allow compilation without optional programs
+DPKG_WITH_PROG([dselect])
+DPKG_WITH_PROG([start-stop-daemon])
+DPKG_WITH_PROG([update-alternatives])
+DPKG_WITH_PROG([install-info])
+
+# Allow alternate directories
+DPKG_WITH_DIR([admindir], [${localstatedir}/lib/${PACKAGE_NAME}],
+ [dpkg database directory [LOCALSTATEDIR/lib/dpkg]])
+DPKG_WITH_DIR([logdir], [${localstatedir}/log],
+ [system logging directory [LOCALSTATEDIR/log]])
# Checks for programs.
AC_PROG_CC
diff --git a/m4/dpkg-build.m4 b/m4/dpkg-build.m4
new file mode 100644
index 0000000..166854d
--- /dev/null
+++ b/m4/dpkg-build.m4
@@ -0,0 +1,33 @@
+# Copyright © 2010 Guillem Jover <[email protected]>
+
+# DPKG_WITH_PROG(PROG)
+# --------------
+# Allow disabling compilation and usage of specific programs.
+AC_DEFUN([DPKG_WITH_PROG], [
+ AC_ARG_WITH([$1],
+ AS_HELP_STRING([--without-$1], [do not build or use $1]),
+ [build_]AS_TR_SH([$1])[=$with_]AS_TR_SH([$1]),
+ [build_]AS_TR_SH([$1])[=yes]
+ )
+ AM_CONDITIONAL([WITH_]AS_TR_CPP([$1]),
+ [test "x$build_]AS_TR_SH([$1])[" = "xyes"])
+ AS_IF([test "x$build_]AS_TR_SH([$1])[" = "xyes"], [
+ AC_DEFINE([WITH_]AS_TR_CPP([$1]), 1, [Define to 1 if $1 is compiled.])
+ ], [
+ AC_DEFINE([WITH_]AS_TR_CPP([$1]), 0)
+ ])
+])# DPKG_WITH_PROG
+
+# DPKG_WITH_DIR(DIR, DEFAULT, DESCRIPTION)
+# -------------
+# Allow specifying alternate directories.
+AC_DEFUN([DPKG_WITH_DIR], [
+ $1="$2"
+ AC_ARG_WITH([$1],
+ AS_HELP_STRING([--with-$1=DIR], [$3]),
+ AS_CASE([$with_$1],
+ [""], [AC_MSG_ERROR([invalid $1 specified])],
+ [$1="$with_$1"])
+ )
+ AC_SUBST([$1])
+])# DPKG_WITH_DIR
--
dpkg's main repository
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]