summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ChangeLog10
-rwxr-xr-xconfigure41
-rw-r--r--configure.ac26
-rw-r--r--systemtap.spec.in6
4 files changed, 65 insertions, 18 deletions
diff --git a/ChangeLog b/ChangeLog
index 956255ad..1d264ce5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,13 @@
+2008-01-24 David Smith <dsmith@redhat.com>
+
+ PR 5650 (partial).
+ * configure.ac: Handles sqlite optional functionality correctly.
+ If enabled/disabled by the user, do the right thing. If not
+ specified by the user, use it if present.
+ * configure: Regenerated.
+ * systemtap.spec.in: Always specify to configure whether to use
+ sqlite or not.
+
2008-01-24 Dave Brolley <brolley@redhat.com>
PR 5017.
diff --git a/configure b/configure
index e007903b..84d62a8d 100755
--- a/configure
+++ b/configure
@@ -1374,6 +1374,7 @@ Optional Features:
--enable-perfmon enable perfmon support (default is disabled)
--enable-prologues make -P prologue-searching default
--enable-ssp enable gcc stack-protector
+ --enable-sqlite build with sqlite support
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
@@ -6022,10 +6023,28 @@ fi
fi
+# Check whether --enable-ssp was given.
+if test "${enable_ssp+set}" = set; then
+ enableval=$enable_ssp;
+fi
+
+if test "x$enable_ssp" == xyes; then
+ CFLAGS="$CFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2"
+ CXXFLAGS="$CXXFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2"
+ { echo "$as_me:$LINENO: Compiling with gcc -fstack-protector-all et al." >&5
+echo "$as_me: Compiling with gcc -fstack-protector-all et al." >&6;}
+fi
-SAVE_LIBS="$LIBS"
-{ echo "$as_me:$LINENO: checking for sqlite3_open in -lsqlite3" >&5
+# Check whether --enable-sqlite was given.
+if test "${enable_sqlite+set}" = set; then
+ enableval=$enable_sqlite;
+else
+ enable_sqlite=check
+fi
+ sqlite3_LIBS=
+if test "x$enable_sqlite" != xno; then
+ { echo "$as_me:$LINENO: checking for sqlite3_open in -lsqlite3" >&5
echo $ECHO_N "checking for sqlite3_open in -lsqlite3... $ECHO_C" >&6; }
if test "${ac_cv_lib_sqlite3_sqlite3_open+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
@@ -6087,17 +6106,19 @@ fi
{ echo "$as_me:$LINENO: result: $ac_cv_lib_sqlite3_sqlite3_open" >&5
echo "${ECHO_T}$ac_cv_lib_sqlite3_sqlite3_open" >&6; }
if test $ac_cv_lib_sqlite3_sqlite3_open = yes; then
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBSQLITE3 1
-_ACEOF
-
- LIBS="-lsqlite3 $LIBS"
+ sqlite3_LIBS=-lsqlite3
+else
+ if test "x$enable_sqlite" != xcheck; then
+ { { echo "$as_me:$LINENO: error: --enable-sqlite was given, but test for sqlite failed
+See \`config.log' for more details." >&5
+echo "$as_me: error: --enable-sqlite was given, but test for sqlite failed
+See \`config.log' for more details." >&2;}
+ { (exit 1); exit 1; }; }
+ fi
fi
-sqlite3_LIBS="$LIBS"
-
-LIBS="$SAVE_LIBS"
+fi
# Check whether --enable-ssp was given.
diff --git a/configure.ac b/configure.ac
index c8b43fe0..79812c7b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,13 +78,27 @@ if test "$enable_prologues" = yes; then
AC_DEFINE([ENABLE_PROLOGUES],[],[make -P prologue-searching default])
fi])
+AC_ARG_ENABLE([ssp],
+ [AC_HELP_STRING([--enable-ssp], [enable gcc stack-protector])])
+AS_IF([test "x$enable_ssp" == xyes],
+ [CFLAGS="$CFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2"
+ CXXFLAGS="$CXXFLAGS -fstack-protector-all -D_FORTIFY_SOURCE=2"
+ AC_MSG_NOTICE([Compiling with gcc -fstack-protector-all et al.])])
-SAVE_LIBS="$LIBS"
-AC_CHECK_LIB(sqlite3, sqlite3_open)
-sqlite3_LIBS="$LIBS"
-AC_SUBST(sqlite3_LIBS)
-LIBS="$SAVE_LIBS"
-
+dnl Handle optional sqlite support. If enabled/disabled by the user,
+dnl do the right thing. If not specified by the user, use it if
+dnl present.
+AC_ARG_ENABLE([sqlite],
+ AS_HELP_STRING([--enable-sqlite], [build with sqlite support]),
+ [], dnl ACTION-IF-GIVEN
+ [enable_sqlite=check]) dnl ACTION-IF-NOT-GIVEN
+sqlite3_LIBS=
+AS_IF([test "x$enable_sqlite" != xno],
+ [AC_CHECK_LIB([sqlite3], [sqlite3_open],
+ [AC_SUBST([sqlite3_LIBS], [-lsqlite3])],
+ [if test "x$enable_sqlite" != xcheck; then
+ AC_MSG_FAILURE([--enable-sqlite was given, but test for sqlite failed])
+ fi])])
AC_ARG_ENABLE([ssp],
[AC_HELP_STRING([--enable-ssp], [enable gcc stack-protector])])
diff --git a/systemtap.spec.in b/systemtap.spec.in
index b8ab8652..7c2df0c4 100644
--- a/systemtap.spec.in
+++ b/systemtap.spec.in
@@ -127,9 +127,11 @@ cd ..
%define elfutils_mflags LD_LIBRARY_PATH=`pwd`/lib-elfutils
%endif
+# Enable/disable the sqlite coverage testing support
%if %{sqlite}
-# Include the coverage testing support
-%define sqlite_config --enable-sqlitedb
+%define sqlite_config --enable-sqlite
+%else
+%define sqlite_config --disable-sqlite
%endif
%configure %{?elfutils_config} %{?sqlite_config}