mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-22 01:49:48 +00:00
[#3732] Remove unnecessary kludge section from netconf fallback that searched in /opt
This commit is contained in:
parent
950cbdeca1
commit
42edde7415
@ -88,12 +88,14 @@ fi
|
|||||||
if test '@HAVE_NETCONF@' != 'no'; then
|
if test '@HAVE_NETCONF@' != 'no'; then
|
||||||
add_to_report <<HERE_DOCUMENT
|
add_to_report <<HERE_DOCUMENT
|
||||||
Netconf:
|
Netconf:
|
||||||
LIBYANG: @LIBYANG_VERSION@
|
YANG: @YANG_VERSION@
|
||||||
LIBYANGCPP: @LIBYANGCPP_VERSION@
|
YANG_PREFIX: @YANG_PREFIX@
|
||||||
LIBYANG_PREFIX: @LIBYANG_PREFIX@
|
YANGCPP: @YANGCPP_VERSION@
|
||||||
|
YANGCPP_PREFIX: @YANGCPP_PREFIX@
|
||||||
SYSREPO: @SYSREPO_VERSION@
|
SYSREPO: @SYSREPO_VERSION@
|
||||||
SYSREPOCPP: @SYSREPOCPP_VERSION@
|
|
||||||
SYSREPO_PREFIX: @SYSREPO_PREFIX@
|
SYSREPO_PREFIX: @SYSREPO_PREFIX@
|
||||||
|
SYSREPOCPP: @SYSREPOCPP_VERSION@
|
||||||
|
SYSREPOCPP_PREFIX: @SYSREPOCPP_PREFIX@
|
||||||
|
|
||||||
HERE_DOCUMENT
|
HERE_DOCUMENT
|
||||||
else
|
else
|
||||||
|
63
meson.build
63
meson.build
@ -223,7 +223,7 @@ NETCONF_DEP = dependency(
|
|||||||
required: netconf_opt,
|
required: netconf_opt,
|
||||||
)
|
)
|
||||||
if netconf_opt.enabled() and NETCONF_DEP.get_variable(
|
if netconf_opt.enabled() and NETCONF_DEP.get_variable(
|
||||||
'libyang_prefix',
|
'yang-prefix',
|
||||||
default_value: 'unknown',
|
default_value: 'unknown',
|
||||||
) == 'unknown'
|
) == 'unknown'
|
||||||
error('Dependency not found: NETCONF.')
|
error('Dependency not found: NETCONF.')
|
||||||
@ -541,11 +541,26 @@ conf_data.set('PACKAGE_VERSION_TYPE', f'"@package_version_type@"')
|
|||||||
compile_args = []
|
compile_args = []
|
||||||
link_args = []
|
link_args = []
|
||||||
|
|
||||||
|
# TODO: Use $ORIGIN
|
||||||
# $ORIGIN documented at https://www.man7.org/linux/man-pages/man8/ld.so.8.html
|
# $ORIGIN documented at https://www.man7.org/linux/man-pages/man8/ld.so.8.html
|
||||||
|
# It is preferable since it would allow Kea to start even if the installation is moved.
|
||||||
|
# We have to be careful at making executables work both in the build directory and in the installation directory.
|
||||||
|
# Also, Meson might use it by default, but might not use it on all systems, so lots of variables...
|
||||||
# EXECUTABLE_RPATH = f'$ORIGIN/../@LIBDIR@'
|
# EXECUTABLE_RPATH = f'$ORIGIN/../@LIBDIR@'
|
||||||
# HOOK_RPATH = '$ORIGIN/../..'
|
# HOOK_RPATH = '$ORIGIN/../..'
|
||||||
|
|
||||||
BUILD_RPATH = TOP_BUILD_DIR / 'src/lib'
|
BUILD_RPATH = TOP_BUILD_DIR / 'src/lib'
|
||||||
INSTALL_RPATH = PREFIX / LIBDIR
|
INSTALL_RPATH = PREFIX / LIBDIR
|
||||||
|
|
||||||
|
# Add rpaths for NETCONF dependencies.
|
||||||
|
if NETCONF_DEP.found()
|
||||||
|
foreach i : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp']
|
||||||
|
libdir = NETCONF_DEP.get_variable(f'@i@-libdir')
|
||||||
|
BUILD_RPATH += f':@libdir@'
|
||||||
|
INSTALL_RPATH += f':@libdir@'
|
||||||
|
endforeach
|
||||||
|
endif
|
||||||
|
|
||||||
# rpmbuild complains about rpaths to standard locations so let us conform to
|
# rpmbuild complains about rpaths to standard locations so let us conform to
|
||||||
# its liking and remove them. And let's do it consistently for all packages.
|
# its liking and remove them. And let's do it consistently for all packages.
|
||||||
if kea_pkg_type_in_configure != ''
|
if kea_pkg_type_in_configure != ''
|
||||||
@ -743,49 +758,59 @@ endif
|
|||||||
if NETCONF_DEP.found()
|
if NETCONF_DEP.found()
|
||||||
report_conf_data.set('HAVE_NETCONF', 'yes')
|
report_conf_data.set('HAVE_NETCONF', 'yes')
|
||||||
report_conf_data.set(
|
report_conf_data.set(
|
||||||
'LIBYANG_PREFIX',
|
'YANG_VERSION',
|
||||||
NETCONF_DEP.get_variable('libyang_prefix', default_value: 'unknown'),
|
|
||||||
)
|
|
||||||
report_conf_data.set(
|
|
||||||
'SYSREPO_PREFIX',
|
|
||||||
NETCONF_DEP.get_variable('sysrepo_prefix', default_value: 'unknown'),
|
|
||||||
)
|
|
||||||
report_conf_data.set(
|
|
||||||
'LIBYANG_VERSION',
|
|
||||||
NETCONF_DEP.get_variable(
|
NETCONF_DEP.get_variable(
|
||||||
'libyang_version',
|
'yang-version',
|
||||||
default_value: 'unknown version',
|
default_value: 'unknown version',
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
report_conf_data.set(
|
report_conf_data.set(
|
||||||
'LIBYANGCPP_VERSION',
|
'YANG_PREFIX',
|
||||||
|
NETCONF_DEP.get_variable('yang-prefix', default_value: 'unknown'),
|
||||||
|
)
|
||||||
|
report_conf_data.set(
|
||||||
|
'YANGCPP_VERSION',
|
||||||
NETCONF_DEP.get_variable(
|
NETCONF_DEP.get_variable(
|
||||||
'libyangcpp_version',
|
'yang-cpp-version',
|
||||||
default_value: 'unknown version',
|
default_value: 'unknown version',
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
report_conf_data.set(
|
||||||
|
'YANGCPP_PREFIX',
|
||||||
|
NETCONF_DEP.get_variable('yang-cpp-prefix', default_value: 'unknown'),
|
||||||
|
)
|
||||||
report_conf_data.set(
|
report_conf_data.set(
|
||||||
'SYSREPO_VERSION',
|
'SYSREPO_VERSION',
|
||||||
NETCONF_DEP.get_variable(
|
NETCONF_DEP.get_variable(
|
||||||
'sysrepo_version',
|
'sysrepo-version',
|
||||||
default_value: 'unknown version',
|
default_value: 'unknown version',
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
report_conf_data.set(
|
||||||
|
'SYSREPO_PREFIX',
|
||||||
|
NETCONF_DEP.get_variable('sysrepo-prefix', default_value: 'unknown'),
|
||||||
|
)
|
||||||
report_conf_data.set(
|
report_conf_data.set(
|
||||||
'SYSREPOCPP_VERSION',
|
'SYSREPOCPP_VERSION',
|
||||||
NETCONF_DEP.get_variable(
|
NETCONF_DEP.get_variable(
|
||||||
'sysrepocpp_version',
|
'sysrepo-cpp-version',
|
||||||
default_value: 'unknown version',
|
default_value: 'unknown version',
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
report_conf_data.set(
|
||||||
|
'SYSREPOCPP_PREFIX',
|
||||||
|
NETCONF_DEP.get_variable('sysrepo-cpp-prefix', default_value: 'unknown'),
|
||||||
|
)
|
||||||
else
|
else
|
||||||
report_conf_data.set('HAVE_NETCONF', 'no')
|
report_conf_data.set('HAVE_NETCONF', 'no')
|
||||||
report_conf_data.set('LIBYANG_PREFIX', 'no')
|
report_conf_data.set('YANG_VERSION', 'no')
|
||||||
report_conf_data.set('SYSREPO_PREFIX', 'no')
|
report_conf_data.set('YANG_PREFIX', 'no')
|
||||||
report_conf_data.set('LIBYANG_VERSION', 'no')
|
report_conf_data.set('YANGCPP_VERSION', 'no')
|
||||||
report_conf_data.set('LIBYANGCPP_VERSION', 'no')
|
report_conf_data.set('YANGCPP_PREFIX', 'no')
|
||||||
report_conf_data.set('SYSREPO_VERSION', 'no')
|
report_conf_data.set('SYSREPO_VERSION', 'no')
|
||||||
|
report_conf_data.set('SYSREPO_PREFIX', 'no')
|
||||||
report_conf_data.set('SYSREPOCPP_VERSION', 'no')
|
report_conf_data.set('SYSREPOCPP_VERSION', 'no')
|
||||||
|
report_conf_data.set('SYSREPOCPP_PREFIX', 'no')
|
||||||
endif
|
endif
|
||||||
if FUZZ_OPT.enabled() or TESTS_OPT.enabled()
|
if FUZZ_OPT.enabled() or TESTS_OPT.enabled()
|
||||||
report_conf_data.set('HAVE_GTEST', 'yes')
|
report_conf_data.set('HAVE_GTEST', 'yes')
|
||||||
|
@ -8,11 +8,11 @@ yang_utils_conf_data.set('datarootdir', PREFIX / DATADIR)
|
|||||||
yang_utils_conf_data.set('prefix', PREFIX)
|
yang_utils_conf_data.set('prefix', PREFIX)
|
||||||
yang_utils_conf_data.set(
|
yang_utils_conf_data.set(
|
||||||
'LIBYANG_PREFIX',
|
'LIBYANG_PREFIX',
|
||||||
NETCONF_DEP.get_variable('libyang_prefix'),
|
NETCONF_DEP.get_variable('yang-prefix'),
|
||||||
)
|
)
|
||||||
yang_utils_conf_data.set(
|
yang_utils_conf_data.set(
|
||||||
'SYSREPO_PREFIX',
|
'SYSREPO_PREFIX',
|
||||||
NETCONF_DEP.get_variable('sysrepo_prefix'),
|
NETCONF_DEP.get_variable('sysrepo-prefix'),
|
||||||
)
|
)
|
||||||
|
|
||||||
configure_file(
|
configure_file(
|
||||||
|
@ -10,39 +10,13 @@ foreach dep : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp']
|
|||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Try adding lib to it. libyang and libyang-cpp define the wrong pkg-config.
|
# Try adding lib to it. yang and yang-cpp define the wrong pkg-config.
|
||||||
netconf_deps = netconf_deps + {
|
netconf_deps = netconf_deps + {
|
||||||
dep: dependency('lib' + dep, required: false),
|
dep: dependency('lib' + dep, required: false),
|
||||||
}
|
}
|
||||||
if netconf_deps[dep].found()
|
if netconf_deps[dep].found()
|
||||||
continue
|
continue
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# Search in /opt.
|
|
||||||
foreach prefix : ['', 'lib']
|
|
||||||
path = f'/opt/@prefix@@dep@'
|
|
||||||
lib = cpp.find_library(dep, dirs: [f'/@path@/lib'], required: false)
|
|
||||||
if lib.found()
|
|
||||||
netconf_deps = netconf_deps + {
|
|
||||||
dep: declare_dependency(
|
|
||||||
dependencies: [lib],
|
|
||||||
include_directories: include_directories(f'/@path@/include'),
|
|
||||||
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
|
||||||
|
|
||||||
all_deps_found = true
|
all_deps_found = true
|
||||||
@ -55,48 +29,22 @@ endforeach
|
|||||||
|
|
||||||
if all_deps_found
|
if all_deps_found
|
||||||
variables = {}
|
variables = {}
|
||||||
if netconf_deps['yang'].found()
|
foreach i : ['yang', 'yang-cpp', 'sysrepo', 'sysrepo-cpp']
|
||||||
libyang_prefix = netconf_deps['yang'].get_variable('prefix')
|
if netconf_deps[i].found()
|
||||||
libyang_version = netconf_deps['yang'].version()
|
libdir = netconf_deps[i].get_variable('libdir')
|
||||||
if libyang_version == 'unknown'
|
prefix = netconf_deps[i].get_variable('prefix')
|
||||||
libyang_version = 'unknown version'
|
version = netconf_deps[i].version()
|
||||||
|
if version == 'unknown'
|
||||||
|
version = 'unknown version'
|
||||||
endif
|
endif
|
||||||
else
|
else
|
||||||
libyang_prefix = 'unknown'
|
prefix = 'unknown'
|
||||||
libyang_version = 'unknown version'
|
version = 'unknown version'
|
||||||
endif
|
endif
|
||||||
variables += {'libyang_prefix': libyang_prefix}
|
variables += {f'@i@-libdir': libdir}
|
||||||
variables += {'libyang_version': libyang_version}
|
variables += {f'@i@-prefix': prefix}
|
||||||
if netconf_deps['yang-cpp'].found()
|
variables += {f'@i@-version': version}
|
||||||
libyangcpp_version = netconf_deps['yang-cpp'].version()
|
endforeach
|
||||||
if libyangcpp_version == 'unknown'
|
|
||||||
libyangcpp_version = 'unknown version'
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
libyangcpp_version = 'unknown version'
|
|
||||||
endif
|
|
||||||
variables += {'libyangcpp_version': libyangcpp_version}
|
|
||||||
if netconf_deps['sysrepo'].found()
|
|
||||||
sysrepo_prefix = netconf_deps['sysrepo'].get_variable('prefix')
|
|
||||||
sysrepo_version = netconf_deps['sysrepo'].version()
|
|
||||||
if sysrepo_version == 'unknown'
|
|
||||||
sysrepo_version = 'unknown version'
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
sysrepo_prefix = 'unknown'
|
|
||||||
sysrepo_version = 'unknown version'
|
|
||||||
endif
|
|
||||||
variables += {'sysrepo_prefix': sysrepo_prefix}
|
|
||||||
variables += {'sysrepo_version': sysrepo_version}
|
|
||||||
if netconf_deps['sysrepo-cpp'].found()
|
|
||||||
sysrepocpp_version = netconf_deps['sysrepo-cpp'].version()
|
|
||||||
if sysrepocpp_version == 'unknown'
|
|
||||||
sysrepocpp_version = 'unknown version'
|
|
||||||
endif
|
|
||||||
else
|
|
||||||
sysrepocpp_version = 'unknown version'
|
|
||||||
endif
|
|
||||||
variables += {'sysrepocpp_version': sysrepocpp_version}
|
|
||||||
netconf = declare_dependency(
|
netconf = declare_dependency(
|
||||||
dependencies: [
|
dependencies: [
|
||||||
netconf_deps['yang'],
|
netconf_deps['yang'],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user