[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.
This commit is contained in:
Michael Rash 2012-10-31 21:37:55 -04:00
parent 8ee9999cbd
commit 7db2d1e796
3 changed files with 75 additions and 56 deletions

View File

@ -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

View File

@ -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

View File

@ -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.