pppd: Add rules for building the pppol2tp-android plugin

Build plugin as shared library. It uses some symbols from pppd, so let's
allow building the plugin with undefined symbols, as they will be
resolved at runtime, when plugin is loaded (on dlopen() call).

Plugin will be installed to next path:
  - on 32-bit systems: /system/lib/
  - on 64-bit systems: /system/lib64/
  - on Multilib build: to both paths above

We install it in /system/$LIB/ rather than /system/$LIB/pppd/$VERSION/,
because we previously modified pppd to look in /system/$LIB for plugins,
as it is the only allowed path for dlopen().

While at it, extract flags that common for pppd and plugins to separate
variable, to avoid code duplication.

Also, add pppol2tp-android as pppd dependency, so it will be built and
installed along with pppd. Let's use LOCAL_REQUIRED_MODULE instead of
LOCAL_SHARED_LIBRARIES, because latter would lead to linking pppd binary
against pppol2tp-android.so, which we don't want, as pppol2tp-android.so
is just a plugin and should be loaded via dlopen() only when it's needed.

-Wno-pointer-sign is added to avoid next error shown by presubmit
(Treehugger Robot), because 32-bit ABI is broken:

        error: passing 'int *' to parameter of type 'socklen_t *'
        (aka 'unsigned int *') converts between pointers to integer
        types with different sign [-Werror,-Wpointer-sign]

-Wno-unused-variable flag is removed, because pppd builds cleanly now.

[1] https://lwn.net/Articles/507794/

Change-Id: I4b51a0f2bf99550c0fe126b6e56e08127dde812b
Signed-off-by: Sam Protsenko <semen.protsenko@linaro.org>
1 file changed
tree: 0f4b67e17b9a5dc2edac853b8ed753c01493a85f
  1. pppd/
  2. CleanSpec.mk
  3. README.version