mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-09-04 07:55:18 +00:00
[#3729] Fix yang
This commit is contained in:
93
meson.build
93
meson.build
@@ -123,6 +123,36 @@ conf_data = configuration_data(
|
|||||||
},
|
},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
#### System-specific Variables
|
||||||
|
|
||||||
|
SYSTEM = build_machine.system()
|
||||||
|
if SYSTEM == 'linux'
|
||||||
|
conf_data.set('OS_LINUX', true)
|
||||||
|
OS_TYPE = 'Linux'
|
||||||
|
elif SYSTEM == 'freebsd'
|
||||||
|
conf_data.set('OS_BSD', true)
|
||||||
|
conf_data.set('OS_FREEBSD', true)
|
||||||
|
OS_TYPE = 'BSD'
|
||||||
|
elif SYSTEM == 'netbsd'
|
||||||
|
conf_data.set('OS_BSD', true)
|
||||||
|
conf_data.set('OS_NETBSD', true)
|
||||||
|
OS_TYPE = 'BSD'
|
||||||
|
elif SYSTEM == 'openbsd'
|
||||||
|
conf_data.set('OS_BSD', true)
|
||||||
|
conf_data.set('OS_OPENBSD', true)
|
||||||
|
OS_TYPE = 'BSD'
|
||||||
|
elif SYSTEM == 'sun'
|
||||||
|
conf_data.set('OS_SOLARIS', true)
|
||||||
|
OS_TYPE = 'Solaris'
|
||||||
|
elif SYSTEM == 'darwin'
|
||||||
|
conf_data.set('OS_BSD', true)
|
||||||
|
conf_data.set('OS_OSX', true)
|
||||||
|
OS_TYPE = 'BSD'
|
||||||
|
else
|
||||||
|
error(f'Build failed: Unsupported system "@SYSTEM@".')
|
||||||
|
endif
|
||||||
|
message(f'Detected system "@SYSTEM@".')
|
||||||
|
|
||||||
#### Programs
|
#### Programs
|
||||||
|
|
||||||
python_exe = find_program('python3', 'python', required: false)
|
python_exe = find_program('python3', 'python', required: false)
|
||||||
@@ -261,15 +291,30 @@ foreach dep : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp']
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
# Search in /opt.
|
# Search in /opt.
|
||||||
lib = cpp.find_library(dep, dirs: [f'/opt/@dep@/lib'], required: false)
|
foreach prefix : ['', 'lib']
|
||||||
if lib.found()
|
path = f'/opt/@prefix@@dep@'
|
||||||
netconf_deps = netconf_deps + {
|
lib = cpp.find_library(dep, dirs: [f'/@path@/lib'], required: false)
|
||||||
dep: declare_dependency(
|
if lib.found()
|
||||||
dependencies: [lib],
|
netconf_deps = netconf_deps + {
|
||||||
include_directories: include_directories(f'/opt/@dep@/include'),
|
dep: declare_dependency(
|
||||||
),
|
dependencies: [lib],
|
||||||
}
|
include_directories: include_directories(f'/@path@/include'),
|
||||||
endif
|
variables: {'prefix': f'@path@'},
|
||||||
|
),
|
||||||
|
}
|
||||||
|
if SYSTEM == 'darwin'
|
||||||
|
add_project_link_arguments(
|
||||||
|
f'-Wl,-rpath,@path@/lib',
|
||||||
|
language: 'cpp',
|
||||||
|
)
|
||||||
|
else
|
||||||
|
add_project_link_arguments(
|
||||||
|
f'-Wl,-rpath=@path@/lib',
|
||||||
|
language: 'cpp',
|
||||||
|
)
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
endforeach
|
endforeach
|
||||||
foreach dep : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp']
|
foreach dep : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp']
|
||||||
if netconf_deps[dep].found()
|
if netconf_deps[dep].found()
|
||||||
@@ -341,36 +386,6 @@ result = cpp.run(
|
|||||||
)
|
)
|
||||||
conf_data.set('HAVE_STREAM_TRUNCATED_ERROR', result.returncode() == 0)
|
conf_data.set('HAVE_STREAM_TRUNCATED_ERROR', result.returncode() == 0)
|
||||||
|
|
||||||
#### System-specific Variables
|
|
||||||
|
|
||||||
SYSTEM = build_machine.system()
|
|
||||||
if SYSTEM == 'linux'
|
|
||||||
conf_data.set('OS_LINUX', true)
|
|
||||||
OS_TYPE = 'Linux'
|
|
||||||
elif SYSTEM == 'freebsd'
|
|
||||||
conf_data.set('OS_BSD', true)
|
|
||||||
conf_data.set('OS_FREEBSD', true)
|
|
||||||
OS_TYPE = 'BSD'
|
|
||||||
elif SYSTEM == 'netbsd'
|
|
||||||
conf_data.set('OS_BSD', true)
|
|
||||||
conf_data.set('OS_NETBSD', true)
|
|
||||||
OS_TYPE = 'BSD'
|
|
||||||
elif SYSTEM == 'openbsd'
|
|
||||||
conf_data.set('OS_BSD', true)
|
|
||||||
conf_data.set('OS_OPENBSD', true)
|
|
||||||
OS_TYPE = 'BSD'
|
|
||||||
elif SYSTEM == 'sun'
|
|
||||||
conf_data.set('OS_SOLARIS', true)
|
|
||||||
OS_TYPE = 'Solaris'
|
|
||||||
elif SYSTEM == 'darwin'
|
|
||||||
conf_data.set('OS_BSD', true)
|
|
||||||
conf_data.set('OS_OSX', true)
|
|
||||||
OS_TYPE = 'BSD'
|
|
||||||
else
|
|
||||||
error(f'Build failed: Unsupported system "@SYSTEM@".')
|
|
||||||
endif
|
|
||||||
message(f'Detected system "@SYSTEM@".')
|
|
||||||
|
|
||||||
#### System-specific Compiler Flags
|
#### System-specific Compiler Flags
|
||||||
|
|
||||||
compile_args = []
|
compile_args = []
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Copyright (C) 2018-2024 Internet Systems Consortium, Inc. ("ISC")
|
# Copyright (C) 2018-2025 Internet Systems Consortium, Inc. ("ISC")
|
||||||
#
|
#
|
||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Copyright (C) 2018-2024 Internet Systems Consortium, Inc. ("ISC")
|
# Copyright (C) 2018-2025 Internet Systems Consortium, Inc. ("ISC")
|
||||||
#
|
#
|
||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
|
@@ -1,24 +1,19 @@
|
|||||||
yangdir = f'@DATADIR@/kea/yang/modules/utils'
|
yangdir = f'@DATADIR@/kea/yang/modules/utils'
|
||||||
yang_utils_conf_data = configuration_data()
|
yang_utils_conf_data = configuration_data()
|
||||||
# Comment says sources (vs build)
|
# Comment says sources (vs build)
|
||||||
yang_utils_conf_data.set('abs_top_builddir', TOP_SOURCE_DIR)
|
yang_utils_conf_data.set('abs_top_builddir', TOP_BUILD_DIR)
|
||||||
# Beware that top_srcdir here must be a relative path.
|
# Beware that top_srcdir here must be a relative path.
|
||||||
yang_utils_conf_data.set('top_srcdir', '../../../../..')
|
yang_utils_conf_data.set('top_srcdir', '../../../../..')
|
||||||
yang_utils_conf_data.set('datarootdir', f'@PREFIX@/@DATADIR@')
|
yang_utils_conf_data.set('datarootdir', f'@PREFIX@/@DATADIR@')
|
||||||
yang_lint = find_program('/opt/bin/yanglint', required: false)
|
yang_utils_conf_data.set('prefix', PREFIX)
|
||||||
if yang_lint.found()
|
yang_utils_conf_data.set(
|
||||||
yang_utils_conf_data.set('LIBYANG_PREFIX', '/opt')
|
'LIBYANG_PREFIX',
|
||||||
yang_utils_conf_data.set('SYSREPO_PREFIX', '/opt')
|
netconf_deps['yang'].get_variable('prefix'),
|
||||||
else
|
)
|
||||||
yang_utils_conf_data.set('SYSREPO_PREFIX', '/usr/local')
|
yang_utils_conf_data.set(
|
||||||
yang_lint = find_program('/usr/local/bin/yanglint', required: false)
|
'SYSREPO_PREFIX',
|
||||||
if yang_lint.found()
|
netconf_deps['sysrepo'].get_variable('prefix'),
|
||||||
yang_utils_conf_data.set('LIBYANG_PREFIX', '/usr/local')
|
)
|
||||||
else
|
|
||||||
yang_lint = find_program('yanglint', required: true)
|
|
||||||
yang_utils_conf_data.set('LIBYANG_PREFIX', '')
|
|
||||||
endif
|
|
||||||
endif
|
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
input: 'check-hashes.sh.in',
|
input: 'check-hashes.sh.in',
|
||||||
@@ -34,4 +29,6 @@ configure_file(
|
|||||||
input: 'reinstall.sh.in',
|
input: 'reinstall.sh.in',
|
||||||
output: 'reinstall.sh',
|
output: 'reinstall.sh',
|
||||||
configuration: yang_utils_conf_data,
|
configuration: yang_utils_conf_data,
|
||||||
|
install: true,
|
||||||
|
install_dir: 'share/kea/yang/modules/utils',
|
||||||
)
|
)
|
||||||
|
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# Copyright (C) 2021-2024 Internet Systems Consortium, Inc. ("ISC")
|
# Copyright (C) 2021-2025 Internet Systems Consortium, Inc. ("ISC")
|
||||||
#
|
#
|
||||||
# This Source Code Form is subject to the terms of the Mozilla Public
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
@@ -87,7 +87,7 @@ prefix="@prefix@"
|
|||||||
# If script is in sources, use modules from sources.
|
# If script is in sources, use modules from sources.
|
||||||
# If script is in installation, use modules from installation.
|
# If script is in installation, use modules from installation.
|
||||||
for i in \
|
for i in \
|
||||||
"@datarootdir@/@PACKAGE_NAME@/yang/modules" \
|
"@datarootdir@/kea/yang/modules" \
|
||||||
"@abs_top_builddir@/src/share/yang/modules" \
|
"@abs_top_builddir@/src/share/yang/modules" \
|
||||||
; do
|
; do
|
||||||
if test "${script_path}" = "${i}/utils"; then
|
if test "${script_path}" = "${i}/utils"; then
|
||||||
|
Reference in New Issue
Block a user