|
|
1.1 root 1: dnl Process this file with autoconf to produce a configure script.
2:
1.1.1.5 ! root 3: dnl $Id: configure.in,v 1.20 2010/06/05 19:56:37 fredette Exp $
1.1 root 4:
5: dnl Copyright (c) 2001, 2003 Matt Fredette
6: dnl All rights reserved.
7: dnl
8: dnl Redistribution and use in source and binary forms, with or without
9: dnl modification, are permitted provided that the following conditions
10: dnl are met:
11: dnl 1. Redistributions of source code must retain the above copyright
12: dnl notice, this list of conditions and the following disclaimer.
13: dnl 2. Redistributions in binary form must reproduce the above copyright
14: dnl notice, this list of conditions and the following disclaimer in the
15: dnl documentation and/or other materials provided with the distribution.
16: dnl 3. All advertising materials mentioning features or use of this software
17: dnl must display the following acknowledgement:
18: dnl This product includes software developed by Matt Fredette.
19: dnl 4. The name of the author may not be used to endorse or promote products
20: dnl derived from this software without specific prior written permission.
21: dnl
22: dnl THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
23: dnl IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24: dnl WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
25: dnl DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
26: dnl INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
27: dnl (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
28: dnl SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29: dnl HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
30: dnl STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
31: dnl ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
32: dnl POSSIBILITY OF SUCH DAMAGE.
33:
34: dnl Checks that we are given a good source directory.
35: AC_INIT(ic/m68k/m68k-impl.h)
36: AC_CANONICAL_SYSTEM
1.1.1.5 ! root 37: AM_INIT_AUTOMAKE(tme, 0.8)
1.1 root 38:
39: dnl Write configuration out to config.h through config.h.in.
40: AM_CONFIG_HEADER(config.h)
41:
42: dnl Checks for programs.
43: AC_PROG_CC
44: AC_PROG_CPP
45: AC_PROG_YACC
46: AC_PROG_INSTALL
47: AC_PROG_MAKE_SET
48:
49: dnl Checks for header files.
50: AC_HEADER_STDC
1.1.1.3 root 51: AC_CHECK_HEADERS(unistd.h stdio.h memory.h stdarg.h limits.h float.h)
1.1 root 52: AC_CHECK_HEADERS(sys/ioctl.h sys/sockio.h sys/socketio.h net/if_dl.h ioctls.h)
1.1.1.3 root 53: AC_CHECK_HEADERS(sys/bswap.h)
1.1 root 54:
55: dnl Checks for typedefs, structures, and compiler characteristics.
56: AC_C_BIGENDIAN
57: AC_C_CONST
58: AC_C_INLINE
1.1.1.3 root 59: AC_C_VOLATILE
60: AC_C_LONG_DOUBLE
1.1.1.2 root 61: AC_TYPE_SIZE_T
1.1.1.3 root 62: AC_TYPE_SIGNAL
1.1 root 63: AC_CHECK_SIZEOF(long, 4)
64: AC_CHECK_SIZEOF(int, 4)
65: AC_CHECK_SIZEOF(short, 2)
1.1.1.3 root 66: AC_CHECK_SIZEOF(float, 4)
67: AC_CHECK_SIZEOF(double, 8)
68: if test $ac_cv_c_long_double = yes; then
69: AC_CHECK_SIZEOF(long double, 12)
70: fi
1.1 root 71: if test $ac_cv_sizeof_int != 4 && test $ac_cv_sizeof_long != 4; then
72: AC_MSG_ERROR([can't find a 32-bit type])
73: fi
74: if test $ac_cv_sizeof_int != 2 && test $ac_cv_sizeof_short != 2; then
75: AC_MSG_ERROR([can't find a 16-bit type])
76: fi
1.1.1.4 root 77: if test $ac_cv_sizeof_long = 8; then
78: AC_CHECK_ALIGNOF(64)
1.1.1.5 ! root 79: AC_CHECK_SHIFTMAX(64)
! 80: AC_CHECK_SHIFTSIGNED(64)
1.1.1.4 root 81: fi
1.1 root 82: AC_CHECK_ALIGNOF(32)
83: AC_CHECK_ALIGNOF(16)
84: AC_CHECK_SHIFTMAX(8)
85: AC_CHECK_SHIFTMAX(16)
86: AC_CHECK_SHIFTMAX(32)
1.1.1.3 root 87: AC_CHECK_SHIFTSIGNED(8)
88: AC_CHECK_SHIFTSIGNED(16)
89: AC_CHECK_SHIFTSIGNED(32)
90: AC_CHECK_FLOAT_FORMAT(float)
91: AC_CHECK_FLOAT_LIMITS(float, FLT_MAX/FLT_MIN)
92: AC_CHECK_FLOAT_FORMAT(double)
93: AC_CHECK_FLOAT_LIMITS(double, DBL_MAX/DBL_MIN)
94: if test $ac_cv_c_long_double = yes; then
95: AC_CHECK_FLOAT_FORMAT(long double)
96: AC_CHECK_FLOAT_LIMITS(long double, LDBL_MAX/LDBL_MIN)
97: fi
1.1 root 98: AC_SYS_SOCKADDR_SA_LEN
99:
100: dnl Checks for library functions and prototypes.
101: AC_PROG_GCC_TRADITIONAL
102: AC_FUNC_MEMCMP
103: AC_FUNC_MMAP
1.1.1.3 root 104: AC_CHECK_FUNC_LONG(bswap16, [
105: unsigned int x;
106:
107: x = bswap16(0x1122);
108: ], [
109: #ifdef HAVE_SYS_BSWAP_H
110: #include <sys/bswap.h>
111: #endif
112: ])
113: AC_CHECK_FUNC_LONG(bswap32, [
114: unsigned int x;
115:
116: x = bswap32(0x11223344);
117: ], [
118: #ifdef HAVE_SYS_BSWAP_H
119: #include <sys/bswap.h>
120: #endif
121: ])
1.1.1.5 ! root 122: if test $ac_cv_sizeof_long = 8; then
! 123: AC_CHECK_FUNC_LONG(bswap64, [
! 124: unsigned long x;
! 125:
! 126: x = bswap64(0x11223344);
! 127: ], [
! 128: #ifdef HAVE_SYS_BSWAP_H
! 129: #include <sys/bswap.h>
! 130: #endif
! 131: ])
! 132: fi
1.1.1.3 root 133: AC_CHECK_FUNC_LONG(isinff,
134: [
135: float x;
136: int y;
137:
138: x = 1;
139: y = isinff(x);
140: ], [
141: #include <math.h>
142: ], -lm)
1.1 root 143:
144: dnl Checks for perl.
145: AC_PATH_PROGS(PERL, perl4.036 perl4 perl perl5, no)
146: AC_SUBST(PERL)
147:
1.1.1.2 root 148: dnl Start the list of host support.
149: TME_HOSTS="posix"
150:
1.1 root 151: dnl Checks for AF_LINK.
152: AC_MSG_CHECKING([for AF_LINK support])
153: AC_EGREP_CPP(_tme_has_af_link,
154: [
155: #include <sys/socket.h>
156: #ifdef AF_LINK
157: _tme_has_af_link
158: #endif
159: ], [
160: AC_MSG_RESULT(yes)
161: AC_DEFINE(HAVE_AF_LINK, [], [Define if you have AF_LINK.])
162: ], [
163: AC_MSG_RESULT(no)
164: ])
165:
166: dnl Checks for BPF.
167: tme_raw_type=
1.1.1.2 root 168: AC_CHECK_HEADER(net/bpf.h,
169: [AC_EGREP_CPP(found_BIOCSHDRCMPLT,
170: [#include <net/bpf.h>
171: #ifdef BIOCSHDRCMPLT
172: found_BIOCSHDRCMPLT
173: #endif
174: ], [tme_raw_type=bpf])])
1.1 root 175: AC_MSG_CHECKING([for raw Ethernet access method])
1.1.1.2 root 176: case "x$tme_raw_type" in
177: xbpf) TME_HOSTS="${TME_HOSTS} bsd" ;;
178: x) tme_raw_type=none ;;
179: esac
1.1 root 180: AC_MSG_RESULT($tme_raw_type)
181:
1.1.1.2 root 182: dnl Checks for X11.
183: AC_PATH_XTRA
184:
185: dnl Checks for GTK.
1.1.1.5 ! root 186: AM_PATH_GTK_2_0([], have_gtk=true, have_gtk=false)
1.1.1.2 root 187: if $have_gtk; then
188: AC_DEFINE(HAVE_GTK, [], [Define if you are compiling with GTK.])
189: TME_HOSTS="${TME_HOSTS} gtk"
190: fi
191:
192: dnl Characterize any graphics displays and remember the areas of
193: dnl the smallest and largest screens.
194: TME_FB_XLAT_DST=
195: area_smallest=0
196: area_largest=0
197:
1.1.1.3 root 198: # if --with-tme-host-displays is given, characterize those given displays:
199: AC_ARG_WITH(tme-host-displays,
200: [ --with-tme-host-displays=DISPLAYS support host displays with these display formats])
201: for dst_key in ${with_tme_host_displays}; do
1.1.1.2 root 202:
203: dnl Make brackets safe to use.
204: changequote(<<, >>)dnl
205:
206: this_width=`echo ${dst_key} | sed -e 's/^\([0-9][0-9]*\)x\([0-9][0-9]*\)\(.*\)$/\1/'`
207: this_height=`echo ${dst_key} | sed -e 's/^\([0-9][0-9]*\)x\([0-9][0-9]*\)\(.*\)$/\2/'`
208: dst_key=`echo ${dst_key} | sed -e 's/^\([0-9][0-9]*\)x\([0-9][0-9]*\)\(.*\)$/\3/'`
209: this_area=`expr ${this_width} \* ${this_height}`
210:
211: if test ${area_smallest} = 0 || test `expr ${this_area} \< ${area_smallest}` = 1; then
212: area_smallest=${this_area}
213: fi
214: if test `expr ${this_area} \> ${area_largest}` = 1; then
215: area_largest=${this_area}
216: fi
217:
218: # add in this destination display key:
219: if echo " ${TME_FB_XLAT_DST} " | grep " ${dst_key} " > /dev/null 2>&1; then :; else
220: TME_FB_XLAT_DST="${TME_FB_XLAT_DST} ${dst_key}"
221: fi
222:
223: dnl Make brackets the quote characters again.
224: changequote([, ])dnl
225: done
226:
227: # if DISPLAY is set and xdpyinfo appears to work, characterize this X display:
228: if test "x${DISPLAY}" != x && xdpyinfo >/dev/null 2>&1; then
229: AC_MSG_CHECKING(characteristics of X display ${DISPLAY})
230:
231: dnl Make brackets safe to use.
232: changequote(<<, >>)dnl
233:
234: # get the format this display uses for bitmaps:
235: bitmap_info=`xdpyinfo | grep 'bitmap unit' | sed -e 's/bitmap unit, *bit order, *padding: *\(.*\)$/\1/'`
236: bitmap_order=`echo ${bitmap_info} | sed -e 's/\([0-9][0-9]*\), *\([LM]\)SBFirst, *\([0-9][0-9]*\).*/\2/'`
237: bitmap_pad=`echo ${bitmap_info} | sed -e 's/\([0-9][0-9]*\), *\([LM]\)SBFirst, *\([0-9][0-9]*\).*/\3/'`
238: bitmap_order=`echo ${bitmap_order} | tr A-Z a-z`
239:
1.1.1.3 root 240: # get the format this display uses for images at its default depth. we
241: # assume that the root window is at the default depth:
1.1.1.2 root 242: pixmap_order=`xdpyinfo | grep 'image byte order'`
243: pixmap_order=`echo ${pixmap_order} | sed -e 's/.*image byte order: *\([LM]\)SBFirst.*/\1/' | tr A-Z a-z`
1.1.1.3 root 244: pixmap_depth=`xwininfo -root | grep 'Depth:'`
245: pixmap_depth=`echo ${pixmap_depth} | sed -e 's/.*Depth: *\([0-9][0-9]*\).*/\1/'`
1.1.1.2 root 246: pixmap_infos=`xdpyinfo | grep bits_per_pixel | tr '\n' %`
247: save_IFS=$IFS
248: IFS=%
249: for pixmap_info in $pixmap_infos; do
250: IFS=$save_IFS
251: if test "x$pixmap_info" = x; then continue; fi
252: this_pixmap_depth=`echo ${pixmap_info} | sed -e 's/.*depth \([0-9][0-9]*\), *bits_per_pixel \([0-9][0-9]*\), *scanline_pad \([0-9][0-9]*\).*/\1/'`
253: this_pixmap_bipp=`echo ${pixmap_info} | sed -e 's/.*depth \([0-9][0-9]*\), *bits_per_pixel \([0-9][0-9]*\), *scanline_pad \([0-9][0-9]*\).*/\2/'`
254: this_pixmap_pad=`echo ${pixmap_info} | sed -e 's/.*depth \([0-9][0-9]*\), *bits_per_pixel \([0-9][0-9]*\), *scanline_pad \([0-9][0-9]*\).*/\3/'`
1.1.1.3 root 255: if test "x${this_pixmap_depth}" = "x${pixmap_depth}"; then
1.1.1.2 root 256: pixmap_bipp=${this_pixmap_bipp}
257: pixmap_pad=${this_pixmap_pad}
1.1.1.3 root 258: break
1.1.1.2 root 259: fi
260: done
261: IFS=$save_IFS
262:
263: # if this display's greatest depth is one, we use its
264: # bitmap format:
1.1.1.3 root 265: if test "x${pixmap_bipp}" = x; then
1.1.1.2 root 266: pixmap_bipp=1
267: pixmap_pad=${bitmap_pad}
268:
269: # our translation functions can't handle the case when the bitmap
270: # bit order is different from the image byte order - doing so
271: # requires dealing with the bitmap unit size. since this
272: # situation is rare, just bail:
273: if test ${bitmap_order} != ${pixmap_order}; then
274: changequote([, ])dnl
275: AC_MSG_WARN([the X display ${DISPLAY} is monochrome and needs bitmaps with a bit order that the generic code doesn't support])
276: changequote(<<, >>)dnl
1.1.1.3 root 277: pixmap_bipp=
1.1.1.2 root 278: fi
279: fi
280:
281: # if this display seems usable:
1.1.1.3 root 282: if test "x${pixmap_bipp}" != x; then
1.1.1.2 root 283:
284: # check the dimensions of all screens on this display:
285: dimensions=`xdpyinfo | grep dimensions | tr '\n' %`
286: save_IFS=$IFS
287: IFS=%
288: for dimension in $dimensions; do
289: IFS=$save_IFS
290: if test "x$dimension" = x; then continue; fi
291: this_width=`echo ${dimension} | sed -e 's/.*dimensions: *\([0-9][0-9]*\)x\([0-9][0-9]*\).*/\1/'`
292: this_height=`echo ${dimension} | sed -e 's/.*dimensions: *\([0-9][0-9]*\)x\([0-9][0-9]*\).*/\2/'`
293: this_area=`expr ${this_width} \* ${this_height}`
294: if test ${area_smallest} = 0 || test `expr ${this_area} \< ${area_smallest}` = 1; then
295: area_smallest=${this_area}
296: fi
297: if test `expr ${this_area} \> ${area_largest}` = 1; then
298: area_largest=${this_area}
299: fi
300: done
301: IFS=$save_IFS
302:
1.1.1.3 root 303: # assume an unknown set of masks and an unknown mapping type:
304: dst_masks=_r0x0_g0x0_b0x0
305: dst_map=
306: value_visual=", unknown visual"
307:
308: # if the depth is greater than one:
309: if test "x${pixmap_depth}" != 1; then
310:
311: # we assume that the root window uses the default visual:
312: visual=`xwininfo -root | grep 'Visual Class:' | sed -e 's/^ *Visual Class: *\([A-Za-z][A-Za-z]*\).*$/\1/'`
313:
314: # get any primary masks for this visual:
315: case "x${visual}" in
316: xDirectColor | xTrueColor)
317: dst_masks=`xdpyinfo | $EGREP '(visual id|class|blue masks):' | $EGREP -C1 $visual | grep 'blue masks' | head -1`
318: dst_masks=`echo ${dst_masks} | sed -e 's/^.*blue masks: *\(.*\)/\1/'`
319: value_visual=", rgb masks ${dst_masks}"
320: dst_masks=`echo ${dst_masks} | sed -e 's/^/_r/' -e 's/, /_g/' -e 's/, /_b/'`
321: ;;
322: xStaticGray | xGrayScale | xStaticColor | xPseudoColor)
323: dst_masks=
324: value_visual=", no subfields"
325: ;;
326: *) ;;
327: esac
328:
329: # get the mapping type for this visual:
330: case "x${visual}" in
331: xStaticGray | xStaticColor | xPseudoColor)
332: dst_map="ml"
333: ;;
334: xDirectColor)
335: dst_map="mi"
336: value_visual="${value_visual}, indexed"
337: ;;
338: xGrayScale | xTrueColor)
339: dst_map="ml"
340: value_visual="${value_visual}, linear"
341: ;;
342: *) ;;
343: esac
344: fi
345:
1.1.1.2 root 346: dnl Make brackets the quote characters again.
347: changequote([, ])dnl
348:
349: # finish the characterization:
1.1.1.3 root 350: if test "x${pixmap_bipp}" = "x${pixmap_depth}"; then
1.1.1.2 root 351: value=
352: else
353: value=" (${pixmap_bipp} bits per pixel)"
354: fi
1.1.1.3 root 355: AC_MSG_RESULT([${pixmap_depth}-bit${value} ${pixmap_order}sb-first images with ${pixmap_pad}-bit padding${value_visual}])
356: dst_key="d${pixmap_depth}b${pixmap_bipp}s0p${pixmap_pad}o${pixmap_order}${dst_map}${dst_masks}"
1.1.1.2 root 357:
358: # add in this destination display key:
359: if echo " ${TME_FB_XLAT_DST} " | grep " ${dst_key} " > /dev/null 2>&1; then :; else
360: TME_FB_XLAT_DST="${TME_FB_XLAT_DST} ${dst_key}"
361: fi
362: fi
363: fi
364: AC_SUBST(TME_FB_XLAT_DST)
365:
1.1 root 366: dnl Configures for the system(s) to emulate.
367: systems=all
368: if echo " ${systems} " | grep ' all ' > /dev/null 2>&1; then
1.1.1.4 root 369: systems="sun2 sun3 sun4"
1.1.1.5 ! root 370: if test $ac_cv_sizeof_long = 8 || test "x${GCC}" = "xyes"; then
! 371: systems="${systems} sunultra1"
! 372: fi
1.1 root 373: fi
374: TME_MACHINE_SUBDIRS=
375: TME_IC_SUBDIRS=
376: TME_ICS=
1.1.1.2 root 377: TME_SERIAL_SUBDIRS=
378: TME_SERIALS=
1.1 root 379: TME_BUS_SUBDIRS=
1.1.1.2 root 380: TME_FB_XLAT_SRC=
1.1.1.5 ! root 381: bus_size_max=32
! 382: recode_size_guest_max=0
1.1 root 383: for system in $systems; do
384:
385: # dispatch on the machine type to get more machines, ICs, and
386: # buses to compile:
387: case ${system} in
388:
389: # the sun2:
390: sun2)
391: machines="sun sun2"
1.1.1.3 root 392: ics="m68k am9513 mm58167 z8530 i825x6"
1.1 root 393: buses="multibus"
1.1.1.2 root 394: fb_xlats="1152x900d1b1s0p32om"
1.1.1.5 ! root 395: bus_size=32
! 396: recode_size_guest=0
1.1 root 397: ;;
398:
1.1.1.3 root 399: # the sun3:
400: sun3)
401: machines="sun sun3"
402: ics="m68k isil7170 z8530 i825x6 ieee754 ncr5380"
403: buses="multibus"
404: fb_xlats="1152x900d1b1s0p32om 1152x900d8b8s0p32ommi8 1152x900d1b1s0p32omccmi8"
1.1.1.5 ! root 405: bus_size=32
! 406: recode_size_guest=0
1.1.1.3 root 407: ;;
408:
1.1.1.4 root 409: # the sun4:
410: sun4)
411: machines="sun sun4"
412: ics="sparc isil7170 z8530 am7930 am7990 ieee754 ncr53c9x mk48txx lsi64854 nec765"
413: buses="sbus"
414: fb_xlats="1152x900d1b1s0p32om 1152x900d8b8s0p32ommi8 1152x900d1b1s0p32omccmi8"
1.1.1.5 ! root 415: bus_size=32
! 416: recode_size_guest=32
! 417: ;;
! 418:
! 419: # the sun Ultra-1:
! 420: sunultra1)
! 421: machines="sun sun4u"
! 422: ics="sparc stp22xx z8530 am7990 ieee754 ncr53c9x ncr89c105 mk48txx lsi64854 nec765 stp2024 ad184x"
! 423: buses="sbus"
! 424: fb_xlats="1152x900d1b1s0p32om 1152x900d8b8s0p32ommi8 1152x900d1b1s0p32omccmi8"
! 425: bus_size=64
! 426: recode_size_guest=64
1.1.1.4 root 427: ;;
428:
1.1 root 429: *)
430: AC_MSG_ERROR([don't know how to emulate ${machine}])
431: ;;
432: esac
433:
1.1.1.5 ! root 434: # update the maximum bus size:
! 435: if test `expr ${bus_size_max} \< ${bus_size}` = 1; then
! 436: bus_size_max=$bus_size
! 437: fi
! 438:
! 439: # update the maximum recode guest size:
! 440: if test `expr ${recode_size_guest_max} \< ${recode_size_guest}` = 1; then
! 441: recode_size_guest_max=$recode_size_guest
! 442: fi
! 443:
1.1.1.2 root 444: # add in the new machines, ICs, serials, and buses to compile:
1.1 root 445: for machine in $machines; do
446: if echo " ${TME_MACHINE_SUBDIRS} " | grep " ${machine} " > /dev/null 2>&1; then :; else
447: TME_MACHINE_SUBDIRS="${TME_MACHINE_SUBDIRS} ${machine}"
448: fi
449: done
450: for ic in $ics; do
1.1.1.5 ! root 451: if test -d $srcdir/ic/$ic; then
1.1 root 452: if echo " ${TME_IC_SUBDIRS} " | grep " ${ic} " > /dev/null 2>&1; then :; else
453: TME_IC_SUBDIRS="${TME_IC_SUBDIRS} ${ic}"
454: fi
455: else
456: ic="tme_ic_${ic}.la"
457: if echo " ${TME_ICS} " | grep " ${ic} " > /dev/null 2>&1; then :; else
458: TME_ICS="${TME_ICS} ${ic}"
459: fi
460: fi
461: done
1.1.1.2 root 462: for serial in $serials; do
1.1.1.5 ! root 463: if test -d $srcdir/serial/$serial; then
1.1.1.2 root 464: if echo " ${TME_SERIAL_SUBDIRS} " | grep " ${serial} " > /dev/null 2>&1; then :; else
465: TME_SERIAL_SUBDIRS="${TME_SERIAL_SUBDIRS} ${serial}"
466: fi
467: else
468: serial="tme_serial_${serial}.la"
469: if echo " ${TME_SERIALS} " | grep " ${serial} " > /dev/null 2>&1; then :; else
470: TME_SERIALS="${TME_SERIALS} ${serial}"
471: fi
472: fi
473: done
1.1 root 474: for bus in $buses; do
475: if echo " ${TME_BUS_SUBDIRS} " | grep " ${bus} " > /dev/null 2>&1; then :; else
476: TME_BUS_SUBDIRS="${TME_BUS_SUBDIRS} ${bus}"
477: fi
478: done
1.1.1.2 root 479:
480: # add in the new frame buffer translations to compile:
481: for fb_xlat in $fb_xlats; do
482: if echo " ${TME_FB_XLAT_SRC} " | grep " ${fb_xlat} " > /dev/null 2>&1; then :; else
483: TME_FB_XLAT_SRC="${TME_FB_XLAT_SRC} ${fb_xlat}"
484: fi
485:
486: dnl Make brackets safe to use.
487: changequote(<<, >>)dnl
488:
489: # calculate the area of this frame buffer multiplied by 100:
490: this_width=`echo ${fb_xlat} | sed -e 's/^\([0-9][0-9]*\)x\([0-9][0-9]*\)\(.*\)$/\1/'`
491: this_height=`echo ${fb_xlat} | sed -e 's/^\([0-9][0-9]*\)x\([0-9][0-9]*\)\(.*\)$/\2/'`
492: this_area=`expr ${this_width} \* ${this_height} \* 100`
493:
494: dnl Make brackets the quote characters again.
495: changequote([, ])dnl
496:
497: # if this frame buffer would consume at least 70 percent of
498: # the smallest destination screen, make an xlat function that
499: # scales this frame buffer down by two:
500: if test ${area_smallest} = 0; then
501: percentage=100
502: else
503: percentage=`expr ${this_area} / ${area_smallest}`
504: fi
505: if test `expr ${percentage} \> 70` = 1; then
506: src_key="${fb_xlat}_h"
507: if echo " ${TME_FB_XLAT_SRC} " | grep " ${src_key} " > /dev/null 2>&1; then :; else
508: TME_FB_XLAT_SRC="${TME_FB_XLAT_SRC} ${src_key}"
509: fi
510: fi
511:
512: # if this frame buffer would consume less than 30 percent of
513: # the largest destination screen, make an xlat function that
514: # scales this frame buffer up by two:
515: if test ${area_largest} = 0; then
516: percentage=0
517: else
518: percentage=`expr ${this_area} / ${area_largest}`
519: fi
520: if test `expr ${percentage} \< 30` = 1; then
521: src_key="${fb_xlat}_d"
522: if echo " ${TME_FB_XLAT_SRC} " | grep " ${src_key} " > /dev/null 2>&1; then :; else
523: TME_FB_XLAT_SRC="${TME_FB_XLAT_SRC} ${src_key}"
524: fi
525: fi
526: done
1.1 root 527: done
528: AC_SUBST(TME_MACHINE_SUBDIRS)
529: AC_SUBST(TME_IC_SUBDIRS)
530: AC_SUBST(TME_ICS)
1.1.1.2 root 531: AC_SUBST(TME_SERIAL_SUBDIRS)
532: AC_SUBST(TME_SERIALS)
1.1 root 533: AC_SUBST(TME_BUS_SUBDIRS)
1.1.1.2 root 534: AC_SUBST(TME_FB_XLAT_SRC)
535:
536: dnl The list of host support is finished.
1.1 root 537: AC_SUBST(TME_HOSTS)
538:
1.1.1.5 ! root 539: dnl Configure recode.
! 540: AC_ARG_ENABLE(recode,
! 541: [ --enable-recode enable recode (dynamic binary translation) (default=if target supports)],
! 542: [ ], [enable_recode=])
! 543: if test "${recode_size_guest_max}" = 0; then
! 544: enable_recode=no
! 545: recode_size_guest_max=1
! 546: fi
! 547: if test "x${enable_recode}" = no; then
! 548: recode_hosts=
! 549: else
! 550: AC_MSG_CHECKING([for target recode support])
! 551:
! 552: dnl Make brackets safe to use.
! 553: changequote(<<, >>)dnl
! 554:
! 555: # get the host maximum guest size:
! 556: case "${target_cpu}" in
! 557: i[3456789]86)
! 558: recode_size_guest_max_host=64
! 559: ;;
! 560: x86_64)
! 561: recode_size_guest_max_host=128
! 562: ;;
! 563: *) recode_size_guest_max_host= ;;
! 564: esac
! 565:
! 566: # get the host recode parts:
! 567: case "${target}" in
! 568: i[3456789]86-*-netbsd* | x86_64-*-netbsd* | i[3456789]86-*-linux*)
! 569: recode_hosts="mmap x86"
! 570: ;;
! 571: *) recode_hosts= ;;
! 572: esac
! 573:
! 574: dnl Make brackets the quote characters again.
! 575: changequote([, ])dnl
! 576:
! 577: if test "x${recode_hosts}" = x; then
! 578: AC_MSG_RESULT([no])
! 579: if test "x${enable_recode}" = xrequired; then
! 580: AC_MSG_ERROR([recode required but not supported on ${target}])
! 581: fi
! 582: else
! 583: if test "x${recode_size_guest_max_host}" = x; then
! 584: AC_MSG_ERROR([internal error - no maximum recode guest size for ${target_cpu}])
! 585: fi
! 586: if test `expr ${recode_size_guest_max} \> ${recode_size_guest_max_host}` = 1; then
! 587: recode_size_guest_max=$recode_size_guest_max_host
! 588: fi
! 589: AC_MSG_RESULT([up to ${recode_size_guest_max}-bit guests using ${recode_hosts}])
! 590: fi
! 591: fi
! 592:
! 593: dnl Configure miscellaneous target support.
! 594: AC_MSG_CHECKING([for target miscellaneous support])
! 595: changequote(<<, >>)dnl
! 596: case "${target}" in
! 597: i[3456789]86-* | x86_64-*) misc_hosts="x86" ;;
! 598: *) misc_hosts=no ;;
! 599: esac
! 600: changequote([, ])dnl
! 601: AC_MSG_RESULT([${misc_hosts}])
! 602: if test "x${misc_hosts}" = no; then
! 603: misc_hosts=
! 604: fi
! 605:
1.1 root 606: dnl Configure for libtool.
607: AC_LIBLTDL_INSTALLABLE
608: AC_SUBST(INCLTDL)
609: AC_SUBST(LIBLTDL)
610: AC_LIBTOOL_DLOPEN
611: AM_PROG_LIBTOOL
612: AC_SUBST(LTLIBOBJS)
613: AC_CONFIG_SUBDIRS(libltdl)
614: TME_PREOPEN=
615: if test $enable_shared = no; then
616: TME_PREOPEN='`sort -u $(top_builddir)/tme-preopen.txt`'
617: fi
618: AC_SUBST(TME_PREOPEN)
619:
620: dnl Configure debugging and/or warnings.
621: AC_ARG_ENABLE(debug,
1.1.1.4 root 622: [ --enable-debug compile debuggable libraries and programs (default=don't)],
1.1.1.3 root 623: [ ], [enable_debug=no])
1.1 root 624: if test "x$enable_debug" = "xyes"; then
625: CFLAGS="${CFLAGS-} -g -O0"
626: CXXFLAGS="${CXXFLAGS-} -g3 -O0"
1.1.1.3 root 627: else
628: CPPFLAGS="${CPPFLAGS-} -DTME_NO_LOG -DTME_NO_DEBUG_LOCKS -DTME_NO_AUDIT_ATOMICS -DNDEBUG"
1.1 root 629: fi
630: AC_ARG_ENABLE(warnings,
631: [ --disable-warnings don't compile with warnings turned on (default=do)],
632: [ ], [enable_warnings=yes])
633: if test "x$enable_warnings" = "xyes" -a "x$GCC" = "xyes"; then
1.1.1.3 root 634: CFLAGS="${CFLAGS-} -Wundef -Wall -Werror"
1.1 root 635: CXXFLAGS="${CXXFLAGS-} -W"
636: fi
637:
1.1.1.3 root 638: dnl Some code isn't alias-clean.
639: CFLAGS_NO_STRICT_ALIASING=
640: if test "x$GCC" = "xyes"; then
641: CFLAGS_NO_STRICT_ALIASING=" -fno-strict-aliasing"
642: fi
643: AC_SUBST(CFLAGS_NO_STRICT_ALIASING)
644:
1.1 root 645: dnl Generate tmeconfig.h. The whether-to-generate logic is cribbed
646: dnl from glib-1.2.1's configure.in.
647: dnl See that file for an explanation.
648: AC_OUTPUT_COMMANDS([
649:
650: ## Generate our configure-time sources in two
651: ## cases:
652: ## 1. `config.status' is run either explicitly, or via configure.
653: ## Esp. not when it is run in `Makefile' to generate makefiles and
654: ## config.h
655: ## 2. CONFIG_OTHER is set explicitly
656: ##
657: ## Case 1 is difficult. We know that `automake' sets one of
658: ## CONFIG_FILES or CONFIG_HEADERS to empty. This heuristic works
659: ## only when AM_CONFIG_HEADER is set, however.
660:
661: case "x$CONFIG_OTHER" in
662: *tmeconfig.h) gen_tmeconfig_h=yes
663: ;;
664: esac
665: if test -n "${CONFIG_FILES}" && test -n "${CONFIG_HEADERS}"; then
666: # Both CONFIG_FILES and CONFIG_HEADERS are non-empty ==> Case 1
667: if test "x${CONFIG_OTHER}" = x; then
668: gen_tmeconfig_h=yes
669: fi
670: fi
671:
672: ## If we're generating tmeconfig.h:
673: if test "x$gen_tmeconfig_h" = xyes; then
674: outfile=tmeconfig.h
675: echo "$as_me: creating $outfile"
676: cat <<TMEEOF > ${outfile}-tmp
677: /* tmeconfig.h
678: *
679: * This is an automatically generated file - please modify 'configure.in'.
680: */
681:
682: #ifndef _TMECONFIG_H
683: #define _TMECONFIG_H
684:
685: TMEEOF
1.1.1.2 root 686: (for word in HAVE_ TIME_ PROTO_ ALIGNOF_ SIZEOF_ WORDS_BIGENDIAN; do \
1.1 root 687: grep $word config.h | sed 's/#define[ ]\{1,\}/&_TME_/' ; \
688: done) | sort | uniq >> ${outfile}-tmp
1.1.1.3 root 689: grep FLOAT_FORMAT config.h | \
690: sed 's/#define[ ]\{1,\}\([A-Za-z0-9_]\{1,\}\)[ ]\{1,\}\([A-Za-z0-9_]\{1,\}\)/#define TME_\1 TME_FLOAT_FORMAT_\2/' >> ${outfile}-tmp
1.1.1.5 ! root 691: echo '#define TME_BUSMAX_LOG2 TME_BUS'${bus_size_max}'_LOG2' >> ${outfile}-tmp
! 692: echo '#define TME_HAVE_RECODE (' \
! 693: `if test "x${recode_hosts}" = x; then echo 0; else echo 1; fi` ')' >> ${outfile}-tmp
! 694: echo '#define TME_RECODE_SIZE_GUEST_MAX TME_RECODE_SIZE_'${recode_size_guest_max} >> ${outfile}-tmp
1.1 root 695: echo '#define TME_RELEASE_MAJOR (' \
696: `echo $VERSION | sed -e 's,^\([0-9][0-9]*\)\.[0-9][0-9]*$,\1,'` ')' >> ${outfile}-tmp
697: echo '#define TME_RELEASE_MINOR (' \
698: `echo $VERSION | sed -e 's,^[0-9][0-9]*\.\([0-9][0-9]*\)$,\1,'` ')' >> ${outfile}-tmp
699: echo '#define TME_BUILD_TARGET "'$target'"' >> ${outfile}-tmp
1.1.1.2 root 700: if test $ac_cv_sizeof_long = 8; then
701: echo '#define TME_HAVE_INT64_T' >> ${outfile}-tmp
1.1.1.5 ! root 702: echo '#define _TME_PRI64 "l"' >> ${outfile}-tmp
1.1.1.2 root 703: echo 'typedef signed long tme_int64_t;' >> ${outfile}-tmp
704: echo 'typedef unsigned long tme_uint64_t;' >> ${outfile}-tmp
705: fi
1.1 root 706: if test $ac_cv_sizeof_int = 4; then
1.1.1.5 ! root 707: echo '#define _TME_PRI32 ""' >> ${outfile}-tmp
1.1 root 708: echo 'typedef signed int tme_int32_t;' >> ${outfile}-tmp
709: echo 'typedef unsigned int tme_uint32_t;' >> ${outfile}-tmp
710: elif test $ac_cv_sizeof_long = 4; then
1.1.1.5 ! root 711: echo '#define _TME_PRI32 "l"' >> ${outfile}-tmp
1.1 root 712: echo 'typedef signed long tme_int32_t;' >> ${outfile}-tmp
713: echo 'typedef unsigned long tme_uint32_t;' >> ${outfile}-tmp
714: fi
715: if test $ac_cv_sizeof_int = 2; then
716: echo 'typedef signed int tme_int16_t;' >> ${outfile}-tmp
717: echo 'typedef unsigned int tme_uint16_t;' >> ${outfile}-tmp
718: elif test $ac_cv_sizeof_short = 2; then
719: echo 'typedef signed short tme_int16_t;' >> ${outfile}-tmp
720: echo 'typedef unsigned short tme_uint16_t;' >> ${outfile}-tmp
721: fi
722: echo 'typedef signed char tme_int8_t;' >> ${outfile}-tmp
723: echo 'typedef unsigned char tme_uint8_t;' >> ${outfile}-tmp
724: cat <<TMEEOF >> ${outfile}-tmp
725:
726: /* features that aren't currently controlled by a configure option: */
727: #define TME_THREADS_SJLJ
728:
729: #endif /* !_TMECONFIG_H */
730: TMEEOF
731: if cmp -s ${outfile}-tmp $outfile; then
732: echo "$as_me: $outfile is unchanged"
733: rm -f ${outfile}-tmp
734: else
735: mv ${outfile}-tmp ${outfile}
736: fi
1.1.1.5 ! root 737:
! 738: outfile=tme/recode-host.h
! 739: echo "$as_me: creating $outfile"
! 740: cat <<TMEEOF > ${outfile}-tmp
! 741: /* recode-host.h
! 742: *
! 743: * This is an automatically generated file - please modify 'configure.in'.
! 744: */
! 745:
! 746: TMEEOF
! 747: for host in ${recode_hosts}; do
! 748: echo '#include <tme/host/recode-'${host}'.h>' >> ${outfile}-tmp
! 749: done
! 750: delim='#define TME_RECODE_HOST_IC \'
! 751: for host in ${recode_hosts}; do
! 752: echo ${delim} >> ${outfile}-tmp
! 753: echo -n ' TME_RECODE_'`echo ${host} | tr '[a-z]' '[A-Z]'`'_IC' >> ${outfile}-tmp
! 754: delim='; \'
! 755: done
! 756: echo '' >> ${outfile}-tmp
! 757: if cmp -s ${outfile}-tmp $outfile; then
! 758: echo "$as_me: $outfile is unchanged"
! 759: rm -f ${outfile}-tmp
! 760: else
! 761: mv ${outfile}-tmp ${outfile}
! 762: fi
! 763:
! 764: outfile=libtme/recode-host.c
! 765: echo "$as_me: creating $outfile"
! 766: cat <<TMEEOF > ${outfile}-tmp
! 767: /* recode-host.c
! 768: *
! 769: * This is an automatically generated file - please modify 'configure.in'.
! 770: */
! 771:
! 772: TMEEOF
! 773: for host in ${recode_hosts}; do
! 774: if test -d ${srcdir}/libtme/host/${host}; then
! 775: echo '#include "libtme/host/'${host}'/recode-'${host}'.c"' >> ${outfile}-tmp
! 776: else
! 777: echo '#include "libtme/host/recode-'${host}'.c"' >> ${outfile}-tmp
! 778: fi
! 779: done
! 780: if cmp -s ${outfile}-tmp $outfile; then
! 781: echo "$as_me: $outfile is unchanged"
! 782: rm -f ${outfile}-tmp
! 783: else
! 784: mv ${outfile}-tmp ${outfile}
! 785: fi
! 786:
! 787: outfile=libtme/misc-host.c
! 788: echo "$as_me: creating $outfile"
! 789: cat <<TMEEOF > ${outfile}-tmp
! 790: /* misc-host.c
! 791: *
! 792: * This is an automatically generated file - please modify 'configure.in'.
! 793: */
! 794:
! 795: TMEEOF
! 796: for host in ${misc_hosts}; do
! 797: if test -d ${srcdir}/libtme/host/${host}; then
! 798: echo '#include "libtme/host/'${host}'/misc-'${host}'.c"' >> ${outfile}-tmp
! 799: else
! 800: echo '#include "libtme/host/misc-'${host}'.c"' >> ${outfile}-tmp
! 801: fi
! 802: done
! 803: echo '#include "libtme/misc.c"' >> ${outfile}-tmp
! 804: if cmp -s ${outfile}-tmp $outfile; then
! 805: echo "$as_me: $outfile is unchanged"
! 806: rm -f ${outfile}-tmp
! 807: else
! 808: mv ${outfile}-tmp ${outfile}
! 809: fi
! 810:
1.1 root 811: fi
812: ], [
1.1.1.5 ! root 813: recode_hosts="$recode_hosts"
! 814: recode_size_guest_max="$recode_size_guest_max"
! 815: misc_hosts="$misc_hosts"
! 816: srcdir="$srcdir"
1.1 root 817: PACKAGE="$PACKAGE"
818: VERSION="$VERSION"
819: target="$target"
820: ac_cv_sizeof_int="$ac_cv_sizeof_int"
821: ac_cv_sizeof_long="$ac_cv_sizeof_long"
822: ac_cv_sizeof_short="$ac_cv_sizeof_short"
1.1.1.5 ! root 823: bus_size_max="$bus_size_max"
1.1 root 824: ])
825:
826: dnl Writes files.
827: AC_OUTPUT(Makefile
828: tme/Makefile
829: tme/ic/Makefile
830: tme/machine/Makefile
831: tme/generic/Makefile
1.1.1.2 root 832: tme/scsi/Makefile
1.1.1.5 ! root 833: tme/host/Makefile
! 834: tme/bus/Makefile
1.1 root 835: libtme/Makefile
1.1.1.5 ! root 836: libtme/host/Makefile
! 837: libtme/host/x86/Makefile
1.1 root 838: ic/Makefile
839: ic/m68k/Makefile
1.1.1.3 root 840: ic/ieee754/Makefile
1.1.1.4 root 841: ic/sparc/Makefile
1.1.1.5 ! root 842: ic/stp22xx/Makefile
1.1 root 843: machine/Makefile
844: machine/sun/Makefile
845: machine/sun2/Makefile
1.1.1.3 root 846: machine/sun3/Makefile
1.1.1.4 root 847: machine/sun4/Makefile
1.1.1.5 ! root 848: machine/sun4u/Makefile
1.1 root 849: host/Makefile
850: host/posix/Makefile
851: host/bsd/Makefile
1.1.1.2 root 852: host/gtk/Makefile
1.1 root 853: bus/Makefile
854: bus/multibus/Makefile
1.1.1.4 root 855: bus/sbus/Makefile
1.1.1.2 root 856: serial/Makefile
857: scsi/Makefile
1.1 root 858: generic/Makefile
1.1.1.3 root 859: tmesh/Makefile
860: tools/Makefile)
1.1 root 861:
This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.