anchor.diff:  { stdenv
   , fetchurl
  -, static ? false
  +, static ? true
  +, shared ? true
   }:
   
   stdenv.mkDerivation (rec {
  
positive.code:       --replace 'ARFLAGS="-o"' 'ARFLAGS="-r"'
    '';
  
    outputs = [ "out" "dev" "static" ];
    setOutputFlags = false;
    outputDoc = "dev"; # single tiny man3 page
  
    configureFlags = stdenv.lib.optional (!static) "--shared";
  
    postInstall = ''
      moveToOutput lib/libz.a "$static"
    ''
      # jww (2015-01-06): Sometimes this library install as a .so, even on
  
negative.code:     "PREFIX=${stdenv.cc.targetPrefix}"
    ] ++ stdenv.lib.optionals (stdenv.hostPlatform.libc == "msvcrt") [
      "-f" "win32/Makefile.gcc"
    ] ++ stdenv.lib.optionals shared [
      "SHARED_MODE=1"
    ];
  
  