GNOME Bugzilla – Bug 336364
Get rid of EXPANDED_* substitutions
Last modified: 2006-03-28 23:45:16 UTC
At the moment, gdm expands many directory-related variables in the configure script and then feeds the results back to the Makefiles and generated files. This is incorrect for multiple reasons: 1) Nothing warrants that the variables need a single expansion to get the real value. Sometimes they have two indirections, so a single 'eval' call only expands one and leaves the variable still unexpanded. 2) Makefiles get the expanded values so all variable inter-dependencies are lost. E.g., if gdmsysconfdir depends on sysconfdir, saying 'make sysconfdir=/foo' will not change gdmsysconfdir. 3) It goes against the GNU coding standards (because of 2) and against the recommended automake/autoconf usage. Related to this, you can read "(autoconf.info)Installation Directory Variables"; it gives a detailed explanation on why this variable expansion is not suggested at all. 4) There is a comment in configure.ac saying that it's wrong and ought to be fixed ;) What I have done is to get rid of all the EXPANDED_* variables. Instead of trying to evaluate the *dir variables from the configure.ac script, I delegated that task to the appropriate Makefile.am files. As a side effect, some files need to be generated from the Makefiles instead of from AC_OUTPUT; "(automake.info)Scripts" has more information on how this has to be done. Similarly, many AC_DEFINE calls are gone and instead the Makefiles pass -D flags where appropriate (in which case they are all completely expanded). The result is that the Makefiles are now standards-compliant and behave appropriately: the user can override variables from the command line and get the expected results (i.e. all those that rely on others are properly expanded too). And as you can see from the patch, configure.ac is greatly simplified at the expense of some extra (but trivial!) code in the Makefiles. (Note that EXPANDED_SESSDIR is just removed from the code because it is not used anywhere in gdm's tree. Seems to be a leftover from previous versions.)
Created attachment 62212 [details] [review] Proposed patch.
Thanks, applied to CVS head.