[PATCH 2/3 v4] Add build suppport for VPNC.

Mohamed Abbas mabbas at linux.intel.com
Tue Jan 18 12:50:24 PST 2011


Initial
---
 Makefile.plugins |   28 ++++++++++++++++++++++++----
 configure.ac     |   17 +++++++++++++++++
 2 files changed, 41 insertions(+), 4 deletions(-)

diff --git a/Makefile.plugins b/Makefile.plugins
index 025e972..47abc0a 100644
--- a/Makefile.plugins
+++ b/Makefile.plugins
@@ -100,6 +100,7 @@ if OPENCONNECT
 if OPENCONNECT_BUILTIN
 builtin_modules += openconnect
 builtin_sources += plugins/openconnect.c
+builtin_vpn_sources = plugins/vpn.c plugins/vpn.h
 builtin_cflags += -DOPENCONNECT=\"@OPENCONNECT@\"
 else
 plugin_LTLIBRARIES += plugins/openconnect.la
@@ -117,6 +118,7 @@ if OPENVPN
 if OPENVPN_BUILTIN
 builtin_modules += openvpn
 builtin_sources += plugins/openvpn.c
+builtin_vpn_sources = plugins/vpn.c plugins/vpn.h
 builtin_cflags += -DOPENVPN=\"@OPENVPN@\"
 else
 plugin_LTLIBRARIES += plugins/openvpn.la
@@ -130,14 +132,26 @@ plugins_openvpn_la_LDFLAGS = $(plugin_ldflags)
 endif
 endif
 
-if OPENCONNECT_BUILTIN
-builtin_sources += plugins/vpn.c plugins/vpn.h
+if VPNC
+if VPNC_BUILTIN
+builtin_modules += vpnc
+builtin_sources += plugins/vpnc.c
+builtin_vpn_sources = plugins/vpn.c plugins/vpn.h
+builtin_cflags += -DVPNC=\"@VPNC@\"
 else
-if OPENVPN_BUILTIN
-builtin_sources += plugins/vpn.c plugins/vpn.h
+plugin_LTLIBRARIES += plugins/vpnc.la
+plugin_objects += $(plugins_vpnc_la_OBJECTS)
+plugins_vpnc_la_SOURCES = plugins/vpn.h plugins/vpn.c \
+						plugins/vpnc.c
+plugins_vpnc_la_CFLAGS = $(plugin_cflags) -DVPNC=\"@VPNC@\" \
+					-DSTATEDIR=\""$(statedir)"\" \
+					-DSCRIPTDIR=\""$(build_scriptdir)"\"
+plugins_vpnc_la_LDFLAGS = $(plugin_ldflags)
 endif
 endif
 
+builtin_sources += $(builtin_vpn_sources)
+
 if PORTAL
 if PORTAL_BUILTIN
 builtin_modules += portal
@@ -243,6 +257,12 @@ if OPENCONNECT
 script_PROGRAMS += scripts/openconnect-script
 
 scripts_openconnect_script_LDADD = @DBUS_LIBS@
+else
+if VPNC
+script_PROGRAMS += scripts/openconnect-script
+
+scripts_openconnect_script_LDADD = @DBUS_LIBS@
+endif
 endif
 
 if OPENVPN
diff --git a/configure.ac b/configure.ac
index a0a1dca..4931d6a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -135,6 +135,23 @@ fi
 AM_CONDITIONAL(OPENVPN, test "${enable_openvpn}" != "no")
 AM_CONDITIONAL(OPENVPN_BUILTIN, test "${enable_openvpn}" = "builtin")
 
+AC_ARG_WITH(vpnc, AC_HELP_STRING([--with-vpnc=PROGRAM],
+	[specify location of vpnc binary]), [path_vpnc=${withval}])
+
+AC_ARG_ENABLE(vpnc,
+	AC_HELP_STRING([--enable-vpnc], [enable vpnc support]),
+		[enable_vpnc=${enableval}], [enable_vpnc="no"])
+if (test "${enable_vpnc}" != "no"); then
+	if (test -z "${path_vpnc}"); then
+		AC_PATH_PROG(VPNC, [vpnc], [], $PATH:/sbin:/usr/sbin)
+	else
+		VPNC="${path_vpnc}"
+		AC_SUBST(VPNC)
+	fi
+fi
+AM_CONDITIONAL(VPNC, test "${enable_vpnc}" != "no")
+AM_CONDITIONAL(VPNC_BUILTIN, test "${enable_vpnc}" = "builtin")
+
 AC_ARG_ENABLE(loopback,
 	AC_HELP_STRING([--enable-loopback], [enable loopback support]),
 			[enable_loopback=${enableval}], [enable_loopback="no"])
-- 
1.7.3.4




More information about the connman mailing list