automake
[Top][All Lists]
Advanced

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

Re: automake distcheck question


From: Stefano Lattarini
Subject: Re: automake distcheck question
Date: Fri, 13 Apr 2012 10:32:35 +0200

On 04/13/2012 04:07 AM, songbird wrote:
>   [edited and posted from another group after
> being redirected]
> 
>   hi everyone,  :)
> 
> 
>   i'm running Debian (testing) with current
> automake, autoconf, etc.
> 
>   please note that the example code below does
> nothing at all, that's not the important part
> at the moment in this trail of learning, i'm
> just examining the build environment and making
> sure it configures, compiles, dists, etc. correctly.
> 
> 
>   my question?  it's at the end, but to be complete
> i include background and development.
> 
> 
>   i've used a small tutorial that is part of an
> online book at: 
> 
>   http://sources.redhat.com/autobook/autobook/autobook.html#SEC_Top
>
That is pretty old, and mostly outdated AFAIK.  Have you tried taking a
look at this instead?

  <http://www.flameeyes.eu/autotools-mythbuster/>

I've also found this very clear and useful when I was learning the
autotools myself:

  <http://www.lrde.epita.fr/~adl/autotools.html>

> and specifically the foonly-2.0.tar.gz example after setting up a
> working directory to play in.
> 
> 
>   at first when unpacked i get a list:
> 
> -rwxr-xr-x 1 me me   33 Feb  2  2006 bootstrap
> -rw-r--r-- 1 me me  235 Feb  2  2006 configure.ac
> -rw-r--r-- 1 me me   17 Feb  2  2006 foo.c
> -rw-r--r-- 1 me me   28 Sep 13  2004 main.c
> -rw-r--r-- 1 me me 1014 Feb  2  2006 Makefile.am
> -rw-r--r-- 1 me me   17 Feb  2  2006 nly.c
> -rw-r--r-- 1 me me   78 Sep 13  2004 parser.y
> -rw-r--r-- 1 me me    3 Sep 13  2004 scanner.l
> 
>   running ./bootstrap and ./configure doesn't work
> and besides i don't want the guy who wrote this
> stuff to get bug reports from me messing around so
> i make a new version and tinker around a bit so
> it compiles and does things right.
> 
> 
>   do a make dist and it now looks like this when
> unpacked:
> 
> -rw-r--r-- 1 me me  35550 Apr 11 12:57 aclocal.m4
> -rwxr-xr-x 1 me me     33 Feb  2  2006 bootstrap
> -rwxr-xr-x 1 me me 141988 Apr 11 12:57 configure
> -rw-r--r-- 1 me me    241 Apr 11 02:36 configure.ac
> -rwxr-xr-x 1 me me  20899 Apr 11 12:57 depcomp
> -rw-r--r-- 1 me me     17 Feb  2  2006 foo.c
> -rwxr-xr-x 1 me me  13998 Apr 11 12:57 install-sh
> -rw-r--r-- 1 me me     28 Sep 13  2004 main.c
> -rw-r--r-- 1 me me   1124 Apr 11 12:56 Makefile.am
> -rw-r--r-- 1 me me  21570 Apr 11 12:57 Makefile.in
> -rwxr-xr-x 1 me me  10346 Apr 11 12:57 missing
> -rw-r--r-- 1 me me     17 Feb  2  2006 nly.c
> -rw-r--r-- 1 me me  43182 Apr 11 12:57 parser.c
> -rw-r--r-- 1 me me    124 Apr 11 00:15 parser.y
> -rw-r--r-- 1 me me  43820 Apr 11 12:57 scanner.c
> -rw-r--r-- 1 me me      3 Sep 13  2004 scanner.l
> -rwxr-xr-x 1 me me   6383 Apr 11 12:57 ylwrap
> 
> 
>   a lot of extra stuff in there.
>
That "extra stuff" is what will allow your package to work on
the machines of your users without requiring them to have all
the developer's tools you're using (autoconf, automake, aclocal,
bison, flex).

  reading more i
> come across dist-hook and add a README file so
> there's some idea of what is going on.  Put those
> in and now when unpacked it looks like:
> 
> -rwxr-xr-x 1 me me   33 Feb  2  2006 bootstrap
> -rw-r--r-- 1 me me  247 Apr 11 12:22 configure.ac
> -rw-r--r-- 1 me me   17 Feb  2  2006 foo.c
> -rw-r--r-- 1 me me   28 Sep 13  2004 main.c
> -rw-r--r-- 1 me me 1326 Apr 11 12:19 Makefile.am
> -rw-r--r-- 1 me me   17 Feb  2  2006 nly.c
> -rw-r--r-- 1 me me  124 Apr 11 00:15 parser.y
> -rw-r--r-- 1 me me 1517 Apr 11 04:12 README
> -rw-r--r-- 1 me me    3 Sep 13  2004 scanner.l
>
> 
>   much better.
>
No, completely broken.  When a user gets your tarball and unpacks it,
he expects to be able to run "./configure && make && make install" and
have that succeed without further steps and without requiring the
presence of developer-specific tools.  This is not the case with your
distribution tarball.

>  except now distcheck doesn't work.
> 
And rightly so -- it is basically informing you that your 'dist-hook'
has mangled your distribution tarball.

> Question:  (finally! :) )
> 
> hmm...  how to add a flag so that the first time
> through the generated Makefile doesn't do the dist-hook
> and only does it at the end?  or is this a bug in
> that the dist-hook shouldn't be run during a distcheck?
> obviously the fixes have to go into Makefile.am to
> get passed through or configure.ac.  more complicated
> than that and it defeats the purpose of keeping things
> minimal as possible.
> 
> 
> The four versions of the code tar and gzip to:
> 
> -rw-r--r-- 1 me me 96783 Apr 11 12:34 foonly-2.0.1.big.tar.gz
> -rw-r--r-- 1 me me  2120 Apr 11 12:32 foonly-2.0.1.small.tar.gz
> -rw-r--r-- 1 me me 96027 Apr 11 12:57 foonly-2.0.1.tar.gz
> -rw-r--r-- 1 me me  1211 Apr 10 22:57 foonly-2.0.tar.gz
> 
>   i really like that the small version that works almost
> completely (minus the distcheck make target) is so tiny
> yet has the code and the build scripts entirely in there
> and the rest can all be generated.  that's exactly the
> kind of setup i always aim towards.  ship minimal but it
> has to build with what is shipped (if the rest of the
> environment is correct).
>
Sorry, you are misunderstanding how the autotools work and what
problems they are supposed to solve.  The point is that you
ship big (not minimal) so that the build works even when some
parts of the the build environment on the user's machine is
missing or broken. The tutorials I've linked above should explain
this in greater details and with more clarity.  It is also hinted
in the Autotools wikipedia entry:

  [Advantages of the GNU build system]
  The GNU build system allows a programmer to write cross-platform
  software. It also makes the build process easier on a user who
  wants to compile the program on his or her own computer. The user
  does not need to have GNU build system components installed on
  the computer but only needs to run the supplied configure script
  which has no dependencies other than the presence of a
  Bourne-compatible shell.

HTH,
  Stefano



reply via email to

[Prev in Thread] Current Thread [Next in Thread]