summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.cvsignore1
-rw-r--r--CHANGES6
-rw-r--r--Makefile.in5
-rw-r--r--apr-config.in86
-rw-r--r--configure.in3
5 files changed, 100 insertions, 1 deletions
diff --git a/.cvsignore b/.cvsignore
index 5cb40de2a..cb36264ec 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -6,6 +6,7 @@ config.status
configure
libtool
APRVARS
+apr-config
LibD
LibR
Debug
diff --git a/CHANGES b/CHANGES
index 2300ce104..25bf42403 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,5 +1,11 @@
Changes with APR b1
+ *) Add apr-config - a shell script to allow third-party programs
+ easy access to APR configuration parameters. [Justin Erenkrantz]
+
+ *) Add find_apr.m4 to allow third-party programs that use APR to
+ have a standard m4 macro for detection. [Greg Stein]
+
*) SEGV in apr_table_overlap [Brian Pane]
*) apr_array_copy speedup by removing the zero-fill [Brian Pane]
diff --git a/Makefile.in b/Makefile.in
index 37c03f8cc..4ec8ef151 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -31,12 +31,13 @@ TARGETS = delete-lib $(TARGET_LIB) delete-exports export_vars.h apr.exp
CLEAN_TARGETS =
DISTCLEAN_TARGETS = config.cache config.log config.status \
include/apr.h include/arch/unix/apr_private.h \
- APRVARS libtool apr.exp
+ APRVARS libtool apr.exp apr-config
EXTRACLEAN_TARGETS = configure aclocal.m4 include/arch/unix/apr_private.h.in \
exports.c export_vars.h
prefix=@prefix@
exec_prefix=@exec_prefix@
+bindir=@bindir@
libdir=@libdir@
includedir=@includedir@
srcdir=@srcdir@
@@ -67,6 +68,8 @@ install: $(TARGET_LIB)
$(LIBTOOL) --mode=install cp $(TARGET_LIB) $(libdir)
$(LIBTOOL) --mode=install cp APRVARS $(libdir)
$(LIBTOOL) --mode=install cp apr.exp $(libdir)
+ $(LIBTOOL) --mode=install cp apr-config $(bindir)
+ chmod 755 $(bindir)/apr-config
@if [ $(INSTALL_SUBDIRS) != "none" ]; then \
for i in $(INSTALL_SUBDIRS); do \
( cd $$i ; $(MAKE) install ); \
diff --git a/apr-config.in b/apr-config.in
new file mode 100644
index 000000000..203fe78df
--- /dev/null
+++ b/apr-config.in
@@ -0,0 +1,86 @@
+#!/bin/sh
+
+PREFIX="@prefix@"
+EXEC_PREFIX="@exec_prefix@"
+LIBDIR="@libdir@"
+INCLUDEDIR="@includedir@"
+CC="@CC@"
+CPP="@CPP@"
+SHELL="@SHELL@"
+CPPFLAGS="@EXTRA_CPPFLAGS@"
+CFLAGS="@EXTRA_CFLAGS@"
+LDFLAGS="@EXTRA_LDFLAGS@"
+LIBS="@EXTRA_LIBS@"
+INCLUDES="@EXTRA_INCLUDES@"
+LIBTOOL_LIBS="@LIBTOOL_LIBS@"
+SHLIBPATH_VAR="@shlibpath_var@"
+APR_SOURCE_DIR="@abs_srcdir@"
+APR_SO_EXT="@so_ext@"
+APR_LIB_TARGET="@export_lib_target@"
+
+show_usage()
+{
+ cat << EOF
+Usage: apr-config [OPTION]
+
+Known values for OPTION are:
+ --prefix=DIR change prefix to DIR
+ --cflags print C compiler flags
+ --cppflags print cpp flags
+ --includes print include information
+ --ldflags print linker flags
+ --libs print library information
+ --help print this help
+EOF
+}
+
+if test $# -eq 0; then
+ show_usage
+ exit 1
+fi
+
+while test $# -gt 0; do
+ # Normalize the prefix.
+ case "$1" in
+ -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
+ *) optarg= ;;
+ esac
+
+ case "$1" in
+ # It is possible for the user to override our prefix.
+ --prefix=*)
+ prefix=$optarg
+ ;;
+ --prefix)
+ echo $PREFIX
+ ;;
+ --cflags)
+ echo $CFLAGS
+ ;;
+ --cppflags)
+ echo $CPPFLAGS
+ ;;
+ --libs)
+ echo $LIBS
+ ;;
+ --ldflags)
+ echo $LDFLAGS
+ ;;
+ --includes)
+ echo $INCLUDES
+ ;;
+ --help)
+ show_usage
+ exit 1
+ ;;
+ *)
+ show_usage
+ exit 1
+ ;;
+ esac
+
+ # Next please.
+ shift
+done
+
+exit 0
diff --git a/configure.in b/configure.in
index 2829b484b..4da89a4ef 100644
--- a/configure.in
+++ b/configure.in
@@ -1427,6 +1427,7 @@ AC_OUTPUT([
include/apr.h
APRVARS
build/rules.mk
+ apr-config
],[
for i in $SAVE_FILES; do
if cmp -s $i $i.save 2>/dev/null; then
@@ -1437,6 +1438,8 @@ for i in $SAVE_FILES; do
done
])
+chmod +x apr-config
+
dnl #----------------------------- Fixup Makefiles for VPATH support
changequote({,})