[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Outdated GNU config (config.{sub,guess}) and autotools-dev

This post is basically the README.Debian of the autotools-dev package. It's
being sent here just so that nobody can claim not knowing about it ;)

If any of the packages you maintain or are going to NMU use config.sub or
config.guess, you are well advised to read it.

autotools-dev for Debian

The config.guess and config.sub files, used by autoconf- and automake-
generated scripts, need to be constantly updated to address new
architectures.  Unfortunately, Debian's automake package has failed to
provide such timely updates regularly, and even if it did, most developers
are not even aware of the need for such updates.  Their upstream often
isn't, either.

The result ends up as serious bugs filled in the BTS by porters. Given the
amount of packages using autoconf and automake in Debian, we are talking
about a rather large number of bugs every time we start supporting a new

To fix this, we need both a source of fresh copies for config.{sub,guess} in
Debian, as well as a way to get them inside the packages during their build.
autotools-dev provides the fresh copies of config.{sub,guess} for any
programs that might need them (in /usr/share/misc), including automake and

By inserting some code in the debian/rules file (the clean target is the
best place for this, as it guarantees the updated files will make it to the
source package when dpkg-buildpackage is run), the whole process can be
safely automated: The config.guess and config.sub files will be updated at
every build, then.

The dh_autotools functionality is very easy to emulate. Just add:
	-test -r /usr/share/misc/config.sub && \
	   cp -f /usr/share/misc/config.sub config.sub
	-test -r /usr/share/misc/config.guess && \
	   cp -f /usr/share/misc/config.guess config.guess
to the clean target of debian/rules.

Or, if you dislike not being able to know when a autobuilder did that before
you could, and didn't let you know:

clean:	autotools [other dependencies]
  [clean target]

# The autotools target adds forced build-time dependencies on
# autotools-dev (for /usr/share/misc/config.*) and debscripts (for dch)
# It's also a .PHONY make target.
        OLDDATESUB=`./config.sub -t | tr -d -` ;\
        OLDDATEGUESS=`./config.guess -t | tr -d -` ;\
        NEWDATESUB=`/usr/share/misc/config.sub -t | tr -d -` ;\
        NEWDATEGUESS=`/usr/share/misc/config.guess -t | tr -d -` ;\
        if [ $$OLDDATESUB -lt $$NEWDATESUB -o \
             $$OLDDATEGUESS -lt $$NEWDATEGUESS ]; then \
           dch -a -p "GNU config automated update: config.sub\
             ($$OLDDATESUB to $$NEWDATESUB), config.guess\
             ($$OLDDATEGUESS to $$NEWDATEGUESS)" ;\
           cp -f /usr/share/misc/config.sub config.sub ;\
           cp -f /usr/share/misc/config.guess config.guess ;\
           echo WARNING: GNU config scripts updated from master copies 1>&2 ;\

.PHONY	autotools

(do not forget the build-depends!.  Also, the above script will FAIL if the
config.sub in the package is so old it doesn't support -t. Do the first
upgrade by hand :P).

Packages that can take advantage of autotools-dev should also Build-Depend
on it.

The "it is not wise to do such things automatically" topic has been brought
up and beaten back, btw. Please use the search facility in lists.debian.org
if you're curious.

  "One disk to rule them all, One disk to find them. One disk to bring
  them all and in the darkness grind them. In the Land of Redmond
  where the shadows lie." -- The Silicon Valley Tarot
  Henrique Holschuh

Attachment: pgppZyQ2Laaae.pgp
Description: PGP signature

Reply to: