You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@apr.apache.org by Justin Erenkrantz <je...@ebuilt.com> on 2001/08/01 20:35:48 UTC

[PATCH] Revamp apr-util's configure

(All apologies to Graham - this shouldn't screw your LDAP patch too
much...)

This is a bit further work on the removal of libtool and other junk from
apr-util.  I apologize for the size of this.  It's hard to piecemeal all
of this.

- Renames the buildconf.sh to buildconf
- Adds ALL_LIBS to the link command for APR since the LINK is used for
  building the test programs.
- Adds config.nice support to apr-util (yay!)
- Removes the libtool generation in apr-util (still have it in expat - I 
  may remove it from there, but I'm not sure we want to branch that much
  from the original CVS of expat)
- Exports the so_ext and lib_target macros from APR via APRVARS.  This is 
  needed in the Makefiles for apr-util.  (lib_target also needs to be 
  escaped.)
- Switches to APR_ADDTO for most of variables
- Gets the test/ directory building again by including the
  APR_SOURCE_DIR variable.
- Fix condition where we would run expat's configure twice.
  
This would require commits to apr, apr-util, and httpd-2.0.  I will
commit this later on tonight to all three trees if no one screams.
-- justin

Index: buildconf
===================================================================
RCS file: /home/cvs/httpd-2.0/buildconf,v
retrieving revision 1.23
diff -u -r1.23 buildconf
--- buildconf	2001/07/17 04:57:43	1.23
+++ buildconf	2001/08/01 18:21:52
@@ -109,8 +109,8 @@
 }
 
 echo rebuilding $aprutil_configure
