frr: disable and warn on cross-compilation with net-snmp
Signed-off-by: Markus Theil <theil.markus@gmail.com>
This commit is contained in:
parent
833dd20ab2
commit
e80f51a514
2 changed files with 17 additions and 9 deletions
|
@ -1,9 +1,9 @@
|
||||||
{ lib
|
{ lib
|
||||||
, stdenv
|
, stdenv
|
||||||
, frr_source
|
, frrSource
|
||||||
, frr_version
|
, frrVersion
|
||||||
|
|
||||||
# build time
|
# build time
|
||||||
, autoreconfHook
|
, autoreconfHook
|
||||||
, flex
|
, flex
|
||||||
, bison
|
, bison
|
||||||
|
@ -16,9 +16,9 @@
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "frr-clippy-helper";
|
pname = "frr-clippy-helper";
|
||||||
version = frr_version;
|
version = frrVersion;
|
||||||
|
|
||||||
src = frr_source;
|
src = frrSource;
|
||||||
|
|
||||||
nativeBuildInputs = [
|
nativeBuildInputs = [
|
||||||
autoreconfHook
|
autoreconfHook
|
||||||
|
|
|
@ -30,8 +30,15 @@
|
||||||
, nettools
|
, nettools
|
||||||
, nixosTests
|
, nixosTests
|
||||||
|
|
||||||
# general options
|
# FRR's configure.ac gets SNMP options by executing net-snmp-config on the build host
|
||||||
, snmpSupport ? true
|
# This leads to compilation errors when cross compiling.
|
||||||
|
# E.g. net-snmp-config for x86_64 does not return the ARM64 paths.
|
||||||
|
#
|
||||||
|
# SNMP_LIBS="`${NETSNMP_CONFIG} --agent-libs`"
|
||||||
|
# SNMP_CFLAGS="`${NETSNMP_CONFIG} --base-cflags`"
|
||||||
|
, snmpSupport ? stdenv.buildPlatform.canExecute stdenv.hostPlatform
|
||||||
|
|
||||||
|
# other general options besides snmp support
|
||||||
, rpkiSupport ? true
|
, rpkiSupport ? true
|
||||||
, numMultipath ? 64
|
, numMultipath ? 64
|
||||||
, watchfrrSupport ? true
|
, watchfrrSupport ? true
|
||||||
|
@ -71,7 +78,8 @@
|
||||||
, ospfApi ? true
|
, ospfApi ? true
|
||||||
}:
|
}:
|
||||||
|
|
||||||
assert snmpSupport -> stdenv.buildPlatform.canExecute stdenv.hostPlatform;
|
lib.warnIf (!(stdenv.buildPlatform.canExecute stdenv.hostPlatform))
|
||||||
|
"cannot enable SNMP support due to cross-compilation issues with net-snmp-config"
|
||||||
|
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "frr";
|
pname = "frr";
|
||||||
|
@ -119,7 +127,7 @@ stdenv.mkDerivation rec {
|
||||||
|
|
||||||
# cross-compiling: clippy is compiled with the build host toolchain, split it out to ease
|
# cross-compiling: clippy is compiled with the build host toolchain, split it out to ease
|
||||||
# navigation in dependency hell
|
# navigation in dependency hell
|
||||||
clippy-helper = buildPackages.callPackage ./clippy-helper.nix { frr_version = version; frr_source=src; };
|
clippy-helper = buildPackages.callPackage ./clippy-helper.nix { frrVersion = version; frrSource = src; };
|
||||||
|
|
||||||
configureFlags = [
|
configureFlags = [
|
||||||
"--disable-silent-rules"
|
"--disable-silent-rules"
|
||||||
|
|
Loading…
Reference in a new issue