Merge lp:~xnox/upstart/no-multibuild into lp:upstart
Status: | Merged |
---|---|
Merged at revision: | 1575 |
Proposed branch: | lp:~xnox/upstart/no-multibuild |
Merge into: | lp:upstart |
Diff against target: |
98 lines (+25/-22) 5 files modified
ChangeLog (+8/-0) init/conf.c (+17/-0) init/xdg.c (+0/-20) test/Makefile.am (+0/-1) util/Makefile.am (+0/-1) |
To merge this branch: | bzr merge lp:~xnox/upstart/no-multibuild |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
James Hunt | Approve | ||
Review via email: mp+195471@code.launchpad.net |
Description of the change
At the moment xdg.c is compiled twice:
init/Makefile.am compiles init/xdg.c -> init/xdg.o
- used by init/init and some init/test_* binaries
util/Makefile.am compiles init/xdg.c -> util/xdg.o
- used by util/initctl and some util/test_* binaries
When subdir-objects option to automake is enabled (which will be the default in automake 2.0),
both init/Makefile.am and util/Makefile.am will compile init/xdg.c into init/xdg.o.
That's going to be a problem, because at the moment there is conditional compilation in xdg.c, and the two xdg.o are different. With subdir-objects, it will then fail to compile either one of init/* or util/*
So, I propose to remove the conditional compilation from xdg.c, and move the definition of the two variables (user_mode and session_file) from xdg.c into conf.c. Those two variables are declared as extern in other places in init/* and have a conflicting definition in util/*.
I'm not sure what's the best practice to managing defitions of extern variables. I guess we can split them into init/init_externs.c where all externs definitions are stored, instead of being scattered around various init/*.c files. In practice, xdg.c is the only one that is common across multiple subdirs so far.
LGTM.