-(cd srclib/apr-util && ./buildconf.sh) || {
-    echo "./buildconf.sh failed for apr-util" 
+(cd srclib/apr-util && ./buildconf) || {
+    echo "./buildconf failed for apr-util" 
     exit 1
 }

Index: configure.in
===================================================================
RCS file: /home/cvs/apr/configure.in,v
retrieving revision 1.350
diff -u -r1.350 configure.in
--- configure.in	2001/07/31 02:10:10	1.350
+++ configure.in	2001/08/01 18:23:01
@@ -111,20 +111,23 @@
 
 if test "x$use_libtool" = "xyes"; then
       lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -c $< && touch $@'
-      link='$(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) $(ALL_LDFLAGS) -o $@'
+      link='$(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) $(ALL_LDFLAGS) $(ALL_LIBS) -o $@'
       so_ext='lo'
       lib_target='-rpath $(libdir) $$objects'
+      export_lib_target='-rpath $(libdir) \$\$objects'
 else
       lt_compile='$(COMPILE) -c $<'
       link='$(AR) cr $(TARGET_LIB) $$objects; $(RANLIB) $(TARGET_LIB)'
       so_ext='o'
       lib_target=''
+      export_lib_target=''
 fi
 
 AC_SUBST(lt_compile)
 AC_SUBST(link)
 AC_SUBST(so_ext)
 AC_SUBST(lib_target)
+AC_SUBST(export_lib_target)
 AC_SUBST(LTFLAGS)
 AC_SUBST(LT_LDFLAGS)
 
Index: APRVARS.in
===================================================================
RCS file: /home/cvs/apr/APRVARS.in,v
retrieving revision 1.9
diff -u -r1.9 APRVARS.in
--- APRVARS.in	2001/07/09 02:30:43	1.9
+++ APRVARS.in	2001/08/01 18:23:01
@@ -8,3 +8,6 @@
 EXTRA_INCLUDES="@EXTRA_INCLUDES@"
 LIBTOOL_LIBS="@LIBTOOL_LIBS@"
 APR_SOURCE_DIR="@abs_srcdir@"
+APR_SO_EXT="@so_ext@"
+APR_LIB_TARGET="@export_lib_target@"
+

Index: configure.in
===================================================================
RCS file: /home/cvs/apr-util/configure.in,v
retrieving revision 1.29
diff -u -r1.29 configure.in
--- configure.in	2001/07/30 15:59:02	1.29
+++ configure.in	2001/08/01 18:24:06
@@ -8,17 +8,21 @@
 AC_CONFIG_HEADER(include/private/apu_config.h)
 AC_CONFIG_AUX_DIR(../apr/build)
 
+sinclude(build/apu-conf.m4)
+sinclude(../apr/build/libtool.m4)
+sinclude(../apr/build/apr_common.m4)
+
+dnl Generate ./config.nice for reproducing runs of configure
+dnl 
+APR_CONFIG_NICE(config.nice)
+
+dnl # Some initial steps for configuration.  We setup the default directory
+dnl # and which files are to be configured.
+
 dnl Absolute source/build directory
 abs_srcdir=`(cd $srcdir && pwd)`
 abs_builddir=`pwd`
 
-sinclude(build/apu-conf.m4)
-sinclude(../apr/build/libtool.m4)
-
-AC_PROG_CC
-AC_PROG_AWK
-AC_CHECK_PROG(RM, rm, rm)
- 
 if test "$abs_builddir" != "$abs_srcdir"; then
   USE_VPATH=1
 fi
@@ -34,10 +38,10 @@
 dnl
 dnl set up the compilation flags and stuff
 dnl
-INCLUDES="$INCLUDES -I\$(top_builddir)/include/private -I\$(top_builddir)/include"
+APR_ADDTO(INCLUDES, [-I\$(top_builddir)/include/private -I\$(top_builddir)/include])
 
 if test -n "$USE_VPATH"; then
-    INCLUDES="$INCLUDES -I\$(top_srcdir)/include"
+    APR_ADDTO(INCLUDES, [-I\$(top_srcdir)/include])
 fi
 
 dnl
@@ -48,15 +52,14 @@
 APU_FIND_APR
 APU_CHECK_DBM
 APU_FIND_EXPAT
-
-INCLUDES="$INCLUDES $APR_INCLUDES"
 
-dnl
-dnl prep libtool
-dnl
-echo "performing libtool configuration..."
+dnl Add in the INCLUDES from APR
+APR_ADDTO(INCLUDES, [$APR_INCLUDES])
+so_ext=$APR_SO_EXT
+lib_target=$APR_LIB_TARGET
+AC_SUBST(so_ext)
+AC_SUBST(lib_target)
 
-AC_CANONICAL_SYSTEM
 LDFLAGS=""
 EXPAT_LINK=""
 case "$host_alias" in
@@ -71,51 +74,13 @@
     ;;
 esac
 
-dnl AC_PROG_LIBTOOL can't be invoked more than once, so this
-dnl logic can't be combined with the previous case statement
-
-case "$host_alias" in
-*os2*)
-    # Use a custom-made libtool replacement
-    echo "using aplibtool"
-    LIBTOOL="$APR_SOURCE_DIR/build/aplibtool"
-    ;;
-*)  dnl libtoolize requires that the following not be indented
-AC_PROG_LIBTOOL
-    if test "x$LTFLAGS" = "x"; then
-        LTFLAGS='--silent'
-    fi
-    ;;
-esac
-
-AC_ARG_ENABLE(libtool, [--with-libtool   use libtool to link the library],
-  [ use_libtool=$withval ], [ use_libtool="yes" ] )
- 
-if test "x$use_libtool" = "xyes"; then
-      lt_compile='$(LIBTOOL) $(LTFLAGS) --mode=compile $(COMPILE) -c $< && touch $@'
-      link='$(LIBTOOL) $(LTFLAGS) --mode=link $(LT_LDFLAGS) $(COMPILE) $(LDFLAGS) -o $@'
-      so_ext='lo'
-      lib_target='-rpath $(libdir) $$objects'
-else
-      lt_compile='$(COMPILE) -c $<'
-      link='$(AR) cr $(TARGET_LIB) $$objects; $(RANLIB) $(TARGET_LIB)'
-      so_ext='o'
-      lib_target=''
-fi
-
-AC_SUBST(lt_compile)
-AC_SUBST(link)
-AC_SUBST(so_ext)
-AC_SUBST(lib_target)
-AC_SUBST(LTFLAGS)
-AC_SUBST(LT_LDFLAGS)
 AC_SUBST(EXPAT_LINK)
 
 dnl
 dnl Prep all the flags and stuff for compilation and export to other builds
 dnl
