summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2004-09-01 09:53:50 +0000
committerjorton <jorton@13f79535-47bb-0310-9956-ffa450edef68>2004-09-01 09:53:50 +0000
commit9753ae81ff3ee349f7b08942b9a3602143cf2c7a (patch)
treeffb596f8c9efb3e9cd12cbb6a6185f61ffcb1a78
parent32b8ed22acba06ab4f0bf62ebe07d14967fe626c (diff)
downloadlibapr-9753ae81ff3ee349f7b08942b9a3602143cf2c7a.tar.gz
Backport from HEAD:
Remove "location detection" from apr-config: * configure.in: Substitute APR_CONFIG_LOCATION as "build" or "source" appropriately. * apr-config.in: Set location to @APR_CONFIG_LOCATION@ rather than fragile pwd/realpath guesswork; pick up and use APR_BUILD_DIR instead of $thisdir. * Makefile.in (apr-config.out): New target. (install): Install apr-config.out instead of apr-config. PR: 8867 git-svn-id: http://svn.apache.org/repos/asf/apr/apr/branches/APR_0_9_BRANCH@65319 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--.cvsignore1
-rw-r--r--CHANGES7
-rw-r--r--Makefile.in10
-rw-r--r--apr-config.in49
-rw-r--r--configure.in5
5 files changed, 29 insertions, 43 deletions
diff --git a/.cvsignore b/.cvsignore
index f197143ef..d078665b1 100644
--- a/.cvsignore
+++ b/.cvsignore
@@ -29,5 +29,6 @@ BuildLog.htm
*.stt
*.sto
*.vcproj
+apr-config.out
autom4te.cache
ltcf-c.sh
diff --git a/CHANGES b/CHANGES
index 3ae18004e..a4b4bb91d 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,7 +1,10 @@
Changes with APR 0.9.5
- *) If available, use 'readlink -f' to resolve symlinks in apr-config.
- [Justin Erenkrantz]
+ *) Fix build issues in paths containing symlinks. PR 8867.
+ [Joe Orton]
+
+ *) Update config.{guess,sub} for DragonFly BSD. PR 29858.
+ [Joe Orton]
*) Win32: Fix bug in apr_socket_sendfile that interferred with
Win32 LSPs. Bug is described in Apache 2.0 bugzilla report
diff --git a/Makefile.in b/Makefile.in
index a0681786a..bca963442 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -31,7 +31,7 @@ TARGETS = delete-lib $(TARGET_LIB) delete-exports export_vars.c apr.exp
# bring in rules.mk for standard functionality
@INCLUDE_RULES@
-CLEAN_TARGETS = apr.exp exports.c export_vars.c
+CLEAN_TARGETS = apr.exp exports.c export_vars.c apr-config.out
DISTCLEAN_TARGETS = config.cache config.log config.status \
include/apr.h include/arch/unix/apr_private.h \
libtool apr-config
@@ -60,7 +60,11 @@ delete-lib:
fi \
fi
-install: $(TARGET_LIB)
+# Create apr-config script suitable for the install tree
+apr-config.out: apr-config
+ sed 's,^\(location=\).*$$,\1installed,' < apr-config > $@
+
+install: $(TARGET_LIB) apr-config.out
if [ ! -d $(DESTDIR)$(includedir) ]; then \
$(top_srcdir)/build/mkdir.sh $(DESTDIR)$(includedir); \
fi;
@@ -90,7 +94,7 @@ install: $(TARGET_LIB)
if [ ! -d $(DESTDIR)$(bindir) ]; then \
$(top_srcdir)/build/mkdir.sh $(DESTDIR)$(bindir); \
fi;
- $(LIBTOOL) --mode=install cp apr-config $(DESTDIR)$(bindir)
+ $(LIBTOOL) --mode=install cp apr-config.out $(DESTDIR)$(bindir)/apr-config
chmod 755 $(DESTDIR)$(bindir)/apr-config
@if [ $(INSTALL_SUBDIRS) != "none" ]; then \
for i in $(INSTALL_SUBDIRS); do \
diff --git a/apr-config.in b/apr-config.in
index 0588d88c9..f16d930f9 100644
--- a/apr-config.in
+++ b/apr-config.in
@@ -76,10 +76,14 @@ LIBS="@EXTRA_LIBS@"
EXTRA_INCLUDES="@EXTRA_INCLUDES@"
SHLIBPATH_VAR="@shlibpath_var@"
APR_SOURCE_DIR="@apr_srcdir@"
+APR_BUILD_DIR="@apr_builddir@"
APR_SO_EXT="@so_ext@"
APR_LIB_TARGET="@export_lib_target@"
APR_LIBNAME="@APR_LIBNAME@"
+# NOTE: the following line is modified during 'make install': alter with care!
+location=@APR_CONFIG_LOCATION@
+
show_usage()
{
cat << EOF
@@ -123,42 +127,10 @@ if test $# -eq 0; then
exit 1
fi
-thisdir="`dirname $0`"
-thisdir="`cd $thisdir && pwd`"
-if test -d $bindir; then
- tmpbindir="`cd $bindir && pwd`"
-else
- tmpbindir=""
-fi
-# If we have the realpath program, use it to resolve symlinks
-# Otherwise, being in a symlinked dir may result in incorrect output.
-REALPATH=
-if test -x "`which realpath 2>/dev/null`"; then
- REALPATH=realpath
-elif test -x "`which readlink 2>/dev/null`"; then
- REALPATH="readlink -f"
-fi
-if test -n "$REALPATH"; then
- thisdir="`$REALPATH $thisdir`"
- if test -d "$APR_SOURCE_DIR"; then
- APR_SOURCE_DIR="`$REALPATH $APR_SOURCE_DIR`"
- fi
- if test -n "$tmpbindir"; then
- tmpbindir="`$REALPATH $tmpbindir`"
- fi
-fi
-if test "$tmpbindir" = "$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/lib${APR_LIBNAME}.la"
else
- LA_FILE="$thisdir/lib${APR_LIBNAME}.la"
+ LA_FILE="$APR_BUILD_DIR/lib${APR_LIBNAME}.la"
fi
flags=""
@@ -190,7 +162,7 @@ while test $# -gt 0; do
flags="$APR_SOURCE_DIR/include"
else
# this is for VPATH builds
- flags="$thisdir/include $APR_SOURCE_DIR/include"
+ flags="$APR_BUILD_DIR/include $APR_SOURCE_DIR/include"
fi
echo $flags
exit 0
@@ -222,7 +194,7 @@ while test $# -gt 0; do
flags="$flags -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
else
# this is for VPATH builds
- flags="$flags -I$thisdir/include -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
+ flags="$flags -I$APR_BUILD_DIR/include -I$APR_SOURCE_DIR/include $EXTRA_INCLUDES"
fi
;;
--srcdir)
@@ -236,7 +208,7 @@ while test $# -gt 0; do
echo "$APR_SOURCE_DIR/build"
else
# this is for VPATH builds
- echo "$thisdir/build"
+ echo "$APR_BUILD_DIR/build"
fi
exit 0
;;
@@ -249,7 +221,8 @@ while test $# -gt 0; do
### avoid using -L if libdir is a "standard" location like /usr/lib
flags="$flags -L$libdir -l${APR_LIBNAME}"
else
- flags="$flags -L$thisdir -l${APR_LIBNAME}"
+ ### this surely can't work since the library is in .libs?
+ flags="$flags -L$APR_BUILD_DIR -l${APR_LIBNAME}"
fi
;;
--link-libtool)
@@ -287,7 +260,7 @@ while test $# -gt 0; do
if test "$location" = "installed"; then
echo "${installbuilddir}/libtool"
else
- echo "$thisdir/libtool"
+ echo "$APR_BUILD_DIR/libtool"
fi
exit 0
;;
diff --git a/configure.in b/configure.in
index 0436f99bf..2c3645135 100644
--- a/configure.in
+++ b/configure.in
@@ -46,8 +46,13 @@ AC_SUBST(apr_builddir)
if test "$apr_builddir" != "$apr_srcdir"; then
USE_VPATH=1
+ APR_CONFIG_LOCATION=build
+else
+ APR_CONFIG_LOCATION=source
fi
+AC_SUBST(APR_CONFIG_LOCATION)
+
# Libtool might need this symbol -- it must point to the location of
# the generated libtool script (not necessarily the "top" build dir).
#