AC_DEFINE([OPENVPN_VERSION_PATCH], ["PRODUCT_VERSION_PATCH"], [OpenVPN patch level - may be a string or integer])
AC_CONFIG_AUX_DIR([.])
-AC_CONFIG_HEADERS([config.h include/openvpn-plugin.h])
+AC_CONFIG_HEADERS([config.h])
AC_CONFIG_SRCDIR([src/openvpn/syshead.h])
AC_CONFIG_MACRO_DIR([m4])
[with_crypto_library="openssl"]
)
-AC_ARG_WITH(
- [plugindir],
- [AS_HELP_STRING([--with-plugindir], [plugin directory @<:@default=LIBDIR/openvpn@:>@])],
- ,
- [with_plugindir="\$(libdir)/openvpn/plugins"]
-)
-
+AC_ARG_VAR([PLUGINDIR], [Path of plug-in directory @<:@default=LIBDIR/openvpn/plugins@:>@])
+if test -n "${PLUGINDIR}"; then
+ plugindir="${PLUGINDIR}"
+else
+ plugindir="\${libdir}/openvpn/plugins"
+fi
AC_DEFINE_UNQUOTED([TARGET_ALIAS], ["${host}"], [A string representing our host])
case "$host" in
AM_CONDITIONAL([ENABLE_CRYPTO], [test "${enable_crypto}" = "yes"])
AM_CONDITIONAL([HAVE_LD_WRAP_SUPPORT], [test "${have_ld_wrap_support}" = "yes"])
-plugindir="${with_plugindir}"
sampledir="\$(docdir)/sample"
AC_SUBST([plugindir])
AC_SUBST([sampledir])
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 $@
#ifndef _WIN32
p->handle = NULL;
-#if defined(PLUGIN_LIBDIR)
+
if (!absolute_pathname(p->so_pathname))
{
char full[PATH_MAX];
openvpn_snprintf(full, sizeof(full), "%s/%s", PLUGIN_LIBDIR, p->so_pathname);
p->handle = dlopen(full, RTLD_NOW);
-#if defined(ENABLE_PLUGIN_SEARCH)
- if (!p->handle)
- {
- rel = true;
- p->handle = dlopen(p->so_pathname, RTLD_NOW);
- }
-#endif
}
else
-#endif
{
rel = !absolute_pathname(p->so_pathname);
p->handle = dlopen(p->so_pathname, RTLD_NOW);