File: fixcygwin

package info (click to toggle)
hmake 3.14-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 1,776 kB
  • ctags: 78
  • sloc: haskell: 3,630; sh: 1,254; makefile: 389; ansic: 19
file content (25 lines) | stat: -rwxr-xr-x 604 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/bin/sh
# fixcygwin:  a small script to patch up the hmake3.config script
#	for hmake-config built by GHC/mingw32, but being run under Cygwin.

case $# in
  0) ;;
  *) exit 1 ;;
esac

#cygpath () { echo c:$2 | tr '/' '\\'; }	# hack for testing on non-Cygwin
convert () { echo `cygpath -w $1` | tr '\\\\' '/'; }

hmakerc=`pwd`/lib/$MACHINE/hmakerc
cygrc=`convert $hmakerc`

nhc98=`pwd`/script/nhc98
cyg98=`convert $nhc98`

infile=targets/$MACHINE/hmake3.config
outfile=targets/$MACHINE/hmake3.cygwin

sed -e "s|$hmakerc|$cygrc|" $infile | sed -e "s|$nhc98|$cyg98|" >$outfile
mv $outfile $infile

exit 0