Should a "configure" script be distributed if configure.ac is available?
Asked Answered
M

3

7

Currently, our installation instructions are:

autoreconf -fi
./configure
...

The autoreconf step generates the configure file from configure.ac and Makefile.in from Makefile.in. If one of the dependencies (say pkg-config) is not installed, both configure and autoreconf fail although the latter prints a cryptic error message.

When releasing source tarballs, should the configure script be supplied in the package or not? What other files need to be included if it has to be distributed? The directories build-aux and autom4te.cache and files aclocal.m4 were also created.

Mishmash answered 14/1, 2012 at 20:22 Comment(5)
In an SCM repository, nothing autogenerated should be present (including configure); a tarball should contain the state after autoreconf -fi/autogen.sh/bootstrap (or just use make dist).Connelly
@jørgensen Make that an answer, I did not fully realize that make dist is the key hereMishmash
Am curious also why it's good to distribute the configure script. To me it seems just as easy (and cleaner) to run the autogen.sh.Puerperal
@LeifGruenwoldt autogen.sh (which usually calls autoreconf -fi) requires the dependencies to be present. If they are missing, you can get cryptic errors. Another reason is that generation of the configure script needs autoconf (and usually automake too), this is not necessary anymore once you have a configure script.Mishmash
@Mishmash Thanks. I suppose I expected that if someone has installed tools to compile a project that they could also just install autotools, but maybe that's not available for everyone. Ah the conveniences of a modern distro.Puerperal
P
7

In an SCM repository, nothing autogenerated should be present (including configure — but developer opinions digress here). A tarball should contain the state after autoreconf -fi and/or autogen.sh (or whichever name you chose for it). Third, you could also use make dist, though it requires that all files that shall appear in the tarball are also listed in the Makefiles.

Priester answered 16/1, 2012 at 15:48 Comment(2)
You are just wrong about this, the end user should not need to have autotools installed to build your software.Meave
@Meave Just a note: With this solution, the end user does not need to have autotools installed (but the developers do).Verlinevermeer
F
4

Your installation instructions are horribly broken. The user should not need to have the autotool chain installed to build your software. You must distribute the configure script in your tarball. Note that you should not include the configure script in your version control system. (You should not use your version control system as a distribution system.)

Flame answered 15/1, 2012 at 14:53 Comment(3)
Thanks for reply, I now know that make dist should be used (it works perfect for generating the configure file and such).Mishmash
@Mishmash -- Actually, you should always use make distcheckFlame
Good to know, autotools has many options but you just have to know about it since the documentation is not terse. gnu.org/software/automake/manual/html_node/…Mishmash
B
3

The configure script should be built by the maintainer and distributed in the tarball. End users should never have to touch it, and it is a good idea to ensure this via AM_MAINTAINER_MODE if you are using automake. If not, make sure your Makefile.in doesn't re-generate configure when running for end users.

Let automake generate a distribution for you if you want to know what else belongs there. The auxiliary directory build-aux and aclocal.m4 do, automat4e.cache doesn't.

Biron answered 14/1, 2012 at 22:16 Comment(6)
Ah, I've just peeked in the PHP repository and it seems that the tarballs containing the source from git should not be used for distribution. If I release a tarball that contains a configure script (just like the downloads from PHP), do I need to use make dist?Mishmash
AM_MAINTAINER_MODE has always been a bad idea. It's author agreed with that years ago. It is now considered (mostly) deprecated, and there is talk of removing it from automake. Do not use it.Flame
@Lekensteyn: make dist works splendidly for making a distribution tarball, after all that's its job.Biron
@WilliamPursell: While the discussion about the sensibility of AM_MAINTAINER_MODE is in the automake user manual (section 28.2), and the macro is called "infamous", it is not marked as deprecated. I still consider it sensible after at least one user build broke due to a different libtool version and broken timestamps.Biron
@Biron Is that "broken timestamps" in the distribution tarball? make distcheck should catch such errors.Flame
@WilliamPursell: No, the distribution tarball was fine. It broke on the client side. MacOS. Shouldn't happen, but did.Biron

© 2022 - 2024 — McMap. All rights reserved.