You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Kevin Pilch-Bisson <ke...@pilch-bisson.net> on 2001/01/23 21:08:02 UTC

Patch for supporting VPATH builds

Hi all,

I have put together a patch for subversion which will allow it to do
VPATH builds.  It still can't do `make dist' or `make distcheck', since
those would require extensive changes to both neon and apr.  However if
you check out the subversion source, apr source and neon source, you
could change to a different subdirectory and '../subversion/configure &&
make && cd subversion && make check', and it would work, except for two
caveats.

1) There were three patches to apr needed to support this.  Two of these
have already been accepted and committed.  One is pending, although I
have sent it to the dev@apr.apache.org list.

2) Two files (Makefile.in and src/dav_props.h) in neon need to be
(minimally) modified in order for this to work.  I didn't want to
suggest incorporating these into neon, since the problems they address
have been modified in neon-0.10.0.

This suggests that we can do one of three things.  
1) Do nothing with my patch for now.

2) Apply the patch now, and still not be able to use vpath builds until
the third patch to APR is accepted and we upgrade to neon-0.10.0. Or

3) Apply the patch now, and leave instructions somewhere in the source
tree for how to modify neon and apr.  (I somewhat dislike this in that
it requires us to monitor apr more extensively, to remove the
instructions once they become unnecessary)

My personal preference is number 2, with some effort being made to
upgrade to neon-0.10.0 in the near future.  I would be willing to do the
work except that I don't know enough about neon/dav.  I did take a small
look at what would be require for the upgrade, and as far as I can tell
it involves changing the location of the neon library in one
Makefile.am, and changing two functions which rely on neon functions
that no longer exist. (The neon functions are
dav_proplist_set_resource_handler, and dav_proplist_get_resource.
All occurrences of them are in libsvn_ra_dav/fetch.c)


Anyway two patch files are included below, the first was made with cvs
diff -up, and the second with diff -r -c since I don't have cvs access
to neon.  (not that I really want it, no offence Greg :)

BTW, sorry about the very long email.

PATCH #1
Modified: (almost all) Makefile.am's, configure.in, and test shell
scripts.
Log:    Modified build structure to not paths relative to the source
tree for outputs, and not relative to the build tree for inputs, thus
allowing VPATH builds


Index: Makefile.am
===================================================================
RCS file: /cvs/subversion/Makefile.am,v
retrieving revision 1.14
diff -u -p -r1.14 Makefile.am
--- Makefile.am	2000/12/22 21:25:38	1.14
+++ Makefile.am	2001/01/23 20:30:13
@@ -12,6 +12,12 @@ SUBDIRS = apr expat-lite neon subversion
 
 ACLOCAL = @ACLOCAL@ -I ac-helpers
 
+## Note, we have to add these in so that they get included in the distribution
+EXTRA_DIST = ac-helpers/berkeley-db.m4 ac-helpers/config.guess \
+            ac-helpers/config.sub ac-helpers/install-sh ac-helpers/ltconfig \
+            ac-helpers/ltmain.sh ac-helpers/missing ac-helpers/mkinstalldirs \
+            ac-helpers/svn-apache.m4 ac-helpers/svn-macros.m4
+
 ## Use Karl's script to create a Changelog from CVS.
 
 log: changelog
Index: configure.in
===================================================================
RCS file: /cvs/subversion/configure.in,v
retrieving revision 1.45
diff -u -p -r1.45 configure.in
--- configure.in	2001/01/10 00:08:00	1.45
+++ configure.in	2001/01/23 20:30:14
@@ -8,6 +8,9 @@ dnl First line is *required*;  sanity-ch
 AC_INIT(subversion/include/svn_types.h)
 AC_CONFIG_AUX_DIR(ac-helpers)
 
+dnl $MKDIR is required for configuring apr and neon in a vpath build
+MKDIR=mkdir
+
 dnl Generate config.nice early (before the args are munged)
 SVN_CONFIG_NICE(config.nice)
 
Index: expat-lite/Makefile.am
===================================================================
RCS file: /cvs/subversion/expat-lite/Makefile.am,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile.am
--- expat-lite/Makefile.am	2000/11/04 02:44:12	1.2
+++ expat-lite/Makefile.am	2001/01/23 20:30:14
@@ -8,7 +8,14 @@
 lib_LTLIBRARIES = libexpat.la
 
 ## Sources needed to build each library (names canonicalized)
-libexpat_la_SOURCES = hashtable.c xmlparse.c xmlrole.c xmltok.c
+libexpat_la_SOURCES = asciitab.h hashtable.c hashtable.h iasciitab.h \
+                      latin1tab.h nametab.h utf8tab.h xmldef.h xmlparse.c \
+                      xmlparse.h xmlrole.c xmlrole.h xmltok.c xmltok.h \
+                      xmltok_impl.h
+
+## This is needed because they are included into xmltok.c, but shouldn't be
+## put in libexpat_la_SOURCES, since it should not be compiled directly
+EXTRA_DIST = xmltok_impl.c xmltok_ns.c
 
 ### still need to set up the byte-order. see xmldef.h
 CFLAGS = -DXML_NS
Index: subversion/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/Makefile.am,v
retrieving revision 1.16
diff -u -p -r1.16 Makefile.am
--- subversion/Makefile.am	2000/10/24 19:45:25	1.16
+++ subversion/Makefile.am	2001/01/23 20:30:14
@@ -16,16 +16,19 @@ SUBDIRS = tests-common               \
 ## Include these extra files when building `dist' target
 
 EXTRA_DIST = LICENSE                   \
-	     include/svn_types.h       \
-             include/svn_string.h      \
-             include/svn_hash.h        \
-             include/svn_error.h       \
-             include/svn_parse.h       \
+             include/svn_base64.h      \
+             include/svn_client.h      \
              include/svn_delta.h       \
+             include/svn_error.h       \
              include/svn_fs.h          \
-             include/svn_wc.h          \
-             include/svn_client.h      \
+             include/svn_hash.h        \
              include/svn_io.h          \
              include/svn_path.h        \
+             include/svn_quoprint.h    \
              include/svn_ra.h          \
+             include/svn_string.h      \
+             include/svn_test.h        \
+	     include/svn_types.h       \
+             include/svn_wc.h          \
              include/svn_xml.h
+             #include/svn_parse.h       \
Index: subversion/client/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/client/Makefile.am,v
retrieving revision 1.16
diff -u -p -r1.16 Makefile.am
--- subversion/client/Makefile.am	2001/01/10 00:08:00	1.16
+++ subversion/client/Makefile.am	2001/01/23 20:30:14
@@ -8,16 +8,18 @@ svn_SOURCES = main.c status.c props.c   
               trace-update.c trace-commit.c
 
 ## Flags needed when compiling:
-INCLUDES = -I. -I../include -I../../apr/include -I../../expat-lite
+INCLUDES = -I@srcdir@ -I@top_srcdir@/subversion/include \
+            -I@top_srcdir@/apr/include -I@top_srcdir@/expat-lite \
+            -I$(top_builddir)/apr/include
 
 ## Libraries this binary depends upon:
-svn_LDADD = ../libsvn_client/libsvn_client.la     \
-            ../libsvn_wc/libsvn_wc.la             \
-            ../libsvn_delta/libsvn_delta.la       \
-	    ../libsvn_subr/libsvn_subr.la         \
-            ../tests-common/libsvn_test_editor.la \
+svn_LDADD = $(top_builddir)/subversion/libsvn_client/libsvn_client.la     \
+            $(top_builddir)/subversion/libsvn_wc/libsvn_wc.la             \
+            $(top_builddir)/subversion/libsvn_delta/libsvn_delta.la       \
+	    $(top_builddir)/subversion/libsvn_subr/libsvn_subr.la         \
+            $(top_builddir)/subversion/tests-common/libsvn_test_editor.la \
             @SVN_APR_LIBS@                        \
