-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathconfigure
executable file
·167 lines (129 loc) · 3.29 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
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
#!/bin/sh
CC=gcc
AS=as
LD=ld
OBJCOPY=objcopy
STRIP=strip
# build info
WHO=$(whoami)
WHERE=$(hostname)
ARCH=$(uname -m)
OS=$(uname -o)
if test "${ARCH}" != "m68k" ; then
M68K_CROSS_COMPILE=${M68K_CROSS_COMPILE:-m68k-linux-}
if ! type "${M68K_CROSS_COMPILE}${CC}" > /dev/null 2>&1
then
M68K_CROSS_COMPILE=m68k-linux-gnu-
if ! type "${M68K_CROSS_COMPILE}${CC}" > /dev/null 2>&1
then
echo "Cannot find m68k cross-compiler" 1>&2
unset M68K_CROSS_COMPILE
fi
fi
fi
if test "${ARCH}" != "ppc" ; then
PPC_CROSS_COMPILE=${PPC_CROSS_COMPILE:-powerpc-linux-}
if ! type "${PPC_CROSS_COMPILE}${CC}" > /dev/null 2>&1
then
PPC_CROSS_COMPILE=powerpc-linux-gnu-
if ! type "${PPC_CROSS_COMPILE}${CC}" > /dev/null 2>&1
then
echo "Cannot find powerpc cross-compiler" 1>&2
unset PPC_CROSS_COMPILE
fi
fi
fi
exec 5> tools.mk.tmp
cat 1>&5 <<!EOF
# file generated by $0
WHEN = \$(shell LANG=C date)
WHO = ${WHO}
WHERE = ${WHERE}
ARCH = ${ARCH}
OS = ${OS}
SIGNATURE = \$(PACKAGE)-\$(VERSION) \$(WHO)@\$(WHERE)(\$(ARCH) \$(OS)) \$(WHEN)
M68K_CROSS_COMPILE = ${M68K_CROSS_COMPILE}
M68K_AS = \$(M68K_CROSS_COMPILE)${AS}
M68K_CC = \$(M68K_CROSS_COMPILE)${CC}
M68K_LD = \$(M68K_CROSS_COMPILE)${LD}
M68K_OBJCOPY = \$(M68K_CROSS_COMPILE)${OBJCOPY}
M68K_STRIP = \$(M68K_CROSS_COMPILE)${STRIP}
!EOF
if [ "${M68K_CROSS_COMPILE}" != "" ] ; then
M68K_GCC_VERSION=$(${M68K_CROSS_COMPILE}${CC} -dumpversion 2> /dev/null)
echo "cross-compiler is ${M68K_CROSS_COMPILE}${CC} ${M68K_GCC_VERSION}" 1>&2
fi
if [ "${PPC_CROSS_COMPILE}" != "" ] ; then
PPC_GCC_VERSION=$(${PPC_CROSS_COMPILE}${CC} -dumpversion 2> /dev/null)
echo "cross-compiler is ${PPC_CROSS_COMPILE}${CC} ${PPC_GCC_VERSION}" 1>&2
cat 1>&5 <<!EOF
PPC_CROSS_COMPILE = ${PPC_CROSS_COMPILE}
PPC_AS = \$(PPC_CROSS_COMPILE)${AS}
PPC_CC = \$(PPC_CROSS_COMPILE)${CC}
PPC_LD = \$(PPC_CROSS_COMPILE)${LD}
PPC_OBJCOPY = \$(PPC_CROSS_COMPILE)${OBJCOPY}
PPC_STRIP = \$(PPC_CROSS_COMPILE)${STRIP}
!EOF
fi
# target compiler
cat 1>&5 <<!EOF
ifeq (\$(TARGET),m68k-linux)
override AS = \$(M68K_AS)
override CC = \$(M68K_CC)
override LD = \$(M68K_LD)
override OBJCOPY = \$(M68K_OBJCOPY)
override STRIP = \$(M68K_STRIP)
else ifeq (\$(TARGET),m68k-netbsd)
override AS = \$(M68K_AS)
override CC = \$(M68K_CC)
override LD = \$(M68K_LD)
override OBJCOPY = \$(M68K_OBJCOPY)
override STRIP = \$(M68K_STRIP)
!EOF
if [ "${PPC_GCC_VERSION}" != "" ] ; then
cat 1>&5 <<!EOF
else ifeq (\$(TARGET),ppc-linux)
override AS = \$(M68K_AS)
override CC = \$(M68K_CC)
override LD = \$(M68K_LD)
override OBJCOPY = \$(M68K_OBJCOPY)
override STRIP = \$(M68K_STRIP)
!EOF
fi
cat 1>&5 <<!EOF
else
AS = \$(CROSS_COMPILE)${AS}
CC = \$(CROSS_COMPILE)${CC}
LD = \$(CROSS_COMPILE)${LD}
OBJCOPY = \$(CROSS_COMPILE)${OBJCOPY}
STRIP = \$(CROSS_COMPILE)${STRIP}
endif
!EOF
# docbook to man
if type docbook-to-man > /dev/null 2>&1
then
cat 1>&5 <<!EOF
%.5: %.sgml
docbook-to-man \$< > \$@
%.8: %.sgml
docbook-to-man \$< > \$@
!EOF
else
if type docbook2man > /dev/null 2>&1
then
cat 1>&5 <<!EOF
%.5: %.sgml
docbook2man \$< > \$@
%.8: %.sgml
docbook2man \$< > \$@
!EOF
else
cat 1>&5 <<!EOF
%.5: %.sgml
@echo "Missing tools to generate \$@ from \$<" >&2 && false
%.8: %.sgml
@echo "Missing tools to generate \$@ from \$<" >&2 && false
!EOF
fi
fi
mv tools.mk.tmp tools.mk