Skip to Content.
Sympa Menu

devel - Re: [sympa-dev] Autotools cleanup

Subject: Developers of Sympa

List archive

Chronological Thread  
  • From: Olivier Salaün <address@concealed>
  • To: Guillaume Rousse <address@concealed>
  • Cc: address@concealed
  • Subject: Re: [sympa-dev] Autotools cleanup
  • Date: Fri, 14 Mar 2008 17:20:14 +0100

Hello Guillaume,

Sorry we did not take your work into account earlier, just because lack of time....

We are aware that the way we are using the autotools is far from perfect and your involvment in this task is a good occasion for us to make the Sympa installation scripts a bit cleaner.
Apart from the satisfaction of using the autotools the proper way, here are the goals we'd like to achieve while performing the changes :

1. make the scripts more maintainable. Currently all Makefile include
lots of duplicate variable definitions that we'd like to get rid
of, ie define them once only.
2. make it easier for contributors/packagers to understand Sympa
installation process. This is the main advantage of doing things
the "straight" way
3. keep things working. Over time, the installation scripts have
become a spaghetti plate, however it does the installation job and
we need to validate any changes before committing changes !

Step (3) should be easier to achieve, given your latest set of atomic patches, whereas the first 3 ones mix lots of changes and are therefore more difficult to check on our end.
However, let me comment all your change proposals below :

Guillaume Rousse a écrit :
Guillaume Rousse a écrit :
Hello developpers.

I'm mandriva sympa package maintainer. We met during JRES, and I told
you how awfull sympa autotools usage was...

Here are two first patches attempting to change the situation, and move
toward a standard use of those tools.

The first one (autoconf-cleanup) doesn't change much in the installation
process, it's rather a purely syntaxic cleanup:
- rename configure.in to configure.ac
ok
- define software version inside configure.ac directly
Currently we are maintaining in a separate .version file.
This file is later used to

1. include the current version in Version.pm
2. compare installed version and to-be-installed versions during an
upgrade and print significant changes during the "make install"
(via the important_changes.pl script)

It was convenient to simply update this .version file while preparing a new Sympa release, however we might change our habits if needed.

Could you please explain why putting the Sympa version number in configure.ac is a required change ?
- use current AC_INIT and AC_OUTPUT syntax
- define autoconf 2.59 as minimal version
- wrap long lines
- use AC_HELP_STRING for formatting options help output
- make all binaries tests use the same logic, meaning no default value,
and only look in PATH if no value given by user
- don't call AC_SUBST for variables set through AC_PATH_PROG (done
implicitely)
ok
- don't put explicit substitutions targets in Makefile.am, automake does
it automatically
Can you explain?
- removal of AM_MAINTAINER_MODE in configure.ac (it prevent automatic
makefile rebuild/configure re-invocation)
ok
The second one (use-automake-correctly), bring real change. It is not a
finished jobs (too many issues to discuss), but it shows how automake
is supposed to be used. So:
- removal of all targets already defined by automake (install, all, etc..)
- removal of all recursion targets (makedoc, makeman,...)
This seems to be a legitimate change, however note that it requires a way to ensure we don't loose any targets, ie lots of testing.
- conversion of all static Makefile in src and doc trees to Makefile.ams
- definition of SUBDIR variable in top-level, src and doc subdirs
Makefile.am
- definition of primary targets in those makefile, as foo_BAR variables,
where foo is the installation directory, and BAR the type of the file to
install
ok
- definition of EXTRA_DIST and CLEANFILES variable to ensure make clean
and make dist will work as expected
Can you please explain which files will be declared as EXTRA_DIST?
- use a standard in-place substitution system for variables defined by
configure process, as per
http://www.gnu.org/software/autoconf/manual/autoconf-2.57/html_mono/autoconf.html#SEC24
The current use of the subst.pl script is pretty satisfactory ; it's flexible and the script also allows us to do additional changes like commenting do_log() calls that can be skipped (performances issue). The only drawback of this substitution process (appart its non standard character) is that we need to set lots of (error-prone) environment variables in Makefiles before each call.
The new substitution system that you refer to seems less flexible (you need to define a twisted sed expression in the Makefile and extend this engine for each new variable) and seems to oblige us to add the '.in' extension to perl modules, which is not convenient to us.
- drop all reference to custom variables in configure.ac for those
directories defined in GNU's standards
Can you precise which are these custom variables?
- drop non-standard /home/sympa prefix
This prefix has been used for 10 years now, therefore it's not so simple to change it because it would break existing installations during upgrades.
What is the reason for having a different default ? Which one do you recommend ?
- usage of a config.h headers rather than command line flags to pass C
symbols for building binaries
Please explain why this change is needed?
I didn't finished the work mainly because setup is unclear. Original
configure script defines a lots of different subdirectories with similar
content type, whereas most software usually just define directories for:
- configuration ($prefix/etc/sympa by default)
- non-variable content ($prefix/share/sympa by default)
- variable content ($prefix/var/lib/sympa by default)
- documentation ($prefix/share/doc/sympa by default)
and then install content relatively to those top-level directories.
We had this change in mind, ie gathering all perl modules in a lib/ directory, all daemons in sbin/, etc.
However I'd consider this a second time work, after all the other cleaning and simplification has been done.
I didn't configured installation, nor ensured substitutions were
correctly handled for those destination directories not cleary matching
this standard setup (samples and user config).

Also, you'll notice how performing a lot of substitutions in perl
modules is cumbersome. You'd rather have a unique .pm files defining
those constants (using constant pragma, or ReadOnly module), sourced by
all others, so as to substitude only once.
It could be a good idea to get rid of all --VAR-- references in the code, however these are precisely data that are part of the bootstrap (--PERL-- refers to the path to the perl interpreter, --LIBDIR-- tells where to find other required perl modules, --CONFIG-- tells where the main configuration file stands, etc). Therefore we need these "bootstrap" information to be provided quite early in the process.
And I didn't handled the po subdirectory neither. Not very difficult to
do, but the procedure to do it is a bit different from other contents,
so I wanted first to demonstrate pure automake usage. For more
explanations, I suggest reading http://www.lrde.epita.fr/~adl/autotools.html

Note that the po/Makefile has been changed by David in the meanwhile, just in case you're working on it.
Hope you'll appreciate the work :)
Of course we do ; you're providing time and expertise that we don't have . Moreover it's useful to have an external point of view of somebody who asks why when things are too twisted :)
I realized just after sending this mail the patch was broken, as it
didn't included removed and renamed files.

Here is a fixed subset of previous patch, dealing with doc directory
only. The list of changes follows:
- conversion of static Makefile in doc and doc/man8 to
automake-generated makefiles
ok
- removal of installation targets (installdoc, installman) in top-level
Makefile, and usage of primary variable (doc_DATA, man_MANS) to let
automake handle them
I could not find any definition of doc_DATA in the provided patches...
- removal of recursion targets (documentation, man) in top-level
Makefile, and usage of SUBDIR variable to let automake handle it
- removal of all target in top-level Makefile, to let automake handle it
- removal of clean target in top-level Makefile, and usage of CLEANFILES
variable to met automake handle it
- definition of EXTRA_DEST variable to correctly include file in archive
generated by 'make dist'
- removal of .latex2html-init file, as it is not handled by build process
ok
- removal of man pages, as they are generated from pod files
- test for pod2man in configure, and fatal error if not found

ok
I hope this is easier to understand.

Next week I'll manage to test the last set of patches you provided in your last email and I'll let you know about the results.
If things work fine, I'll commit the changes in our SVN.

Thanks again for your help Guillaume.



Archive powered by MHonArc 2.6.19+.

Top of Page