diff --git a/configure.ac b/configure.ac index 320eb37a6a..aa1a17c9b0 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 525be69c6a..7d6cdbe958 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)