[systemd-devel] [PATCH] add sprezzos as alias for debian in autoconf script

nick black nick.black at sprezzatech.com
Fri Dec 28 20:34:26 PST 2012


Hello there!

This patch adds sprezzos as an alias for debian in the configuration
script. It also adds a comment exhorting other Debian derivatives to do
this when possible, in the hope of keeping identifier bloat localized
to autoconf while providing maximal future-proofing and making the
correct choice explicit to the largest number of users.

I went this route after first adding a TARGET_SPREZZOS autoconf #define,
and realizing that this meant multiple files now had

 #if defined(TARGET_DEBIAN) || defined(TARGET_ANGSTROM) || defined(TARGET_SPREZZOS)

which is getting pretty clearly ridiculous. Should there come a time
when Debian needs radically unexpected changes here to conform with
*new* behavior, it might behoove us to make sprezzos an alias of
TARGET_DEBIAN_CLASSIC_DERIVATIVE or some other horror, allowing exlusive
TARGET_DEBIAN-guarding of this hypothetical new code. Until that unhappy and
unlikely day, this will work for Debian derivatives until they explicitly
diverge from Debian, at which point changes elsewhere are rather more
expected.

Ångström, I notice that the semantics of TARGET_ANGSTROM are currently
equivalent to those of TARGET_DEBIAN. I thus recommend that you convert
to an alias similarly, allowing removal of TARGET_ANGSTROM #ifdefs scattered
throughout the systemd code proper.

Systemd maintainers, if you agree with this approach, please apply my
patch. It can, of course, be applied independently of Ångström's takeup
of this method. Pull from https://github.com/Sprezzatech/systemd/commit/43571179a9effdde3365c5bd72f66f7712b68f5e.

Thanks, everyone. Hack on!


diff --git a/configure.ac b/configure.ac
index d0003bb..e0e9dca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -640,7 +640,7 @@ AM_CONDITIONAL(ENABLE_MANPAGES, [test "x$have_manpages" = "xyes"])
 
 # ------------------------------------------------------------------------------
 
-AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of fedora, suse, debian, arch, gentoo, slackware, altlinux, mandriva, mageia, angstrom or other]))
+AC_ARG_WITH(distro, AS_HELP_STRING([--with-distro=DISTRO],[Specify the distribution to target: One of fedora, suse, debian, arch, gentoo, slackware, altlinux, mandriva, mageia, angstrom, sprezzos or other]))
 if test "z$with_distro" = "z"; then
         if test "$cross_compiling" = yes; then
                 AC_MSG_WARN([Target distribution cannot be reliably detected when cross-compiling. You should specify it with --with-distro (see $0 --help for recognized distros)])
@@ -660,6 +660,9 @@ SYSTEM_SYSVRCND_PATH=/etc/rc.d
 
 M4_DEFINES=
 
+# If you are Debian-derived, and the set of Debian-associated conditionals
+# apply to you, make yourself an alias of "debian" here rather than introducing
+# an entire new set of identifiers.
 case $with_distro in
         fedora)
                 SYSTEM_SYSVINIT_PATH=/etc/rc.d/init.d
@@ -671,7 +674,7 @@ case $with_distro in
                 AC_DEFINE(TARGET_SUSE, [], [Target is openSUSE/SLE])
                 M4_DEFINES=-DTARGET_SUSE=1
                 ;;
-        debian)
+        sprezzos|debian)
                 SYSTEM_SYSVRCND_PATH=/etc
                 AC_DEFINE(TARGET_DEBIAN, [], [Target is Debian])
                 M4_DEFINES=-DTARGET_DEBIAN=1
-- 
nick black     http://www.sprezzatech.com -- unix and hpc consulting
to make an apple pie from scratch, you need first invent a universe.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-add-ourselves-as-an-alias-for-debian-in-the-autoconf.patch
Type: text/x-diff
Size: 2092 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20121228/15ffb77d/attachment-0001.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20121228/15ffb77d/attachment-0001.pgp>


More information about the systemd-devel mailing list