This is a multi-part message in MIME format.
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit

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:
> Index:
> ================================================== =================
> [SNIP]

What about makedepend or ccmakedep command ?

I think that dependency should be generated only if is requested.
As example to end with:
(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 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
"" 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.


Content-Type: text/plain;
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;

#! /bin/sh

cat > < AC_INIT([test], [0.0])


[echo creating header dependencies ...;
makedepend -I. -- -- *.c]


all: foo

foo: foo.c


cat > foo.h < #ifndef _FOO_H
#define _FOO_H
#endif /*ndef _FOO_H*/

cat > foo.c < #include

int main() {printf("foo\n"); return(0);}

echo ' ./configure ...'
echo ' ./config.status ...'

Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

openssh-unix-dev mailing list