From cbb09718cdf7b15d33ff2f08526fef208de27e28 Mon Sep 17 00:00:00 2001 From: Greg Stein Date: Wed, 6 Feb 2002 11:41:57 +0000 Subject: Big revamp of the find_apr.m4 script for locating an installed/bundled copy of APR. Some associated changes in apr-config to better support the concept, and to fix some issues with apps using it for flags. * find_apr.m4: dramatic simplification. if we can find apr-config, then we can get all the possible information we might need: libraries, includes, linker flags, etc. So, most of the code was cut and we now just look for apr-config. The parameters to APR_FIND_APR have been clarified and cleand up to better support VPATH builds. * apr-config.in: glom all flags together to prevent newlines from getting in there. git-svn-id: https://svn.apache.org/repos/asf/apr/apr/trunk@62918 13f79535-47bb-0310-9956-ffa450edef68 --- apr-config.in | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'apr-config.in') diff --git a/apr-config.in b/apr-config.in index 065851058..e3c31c050 100644 --- a/apr-config.in +++ b/apr-config.in @@ -123,6 +123,8 @@ else LA_FILE="$thisdir/libapr.la" fi +flags="" + while test $# -gt 0; do # Normalize the prefix. case "$1" in @@ -137,52 +139,54 @@ while test $# -gt 0; do ;; --prefix) echo $prefix + exit 0 ;; --cflags) - echo $CFLAGS + flags="$flags $CFLAGS" ;; --cppflags) - echo $CPPFLAGS + flags="$flags $CPPFLAGS" ;; --libs) - echo $LIBS + flags="$flags $LIBS" ;; --ldflags) - echo $LDFLAGS + flags="$flags $LDFLAGS" ;; --includes) if test "$location" = "installed"; then - echo "-I$includedir $EXTRA_INCLUDES" + flags="$flags -I$includedir $EXTRA_INCLUDES" elif test "$location" = "source"; then - echo "-I$APR_SOURCE_DIR/include $EXTRA_INCLUDES" + flags="$flags -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES" else - echo "-I$thisdir/include -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES" + flags="$flags -I$thisdir/include -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES" fi ;; --srcdir) echo $APR_SOURCE_DIR + exit 0 ;; --link-ld) if test "$location" = "installed"; then ### avoid using -L if libdir is a "standard" location like /usr/lib - echo "-L$libdir -lapr" + flags="$flags -L$libdir -lapr" else - echo "-L$thisdir -lapr" + flags="$flags -L$thisdir -lapr" fi ;; --link-libtool) if test -f "$LA_FILE"; then - echo $LA_FILE + flags="$flags $LA_FILE" elif test "$location" = "installed"; then ### avoid using -L if libdir is a "standard" location like /usr/lib - echo "-L$libdir -lapr" + flags="$flags -L$libdir -lapr" else - echo "-L$thisdir -lapr" + flags="$flags-L$thisdir -lapr" fi ;; --apr-la-file) if test -f "$LA_FILE"; then - echo $LA_FILE + flags="$flags $LA_FILE" fi ;; --help) @@ -199,4 +203,8 @@ while test $# -gt 0; do shift done +if test -n "$flags"; then + echo "$flags" +fi + exit 0 -- cgit v1.2.1