-            ../../expat-lite/libexpat.la
+            $(top_builddir)/expat-lite/libexpat.la
 
 
 ## Make libtool be quiet
Index: subversion/client/tests/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/client/tests/Makefile.am,v
retrieving revision 1.2
diff -u -p -r1.2 Makefile.am
--- subversion/client/tests/Makefile.am	2000/11/27 19:12:29	1.2
+++ subversion/client/tests/Makefile.am	2001/01/23 20:30:14
@@ -1,3 +1,5 @@
+## Note, pass them the source xml directory, since they can't find it in VPATH
+## builds
 check:
-	sh ./svn-test.sh
-	sh ./svn-test2.sh
+	sh @srcdir@/svn-test.sh @top_srcdir@/subversion/tests-common/xml
+	sh @srcdir@/svn-test2.sh @top_srcdir@/subversion/tests-common/xml
Index: subversion/client/tests/svn-test.sh
===================================================================
RCS file: /cvs/subversion/subversion/client/tests/svn-test.sh,v
retrieving revision 1.28
diff -u -p -r1.28 svn-test.sh
--- subversion/client/tests/svn-test.sh	2000/12/06 19:43:30	1.28
+++ subversion/client/tests/svn-test.sh	2001/01/23 20:30:14
@@ -1,6 +1,7 @@
 #!/bin/sh
 
 SVN_PROG=../svn
+XML_DIR=$1
 TEST_DIR_1=t1
 TEST_DIR_2=t2
 COMMIT_RESULTFILE_NAME=commit
@@ -26,7 +27,7 @@ echo
 echo "Checking out ${TEST_DIR_1}."
 ${SVN_PROG} checkout                                      \
       --target-dir ${TEST_DIR_1}                          \
-      --xml-file ../../tests-common/xml/co1-inline.xml    \
+      --xml-file $XML_DIR/co1-inline.xml    \
       --revision 1                                        \
       --ancestor-path ${ANCESTOR_PATH}
 
Index: subversion/client/tests/svn-test2.sh
===================================================================
RCS file: /cvs/subversion/subversion/client/tests/svn-test2.sh,v
retrieving revision 1.11
diff -u -p -r1.11 svn-test2.sh
--- subversion/client/tests/svn-test2.sh	2001/01/04 02:42:59	1.11
+++ subversion/client/tests/svn-test2.sh	2001/01/23 20:30:14
@@ -3,6 +3,7 @@
 # Testing merging and conflict resolution.
 
 SVN_PROG=../svn
+XML_DIR=$1
 TEST_DIR_1=t1
 TEST_DIR_2=t2
 COMMIT_RESULTFILE_NAME=commit2
@@ -32,7 +33,7 @@ echo
 echo "Checking out ${TEST_DIR_1}."
 ${SVN_PROG} checkout                                      \
       --target-dir ${TEST_DIR_1}                          \
-      --xml-file ../../tests-common/xml/co1-inline.xml    \
+      --xml-file $XML_DIR/co1-inline.xml    \
       --revision 1                                        \
       --ancestor-path ${ANCESTOR_PATH}
 
@@ -40,13 +41,13 @@ check_status 1
 
 ### Give t1/iota some file-properties via update.
 echo "Updating t1/iota with properties.  (up2.xml)"
-${SVN_PROG} update --xml-file ../../tests-common/xml/up2.xml \
+${SVN_PROG} update --xml-file $XML_DIR/up2.xml \
                    --revision 17 ${TEST_DIR_1}
 check_status 2
 
 ### Give t1/A some dir-properties via update.
 echo "Updating t1/A/ with properties.  (up5.xml)"
-${SVN_PROG} update --xml-file ../../tests-common/xml/up5.xml \
+${SVN_PROG} update --xml-file $XML_DIR/up5.xml \
                    --revision 18 ${TEST_DIR_1}
 check_status 3
 
@@ -83,13 +84,13 @@ check_status 8
 
 ### Update again.  This update should create conflicting properties.
 echo "Updating with (conflicting) properties.  (up-props.xml)"
-${SVN_PROG} update --xml-file ../../tests-common/xml/up-props.xml \
+${SVN_PROG} update --xml-file $XML_DIR/up-props.xml \
                    --revision 20 ${TEST_DIR_1}
 check_status 9
 
 ### Update again.  This update should create conflicting text.
 echo "Updating with (conflicting) text.  (pipatch.xml)"
-${SVN_PROG} update --xml-file ../../tests-common/xml/pipatch.xml \
+${SVN_PROG} update --xml-file $XML_DIR/pipatch.xml \
                    --revision 21 ${TEST_DIR_1}
 check_status 10
 
Index: subversion/libsvn_client/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_client/Makefile.am,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile.am
--- subversion/libsvn_client/Makefile.am	2000/12/14 18:48:15	1.9
+++ subversion/libsvn_client/Makefile.am	2001/01/23 20:30:14
@@ -16,7 +16,8 @@ libsvn_client_la_SOURCES = checkout.c up
 ## Build flags ---------
 
 ## These should be variables, no?  (from autoconf?)
-INCLUDES = -I../include -I../../apr/include -I../../expat-lite
+INCLUDES = -I@top_srcdir@/subversion/include -I@top_srcdir@/apr/include \
+            -I@top_srcdir@/expat-lite -I$(top_builddir)/apr/include
 
 
 ## Put `tests' after `.' when we have a tests directory.
Index: subversion/libsvn_delta/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_delta/Makefile.am,v
retrieving revision 1.14
diff -u -p -r1.14 Makefile.am
--- subversion/libsvn_delta/Makefile.am	2000/10/26 20:02:25	1.14
+++ subversion/libsvn_delta/Makefile.am	2001/01/23 20:30:14
@@ -14,7 +14,8 @@ libsvn_delta_la_SOURCES = xml_parse.c xm
 ## Build flags ---------
 
 ## These should be variables, no?  (from autoconf?)
-INCLUDES = -I../include -I../../apr/include -I../../expat-lite
+INCLUDES = -I@top_srcdir@/subversion/include -I@top_srcdir@/apr/include \
+            -I@top_srcdir@/expat-lite -I$(top_builddir)/apr/include
 
 
 ## Build *this* directory first, *then* the test subdirectory!
Index: subversion/libsvn_delta/tests/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_delta/tests/Makefile.am,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile.am
--- subversion/libsvn_delta/tests/Makefile.am	2001/01/10 00:08:00	1.13
+++ subversion/libsvn_delta/tests/Makefile.am	2001/01/23 20:30:14
@@ -9,34 +9,35 @@ xml_output_test_SOURCES = xml-output-tes
 svndiff_test_SOURCES = svndiff-test.c
 
 ## Flags needed when compiling:
-INCLUDES = -I../../include -I../../../apr/include -I../../../expat-lite
+INCLUDES = -I@top_srcdir@/subversion/include -I@top_srcdir@/apr/include \
+            -I@top_srcdir@/expat-lite -I$(top_builddir)/apr/include
 
 ## Libraries this binary depends upon:
-deltaparse_test_LDADD = ../libsvn_delta.la \
-                        ../../tests-common/libsvn_test_editor.la \
-                        ../../libsvn_subr/libsvn_subr.la \
+deltaparse_test_LDADD = $(top_builddir)/subversion/libsvn_delta/libsvn_delta.la \
+                        $(top_builddir)/subversion/tests-common/libsvn_test_editor.la \
+                        $(top_builddir)/subversion/libsvn_subr/libsvn_subr.la \
                         @SVN_APR_LIBS@ \
-                        ../../../expat-lite/libexpat.la
+                        $(top_builddir)/expat-lite/libexpat.la
 
-vdelta_test_LDADD = ../libsvn_delta.la \
-                    ../../libsvn_subr/libsvn_subr.la \
+vdelta_test_LDADD = $(top_builddir)/subversion/libsvn_delta/libsvn_delta.la \
+                    $(top_builddir)/subversion/libsvn_subr/libsvn_subr.la \
                     @SVN_APR_LIBS@ \
