fielding 01/04/28 22:22:16
Modified: . APRVARS.in CHANGES configure.in
build apr_common.m4 apr_hints.m4 apr_threads.m4
rules.mk.in
test MakeWin32Make.pl Makefile.in
Log:
Completely revamp configure so that it preserves the standard make
variables CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS and LIBS by moving
the configure additions to EXTRA_* variables. Also, allow the user
to specify NOTEST_* values for all of the above, which eliminates the
need for THREAD_CPPFLAGS, THREAD_CFLAGS, and OPTIM. Fix the setting
of INCLUDES and EXTRA_INCLUDES. Check flags as they are added to
avoid pointless duplications. Fix the order in which flags are given
on the compile and link lines.
The Makefile.in in the test directory hasn't been updated in ages,
but that will have to wait.
Revision Changes Path
1.6 +6 -4 apr/APRVARS.in
Index: APRVARS.in
===================================================================
RCS file: /home/cvs/apr/APRVARS.in,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- APRVARS.in 2001/01/09 19:28:36 1.5
+++ APRVARS.in 2001/04/29 05:22:15 1.6
@@ -1,4 +1,6 @@
-EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS @THREAD_CPPFLAGS@"
-EXTRA_CFLAGS="$EXTRA_CFLAGS @THREAD_CFLAGS@"
-EXTRA_LIBS="$EXTRA_LIBS @LIBS@"
-LIBTOOL_LIBS="$LIBTOOL_LIBS @LIBTOOL_LIBS@"
+EXTRA_CPPFLAGS="@EXTRA_CPPFLAGS@"
+EXTRA_CFLAGS="@EXTRA_CFLAGS@"
+EXTRA_LDFLAGS="@EXTRA_LDFLAGS@"
+EXTRA_LIBS="@EXTRA_LIBS@"
+EXTRA_INCLUDES="@EXTRA_INCLUDES@"
+LIBTOOL_LIBS="@LIBTOOL_LIBS@"
1.97 +9 -0 apr/CHANGES
Index: CHANGES
===================================================================
RCS file: /home/cvs/apr/CHANGES,v
retrieving revision 1.96
retrieving revision 1.97
diff -u -r1.96 -r1.97
--- CHANGES 2001/04/27 00:16:02 1.96
+++ CHANGES 2001/04/29 05:22:15 1.97
@@ -1,5 +1,14 @@
Changes with APR b1
+ *) Completely revamp configure so that it preserves the standard make
+ variables CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS and LIBS by moving
+ the configure additions to EXTRA_* variables. Also, allow the user
+ to specify NOTEST_* values for all of the above, which eliminates the
+ need for THREAD_CPPFLAGS, THREAD_CFLAGS, and OPTIM. Fix the setting
+ of INCLUDES and EXTRA_INCLUDES. Check flags as they are added to
+ avoid pointless duplications. Fix the order in which flags are given
+ on the compile and link lines. [Roy Fielding]
+
*) Fix DSO code on HP/UX. We have to use == not =, and it makes more
sense to actually return errno, so that the return code means
something. [Ryan Bloom]
1.295 +61 -42 apr/configure.in
Index: configure.in
===================================================================
RCS file: /home/cvs/apr/configure.in,v
retrieving revision 1.294
retrieving revision 1.295
diff -u -r1.294 -r1.295
--- configure.in 2001/04/27 18:36:03 1.294
+++ configure.in 2001/04/29 05:22:15 1.295
@@ -17,6 +17,14 @@
sinclude(build/apr_hints.m4)
sinclude(build/libtool.m4)
+dnl Save user-defined environment settings for later restoration
+dnl
+APR_SAVE_THE_ENVIRONMENT(CPPFLAGS)
+APR_SAVE_THE_ENVIRONMENT(CFLAGS)
+APR_SAVE_THE_ENVIRONMENT(LDFLAGS)
+APR_SAVE_THE_ENVIRONMENT(LIBS)
+APR_SAVE_THE_ENVIRONMENT(INCLUDES)
+
dnl Generate ./config.nice for reproducing runs of configure
dnl
APR_CONFIG_NICE(config.nice)
@@ -55,31 +63,30 @@
MKDIR=$apr_builders/mkdir.sh
-# These added to allow default directories to be used...
+dnl These added to allow default directories to be used...
DEFAULT_OSDIR="unix"
echo "(Default will be ${DEFAULT_OSDIR})"
apr_modules="file_io network_io threadproc misc locks time mmap shmem i18n
user"
-dnl # Checks for programs.
-AC_PROG_CC
+dnl Checks for programs.
AC_PROG_MAKE_SET
+AC_PROG_CC
+AC_PROG_CPP
AC_PROG_AWK
+AC_PROG_LN_S
+AC_PROG_RANLIB
+AC_PROG_INSTALL
AC_CHECK_PROG(RM, rm, rm)
AC_CHECK_TOOL(AR, ar, ar)
-# This macro needs to be here in case we are on an AIX box.
+dnl Various OS checks that apparently set required flags
AC_AIX
+AC_ISC_POSIX
+AC_MINIX
APR_EBCDIC
-# Use /bin/sh if it exists, otherwise go looking for sh in the path
-if test ".$SH" = . -a -f /bin/sh; then
- SH="/bin/sh"
-fi
-AC_CHECK_PROG(SH, sh, sh)
-
-dnl
dnl prep libtool
dnl
echo "performing libtool configuration..."
@@ -101,7 +108,7 @@
if test "x$use_libtool" = "xyes"; then
lt_compile="\$(LIBTOOL) --mode=compile \$(LTFLAGS) \$(COMPILE) -c \$<
&& touch \$@"
- link="\$(LIBTOOL) --mode=link \$(LTFLAGS) \$(COMPILE) \$(LDFLAGS) -o
\$@"
+ link="\$(LIBTOOL) --mode=link \$(LTFLAGS) \$(COMPILE) \$(ALL_LDFLAGS)
-o \$@"
so_ext="lo"
lib_target="-rpath \$(libdir) \$\$objects"
else
@@ -122,24 +129,32 @@
echo $ac_n "${nl}Check for compiler flags..."
AC_ARG_ENABLE(debug,[ --enable-debug Turn on debugging and
compile time warnings],
- [CFLAGS="$CFLAGS -g"; if test "$GCC" = "yes"; then CFLAGS="$CFLAGS
-Wall"; fi])
+ [APR_ADDTO(CFLAGS,-g)
+ if test "$GCC" = "yes"; then
+ APR_ADDTO(CFLAGS,-Wall)
+ fi
+])dnl
AC_ARG_ENABLE(maintainer-mode,[ --enable-maintainer-mode Turn on debugging
and compile time warnings],
- [CFLAGS="$CFLAGS -g"; if test "$GCC" = "yes"; then CFLAGS="$CFLAGS
-Wall -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations"; fi])
+ [APR_ADDTO(CFLAGS,-g)
+ if test "$GCC" = "yes"; then
+ APR_ADDTO(CFLAGS,[-Wall -Wmissing-prototypes -Wstrict-prototypes
-Wmissing-declarations])
+ fi
+])dnl
dnl # this is the place to put specific options for platform/compiler
dnl # combinations
case "$OS:$CC" in
*-hp-hpux*:cc )
- CFLAGS="$CFLAGS -Ae +DAportable +Z"
+ APR_ADDTO(CFLAGS,[-Ae +DAportable +Z])
;;
powerpc-*-beos:mwcc* )
- CPP="mwcc -E"
- CC="mwcc"
- AR="ar"
- ;;
+ APR_SETVAR(CPP,[mwcc -E])
+ APR_SETVAR(CC,mwcc)
+ APR_SETVAR(AR,ar)
+ ;;
mips-sni-sysv4:cc )
- CFLAGS="$CFLAGS -Kthread"
+ APR_ADDTO(CFLAGS,-Kthread)
;;
esac
@@ -151,8 +166,8 @@
eolstr="\\n"
;;
*-os2*)
- CPPFLAGS="$CPPFLAGS -DOS2"
- CFLAGS="$CFLAGS -Zmt"
+ APR_ADDTO(CPPFLAGS,-DOS2)
+ APR_ADDTO(CFLAGS,-Zmt)
OSDIR="os2"
enable_threads="system_threads"
eolstr="\\r\\n"
@@ -160,7 +175,7 @@
;;
*beos*)
OSDIR="beos"
- CPPFLAGS="$CPPFLAGS -DBEOS"
+ APR_ADDTO(CPPFLAGS,-DBEOS)
enable_threads="system_threads"
config_subdirs="shmem/unix/mm"
native_mmap_emul="1"
@@ -214,20 +229,10 @@
pthreadh="0"
pthreadser="0"
else
-#
-# Play with CPPFLAGS given what was learned from APR_PRELOAD.
-#
-# [Roy: I don't like this because it messes up an environment
-# variable that should remain pristine. However, it is needed
-# for compatibility until all flag handling can be rewritten.]
-#
- apr_save_cppflags="$CPPFLAGS"
- if test -n "$THREAD_CPPFLAGS"; then
- CPPFLAGS="$CPPFLAGS $THREAD_CPPFLAGS"
- fi
if test "$enable_threads" = "pthread"; then
# We have specified pthreads for our threading library, just make sure
# that we have everything we need
+ APR_PTHREADS_CHECK_SAVE
APR_PTHREADS_CHECK
APR_CHECK_PTHREADS_H([
threads="1"
@@ -236,7 +241,8 @@
AC_DEFINE(USE_THREADS) ], [
threads="0"
pthreadh="0"
- pthreadser="0" ] )
+ pthreadser="0"
+ APR_PTHREADS_CHECK_RESTORE ] )
elif test "$enable_threads" = "system_threads"; then
threads="1"
pthreadh="0"
@@ -245,6 +251,7 @@
# We basically specified that we wanted threads, but not how to implement
# them. In this case, just look for pthreads. In the future, we can check
# for other threading libraries as well.
+ APR_PTHREADS_CHECK_SAVE
APR_PTHREADS_CHECK
APR_CHECK_PTHREADS_H([
threads="1"
@@ -254,7 +261,7 @@
threads="0"
pthreadser="0"
pthreadh="0"
- CPPFLAGS="$apr_save_cppflags" ] )
+ APR_PTHREADS_CHECK_RESTORE ] )
fi
if test "$pthreadh" = "1"; then
APR_CHECK_PTHREAD_GETSPECIFIC_TWO_ARGS
@@ -359,7 +366,7 @@
AC_SUBST(file_based)
if test ".$SYS_SW" = ".AIX"; then
- CPPFLAGS="$CPPFLAGS -U__STR__"
+ APR_ADDTO(CPPFLAGS,-U__STR__)
case "$SYS_KV" in
[12]*)
AC_DEFINE(USEBCOPY)
@@ -782,7 +789,7 @@
[
AC_CHECK_FUNCS(NSLinkModule, [ tempdso="dyld" ], [ tempdso="no" ])
if test "$tempdso" = "no"; then
- AC_CHECK_LIB(dl, dlopen, [ tempdso="dlfcn" LIBS="$LIBS -ldl" ],
+ AC_CHECK_LIB(dl, dlopen, [ tempdso="dlfcn" APR_ADDTO(LIBS,-ldl) ],
tempdso="no")
fi
if test "$tempdso" = "no"; then
@@ -792,7 +799,7 @@
AC_CHECK_LIB(root, load_image, tempdso="yes", tempdso="no")
fi
if test "$tempdso" = "no"; then
- AC_CHECK_LIB(dld, shl_load, [ tempdso="shl" LIBS="$LIBS -ldld" ],
+ AC_CHECK_LIB(dld, shl_load, [ tempdso="shl" APR_ADDTO(LIBS,-ldld) ],
tempdso="no")
fi
if test "$tempdso" = "no"; then
@@ -1081,17 +1088,29 @@
fi
AC_SUBST(have_ipv6)
+dnl #----------------------------- Finalize the variables
+
+echo $ac_n "${nl}Restore user-defined environment settings...${nl}"
+
+APR_RESTORE_THE_ENVIRONMENT(CPPFLAGS, EXTRA_)
+APR_RESTORE_THE_ENVIRONMENT(CFLAGS, EXTRA_)
+APR_RESTORE_THE_ENVIRONMENT(LDFLAGS, EXTRA_)
+APR_RESTORE_THE_ENVIRONMENT(LIBS, EXTRA_)
+APR_RESTORE_THE_ENVIRONMENT(INCLUDES, EXTRA_)
+AC_SUBST(NOTEST_CPPFLAGS)
+AC_SUBST(NOTEST_CFLAGS)
+AC_SUBST(NOTEST_LDFLAGS)
+AC_SUBST(NOTEST_LIBS)
+AC_SUBST(NOTEST_INCLUDES)
+
dnl #----------------------------- Construct the files
AC_SUBST(LDLIBS)
-AC_SUBST(OPTIM)
AC_SUBST(AR)
AC_SUBST(RM)
AC_SUBST(OSDIR)
AC_SUBST(DEFAULT_OSDIR)
AC_SUBST(EXEEXT)
-AC_SUBST(THREAD_CPPFLAGS)
-AC_SUBST(THREAD_CFLAGS)
AC_SUBST(LIBTOOL_LIBS)
echo "${nl}Construct Makefiles and header files."
1.17 +90 -43 apr/build/apr_common.m4
Index: apr_common.m4
===================================================================
RCS file: /home/cvs/apr/build/apr_common.m4,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- apr_common.m4 2001/04/07 18:32:11 1.16
+++ apr_common.m4 2001/04/29 05:22:15 1.17
@@ -2,6 +2,10 @@
dnl apr_common.m4: APR's general-purpose autoconf macros
dnl
+dnl APR_CONFIG_NICE(filename)
+dnl
+dnl Saves a snapshot of the configure command-line for later reuse
+dnl
AC_DEFUN(APR_CONFIG_NICE,[
rm -f $1
cat >$1<<EOF
@@ -10,16 +14,43 @@
# Created by configure
EOF
- if test -n "$OPTIM"; then
- echo "OPTIM=\"$OPTIM\"; export OPTIM" >> $1
+ if test -n "$MAKE"; then
+ echo "MAKE=\"$MAKE\"; export MAKE" >> $1
+ fi
+ if test -n "$CFLAGS"; then
+ echo "CFLAGS=\"$CFLAGS\"; export CFLAGS" >> $1
+ fi
+ if test -n "$CPPFLAGS"; then
+ echo "CPPFLAGS=\"$CPPFLAGS\"; export CPPFLAGS" >> $1
+ fi
+ if test -n "$LDFLAGS"; then
+ echo "LDFLAGS=\"$LDFLAGS\"; export LDFLAGS" >> $1
+ fi
+ if test -n "$LIBS"; then
+ echo "LIBS=\"$LIBS\"; export LIBS" >> $1
+ fi
+ if test -n "$INCLUDES"; then
+ echo "INCLUDES=\"$INCLUDES\"; export INCLUDES" >> $1
+ fi
+ if test -n "$NOTEST_CFLAGS"; then
+ echo "NOTEST_CFLAGS=\"$NOTEST_CFLAGS\"; export NOTEST_CFLAGS" >> $1
fi
+ if test -n "$NOTEST_CPPFLAGS"; then
+ echo "NOTEST_CPPFLAGS=\"$NOTEST_CPPFLAGS\"; export NOTEST_CPPFLAGS" >> $1
+ fi
+ if test -n "$NOTEST_LDFLAGS"; then
+ echo "NOTEST_LDFLAGS=\"$NOTEST_LDFLAGS\"; export NOTEST_LDFLAGS" >> $1
+ fi
+ if test -n "$NOTEST_LIBS"; then
+ echo "NOTEST_LIBS=\"$NOTEST_LIBS\"; export NOTEST_LIBS" >> $1
+ fi
for arg in [$]0 "[$]@"; do
echo "\"[$]arg\" \\" >> $1
done
echo '"[$]@"' >> $1
chmod +x $1
-])
+])dnl
dnl
dnl APR_SUBDIR_CONFIG(dir [, sub-package-cmdline-args])
@@ -62,37 +93,39 @@
AC_CACHE_LOAD
])dnl
-
dnl
-dnl APR_DOEXTRA
+dnl APR_SAVE_THE_ENVIRONMENT(variable_name)
dnl
-dnl Handle the use of EXTRA_* variables.
-dnl Basically, EXTRA_* vars are added to the
-dnl current settings of their "parents". We
-dnl can expand as needed for additional
-dnl EXTRA_* variables by adding them to the
-dnl "for i in..." line.
-dnl
-dnl To handle recursive configures, the 1st time
-dnl through we need to null out EXTRA_* and then
-dnl export the lot of them, since we want/need
-dnl them to exist in the sub-configures' environment.
-dnl The nasty eval's allow us to use the 'for'
-dnl construct and save some lines of code.
-dnl
-AC_DEFUN(APR_DOEXTRA, [
- for i in CFLAGS CPPFLAGS LDFLAGS LIBS
- do
- eval APR_TMP=\$EXTRA_$i
- if test -n "$APR_TMP"; then
- eval $i=\"\$$i $APR_TMP\"
- eval export $i
- eval unset EXTRA_${i}
- eval export EXTRA_${i}
- fi
- done
-])
+dnl Stores the variable (usually a Makefile macro) for later restoration
+dnl
+AC_DEFUN(APR_SAVE_THE_ENVIRONMENT,[
+ apr_ste_save_$1="$$1"
+])dnl
+dnl
+dnl APR_RESTORE_THE_ENVIRONMENT(variable_name, prefix_)
+dnl
+dnl Uses the previously saved variable content to figure out what configure
+dnl has added to the variable, moving the new bits to prefix_variable_name
+dnl and restoring the original variable contents. This makes it possible
+dnl for a user to override configure when it does something stupid.
+dnl
+AC_DEFUN(APR_RESTORE_THE_ENVIRONMENT,[
+if test "x$apr_ste_save_$1" = "x"; then
+ $2$1="$$1"
+ $1=
+else
+ if test "x$apr_ste_save_$1" = "x$$1"; then
+ $2$1=
+ else
+ $2$1=`echo $$1 | sed -e "s%${apr_ste_save_$1}%%"`
+ $1="$apr_ste_save_$1"
+ fi
+fi
+echo " restoring $1 to \"$$1\""
+echo " setting $2$1 to \"$$2$1\""
+AC_SUBST($2$1)
+])dnl
dnl
dnl APR_SETIFNULL(variable, value)
@@ -101,11 +134,10 @@
dnl
AC_DEFUN(APR_SETIFNULL,[
if test -z "$$1"; then
- echo " Setting $1 to \"$2\""
- $1="$2"; export $1
+ echo " setting $1 to \"$2\""
+ $1="$2"
fi
-])
-
+])dnl
dnl
dnl APR_SETVAR(variable, value)
@@ -113,10 +145,9 @@
dnl Set variable no matter what
dnl
AC_DEFUN(APR_SETVAR,[
- echo " Forcing $1 to \"$2\""
- $1="$2"; export $1
-])
-
+ echo " forcing $1 to \"$2\""
+ $1="$2"
+])dnl
dnl
dnl APR_ADDTO(variable, value)
@@ -124,10 +155,26 @@
dnl Add value to variable
dnl
AC_DEFUN(APR_ADDTO,[
- echo " Adding \"$2\" to $1"
- $1="$$1 $2"; export $1
-])
-
+ if test "x$$1" = "x"; then
+ echo " setting $1 to \"$2\""
+ $1="$2"
+ else
+ apr_addto_bugger="$2"
+ for i in $apr_addto_bugger; do
+ apr_addto_duplicate="0"
+ for j in $$1; do
+ if test "x$i" = "x$j"; then
+ apr_addto_duplicate="1"
+ break
+ fi
+ done
+ if test $apr_addto_duplicate = "0"; then
+ echo " adding \"$i\" to $1"
+ $1="$$1 $i"
+ fi
+ done
+ fi
+])dnl
dnl
dnl APR_CHECK_DEFINE_FILES( symbol, header_file [header_file ...] )
1.9 +17 -23 apr/build/apr_hints.m4
Index: apr_hints.m4
===================================================================
RCS file: /home/cvs/apr/build/apr_hints.m4,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -r1.8 -r1.9
--- apr_hints.m4 2001/04/27 15:43:56 1.8
+++ apr_hints.m4 2001/04/29 05:22:15 1.9
@@ -88,7 +88,7 @@
APR_ADDTO(CFLAGS, [-qHALT=E -qLANGLVL=extended])
fi
APR_SETIFNULL(apr_iconv_inbuf_const, [1])
- APR_ADDTO(THREAD_CPPFLAGS, [-D_THREAD_SAFE])
+ APR_ADDTO(CPPFLAGS, [-D_THREAD_SAFE])
;;
*-apollo-*)
APR_ADDTO(CPPFLAGS, [-DAPOLLO])
@@ -103,8 +103,7 @@
APR_ADDTO(CPPFLAGS, [-DHIUX])
;;
*-hp-hpux11.*)
- APR_ADDTO(CPPFLAGS, [-DHPUX11])
- APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT])
+ APR_ADDTO(CPPFLAGS, [-DHPUX11 -D_REENTRANT])
;;
*-hp-hpux10.*)
case $host in
@@ -114,11 +113,10 @@
APR_ADDTO(CPPFLAGS, [-DSELECT_NEEDS_CAST])
;;
esac
- APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT])
+ APR_ADDTO(CPPFLAGS, [-D_REENTRANT])
;;
*-hp-hpux*)
- APR_ADDTO(CPPFLAGS, [-DHPUX])
- APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT])
+ APR_ADDTO(CPPFLAGS, [-DHPUX -D_REENTRANT])
;;
*-linux-*)
case `uname -r` in
@@ -131,7 +129,7 @@
* )
;;
esac
- APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT])
+ APR_ADDTO(CPPFLAGS, [-D_REENTRANT])
;;
*-GNU*)
APR_ADDTO(CPPFLAGS, [-DHURD])
@@ -145,7 +143,7 @@
APR_ADDTO(CFLAGS, [-m486])
;;
*-openbsd*)
- APR_ADDTO(THREAD_CPPFLAGS, [-D_POSIX_THREADS])
+ APR_ADDTO(CPPFLAGS, [-D_POSIX_THREADS])
;;
*-netbsd*)
APR_ADDTO(CPPFLAGS, [-DNETBSD])
@@ -159,15 +157,15 @@
esac
APR_ADDTO(LIBS, [-lcrypt])
APR_SETIFNULL(enable_threads, [no])
- APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT -D_THREAD_SAFE])
+ APR_ADDTO(CPPFLAGS, [-D_REENTRANT -D_THREAD_SAFE])
;;
*-next-nextstep*)
- APR_SETIFNULL(OPTIM, [-O])
+ APR_SETIFNULL(CFLAGS, [-O])
APR_ADDTO(CPPFLAGS, [-DNEXT])
;;
*-next-openstep*)
APR_SETVAR(CC, [cc])
- APR_SETIFNULL(OPTIM, [-O])
+ APR_SETIFNULL(CFLAGS, [-O])
APR_ADDTO(CPPFLAGS, [-DNEXT])
;;
*-apple-rhapsody*)
@@ -196,27 +194,23 @@
APR_ADDTO(LIBS, [-linet])
;;
*-sco3*)
- APR_ADDTO(CPPFLAGS, [-DSCO])
+ APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT])
APR_ADDTO(CFLAGS, [-Oacgiltz])
APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i])
- APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT])
;;
*-sco5*)
- APR_ADDTO(CPPFLAGS, [-DSCO5])
+ APR_ADDTO(CPPFLAGS, [-DSCO5 -D_REENTRANT])
APR_ADDTO(LIBS, [-lsocket -lmalloc -lprot -ltinfo -lx])
- APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT])
;;
*-sco_sv*|*-SCO_SV*)
- APR_ADDTO(CPPFLAGS, [-DSCO])
+ APR_ADDTO(CPPFLAGS, [-DSCO -D_REENTRANT])
APR_ADDTO(LIBS, [-lPW -lsocket -lmalloc -lcrypt_i])
- APR_ADDTO(THREAD_CPPFLAGS, [-D_REENTRANT])
;;
*-solaris2*)
PLATOSVERS=`echo $host | sed 's/^.*solaris2.//'`
- APR_ADDTO(CPPFLAGS, [-DSOLARIS2=$PLATOSVERS])
+ APR_ADDTO(CPPFLAGS, [-DSOLARIS2=$PLATOSVERS -D_POSIX_PTHREAD_SEMANTICS
-D_REENTRANT])
APR_ADDTO(LIBS, [-lsocket -lnsl])
APR_SETIFNULL(apr_iconv_inbuf_const, [1])
- APR_ADDTO(THREAD_CPPFLAGS, [-D_POSIX_PTHREAD_SEMANTICS -D_REENTRANT])
;;
*-sunos4*)
APR_ADDTO(CPPFLAGS, [-DSUNOS4 -DUSEBCOPY])
@@ -310,8 +304,8 @@
;;
*convex-v11*)
APR_ADDTO(CPPFLAGS, [-DCONVEXOS11])
+ APR_SETIFNULL(CFLAGS, [-O1])
APR_ADDTO(CFLAGS, [-ext])
- APR_SETIFNULL(OPTIM, [-O1])
APR_SETVAR(CC, [cc])
;;
i860-intel-osf1)
@@ -352,11 +346,11 @@
;;
*-riscix)
APR_ADDTO(CPPFLAGS, [-DRISCIX])
- APR_SETIFNULL(OPTIM, [-O])
+ APR_SETIFNULL(CFLAGS, [-O])
APR_SETIFNULL(MAKE, [make])
;;
*-irix*)
- APR_ADDTO(THREAD_CPPFLAGS, [-D_POSIX_THREAD_SAFE_FUNCTIONS])
+ APR_ADDTO(CPPFLAGS, [-D_POSIX_THREAD_SAFE_FUNCTIONS])
;;
*beos*)
APR_ADDTO(CPPFLAGS, [-DBEOS])
@@ -393,6 +387,6 @@
APR_ADDTO(CPPFLAGS, [-U_NO_PROTO
-DPTHREAD_ATTR_SETDETACHSTATE_ARG2_ADDR -DPTHREAD_SETS_ERRNO
-DPTHREAD_DETACH_ARG1_ADDR -DSIGPROCMASK_SETS_THREAD_MASK -DTCP_NODELAY=1])
;;
esac
- APR_DOEXTRA
+
fi
])
1.5 +22 -5 apr/build/apr_threads.m4
Index: apr_threads.m4
===================================================================
RCS file: /home/cvs/apr/build/apr_threads.m4,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- apr_threads.m4 2001/02/21 11:35:15 1.4
+++ apr_threads.m4 2001/04/29 05:22:15 1.5
@@ -109,7 +109,6 @@
if test -n "$ac_cv_pthreads_cflags"; then
CFLAGS="$CFLAGS $ac_cv_pthreads_cflags"
- THREAD_CFLAGS="$THREAD_CFLAGS $ac_cv_pthreads_cflags"
fi
APR_PTHREADS_CHECK_COMPILE
@@ -123,8 +122,6 @@
APR_PTHREADS_CHECK_COMPILE
if test "$pthreads_working" = "yes"; then
ac_cv_pthreads_cflags="$flag"
- dnl this was already added to CFLAGS; add to THREAD_CFLAGS, too
- THREAD_CFLAGS="$THREAD_CFLAGS $ac_cv_pthreads_cflags"
break
fi
CFLAGS="$ac_save"
@@ -132,7 +129,6 @@
fi
])
-
AC_CACHE_CHECK(for pthreads_lib, ac_cv_pthreads_lib,[
ac_cv_pthreads_lib=""
if test "$pthreads_working" != "yes"; then
@@ -156,6 +152,27 @@
fi
])dnl
+dnl
+dnl APR_PTHREADS_CHECK_SAVE
+dnl APR_PTHREADS_CHECK_RESTORE
+dnl
+dnl Save the global environment variables that might be modified during
+dnl the checks for threading support so that they can restored if the
+dnl result is not what the caller wanted.
+dnl
+AC_DEFUN(APR_PTHREADS_CHECK_SAVE, [
+ apr_pthsv_CFLAGS="$CFLAGS"
+ apr_pthsv_LIBS="$LIBS"
+])dnl
+
+AC_DEFUN(APR_PTHREADS_CHECK_RESTORE, [
+ CFLAGS="$apr_pthsv_CFLAGS"
+ LIBS="$apr_pthsv_LIBS"
+])dnl
+
+dnl
+dnl APR_CHECK_SIGWAIT_ONE_ARG
+dnl
AC_DEFUN(APR_CHECK_SIGWAIT_ONE_ARG,[
AC_CACHE_CHECK(whether sigwait takes one argument,ac_cv_sigwait_one_arg,[
AC_TRY_COMPILE([
@@ -179,4 +196,4 @@
if test "$ac_cv_sigwait_one_arg" = "yes"; then
AC_DEFINE(SIGWAIT_TAKES_ONE_ARG,1,[ ])
fi
-])
+])
1.10 +39 -8 apr/build/rules.mk.in
Index: rules.mk.in
===================================================================
RCS file: /home/cvs/apr/build/rules.mk.in,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- rules.mk.in 2001/04/23 14:55:14 1.9
+++ rules.mk.in 2001/04/29 05:22:15 1.10
@@ -65,17 +65,48 @@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
+# compilation and linking flags that are supposed to be set only by the user.
+# configure adds to them for tests, but we restore them at the end.
+#
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
+# anything added to the standard flags by configure is moved to EXTRA_*
+# at the end of the process.
+#
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
+
+# NOTEST_* are flags and libraries that can be added by the user without
+# causing them to be used in configure tests (necessary for things like
+# -Werror and other strict warnings that maintainers like to use).
+#
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
+
+# Finally, combine all of the flags together in the proper order so that
+# the user-defined flags can always override the configure ones, if needed.
+# Note that includes are listed after the flags because -I options have
+# left-to-right precedence and CPPFLAGS may include user-defined overrides.
+#
+ALL_CPPFLAGS = $(DEFS) $(EXTRA_CPPFLAGS) $(NOTEST_CPPFLAGS) $(CPPFLAGS)
+ALL_CFLAGS = $(EXTRA_CFLAGS) $(NOTEST_CFLAGS) $(CFLAGS)
+ALL_LDFLAGS = $(EXTRA_LDFLAGS) $(NOTEST_LDFLAGS) $(LDFLAGS)
+ALL_LIBS = $(EXTRA_LIBS) $(NOTEST_LIBS) $(LIBS)
+ALL_INCLUDES = $(INCLUDES) $(EXTRA_INCLUDES)
### make LTFLAGS somewhat variable?
LTFLAGS = --silent
@@ -83,7 +114,7 @@
#
# Basic macro setup
#
-COMPILE = $(CC) $(CPPFLAGS) $(INCLUDES) $(OPTIM) $(CFLAGS)
+COMPILE = $(CC) $(ALL_CPPFLAGS) $(ALL_CFLAGS) $(ALL_INCLUDES)
LT_COMPILE = @lt_compile@
LINK = @link@
@@ -143,8 +174,8 @@
local-depend:
@if test -n "`ls *.c 2> /dev/null`"; then \
- echo $(MKDEP) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) *.c ; \
- $(MKDEP) $(CFLAGS) $(CPPFLAGS) $(INCLUDES) *.c ; \
+ echo $(MKDEP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) *.c ; \
+ $(MKDEP) $(ALL_CPPFLAGS) $(ALL_INCLUDES) *.c ; \
fi
# to be filled in by the actual Makefile
1.10 +0 -1 apr/test/MakeWin32Make.pl
Index: MakeWin32Make.pl
===================================================================
RCS file: /home/cvs/apr/test/MakeWin32Make.pl,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -r1.9 -r1.10
--- MakeWin32Make.pl 2001/04/08 08:08:19 1.9
+++ MakeWin32Make.pl 2001/04/29 05:22:16 1.10
@@ -28,7 +28,6 @@
}
$t =~ s|[EMAIL PROTECTED]@|cl|;
$t =~ s|[EMAIL PROTECTED]@||;
- $t =~ s|[EMAIL PROTECTED]@||;
$t =~ s|-I\$\(INCDIR\)|\/I "\$\(INCDIR\)"|;
$t =~ s|\.\.\/libapr\.a|\.\./LibD/apr\.lib|;
if ($t =~ s|[EMAIL PROTECTED]@|\.exe|) {
1.47 +25 -27 apr/test/Makefile.in
Index: Makefile.in
===================================================================
RCS file: /home/cvs/apr/test/Makefile.in,v
retrieving revision 1.46
retrieving revision 1.47
diff -u -r1.46 -r1.47
--- Makefile.in 2001/04/08 08:08:19 1.46
+++ Makefile.in 2001/04/29 05:22:16 1.47
@@ -30,87 +30,85 @@
# bring in rules.mk for standard functionality
@INCLUDE_RULES@
-ALL_LIBS=../libapr.la ../shmem/unix/mm/libmm.la $(LIBS)
+LIBS=../libapr.la ../shmem/unix/mm/libmm.la $(LIBS)
CLEAN_TARGETS = testfile.tmp
-CFLAGS = -g @CFLAGS@ @OPTIM@ $(INCLUDES)
-
INCDIR=../include
INCLUDES=-I$(INCDIR)
[EMAIL PROTECTED]@: testfile.lo ../libapr.la
- $(LINK) testfile.lo $(ALL_LIBS)
+ $(LINK) testfile.lo
[EMAIL PROTECTED]@: testnames.lo ../libapr.la
- $(LINK) testnames.lo $(ALL_LIBS)
+ $(LINK) testnames.lo
[EMAIL PROTECTED]@: testflock.lo ../libapr.la
- $(LINK) testflock.lo $(ALL_LIBS)
+ $(LINK) testflock.lo
### why the export-dynamic?
[EMAIL PROTECTED]@: testdso.lo ../libapr.la
- $(LINK) --export-dynamic testdso.lo $(ALL_LIBS)
+ $(LINK) --export-dynamic testdso.lo
[EMAIL PROTECTED]@: testoc.lo ../libapr.la
- $(LINK) testoc.lo $(ALL_LIBS)
+ $(LINK) testoc.lo
[EMAIL PROTECTED]@: occhild.lo ../libapr.la
- $(LINK) occhild.lo $(ALL_LIBS)
+ $(LINK) occhild.lo
mod_test.so: mod_test.lo ../libapr.la
- $(LINK) -o mod_test.so ${LD_FLAGS} -shared mod_test.o $(ALL_LIBS)
+ $(LINK) -shared mod_test.o
[EMAIL PROTECTED]@: testargs.lo ../libapr.la
- $(LINK) testargs.lo $(ALL_LIBS)
+ $(LINK) testargs.lo
[EMAIL PROTECTED]@: testcontext.lo ../libapr.la
- $(LINK) testcontext.lo $(ALL_LIBS)
+ $(LINK) testcontext.lo
[EMAIL PROTECTED]@: testproc.lo ../libapr.la
- $(LINK) testproc.lo $(ALL_LIBS)
+ $(LINK) testproc.lo
[EMAIL PROTECTED]@: testthread.lo ../libapr.la
- $(LINK) testthread.lo $(ALL_LIBS)
+ $(LINK) testthread.lo
[EMAIL PROTECTED]@: testsock.lo [EMAIL PROTECTED]@ [EMAIL PROTECTED]@ [EMAIL
PROTECTED]@ ../libapr.la
- $(LINK) testsock.lo $(ALL_LIBS)
+ $(LINK) testsock.lo
[EMAIL PROTECTED]@: client.lo ../libapr.la
- $(LINK) client.lo $(ALL_LIBS)
+ $(LINK) client.lo
[EMAIL PROTECTED]@: server.lo sendfile.lo ../libapr.la
- $(LINK) server.lo $(ALL_LIBS)
+ $(LINK) server.lo
[EMAIL PROTECTED]@: sendfile.lo ../libapr.la
- $(LINK) sendfile.lo $(ALL_LIBS)
+ $(LINK) sendfile.lo
[EMAIL PROTECTED]@: testtime.lo ../libapr.la
- $(LINK) testtime.lo $(ALL_LIBS)
+ $(LINK) testtime.lo
[EMAIL PROTECTED]@: testmmap.lo ../libapr.la
- $(LINK) testmmap.lo $(ALL_LIBS)
+ $(LINK) testmmap.lo
[EMAIL PROTECTED]@: testshmem.lo ../libapr.la
- $(LINK) testshmem.lo $(ALL_LIBS)
+ $(LINK) testshmem.lo
[EMAIL PROTECTED]@: testpipe.lo ../libapr.la
- $(LINK) testpipe.lo $(ALL_LIBS)
+ $(LINK) testpipe.lo
[EMAIL PROTECTED]@: testuuid.lo ../libapr.la
- $(LINK) testuuid.lo $(ALL_LIBS)
+ $(LINK) testuuid.lo
[EMAIL PROTECTED]@: testsockopt.lo ../libapr.la
- $(LINK) testsockopt.lo $(ALL_LIBS)
+ $(LINK) testsockopt.lo
[EMAIL PROTECTED]@: testipsub.lo ../libapr.la
- $(LINK) testipsub.lo $(ALL_LIBS)
+ $(LINK) testipsub.lo
[EMAIL PROTECTED]@: testmd5.lo ../libapr.la
- $(LINK) testmd5.lo $(ALL_LIBS)
+ $(LINK) testmd5.lo
[EMAIL PROTECTED]@: testpoll.lo ../libapr.la
- $(LINK) testpoll.lo $(ALL_LIBS)
+ $(LINK) testpoll.lo
# DO NOT REMOVE