diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 26 |
1 files changed, 20 insertions, 6 deletions
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])]) |