-
Notifications
You must be signed in to change notification settings - Fork 113
/
configure
executable file
·55 lines (47 loc) · 1.02 KB
/
configure
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
#!/bin/sh
TARGET=""
OS=""
IMG=""
target()
{
TARGET="$1"
test -n "$2" && OS="$2"
test -n "$3" && IMG="$3"
}
process()
{
case "$1" in
--target=c) target c;;
--target=x86-linux*) target x86 linux elf;;
--target=x86-windows) target x86 windows pe;;
--target=m68k-tos) target m68k tos gemdos;;
--prefix) ;;
*) echo Unknown argument: $1; exit 1;;
esac
}
host_is_target()
{
case `uname -m` in
c) TARGET=c ;;
i?86*|x86*) TARGET=x86 ;;
m68*) TARGET=m86k ;;
arm*) TARGET=arm ;;
*) echo "Unsupported machine; using the C target"; TARGET=c ;;
esac
case `uname -s` in
Linux) OS=linux; IMG=elf ;;
CYGWIN*) OS=windows; IMG=pe ;;
*MiNT|*mint|*TOS) OS=tos; IMG=gemdos ;;
Darwin) OS=osx ;; #IMG=macho
*) echo "Unsupported operating system" ;;
esac
}
while test -n "$1"; do
process "$1"
shift
done
test -z "$TARGET" && host_is_target
rm -f conf.mk
echo TARGET="$TARGET" >> conf.mk
test -n "$OS" && echo OS="$OS" >> conf.mk
test -n "$IMG" && echo IMG="$IMG" >> conf.mk