-                    ../../../expat-lite/libexpat.la
+                    $(top_builddir)/expat-lite/libexpat.la
 
-random_test_LDADD = ../libsvn_delta.la \
-                    ../../libsvn_subr/libsvn_subr.la \
+random_test_LDADD = $(top_builddir)/subversion/libsvn_delta/libsvn_delta.la \
+                    $(top_builddir)/subversion/libsvn_subr/libsvn_subr.la \
                     @SVN_APR_LIBS@ \
-                    ../../../expat-lite/libexpat.la
+                    $(top_builddir)/expat-lite/libexpat.la
 
-xml_output_test_LDADD = ../libsvn_delta.la \
-                        ../../libsvn_subr/libsvn_subr.la \
+xml_output_test_LDADD = $(top_builddir)/subversion/libsvn_delta/libsvn_delta.la \
+                        $(top_builddir)/subversion/libsvn_subr/libsvn_subr.la \
                         @SVN_APR_LIBS@ \
-                        ../../../expat-lite/libexpat.la
+                        $(top_builddir)/expat-lite/libexpat.la
 
-svndiff_test_LDADD = ../libsvn_delta.la \
-                     ../../libsvn_subr/libsvn_subr.la \
+svndiff_test_LDADD = $(top_builddir)/subversion/libsvn_delta/libsvn_delta.la \
+                     $(top_builddir)/subversion/libsvn_subr/libsvn_subr.la \
                      @SVN_APR_LIBS@ \
-                     ../../../expat-lite/libexpat.la
+                     $(top_builddir)/expat-lite/libexpat.la
 
 
 ## Make libtool be quiet
Index: subversion/libsvn_fs/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_fs/Makefile.am,v
retrieving revision 1.22
diff -u -p -r1.22 Makefile.am
--- subversion/libsvn_fs/Makefile.am	2000/12/17 00:11:56	1.22
+++ subversion/libsvn_fs/Makefile.am	2001/01/23 20:30:14
@@ -30,7 +30,8 @@ libsvn_fs_la_SOURCES =				\
 libsvn_fs_la_LIBADD = -ldb
 
 
-INCLUDES = -I../include -I../../apr/include -I../../expat-lite
+INCLUDES = -I@top_srcdir@/subversion/include -I@top_srcdir@/apr/include \
+            -I@top_srcdir@/expat-lite -I$(top_builddir)/apr/include
 
 ## Build *this* directory first, *then* the test subdirectory!
 SUBDIRS = . tests
Index: subversion/libsvn_fs/tests/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_fs/tests/Makefile.am,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile.am
--- subversion/libsvn_fs/tests/Makefile.am	2001/01/10 00:08:01	1.8
+++ subversion/libsvn_fs/tests/Makefile.am	2001/01/23 20:30:14
@@ -1,12 +1,12 @@
 noinst_PROGRAMS = skel-test fs-test
 
 COMMON_LIBS = 						\
-		../libsvn_fs.la				\
-		../../tests-common/libsvn_tests_main.la	\
-		../../libsvn_subr/libsvn_subr.la	\
+		$(top_builddir)/subversion/libsvn_fs/libsvn_fs.la				\
+		$(top_builddir)/subversion/tests-common/libsvn_tests_main.la	\
+		$(top_builddir)/subversion/libsvn_subr/libsvn_subr.la	\
                 @SVN_APR_LIBS@                          \
-		../../../expat-lite/libexpat.la		\
-		-ldb
+		$(top_builddir)/expat-lite/libexpat.la		\
+		-ldb    ## Should this be added automatically by the autoconf script?
 
 # Tests for the `skeleton' library.
 skel_test_SOURCES = skel-test.c
@@ -16,10 +16,12 @@ skel_test_LDADD = ${COMMON_LIBS}
 fs_test_SOURCES = fs-test.c
 fs_test_LDADD = ${COMMON_LIBS}
 
-INCLUDES = -I .. -I ../../include -I ../../../apr/include
+INCLUDES = -I@top_srcdir@/subversion/libsvn_fs \
+            -I@top_srcdir@/subversion/include -I@top_srcdir@/apr/include \
+            -I$(top_builddir)/apr/include
 
 ## Make libtool be quiet
 LIBTOOL = @LIBTOOL@ --silent
 
 check:
-	sh ./run-fs-tests.sh
+	sh @srcdir@/run-fs-tests.sh
Index: subversion/libsvn_ra_dav/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_ra_dav/Makefile.am,v
retrieving revision 1.4
diff -u -p -r1.4 Makefile.am
--- subversion/libsvn_ra_dav/Makefile.am	2000/09/11 09:21:50	1.4
+++ subversion/libsvn_ra_dav/Makefile.am	2001/01/23 20:30:14
@@ -5,7 +5,8 @@ lib_LTLIBRARIES = libsvn_ra_dav.la
 
 libsvn_ra_dav_la_SOURCES = session.c fetch.c commit.c
 
-INCLUDES = -I../include -I../../apr/include -I../../neon/src
+INCLUDES = -I@top_srcdir@/subversion/include -I@top_srcdir@/apr/include \
+            -I@top_srcdir@/neon/src -I$(top_builddir)/apr/include
 
 SUBDIRS = . tests
 
Index: subversion/libsvn_ra_dav/tests/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_ra_dav/tests/Makefile.am,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile.am
--- subversion/libsvn_ra_dav/tests/Makefile.am	2001/01/10 00:08:01	1.13
+++ subversion/libsvn_ra_dav/tests/Makefile.am	2001/01/23 20:30:14
@@ -6,24 +6,25 @@ ra_dav_test_SOURCES = ra-dav-test.c
 ra_commit_SOURCES = ra-commit.c
 
 ## Flags needed when compiling:
-INCLUDES = -I../../include -I../../../apr/include
+INCLUDES = -I@top_srcdir@/subversion/include -I@top_srcdir@/apr/include \
+            -I$(top_builddir)/apr/include
 
 ## Libraries this binary depends upon:
-ra_dav_test_LDADD = ../libsvn_ra_dav.la                     \
-                    ../../libsvn_wc/libsvn_wc.la            \
-                    ../../libsvn_subr/libsvn_subr.la        \
-                    ../../libsvn_delta/libsvn_delta.la      \
-                    ../../../expat-lite/libexpat.la         \
-                    ../../../neon/libneon.la                \
+ra_dav_test_LDADD = $(top_builddir)/subversion/libsvn_ra_dav/libsvn_ra_dav.la                     \
+                    $(top_builddir)/subversion/libsvn_wc/libsvn_wc.la            \
+                    $(top_builddir)/subversion/libsvn_subr/libsvn_subr.la        \
+                    $(top_builddir)/subversion/libsvn_delta/libsvn_delta.la      \
+                    $(top_builddir)/expat-lite/libexpat.la         \
+                    $(top_builddir)/neon/libneon.la                \
                     @SVN_APR_LIBS@
 
 ## Libraries this binary depends upon:
-ra_commit_LDADD = ../libsvn_ra_dav.la                     \
-                    ../../libsvn_wc/libsvn_wc.la            \
-                    ../../libsvn_subr/libsvn_subr.la        \
-                    ../../libsvn_delta/libsvn_delta.la      \
-                    ../../../expat-lite/libexpat.la         \
-                    ../../../neon/libneon.la                \
+ra_commit_LDADD = $(top_builddir)/subversion/libsvn_ra_dav/libsvn_ra_dav.la                     \
+                    $(top_builddir)/subversion/libsvn_wc/libsvn_wc.la            \
+                    $(top_builddir)/subversion/libsvn_subr/libsvn_subr.la        \
+                    $(top_builddir)/subversion/libsvn_delta/libsvn_delta.la      \
+                    $(top_builddir)/expat-lite/libexpat.la         \
+                    $(top_builddir)/neon/libneon.la                \
                     @SVN_APR_LIBS@
 
 
Index: subversion/libsvn_subr/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_subr/Makefile.am,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile.am
--- subversion/libsvn_subr/Makefile.am	2000/12/26 23:28:30	1.13
+++ subversion/libsvn_subr/Makefile.am	2001/01/23 20:30:14
@@ -15,7 +15,8 @@ libsvn_subr_la_SOURCES = svn_string.c sv
 ## Build flags ---------
 
 ## These should be variables, no?  (from autoconf?)
-INCLUDES = -I../include -I../../apr/include -I../../expat-lite
+INCLUDES = -I@top_srcdir@/subversion/include -I@top_srcdir@/apr/include \
+            -I@top_srcdir@/expat-lite -I$(top_builddir)/apr/include
 
 
 ## Build *this* directory first, *then* the test subdirectory!
Index: subversion/libsvn_subr/io.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_subr/io.c,v
retrieving revision 1.26
diff -u -p -r1.26 io.c
--- subversion/libsvn_subr/io.c	2000/12/24 12:52:59	1.26
+++ subversion/libsvn_subr/io.c	2001/01/23 20:30:15
@@ -44,7 +44,7 @@ svn_io_check_path (const svn_string_t *p
   apr_finfo_t finfo;
   apr_status_t apr_err;
 
-  apr_err = apr_stat (&finfo, path->data, pool);
+  apr_err = apr_stat (&finfo, path->data, APR_FINFO_NORM, pool);
 
   if (apr_err && !APR_STATUS_IS_ENOENT(apr_err))
     return svn_error_createf (apr_err, 0, NULL, pool,
@@ -198,7 +198,7 @@ apr_transfer_file_contents (const char *
     return apr_err;
   
   /* Get its size. */
-  apr_err = apr_getfileinfo (&finfo, s);
+  apr_err = apr_getfileinfo (&finfo, APR_FINFO_NORM, s);
   if (apr_err)
     {
       apr_close (s);  /* toss any error */
@@ -354,7 +354,7 @@ svn_io_file_affected_time (apr_time_t *a
   apr_finfo_t finfo;
   apr_status_t apr_err;
 
-  apr_err = apr_stat (&finfo, path->data, pool);
+  apr_err = apr_stat (&finfo, path->data, APR_FINFO_NORM, pool);
   if (apr_err)
     return svn_error_createf
       (apr_err, 0, NULL, pool,
Index: subversion/libsvn_subr/tests/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_subr/tests/Makefile.am,v
retrieving revision 1.12
diff -u -p -r1.12 Makefile.am
--- subversion/libsvn_subr/tests/Makefile.am	2001/01/10 00:08:01	1.12
+++ subversion/libsvn_subr/tests/Makefile.am	2001/01/23 20:30:15
@@ -5,18 +5,19 @@ hashdump_test_SOURCES = hashdump-test.c
 stringtest_SOURCES = stringtest.c
 
 ## Flags needed when compiling:
-INCLUDES = -I../../include -I../../../apr/include
+INCLUDES = -I@top_srcdir@/subversion/include -I@top_srcdir@/apr/include \
+            -I$(top_builddir)/apr/include
 
 ## Libraries this binary depends upon:
-hashdump_test_LDADD = ../../tests-common/libsvn_tests_main.la   \
-                      ../libsvn_subr.la                         \
+hashdump_test_LDADD = $(top_builddir)/subversion/libsvn_subr/libsvn_subr.la \
+                     $(top_builddir)/subversion/tests-common/libsvn_tests_main.la \
                       @SVN_APR_LIBS@                            \
-                      ../../../expat-lite/libexpat.la
+                      $(top_builddir)/expat-lite/libexpat.la
 
-stringtest_LDADD = ../../tests-common/libsvn_tests_main.la   \
-                   ../libsvn_subr.la                         \
+stringtest_LDADD = $(top_builddir)/subversion/libsvn_subr/libsvn_subr.la \
+                   $(top_builddir)/subversion/tests-common/libsvn_tests_main.la \
                    @SVN_APR_LIBS@                            \
-                   ../../../expat-lite/libexpat.la
+                   $(top_builddir)/expat-lite/libexpat.la
 
 
 ## Make libtool be quiet
Index: subversion/libsvn_wc/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_wc/Makefile.am,v
retrieving revision 1.24
diff -u -p -r1.24 Makefile.am
--- subversion/libsvn_wc/Makefile.am	2000/11/12 21:29:35	1.24
+++ subversion/libsvn_wc/Makefile.am	2001/01/23 20:30:15
@@ -18,7 +18,8 @@ libsvn_wc_la_SOURCES = get_editor.c     
 ## Build flags ---------
 
 ## These should be variables, no?  (from autoconf?)
-INCLUDES = -I../include -I../../apr/include -I../../expat-lite -I../../
+INCLUDES = -I@top_srcdir@/subversion/include -I@top_srcdir@/apr/include \
+            -I@top_srcdir@/expat-lite -I$(top_builddir)/apr/include
 
 
 ## Build *this* directory first, *then* the test subdirectory!
Index: subversion/libsvn_wc/log.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_wc/log.c,v
retrieving revision 1.80
diff -u -p -r1.80 log.c
--- subversion/libsvn_wc/log.c	2001/01/08 23:06:34	1.80
+++ subversion/libsvn_wc/log.c	2001/01/23 20:30:16
@@ -474,7 +474,7 @@ log_do_detect_conflict (struct log_runne
   full_path = svn_string_dup (loggy->path, loggy->pool);
   svn_path_add_component_nts (full_path, rejfile, svn_path_local_style);
 
-  apr_err = apr_stat (&finfo, full_path->data, loggy->pool);
+  apr_err = apr_stat (&finfo, full_path->data, APR_FINFO_NORM, loggy->pool);
   if (apr_err)
     return svn_error_createf (apr_err, 0, NULL, loggy->pool,
                               "log_do_detect_conflict: couldn't stat %s",
@@ -737,7 +737,7 @@ conflict_if_rejfile (svn_string_t *paren
     {
       apr_status_t apr_err;
       apr_finfo_t finfo;
-      apr_err = apr_stat (&finfo, rejfile_full_path->data, pool);
+      apr_err = apr_stat (&finfo, rejfile_full_path->data, APR_FINFO_NORM, pool);
       
       if (! APR_STATUS_IS_SUCCESS (apr_err))
         return svn_error_createf
Index: subversion/libsvn_wc/questions.c
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_wc/questions.c,v
retrieving revision 1.45
diff -u -p -r1.45 questions.c
--- subversion/libsvn_wc/questions.c	2001/01/11 21:29:24	1.45
+++ subversion/libsvn_wc/questions.c	2001/01/23 20:30:16
@@ -201,7 +201,7 @@ filesizes_definitely_different_p (svn_bo
   apr_status_t status;
 
   /* Stat both files */
-  status = apr_stat (&finfo1, filename1->data, pool);
+  status = apr_stat (&finfo1, filename1->data, APR_FINFO_NORM, pool);
   if (status)
     {
       /* If we got an error stat'ing a file, it could be because the
@@ -212,7 +212,7 @@ filesizes_definitely_different_p (svn_bo
       return SVN_NO_ERROR;
     }
 
-  status = apr_stat (&finfo2, filename2->data, pool);
+  status = apr_stat (&finfo2, filename2->data, APR_FINFO_NORM, pool);
   if (status)
     {
       /* See previous comment. */
Index: subversion/libsvn_wc/tests/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_wc/tests/Makefile.am,v
retrieving revision 1.13
diff -u -p -r1.13 Makefile.am
--- subversion/libsvn_wc/tests/Makefile.am	2001/01/10 00:08:01	1.13
+++ subversion/libsvn_wc/tests/Makefile.am	2001/01/23 20:30:17
@@ -7,25 +7,25 @@ commit_test_SOURCES = commit-test.c
 
 
 ## Flags needed when compiling:
-INCLUDES = -I../../include -I../../../apr/include -I../../../expat-lite
+INCLUDES = -I@top_srcdir@/subversion/include -I@top_srcdir@/apr/include \
+            -I@top_srcdir@/expat-lite -I$(top_builddir)/apr/include
 
 ## Libraries this binary depends upon:
-checkout_test_LDADD = ../libsvn_wc.la                          \
-                      ../../libsvn_delta/libsvn_delta.la       \
-                      ../../libsvn_subr/libsvn_subr.la         \
+checkout_test_LDADD = $(top_builddir)/subversion/libsvn_wc/libsvn_wc.la                          \
+                      $(top_builddir)/subversion/libsvn_delta/libsvn_delta.la       \
+                      $(top_builddir)/subversion/libsvn_subr/libsvn_subr.la         \
                       @SVN_APR_LIBS@                           \
-                      ../../../expat-lite/libexpat.la
+                      $(top_builddir)/expat-lite/libexpat.la
 
-commit_test_LDADD = ../libsvn_wc.la                          \
-                    ../../libsvn_delta/libsvn_delta.la       \
-                    ../../tests-common/libsvn_test_editor.la \
-                    ../../libsvn_subr/libsvn_subr.la         \
+commit_test_LDADD = $(top_builddir)/subversion/libsvn_wc/libsvn_wc.la                          \
+                    $(top_builddir)/subversion/libsvn_delta/libsvn_delta.la       \
+                    $(top_builddir)/subversion/tests-common/libsvn_test_editor.la \
+                    $(top_builddir)/subversion/libsvn_subr/libsvn_subr.la         \
                     @SVN_APR_LIBS@                           \
-                    ../../../expat-lite/libexpat.la
+                    $(top_builddir)/expat-lite/libexpat.la
 
 ## Make libtool be quiet
 LIBTOOL = @LIBTOOL@ --silent
 
 ## Automatic test scripts to run for `make check`
-
 TESTS = checkout-test.sh
Index: subversion/libsvn_wc/tests/checkout-test.sh
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_wc/tests/checkout-test.sh,v
retrieving revision 1.9
diff -u -p -r1.9 checkout-test.sh
--- subversion/libsvn_wc/tests/checkout-test.sh	2000/10/17 17:43:19	1.9
+++ subversion/libsvn_wc/tests/checkout-test.sh	2001/01/23 20:30:17
@@ -2,7 +2,7 @@
 
 # Make sure checkout-test binary exists
 
-TEST_DELTA=../../tests-common/xml/co1-inline.xml
+TEST_DELTA=$srcdir/../../tests-common/xml/co1-inline.xml
 
 if [ ! -x ./checkout-test ]; then
     echo "Error:  can't find checkout-test executable"
Index: subversion/mod_dav_svn/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/mod_dav_svn/Makefile.am,v
retrieving revision 1.9
diff -u -p -r1.9 Makefile.am
--- subversion/mod_dav_svn/Makefile.am	2000/12/19 12:26:17	1.9
+++ subversion/mod_dav_svn/Makefile.am	2001/01/23 20:30:17
@@ -13,13 +13,14 @@ libmod_dav_svn_la_SOURCES = mod_dav_svn.
 ### this is a hack, but we can't pass libsvn_fs.la (et al) to libtool when
 ### shared libs are being built. libtool barfs on us. we need to upgrade
 ### to libtool 1.4 when it gets released
-libmod_dav_svn_la_LIBADD = -L../libsvn_fs/.libs -lsvn_fs \
-			   -L../libsvn_subr/.libs -lsvn_subr
+libmod_dav_svn_la_LIBADD = -L$(top_builddir)/subversion/libsvn_fs/.libs -lsvn_fs \
+			   -L$(top_builddir)/subversion/libsvn_subr/.libs -lsvn_subr
 
 ## we don't need the .so version stuff for an Apache module, so avoid them
 LDFLAGS = -avoid-version
 
-INCLUDES = -I../include $(APACHE_INCLUDES) -I../../apr/include
+INCLUDES = -I@top_srcdir@/subversion/include $(APACHE_INCLUDES) \
+            -I@top_srcdir@/apr/include -I$(top_builddir)/apr/include
 
 SUBDIRS = . tests
 
Index: subversion/tests-common/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/tests-common/Makefile.am,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile.am
--- subversion/tests-common/Makefile.am	2000/10/25 15:58:08	1.7
+++ subversion/tests-common/Makefile.am	2001/01/23 20:30:17
@@ -5,8 +5,14 @@ libsvn_tests_main_la_SOURCES = svn_tests
 libsvn_test_editor_la_SOURCES = svn_test_editor.c
 
 ## Flags needed when compiling:
-INCLUDES = -I../../apr/include -I../include
+INCLUDES = -I@top_srcdir@/apr/include -I@top_srcdir@/subversion/include \
+            -I$(top_builddir)/apr/include
 
+## Need to include these for performing tests.
+EXTRA_DIST = xml/README xml/col-inline.xml xml/col-postfix.xml xml/col.txt \
+            xml/pipatch.xml xml/up-props.xml xml/upla-inline.xml \
+            xml/upla-postfix.xml xml/uplb-inline.xml xml/uplb-postfix.xml \
+            xml/up2.xml xml/up3.xml xml/up5.xml
 
 ## Make libtool be quiet
 LIBTOOL = @LIBTOOL@ --silent



PATCH #2
Modified: neon/Makefile.in neon/src/dav_props.h
Log: Changed neon/Makefile.in to use builddir and srcdir variables in
rules, thus allowing VPATH builds.  Changed neon/src/dav_props.h to use
quote #includes instead of <> #includes to allow VPATH builds.


diff -r -c neon/Makefile.in neon.orig/Makefile.in
*** neon/Makefile.in	Tue Jan 23 12:29:27 2001
--- neon.orig/Makefile.in	Tue Jan 23 11:29:56 2001
***************
*** 26,31 ****
--- 26,32 ----
  # Where does top_builddir come from?
  top_builddir = .
  srcdir = @srcdir@
+ VPATH = @srcdir@
  # intl stuff
  localedir = $(datadir)/locale
  gnulocaledir = $(prefix)/share/locale
***************
*** 70,91 ****
  .SUFFIXES:
  .SUFFIXES: .c .lo .o
  
! $(top_builddir)/src/%.lo:   $(srcdir)/src/%.c
  	$(LIBTOOL) --quiet --mode=compile $(COMPILE) -c $< -o $@
! 
! $(top_builddir)/src/%.o:   $(srcdir)/src/%.c
  	$(COMPILE) -c $< -o $@
  
  all: libneon.la
  
! libneon.la: $(top_builddir)/src $(OBJECTS)
  	$(LINK) -rpath $(libdir) -version-info $(NEON_INTERFACE_VERSION) -o $@ $(LDFLAGS) $(OBJECTS) $(LIBS)
  	@echo
  	@echo "Compilation complete. Run '$(MAKE) install' (as root?) to install neon."
  	@echo
- 
- $(top_builddir)/src:
- 	mkdir $(top_builddir)/src
  
  clean:
  	rm -f $(OBJECTS) $(example_PROGS) $(nget_OBJS) $(nbrowse_OBJS) $(nserver_OBJS)
--- 71,88 ----
  .SUFFIXES:
  .SUFFIXES: .c .lo .o
  
! .c.lo:
  	$(LIBTOOL) --quiet --mode=compile $(COMPILE) -c $< -o $@
! .c.o:
  	$(COMPILE) -c $< -o $@
  
  all: libneon.la
  
! libneon.la: $(OBJECTS)
  	$(LINK) -rpath $(libdir) -version-info $(NEON_INTERFACE_VERSION) -o $@ $(LDFLAGS) $(OBJECTS) $(LIBS)
  	@echo
  	@echo "Compilation complete. Run '$(MAKE) install' (as root?) to install neon."
  	@echo
  
  clean:
  	rm -f $(OBJECTS) $(example_PROGS) $(nget_OBJS) $(nbrowse_OBJS) $(nserver_OBJS)
diff -r -c neon/src/dav_props.h neon.orig/src/dav_props.h
*** neon/src/dav_props.h	Tue Jan 23 12:17:53 2001
--- neon.orig/src/dav_props.h	Wed Sep  6 19:26:43 2000
***************
*** 22,29 ****
  #ifndef DAV_PROPS_H
  #define DAV_PROPS_H
  
! #include "http_request.h"
! #include "dav_207.h"
  
  BEGIN_NEON_DECLS
  
--- 22,29 ----
  #ifndef DAV_PROPS_H
  #define DAV_PROPS_H
  
! #include <http_request.h>
! #include <dav_207.h>
  
  BEGIN_NEON_DECLS
  
-- 
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson
kevin@pilch-bisson.net
http://www.pilch-bisson.net

Re: Patch for supporting VPATH builds

Posted by Greg Stein <gs...@lyra.org>.
On Thu, Jan 25, 2001 at 11:46:29PM -0800, Mo DeJong wrote:
> On Thu, 25 Jan 2001, Greg Stein wrote:
>...
> > We just expect the caller to set the MKDIR macro to a script that does the
> > job. APR sets it to ./helpers/mkdir.sh. Apache sets it to
> > ./srclib/apr/helpers/mkdir.sh. SVN sets it to ./apr/helpers/mkdir.sh.
> > 
> > In this way, each "top-level" configure can tell the RUN_SUBDIR_CONFIG where
> > to find the MKDIR script.
> > 
> > It is a simpler than the MKDIR macro. However, it does place a burden on the
> > user of RUN_SUBDIR_CONFIG. I've been torn on which is best, so ended up
> > doing nothing :-(
> 
> (WARNING: The following is not a flame)

Don't worry about that. I've got builtin asbestos :-)

> You call that simpler?

Simpler within the configure script. But overall? Wasn't sure.

> Why give folks the chance to make an error?
> The APR_MKDIR macro is hidden inside the RUN_SUBDIR_CONFIG
> macro, most folks would never even know it was there.

Right. It was a balance of configure script simplicity vs. simpler for the
user of the RUN_SUBDIR_CONFIG macro. Like I said... I wasn't sure.

[ I also recall a few slight differences between the macro and mkdir.sh;
  never sat down to look at whether those diffs were important ]

> We are
> already running ./configure at this point, why exec another
> sh script? A macro is much faster and you would never need
> to set a path to get it working.

*nod*

I'm still on the fence, probably leaning towards the builtin macro. I just
haven't gotten worked up enough to hop off the fence :-)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Re: Patch for supporting VPATH builds

Posted by Mo DeJong <md...@cygnus.com>.
On Thu, 25 Jan 2001, Greg Stein wrote:

> On Thu, Jan 25, 2001 at 11:26:01PM -0800, Mo DeJong wrote:
> > On Wed, 24 Jan 2001, Kevin Pilch-Bisson wrote:
> > > On Wed, Jan 24, 2001 at 02:56:38AM +0100, Branko =C8ibej wrote:
> > > > Kevin Pilch-Bisson wrote:
> > > >=20
> > > > > +dnl $MKDIR is required for configuring apr and neon in a vpath build
> > > > > +MKDIR=3Dmkdir
> > > > > +
> > > >=20
> > > > Are you sure this is right? APR uses mkdir.sh from apr/helpers. I think=
> > > =20
> > > > we should do the same.
> > > We could, I was just looking at the GNU Makefile conventions, and it
> > > said mkdir was one of the utilities we could expect all platforms to
> > > have, thus we could use it directly. However, automake generates some
> > > stuff which relies on $MKDIR, so I just set it to mkdir.
> > 
> > 
> > I sent a patch to the apr dev list long ago to fix this problem,
> > but it seems they never added it to the CVS. The real fix is to
> > create a MKDIR macro that does the same thing as the mkdir shell
> > script.
> 
> We just expect the caller to set the MKDIR macro to a script that does the
> job. APR sets it to ./helpers/mkdir.sh. Apache sets it to
> ./srclib/apr/helpers/mkdir.sh. SVN sets it to ./apr/helpers/mkdir.sh.
> 
> In this way, each "top-level" configure can tell the RUN_SUBDIR_CONFIG where
> to find the MKDIR script.
> 
> It is a simpler than the MKDIR macro. However, it does place a burden on the
> user of RUN_SUBDIR_CONFIG. I've been torn on which is best, so ended up
> doing nothing :-(

(WARNING: The following is not a flame)

You call that simpler? Why give folks the chance to make an error?
The APR_MKDIR macro is hidden inside the RUN_SUBDIR_CONFIG
macro, most folks would never even know it was there. We are
already running ./configure at this point, why exec another
sh script? A macro is much faster and you would never need
to set a path to get it working.

Mo DeJong
Red Hat Inc

Re: Patch for supporting VPATH builds

Posted by Greg Stein <gs...@lyra.org>.
On Thu, Jan 25, 2001 at 11:26:01PM -0800, Mo DeJong wrote:
> On Wed, 24 Jan 2001, Kevin Pilch-Bisson wrote:
> > On Wed, Jan 24, 2001 at 02:56:38AM +0100, Branko =C8ibej wrote:
> > > Kevin Pilch-Bisson wrote:
> > >=20
> > > > +dnl $MKDIR is required for configuring apr and neon in a vpath build
> > > > +MKDIR=3Dmkdir
> > > > +
> > >=20
> > > Are you sure this is right? APR uses mkdir.sh from apr/helpers. I think=
> > =20
> > > we should do the same.
> > We could, I was just looking at the GNU Makefile conventions, and it
> > said mkdir was one of the utilities we could expect all platforms to
> > have, thus we could use it directly. However, automake generates some
> > stuff which relies on $MKDIR, so I just set it to mkdir.
> 
> 
> I sent a patch to the apr dev list long ago to fix this problem,
> but it seems they never added it to the CVS. The real fix is to
> create a MKDIR macro that does the same thing as the mkdir shell
> script.

We just expect the caller to set the MKDIR macro to a script that does the
job. APR sets it to ./helpers/mkdir.sh. Apache sets it to
./srclib/apr/helpers/mkdir.sh. SVN sets it to ./apr/helpers/mkdir.sh.

In this way, each "top-level" configure can tell the RUN_SUBDIR_CONFIG where
to find the MKDIR script.

It is a simpler than the MKDIR macro. However, it does place a burden on the
user of RUN_SUBDIR_CONFIG. I've been torn on which is best, so ended up
doing nothing :-(

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Re: Patch for supporting VPATH builds

Posted by Branko Čibej <br...@xbc.nu>.
Greg Stein wrote:

> On Thu, Jan 25, 2001 at 12:30:20AM +0100, Branko Cibej wrote:
> 
>> Kevin Pilch-Bisson wrote:
>> 
>>>>  you sure this is right? APR uses mkdir.sh from apr/helpers. I think 
>>>> we should do the same.
>>> 
>>> We could, I was just looking at the GNU Makefile conventions, and it
>>> said mkdir was one of the utilities we could expect all platforms to
>>> have, thus we could use it directly. However, automake generates some
>>> stuff which relies on $MKDIR, so I just set it to mkdir.
>> 
>> APR's script creates the whole path, like "mkdir -p".
>> 
>> Anyway, leave it in; we can fix it if it turns out to be broken.
> 
> 
> The script is needed because "mkdir -p" is not portable. The MKDIR
> assignment *should* use apr/helpers/mkdir.sh

I put that in, along with some more changes to configure.in: I moved the 
new defines around a bit, fixed the include path for APRVARS and did 
away with the shell escapes.

Oh, and the library order was reversed in 
libsvn_subre/tests/Makefile.am, causing the link to fail.

Everything except Neon (and therefore svn_ra_dav) now compiles with 
builddir != srcdir, and make check also works.

(But note that it doesn't pass, the last libsvn_fs test fails. Have to 
look into that.)


-- 
Brane �ibej
    home:   <br...@xbc.nu>             http://www.xbc.nu/brane/
    work:   <br...@hermes.si>   http://www.hermes-softlab.com/
     ACM:   <br...@acm.org>            http://www.acm.org/

Re: Patch for supporting VPATH builds

Posted by Greg Stein <gs...@lyra.org>.
On Thu, Jan 25, 2001 at 12:30:20AM +0100, Branko Cibej wrote:
> Kevin Pilch-Bisson wrote:
> 
> >>  you sure this is right? APR uses mkdir.sh from apr/helpers. I think 
> >> we should do the same.
> > 
> > We could, I was just looking at the GNU Makefile conventions, and it
> > said mkdir was one of the utilities we could expect all platforms to
> > have, thus we could use it directly. However, automake generates some
> > stuff which relies on $MKDIR, so I just set it to mkdir.
> 
> APR's script creates the whole path, like "mkdir -p".
> 
> Anyway, leave it in; we can fix it if it turns out to be broken.

The script is needed because "mkdir -p" is not portable. The MKDIR
assignment *should* use apr/helpers/mkdir.sh

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/

Re: Patch for supporting VPATH builds

Posted by Branko Čibej <br...@xbc.nu>.
Kevin Pilch-Bisson wrote:

>>  you sure this is right? APR uses mkdir.sh from apr/helpers. I think 
>> we should do the same.
> 
> We could, I was just looking at the GNU Makefile conventions, and it
> said mkdir was one of the utilities we could expect all platforms to
> have, thus we could use it directly. However, automake generates some
> stuff which relies on $MKDIR, so I just set it to mkdir.

APR's script creates the whole path, like "mkdir -p".

Anyway, leave it in; we can fix it if it turns out to be broken.


>> Shouldn't the header files go into EXTRA_DIST instead?
> 
> 
> Again, automake docs say that headers can go in source, and automake
> won't try to compile them, but will distribute them

Oh. O.K.


>> Oops. This is part of the stat patch, it has nothing to do with srcdir 
>> != builddir. Don't combine different patches in one, it'll just confuse 
>> people trying to review it.
> 
> 
> See NOTE re PATCH 1 in my second email.

Yeah, sorry. I didn't see that message until later.


-- 
Brane �ibej
    home:   <br...@xbc.nu>             http://www.xbc.nu/brane/
    work:   <br...@hermes.si>   http://www.hermes-softlab.com/
     ACM:   <br...@acm.org>            http://www.acm.org/

Re: Patch for supporting VPATH builds

Posted by Branko Čibej <br...@xbc.nu>.
Mo DeJong wrote:

> I sent a patch to the apr dev list long ago to fix this problem,
> but it seems they never added it to the CVS. The real fix is to
> create a MKDIR macro that does the same thing as the mkdir shell
> script.

Greg Stein had some unspecific reservations about it.

Hey GregS, can you be a bit more specific now? :-)


-- 
Brane �ibej
    home:   <br...@xbc.nu>             http://www.xbc.nu/brane/
    work:   <br...@hermes.si>   http://www.hermes-softlab.com/
     ACM:   <br...@acm.org>            http://www.acm.org/

Re: Patch for supporting VPATH builds

Posted by Mo DeJong <md...@cygnus.com>.
On Wed, 24 Jan 2001, Kevin Pilch-Bisson wrote:

> On Wed, Jan 24, 2001 at 02:56:38AM +0100, Branko =C8ibej wrote:
> > Kevin Pilch-Bisson wrote:
> >=20
> > > +dnl $MKDIR is required for configuring apr and neon in a vpath build
> > > +MKDIR=3Dmkdir
> > > +
> >=20
> > Are you sure this is right? APR uses mkdir.sh from apr/helpers. I think=
> =20
> > we should do the same.
> We could, I was just looking at the GNU Makefile conventions, and it
> said mkdir was one of the utilities we could expect all platforms to
> have, thus we could use it directly. However, automake generates some
> stuff which relies on $MKDIR, so I just set it to mkdir.


I sent a patch to the apr dev list long ago to fix this problem,
but it seems they never added it to the CVS. The real fix is to
create a MKDIR macro that does the same thing as the mkdir shell
script.


Index: aclocal.m4
===================================================================
RCS file: /home/cvspublic/apr/aclocal.m4,v
retrieving revision 1.38
diff -u -r1.38 aclocal.m4
--- aclocal.m4	2000/12/20 16:20:05	1.38
+++ aclocal.m4	2001/01/06 20:10:01
@@ -331,7 +331,7 @@
 AC_DEFUN(APR_PREPARE_MM_DIR,[
 dnl #----------------------------- Prepare mm directory for VPATH support
 if test -n "$USE_MM" && test -n "$USE_VPATH"; then
-  test -d $mm_dir || $MKDIR $mm_dir
+  test -d $mm_dir || APR_MKDIR($mm_dir)
 
   for i in shtool config.guess config.sub fbtool ltconfig \
            ltmain.sh mm_vers.c; do
Index: apr_common.m4
===================================================================
RCS file: /home/cvspublic/apr/apr_common.m4,v
retrieving revision 1.9
diff -u -r1.9 apr_common.m4
--- apr_common.m4	2000/11/29 23:11:21	1.9
+++ apr_common.m4	2001/01/06 20:10:01
@@ -1,4 +1,39 @@
 dnl
+dnl APR_MKDIR(dir)
+dnl
+dnl This macro works like `mkdir -p $dir' on systems that do not
+dnl support the -p flag to mkdir
+dnl
+dnl Based on `mkinstalldirs' from Noah Friedman <fr...@prep.ai.mit.edu>
+dnl as of 1994-03-25, which was placed in the Public Domain.
+dnl Cleaned up for Apache's Autoconf-style Interface (APACI)
+dnl by Ralf S. Engelschall <rs...@apache.org>
+
+AC_DEFUN(APR_MKDIR, [
+  umask_saved=`umask`
+  umask 022
+
+  dir=$1
+  dirlist=`echo ":$dir" |\
+               sed -e 's/^:\//%/' -e 's/^://' -e 's/\// /g' -e 's/^%/\//'`
+
+  pathcomp=
+  for d in $dirlist; do
+    pathcomp="$pathcomp$d"
+    case "$pathcomp" in
+      -* ) pathcomp=./$pathcomp ;;
+    esac
+    if test ! -d "$pathcomp"; then
+      #echo "mkdir $pathcomp" 1>&2
+      mkdir "$pathcomp"
+    fi
+    pathcomp="$pathcomp/"
+  done
+  echo "mkdir -p $1"
+  umask $umask_saved > /dev/null
+])
+
+dnl
 dnl RUN_SUBDIR_CONFIG_NOW(dir [, sub-package-cmdline-args])
 dnl
 AC_DEFUN(RUN_SUBDIR_CONFIG_NOW, [
@@ -9,7 +44,7 @@
   ac_popdir=`pwd`
   ac_abs_srcdir=`(cd $srcdir/$1 && pwd)`
   apr_config_subdirs="$1"
-  test -d $1 || $srcdir/helpers/mkdir.sh $1
+  test -d $1 || APR_MKDIR($1)
   cd $1
 
 changequote(, )dnl
Index: configure.in
===================================================================
RCS file: /home/cvspublic/apr/configure.in,v
retrieving revision 1.205
diff -u -r1.205 configure.in
--- configure.in	2001/01/05 22:33:08	1.205
+++ configure.in	2001/01/06 20:10:02
@@ -26,7 +26,6 @@
 dnl XXX This assumes that APR "lives" under Apache.
 dnl XXX We'll need to fix this when we pull it out.
 abs_helpersdir=$abs_srcdir/helpers
-MKDIR=$abs_helpersdir/mkdir.sh
 
 if test "$abs_builddir" != "$abs_srcdir"; then
   USE_VPATH=1
@@ -866,7 +865,7 @@
 SUBDIRS="lib strings passwd tables "
 for dir in $MODULES
 do
-    test -d $dir || $MKDIR $dir
+    test -d $dir || APR_MKDIR($dir)
     if test -f $srcdir/$dir/$OSDIR/Makefile.in; then
         MAKEFILE2="$MAKEFILE2 $dir/$OSDIR/Makefile "
         SUBDIRS="$SUBDIRS $dir/$OSDIR "
@@ -891,7 +890,7 @@
 done
 
 dir=include/arch/unix
-test -d $dir || $MKDIR $dir
+test -d $dir || APR_MKDIR($dir)
 
 AC_OUTPUT($MAKEFILE1 $MAKEFILE2 $MAKEFILE3 include/apr.h APRVARS,[
 

Mo DeJong
Red Hat Inc

Re: Patch for supporting VPATH builds

Posted by Kevin Pilch-Bisson <ke...@pilch-bisson.net>.
On Wed, Jan 24, 2001 at 02:56:38AM +0100, Branko Èibej wrote:
> Kevin Pilch-Bisson wrote:
> 
> > +dnl $MKDIR is required for configuring apr and neon in a vpath build
> > +MKDIR=mkdir
> > +
> 
> Are you sure this is right? APR uses mkdir.sh from apr/helpers. I think 
> we should do the same.
We could, I was just looking at the GNU Makefile conventions, and it
said mkdir was one of the utilities we could expect all platforms to
have, thus we could use it directly. However, automake generates some
stuff which relies on $MKDIR, so I just set it to mkdir.
> 
> 
> > 
> >  ## Sources needed to build each library (names canonicalized)
> > -libexpat_la_SOURCES = hashtable.c xmlparse.c xmlrole.c xmltok.c
> > +libexpat_la_SOURCES = asciitab.h hashtable.c hashtable.h iasciitab.h \
> > +                      latin1tab.h nametab.h utf8tab.h xmldef.h xmlparse.c \
> > +                      xmlparse.h xmlrole.c xmlrole.h xmltok.c xmltok.h \
> > +                      xmltok_impl.h
> > +
> > +## This is needed because they are included into xmltok.c, but shouldn't be
> > +## put in libexpat_la_SOURCES, since it should not be compiled directly
> > +EXTRA_DIST = xmltok_impl.c xmltok_ns.c
> 
> Shouldn't the header files go into EXTRA_DIST instead?

Again, automake docs say that headers can go in source, and automake
won't try to compile them, but will distribute them
> 
> 
> > +	     include/svn_types.h       \
> > +             include/svn_wc.h          \
> >               include/svn_xml.h
> > +             #include/svn_parse.h       \
> 
>                ^^^ :-)
This is commented out, because I don't have svn_parse.h in my include
directory.
> 
> 
> >  ## Flags needed when compiling:
> > -INCLUDES = -I. -I../include -I../../apr/include -I../../expat-lite
> > +INCLUDES = -I@srcdir@ -I@top_srcdir@/subversion/include \
> > +            -I@top_srcdir@/apr/include -I@top_srcdir@/expat-lite \
> > +            -I$(top_builddir)/apr/include
> 
> I'd rather define APR_INCLUDES, EXPAT_INCLUDES, etc., and just use those 
> in the makefiles, and the same for various libraries. In that way you 
> only have to make any change  in one place, not in every makefile.

I think that is an excellent idea.
> 
> 
> > Index: subversion/libsvn_subr/io.c
> > ===================================================================
> > RCS file: /cvs/subversion/subversion/libsvn_subr/io.c,v
> > retrieving revision 1.26
> > diff -u -p -r1.26 io.c
> > --- subversion/libsvn_subr/io.c	2000/12/24 12:52:59	1.26
> > +++ subversion/libsvn_subr/io.c	2001/01/23 20:30:15
> > @@ -44,7 +44,7 @@ svn_io_check_path (const svn_string_t *p
> >    apr_finfo_t finfo;
> >    apr_status_t apr_err;
> >  
> > -  apr_err = apr_stat (&finfo, path->data, pool);
> > +  apr_err = apr_stat (&finfo, path->data, APR_FINFO_NORM, pool);
> 
> Oops. This is part of the stat patch, it has nothing to do with srcdir 
> != builddir. Don't combine different patches in one, it'll just confuse 
> people trying to review it.


See NOTE re PATCH 1 in my second email.

-- 
>~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Kevin Pilch-Bisson
kevin@pilch-bisson.net
http://www.pilch-bisson.net

Re: Patch for supporting VPATH builds

Posted by Branko Čibej <br...@xbc.nu>.
Kevin Pilch-Bisson wrote:

> 2) Apply the patch now, and still not be able to use vpath builds until
> the third patch to APR is accepted and we upgrade to neon-0.10.0. Or

I'd go for this option, too.


> +dnl $MKDIR is required for configuring apr and neon in a vpath build
> +MKDIR=mkdir
> +

Are you sure this is right? APR uses mkdir.sh from apr/helpers. I think 
we should do the same.


> 
>  ## Sources needed to build each library (names canonicalized)
> -libexpat_la_SOURCES = hashtable.c xmlparse.c xmlrole.c xmltok.c
> +libexpat_la_SOURCES = asciitab.h hashtable.c hashtable.h iasciitab.h \
> +                      latin1tab.h nametab.h utf8tab.h xmldef.h xmlparse.c \
> +                      xmlparse.h xmlrole.c xmlrole.h xmltok.c xmltok.h \
> +                      xmltok_impl.h
> +
> +## This is needed because they are included into xmltok.c, but shouldn't be
> +## put in libexpat_la_SOURCES, since it should not be compiled directly
> +EXTRA_DIST = xmltok_impl.c xmltok_ns.c

Shouldn't the header files go into EXTRA_DIST instead?


> +	     include/svn_types.h       \
> +             include/svn_wc.h          \
>               include/svn_xml.h
> +             #include/svn_parse.h       \

               ^^^ :-)


>  ## Flags needed when compiling:
> -INCLUDES = -I. -I../include -I../../apr/include -I../../expat-lite
> +INCLUDES = -I@srcdir@ -I@top_srcdir@/subversion/include \
> +            -I@top_srcdir@/apr/include -I@top_srcdir@/expat-lite \
> +            -I$(top_builddir)/apr/include

I'd rather define APR_INCLUDES, EXPAT_INCLUDES, etc., and just use those 
in the makefiles, and the same for various libraries. In that way you 
only have to make any change  in one place, not in every makefile.


> Index: subversion/libsvn_subr/io.c
> ===================================================================
> RCS file: /cvs/subversion/subversion/libsvn_subr/io.c,v
> retrieving revision 1.26
> diff -u -p -r1.26 io.c
> --- subversion/libsvn_subr/io.c	2000/12/24 12:52:59	1.26
> +++ subversion/libsvn_subr/io.c	2001/01/23 20:30:15
> @@ -44,7 +44,7 @@ svn_io_check_path (const svn_string_t *p
>    apr_finfo_t finfo;
>    apr_status_t apr_err;
>  
> -  apr_err = apr_stat (&finfo, path->data, pool);
> +  apr_err = apr_stat (&finfo, path->data, APR_FINFO_NORM, pool);

Oops. This is part of the stat patch, it has nothing to do with srcdir 
!= builddir. Don't combine different patches in one, it'll just confuse 
people trying to review it.



-- 
Brane �ibej
    home:   <br...@xbc.nu>             http://www.xbc.nu/brane/
    work:   <br...@hermes.si>   http://www.hermes-softlab.com/
     ACM:   <br...@acm.org>            http://www.acm.org/