aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorChristian Hesse2017-01-25 21:19:47 +0100
committerDavid Sommerseth2017-01-25 22:10:43 +0100
commit4590c3831d0400096fab08aa1ed7f909da870ced (patch)
tree5bf236ea2eae5532fd5f297b928f72846fc3929c /include
parent76096c605fcac4815674b6ae76ac1f31f03a8186 (diff)
downloadopenvpn-4590c3831d0400096fab08aa1ed7f909da870ced.zip
openvpn-4590c3831d0400096fab08aa1ed7f909da870ced.tar.gz
Clean up plugin path handling
Drop --with-plugindir, instead use an environment variable PLUGINDIR to specify the plugin directory. This puts a define into include/openvpn-plugin.h.in which has the plugin directory. The configure script does not know about the final plugin path. Thus we have to make Make generate the final header file for us. As the path is always available remove the compile time condition (and dead code) from src/openvpn/plugin.c. v2: The configure script can not evaluate the final $libdir path. So use make to create a header file on the containing the final path. v3: Fix whitespace errors and gitignore location. v4: No extra header file, generate src/openvpn/plugin.h on the fly. Remove condition and dead code. v5: Move the define to include/openvpn-plugin.h.in and let make generate the final header file. Signed-off-by: Christian Hesse <mail@eworm.de> Acked-by: David Sommerseth <davids@openvpn.net> Message-Id: <20170125201947.17197-1-list@eworm.de> URL: http://www.mail-archive.com/search?l=mid&q=20170125201947.17197-1-list@eworm.de Signed-off-by: David Sommerseth <davids@openvpn.net>
Diffstat (limited to 'include')
-rw-r--r--include/Makefile.am7
-rw-r--r--include/openvpn-plugin.h.in2
2 files changed, 9 insertions, 0 deletions
diff --git a/include/Makefile.am b/include/Makefile.am
index a52c427..37962a6 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -16,3 +16,10 @@ MAINTAINERCLEANFILES = \
include_HEADERS = \
openvpn-plugin.h \
openvpn-msg.h
+
+openvpn-plugin.h: openvpn-plugin.h.in Makefile
+ $(AM_V_GEN)sed -e 's|\@PLUGINDIR\@|$(plugindir)|' \
+ -e 's|\@OPENVPN_VERSION_MAJOR\@|$(OPENVPN_VERSION_MAJOR)|' \
+ -e 's|\@OPENVPN_VERSION_MINOR\@|$(OPENVPN_VERSION_MINOR)|' \
+ -e 's|\@OPENVPN_VERSION_PATCH\@|$(OPENVPN_VERSION_PATCH)|' \
+ $< > $@.tmp && mv $@.tmp $@
diff --git a/include/openvpn-plugin.h.in b/include/openvpn-plugin.h.in
index 0b30352..a084fc1 100644
--- a/include/openvpn-plugin.h.in
+++ b/include/openvpn-plugin.h.in
@@ -27,6 +27,8 @@
#define OPENVPN_PLUGIN_VERSION 3
+#define PLUGIN_LIBDIR "@PLUGINDIR@"
+
#ifdef ENABLE_CRYPTO
#ifdef ENABLE_CRYPTO_MBEDTLS
#include <mbedtls/x509_crt.h>