aboutsummaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorPeter Seebach <peter.seebach@windriver.com>2012-04-09 11:56:49 -0500
committerPeter Seebach <peter.seebach@windriver.com>2012-04-09 11:56:49 -0500
commit813755a4993f9fd7d2340d5338220a697a164f45 (patch)
tree1299c30e48f427bd32843de10ea1f71c39ec41e1 /configure
parent0469c56bb9d1f575062060aadaf05aeee5a342b9 (diff)
downloadpseudo-813755a4993f9fd7d2340d5338220a697a164f45.tar.gz
pseudo-813755a4993f9fd7d2340d5338220a697a164f45.tar.bz2
pseudo-813755a4993f9fd7d2340d5338220a697a164f45.zip
Improve RPATH logic
The existing behavior was to set rpath to whatever was specified explicitly with --with-rpath, or to set a default if the opt_rpath variable was unset and we reached a --with-sqlite. This turns out to be incorrect in the case where a static sqlite is being used. You can force the issue with --without-rpath, but it's probably better to make the inference smarter. This also allows the slight cleanup of setting opt_rpath to '' to begin with, because we're no longer depending on the distinction between empty and unset.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure16
1 files changed, 14 insertions, 2 deletions
diff --git a/configure b/configure
index dfd712b..8a0115d 100755
--- a/configure
+++ b/configure
@@ -23,6 +23,7 @@ opt_libdir=
opt_suffix=
opt_bits=
opt_sqlite=/usr
+opt_rpath=
usage()
{
@@ -39,6 +40,9 @@ usage()
sqlite_ldarg=-lsqlite3
+maybe_rpath=
+use_maybe_rpath=true
+
for arg
do
case $arg in
@@ -51,18 +55,21 @@ do
;;
--enable-static-sqlite)
sqlite_ldarg='$(SQLITE)/lib/libsqlite3.a'
+ use_maybe_rpath=false
;;
--with-sqlite=*)
opt_sqlite=${arg#--with-sqlite=}
# assign new value if unset
- : ${opt_rpath=-Wl,-R\$(SQLITE)/lib}
+ maybe_rpath='-Wl,-R$(SQLITE)/lib'
;;
--without-rpath)
opt_rpath=''
+ use_maybe_rpath=false
;;
--with-rpath=*)
rpath=${arg#--with-rpath=}
opt_rpath=${rpath:+-Wl,-R$rpath}
+ use_maybe_rpath=false
;;
--suffix=*)
opt_suffix=${arg#--suffix=}
@@ -82,6 +89,11 @@ do
esac
done
+if $use_maybe_rpath && [ -n "$maybe_rpath" ]; then
+ echo >&2 "Adding default RPATH for sqlite."
+ opt_rpath="${opt_rpath+${opt_rpath} }${maybe_rpath}"
+fi
+
if [ -z "$opt_prefix" ]; then
usage
fi
@@ -107,7 +119,7 @@ read t1 t2 SQLITE3_VERSION << EOF
`grep "#define SQLITE_VERSION_NUMBER " ${opt_sqlite}/include/sqlite3.h`
EOF
-echo "SQLite header for version ${SQLITE3_VERSION} found."
+echo "SQLite header for version ${SQLITE3_VERSION} found in ${opt_sqlite}."
if [ "${SQLITE3_VERSION}" -lt "03006000" ]; then
echo >&2 "Pseudo requires SQLite version 3, 3.6.x or later."