From: Kevin Cernekee Date: Sat, 16 Mar 2013 16:49:02 +0000 (-0700) Subject: Add --without-libproxy and --without-stoken options to configure X-Git-Tag: v5.00~19 X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=ce9a10cb6c58bfbea43c89b566c3c4c6bb15a67f;p=users%2Fdwmw2%2Fopenconnect.git Add --without-libproxy and --without-stoken options to configure "Automagic dependencies" can cause trouble for source-based distributions like Gentoo [1], so we will provide a way to disable them. As written, this does not honor --with-libproxy or --with-stoken. [1] http://www.gentoo.org/proj/en/qa/automagic.xml Signed-off-by: Kevin Cernekee --- diff --git a/configure.ac b/configure.ac index 8716ccf0..2f0f702c 100644 --- a/configure.ac +++ b/configure.ac @@ -462,11 +462,17 @@ PKG_CHECK_MODULES(ZLIB, zlib, [AC_SUBST(ZLIB_PC, [zlib])], AC_ERROR([Could not build against zlib])]) LIBS="$oldLIBS"]) -PKG_CHECK_MODULES(LIBPROXY, libproxy-1.0, - [AC_SUBST(LIBPROXY_PC, libproxy-1.0) - AC_DEFINE([LIBPROXY_HDR], ["proxy.h"]) - libproxy_pkg=yes], - libproxy_pkg=no) +AC_ARG_WITH([libproxy], + AS_HELP_STRING([--without-libproxy], + [Build without libproxy library [default=auto]])) +AS_IF([test "x$with_libproxy" != "xno"], [ + PKG_CHECK_MODULES(LIBPROXY, libproxy-1.0, + [AC_SUBST(LIBPROXY_PC, libproxy-1.0) + AC_DEFINE([LIBPROXY_HDR], ["proxy.h"]) + libproxy_pkg=yes], + libproxy_pkg=no) +], [libproxy_pkg=disabled]) + dnl Libproxy *can* exist without a .pc file, and its header may be called dnl libproxy.h in that case. if (test "$libproxy_pkg" = "no"); then @@ -487,11 +493,16 @@ if (test "$libproxy_pkg" = "no"); then LIBS="$oldLIBS" fi -PKG_CHECK_MODULES(LIBSTOKEN, stoken, - [AC_SUBST(LIBSTOKEN_PC, stoken) - AC_DEFINE([LIBSTOKEN_HDR], ["stoken.h"]) - libstoken_pkg=yes], - libstoken_pkg=no) +AC_ARG_WITH([stoken], + AS_HELP_STRING([--without-stoken], + [Build without libstoken library [default=auto]])) +AS_IF([test "x$with_stoken" != "xno"], [ + PKG_CHECK_MODULES(LIBSTOKEN, stoken, + [AC_SUBST(LIBSTOKEN_PC, stoken) + AC_DEFINE([LIBSTOKEN_HDR], ["stoken.h"]) + libstoken_pkg=yes], + libstoken_pkg=no) +], [libstoken_pkg=disabled]) AC_CHECK_HEADER([if_tun.h], [AC_DEFINE([IF_TUN_HDR], ["if_tun.h"])],