Discussion:
autoconf/tools produces to many top level files
Bob Rossi
2013-04-12 11:30:35 UTC
Permalink
Hi,

I'm creating a new project and using autotools. I've done this before,
but for some reason this time I've noticed how many files autotools
creates. It totally pollutes the top level of my project.

lib <- Mine originally
aclocal.m4
AUTHORS
autom4te.cache
bootstrap
build-aux
ChangeLog
config.h.in
configure
configure.in
COPYING
INSTALL
m4
Makefile.am
Makefile.in
NEWS
README

I understand why configure, Makefile.am and bootstrap (autoreconf script)
need to exist in this directory.

Is it possible to configure the autotools so that everything else gets
put somewhere else (like in a nested directory)?

Thanks,
Bob Rossi
Bert Wesarg
2013-04-12 12:56:22 UTC
Permalink
Hi,
Post by Bob Rossi
Hi,
I'm creating a new project and using autotools. I've done this before,
but for some reason this time I've noticed how many files autotools
creates. It totally pollutes the top level of my project.
lib <- Mine originally
aclocal.m4
AUTHORS
autom4te.cache
bootstrap
build-aux
ChangeLog
config.h.in
configure
configure.in
COPYING
INSTALL
m4
Makefile.am
Makefile.in
NEWS
README
I understand why configure, Makefile.am and bootstrap (autoreconf script)
need to exist in this directory.
Is it possible to configure the autotools so that everything else gets
put somewhere else (like in a nested directory)?
Look for the macros AC_CONFIG_AUX_DIR(), AC_CONFIG_MACRO_DIR(), and
AC_CONFIG_HEADERS()

Hth,
Bert
Post by Bob Rossi
Thanks,
Bob Rossi
Eric Blake
2013-04-12 12:49:59 UTC
Permalink
Post by Bob Rossi
Hi,
I'm creating a new project and using autotools. I've done this before,
but for some reason this time I've noticed how many files autotools
creates. It totally pollutes the top level of my project.
lib <- Mine originally
aclocal.m4
Ask automake if that can be moved. Autoconf does not create it.
Post by Bob Rossi
AUTHORS
GNU Coding Standards requires this in the top level; but you can tell
automake that you don't want to comply to GNU Coding Standards if you
want to omit it. Autoconf does not create it.
Post by Bob Rossi
autom4te.cache
Autoconf creates this, but it is local only; it is not packaged into
your tarballs. If you don't like it, you can use autom4te's --no-cache
option (your runs of autoconf will be slightly slower).
Post by Bob Rossi
bootstrap
Autotools don't create this. That must be your doing, or else you are
using gnulib.
Post by Bob Rossi
build-aux
This is a subdirectory, precisely to hold a lot more files rather than
polluting the top level directory.
Post by Bob Rossi
ChangeLog
GNU Coding Standards requires this in the top level. Same comments as
AUTHORS.
Post by Bob Rossi
config.h.in
This does not have to live at the top level. Use
AC_CONFIG_HEADERS([dir/config.h]) to stick it in a subdirectory instead.
Post by Bob Rossi
configure
Mandatory at the top level, for your package to be configured by end users.
Post by Bob Rossi
configure.in
That name is obsolete. You should be using configure.ac these days.
This file has to exist for you to create configure; and you need to ship
it to the user to comply with the rules of open source. No easy way to
stick it in a subdirectory.
Post by Bob Rossi
COPYING
GNU Coding Standards requires this in the top level. Same comments as
AUTHORS.
Post by Bob Rossi
INSTALL
GNU Coding Standards requires this in the top level. Same comments as
AUTHORS.
Post by Bob Rossi
m4
This is a subdirectory so that you don't have to pollute the top level
with helper .m4 files.
Post by Bob Rossi
Makefile.am
If you use automake, this is mandatory to comply with the rules of open
source. You don't have to use automake, in which case you can get away
without this file.
Post by Bob Rossi
Makefile.in
Mandatory if you want your use to do './configure && make' - configure
has to create a Makefile from something, after all.
Post by Bob Rossi
NEWS
GNU Coding Standards requires this in the top level. Same comments as
AUTHORS.
Post by Bob Rossi
README
GNU Coding Standards requires this in the top level. Same comments as
AUTHORS.
Post by Bob Rossi
I understand why configure, Makefile.am and bootstrap (autoreconf script)
need to exist in this directory.
Is it possible to configure the autotools so that everything else gets
put somewhere else (like in a nested directory)?
It's possible to configure automake to not enforce GNU Coding Standards
and drop some of the files, and to use AC_CONFIG_HEADERS to bury
config.h[.in] in a subdirectory. Beyond that, it's already a pretty
minimal list, and nothing listed above is really autoconf's fault except
for autom4te.cache (which can be disabled), so you are better off
complaining to other lists.
--
Eric Blake eblake redhat com +1-919-301-3266
Libvirt virtualization library http://libvirt.org
Bob Rossi
2013-04-13 02:02:36 UTC
Permalink
Post by Eric Blake
Post by Bob Rossi
Hi,
I'm creating a new project and using autotools. I've done this before,
but for some reason this time I've noticed how many files autotools
creates. It totally pollutes the top level of my project.
lib <- Mine originally
aclocal.m4
Ask automake if that can be moved. Autoconf does not create it.
Wow! Thanks for this information, very helpful!

