O.K., I've had it up to here [indicates position approximately
0.3048 m above top of head, one left foot to you benighted souls
across the pond] with those hard-coded "-pthread" flags in the
makefiles. I think it's finally time to fix that.
I've attached two patches: the first teaches APR's configure
to export CPPFLAGS and CFLAGS needed for threaded programs
into APRVARS; the second tells SVN's configure to use EXTRA_LIBS,
EXTRA_CFLAGS and EXTRA_CPPFLAGS from APRVARS, and nukes the CFLAGS
definitions in the Makefile.am files.
Greg S, if you can apply the first patch to APR, and if nobody
screams too much, I'll check in the second patch later today or
early tomorrow. I already fixed a typo in berkeley-db.m4 where
CPPFLAGS were set off of LIBS, which broke this brilliant solution
of mine. :-p
Hey, with these patches I can finally build on Solaris! :-))
(No, I don't want to try on AIX right now, but yes, I will soon,
likewise HP-UX and maybe IRIX. Have to see if Berkeley DB builds
on those first. Probably does, but <shrug>.)
An interesting side note: expat-lite inherits the CPPFLAGS,
but not the CFLAGS; neon doesn't care about either. Maybe
this'll have to be fixed, maybe not. Will wait and see.
--
Brane �ibej
home: <brane_at_xbc.nu> http://www.xbc.nu/brane/
ACM: <brane_at_acm.org> http://www.acm.org/
Index: APRVARS.in
===================================================================
RCS file: /home/cvspublic/apache-2.0/src/lib/apr/APRVARS.in,v
retrieving revision 1.3
diff -u -p -r1.3 APRVARS.in
--- APRVARS.in 2000/09/10 22:07:15 1.3
+++ APRVARS.in 2000/10/24 13:27:51
@@ -1 +1,3 @@
+EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS @THREAD_CPPFLAGS@"
+EXTRA_CFLAGS="$EXTRA_CFLAGS @THREAD_CFLAGS@"
EXTRA_LIBS="$EXTRA_LIBS @LIBS@"
Index: apr_common.m4
===================================================================
RCS file: /home/cvspublic/apache-2.0/src/lib/apr/apr_common.m4,v
retrieving revision 1.5
diff -u -p -r1.5 apr_common.m4
--- apr_common.m4 2000/10/05 01:06:33 1.5
+++ apr_common.m4 2000/10/24 13:27:52
@@ -70,6 +70,7 @@ dnl PTHREAD_FLAGS="-D_REENTRANT -D_XO
if test -n "$PTHREAD_FLAGS"; then
CPPFLAGS="$CPPFLAGS $PTHREAD_FLAGS"
+ THREAD_CPPFLAGS="$THREAD_CPPFLAGS $PTHREAD_FLAGS"
fi
])dnl
@@ -165,6 +166,7 @@ fi
if test -n "$ac_cv_pthreads_cflags"; then
CFLAGS="$CFLAGS $ac_cv_pthreads_cflags"
+ THREAD_CFLAGS="$THREAD_CFLAGS $ac_cv_pthreads_cflags"
fi
PTHREADS_CHECK_COMPILE
Index: configure.in
===================================================================
RCS file: /home/cvspublic/apache-2.0/src/lib/apr/configure.in,v
retrieving revision 1.161
diff -u -p -r1.161 configure.in
--- configure.in 2000/10/24 10:25:23 1.161
+++ configure.in 2000/10/24 13:27:52
@@ -715,6 +715,8 @@ AC_SUBST(OSDIR)
AC_SUBST(DEFAULT_OSDIR)
AC_SUBST(LIBPREFIX)
AC_SUBST(EXEEXT)
+AC_SUBST(THREAD_CPPFLAGS)
+AC_SUBST(THREAD_CFLAGS)
echo "Construct Makefiles and header files."
MAKEFILE1="Makefile lib/Makefile strings/Makefile passwd/Makefile tables/Makefile"
Index: configure.in
===================================================================
RCS file: /cvs/subversion/configure.in,v
retrieving revision 1.38
diff -u -p -r1.38 configure.in
--- configure.in 2000/10/16 13:23:54 1.38
+++ configure.in 2000/10/24 13:26:39
@@ -43,6 +43,17 @@ if test "$enable_subdir_config" = "yes";
fi
+dnl Get libraries and thread flags from APR ---------------------
+
+if test -f apr/APRVARS; then
+ . apr/APRVARS
+ CPPFLAGS="$CPPFLAGS $EXTRA_CPPFLAGS"
+ CFLAGS="$CFLAGS $EXTRA_CFLAGS"
+ LIBS="$LIBS $EXTRA_LIBS"
+else
+ AC_MSG_ERROR([Must configure APR before Subversion.])
+fi
+
dnl Check for programs ---------------------
dnl Look for a C compiler
Index: subversion/client/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/client/Makefile.am,v
retrieving revision 1.5
diff -u -p -r1.5 Makefile.am
--- subversion/client/Makefile.am 2000/10/20 02:17:03 1.5
+++ subversion/client/Makefile.am 2000/10/24 13:26:39
@@ -4,7 +4,6 @@ noinst_PROGRAMS = svn
svn_SOURCES = main.c
## Flags needed when compiling:
-CFLAGS = @CFLAGS@ -pthread
INCLUDES = -I../include -I../../apr/include -I../../expat-lite
## Libraries this binary depends upon:
Index: subversion/libsvn_delta/tests/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_delta/tests/Makefile.am,v
retrieving revision 1.11
diff -u -p -r1.11 Makefile.am
--- subversion/libsvn_delta/tests/Makefile.am 2000/10/16 20:05:27 1.11
+++ subversion/libsvn_delta/tests/Makefile.am 2000/10/24 13:26:39
@@ -9,7 +9,6 @@ xml_output_test_SOURCES = xml-output-tes
svndiff_test_SOURCES = svndiff-test.c
## Flags needed when compiling:
-CFLAGS = @CFLAGS@ -pthread
INCLUDES = -I../../include -I../../../apr/include -I../../../expat-lite
## Libraries this binary depends upon:
Index: subversion/libsvn_fs/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_fs/Makefile.am,v
retrieving revision 1.7
diff -u -p -r1.7 Makefile.am
--- subversion/libsvn_fs/Makefile.am 2000/10/14 06:11:12 1.7
+++ subversion/libsvn_fs/Makefile.am 2000/10/24 13:26:39
@@ -16,7 +16,6 @@ libsvn_fs_la_SOURCES = convert-size.c \
txn.c \
version.c
-CFLAGS = @CFLAGS@ -pthread
INCLUDES = -I../include -I../../apr/include -I../../expat-lite
## Build *this* directory first, *then* the test subdirectory!
Index: subversion/libsvn_fs/tests/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_fs/tests/Makefile.am,v
retrieving revision 1.3
diff -u -p -r1.3 Makefile.am
--- subversion/libsvn_fs/tests/Makefile.am 2000/10/12 17:11:52 1.3
+++ subversion/libsvn_fs/tests/Makefile.am 2000/10/24 13:26:39
@@ -8,7 +8,6 @@ skel_test_LDADD = ../libsvn_fs.la \
../../../apr/libapr.a
-CFLAGS = @CFLAGS@ -pthread
INCLUDES = -I .. -I ../../include -I ../../../apr/include
## Make libtool be quiet
Index: subversion/libsvn_ra_dav/tests/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_ra_dav/tests/Makefile.am,v
retrieving revision 1.8
diff -u -p -r1.8 Makefile.am
--- subversion/libsvn_ra_dav/tests/Makefile.am 2000/10/12 17:11:52 1.8
+++ subversion/libsvn_ra_dav/tests/Makefile.am 2000/10/24 13:26:39
@@ -4,7 +4,6 @@ noinst_PROGRAMS = ra-dav-test
ra_dav_test_SOURCES = ra-dav-test.c
## Flags needed when compiling:
-CFLAGS = @CFLAGS@ -pthread
INCLUDES = -I../../include -I../../../apr/include
## Libraries this binary depends upon:
Index: subversion/libsvn_subr/tests/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_subr/tests/Makefile.am,v
retrieving revision 1.10
diff -u -p -r1.10 Makefile.am
--- subversion/libsvn_subr/tests/Makefile.am 2000/10/14 20:58:44 1.10
+++ subversion/libsvn_subr/tests/Makefile.am 2000/10/24 13:26:39
@@ -5,7 +5,6 @@ hashdump_test_SOURCES = hashdump-test.c
stringtest_SOURCES = stringtest.c
## Flags needed when compiling:
-CFLAGS = @CFLAGS@ -pthread
INCLUDES = -I../../include -I../../../apr/include
## Libraries this binary depends upon:
Index: subversion/libsvn_wc/tests/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/libsvn_wc/tests/Makefile.am,v
retrieving revision 1.11
diff -u -p -r1.11 Makefile.am
--- subversion/libsvn_wc/tests/Makefile.am 2000/10/16 20:05:27 1.11
+++ subversion/libsvn_wc/tests/Makefile.am 2000/10/24 13:26:39
@@ -7,7 +7,6 @@ commit_test_SOURCES = commit-test.c
## Flags needed when compiling:
-CFLAGS = @CFLAGS@ -pthread
INCLUDES = -I../../include -I../../../apr/include -I../../../expat-lite
## Libraries this binary depends upon:
Index: subversion/tests-common/Makefile.am
===================================================================
RCS file: /cvs/subversion/subversion/tests-common/Makefile.am,v
retrieving revision 1.6
diff -u -p -r1.6 Makefile.am
--- subversion/tests-common/Makefile.am 2000/10/16 20:05:27 1.6
+++ subversion/tests-common/Makefile.am 2000/10/24 13:26:39
@@ -5,7 +5,6 @@ libsvn_tests_main_la_SOURCES = svn_tests
libsvn_test_editor_la_SOURCES = svn_test_editor.c
## Flags needed when compiling:
-CFLAGS = @CFLAGS@ -pthread
INCLUDES = -I../../apr/include -I../include
Received on Sat Oct 21 14:36:12 2006