have configure generate header dependencies automatically
Roumen Petrov
openssh at roumenpetrov.info
Sun Jan 27 23:41:01 EST 2008
Hi Darren,
> On Thu, Jan 10, 2008 at 09:11:18AM +1100, Darren Tucker wrote:
> [...]
>> That said, I think something like that (or mkdep from OpenBSD as
>> mentioned in my original mail) would be OK as long as either the result
>> is checked into CVS (not done at build time) or is an optional extra.
>>
>> The down side of this strategy is that the output of those types of
>> tools is usually dependent on the compiler flags passed to the tool.
>> Hence my "if all you have is a hammer, every problem looks like a nail"
>> solution using configure :-)
>
> Here's one possible solution. It preprocesses the entire tree and
> strips out everything except the #includes, processes the tree
> with gcc -MM and stores the result. Because the #ifdefs have been
> removed, the result is effectively the dependencies for every possible
> configuration (all at once).
>
> At configure time, if the dependency info is available then it's
> appended to the Makefile, otherwise it's a no-op. If we check the
> depend files into CVS and make sure they're current when building
> releases then I think it would work out.
>
> If anyone wants to try this (particularly with a non-gcc compiler
> and vendor make) I have put up a snapshot with this change here:
> http://www.zip.com.au/~dtucker/tmp/openssh-depend3.tar.gz
>
> Index: Makefile.in
> ===================================================================
> [SNIP]
What about makedepend or ccmakedep command ?
I think that dependency should be generated only if is requested.
As example Makefile.in to end with:
=====
depend:
(cd openbsd-compat && $(MAKE))
makedepend -- $(CFLAGS) -- $(srcdir)/*.c
=====
If the commands above are not so good then I don't have objections
depend-files to be distributed with source. In this case proposed by you
shell script mkdepend.sh could be used to generate them before source
packages to be created.
I don't agree with changes in configure. The command config.status can
recreate makefiles and dependency will lost. I attach file
"bootstrap.sh" to show sample solution - macro AC_CONFIG_COMMANDS.
Since the dependency is suitable mostly for developers I prefer solution
based on new tag(in makefile{.in}) without dependency information to be
distributed with source code.
Regards,
Roumen
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: bootstrap.sh
Url: http://lists.mindrot.org/pipermail/openssh-unix-dev/attachments/20080127/5e9165c9/attachment.ksh
More information about the openssh-unix-dev
mailing list