-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhsc2hs.in
41 lines (33 loc) · 942 Bytes
/
hsc2hs.in
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
HSC2HS_C="@SettingsCCompilerFlags@"
HSC2HS_L="@SettingsCCompilerLinkFlags@"
tflag="--template=$libdir/template-hsc.h"
Iflag="-I$includedir/include/"
for f in ${HSC2HS_C}; do
cflags="${cflags} --cflag=$f"
done
for f in ${HSC2HS_L}; do
lflags="${lflags} --lflag=$f"
done
HSC2HS_EXTRA="$cflags $lflags"
read_response() {
response_file=$1
if [ -f "$response_file" ]; then
while read -r arg; do
case "$arg" in
-t*) tflag=;;
--template=*) tflag=;;
@*) read_response "${arg#"@"}" ;;
--) break;;
esac
done < "$response_file"
fi
}
for arg do
case "$arg" in
-t*) tflag=;;
--template=*) tflag=;;
@*) read_response "${arg#"@"}" ;;
--) break;;
esac
done
exec "$executablename" ${tflag:+"$tflag"} $HSC2HS_EXTRA ${1+"$@"} "$Iflag"