diff options
author | Eivind Næss <eivnaes@yahoo.com> | 2023-03-04 23:26:00 +0100 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2023-04-16 21:05:01 +0200 |
commit | 0324098afaee6e9e72050b2c8a6fb47803c36494 (patch) | |
tree | eb282bc331400a4427de6c200c3eb4a4c617ae0d | |
parent | 290bac0af9ad567f18ba59b5401dcfe4c571ee87 (diff) | |
download | NetworkManager-0324098afaee6e9e72050b2c8a6fb47803c36494.tar.gz |
build: detect pppd version via pkg-config for PPPD_PLUGIN_DIR
Ppp 2.5 adds a pkg-config file, so we can detect the version.
Use it.
[thaller@redhat.com: split out patch]
-rw-r--r-- | configure.ac | 8 | ||||
-rw-r--r-- | meson.build | 9 |
2 files changed, 14 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index 4a550cb5ae..1057b4e933 100644 --- a/configure.ac +++ b/configure.ac @@ -767,13 +767,17 @@ else fi AM_CONDITIONAL(WITH_PPP, test "${enable_ppp}" = "yes") +PPPD_VERSION=2.4.9 +PKG_CHECK_EXISTS([pppd], [ + PPPD_VERSION=`$PKG_CONFIG --modversion pppd` +]) + AC_ARG_WITH([pppd-plugin-dir], AS_HELP_STRING([--with-pppd-plugin-dir=DIR], [path to the pppd plugins directory])) - if test -n "$with_pppd_plugin_dir" ; then PPPD_PLUGIN_DIR="$with_pppd_plugin_dir" else - PPPD_PLUGIN_DIR="${libdir}/pppd/2.4.5" + PPPD_PLUGIN_DIR="${libdir}/pppd/$PPPD_VERSION" fi AC_SUBST(PPPD_PLUGIN_DIR) diff --git a/meson.build b/meson.build index b41597cab9..bed0702a1c 100644 --- a/meson.build +++ b/meson.build @@ -563,6 +563,13 @@ enable_ppp = get_option('ppp') if enable_ppp assert(cc.has_header('pppd/pppd.h'), 'couldn\'t find pppd.h. pppd development headers are required') + pppd_dep = dependency('pppd', required: false) + if (pppd_dep.found()) + pppd_version = pppd_dep.version() + else + pppd_version = '2.4.9' + endif + pppd_path = get_option('pppd') if pppd_path == '' pppd = find_program('pppd', '/sbin/pppd', '/usr/sbin/pppd', required: false) @@ -574,7 +581,7 @@ if enable_ppp pppd_plugin_dir = get_option('pppd_plugin_dir') if pppd_plugin_dir == '' - pppd_plugin_dir = join_paths(nm_libdir, 'pppd', '2.4.5') + pppd_plugin_dir = join_paths(nm_libdir, 'pppd', pppd_version) endif endif config_h.set10('WITH_PPP', enable_ppp) |