Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
jberryman
GHC
Commits
6e3f9759
Commit
6e3f9759
authored
Jan 17, 2002
by
sof
Browse files
[project @ 2002-01-17 08:37:57 by sof]
- removed KludgedSystem; no longer needed. - be path separator savvy.
parent
4e31cae2
Changes
3
Hide whitespace changes
Inline
Side-by-side
ghc/utils/hsc2hs/KludgedSystem.hs
deleted
100644 → 0
View file @
4e31cae2
{-# OPTIONS -cpp -fglasgow-exts #-}
-----------------------------------------------------------------------------
-- $Id: KludgedSystem.hs,v 1.8 2001/07/04 09:18:38 sewardj Exp $
-- system that works feasibly under Windows (i.e. passes the command line to sh,
-- because system() under Windows doesn't look at SHELL, and always uses CMD.EXE)
module
KludgedSystem
(
system
,
defaultCompiler
,
progNameSuffix
)
where
#
include
"../../includes/config.h"
import
Config
#
ifndef
mingw32_TARGET_OS
import
System
(
system
)
defaultCompiler
::
String
defaultCompiler
=
cGCC
progNameSuffix
=
""
#
else
import
qualified
System
import
System
(
ExitCode
)
import
IO
(
bracket_
)
import
Directory
(
removeFile
)
system
::
String
->
IO
ExitCode
system
cmd
=
do
pid
<-
getProcessID
let
tmp
=
cDEFAULT_TMPDIR
++
"/sh"
++
show
pid
writeFile
tmp
(
cmd
++
"
\n
"
)
bracket_
(
return
tmp
)
removeFile
$
System
.
system
(
"sh - "
++
tmp
)
foreign
import
"_getpid"
unsafe
getProcessID
::
IO
Int
defaultCompiler
::
String
defaultCompiler
=
cGCC
++
" -mno-cygwin"
progNameSuffix
=
".exe"
#
endif
/*
mingw32_TARGET_OS
*/
ghc/utils/hsc2hs/Main.hs
View file @
6e3f9759
------------------------------------------------------------------------
-- $Id: Main.hs,v 1.3
4
200
1
/0
9
/1
2 11:52:58 rrt
Exp $
-- $Id: Main.hs,v 1.3
5
200
2
/0
1
/1
7 08:37:57 sof
Exp $
--
-- Program for converting .hsc files to .hs files, by converting the
-- file into a C program which is run to generate the Haskell source.
...
...
@@ -10,8 +10,8 @@
-- See the documentation in the Users' Guide for more details.
import
GetOpt
import
System
(
getProgName
,
getArgs
,
ExitCode
(
..
),
exitWith
,
exitFailure
)
import
KludgedS
ystem
import
Config
import
System
(
getProgName
,
getArgs
,
ExitCode
(
..
),
exitWith
,
exitFailure
,
s
ystem
)
import
Directory
(
removeFile
)
import
Monad
(
MonadPlus
(
..
),
liftM
,
liftM2
,
when
,
unless
)
import
Char
(
isAlpha
,
isAlphaNum
,
isSpace
,
isDigit
,
toUpper
,
intToDigit
,
ord
)
...
...
@@ -449,7 +449,7 @@ output flags name toks = do
outCName
=
outDir
++
outBase
++
"_hsc.c"
let
execProgName
|
null
outDir
=
"./"
++
progName
|
null
outDir
=
'.'
:
pathSep
:
progName
|
otherwise
=
progName
let
specials
=
[(
pos
,
key
,
arg
)
|
Special
pos
key
arg
<-
toks
]
...
...
@@ -468,7 +468,7 @@ output flags name toks = do
_
->
onlyOne
"compiler"
linker
<-
case
[
l
|
Linker
l
<-
flags
]
of
[]
->
return
defaultCompiler
[]
->
return
cGCC
[
l
]
->
return
l
_
->
onlyOne
"linker"
...
...
ghc/utils/hsc2hs/Makefile
View file @
6e3f9759
# -----------------------------------------------------------------------------
# $Id: Makefile,v 1.2
7
2001/1
2/26 23:0
8:0
7
sof Exp $
# $Id: Makefile,v 1.2
8
20
02/
01/1
7 08:3
8:0
0
sof Exp $
TOP
=
../..
include
$(TOP)/mk/boilerplate.mk
...
...
@@ -86,6 +86,12 @@ $(CONFIG_HS) : $(FPTOOLS_TOP)/mk/config.mk Makefile
@
echo
"module Config where"
>>
$(CONFIG_HS)
@
echo
"cDEFAULT_TMPDIR =
\"
$(DEFAULT_TMPDIR)
\"
"
>>
$(CONFIG_HS)
@
echo
"cGCC =
\"
$(WhatGccIsCalled)
\"
"
>>
$(CONFIG_HS)
@
echo
"progNameSuffix =
\"
$(exeext)
\"
"
>>
$(CONFIG_HS)
ifneq
"$(TARGETPLATFORM)" "i386-unknown-mingw32"
@
echo
"pathSep = '/'"
>>
$(CONFIG_HS)
else
@
echo
"pathSep = '
\\\\\\
'"
>>
$(CONFIG_HS)
endif
@
echo
done
.
CLEAN_FILES
+=
$(CONFIG_HS)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment