From: rrt Date: Tue, 8 May 2001 14:54:58 +0000 (+0000) Subject: [project @ 2001-05-08 14:54:58 by rrt] X-Git-Tag: Approximately_9120_patches~1974 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=8162c20d42283c360308a46374b9307b3530ec08;p=ghc-hetmet.git [project @ 2001-05-08 14:54:58 by rrt] fixdll.pl renamed decyg.pl, for greater justice. runexe.c added: it's a little Windows program which takes a command line and runs it, without any connection to the parent process. This allows cygwin binaries to be run against our patched cygwin1.dll (under a pseudonym), without any connection being made if the parent process is also Cygwinised. --- diff --git a/ghc/InstallShield/decyg.pl b/ghc/InstallShield/decyg.pl new file mode 100644 index 0000000..7bcfd7e --- /dev/null +++ b/ghc/InstallShield/decyg.pl @@ -0,0 +1,21 @@ +#!/usr/bin/perl +# Patch a DLL or EXE to change the name of the Cygwin DLL it uses or is, so that we can +# include our own Cygwin DLL that doesn't interfere with the rest of the system, for great justice + +@ARGV = ('-') unless @ARGV; +@FILES = @ARGV; +while ($ARGV = shift) { + $out = $ARGV . ".new"; + open(IN, $ARGV) or warn "Can't open $ARGV: $!\n"; + open(OUT, ">$out") or warn "Can't open $out: $!\n"; + binmode IN; + while () { + s/cygwin1/aybabtu/g; + s/c\000y\000g\000w\000i\000n\0001/a\000y\000b\000a\000b\000t\000u/g; + print OUT; + } + close IN; + close OUT; + unlink $ARGV; + rename $out, $ARGV; +} diff --git a/ghc/InstallShield/fixdll.pl b/ghc/InstallShield/fixdll.pl deleted file mode 100644 index 1d3449d..0000000 --- a/ghc/InstallShield/fixdll.pl +++ /dev/null @@ -1,8 +0,0 @@ -#!/usr/bin/perl -i.bak -# Patch the cygwin dll to make a non-clashing version, for great justice - -while (<>) { - s/cygwin1/aybabtu/g; - s/c\000y\000g\000w\000i\000n\0001/a\000y\000b\000a\000b\000t\000u/g; - print; -} diff --git a/ghc/InstallShield/runexe.c b/ghc/InstallShield/runexe.c new file mode 100644 index 0000000..c01f0b1 --- /dev/null +++ b/ghc/InstallShield/runexe.c @@ -0,0 +1,24 @@ +#include + +const char *prog = "runexe"; + +int APIENTRY WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdParam, int nCmdShow) +{ + STARTUPINFO sInfo; + PROCESS_INFORMATION pInfo; + + sInfo.cb = sizeof(STARTUPINFO); + sInfo.lpReserved = NULL; + sInfo.lpReserved2 = NULL; + sInfo.cbReserved2 = 0; + sInfo.lpDesktop = NULL; + sInfo.lpTitle = NULL; + sInfo.dwFlags = 0; + + if (strlen(lpszCmdParam) == 0) { + printf("%s: no parameters given\n", prog); + exit(1); + } + CreateProcess(NULL, lpszCmdParam, NULL, NULL, FALSE, 0, NULL, NULL, &sInfo, &pInfo); + return 0; +}