summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--pkgs/os-specific/linux/pam/default.nix9
1 files changed, 8 insertions, 1 deletions
diff --git a/pkgs/os-specific/linux/pam/default.nix b/pkgs/os-specific/linux/pam/default.nix
index e8fc1081ad3..1ae6ae1bfe3 100644
--- a/pkgs/os-specific/linux/pam/default.nix
+++ b/pkgs/os-specific/linux/pam/default.nix
@@ -19,8 +19,15 @@ stdenv.mkDerivation {
     propagatedBuildInputs = [ flex.hostDrv cracklib.hostDrv ];
     preConfigure = ''
       ar x ${flex.hostDrv}/lib/libfl.a
-      export LDFLAGS="$LDFLAGS $PWD/libyywrap.o"
+      mv libyywrap.o libyywrap-target.o
+      ar x ${flex}/lib/libfl.a
+      mv libyywrap.o libyywrap-host.o
+      export LDFLAGS="$LDFLAGS $PWD/libyywrap-target.o"
+      sed -e 's/@CC@/gcc/' -i doc/specs/Makefile.in
     '';
+    postConfigure = ''
+      sed -e "s@ $PWD/libyywrap-target.o@ $PWD/libyywrap-host.o@" -i doc/specs/Makefile
+    ''; 
   };
 
   postInstall = ''