This is a multi-part message in MIME format.
--------------070907080807060400040606
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:
> http://www.zip.com.au/~dtucker/tmp/o...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





--------------070907080807060400040606
Content-Type: text/plain;
name="bootstrap.sh"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline;
filename="bootstrap.sh"

#! /bin/sh

cat > configure.ac < AC_INIT([test], [0.0])
AC_PREREQ(2.59)

AC_PROG_CC

AC_CONFIG_COMMANDS(
[autodeps],
[echo creating header dependencies ...;
makedepend -I. -- -- *.c]
)
AC_OUTPUT([Makefile])
EOF


cat > Makefile.in < CFLAGS=@CFLAGS@

all: foo

foo: foo.c

EOF


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


cat > foo.c < #include
#include

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


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


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

_______________________________________________
openssh-unix-dev mailing list
openssh-unix-dev@mindrot.org
https://lists.mindrot.org/mailman/li...enssh-unix-dev

--------------070907080807060400040606--