I didn't solve aclocal.m4 yet, but..
Post by Eric Blake
Post by Bob Rossi
AUTHORS
GNU Coding Standards requires this in the top level; but you can tell
automake that you don't want to comply to GNU Coding Standards if you
want to omit it. Autoconf does not create it.
Done --foreign to automake.
Post by Eric Blake
Post by Bob Rossi
autom4te.cache
Autoconf creates this, but it is local only; it is not packaged into
your tarballs. If you don't like it, you can use autom4te's --no-cache
option (your runs of autoconf will be slightly slower).
A nice feature request would be to move this into one of the directories
specified here,
AC_CONFIG_AUX_DIR(build/build-aux)
AC_CONFIG_MACRO_DIR(build/m4)
AM_CONFIG_HEADER(build/config.h)
or into a new one?
Post by Eric Blake
Post by Bob Rossi
bootstrap
Autotools don't create this. That must be your doing, or else you are
using gnulib.
Yes, this is mine. It's my autoreconf script. Does autoreconf work fine
these days? or is there another way to generate all the scripts?
Post by Eric Blake
Post by Bob Rossi
build-aux
Done, used a nested path with AC_CONFIG_AUX_DIR.
Post by Eric Blake
This is a subdirectory, precisely to hold a lot more files rather than
polluting the top level directory.
Post by Bob Rossi
ChangeLog
Done --foreign to automake.
Post by Eric Blake
GNU Coding Standards requires this in the top level. Same comments as
AUTHORS.
Post by Bob Rossi
config.h.in
Done, used a nested path with AM_CONFIG_HEADER.
Post by Eric Blake
This does not have to live at the top level. Use
AC_CONFIG_HEADERS([dir/config.h]) to stick it in a subdirectory instead.
Post by Bob Rossi
configure
Mandatory at the top level, for your package to be configured by end users.
OK, great.
Post by Eric Blake
Post by Bob Rossi
configure.in
That name is obsolete. You should be using configure.ac these days.
This file has to exist for you to create configure; and you need to ship
it to the user to comply with the rules of open source. No easy way to
stick it in a subdirectory.
OK, great.
Post by Eric Blake
Post by Bob Rossi
COPYING
GNU Coding Standards requires this in the top level. Same comments as
AUTHORS.
Done --foreign to automake.
Post by Eric Blake
Post by Bob Rossi
INSTALL
GNU Coding Standards requires this in the top level. Same comments as
AUTHORS.
Done --foreign to automake.
Post by Eric Blake
Post by Bob Rossi
m4
This is a subdirectory so that you don't have to pollute the top level
with helper .m4 files.
Done, used a nested path with AC_CONFIG_MACRO_DIR.
Post by Eric Blake
Post by Bob Rossi
Makefile.am
If you use automake, this is mandatory to comply with the rules of open
source. You don't have to use automake, in which case you can get away
without this file.
OK, great.
Post by Eric Blake
Post by Bob Rossi
Makefile.in
Mandatory if you want your use to do './configure && make' - configure
has to create a Makefile from something, after all.
OK, great.
Post by Eric Blake
Post by Bob Rossi
NEWS
GNU Coding Standards requires this in the top level. Same comments as
AUTHORS.
Done --foreign to automake.
Post by Eric Blake
Post by Bob Rossi
README
GNU Coding Standards requires this in the top level. Same comments as
AUTHORS.
Done --foreign to automake.
Post by Eric Blake
Post by Bob Rossi
I understand why configure, Makefile.am and bootstrap (autoreconf script)
need to exist in this directory.
Is it possible to configure the autotools so that everything else gets
put somewhere else (like in a nested directory)?
It's possible to configure automake to not enforce GNU Coding Standards
and drop some of the files, and to use AC_CONFIG_HEADERS to bury
config.h[.in] in a subdirectory. Beyond that, it's already a pretty
minimal list, and nothing listed above is really autoconf's fault except
for autom4te.cache (which can be disabled), so you are better off
complaining to other lists.
Thanks again for the help. I got the list down to,

aclocal.m4 <- ask automake
bootstrap <- my autoreconf script
configure
Makefile.am
autom4te.cache <- autoconf feature request to move to build/ dir
build
configure.ac
Makefile.in
src

I'd like to still move aclocal.m4 and autom4te.cache if possible.

We'll see.

Bob
Russ Allbery
2013-04-13 02:13:25 UTC
Permalink
Post by Bob Rossi
Post by Eric Blake
Post by Bob Rossi
I'm creating a new project and using autotools. I've done this before,
but for some reason this time I've noticed how many files autotools
creates. It totally pollutes the top level of my project.
lib <- Mine originally
aclocal.m4
Ask automake if that can be moved. Autoconf does not create it.
Wow! Thanks for this information, very helpful!
I didn't solve aclocal.m4 yet, but..
You can tell aclocal to write the file somewhere else (with --output).
You may want to try just putting it into your AC_CONFIG_MACRO_DIR and see
if it happens to work. Although that's going to force you to keep your
bootstrap script, since that means calling aclocal with a flag instead of
just running autoreconf.
Post by Bob Rossi
Post by Eric Blake
Post by Bob Rossi
bootstrap
Autotools don't create this. That must be your doing, or else you are
using gnulib.
Yes, this is mine. It's my autoreconf script. Does autoreconf work fine
these days? or is there another way to generate all the scripts?
autoreconf just works, and I would pass it --no-cache. I always suppress
the cache and don't really notice a significant difference.
--
Russ Allbery (***@stanford.edu) <http://www.eyrie.org/~eagle/>
Miles Bader
2013-04-15 01:35:30 UTC
Permalink
Post by Bob Rossi
I'm creating a new project and using autotools. I've done this
before, but for some reason this time I've noticed how many files
autotools creates. It totally pollutes the top level of my project.
Heh.... Autoconf/automake are positively restrained and minimalist
compared to gnulib! [Which creates vast quantities of fileş with no
particular pattern, some of which are source files (and so must be
included in the project), others of which are dev/build-time
trash... even writing a .gitignore file for a gnulib'd project is
a hugely fiddly and frustrating exercise...]

-miles
--
Resign, v. A good thing to do when you are going to be kicked out.
Loading...