[OpenAFS-devel] 1.3.80 compilation fails on FC3 linux

Jeffrey Hutzelman jhutz@cmu.edu
Tue, 22 Mar 2005 17:43:43 -0500


On Tuesday, March 22, 2005 11:56:35 AM +0000 William John Murray 
<w.murray@rl.ac.uk> wrote:

>      Hello there,
>          I have problems compiling 1.3.80 on my FC3 linux machine.
> The specific error message is:
>
> Building in directory: MODLOAD-2.6.10-1.770_FC3-SP
> make[4]: Entering directory
> `/usr/local/src/openafs-1.3.80/src/libafs/MODLOAD-2.6.10-1.770_FC3-SP'
> Makefile.common:51: warning: overriding commands for target `.c.o'
> /usr/local/src/openafs-1.3.80/src/config/Makefile.config:132: warning:
> ignoring old commands for target `.c.o'
> env EXTRA_CFLAGS="" ./make_kbuild_makefile.pl MODLOAD-2.6.10-1.770_FC3-
> SP libafs.ko /usr/local/src/openafs-1.3.80/src/config/Makefile.config
> Makefile.afs Makefile.common
> env: ./make_kbuild_makefile.pl: No such file or directory
> make[4]: *** [libafs.ko] Error 127
>
> I worked around by changing MakefileProto.LINUX.in to
> .FORCE:
> libafs.ko: .FORCE
> 	env EXTRA_CFLAGS="${EXTRA_CFLAGS}" ../make_kbuild_makefile.pl ${KDIR}
> $@ @TOP_OBJDIR@/src/config/Makefile.config Makefile.afs Makefile.common
> 	env EXTRA_CFLAGS="${EXTRA_CFLAGS}" $(MAKE) -C ${LINUX_KERNEL_PATH}
> M=@TOP_OBJDIR@/src/libafs/${KDIR} modules
>
> This used to be ${source}/make_kbuild_makefile.pl
>
>   With this change it seems to build OK, and at a first look runs, but I
> have no idea if this would cause problems for other systems...

Ugh; this has changed so many times...

./make_kbuild_makefile.pl
  This was the original model.  It worked fine, but not for objdir build
  environments where the script isn't in "."

../${srcdir}/make_kbuild_makefile.pl
  This change was made back in June.  I'm not sure what environment this
  was intended to work in.  It happens to work when _not_ building in
  an objdir, because in that case ${srcdir} will evaluate to '.', so it
  is running ../make_kbuild_makefile.pl, which works because the current
  directory is actually src/libafs/XXX (for some XXX).

  However this still doesn't work for the objdir case, unless you are very
  lucky about what the value of ${srcdir} happens to be.  So as I said,
  I don't know what the motivation here was.

${srcdir}/make_kbuild_makefile.pl
  This was the most recent attempt (just before 1.3.80), and actually
  _does_ work for the objdir case, because ${srcdir} then refers to the
  top-level src/libafs directory, where the script lives.  But it does
  not work in the non-objdir case, where ${srcdir} is '.' and the pwd
  is the module build directory, where the script does not live.

  Unfortunately, I missed this nuance when reviewing this patch.  I guess
  I should do test builds more often...


Anyway, the correct answer is to stop trying to use ${srcdir} at all, and 
instead use an absolute path based on the location of the sources:

@TOP_SRCDIR@/libafs/make_kbuild_makefile.pl


-- Jeff