dpdk: support static/shared build mode switch

The default is false because upstream default is false (for performance).
wip/yesman
Orivej Desh 6 years ago
parent 66002a0e07
commit f1a2023961
  1. 11
      pkgs/os-specific/linux/dpdk/default.nix

@ -1,4 +1,4 @@
{ stdenv, lib, kernel, fetchurl, pkgconfig, numactl }:
{ stdenv, lib, kernel, fetchurl, pkgconfig, numactl, shared ? false }:
let
@ -25,9 +25,14 @@ in stdenv.mkDerivation rec {
NIX_CFLAGS_COMPILE = [ "-msse3" ];
hardeningDisable = [ "pic" ];
postPatch = lib.optionalString (!mod) ''
# Do not build kernel modules.
postPatch = ''
cat >>config/defconfig_$RTE_TARGET <<EOF
# Build static or shared libraries.
CONFIG_RTE_BUILD_SHARED_LIB=${if shared then "y" else "n"}
EOF
'' + lib.optionalString (!mod) ''
cat >>config/defconfig_$RTE_TARGET <<EOF
# Do not build kernel modules.
CONFIG_RTE_EAL_IGB_UIO=n
CONFIG_RTE_KNI_KMOD=n
EOF

Loading…
Cancel
Save