]> git.ozlabs.org Git - ppp.git/commit
Fix include paths for plugins to use the public API of pppd
authorEivind Næss <eivnaes@yahoo.com>
Tue, 10 Aug 2021 23:38:45 +0000 (16:38 -0700)
committerEivind Næss <eivnaes@yahoo.com>
Fri, 15 Jul 2022 22:25:39 +0000 (15:25 -0700)
commitbdd34ab1f2f87acb23c6d92feee7354ac53005ff
tree57a45d6e3f98e6c06e1f3afeccd299587243fb25
parente8605bcddbad7e47277b86f2ce0b28f6ca951fa2
Fix include paths for plugins to use the public API of pppd

This change does a few different things.
 * Projects that needs #include "config.h" should use a config.h.in for the project generated by configure in the project's local directory.
 * All projects will use #include <pppd/pppd.h>, and Makefile will add -I${top_srcdir} to the appropriate *_CPPFLAGS variable.
 * The inclusion of <pppd/pppdconf.h> will set the presidence for all features enabled/disabled in pppd
 * Plugins will now need to use PPPD_VERSION as it conflicts with VERSION from config.h generated by autotools for third party packages

Currently, only pppoe require the use of config.h to correctly set the defines for which header files and so on was detected by configure

Other projects only needed to include <pppd/pppd.h> (and maybe a few other header files), a future change will fixup <pppd/pppd.h> to include features as needed such that it's the only needed include for a plugin. This will avoid littering the code with #ifdef/#endif constructs.

BREAKING CHANGE!

pppd/pppd.h no longer provide VERSION, third party packages are required to switch to use PPPD_VERSION. This is to avoid conflict with a source package's own VERSION as set by autotools / config.h. Also, the use of PPP_VERSION conflicts with public header files from Glibc/Linux kernel.

Example:

   char pppd_version[] = PPPD_VERSION;

pppd will load plugins, and also look for the symbol "pppd_version" to validate that the plugin was built for the current version of pppd.

Signed-off-by: Eivind Næss <eivnaes@yahoo.com>
28 files changed:
.gitignore
configure.ac
pppd/plugins/Makefile.am
pppd/plugins/minconn.c
pppd/plugins/passprompt.c
pppd/plugins/passwordfd.c
pppd/plugins/pppoatm/Makefile.am
pppd/plugins/pppoatm/pppoatm.c
pppd/plugins/pppoe/Makefile.am
pppd/plugins/pppoe/common.c
pppd/plugins/pppoe/config.h.in [new file with mode: 0644]
pppd/plugins/pppoe/discovery.c
pppd/plugins/pppoe/if.c
pppd/plugins/pppoe/plugin.c
pppd/plugins/pppoe/pppoe-discovery.c
pppd/plugins/pppoe/pppoe.h
pppd/plugins/pppol2tp/Makefile.am
pppd/plugins/pppol2tp/openl2tp.c
pppd/plugins/pppol2tp/pppol2tp.c
pppd/plugins/radius/Makefile.am
pppd/plugins/radius/includes.h
pppd/plugins/radius/md5.c
pppd/plugins/radius/radattr.c
pppd/plugins/radius/radius.c
pppd/plugins/radius/radiusclient.h
pppd/plugins/radius/radrealms.c
pppd/plugins/winbind.c
pppd/pppdconf.h.in