blob: 2bb1c82671cfa973fe3989b21df2b9223eaf06b9 [file] [log] [blame]
Brandon Kimdab96f12021-02-18 11:21:37 -08001# 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 III7d6fa422021-02-08 17:04:02 -080015ncsid_headers = include_directories('.')
16
William A. Kennington III7d6fa422021-02-08 17:04:02 -080017ncsid_deps = [
William A. Kennington III7d6fa422021-02-08 17:04:02 -080018 dependency('sdbusplus', fallback: ['sdbusplus', 'sdbusplus_dep']),
William A. Kennington IIId237c6c2021-06-18 00:59:04 -070019 dependency('stdplus', fallback: ['stdplus', 'stdplus_dep']),
William A. Kennington III7d6fa422021-02-08 17:04:02 -080020]
21
22ncsid_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
38ncsid = declare_dependency(
39 dependencies: ncsid_deps,
40 include_directories: ncsid_headers,
41 link_with: ncsid_lib)
42
43executable(
44 'ncsid',
45 'ncsid.cpp',
46 implicit_include_directories: false,
47 dependencies: ncsid,
48 install: true,
49 install_dir: get_option('libexecdir'))
50
51normalize_ip = executable(
52 'normalize_ip',
53 'normalize_ip.c',
54 implicit_include_directories: false,
55 install: true)
56
57normalize_mac = executable(
58 'normalize_mac',
59 'normalize_mac.c',
60 implicit_include_directories: false,
61 install: true)
62
63install_data(
William A. Kennington III379b0612021-11-04 02:42:30 -070064 'update_ra_gw.sh',
William A. Kennington III7d6fa422021-02-08 17:04:02 -080065 install_mode: 'rwxr-xr-x',
66 install_dir: get_option('libexecdir'))
67
68install_data(
69 'ncsid_lib.sh',
70 install_mode: 'rw-r--r--',
71 install_dir: get_option('libexecdir'))
72
William A. Kennington III7d6fa422021-02-08 17:04:02 -080073systemd = dependency('systemd')
Patrick Williams4c4e94f2023-04-12 08:01:25 -050074systemunitdir = systemd.get_variable('systemdsystemunitdir')
William A. Kennington III7d6fa422021-02-08 17:04:02 -080075
76libexecdir = get_option('prefix') / get_option('libexecdir')
77
78configure_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
85configure_file(
William A. Kennington III379b0612021-11-04 02:42:30 -070086 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 III7d6fa422021-02-08 17:04:02 -080092install_data(
93 'nic-hostful@.target',
94 'nic-hostless@.target',
William A. Kennington III7d6fa422021-02-08 17:04:02 -080095 install_mode: 'rw-r--r--',
96 install_dir: systemunitdir)