On Fri, 15 Dec 2000, Sascha Schumann wrote:
> On Fri, 15 Dec 2000, Mo DeJong wrote:
>
> > Hello.
> >
> > Here is a small patch that fixes up a couple of problems that
> > cause the configure script to break when run in a build
> > directory that is not the same as the source directory.
> > It also uses $MKDIR not $MKDIR -p, the -p thing is an
> > error, it ends up making a directory named -p in the
> > build dir.
>
> Applied. I've also taken the chance to fix some other VPATH
> issues, so that APR builds now cleanly in a separate
> directory. Thanks,
>
> - Sascha
Great!
My next question is related to the way the configure script
seems to be doing extra substs that are not done when
you simply run ./config.status. Here is a quick example.
% cd ~/project/build/apr
% /home/mo/project/subversion/apr/configure
...
% cd network_io/unix
% make
gcc -DLINUX=2 -pthread -D_REENTRANT -c -I../../include
-I/home/mo/project/subversion/apr/network_io/unix/../../include
-I../../include/arch/unix
-I/home/mo/project/subversion/apr/network_io/unix/../../include/arch/unix
-I../../include/arch/unix
-I/home/mo/project/subversion/apr/network_io/unix/../../include/arch/unix
/home/mo/project/subversion/apr/network_io/unix/sockets.c
% cp Makefile Makefile.orig
% cd ../..
% ./config.status
...
% cd network_io/unix
% rm sockets.o
% make
make: *** No rule to make target `poll.o', needed by `all'. Stop.
Why you ask? Because the srcdir, VPATH, and -I$(srcdir) and
not getting put into the Makefile when ./config.status is run.
% diff -u Makefile.orig Makefile
--- Makefile.orig Fri Dec 15 13:33:22 2000
+++ Makefile Fri Dec 15 13:33:30 2000
@@ -1,6 +1,3 @@
-srcdir = /home/mo/project/subversion/apr/network_io/unix/
-VPATH = /home/mo/project/subversion/apr/network_io/unix/
-
# Generated automatically from Makefile.in by configure.
RM=rm
CC=gcc
@@ -11,7 +8,7 @@
INCDIR=../../include
OSDIR=$(INCDIR)/arch/unix
DEFOSDIR=$(INCDIR)/arch/unix
-INCLUDES=-I$(INCDIR) -I$(srcdir)$(INCDIR) -I$(OSDIR) -I$(srcdir)$(OSDIR)
-I$(DEFOSDIR) -I$(srcdir)$(DEFOSDIR)
+INCLUDES=-I$(INCDIR) -I$(OSDIR) -I$(DEFOSDIR)
MKDEP=../../helpers/mkdep.sh
The code that does this stuff is in configure.in:
dnl #----------------------------- Fixup Makefiles for VPATH support
changequote({,})
if test -n "$USE_VPATH"; then
if test -n "$USE_MM"; then
MAKEFILE3="$MAKEFILE3 $mm_dir/Makefile"
fi
for makefile in $MAKEFILE1 $MAKEFILE2 $MAKEFILE3; do
dir=`echo $makefile|sed 's%[^/][^/]*$%%'`
(cat <<EOF
srcdir = $abs_srcdir/$dir
VPATH = $abs_srcdir/$dir
EOF
) | cat - $makefile | \
sed \
-e 's#-I\($(INCDIR[0-9]*)\)#-I\1 -I$(srcdir)\1#g' \
-e 's#-I\($(OSDIR[0-9]*)\)#-I\1 -I$(srcdir)\1#g' \
-e 's#-I\($(DEFOSDIR[0-9]*)\)#-I\1 -I$(srcdir)\1#g' \
> tmp
cp tmp $makefile
done
I guess I just don't see why the VPATH and $(srcdir) stuff
is not put directly into the Makefile.in's and then substituted
in the normal way.
Could someone tell me why it was done this way? Is there
any reason we could not switch over to using automake?
Mo DeJong
Red Hat Inc