diff options
author | gstein <gstein@13f79535-47bb-0310-9956-ffa450edef68> | 2002-02-03 13:39:47 +0000 |
---|---|---|
committer | gstein <gstein@13f79535-47bb-0310-9956-ffa450edef68> | 2002-02-03 13:39:47 +0000 |
commit | 938bcb89633f33f4b10305ac6b011b4f91a3f7e8 (patch) | |
tree | 64536fd1f8a047a0fb15324e6f7b29cb7399a77e /apr-config.in | |
parent | 0442fe3e50789bf8f3e70b11df9710d738989b3f (diff) | |
download | libapr-938bcb89633f33f4b10305ac6b011b4f91a3f7e8.tar.gz |
Provide more outputs for the apr-config file. Corrected some handling
of the prefix, and the exit code for the --help switch.
Make the chmod +x for apr-config part of the "config commands" so that
it will occur every time that config.status is run.
git-svn-id: http://svn.apache.org/repos/asf/apr/apr/trunk@62900 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'apr-config.in')
-rw-r--r-- | apr-config.in | 81 |
1 files changed, 71 insertions, 10 deletions
diff --git a/apr-config.in b/apr-config.in index 1fb81ef07..edb5cc57a 100644 --- a/apr-config.in +++ b/apr-config.in @@ -55,10 +55,12 @@ # APR script designed to allow easy command line access to APR configuration # parameters. -PREFIX="@prefix@" -EXEC_PREFIX="@exec_prefix@" -LIBDIR="@libdir@" -INCLUDEDIR="@includedir@" +prefix="@prefix@" +exec_prefix="@exec_prefix@" +bindir="@bindir@" +libdir="@libdir@" +includedir="@includedir@" + CC="@CC@" CPP="@CPP@" SHELL="@SHELL@" @@ -66,8 +68,7 @@ CPPFLAGS="@EXTRA_CPPFLAGS@" CFLAGS="@EXTRA_CFLAGS@" LDFLAGS="@EXTRA_LDFLAGS@" LIBS="@EXTRA_LIBS@" -INCLUDES="@EXTRA_INCLUDES@" -LIBTOOL_LIBS="@LIBTOOL_LIBS@" +EXTRA_INCLUDES="@EXTRA_INCLUDES@" SHLIBPATH_VAR="@shlibpath_var@" APR_SOURCE_DIR="@abs_srcdir@" APR_SO_EXT="@so_ext@" @@ -84,8 +85,20 @@ Known values for OPTION are: --cppflags print cpp flags --includes print include information --ldflags print linker flags - --libs print library information + --libs print additional libraries to link against + --srcdir print APR source directory + --apr-ld print link switch(es) for linking to APR + --apr-libtool print the libtool inputs for linking to APR + --apr-la-file print the path to the .la file, if available --help print this help + +When linking with libtool, an application should do something like: + APR_LIBS="\`apr-config --apr-libtool --libs\`" +or when linking directly: + APR_LIBS="\`apr-config --apr-ld --libs\`" + +An application should use the results of --cflags, --cppflags, --includes, +and --ldflags in their build process. EOF } @@ -94,6 +107,22 @@ if test $# -eq 0; then exit 1 fi +thisdir="`dirname $0`" +thisdir="`cd $thisdir && pwd`" +if test "$BINDIR" = "$thisdir"; then + location=installed +elif test "$APR_SOURCE_DIR" = "$thisdir"; then + location=source +else + location=build +fi + +if test "$location" = "installed"; then + LA_FILE="$libdir/libapr.la" +else + LA_FILE="$thisdir/libapr.la" +fi + while test $# -gt 0; do # Normalize the prefix. case "$1" in @@ -107,7 +136,7 @@ while test $# -gt 0; do prefix=$optarg ;; --prefix) - echo $PREFIX + echo $prefix ;; --cflags) echo $CFLAGS @@ -122,11 +151,43 @@ while test $# -gt 0; do echo $LDFLAGS ;; --includes) - echo $INCLUDES + if test "$location" = "installed"; then + echo "-I$includedir $EXTRA_INCLUDES" + elif test "$location" = "source"; then + echo "-I$APR_SOURCE_DIR/include $EXTRA_INCLUDES" + else + echo "-I$thisdir/include -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES" + fi + ;; + --srcdir) + echo $APR_SOURCE_DIR + ;; + --apr-ld) + if test "$location" = "installed"; then + ### avoid using -L if libdir is a "standard" location like /usr/lib + echo "-L$libdir -lapr" + else + echo "-L$thisdir -lapr" + fi + ;; + --apr-libtool) + if test -f "$LA_FILE"; then + echo $LA_FILE + elif test "$location" = "installed"; then + ### avoid using -L if libdir is a "standard" location like /usr/lib + echo "-L$libdir -lapr" + else + echo "-L$thisdir -lapr" + fi + ;; + --apr-la-file) + if test -f "$LA_FILE"; then + echo $LA_FILE + fi ;; --help) show_usage - exit 1 + exit 0 ;; *) show_usage |