jorton 2004/06/14 08:43:41
Modified: . apu-config.in .cvsignore Makefile.in configure.in
Log:
Remove "location detection" from apu-config:
* configure.in: Substitute APU_CONFIG_LOCATION as "build" or "source"
appropriately.
* apu-config.in: Set location to @APU_CONFIG_LOCATION@ rather than
using fragile pwd/realpath guesswork.
* Makefile.in (apu-config.out): New target.
(install): Install apu-config.out instead of apu-config.
PR: 8867 (episode two)
Revision Changes Path
1.36 +7 -30 apr-util/apu-config.in
Index: apu-config.in
===================================================================
RCS file: /home/cvs/apr-util/apu-config.in,v
retrieving revision 1.35
retrieving revision 1.36
diff -d -w -u -r1.35 -r1.36
--- apu-config.in 26 Feb 2004 21:55:12 -0000 1.35
+++ apu-config.in 14 Jun 2004 15:43:40 -0000 1.36
@@ -37,6 +37,9 @@
APR_XML_EXPAT_OLD="@APR_XML_EXPAT_OLD@"
APU_DB_VERSION="@apu_db_version@"
+# NOTE: the following line is modified during 'make install': alter with
care!
[EMAIL PROTECTED]@
+
show_usage()
{
cat << EOF
@@ -73,32 +76,6 @@
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.
-if test -x "`which realpath 2>/dev/null`"; then
- thisdir="`realpath $thisdir`"
- if test -d "$APU_SOURCE_DIR"; then
- APU_SOURCE_DIR="`realpath $APU_SOURCE_DIR`"
- fi
- if test -n "$tmpbindir"; then
- tmpbindir="`realpath $tmpbindir`"
- fi
-fi
-if test "$tmpbindir" = "$thisdir"; then
- location=installed
-elif test "$APU_SOURCE_DIR" = "$thisdir"; then
- location=source
-else
- location=build
-fi
-
if test "$location" = "installed"; then
LA_FILE="$libdir/lib${APRUTIL_LIBNAME}.la"
@@ -106,7 +83,7 @@
LDFLAGS=`echo "$LDFLAGS" | sed -e "s $APU_BUILD_DIR/xml/expat $prefix g"`
INCLUDES=`echo "$INCLUDES" | sed -e "s $APU_BUILD_DIR/xml/expat $prefix
g" -e "s -I$prefix/lib g"`
else
- LA_FILE="$thisdir/lib${APRUTIL_LIBNAME}.la"
+ LA_FILE="$APU_BUILD_DIR/lib${APRUTIL_LIBNAME}.la"
fi
flags=""
@@ -141,7 +118,7 @@
flags="$APU_SOURCE_DIR/include"
else
# this is for VPATH builds
- flags="$thisdir/include $APU_SOURCE_DIR/include"
+ flags="$APU_BUILD_DIR/include $APU_SOURCE_DIR/include"
fi
echo $flags
exit 0
@@ -153,7 +130,7 @@
flags="$flags -I$APU_SOURCE_DIR/include $INCLUDES"
else
# this is for VPATH builds
- flags="$flags -I$thisdir/include -I$APU_SOURCE_DIR/include $INCLUDES"
+ flags="$flags -I$APU_BUILD_DIR/include -I$APU_SOURCE_DIR/include
$INCLUDES"
fi
;;
--ldflags)
@@ -172,7 +149,7 @@
### avoid using -L if libdir is a "standard" location like /usr/lib
flags="$flags -L$libdir -l$APRUTIL_LIBNAME"
else
- flags="$flags -L$thisdir -l$APRUTIL_LIBNAME"
+ flags="$flags -L$APU_BUILD_DIR -l$APRUTIL_LIBNAME"
fi
;;
--link-libtool)
1.21 +1 -0 apr-util/.cvsignore
Index: .cvsignore
===================================================================
RCS file: /home/cvs/apr-util/.cvsignore,v
retrieving revision 1.20
retrieving revision 1.21
diff -d -w -u -r1.20 -r1.21
--- .cvsignore 29 May 2004 23:23:42 -0000 1.20
+++ .cvsignore 14 Jun 2004 15:43:40 -0000 1.21
@@ -14,6 +14,7 @@
export_vars.h
export_vars.sh
apu-config
+apu-config.out
Debug
Release
LibD
1.88 +6 -3 apr-util/Makefile.in
Index: Makefile.in
===================================================================
RCS file: /home/cvs/apr-util/Makefile.in,v
retrieving revision 1.87
retrieving revision 1.88
diff -d -w -u -r1.87 -r1.88
--- Makefile.in 31 May 2004 20:28:31 -0000 1.87
+++ Makefile.in 14 Jun 2004 15:43:40 -0000 1.88
@@ -27,7 +27,7 @@
CLEAN_SUBDIRS = test
-CLEAN_TARGETS = exports.c export_vars.h aprutil.exp .make.dirs
+CLEAN_TARGETS = exports.c export_vars.h aprutil.exp .make.dirs apu-config.out
DISTCLEAN_TARGETS = config.cache config.log config.status libtool \
include/private/apu_config.h include/private/apu_private.h \
include/private/apu_select_dbm.h include/apr_ldap.h include/apu.h \
@@ -46,8 +46,11 @@
[EMAIL PROTECTED]@
[EMAIL PROTECTED]@
+# Create apu-config script suitable for the install tree
+apu-config.out: apu-config
+ sed 's,^\(location=\).*$$,\1installed,' < apu-config > $@
-install: $(TARGET_LIB)
+install: $(TARGET_LIB) apu-config.out
if [ ! -d $(DESTDIR)$(includedir) ]; then \
@APR_SOURCE_DIR@/build/mkdir.sh $(DESTDIR)$(includedir); \
fi;
@@ -71,7 +74,7 @@
if [ ! -d $(DESTDIR)$(bindir) ]; then \
@APR_SOURCE_DIR@/build/mkdir.sh $(DESTDIR)$(bindir); \
fi;
- $(LIBTOOL) --mode=install cp apu-config $(DESTDIR)$(bindir)
+ $(LIBTOOL) --mode=install cp apu-config.out
$(DESTDIR)$(bindir)/apu-config
chmod 755 $(DESTDIR)$(bindir)/apu-config
$(TARGET_LIB): $(OBJECTS)
1.76 +5 -0 apr-util/configure.in
Index: configure.in
===================================================================
RCS file: /home/cvs/apr-util/configure.in,v
retrieving revision 1.75
retrieving revision 1.76
diff -d -w -u -r1.75 -r1.76
--- configure.in 29 May 2004 23:23:42 -0000 1.75
+++ configure.in 14 Jun 2004 15:43:40 -0000 1.76
@@ -28,7 +28,12 @@
if test "$abs_builddir" != "$abs_srcdir"; then
USE_VPATH=1
+ APU_CONFIG_LOCATION=build
+else
+ APU_CONFIG_LOCATION=source
fi
+
+AC_SUBST(APU_CONFIG_LOCATION)
AC_CANONICAL_SYSTEM