-CFLAGS="$CFLAGS $INCLUDES $APR_EXPORT_CFLAGS $APR_EXPORT_CPPFLAGS"
-LIBS="$LIBS $APR_EXPORT_LIBS"
+APR_ADDTO(CFLAGS, [$CFLAGS $INCLUDES $APR_EXPORT_CFLAGS $APR_EXPORT_CPPFLAGS])
+APR_ADDTO(LIBS, [$APR_EXPORT_LIBS])
 
 AC_SUBST(APRUTIL_EXPORT_LIBS)
 AC_SUBST(LDFLAGS)
@@ -139,12 +104,12 @@
 
 dnl
 dnl everthing is done. 
-MAKEFILES=" Makefile buckets/Makefile crypto/Makefile dbm/Makefile dbm/sdbm/Makefile encoding/Makefile hooks/Makefile uri/Makefile xml/Makefile misc/Makefile $test_Makefile"
+MAKEFILES="Makefile buckets/Makefile crypto/Makefile dbm/Makefile dbm/sdbm/Makefile encoding/Makefile hooks/Makefile uri/Makefile xml/Makefile misc/Makefile $test_Makefile"
 AC_OUTPUT([
-	export_vars.sh
-	include/private/apu_select_dbm.h
-        include/apu.h
-        $MAKEFILES
+    export_vars.sh
+    include/private/apu_select_dbm.h
+    include/apu.h
+    $MAKEFILES
 	])
 
 dnl #----------------------------- Fixup Makefiles for VPATH support
Index: build/apu-conf.m4
===================================================================
RCS file: /home/cvs/apr-util/build/apu-conf.m4,v
retrieving revision 1.10
diff -u -r1.10 apu-conf.m4
--- build/apu-conf.m4	2001/07/09 02:30:54	1.10
+++ build/apu-conf.m4	2001/08/01 18:24:06
@@ -393,7 +393,7 @@
   expat_include_dir=$top_builddir/$bundled_subdir/lib
   expat_libs=$top_builddir/$bundled_subdir/lib/libexpat.la
   APR_XML_SUBDIRS="`echo $bundled_subdir | sed -e 's%xml/%%'`"
-fi
+else
 if test "$expat_include_dir" = "$srcdir/xml/expat/include" -o "$expat_include_dir" = "$srcdir/xml/expat/lib"; then
   dnl This is a bit of a hack.  This only works because we know that
   dnl we are working with the bundled version of the software.
@@ -403,10 +403,11 @@
   expat_libs=$top_builddir/$bundled_subdir/lib/libexpat.la
   APR_XML_SUBDIRS="`echo $bundled_subdir | sed -e 's%xml/%%'`"
 fi
+fi
 AC_SUBST(APR_XML_SUBDIRS)
 
-INCLUDES="$INCLUDES -I$expat_include_dir"
-LIBS="$LIBS $expat_libs"
-APRUTIL_EXPORT_LIBS="$APRUTIL_EXPORT_LIBS $expat_libs"
+APR_ADDTO(INCLUDES, [-I$expat_include_dir])
+APR_ADDTO(LIBS, [$expat_libs])
+APR_ADDTO(APRUTIL_EXPORT_LIBS, [$expat_libs])
 dnl ### export the Expat includes?
 ])
Index: test/Makefile.in
===================================================================
RCS file: /home/cvs/apr-util/test/Makefile.in,v
retrieving revision 1.11
diff -u -r1.11 Makefile.in
--- test/Makefile.in	2001/06/04 17:10:31	1.11
+++ test/Makefile.in	2001/08/01 18:24:07
@@ -1,3 +1,5 @@
+top_builddir=@top_builddir@
+INCLUDES=-I$(top_builddir)/include -I$(top_builddir)/include/private -I@APR_SOURCE_DIR@/include
 TARGETS =
 PROGRAMS = testdbm testdate testmd4