11285115cSWilliam A. Kennington III# Copyright 2021 Google LLC 21285115cSWilliam A. Kennington III# 31285115cSWilliam A. Kennington III# Licensed under the Apache License, Version 2.0 (the "License"); 41285115cSWilliam A. Kennington III# you may not use this file except in compliance with the License. 51285115cSWilliam A. Kennington III# You may obtain a copy of the License at 61285115cSWilliam A. Kennington III# 71285115cSWilliam A. Kennington III# http://www.apache.org/licenses/LICENSE-2.0 81285115cSWilliam A. Kennington III# 91285115cSWilliam A. Kennington III# Unless required by applicable law or agreed to in writing, software 101285115cSWilliam A. Kennington III# distributed under the License is distributed on an "AS IS" BASIS, 111285115cSWilliam A. Kennington III# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 121285115cSWilliam A. Kennington III# See the License for the specific language governing permissions and 131285115cSWilliam A. Kennington III# limitations under the License. 141285115cSWilliam A. Kennington III 151285115cSWilliam A. Kennington IIIncsid_headers = include_directories('.') 161285115cSWilliam A. Kennington III 171285115cSWilliam A. Kennington IIIfmt_dep = dependency('fmt', required: false) 181285115cSWilliam A. Kennington IIIif not fmt_dep.found() 191285115cSWilliam A. Kennington III fmt_proj = import('cmake').subproject( 201285115cSWilliam A. Kennington III 'fmt', 211285115cSWilliam A. Kennington III cmake_options: [ 221285115cSWilliam A. Kennington III '-DCMAKE_POSITION_INDEPENDENT_CODE=ON', 231285115cSWilliam A. Kennington III '-DMASTER_PROJECT=OFF' 241285115cSWilliam A. Kennington III ], 251285115cSWilliam A. Kennington III required: false) 261285115cSWilliam A. Kennington III assert(fmt_proj.found(), 'fmtlib is required') 271285115cSWilliam A. Kennington III fmt_dep = fmt_proj.dependency('fmt') 281285115cSWilliam A. Kennington IIIendif 291285115cSWilliam A. Kennington III 301285115cSWilliam A. Kennington IIIncsid_deps = [ 311285115cSWilliam A. Kennington III fmt_dep, 321285115cSWilliam A. Kennington III dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']), 33d237c6ccSWilliam A. Kennington III dependency('stdplus', fallback: ['stdplus', 'stdplus_dep']), 341285115cSWilliam A. Kennington III] 351285115cSWilliam A. Kennington III 361285115cSWilliam A. Kennington IIIncsid_lib = static_library( 371285115cSWilliam A. Kennington III 'ncsid', 381285115cSWilliam A. Kennington III [ 391285115cSWilliam A. Kennington III 'net_config.cpp', 401285115cSWilliam A. Kennington III 'net_iface.cpp', 411285115cSWilliam A. Kennington III 'net_sockio.cpp', 421285115cSWilliam A. Kennington III 'ncsi_sockio.cpp', 431285115cSWilliam A. Kennington III 'ncsi_state_machine.cpp', 441285115cSWilliam A. Kennington III 'platforms/nemora/portable/ncsi_fsm.c', 451285115cSWilliam A. Kennington III 'platforms/nemora/portable/ncsi_client.c', 461285115cSWilliam A. Kennington III 'platforms/nemora/portable/ncsi_server.c', 471285115cSWilliam A. Kennington III ], 481285115cSWilliam A. Kennington III include_directories: ncsid_headers, 491285115cSWilliam A. Kennington III implicit_include_directories: false, 501285115cSWilliam A. Kennington III dependencies: ncsid_deps) 511285115cSWilliam A. Kennington III 521285115cSWilliam A. Kennington IIIncsid = declare_dependency( 531285115cSWilliam A. Kennington III dependencies: ncsid_deps, 541285115cSWilliam A. Kennington III include_directories: ncsid_headers, 551285115cSWilliam A. Kennington III link_with: ncsid_lib) 561285115cSWilliam A. Kennington III 571285115cSWilliam A. Kennington IIIexecutable( 581285115cSWilliam A. Kennington III 'ncsid', 591285115cSWilliam A. Kennington III 'ncsid.cpp', 601285115cSWilliam A. Kennington III implicit_include_directories: false, 611285115cSWilliam A. Kennington III dependencies: ncsid, 621285115cSWilliam A. Kennington III install: true, 631285115cSWilliam A. Kennington III install_dir: get_option('libexecdir')) 641285115cSWilliam A. Kennington III 651285115cSWilliam A. Kennington IIInormalize_ip = executable( 661285115cSWilliam A. Kennington III 'normalize_ip', 671285115cSWilliam A. Kennington III 'normalize_ip.c', 681285115cSWilliam A. Kennington III implicit_include_directories: false, 691285115cSWilliam A. Kennington III install: true) 701285115cSWilliam A. Kennington III 711285115cSWilliam A. Kennington IIInormalize_mac = executable( 721285115cSWilliam A. Kennington III 'normalize_mac', 731285115cSWilliam A. Kennington III 'normalize_mac.c', 741285115cSWilliam A. Kennington III implicit_include_directories: false, 751285115cSWilliam A. Kennington III install: true) 761285115cSWilliam A. Kennington III 771285115cSWilliam A. Kennington IIIinstall_data( 781285115cSWilliam A. Kennington III 'ncsid_udhcpc4.script', 791285115cSWilliam A. Kennington III 'ncsid_udhcpc6.script', 80*379b061fSWilliam A. Kennington III 'update_ra_gw.sh', 81*379b061fSWilliam A. Kennington III 'update_ra_neighbor.sh', 82*379b061fSWilliam A. Kennington III 'update_static_neighbors.sh', 831285115cSWilliam A. Kennington III install_mode: 'rwxr-xr-x', 841285115cSWilliam A. Kennington III install_dir: get_option('libexecdir')) 851285115cSWilliam A. Kennington III 861285115cSWilliam A. Kennington IIIinstall_data( 871285115cSWilliam A. Kennington III 'ncsid_lib.sh', 881285115cSWilliam A. Kennington III install_mode: 'rw-r--r--', 891285115cSWilliam A. Kennington III install_dir: get_option('libexecdir')) 901285115cSWilliam A. Kennington III 911285115cSWilliam A. Kennington IIIsystemd = dependency('systemd') 921285115cSWilliam A. Kennington IIIsystemunitdir = systemd.get_pkgconfig_variable('systemdsystemunitdir') 931285115cSWilliam A. Kennington III 941285115cSWilliam A. Kennington IIIlibexecdir = get_option('prefix') / get_option('libexecdir') 951285115cSWilliam A. Kennington III 961285115cSWilliam A. Kennington IIIconfigure_file( 971285115cSWilliam A. Kennington III configuration: {'BIN': libexecdir / 'ncsid'}, 981285115cSWilliam A. Kennington III input: 'ncsid@.service.in', 991285115cSWilliam A. Kennington III output: 'ncsid@.service', 1001285115cSWilliam A. Kennington III install_mode: 'rw-r--r--', 1011285115cSWilliam A. Kennington III install_dir: systemunitdir) 1021285115cSWilliam A. Kennington III 1031285115cSWilliam A. Kennington IIIconfigure_file( 104*379b061fSWilliam A. Kennington III configuration: {'BIN': libexecdir / 'update_ra_gw.sh'}, 105*379b061fSWilliam A. Kennington III input: 'update-ra-gw@.service.in', 106*379b061fSWilliam A. Kennington III output: 'update-ra-gw@.service', 107*379b061fSWilliam A. Kennington III install_mode: 'rw-r--r--', 108*379b061fSWilliam A. Kennington III install_dir: systemunitdir) 109*379b061fSWilliam A. Kennington III 110*379b061fSWilliam A. Kennington IIIconfigure_file( 111b163a2c1SWilliam A. Kennington III configuration: {'BIN': libexecdir / 'update_ra_neighbor.sh'}, 112b163a2c1SWilliam A. Kennington III input: 'update-ra-neighbor@.service.in', 113b163a2c1SWilliam A. Kennington III output: 'update-ra-neighbor@.service', 114b163a2c1SWilliam A. Kennington III install_mode: 'rw-r--r--', 115b163a2c1SWilliam A. Kennington III install_dir: systemunitdir) 116b163a2c1SWilliam A. Kennington III 117b163a2c1SWilliam A. Kennington IIIconfigure_file( 1181285115cSWilliam A. Kennington III configuration: {'BIN': libexecdir / 'update_static_neighbors.sh'}, 1191285115cSWilliam A. Kennington III input: 'update-static-neighbors@.service.in', 1201285115cSWilliam A. Kennington III output: 'update-static-neighbors@.service', 1211285115cSWilliam A. Kennington III install_mode: 'rw-r--r--', 1221285115cSWilliam A. Kennington III install_dir: systemunitdir) 1231285115cSWilliam A. Kennington III 1241285115cSWilliam A. Kennington IIIconfigure_file( 1251285115cSWilliam A. Kennington III configuration: { 1261285115cSWilliam A. Kennington III 'SCRIPT': libexecdir / 'ncsid_udhcpc4.script'}, 1271285115cSWilliam A. Kennington III input: 'dhcp4@.service.in', 1281285115cSWilliam A. Kennington III output: 'dhcp4@.service', 1291285115cSWilliam A. Kennington III install_mode: 'rw-r--r--', 1301285115cSWilliam A. Kennington III install_dir: systemunitdir) 1311285115cSWilliam A. Kennington III 1321285115cSWilliam A. Kennington IIIconfigure_file( 1331285115cSWilliam A. Kennington III configuration: { 1341285115cSWilliam A. Kennington III 'SCRIPT': libexecdir / 'ncsid_udhcpc6.script'}, 1351285115cSWilliam A. Kennington III input: 'dhcp6@.service.in', 1361285115cSWilliam A. Kennington III output: 'dhcp6@.service', 1371285115cSWilliam A. Kennington III install_mode: 'rw-r--r--', 1381285115cSWilliam A. Kennington III install_dir: systemunitdir) 1391285115cSWilliam A. Kennington III 1401285115cSWilliam A. Kennington IIIinstall_data( 1411285115cSWilliam A. Kennington III 'nic-hostful@.target', 1421285115cSWilliam A. Kennington III 'nic-hostless@.target', 143b163a2c1SWilliam A. Kennington III 'update-ra-neighbor@.timer', 1441285115cSWilliam A. Kennington III 'update-static-neighbors@.timer', 1451285115cSWilliam A. Kennington III install_mode: 'rw-r--r--', 1461285115cSWilliam A. Kennington III install_dir: systemunitdir) 147