After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 336364 - Get rid of EXPANDED_* substitutions
Get rid of EXPANDED_* substitutions
Status: RESOLVED FIXED
Product: gdm
Classification: Core
Component: general
2.14.x
Other All
: Normal enhancement
: ---
Assigned To: GDM maintainers
GDM maintainers
Depends on:
Blocks:
 
 
Reported: 2006-03-28 15:59 UTC by Julio Merino
Modified: 2006-03-28 23:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Proposed patch. (49.09 KB, patch)
2006-03-28 16:00 UTC, Julio Merino
none Details | Review

Description Julio Merino 2006-03-28 15:59:24 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.)
Comment 1 Julio Merino 2006-03-28 16:00:09 UTC
Created attachment 62212 [details] [review]
Proposed patch.
Comment 2 Brian Cameron 2006-03-28 23:45:16 UTC
Thanks, applied to CVS head.