build: meson: fix pppd path

Allow specifying a non-existent path.

(cherry picked from commit 794e499ab8)
This commit is contained in:
Beniamino Galvani 2018-09-07 16:52:59 +02:00
parent e860a2e09c
commit bda3bb931b
2 changed files with 9 additions and 6 deletions

View file

@ -505,11 +505,14 @@ 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')
locations = get_option('pppd')
pppd = find_program(locations, required: false)
assert(pppd.found(), 'pppd required but not found, please provide a valid pppd path or use -Dppp=false to disable it')
pppd_path = get_option('pppd')
if pppd_path == ''
pppd = find_program('pppd', '/sbin/pppd', '/usr/sbin/pppd', required: false)
assert(pppd.found(), 'pppd required but not found, please provide a valid pppd path or use -Dppp=false to disable it')
pppd_path = pppd.path()
endif
config_h.set_quoted('PPPD_PATH', pppd.path())
config_h.set_quoted('PPPD_PATH', pppd_path)
pppd_plugin_dir = get_option('pppd_plugin_dir')
if pppd_plugin_dir == ''
@ -984,7 +987,7 @@ output += ' wifi: ' + enable_wifi.to_string() + '\n'
output += ' iwd: ' + enable_iwd.to_string() + '\n'
output += ' pppd: ' + enable_ppp.to_string()
if enable_ppp
output += ' ' + pppd.path()
output += ' ' + pppd_path
endif
output += '\n'
output += ' modemmanager-1: ' + enable_modem_manager.to_string() + '\n'

View file

@ -30,7 +30,7 @@ option('wext', type: 'boolean', value: true, description: 'Enable or disable Lin
option('wifi', type: 'boolean', value: true, description: 'enable Wi-Fi support')
option('iwd', type: 'boolean', value: false, description: 'enable iwd support (experimental)')
option('ppp', type: 'boolean', value: true, description: 'enable PPP/PPPoE support')
option('pppd', type: 'array', value: ['pppd', '/sbin/pppd', '/usr/sbin/pppd'], description: 'path to pppd binary')
option('pppd', type: 'string', value: '', description: 'path to pppd binary')
option('pppd_plugin_dir', type: 'string', value: '', description: 'path to the pppd plugins directory')
option('modem_manager', type: 'boolean', value: true, description: 'Enable new ModemManager1 interface support')
option('ofono', type: 'boolean', value: false, description: 'Enable oFono support (experimental)')