David Sommerseth <open...@sf.lists.topphemmelig.net> on Tue, 2016/11/29 00:47: > On 28/11/16 17:16, Christian Hesse wrote: > > From: Christian Hesse <m...@eworm.de> > > > > For plugin lookup (give relative path to plugin directory in > > configuration) we had to configure with something like this: > > > > CFLAGS="$CFLAGS > > -DPLUGIN_LIBDIR=\\\"/usr/lib/openvpn/plugins\\\"" ./configure > > > > This allows to pass --enable-plugin-lookup to configure to achieve the > > same. As a bonus we can be sure that install path and lookup path in > > openvpn binary are the same. > > > Thank you for your patch. Unfortunately I'm not convinced this is the > proper way to do it. > > First of all, to achieve what I believe is your goal, you need to flip > things around: > > ./configure CFLAGS="$CFLAGS > -DPLUGIN_LIBDIR=\\\"/usr/lib/openvpn/plugins\\\"" > > This will ensure that whenever 'make' decides to re-run ./configure > automatically it will keep all variables provided to the command line.
Ah, right... I used this to build a binary package, so configure is run only once and it works for this case. :D > Secondly, I believe the proper way to configure PLUGIN_LIBDIR without > going via CFLAGS is to use a similar approach to what is used by > IFCONFIG, ROUTE, IPROUTE and NETSTAT. They are configured via AC_ARG_VAR. > > I'd recommend just adding these two lines to configure.ac instead: > > AC_ARG_VAR([PLUGINDIR], [Path of default plug-in search directory]) > AC_DEFINE_UNQUOTED([PLUGIN_LIBDIR], ["$PLUGINDIR"]) > > (these lines are not tested, but that should give some pointer towards a > better direction. > > With these lines in place, it is expected that you can do: > > ./configure PLUGINDIR=/usr/lib/openvpn/plugins > > Which should result in defining PLUGIN_LIBDIR in config.h. I decided to go another way... Wanted to make the plugin search work out of the box. Or do we want to keep that optional? (AC_DEFINE_UNQUOTED() fails if PLUGINDIR is not defined and you try ${libdir}/openvpn/plugins instead. That evaluates to "${exec_prefix}/lib/openvpn/plugins" and breaks the path in config.h.) -- main(a){char*c=/* Schoene Gruesse */"B?IJj;MEH" "CX:;",b;for(a/* Best regards my address: */=0;b=c[a++];) putchar(b-1/(/* Chris cc -ox -xc - && ./x */b/42*2-3)*42);}
pgpDcQgOS59i6.pgp
Description: OpenPGP digital signature
------------------------------------------------------------------------------
_______________________________________________ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel