From 7db2d1e796bba7af393e2d5c40db65b95fcee066 Mon Sep 17 00:00:00 2001 From: Michael Rash Date: Wed, 31 Oct 2012 21:37:55 -0400 Subject: [PATCH] [client+server] Added --disable-gpg to the autoconf config Added --disable-gpg to the autoconf ./configure script via configure.ac. This makes it easy to not have fwknop/fwknopd link against libgpgme even if it is installed on the local system. --- ChangeLog | 3 ++ configure.ac | 118 ++++++++++++++++++++++++++++----------------------- todo.org | 10 +++-- 3 files changed, 75 insertions(+), 56 deletions(-) diff --git a/ChangeLog b/ChangeLog index 7166d922..78a231d1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -52,6 +52,9 @@ fwknop-2.0.4 (11//2012): - Updated build CFLAGS and LDFLAGS to conform to the Debian hardening-includes file for PIE support (e.g. '-fPIE' for CFLAGS and '-fPIE -pie' for LDFLAGS). + - [client+server] Added --disable-gpg to the autoconf ./configure script + via configure.ac. This makes it easy to not have fwknop/fwknopd + link against libgpgme even if it is installed on the local system. fwknop-2.0.3 (09/03/2012): - [server] Fernando Arnaboldi from IOActive found several DoS/code diff --git a/configure.ac b/configure.ac index f7d8e070..dd411ad8 100644 --- a/configure.ac +++ b/configure.ac @@ -299,64 +299,78 @@ AS_IF([test "$want_file_cache" = yes], [ AC_DEFINE([USE_FILE_CACHE], [1], [Define this to enable non-gdbm/ndbm digest storing (eliminates gdbm/ndbm dependency).]) ]) -# Check for 3rd-party libs -# -AC_ARG_WITH([gpgme], - [AS_HELP_STRING([--with-gpgme], - [support for gpg encryption using libgpgme @<:@default=check@:>@])], - [], - [with_gpgme=check]) - -have_gpgme=yes -AS_IF([test "x$with_gpgme" != xno], - [AM_PATH_GPGME([], - [AC_DEFINE([HAVE_LIBGPGME], [1], [Define if you have libgpgme])], - [if test "x$with_gpgme" != xcheck; then - AC_MSG_FAILURE( - [--with-gpgme was given, but test for gpgme failed]) - else - have_gpgme=no - fi - ], [have_gpgme=no])], [have_gpgme=no]) - dnl Add various common way to sbin dir to the path (just in case) - APP_PATH=$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/usr/local/sbin +APP_PATH=$PATH$PATH_SEPARATOR/sbin$PATH_SEPARATOR/usr/sbin$PATH_SEPARATOR/usr/local/sbin + +dnl Decide whether or not to enable gpg support +dnl +use_gpg=yes +AC_ARG_ENABLE([gpg], + [AS_HELP_STRING([--disable-gpg], + [Do not enable gpg support via libgpgme @<:@default is on@:>@])], + [use_gpg=$enableval], + []) + +if test "x$use_gpg" = "xyes"; then + + # Check for 3rd-party libs + # + AC_ARG_WITH([gpgme], + [AS_HELP_STRING([--with-gpgme], + [support for gpg encryption using libgpgme @<:@default=check@:>@])], + [], + [with_gpgme=check]) + + have_gpgme=yes + AS_IF([test "x$with_gpgme" != xno], + [AM_PATH_GPGME([], + [AC_DEFINE([HAVE_LIBGPGME], [1], [Define if you have libgpgme])], + [if test "x$with_gpgme" != xcheck; then + AC_MSG_FAILURE( + [--with-gpgme was given, but test for gpgme failed]) + else + have_gpgme=no + fi + ], [have_gpgme=no])], [have_gpgme=no]) dnl Check for gpg (not gpg2) dnl -AC_ARG_WITH([gpg], - [AS_HELP_STRING([--with-gpg=/path/to/gpg], - [Specify path to the gpg executable that gpgme will use @<:@default=check path@:>@])], - [ - AS_IF([ test "x$withval" = x -o "x$withval" = xyes -o "x$withval" = xno ], - [AC_MSG_ERROR([--with-gpg requires an argument specifying a path to gpg])], - [ GPG_EXE=$withval ] - ) - ], - [ - AC_PATH_PROG(GPG_EXE, [gpg], [], [$APP_PATH]) - ] -) -AS_IF([test "x$GPG_EXE" != x], - [ - AC_DEFINE_UNQUOTED([GPG_EXE], ["$GPG_EXE"], [Path to gpg executable]) - gpg_exe=$GPG_EXE - ], [ gpg_exe="(not found)"] -) + AC_ARG_WITH([gpg], + [AS_HELP_STRING([--with-gpg=/path/to/gpg], + [Specify path to the gpg executable that gpgme will use @<:@default=check path@:>@])], + [ + AS_IF([ test "x$withval" = x -o "x$withval" = xyes -o "x$withval" = xno ], + [AC_MSG_ERROR([--with-gpg requires an argument specifying a path to gpg])], + [ GPG_EXE=$withval ] + ) + ], + [ + AC_PATH_PROG(GPG_EXE, [gpg], [], [$APP_PATH]) + ] + ) + AS_IF([test "x$GPG_EXE" != x], + [ + AC_DEFINE_UNQUOTED([GPG_EXE], ["$GPG_EXE"], [Path to gpg executable]) + gpg_exe=$GPG_EXE + ], [ gpg_exe="(not found)"] + ) -if [test "$have_gpgme" = "yes" ]; then -case "$host" in -*-*-linux*) - ;; -*-*-freebsd*) - if [ test "x$CPPFLAGS" = "x" ] ; then - CPPFLAGS="-I/usr/local/include -I/usr/local/include/gpgme" + if [test "$have_gpgme" = "yes" ]; then + case "$host" in + *-*-linux*) + ;; + *-*-freebsd*) + if [ test "x$CPPFLAGS" = "x" ] ; then + CPPFLAGS="-I/usr/local/include -I/usr/local/include/gpgme" + fi + if [ test "x$LDFLAGS" = "x" ] ; then + LDFLAGS="-L/usr/local/lib" + fi + ;; + esac fi - if [ test "x$LDFLAGS" = "x" ] ; then - LDFLAGS="-L/usr/local/lib" - fi - ;; -esac + else + have_gpgme=no fi dnl Check for libpcap, gdbm (or ndbm) if we are building the server component diff --git a/todo.org b/todo.org index 9239ccaa..727c7f6c 100644 --- a/todo.org +++ b/todo.org @@ -2,6 +2,12 @@ This is the main todo org mode file for the fwknop project ** COMPLETED This bucket is for completed tasks. +*** Add --disable-gpg arg to the autoconf configure script + :CLOSED: <2012-10-31 Wed> + There needs to be a way to easily disable libgpgme usage even if it is + installed - this could be done with a new --disable-gpg argument to the + configure script. + - Added --disable-gpg to the autoconf configure script (via configure.ac) *** [client] Add --icmp-type and --icmp-code args :CLOSED: <2012-10-11 Thu> For SPA packets sent over ICMP via raw socket, allow the user to specify @@ -112,10 +118,6 @@ ** [client] Update to not send SPA packet if Ctrl-C is used The client currently sends an SPA packet when an encryption key is requested but the user tries to exit out with Ctrl-C. -** Add --disable-gpg arg to the autoconf configure script - There needs to be a way to easily disable libgpgme usage even if it is - installed - this could be done with a new --disablegpg argument to the - configure script. ** [test suite] client/server only tests When only the client or server is being installed on a system, the test suite should be able to run only the relevant tests.