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 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182
|
#!/bin/sh
# fixghc: a small script to patch up the -syslib changes between
# versions 4.04, 4.06, 4.08, and 5.xx of ghc.
case $# in
0) exit 1;;
esac
ghcversion=$1
shift
# We need a working `echo' command: Solaris2.6 and HP/UX may not have it.
case `echo -n hello | wc -c | ( read n ; echo $n )` in
5) echon () { echo -n "$@"; } ;;
*) LOCAL=${LOCAL-`dirname $0`}
if [ -x $LOCAL/echo ]
then echon () { $LOCAL/echo -n "$@"; }
else echon () { echo "$@"; }
fi ;;
esac
# Versions of ghc > 6.0 need a hack to make the version number larger.
if [ $ghcversion -le 100 ]
then
ghcversion=${ghcversion}0
fi
# We permit arguments to arrive in any format (4.04, 4.06, 4.08, 5.00, 5.04),
# and translate to the format specified by the first arg.
if [ $ghcversion -le 405 ]
then
while test "'$1'" != "''"
do
case $1 in
-syslib|-package) shift
case $1 in
lang) echon " -syslib exts";;
text) echon " -syslib misc";;
base) ;;
*) echon " -syslib $1" ;;
esac ;;
*) echon " $1" ;;
esac
shift
done
echo
exit 0
fi
if [ $ghcversion -gt 405 -a $ghcversion -lt 408 ]
then
while test "'$1'" != "''"
do
case $1 in
-syslib|-package) shift
case $1 in
exts) echon " -syslib lang";;
misc) ;;
base) ;;
packedstring) ;;
directory) ;;
containers) ;;
*) echon " -syslib $1" ;;
esac ;;
*) echon " $1" ;;
esac
shift
done
echo
exit 0
fi
if [ $ghcversion -ge 408 -a $ghcversion -lt 504 ]
then
while test "'$1'" != "''"
do
case $1 in
-syslib) shift
case $1 in
exts) echon " -package lang";;
misc) ;;
base) ;;
*) echon " -package $1" ;;
esac ;;
-package) shift
case $1 in
base) ;;
haskell98) ;;
readline) ;;
packedstring) ;;
directory) ;;
process) ;;
containers) ;;
*) echon " -package $1" ;;
esac ;;
*) echon " $1" ;;
esac
shift
done
echo
exit 0
fi
if [ $ghcversion -ge 504 -a $ghcversion -lt 605 ]
then
while test "'$1'" != "''"
do
case $1 in
-syslib) shift
case $1 in
exts) echon " -package lang";;
misc) ;;
*) echon " -package $1" ;;
esac ;;
-package) shift
case $1 in
readline) ;;
packedstring) ;;
directory) ;;
process) ;;
containers) ;;
*) echon " -package $1" ;;
esac ;;
*) echon " $1" ;;
esac
shift
done
echo
exit 0
fi
if [ $ghcversion -ge 605 -a $ghcversion -lt 607 ]
then
while test "'$1'" != "''"
do
case $1 in
-syslib|-package) shift
case $1 in
exts) ;;
misc) ;;
util) ;;
lang) ;;
text) ;;
packedstring) ;;
directory) ;;
process) ;;
containers) ;;
*) echon " -package $1" ;;
esac ;;
*) echon " $1" ;;
esac
shift
done
echo
exit 0
fi
if [ $ghcversion -ge 607 ]
then
while test "'$1'" != "''"
do
case $1 in
-syslib|-package) shift
case $1 in
exts) ;;
misc) ;;
util) ;;
lang) ;;
text) ;;
*) echon " -package $1" ;;
esac ;;
*) echon " $1" ;;
esac
shift
done
echo
exit 0
fi
# stand-by default case
echo "$@"
exit 0
|