Return-Path: Delivered-To: apmail-apr-cvs-archive@apr.apache.org Received: (qmail 50350 invoked by uid 500); 5 Apr 2003 21:42:22 -0000 Mailing-List: contact cvs-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Reply-To: dev@apr.apache.org Delivered-To: mailing list cvs@apr.apache.org Received: (qmail 50333 invoked from network); 5 Apr 2003 21:42:21 -0000 Date: 5 Apr 2003 21:42:20 -0000 Message-ID: <20030405214220.86564.qmail@icarus.apache.org> From: jerenkrantz@apache.org To: apr-cvs@apache.org Subject: cvs commit: apr/build apr_common.m4 X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N jerenkrantz 2003/04/05 13:42:20 Modified: . CHANGES build apr_common.m4 Log: Add parameter to APR_SUBDIR_CONFIG to drop options passed to configure before the subdir's configure is invoked. Also, add documentation notes on what this macro does and autoconf version caveats that need to be watched out for! Inspired by: Jeff's patch to httpd-2.0 (which was inspired by me on dev@httpd) Revision Changes Path 1.397 +4 -0 apr/CHANGES Index: CHANGES =================================================================== RCS file: /home/cvs/apr/CHANGES,v retrieving revision 1.396 retrieving revision 1.397 diff -u -u -r1.396 -r1.397 --- CHANGES 4 Apr 2003 11:47:39 -0000 1.396 +++ CHANGES 5 Apr 2003 21:42:20 -0000 1.397 @@ -1,5 +1,9 @@ Changes with APR 0.9.4 + *) Add parameter to APR_SUBDIR_CONFIG to drop options passed to configure + before the subdir's configure is invoked. + [Jeff Trawick, Justin Erenkrantz] + *) Implement APR_SO_RCVBUF socket option on Unix. [Adam Sussman ] 1.55 +33 -2 apr/build/apr_common.m4 Index: apr_common.m4 =================================================================== RCS file: /home/cvs/apr/build/apr_common.m4,v retrieving revision 1.54 retrieving revision 1.55 diff -u -u -r1.54 -r1.55 --- apr_common.m4 7 Mar 2003 12:41:26 -0000 1.54 +++ apr_common.m4 5 Apr 2003 21:42:20 -0000 1.55 @@ -74,7 +74,24 @@ ]) dnl -dnl APR_SUBDIR_CONFIG(dir [, sub-package-cmdline-args]) +dnl APR_SUBDIR_CONFIG(dir [, sub-package-cmdline-args, args-to-drop]) +dnl +dnl dir: directory to find configure in +dnl sub-package-cmdline-args: arguments to add to the invocation (optional) +dnl args-to-drop: arguments to drop from the invocation (optional) +dnl +dnl Note: This macro relies on ac_configure_args being set properly. +dnl +dnl The args-to-drop argument is shoved into a case statement, so +dnl multiple arguments can be separated with a |. +dnl +dnl Note: Older versions of autoconf do not single-quote args, while 2.54+ +dnl places quotes around every argument. So, if you want to drop the +dnl argument called --enable-layout, you must pass the third argument as: +dnl [--enable-layout=*|\'--enable-layout=*] +dnl +dnl Trying to optimize this is left as an exercise to the reader who wants +dnl to put up with more autoconf craziness. I give up. dnl AC_DEFUN(APR_SUBDIR_CONFIG, [ # save our work to this point; this allows the sub-package to use it @@ -102,13 +119,27 @@ ac_sub_cache_file="$ac_popdir/$cache_file" ;; esac + ifelse($3, [], [apr_configure_args=$ac_configure_args],[ + apr_configure_args= + apr_sep= + for apr_configure_arg in $ac_configure_args + do + case "$apr_configure_arg" in + $3) + continue ;; + esac + apr_configure_args="$apr_configure_args$apr_sep'$apr_configure_arg'" + apr_sep=" " + done + ]) + dnl The eval makes quoting arguments work - specifically $2 where the dnl quoting mechanisms used is "" rather than []. dnl dnl We need to execute another shell because some autoconf/shell combinations dnl will choke after doing repeated APR_SUBDIR_CONFIG()s. (Namely Solaris dnl and autoconf-2.54+) - if eval $SHELL $ac_abs_srcdir/configure $ac_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir $2 + if eval $SHELL $ac_abs_srcdir/configure $apr_configure_args --cache-file=$ac_sub_cache_file --srcdir=$ac_abs_srcdir $2 then : echo "$1 configured properly" else