Unverified Commit f991762e authored by Pavol Rusnak's avatar Pavol Rusnak Committed by GitHub
Browse files

Merge pull request #220476 from ErinvanderVeen/openocd

openocd: rework configuration flags
parents 7efee351 7c98145f
Loading
Loading
Loading
Loading
+11 −10
Original line number Diff line number Diff line
@@ -3,9 +3,13 @@
, fetchurl
, pkg-config
, hidapi
, libftdi1
, libusb1
, libgpiod

, enableFtdi ? true, libftdi1

# Allow selection the hardware targets (SBCs, JTAG Programmers, JTAG Adapters)
, extraHardwareSupport ? []
}:

stdenv.mkDerivation rec {
@@ -24,17 +28,14 @@ stdenv.mkDerivation rec {
  configureFlags = [
    "--disable-werror"
    "--enable-jtag_vpi"
    "--enable-usb_blaster_libftdi"
    (lib.enableFeature (! stdenv.isDarwin) "amtjtagaccel")
    (lib.enableFeature (! stdenv.isDarwin) "gw16012")
    "--enable-presto_libftdi"
    "--enable-openjtag_ftdi"
    (lib.enableFeature (! stdenv.isDarwin) "oocd_trace")
    "--enable-buspirate"
    (lib.enableFeature stdenv.isLinux "sysfsgpio")
    (lib.enableFeature stdenv.isLinux "linuxgpiod")
    "--enable-remote-bitbang"
  ];
    (lib.enableFeature enableFtdi "ftdi")
    (lib.enableFeature stdenv.isLinux "linuxgpiod")
    (lib.enableFeature stdenv.isLinux "sysfsgpio")
  ] ++
    map (hardware: "--enable-${hardware}") extraHardwareSupport
  ;

  env.NIX_CFLAGS_COMPILE = toString (lib.optionals stdenv.cc.isGNU [
    "-Wno-error=cpp"