root / configure @ 97eb5b14
History | View | Annotate | Download (10.8 kB)
1 | 7d13299d | bellard | #!/bin/sh |
---|---|---|---|
2 | 7d13299d | bellard | # |
3 | 3ef693a0 | bellard | # qemu configure script (c) 2003 Fabrice Bellard |
4 | 7d13299d | bellard | # |
5 | 7d13299d | bellard | # set temporary file name |
6 | 7d13299d | bellard | if test ! -z "$TMPDIR" ; then |
7 | 7d13299d | bellard | TMPDIR1="${TMPDIR}" |
8 | 7d13299d | bellard | elif test ! -z "$TEMPDIR" ; then |
9 | 7d13299d | bellard | TMPDIR1="${TEMPDIR}" |
10 | 7d13299d | bellard | else |
11 | 7d13299d | bellard | TMPDIR1="/tmp" |
12 | 7d13299d | bellard | fi |
13 | 7d13299d | bellard | |
14 | 3ef693a0 | bellard | TMPC="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.c" |
15 | 3ef693a0 | bellard | TMPO="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.o" |
16 | 3ef693a0 | bellard | TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}" |
17 | 3ef693a0 | bellard | TMPS="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.S" |
18 | 7d13299d | bellard | |
19 | 7d13299d | bellard | # default parameters |
20 | 7d13299d | bellard | prefix="/usr/local" |
21 | 1e43adfc | bellard | interp_prefix="/usr/gnemul/qemu-%M" |
22 | 43ce4dfe | bellard | static="no" |
23 | 7d13299d | bellard | cross_prefix="" |
24 | 7d13299d | bellard | cc="gcc" |
25 | 7d13299d | bellard | host_cc="gcc" |
26 | 7d13299d | bellard | ar="ar" |
27 | 7d13299d | bellard | make="make" |
28 | 7d13299d | bellard | strip="strip" |
29 | 7d13299d | bellard | cpu=`uname -m` |
30 | 67867308 | bellard | target_list="i386-user i386 i386-softmmu arm-user sparc-user ppc-user" |
31 | 7d13299d | bellard | case "$cpu" in |
32 | 7d13299d | bellard | i386|i486|i586|i686|i86pc|BePC) |
33 | 97a847bc | bellard | cpu="i386" |
34 | 7d13299d | bellard | ;; |
35 | 7d13299d | bellard | armv4l) |
36 | 7d13299d | bellard | cpu="armv4l" |
37 | 7d13299d | bellard | ;; |
38 | 7d13299d | bellard | alpha) |
39 | 7d13299d | bellard | cpu="alpha" |
40 | 7d13299d | bellard | ;; |
41 | 295defa5 | bellard | "Power Macintosh"|ppc|ppc64) |
42 | 7d13299d | bellard | cpu="powerpc" |
43 | 7d13299d | bellard | ;; |
44 | 7d13299d | bellard | mips) |
45 | 7d13299d | bellard | cpu="mips" |
46 | 7d13299d | bellard | ;; |
47 | fb3e5849 | bellard | s390) |
48 | fb3e5849 | bellard | cpu="s390" |
49 | fb3e5849 | bellard | ;; |
50 | ae228531 | bellard | sparc) |
51 | ae228531 | bellard | cpu="sparc" |
52 | ae228531 | bellard | ;; |
53 | ae228531 | bellard | sparc64) |
54 | ae228531 | bellard | cpu="sparc64" |
55 | ae228531 | bellard | ;; |
56 | a8baa8c5 | bellard | ia64) |
57 | a8baa8c5 | bellard | cpu="ia64" |
58 | a8baa8c5 | bellard | ;; |
59 | 38e584a0 | bellard | m68k) |
60 | 38e584a0 | bellard | cpu="m68k" |
61 | 38e584a0 | bellard | ;; |
62 | 7d13299d | bellard | *) |
63 | 7d13299d | bellard | cpu="unknown" |
64 | 7d13299d | bellard | ;; |
65 | 7d13299d | bellard | esac |
66 | 7d13299d | bellard | gprof="no" |
67 | 7d13299d | bellard | bigendian="no" |
68 | 7d13299d | bellard | |
69 | 7d13299d | bellard | # OS specific |
70 | 7d13299d | bellard | targetos=`uname -s` |
71 | 7d13299d | bellard | case $targetos in |
72 | 7d13299d | bellard | *) ;; |
73 | 7d13299d | bellard | esac |
74 | 7d13299d | bellard | |
75 | 97a847bc | bellard | ########################################## |
76 | 97a847bc | bellard | # SDL probe |
77 | 97a847bc | bellard | |
78 | 97a847bc | bellard | cat > $TMPC << EOF |
79 | 97a847bc | bellard | #include <SDL.h> |
80 | 97a847bc | bellard | #undef main /* We don't want SDL to override our main() */ |
81 | 97a847bc | bellard | int main( void ) { return SDL_Init (SDL_INIT_VIDEO); } |
82 | 97a847bc | bellard | EOF |
83 | 97a847bc | bellard | |
84 | 97a847bc | bellard | sdl_too_old=no |
85 | 97a847bc | bellard | sdl=no |
86 | 97a847bc | bellard | if $cc -o $TMPE `sdl-config --cflags` $TMPC `sdl-config --libs` 2> /dev/null ; then |
87 | 97a847bc | bellard | _sdlversion=`sdl-config --version | sed 's/[^0-9]//g'` |
88 | 97a847bc | bellard | if test "$_sdlversion" -lt 121 ; then |
89 | 97a847bc | bellard | sdl_too_old=yes |
90 | 97a847bc | bellard | else |
91 | 97a847bc | bellard | sdl=yes |
92 | 97a847bc | bellard | fi |
93 | 97a847bc | bellard | fi |
94 | 97a847bc | bellard | |
95 | 7d13299d | bellard | # find source path |
96 | 7d13299d | bellard | # XXX: we assume an absolute path is given when launching configure, |
97 | 7d13299d | bellard | # except in './configure' case. |
98 | 7d13299d | bellard | source_path=${0%configure} |
99 | 7d13299d | bellard | source_path=${source_path%/} |
100 | 7d13299d | bellard | source_path_used="yes" |
101 | 7d13299d | bellard | if test -z "$source_path" -o "$source_path" = "." ; then |
102 | 7d13299d | bellard | source_path=`pwd` |
103 | 7d13299d | bellard | source_path_used="no" |
104 | 7d13299d | bellard | fi |
105 | 7d13299d | bellard | |
106 | 7d13299d | bellard | for opt do |
107 | 7d13299d | bellard | case "$opt" in |
108 | 7d13299d | bellard | --prefix=*) prefix=`echo $opt | cut -d '=' -f 2` |
109 | 7d13299d | bellard | ;; |
110 | 32ce6337 | bellard | --interp-prefix=*) interp_prefix=`echo $opt | cut -d '=' -f 2` |
111 | 32ce6337 | bellard | ;; |
112 | 7d13299d | bellard | --source-path=*) source_path=`echo $opt | cut -d '=' -f 2` |
113 | 7d13299d | bellard | ;; |
114 | 7d13299d | bellard | --cross-prefix=*) cross_prefix=`echo $opt | cut -d '=' -f 2` |
115 | 7d13299d | bellard | ;; |
116 | 7d13299d | bellard | --cc=*) cc=`echo $opt | cut -d '=' -f 2` |
117 | 7d13299d | bellard | ;; |
118 | 7d13299d | bellard | --make=*) make=`echo $opt | cut -d '=' -f 2` |
119 | 7d13299d | bellard | ;; |
120 | 7d13299d | bellard | --extra-cflags=*) CFLAGS="${opt#--extra-cflags=}" |
121 | 7d13299d | bellard | ;; |
122 | 7d13299d | bellard | --extra-ldflags=*) LDFLAGS="${opt#--extra-ldflags=}" |
123 | 7d13299d | bellard | ;; |
124 | 7d13299d | bellard | --extra-libs=*) extralibs=${opt#--extra-libs=} |
125 | 7d13299d | bellard | ;; |
126 | 7d13299d | bellard | --cpu=*) cpu=`echo $opt | cut -d '=' -f 2` |
127 | 7d13299d | bellard | ;; |
128 | 97a847bc | bellard | --target-list=*) target_list=${opt#--target-list=} |
129 | de83cd02 | bellard | ;; |
130 | 7d13299d | bellard | --enable-gprof) gprof="yes" |
131 | 7d13299d | bellard | ;; |
132 | 43ce4dfe | bellard | --static) static="yes" |
133 | 43ce4dfe | bellard | ;; |
134 | 97a847bc | bellard | --disable-sdl) sdl="no" |
135 | 97a847bc | bellard | ;; |
136 | 7d13299d | bellard | esac |
137 | 7d13299d | bellard | done |
138 | 7d13299d | bellard | |
139 | 7d13299d | bellard | # Checking for CFLAGS |
140 | 7d13299d | bellard | if test -z "$CFLAGS"; then |
141 | 7d13299d | bellard | CFLAGS="-O2" |
142 | 7d13299d | bellard | fi |
143 | 7d13299d | bellard | |
144 | 7d13299d | bellard | cc="${cross_prefix}${cc}" |
145 | 7d13299d | bellard | ar="${cross_prefix}${ar}" |
146 | 7d13299d | bellard | strip="${cross_prefix}${strip}" |
147 | 7d13299d | bellard | |
148 | 7d13299d | bellard | if test -z "$cross_prefix" ; then |
149 | 7d13299d | bellard | |
150 | 7d13299d | bellard | # --- |
151 | 7d13299d | bellard | # big/little endian test |
152 | 7d13299d | bellard | cat > $TMPC << EOF |
153 | 7d13299d | bellard | #include <inttypes.h> |
154 | 7d13299d | bellard | int main(int argc, char ** argv){ |
155 | 7d13299d | bellard | volatile uint32_t i=0x01234567; |
156 | 7d13299d | bellard | return (*((uint8_t*)(&i))) == 0x67; |
157 | 7d13299d | bellard | } |
158 | 7d13299d | bellard | EOF |
159 | 7d13299d | bellard | |
160 | 7d13299d | bellard | if $cc -o $TMPE $TMPC 2>/dev/null ; then |
161 | 7d13299d | bellard | $TMPE && bigendian="yes" |
162 | 7d13299d | bellard | else |
163 | 7d13299d | bellard | echo big/little test failed |
164 | 7d13299d | bellard | fi |
165 | 7d13299d | bellard | |
166 | 7d13299d | bellard | else |
167 | 7d13299d | bellard | |
168 | 7d13299d | bellard | # if cross compiling, cannot launch a program, so make a static guess |
169 | 38e584a0 | bellard | if test "$cpu" = "powerpc" -o "$cpu" = "mips" -o "$cpu" = "s390" -o "$cpu" = "sparc" -o "$cpu" = "sparc64" -o "$cpu" = "m68k"; then |
170 | 7d13299d | bellard | bigendian="yes" |
171 | 7d13299d | bellard | fi |
172 | 7d13299d | bellard | |
173 | 7d13299d | bellard | fi |
174 | 7d13299d | bellard | |
175 | e8cd23de | bellard | # check gcc options support |
176 | 04369ff2 | bellard | cat > $TMPC <<EOF |
177 | 04369ff2 | bellard | int main(void) { |
178 | 04369ff2 | bellard | } |
179 | 04369ff2 | bellard | EOF |
180 | 04369ff2 | bellard | |
181 | e8cd23de | bellard | have_gcc3_options="no" |
182 | e8cd23de | bellard | if $cc -fno-reorder-blocks -fno-optimize-sibling-calls -o $TMPO $TMPC 2> /dev/null ; then |
183 | e8cd23de | bellard | have_gcc3_options="yes" |
184 | 04369ff2 | bellard | fi |
185 | ca735206 | bellard | |
186 | 7d13299d | bellard | if test x"$1" = x"-h" -o x"$1" = x"--help" ; then |
187 | 7d13299d | bellard | cat << EOF |
188 | 7d13299d | bellard | |
189 | 7d13299d | bellard | Usage: configure [options] |
190 | 7d13299d | bellard | Options: [defaults in brackets after descriptions] |
191 | 7d13299d | bellard | |
192 | 7d13299d | bellard | EOF |
193 | 7d13299d | bellard | echo "Standard options:" |
194 | 7d13299d | bellard | echo " --help print this message" |
195 | 7d13299d | bellard | echo " --prefix=PREFIX install in PREFIX [$prefix]" |
196 | 1e43adfc | bellard | echo " --interp-prefix=PREFIX where to find shared libraries, etc." |
197 | 1e43adfc | bellard | echo " use %M for cpu name [$interp_prefix]" |
198 | 97a847bc | bellard | echo " --target-list=LIST set target list [$target_list]" |
199 | 7d13299d | bellard | echo "" |
200 | 7d13299d | bellard | echo "Advanced options (experts only):" |
201 | 7d13299d | bellard | echo " --source-path=PATH path of source code [$source_path]" |
202 | 7d13299d | bellard | echo " --cross-prefix=PREFIX use PREFIX for compile tools [$cross_prefix]" |
203 | 7d13299d | bellard | echo " --cc=CC use C compiler CC [$cc]" |
204 | 7d13299d | bellard | echo " --make=MAKE use specified make [$make]" |
205 | 43ce4dfe | bellard | echo " --static enable static build [$static]" |
206 | 7d13299d | bellard | echo "" |
207 | 7d13299d | bellard | echo "NOTE: The object files are build at the place where configure is launched" |
208 | 7d13299d | bellard | exit 1 |
209 | 7d13299d | bellard | fi |
210 | 7d13299d | bellard | |
211 | 5a67135a | bellard | mandir="$prefix/share/man" |
212 | 5a67135a | bellard | sharedir="$prefix/share/qemu" |
213 | 5a67135a | bellard | |
214 | 43ce4dfe | bellard | echo "Install prefix $prefix" |
215 | 5a67135a | bellard | echo "Manual directory $mandir" |
216 | 5a67135a | bellard | echo "BIOS directory $sharedir" |
217 | 43ce4dfe | bellard | echo "ELF interp prefix $interp_prefix" |
218 | 5a67135a | bellard | echo "Source path $source_path" |
219 | 43ce4dfe | bellard | echo "C compiler $cc" |
220 | 43ce4dfe | bellard | echo "make $make" |
221 | 43ce4dfe | bellard | echo "host CPU $cpu" |
222 | de83cd02 | bellard | echo "host big endian $bigendian" |
223 | 97a847bc | bellard | echo "target list $target_list" |
224 | 43ce4dfe | bellard | echo "gprof enabled $gprof" |
225 | 43ce4dfe | bellard | echo "static build $static" |
226 | 97a847bc | bellard | echo "SDL support $sdl" |
227 | 97a847bc | bellard | if test $sdl_too_old = "yes"; then |
228 | 97a847bc | bellard | echo "-> Your SDL version is too old - please upgrade to have FFplay/SDL support" |
229 | 97a847bc | bellard | fi |
230 | 97a847bc | bellard | |
231 | 97a847bc | bellard | config_mak="config-host.mak" |
232 | 97a847bc | bellard | config_h="config-host.h" |
233 | 7d13299d | bellard | |
234 | 97a847bc | bellard | echo "Creating $config_mak and $config_h" |
235 | 7d13299d | bellard | |
236 | 97a847bc | bellard | echo "# Automatically generated by configure - do not modify" > $config_mak |
237 | 97a847bc | bellard | echo "/* Automatically generated by configure - do not modify */" > $config_h |
238 | 7d13299d | bellard | |
239 | 97a847bc | bellard | echo "prefix=$prefix" >> $config_mak |
240 | 5a67135a | bellard | echo "mandir=$mandir" >> $config_mak |
241 | 5a67135a | bellard | echo "sharedir=$sharedir" >> $config_mak |
242 | 5a67135a | bellard | echo "#define CONFIG_QEMU_SHAREDIR \"$sharedir\"" >> $config_h |
243 | 97a847bc | bellard | echo "MAKE=$make" >> $config_mak |
244 | 97a847bc | bellard | echo "CC=$cc" >> $config_mak |
245 | e8cd23de | bellard | if test "$have_gcc3_options" = "yes" ; then |
246 | 97a847bc | bellard | echo "HAVE_GCC3_OPTIONS=yes" >> $config_mak |
247 | e8cd23de | bellard | fi |
248 | 97a847bc | bellard | echo "HOST_CC=$host_cc" >> $config_mak |
249 | 97a847bc | bellard | echo "AR=$ar" >> $config_mak |
250 | 97a847bc | bellard | echo "STRIP=$strip -s -R .comment -R .note" >> $config_mak |
251 | 97a847bc | bellard | echo "CFLAGS=$CFLAGS" >> $config_mak |
252 | 97a847bc | bellard | echo "LDFLAGS=$LDFLAGS" >> $config_mak |
253 | 97a847bc | bellard | if test "$cpu" = "i386" ; then |
254 | 97a847bc | bellard | echo "ARCH=i386" >> $config_mak |
255 | 97a847bc | bellard | echo "#define HOST_I386 1" >> $config_h |
256 | 7d13299d | bellard | elif test "$cpu" = "armv4l" ; then |
257 | 97a847bc | bellard | echo "ARCH=arm" >> $config_mak |
258 | 97a847bc | bellard | echo "#define HOST_ARM 1" >> $config_h |
259 | 7d13299d | bellard | elif test "$cpu" = "powerpc" ; then |
260 | 97a847bc | bellard | echo "ARCH=ppc" >> $config_mak |
261 | 97a847bc | bellard | echo "#define HOST_PPC 1" >> $config_h |
262 | 7d13299d | bellard | elif test "$cpu" = "mips" ; then |
263 | 97a847bc | bellard | echo "ARCH=mips" >> $config_mak |
264 | 97a847bc | bellard | echo "#define HOST_MIPS 1" >> $config_h |
265 | fb3e5849 | bellard | elif test "$cpu" = "s390" ; then |
266 | 97a847bc | bellard | echo "ARCH=s390" >> $config_mak |
267 | 97a847bc | bellard | echo "#define HOST_S390 1" >> $config_h |
268 | 295defa5 | bellard | elif test "$cpu" = "alpha" ; then |
269 | 97a847bc | bellard | echo "ARCH=alpha" >> $config_mak |
270 | 97a847bc | bellard | echo "#define HOST_ALPHA 1" >> $config_h |
271 | ae228531 | bellard | elif test "$cpu" = "sparc" ; then |
272 | 97a847bc | bellard | echo "ARCH=sparc" >> $config_mak |
273 | 97a847bc | bellard | echo "#define HOST_SPARC 1" >> $config_h |
274 | ae228531 | bellard | elif test "$cpu" = "sparc64" ; then |
275 | 97a847bc | bellard | echo "ARCH=sparc64" >> $config_mak |
276 | 97a847bc | bellard | echo "#define HOST_SPARC64 1" >> $config_h |
277 | a8baa8c5 | bellard | elif test "$cpu" = "ia64" ; then |
278 | 97a847bc | bellard | echo "ARCH=ia64" >> $config_mak |
279 | 97a847bc | bellard | echo "#define HOST_IA64 1" >> $config_h |
280 | 38e584a0 | bellard | elif test "$cpu" = "m68k" ; then |
281 | 38e584a0 | bellard | echo "ARCH=m68k" >> config.mak |
282 | 38e584a0 | bellard | echo "#define HOST_M68K 1" >> $TMPH |
283 | 7d13299d | bellard | else |
284 | 7d13299d | bellard | echo "Unsupported CPU" |
285 | 7d13299d | bellard | exit 1 |
286 | 7d13299d | bellard | fi |
287 | 7d13299d | bellard | if test "$bigendian" = "yes" ; then |
288 | 97a847bc | bellard | echo "WORDS_BIGENDIAN=yes" >> $config_mak |
289 | 97a847bc | bellard | echo "#define WORDS_BIGENDIAN 1" >> $config_h |
290 | 97a847bc | bellard | fi |
291 | 97a847bc | bellard | echo "#define HAVE_BYTESWAP_H 1" >> $config_h |
292 | 97a847bc | bellard | if test "$gprof" = "yes" ; then |
293 | 97a847bc | bellard | echo "TARGET_GPROF=yes" >> $config_mak |
294 | 97a847bc | bellard | echo "#define HAVE_GPROF 1" >> $config_h |
295 | 97a847bc | bellard | fi |
296 | 97a847bc | bellard | if test "$static" = "yes" ; then |
297 | 97a847bc | bellard | echo "CONFIG_STATIC=yes" >> $config_mak |
298 | 50863472 | bellard | echo "#define CONFIG_STATIC 1" >> $config_h |
299 | 7d13299d | bellard | fi |
300 | 97a847bc | bellard | if test "$sdl" = "yes" ; then |
301 | 97a847bc | bellard | echo "CONFIG_SDL=yes" >> $config_mak |
302 | 97a847bc | bellard | echo "#define CONFIG_SDL 1" >> $config_h |
303 | 97a847bc | bellard | echo "SDL_LIBS=`sdl-config --libs`" >> $config_mak |
304 | 590b7eed | bellard | aa="no" |
305 | 590b7eed | bellard | `sdl-config --static-libs | grep \\\-laa > /dev/null` && aa="yes" |
306 | 590b7eed | bellard | echo -n "SDL_STATIC_LIBS=`sdl-config --static-libs`" >> $config_mak |
307 | 590b7eed | bellard | if [ "${aa}" = "yes" ] ; then |
308 | 590b7eed | bellard | echo -n " `aalib-config --libs`" >> $config_mak ; |
309 | 590b7eed | bellard | fi |
310 | 590b7eed | bellard | echo "" >> $config_mak |
311 | 590b7eed | bellard | echo -n "SDL_CFLAGS=`sdl-config --cflags`" >> $config_mak |
312 | 590b7eed | bellard | if [ "${aa}" = "yes" ] ; then |
313 | 590b7eed | bellard | echo -n " `aalib-config --cflags`" >> $config_mak ; |
314 | 590b7eed | bellard | fi |
315 | 590b7eed | bellard | echo "" >> $config_mak |
316 | 97a847bc | bellard | fi |
317 | 97a847bc | bellard | echo -n "VERSION=" >>$config_mak |
318 | 97a847bc | bellard | head $source_path/VERSION >>$config_mak |
319 | 97a847bc | bellard | echo "" >>$config_mak |
320 | 97a847bc | bellard | echo -n "#define QEMU_VERSION \"" >> $config_h |
321 | 97a847bc | bellard | head $source_path/VERSION >> $config_h |
322 | 97a847bc | bellard | echo "\"" >> $config_h |
323 | 97a847bc | bellard | |
324 | 97a847bc | bellard | echo "SRC_PATH=$source_path" >> $config_mak |
325 | 97a847bc | bellard | echo "TARGET_DIRS=$target_list" >> $config_mak |
326 | 97a847bc | bellard | |
327 | 97a847bc | bellard | for target in $target_list; do |
328 | 97a847bc | bellard | |
329 | 97a847bc | bellard | target_dir="$target" |
330 | 97a847bc | bellard | config_mak=$target_dir/config.mak |
331 | 97a847bc | bellard | config_h=$target_dir/config.h |
332 | 97a847bc | bellard | target_cpu=`echo $target | cut -d '-' -f 1` |
333 | 97a847bc | bellard | target_bigendian="no" |
334 | 1e43adfc | bellard | [ "$target_cpu" = "sparc" ] && target_bigendian=yes |
335 | 67867308 | bellard | [ "$target_cpu" = "ppc" ] && target_bigendian=yes |
336 | 97a847bc | bellard | target_softmmu="no" |
337 | 97a847bc | bellard | if expr $target : '.*-softmmu' > /dev/null ; then |
338 | 97a847bc | bellard | target_softmmu="yes" |
339 | 97a847bc | bellard | fi |
340 | 997344f3 | bellard | target_user_only="no" |
341 | 997344f3 | bellard | if expr $target : '.*-user' > /dev/null ; then |
342 | 997344f3 | bellard | target_user_only="yes" |
343 | 997344f3 | bellard | fi |
344 | 97a847bc | bellard | |
345 | 97a847bc | bellard | echo "Creating $config_mak, $config_h and $target_dir/Makefile" |
346 | 97a847bc | bellard | |
347 | 97a847bc | bellard | mkdir -p $target_dir |
348 | 69de927c | bellard | if test "$target" = "arm-user" ; then |
349 | 69de927c | bellard | mkdir -p $target_dir/nwfpe |
350 | 69de927c | bellard | fi |
351 | 69de927c | bellard | |
352 | 97a847bc | bellard | ln -sf $source_path/Makefile.target $target_dir/Makefile |
353 | 97a847bc | bellard | |
354 | 97a847bc | bellard | echo "# Automatically generated by configure - do not modify" > $config_mak |
355 | 97a847bc | bellard | echo "/* Automatically generated by configure - do not modify */" > $config_h |
356 | 97a847bc | bellard | |
357 | de83cd02 | bellard | |
358 | 97a847bc | bellard | echo "include ../config-host.mak" >> $config_mak |
359 | 97a847bc | bellard | echo "#include \"../config-host.h\"" >> $config_h |
360 | 1e43adfc | bellard | |
361 | 1e43adfc | bellard | interp_prefix1=`echo "$interp_prefix" | sed "s/%M/$target_cpu/g"` |
362 | 1e43adfc | bellard | echo "#define CONFIG_QEMU_PREFIX \"$interp_prefix1\"" >> $config_h |
363 | 97a847bc | bellard | |
364 | 97a847bc | bellard | if test "$target_cpu" = "i386" ; then |
365 | 97a847bc | bellard | echo "TARGET_ARCH=i386" >> $config_mak |
366 | 97a847bc | bellard | echo "#define TARGET_ARCH \"i386\"" >> $config_h |
367 | 97a847bc | bellard | echo "#define TARGET_I386 1" >> $config_h |
368 | de83cd02 | bellard | elif test "$target_cpu" = "arm" ; then |
369 | 97a847bc | bellard | echo "TARGET_ARCH=arm" >> $config_mak |
370 | 97a847bc | bellard | echo "#define TARGET_ARCH \"arm\"" >> $config_h |
371 | 97a847bc | bellard | echo "#define TARGET_ARM 1" >> $config_h |
372 | 1e43adfc | bellard | elif test "$target_cpu" = "sparc" ; then |
373 | 1e43adfc | bellard | echo "TARGET_ARCH=sparc" >> $config_mak |
374 | 1e43adfc | bellard | echo "#define TARGET_ARCH \"sparc\"" >> $config_h |
375 | 1e43adfc | bellard | echo "#define TARGET_SPARC 1" >> $config_h |
376 | 67867308 | bellard | elif test "$target_cpu" = "ppc" ; then |
377 | 67867308 | bellard | echo "TARGET_ARCH=ppc" >> $config_mak |
378 | 67867308 | bellard | echo "#define TARGET_ARCH \"ppc\"" >> $config_h |
379 | 67867308 | bellard | echo "#define TARGET_PPC 1" >> $config_h |
380 | de83cd02 | bellard | else |
381 | de83cd02 | bellard | echo "Unsupported target CPU" |
382 | de83cd02 | bellard | exit 1 |
383 | de83cd02 | bellard | fi |
384 | de83cd02 | bellard | if test "$target_bigendian" = "yes" ; then |
385 | 97a847bc | bellard | echo "TARGET_WORDS_BIGENDIAN=yes" >> $config_mak |
386 | 97a847bc | bellard | echo "#define TARGET_WORDS_BIGENDIAN 1" >> $config_h |
387 | de83cd02 | bellard | fi |
388 | 97a847bc | bellard | if test "$target_softmmu" = "yes" ; then |
389 | 97a847bc | bellard | echo "CONFIG_SOFTMMU=yes" >> $config_mak |
390 | 97a847bc | bellard | echo "#define CONFIG_SOFTMMU 1" >> $config_h |
391 | 43ce4dfe | bellard | fi |
392 | 997344f3 | bellard | if test "$target_user_only" = "yes" ; then |
393 | 997344f3 | bellard | echo "CONFIG_USER_ONLY=yes" >> $config_mak |
394 | 997344f3 | bellard | echo "#define CONFIG_USER_ONLY 1" >> $config_h |
395 | 997344f3 | bellard | fi |
396 | 97a847bc | bellard | |
397 | 97a847bc | bellard | done # for target in $targets |
398 | 7d13299d | bellard | |
399 | 7d13299d | bellard | # build tree in object directory if source path is different from current one |
400 | 7d13299d | bellard | if test "$source_path_used" = "yes" ; then |
401 | 7d13299d | bellard | DIRS="tests" |
402 | 7d13299d | bellard | FILES="Makefile tests/Makefile" |
403 | 7d13299d | bellard | for dir in $DIRS ; do |
404 | 7d13299d | bellard | mkdir -p $dir |
405 | 7d13299d | bellard | done |
406 | 7d13299d | bellard | for f in $FILES ; do |
407 | 7d13299d | bellard | ln -sf $source_path/$f $f |
408 | 7d13299d | bellard | done |
409 | 7d13299d | bellard | fi |
410 | 7d13299d | bellard | |
411 | 97a847bc | bellard | rm -f $TMPO $TMPC $TMPE $TMPS |