Brandon Kim | dab96f1 | 2021-02-18 11:21:37 -0800 | [diff] [blame] | 1 | # Copyright 2021 Google LLC |
| 2 | # |
| 3 | # Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | # you may not use this file except in compliance with the License. |
| 5 | # You may obtain a copy of the License at |
| 6 | # |
| 7 | # http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | # |
| 9 | # Unless required by applicable law or agreed to in writing, software |
| 10 | # distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | # See the License for the specific language governing permissions and |
| 13 | # limitations under the License. |
| 14 | |
William A. Kennington III | 7d6fa42 | 2021-02-08 17:04:02 -0800 | [diff] [blame] | 15 | ncsid_headers = include_directories('.') |
| 16 | |
William A. Kennington III | 7d6fa42 | 2021-02-08 17:04:02 -0800 | [diff] [blame] | 17 | ncsid_deps = [ |
William A. Kennington III | 7d6fa42 | 2021-02-08 17:04:02 -0800 | [diff] [blame] | 18 | dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']), |
William A. Kennington III | d237c6c | 2021-06-18 00:59:04 -0700 | [diff] [blame] | 19 | dependency('stdplus', fallback: ['stdplus', 'stdplus_dep']), |
William A. Kennington III | 7d6fa42 | 2021-02-08 17:04:02 -0800 | [diff] [blame] | 20 | ] |
| 21 | |
| 22 | ncsid_lib = static_library( |
| 23 | 'ncsid', |
| 24 | [ |
| 25 | 'net_config.cpp', |
| 26 | 'net_iface.cpp', |
| 27 | 'net_sockio.cpp', |
| 28 | 'ncsi_sockio.cpp', |
| 29 | 'ncsi_state_machine.cpp', |
| 30 | 'platforms/nemora/portable/ncsi_fsm.c', |
| 31 | 'platforms/nemora/portable/ncsi_client.c', |
| 32 | 'platforms/nemora/portable/ncsi_server.c', |
| 33 | ], |
| 34 | include_directories: ncsid_headers, |
| 35 | implicit_include_directories: false, |
| 36 | dependencies: ncsid_deps) |
| 37 | |
| 38 | ncsid = declare_dependency( |
| 39 | dependencies: ncsid_deps, |
| 40 | include_directories: ncsid_headers, |
| 41 | link_with: ncsid_lib) |
| 42 | |
| 43 | executable( |
| 44 | 'ncsid', |
| 45 | 'ncsid.cpp', |
| 46 | implicit_include_directories: false, |
| 47 | dependencies: ncsid, |
| 48 | install: true, |
| 49 | install_dir: get_option('libexecdir')) |
| 50 | |
| 51 | normalize_ip = executable( |
| 52 | 'normalize_ip', |
| 53 | 'normalize_ip.c', |
| 54 | implicit_include_directories: false, |
| 55 | install: true) |
| 56 | |
| 57 | normalize_mac = executable( |
| 58 | 'normalize_mac', |
| 59 | 'normalize_mac.c', |
| 60 | implicit_include_directories: false, |
| 61 | install: true) |
| 62 | |
| 63 | install_data( |
William A. Kennington III | 379b061 | 2021-11-04 02:42:30 -0700 | [diff] [blame] | 64 | 'update_ra_gw.sh', |
William A. Kennington III | 7d6fa42 | 2021-02-08 17:04:02 -0800 | [diff] [blame] | 65 | install_mode: 'rwxr-xr-x', |
| 66 | install_dir: get_option('libexecdir')) |
| 67 | |
| 68 | install_data( |
| 69 | 'ncsid_lib.sh', |
| 70 | install_mode: 'rw-r--r--', |
| 71 | install_dir: get_option('libexecdir')) |
| 72 | |
William A. Kennington III | 7d6fa42 | 2021-02-08 17:04:02 -0800 | [diff] [blame] | 73 | systemd = dependency('systemd') |
Patrick Williams | 4c4e94f | 2023-04-12 08:01:25 -0500 | [diff] [blame] | 74 | systemunitdir = systemd.get_variable('systemdsystemunitdir') |
William A. Kennington III | 7d6fa42 | 2021-02-08 17:04:02 -0800 | [diff] [blame] | 75 | |
| 76 | libexecdir = get_option('prefix') / get_option('libexecdir') |
| 77 | |
| 78 | configure_file( |
| 79 | configuration: {'BIN': libexecdir / 'ncsid'}, |
| 80 | input: 'ncsid@.service.in', |
| 81 | output: 'ncsid@.service', |
| 82 | install_mode: 'rw-r--r--', |
| 83 | install_dir: systemunitdir) |
| 84 | |
| 85 | configure_file( |
William A. Kennington III | 379b061 | 2021-11-04 02:42:30 -0700 | [diff] [blame] | 86 | configuration: {'BIN': libexecdir / 'update_ra_gw.sh'}, |
| 87 | input: 'update-ra-gw@.service.in', |
| 88 | output: 'update-ra-gw@.service', |
| 89 | install_mode: 'rw-r--r--', |
| 90 | install_dir: systemunitdir) |
| 91 | |
William A. Kennington III | 7d6fa42 | 2021-02-08 17:04:02 -0800 | [diff] [blame] | 92 | install_data( |
| 93 | 'nic-hostful@.target', |
| 94 | 'nic-hostless@.target', |
William A. Kennington III | 7d6fa42 | 2021-02-08 17:04:02 -0800 | [diff] [blame] | 95 | install_mode: 'rw-r--r--', |
| 96 | install_dir: systemunitdir) |