Skip to content
Snippets Groups Projects
Commit d56abb94 authored by Isaac Potoczny-Jones's avatar Isaac Potoczny-Jones
Browse files

cvs commit from ross

  installHugs: quote the script name to protect spaces, and create .bat
  files for executables under Windows.
parent 97b5183c
No related branches found
No related tags found
No related merge requests found
...@@ -185,19 +185,23 @@ installHugs verbose libPref binPref targetLibPref buildPref pkg_descr = do ...@@ -185,19 +185,23 @@ installHugs verbose libPref binPref targetLibPref buildPref pkg_descr = do
try $ removeDirectoryRecursive installDir try $ removeDirectoryRecursive installDir
smartCopySources verbose [buildDir] installDir smartCopySources verbose [buildDir] installDir
("Main" : otherModules (buildInfo exe)) hugsInstallSuffixes True ("Main" : otherModules (buildInfo exe)) hugsInstallSuffixes True
#if !(mingw32_HOST_OS || mingw32_TARGET_OS) let targetName = "\"" ++ (targetDir `joinFileName` hugsMainFilename exe) ++ "\""
-- FIX (HUGS): works for Unix only
let targetName = targetDir `joinFileName` hugsMainFilename exe
let exeFile = binPref `joinFileName` exeName exe
-- FIX (HUGS): use extensions, and options from file too? -- FIX (HUGS): use extensions, and options from file too?
let hugsOptions = hcOptions Hugs (options (buildInfo exe)) let hugsOptions = hcOptions Hugs (options (buildInfo exe))
#if mingw32_HOST_OS || mingw32_TARGET_OS
let exeFile = binPref `joinFileName` exeName exe `joinFileExt` "bat"
let script = unlines [ let script = unlines [
"#! /bin/sh", "@echo off",
unwords ("runhugs" : hugsOptions ++ [targetName, "%*"])]
#else
let exeFile = binPref `joinFileName` exeName exe
let script = unlines [
"#! /bin/sh",
unwords ("runhugs" : hugsOptions ++ [targetName, "\"$@\""])] unwords ("runhugs" : hugsOptions ++ [targetName, "\"$@\""])]
#endif
writeFile exeFile script writeFile exeFile script
perms <- getPermissions exeFile perms <- getPermissions exeFile
setPermissions exeFile perms { executable = True, readable = True } setPermissions exeFile perms { executable = True, readable = True }
#endif
hugsInstallSuffixes :: [String] hugsInstallSuffixes :: [String]
hugsInstallSuffixes = ["hs", "lhs", dllExtension] hugsInstallSuffixes = ["hs", "lhs", dllExtension]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment