ViewVC Help
View File | Revision Log | Show Annotations | Revision Graph | Root Listing
root/cebix/BasiliskII/src/Windows/configure.ac
(Generate patch)

Comparing BasiliskII/src/Windows/configure.ac (file contents):
Revision 1.2 by gbeauche, 2005-03-24T23:13:09Z vs.
Revision 1.4 by gbeauche, 2005-11-21T22:13:56Z

# Line 1 | Line 1
1 < dnl Process this file with autoconf to produce a configure script.
2 < dnl Written in 2002 by Christian Bauer et al.
3 <
4 < AC_INIT([Basilisk II], 1.0, [Christian.Bauer@uni-mainz.de], BasiliskII)
5 < AC_CONFIG_SRCDIR(main_windows.cpp)
6 < AC_CONFIG_AUX_DIR(../Unix)
7 < AC_PREREQ(2.52)
8 < AC_CONFIG_HEADER(config.h)
9 <
10 < dnl Aliases for PACKAGE and VERSION macros.
11 < AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE_NAME", [Define this program name.])
12 < AC_DEFINE_UNQUOTED(VERSION, "$PACKAGE_VERSION", [Define this program version.])
13 <
14 < dnl JIT compiler options.
15 < AC_ARG_ENABLE(jit-compiler,  [  --enable-jit-compiler   enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes])
16 < AC_ARG_ENABLE(jit-debug,     [  --enable-jit-debug      activate native code disassemblers [default=no]], [WANT_JIT_DEBUG=$enableval], [WANT_JIT_DEBUG=no])
17 <
18 < dnl FPU emulation core.
19 < AC_ARG_ENABLE(fpe,
20 < [  --enable-fpe=FPE        specify which fpu emulator to use [default=auto]],
21 < [ case "$enableval" in
22 <    dnl default is always ieee, if architecture has this fp format
23 <    auto)       FPE_CORE_TEST_ORDER="ieee uae";;
24 <    ieee)       FPE_CORE_TEST_ORDER="ieee";;
25 <    uae)        FPE_CORE_TEST_ORDER="uae";;
26 <    x86)        FPE_CORE_TEST_ORDER="x86";;
27 <        *)              AC_MSG_ERROR([--enable-fpe takes only one of the following values: auto, x86, ieee, uae]);;
28 <  esac
29 < ],
30 < [ FPE_CORE_TEST_ORDER="ieee uae"
31 < ])
32 <
33 < dnl Addressing modes.
34 < AC_ARG_ENABLE(addressing,
35 < [  --enable-addressing=AM  specify the addressing mode to use [default=fastest]],
36 < [ case "$enableval" in
37 <    direct)     ADDRESSING_TEST_ORDER="direct";;
38 <    banks)      ADDRESSING_TEST_ORDER="banks";;
39 <    fastest)ADDRESSING_TEST_ORDER="direct banks";;
40 <    *)          AC_MSG_ERROR([--enable-addressing takes only one of the following values: fastest, direct, banks]);;
41 <  esac
42 < ],
43 < [ ADDRESSING_TEST_ORDER="direct banks"
44 < ])
45 <
46 < dnl Canonical system information.
47 < AC_CANONICAL_HOST
48 < AC_CANONICAL_TARGET
49 <
50 < dnl Target CPU type.
51 < HAVE_I386=no
52 < HAVE_POWERPC=no
53 < HAVE_X86_64=no
54 < case "$target_cpu" in
55 <  i386* | i486* | i586* | i686* | i786* ) HAVE_I386=yes;;
56 <  powerpc* ) HAVE_POWERPC=yes;;
57 <  x86_64* ) HAVE_X86_64=yes;;
58 < esac
59 <
60 < dnl Checks for programs.
61 < AC_PROG_CC
62 < AC_PROG_CC_C_O
63 < AC_PROG_CPP
64 < AC_PROG_CXX
65 < AC_PROG_MAKE_SET
66 < AC_PROG_EGREP
67 < AC_PROG_LN_S
68 < AC_CHECK_TOOL(WINDRES, windres)
69 <
70 < dnl We use 64-bit file size support if possible.
71 < AC_SYS_LARGEFILE
72 <
73 < dnl Checks for header files.
74 < AC_HEADER_STDC
75 <
76 < dnl Checks for typedefs, structures, and compiler characteristics.
77 < AC_C_BIGENDIAN
78 < AC_C_CONST
79 < AC_C_INLINE
80 < AC_CHECK_SIZEOF(short, 2)
81 < AC_CHECK_SIZEOF(int, 4)
82 < AC_CHECK_SIZEOF(long, 4)
83 < AC_CHECK_SIZEOF(long long, 8)
84 < AC_CHECK_SIZEOF(float, 4)
85 < AC_CHECK_SIZEOF(double, 8)
86 < AC_CHECK_SIZEOF(long double, 12)
87 < AC_CHECK_SIZEOF(void *, 4)
88 < AC_TYPE_OFF_T
89 < AC_CHECK_TYPES(loff_t)
90 < AC_CHECK_TYPES(caddr_t)
91 < AC_TYPE_SIZE_T
92 <
93 < dnl Define a macro that translates a yesno-variable into a C macro definition
94 < dnl to be put into the config.h file
95 < dnl $1 -- the macro to define
96 < dnl $2 -- the value to translate
97 < dnl $3 -- template name
98 < AC_DEFUN([AC_TRANSLATE_DEFINE], [
99 <    if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
100 <        AC_DEFINE($1, 1, $3)
101 <    fi
102 < ])
103 <
104 < dnl Check that VirtualAlloc(), VirtualProtect() work
105 < AC_CACHE_CHECK([whether VirtualProtect works],
106 <  ac_cv_VirtualProtect_works, [
107 <  AC_LANG_SAVE
108 <  AC_LANG_CPLUSPLUS
109 <  ac_cv_VirtualProtect_works=yes
110 <  dnl First the tests that should segfault
111 <  for test_def in NONE_READ NONE_WRITE READ_WRITE; do
112 <    AC_TRY_RUN([
113 <      #define HAVE_WIN32_VM 1
114 <      #define CONFIGURE_TEST_VM_MAP
115 <      #define TEST_VM_PROT_$test_def
116 <      #include "../Unix/vm_alloc.cpp"
117 <    ], ac_cv_VirtualProtect_works=no, rm -f core,
118 <    dnl When cross-compiling, assume it works
119 <    ac_cv_VirtualProtect_works="yes"
120 <    )
121 <  done
122 <  AC_TRY_RUN([
123 <    #define HAVE_WIN32_VM 1
124 <    #define CONFIGURE_TEST_VM_MAP
125 <    #define TEST_VM_PROT_RDWR_WRITE
126 <    #include "../Unix/vm_alloc.cpp"
127 <  ], , ac_cv_VirtualProtect_works=no,
128 <  dnl When cross-compiling, assume it works
129 <  ac_cv_VirtualProtect_works="yes"
130 <  )
131 <  AC_LANG_RESTORE
132 <  ]
133 < )
134 < if [[ "x$ac_cv_VirtualProtect_works" = "xyes" ]]; then
135 <  AC_DEFINE(HAVE_WIN32_VM, 1, [Define if your system has a working Win32-based memory allocator.])
136 < else
137 <  AC_MSG_ERROR([Sorry, Windows VM functions don't work as expected on your system.])
138 < fi
139 <
140 < dnl Check if Windows exceptions are supported.
141 < AC_CACHE_CHECK([whether your system supports Windows exceptions],
142 <  ac_cv_have_win32_exceptions, [
143 <  AC_LANG_SAVE
144 <  AC_LANG_CPLUSPLUS
145 <  AC_TRY_RUN([
146 <    #define HAVE_WIN32_EXCEPTIONS 1
147 <    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
148 <    #include "../Unix/vm_alloc.cpp"
149 <    #include "../Unix/sigsegv.cpp"
150 <  ],
151 <  ac_cv_have_win32_exceptions=yes,
152 <  ac_cv_have_win32_exceptions=no,
153 <  dnl When cross-compiling, assume it works
154 <  ac_cv_have_win32_exceptions="yes"
155 <  )
156 <  AC_LANG_RESTORE
157 <  ]
158 < )
159 < if [[ "x$ac_cv_have_win32_exceptions" = "xyes" ]]; then
160 <  AC_DEFINE(HAVE_WIN32_EXCEPTIONS, 1, [Define if your system supports Windows exceptions.])
161 < else
162 <  AC_MSG_ERROR([Sorry, Windows exceptions don't work as expected on your system.])
163 < fi
164 <
165 < dnl We really want VOSF (Video on SEGV Signals) screen updates acceleration
166 < AC_DEFINE(ENABLE_VOSF, 1, [Define if using video enabled on SEGV signals.])
167 <
168 < dnl Determine the addressing mode to use
169 < ADDRESSING_MODE=""
170 < AC_MSG_CHECKING([for the addressing mode to use])
171 < for am in $ADDRESSING_TEST_ORDER; do
172 <  case $am in
173 <  direct)
174 <    dnl Direct addressing mode (constant offset)
175 <    ADDRESSING_MODE="direct"
176 <    DEFINES="$DEFINES -DDIRECT_ADDRESSING"
177 <    break
178 <    ;;
179 <  banks)
180 <    dnl Default addressing mode
181 <    ADDRESSING_MODE="memory banks"
182 <    break
183 <    ;;
184 <  *)
185 <    AC_MSG_ERROR([Internal configure.ac script error for $am addressing mode])
186 <  esac
187 < done
188 < AC_MSG_RESULT($ADDRESSING_MODE)
189 < if [[ "x$ADDRESSING_MODE" = "x" ]]; then
190 <  AC_MSG_WARN([Sorry, no suitable addressing mode in $ADDRESSING_TEST_ORDER])
191 <  ADDRESSING_MODE="memory banks"
192 < fi
193 <
194 < dnl Banked Memory Addressing mode is not supported by the JIT compiler
195 < if [[ "x$WANT_JIT" = "xyes" -a "x$ADDRESSING_MODE" = "xmemory banks" ]]; then
196 <  AC_MSG_ERROR([Sorry, the JIT Compiler requires Direct Addressing, at least])
197 < fi
198 <
199 < dnl Check for GAS.
200 < HAVE_GAS=no
201 < AC_MSG_CHECKING(for GAS .p2align feature)
202 < cat >conftest.S << EOF
203 <        .text
204 <        .p2align 5
205 < EOF
206 < if $CC conftest.S -c -o conftest.o >/dev/null 2>&1 ; then HAVE_GAS=yes; fi
207 < AC_MSG_RESULT($HAVE_GAS)
208 <
209 < dnl Check for GCC 2.7 or higher.
210 < HAVE_GCC27=no
211 < AC_MSG_CHECKING(for GCC 2.7 or higher)
212 < AC_EGREP_CPP(xyes,
213 < [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
214 <  xyes
215 < #endif
216 < ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
217 <
218 < dnl Check for GCC 3.0 or higher.
219 < HAVE_GCC30=no
220 < AC_MSG_CHECKING(for GCC 3.0 or higher)
221 < AC_EGREP_CPP(xyes,
222 < [#if __GNUC__ >= 3
223 <  xyes
224 < #endif
225 < ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
226 <
227 < dnl Select appropriate CPU source and REGPARAM define.
228 < ASM_OPTIMIZATIONS=none
229 < CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"
230 <
231 < dnl JITSRCS will be emptied later if the JIT is not available
232 < dnl Other platforms should define their own set of noflags file variants
233 < CAN_JIT=no
234 < JITSRCS="compemu1.cpp compemu2.cpp compemu3.cpp compemu4.cpp compemu5.cpp compemu6.cpp compemu7.cpp compemu8.cpp"
235 <
236 < if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then
237 <  dnl i386 CPU
238 <  DEFINES="$DEFINES -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(3)))\""
239 <  if [[ "x$HAVE_GAS" = "xyes" ]]; then
240 <    ASM_OPTIMIZATIONS=i386
241 <    DEFINES="$DEFINES -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE"
242 <    JITSRCS="cpuemu1_nf.cpp cpuemu2_nf.cpp cpuemu3_nf.cpp cpuemu4_nf.cpp cpuemu5_nf.cpp cpuemu6_nf.cpp cpuemu7_nf.cpp cpuemu8_nf.cpp $JITSRCS"
243 <    CAN_JIT=yes
244 <  fi
245 < elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_X86_64" = "xyes" ]]; then
246 <  dnl x86-64 CPU
247 <  DEFINES="$DEFINES -DUNALIGNED_PROFITABLE"
248 <  if [[ "x$HAVE_GAS" = "xyes" ]]; then
249 <    ASM_OPTIMIZATIONS="x86-64"
250 <    DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS"
251 <    JITSRCS="cpuemu1_nf.cpp cpuemu2_nf.cpp cpuemu3_nf.cpp cpuemu4_nf.cpp cpuemu5_nf.cpp cpuemu6_nf.cpp cpuemu7_nf.cpp cpuemu8_nf.cpp $JITSRCS"
252 <    CAN_JIT=yes
253 <    WANT_33BIT_ADDRESSING=yes
254 <  fi
255 < fi
256 <
257 < dnl Enable JIT compiler, if possible.
258 < if [[ "x$WANT_JIT" = "xyes" -a "x$CAN_JIT" ]]; then
259 <  JITSRCS="$JITSRCS ../uae_cpu/compiler/compemu_support.cpp ../uae_cpu/compiler/compemu_fpp.cpp compstbl.o cpustbl_nf.o"
260 <  DEFINES="$DEFINES -DUSE_JIT -DUSE_JIT_FPU"
261 <  
262 <  if [[ "x$WANT_JIT_DEBUG" = "xyes" ]]; then
263 <    if [[ "x$WANT_MON" = "xyes" ]]; then
264 <      DEFINES="$DEFINES -DJIT_DEBUG=1"
265 <    else
266 <      AC_MSG_WARN([cxmon not found, ignoring --enable-jit-debug])
267 <      WANT_JIT_DEBUG=no
268 <    fi
269 <  fi
270 <
271 <  dnl IEEE core is the only FPU emulator to use with the JIT compiler
272 <  case $FPE_CORE_TEST_ORDER in
273 <  ieee*) ;;
274 <  *) AC_MSG_WARN([Forcing use of the IEEE FPU core, as the JIT compiler supports only this one.]) ;;
275 <  esac
276 <  FPE_CORE_TEST_ORDER="ieee"
277 < else
278 <  WANT_JIT=no
279 <  WANT_JIT_DEBUG=no
280 <  JITSRCS=""
281 < fi
282 <
283 < dnl Utility macro used by next two tests.
284 < dnl AC_EXAMINE_OBJECT(C source code,
285 < dnl     commands examining object file,
286 < dnl     [commands to run if compile failed]):
287 < dnl
288 < dnl Compile the source code to an object file; then convert it into a
289 < dnl printable representation.  All unprintable characters and
290 < dnl asterisks (*) are replaced by dots (.).  All white space is
291 < dnl deleted.  Newlines (ASCII 0x10) in the input are preserved in the
292 < dnl output, but runs of newlines are compressed to a single newline.
293 < dnl Finally, line breaks are forcibly inserted so that no line is
294 < dnl longer than 80 columns and the file ends with a newline.  The
295 < dnl result of all this processing is in the file conftest.dmp, which
296 < dnl may be examined by the commands in the second argument.
297 < dnl
298 < AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
299 < [AC_LANG_SAVE
300 < AC_LANG_C
301 < dnl Next bit cribbed from AC_TRY_COMPILE.
302 < cat > conftest.$ac_ext <<EOF
303 < [#line __oline__ "configure"
304 < #include "confdefs.h"
305 < $1
306 < ]EOF
307 < if AC_TRY_EVAL(ac_compile); then
308 <  od -c conftest.o |
309 <    sed ['s/^[0-7]*[    ]*/ /
310 <          s/\*/./g
311 <          s/ \\n/*/g
312 <          s/ [0-9][0-9][0-9]/./g
313 <          s/  \\[^ ]/./g'] |
314 <    tr -d '
315 < ' | tr -s '*' '
316 < ' | fold | sed '$a\
317 < ' > conftest.dmp
318 <  $2
319 < ifelse($3, , , else
320 <  $3
321 < )dnl
322 < fi
323 < rm -rf conftest*
324 < AC_LANG_RESTORE])
325 <
326 < dnl Floating point format probe.
327 < dnl The basic concept is the same as the above: grep the object
328 < dnl file for an interesting string.  We have to watch out for
329 < dnl rounding changing the values in the object, however; this is
330 < dnl handled by ignoring the least significant byte of the float.
331 < dnl
332 < dnl Does not know about VAX G-float or C4x idiosyncratic format.
333 < dnl It does know about PDP-10 idiosyncratic format, but this is
334 < dnl not presently supported by GCC.  S/390 "binary floating point"
335 < dnl is in fact IEEE (but maybe we should have that in EBCDIC as well
336 < dnl as ASCII?)
337 < dnl
338 < AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
339 < [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
340 < [gcc_AC_EXAMINE_OBJECT(
341 < [/* This will not work unless sizeof(double) == 8.  */
342 < extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
343 <
344 < /* This structure must have no internal padding.  */
345 < struct possibility {
346 <  char prefix[8];
347 <  double candidate;
348 <  char postfix[8];
349 < };
350 <
351 < #define C(cand) { "\nformat:", cand, ":tamrof\n" }
352 < struct possibility table [] =
353 < {
354 <  C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
355 <  C( 3.53802595280598432000e+18), /* D__float - VAX */
356 <  C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
357 <  C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
358 <  C(-5.22995989424860458374e+10)  /* IBMHEXFP - s/390 format, EBCDIC */
359 < };],
360 < [if   grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
361 <    ac_cv_c_float_format='IEEE (big-endian)'
362 <  elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
363 <    ac_cv_c_float_format='IEEE (big-endian)'
364 <  elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
365 <    ac_cv_c_float_format='IEEE (little-endian)'
366 <  elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
367 <    ac_cv_c_float_format='IEEE (little-endian)'
368 <  elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
369 <    ac_cv_c_float_format='VAX D-float'
370 <  elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
371 <    ac_cv_c_float_format='PDP-10'
372 <  elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
373 <    ac_cv_c_float_format='IBM 370 hex'
374 <  else
375 <    AC_MSG_ERROR(Unknown floating point format)
376 <  fi],
377 <  [AC_MSG_ERROR(compile failed)])
378 < ])
379 < # IEEE is the default format.  If the float endianness isn't the same
380 < # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
381 < # (which is a tristate: yes, no, default).  This is only an issue with
382 < # IEEE; the other formats are only supported by a few machines each,
383 < # all with the same endianness.
384 < format=IEEE_FLOAT_FORMAT
385 < fbigend=
386 < case $ac_cv_c_float_format in
387 <    'IEEE (big-endian)' )
388 <        if test $ac_cv_c_bigendian = no; then
389 <            fbigend=1
390 <        fi
391 <        ;;
392 <    'IEEE (little-endian)' )
393 <        if test $ac_cv_c_bigendian = yes; then
394 <            fbigend=0
395 <        fi
396 <        ;;
397 <    'VAX D-float' )
398 <        format=VAX_FLOAT_FORMAT
399 <        ;;
400 <    'PDP-10' )
401 <        format=PDP10_FLOAT_FORMAT
402 <        ;;
403 <    'IBM 370 hex' )
404 <        format=IBM_FLOAT_FORMAT
405 <        ;;
406 < esac
407 < AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
408 <  [Define to the floating point format of the host machine.])
409 < if test -n "$fbigend"; then
410 <        AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
411 <  [Define to 1 if the host machine stores floating point numbers in
412 <   memory with the word containing the sign bit at the lowest address,
413 <   or to 0 if it does it the other way around.
414 <
415 <   This macro should not be defined if the ordering is the same as for
416 <   multi-word integers.])
417 < fi
418 < ])
419 <
420 < dnl Select appropriate FPU source.
421 < gcc_AC_C_FLOAT_FORMAT
422 < AC_CHECK_HEADERS(ieee754.h ieeefp.h floatingpoint.h nan.h)
423 <
424 < for fpe in $FPE_CORE_TEST_ORDER; do
425 <  case $fpe in
426 <  ieee)
427 <    case $ac_cv_c_float_format in
428 <    IEEE*)
429 <      FPE_CORE="IEEE fpu core"
430 <      DEFINES="$DEFINES -DFPU_IEEE"
431 <      FPUSRCS="../uae_cpu/fpu/fpu_ieee.cpp"
432 <      dnl Math functions not mandated by C99 standard
433 <      AC_CHECK_FUNCS(isnanl isinfl)
434 <      dnl Math functions required by C99 standard, but probably not
435 <      dnl implemented everywhere. In that case, we fall back to the
436 <      dnl regular variant for doubles.
437 <      AC_CHECK_FUNCS(logl log10l expl powl fabsl sqrtl)
438 <      AC_CHECK_FUNCS(sinl cosl tanl sinhl coshl tanhl)
439 <      AC_CHECK_FUNCS(asinl acosl atanl asinhl acoshl atanhl)
440 <      AC_CHECK_FUNCS(floorl ceill)
441 <      break
442 <      ;;
443 <    esac
444 <    ;;
445 <  x86)
446 <    if [[ ":$HAVE_GCC27:$HAVE_I386:$HAVE_GAS:" = ":yes:yes:yes:" ]]; then
447 <      FPE_CORE="i387 fpu core"
448 <      DEFINES="$DEFINES -DFPU_X86"
449 <      FPUSRCS="../uae_cpu/fpu/fpu_x86.cpp"
450 <      break
451 <    fi
452 <    ;;
453 <  uae)
454 <    FPE_CORE="uae fpu core"
455 <    DEFINES="$DEFINES -DFPU_UAE"
456 <    FPUSRCS="../uae_cpu/fpu/fpu_uae.cpp"
457 <    break
458 <    ;;
459 <  *)
460 <    AC_MSG_ERROR([Internal configure.in script error for $fpe fpu core])
461 <    ;;
462 <  esac
463 < done
464 < if [[ "x$FPE_CORE" = "x" ]]; then
465 <  AC_MSG_ERROR([Sorry, no suitable FPU core found in $FPE_CORE_TEST_ORDER])
466 < fi
467 <
468 < dnl Check for certain math functions
469 < AC_CHECK_FUNCS(atanh)
470 < AC_CHECK_FUNCS(isnan isinf finite isnormal signbit)
471 <
472 < dnl UAE CPU sources for all non-m68k-native architectures.
473 < CPUINCLUDES="-I../uae_cpu"
474 < CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp $FPUSRCS cpustbl.cpp cpudefs.cpp $CPUSRCS $JITSRCS"
475 <
476 < dnl We really want SDL for now
477 < AC_CHECK_TOOL(sdl_config, sdl-config, [AC_MSG_ERROR([Sorry, you currently need SDL for this port])])
478 < sdl_cflags=`$sdl_config --cflags`
479 < sdl_libs=`$sdl_config --libs`
480 < CFLAGS="$CFLAGS $sdl_cflags"
481 < CXXFLAGS="$CXXFLAGS $sdl_cflags"
482 < LIBS="$LIBS $sdl_libs"
483 < AC_DEFINE(USE_SDL, 1, [Define to enble SDL support])
484 < AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support])
485 < AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support])
486 <
487 < dnl Remove the "-g" option if set for GCC.
488 < if [[ "x$HAVE_GCC27" = "xyes" ]]; then
489 <  CFLAGS=`echo $CFLAGS | sed -e 's/-g\b//g'`
490 <  CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g\b//g'`
491 < fi
492 <
493 < dnl Generate Makefile.
494 < AC_SUBST(DEFINES)
495 < AC_SUBST(CPUINCLUDES)
496 < AC_SUBST(CPUSRCS)
497 < AC_CONFIG_FILES([Makefile])
498 < AC_OUTPUT
499 <
500 < dnl Print summary.
501 < echo
502 < echo Basilisk II configuration summary:
503 < echo
504 < echo Use JIT compiler ....................... : $WANT_JIT
505 < echo JIT debug mode ......................... : $WANT_JIT_DEBUG
506 < echo Floating-Point emulation core .......... : $FPE_CORE
507 < echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS
508 < echo Addressing mode ........................ : $ADDRESSING_MODE
509 < echo
510 < echo "Configuration done. Now type \"make\" (or \"gmake\")."
1 > dnl Process this file with autoconf to produce a configure script.
2 > dnl Written in 2002 by Christian Bauer et al.
3 >
4 > AC_INIT([Basilisk II], 1.0, [Christian.Bauer@uni-mainz.de], BasiliskII)
5 > AC_CONFIG_SRCDIR(main_windows.cpp)
6 > AC_CONFIG_AUX_DIR(../Unix)
7 > AC_PREREQ(2.52)
8 > AC_CONFIG_HEADER(config.h)
9 >
10 > dnl Aliases for PACKAGE and VERSION macros.
11 > AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE_NAME", [Define this program name.])
12 > AC_DEFINE_UNQUOTED(VERSION, "$PACKAGE_VERSION", [Define this program version.])
13 >
14 > dnl JIT compiler options.
15 > AC_ARG_ENABLE(jit-compiler,  [  --enable-jit-compiler   enable JIT compiler [default=yes]], [WANT_JIT=$enableval], [WANT_JIT=yes])
16 > AC_ARG_ENABLE(jit-debug,     [  --enable-jit-debug      activate native code disassemblers [default=no]], [WANT_JIT_DEBUG=$enableval], [WANT_JIT_DEBUG=no])
17 >
18 > dnl FPU emulation core.
19 > AC_ARG_ENABLE(fpe,
20 > [  --enable-fpe=FPE        specify which fpu emulator to use [default=auto]],
21 > [ case "$enableval" in
22 >    dnl default is always ieee, if architecture has this fp format
23 >    auto)       FPE_CORE_TEST_ORDER="ieee uae";;
24 >    ieee)       FPE_CORE_TEST_ORDER="ieee";;
25 >    uae)        FPE_CORE_TEST_ORDER="uae";;
26 >    x86)        FPE_CORE_TEST_ORDER="x86";;
27 >        *)              AC_MSG_ERROR([--enable-fpe takes only one of the following values: auto, x86, ieee, uae]);;
28 >  esac
29 > ],
30 > [ FPE_CORE_TEST_ORDER="ieee uae"
31 > ])
32 >
33 > dnl External packages.
34 > AC_ARG_WITH(gtk,             [  --with-gtk              use GTK user interface [default=yes]], [WANT_GTK=$withval], [WANT_GTK=yes])
35 >
36 > dnl Addressing modes.
37 > AC_ARG_ENABLE(addressing,
38 > [  --enable-addressing=AM  specify the addressing mode to use [default=fastest]],
39 > [ case "$enableval" in
40 >    direct)     ADDRESSING_TEST_ORDER="direct";;
41 >    banks)      ADDRESSING_TEST_ORDER="banks";;
42 >    fastest)ADDRESSING_TEST_ORDER="direct banks";;
43 >    *)          AC_MSG_ERROR([--enable-addressing takes only one of the following values: fastest, direct, banks]);;
44 >  esac
45 > ],
46 > [ ADDRESSING_TEST_ORDER="direct banks"
47 > ])
48 >
49 > dnl Canonical system information.
50 > AC_CANONICAL_HOST
51 > AC_CANONICAL_TARGET
52 >
53 > dnl Target CPU type.
54 > HAVE_I386=no
55 > HAVE_POWERPC=no
56 > HAVE_X86_64=no
57 > case "$target_cpu" in
58 >  i386* | i486* | i586* | i686* | i786* ) HAVE_I386=yes;;
59 >  powerpc* ) HAVE_POWERPC=yes;;
60 >  x86_64* ) HAVE_X86_64=yes;;
61 > esac
62 >
63 > dnl Checks for programs.
64 > AC_PROG_CC
65 > AC_PROG_CC_C_O
66 > AC_PROG_CPP
67 > AC_PROG_CXX
68 > AC_PROG_MAKE_SET
69 > AC_PROG_EGREP
70 > AC_PROG_LN_S
71 > AC_CHECK_TOOL(WINDRES, windres)
72 >
73 > dnl We use GTK+ if possible.
74 > if [[ "x$WANT_GTK" = "xyes" ]]; then
75 >  AM_PATH_GTK_2_0(1.3.15, [], [
76 >    AC_MSG_WARN([Could not find GTK+ 2.0, disabling user interface.])
77 >    WANT_GTK=no
78 >  ])
79 > fi
80 > AC_SUBST(WANT_GTK)
81 >
82 > dnl We use 64-bit file size support if possible.
83 > AC_SYS_LARGEFILE
84 >
85 > dnl Checks for header files.
86 > AC_HEADER_STDC
87 >
88 > dnl Checks for typedefs, structures, and compiler characteristics.
89 > AC_C_BIGENDIAN
90 > AC_C_CONST
91 > AC_C_INLINE
92 > AC_CHECK_SIZEOF(short, 2)
93 > AC_CHECK_SIZEOF(int, 4)
94 > AC_CHECK_SIZEOF(long, 4)
95 > AC_CHECK_SIZEOF(long long, 8)
96 > AC_CHECK_SIZEOF(float, 4)
97 > AC_CHECK_SIZEOF(double, 8)
98 > AC_CHECK_SIZEOF(long double, 12)
99 > AC_CHECK_SIZEOF(void *, 4)
100 > AC_TYPE_OFF_T
101 > AC_CHECK_TYPES(loff_t)
102 > AC_CHECK_TYPES(caddr_t)
103 > AC_TYPE_SIZE_T
104 >
105 > dnl Define a macro that translates a yesno-variable into a C macro definition
106 > dnl to be put into the config.h file
107 > dnl $1 -- the macro to define
108 > dnl $2 -- the value to translate
109 > dnl $3 -- template name
110 > AC_DEFUN([AC_TRANSLATE_DEFINE], [
111 >    if [[ "x$2" = "xyes" -o "x$2" = "xguessing yes" ]]; then
112 >        AC_DEFINE($1, 1, $3)
113 >    fi
114 > ])
115 >
116 > dnl Check that VirtualAlloc(), VirtualProtect() work
117 > AC_CACHE_CHECK([whether VirtualProtect works],
118 >  ac_cv_VirtualProtect_works, [
119 >  AC_LANG_SAVE
120 >  AC_LANG_CPLUSPLUS
121 >  ac_cv_VirtualProtect_works=yes
122 >  dnl First the tests that should segfault
123 >  for test_def in NONE_READ NONE_WRITE READ_WRITE; do
124 >    AC_TRY_RUN([
125 >      #define HAVE_WIN32_VM 1
126 >      #define CONFIGURE_TEST_VM_MAP
127 >      #define TEST_VM_PROT_$test_def
128 >      #include "../Unix/vm_alloc.cpp"
129 >    ], ac_cv_VirtualProtect_works=no, rm -f core,
130 >    dnl When cross-compiling, assume it works
131 >    ac_cv_VirtualProtect_works="yes"
132 >    )
133 >  done
134 >  AC_TRY_RUN([
135 >    #define HAVE_WIN32_VM 1
136 >    #define CONFIGURE_TEST_VM_MAP
137 >    #define TEST_VM_PROT_RDWR_WRITE
138 >    #include "../Unix/vm_alloc.cpp"
139 >  ], , ac_cv_VirtualProtect_works=no,
140 >  dnl When cross-compiling, assume it works
141 >  ac_cv_VirtualProtect_works="yes"
142 >  )
143 >  AC_LANG_RESTORE
144 >  ]
145 > )
146 > if [[ "x$ac_cv_VirtualProtect_works" = "xyes" ]]; then
147 >  AC_DEFINE(HAVE_WIN32_VM, 1, [Define if your system has a working Win32-based memory allocator.])
148 > else
149 >  AC_MSG_ERROR([Sorry, Windows VM functions don't work as expected on your system.])
150 > fi
151 >
152 > dnl Check if Windows exceptions are supported.
153 > AC_CACHE_CHECK([whether your system supports Windows exceptions],
154 >  ac_cv_have_win32_exceptions, [
155 >  AC_LANG_SAVE
156 >  AC_LANG_CPLUSPLUS
157 >  AC_TRY_RUN([
158 >    #define HAVE_WIN32_EXCEPTIONS 1
159 >    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
160 >    #include "../Unix/vm_alloc.cpp"
161 >    #include "../Unix/sigsegv.cpp"
162 >  ],
163 >  ac_cv_have_win32_exceptions=yes,
164 >  ac_cv_have_win32_exceptions=no,
165 >  dnl When cross-compiling, assume it works
166 >  ac_cv_have_win32_exceptions="yes"
167 >  )
168 >  AC_LANG_RESTORE
169 >  ]
170 > )
171 > if [[ "x$ac_cv_have_win32_exceptions" = "xyes" ]]; then
172 >  AC_DEFINE(HAVE_WIN32_EXCEPTIONS, 1, [Define if your system supports Windows exceptions.])
173 > else
174 >  AC_MSG_ERROR([Sorry, Windows exceptions don't work as expected on your system.])
175 > fi
176 >
177 > dnl Check if we can ignore the fault (instruction skipping in SIGSEGV handler)
178 > AC_CACHE_CHECK([whether we can skip instruction in SIGSEGV handler],
179 >  ac_cv_have_skip_instruction, [
180 >  AC_LANG_SAVE
181 >  AC_LANG_CPLUSPLUS
182 >  AC_TRY_RUN([
183 >    #define HAVE_SIGSEGV_SKIP_INSTRUCTION 1
184 >    #define CONFIGURE_TEST_SIGSEGV_RECOVERY
185 >    #include "../Unix/vm_alloc.cpp"
186 >    #include "../Unix/sigsegv.cpp"
187 >  ], ac_cv_have_skip_instruction=yes, ac_cv_have_skip_instruction=no,
188 >  dnl When cross-compiling, do not assume anything.
189 >  ac_cv_have_skip_instruction=no
190 >  )
191 >  AC_LANG_RESTORE
192 >  ]
193 > )
194 > AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_INSTRUCTION, "$ac_cv_have_skip_instruction",
195 >  [Define if we can ignore the fault (instruction skipping in SIGSEGV handler).])
196 >
197 > dnl We really want VOSF (Video on SEGV Signals) screen updates acceleration
198 > AC_DEFINE(ENABLE_VOSF, 1, [Define if using video enabled on SEGV signals.])
199 >
200 > dnl Determine the addressing mode to use
201 > ADDRESSING_MODE=""
202 > AC_MSG_CHECKING([for the addressing mode to use])
203 > for am in $ADDRESSING_TEST_ORDER; do
204 >  case $am in
205 >  direct)
206 >    dnl Direct addressing mode (constant offset)
207 >    ADDRESSING_MODE="direct"
208 >    DEFINES="$DEFINES -DDIRECT_ADDRESSING"
209 >    break
210 >    ;;
211 >  banks)
212 >    dnl Default addressing mode
213 >    ADDRESSING_MODE="memory banks"
214 >    break
215 >    ;;
216 >  *)
217 >    AC_MSG_ERROR([Internal configure.ac script error for $am addressing mode])
218 >  esac
219 > done
220 > AC_MSG_RESULT($ADDRESSING_MODE)
221 > if [[ "x$ADDRESSING_MODE" = "x" ]]; then
222 >  AC_MSG_WARN([Sorry, no suitable addressing mode in $ADDRESSING_TEST_ORDER])
223 >  ADDRESSING_MODE="memory banks"
224 > fi
225 >
226 > dnl Banked Memory Addressing mode is not supported by the JIT compiler
227 > if [[ "x$WANT_JIT" = "xyes" -a "x$ADDRESSING_MODE" = "xmemory banks" ]]; then
228 >  AC_MSG_ERROR([Sorry, the JIT Compiler requires Direct Addressing, at least])
229 > fi
230 >
231 > dnl Check for GAS.
232 > HAVE_GAS=no
233 > AC_MSG_CHECKING(for GAS .p2align feature)
234 > cat >conftest.S << EOF
235 >        .text
236 >        .p2align 5
237 > EOF
238 > if $CC conftest.S -c -o conftest.o >/dev/null 2>&1 ; then HAVE_GAS=yes; fi
239 > AC_MSG_RESULT($HAVE_GAS)
240 >
241 > dnl Check for GCC 2.7 or higher.
242 > HAVE_GCC27=no
243 > AC_MSG_CHECKING(for GCC 2.7 or higher)
244 > AC_EGREP_CPP(xyes,
245 > [#if __GNUC__ - 1 > 1 || __GNUC_MINOR__ - 1 > 5
246 >  xyes
247 > #endif
248 > ], [AC_MSG_RESULT(yes); HAVE_GCC27=yes], AC_MSG_RESULT(no))
249 >
250 > dnl Check for GCC 3.0 or higher.
251 > HAVE_GCC30=no
252 > AC_MSG_CHECKING(for GCC 3.0 or higher)
253 > AC_EGREP_CPP(xyes,
254 > [#if __GNUC__ >= 3
255 >  xyes
256 > #endif
257 > ], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no))
258 >
259 > dnl Select appropriate CPU source and REGPARAM define.
260 > ASM_OPTIMIZATIONS=none
261 > CPUSRCS="cpuemu1.cpp cpuemu2.cpp cpuemu3.cpp cpuemu4.cpp cpuemu5.cpp cpuemu6.cpp cpuemu7.cpp cpuemu8.cpp"
262 >
263 > dnl JITSRCS will be emptied later if the JIT is not available
264 > dnl Other platforms should define their own set of noflags file variants
265 > CAN_JIT=no
266 > JITSRCS="compemu1.cpp compemu2.cpp compemu3.cpp compemu4.cpp compemu5.cpp compemu6.cpp compemu7.cpp compemu8.cpp"
267 >
268 > if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then
269 >  dnl i386 CPU
270 >  DEFINES="$DEFINES -DUNALIGNED_PROFITABLE -DREGPARAM=\"__attribute__((regparm(3)))\""
271 >  if [[ "x$HAVE_GAS" = "xyes" ]]; then
272 >    ASM_OPTIMIZATIONS=i386
273 >    DEFINES="$DEFINES -DX86_ASSEMBLY -DOPTIMIZED_FLAGS -DSAHF_SETO_PROFITABLE"
274 >    JITSRCS="cpuemu1_nf.cpp cpuemu2_nf.cpp cpuemu3_nf.cpp cpuemu4_nf.cpp cpuemu5_nf.cpp cpuemu6_nf.cpp cpuemu7_nf.cpp cpuemu8_nf.cpp $JITSRCS"
275 >    CAN_JIT=yes
276 >  fi
277 > elif [[ "x$HAVE_GCC30" = "xyes" -a "x$HAVE_X86_64" = "xyes" ]]; then
278 >  dnl x86-64 CPU
279 >  DEFINES="$DEFINES -DUNALIGNED_PROFITABLE"
280 >  if [[ "x$HAVE_GAS" = "xyes" ]]; then
281 >    ASM_OPTIMIZATIONS="x86-64"
282 >    DEFINES="$DEFINES -DX86_64_ASSEMBLY -DOPTIMIZED_FLAGS"
283 >    JITSRCS="cpuemu1_nf.cpp cpuemu2_nf.cpp cpuemu3_nf.cpp cpuemu4_nf.cpp cpuemu5_nf.cpp cpuemu6_nf.cpp cpuemu7_nf.cpp cpuemu8_nf.cpp $JITSRCS"
284 >    CAN_JIT=yes
285 >    WANT_33BIT_ADDRESSING=yes
286 >  fi
287 > fi
288 >
289 > dnl Enable JIT compiler, if possible.
290 > if [[ "x$WANT_JIT" = "xyes" -a "x$CAN_JIT" ]]; then
291 >  JITSRCS="$JITSRCS ../uae_cpu/compiler/compemu_support.cpp ../uae_cpu/compiler/compemu_fpp.cpp compstbl.o cpustbl_nf.o"
292 >  DEFINES="$DEFINES -DUSE_JIT -DUSE_JIT_FPU"
293 >  
294 >  if [[ "x$WANT_JIT_DEBUG" = "xyes" ]]; then
295 >    if [[ "x$WANT_MON" = "xyes" ]]; then
296 >      DEFINES="$DEFINES -DJIT_DEBUG=1"
297 >    else
298 >      AC_MSG_WARN([cxmon not found, ignoring --enable-jit-debug])
299 >      WANT_JIT_DEBUG=no
300 >    fi
301 >  fi
302 >
303 >  dnl IEEE core is the only FPU emulator to use with the JIT compiler
304 >  case $FPE_CORE_TEST_ORDER in
305 >  ieee*) ;;
306 >  *) AC_MSG_WARN([Forcing use of the IEEE FPU core, as the JIT compiler supports only this one.]) ;;
307 >  esac
308 >  FPE_CORE_TEST_ORDER="ieee"
309 > else
310 >  WANT_JIT=no
311 >  WANT_JIT_DEBUG=no
312 >  JITSRCS=""
313 > fi
314 >
315 > dnl Utility macro used by next two tests.
316 > dnl AC_EXAMINE_OBJECT(C source code,
317 > dnl     commands examining object file,
318 > dnl     [commands to run if compile failed]):
319 > dnl
320 > dnl Compile the source code to an object file; then convert it into a
321 > dnl printable representation.  All unprintable characters and
322 > dnl asterisks (*) are replaced by dots (.).  All white space is
323 > dnl deleted.  Newlines (ASCII 0x10) in the input are preserved in the
324 > dnl output, but runs of newlines are compressed to a single newline.
325 > dnl Finally, line breaks are forcibly inserted so that no line is
326 > dnl longer than 80 columns and the file ends with a newline.  The
327 > dnl result of all this processing is in the file conftest.dmp, which
328 > dnl may be examined by the commands in the second argument.
329 > dnl
330 > AC_DEFUN([gcc_AC_EXAMINE_OBJECT],
331 > [AC_LANG_SAVE
332 > AC_LANG_C
333 > dnl Next bit cribbed from AC_TRY_COMPILE.
334 > cat > conftest.$ac_ext <<EOF
335 > [#line __oline__ "configure"
336 > #include "confdefs.h"
337 > $1
338 > ]EOF
339 > if AC_TRY_EVAL(ac_compile); then
340 >  od -c conftest.o |
341 >    sed ['s/^[0-7]*[    ]*/ /
342 >          s/\*/./g
343 >          s/ \\n/*/g
344 >          s/ [0-9][0-9][0-9]/./g
345 >          s/  \\[^ ]/./g'] |
346 >    tr -d '
347 > ' | tr -s '*' '
348 > ' | fold | sed '$a\
349 > ' > conftest.dmp
350 >  $2
351 > ifelse($3, , , else
352 >  $3
353 > )dnl
354 > fi
355 > rm -rf conftest*
356 > AC_LANG_RESTORE])
357 >
358 > dnl Floating point format probe.
359 > dnl The basic concept is the same as the above: grep the object
360 > dnl file for an interesting string.  We have to watch out for
361 > dnl rounding changing the values in the object, however; this is
362 > dnl handled by ignoring the least significant byte of the float.
363 > dnl
364 > dnl Does not know about VAX G-float or C4x idiosyncratic format.
365 > dnl It does know about PDP-10 idiosyncratic format, but this is
366 > dnl not presently supported by GCC.  S/390 "binary floating point"
367 > dnl is in fact IEEE (but maybe we should have that in EBCDIC as well
368 > dnl as ASCII?)
369 > dnl
370 > AC_DEFUN([gcc_AC_C_FLOAT_FORMAT],
371 > [AC_CACHE_CHECK(floating point format, ac_cv_c_float_format,
372 > [gcc_AC_EXAMINE_OBJECT(
373 > [/* This will not work unless sizeof(double) == 8.  */
374 > extern char sizeof_double_must_be_8 [sizeof(double) == 8 ? 1 : -1];
375 >
376 > /* This structure must have no internal padding.  */
377 > struct possibility {
378 >  char prefix[8];
379 >  double candidate;
380 >  char postfix[8];
381 > };
382 >
383 > #define C(cand) { "\nformat:", cand, ":tamrof\n" }
384 > struct possibility table [] =
385 > {
386 >  C( 3.25724264705901305206e+01), /* @@IEEEFP - IEEE 754 */
387 >  C( 3.53802595280598432000e+18), /* D__float - VAX */
388 >  C( 5.32201830133125317057e-19), /* D.PDP-10 - PDP-10 - the dot is 0x13a */
389 >  C( 1.77977764695171661377e+10), /* IBMHEXFP - s/390 format, ascii */
390 >  C(-5.22995989424860458374e+10)  /* IBMHEXFP - s/390 format, EBCDIC */
391 > };],
392 > [if   grep 'format:.@IEEEF.:tamrof' conftest.dmp >/dev/null 2>&1; then
393 >    ac_cv_c_float_format='IEEE (big-endian)'
394 >  elif grep 'format:.I@@PFE.:tamrof' conftest.dmp >/dev/null 2>&1; then
395 >    ac_cv_c_float_format='IEEE (big-endian)'
396 >  elif grep 'format:.FEEEI@.:tamrof' conftest.dmp >/dev/null 2>&1; then
397 >    ac_cv_c_float_format='IEEE (little-endian)'
398 >  elif grep 'format:.EFP@@I.:tamrof' conftest.dmp >/dev/null 2>&1; then
399 >    ac_cv_c_float_format='IEEE (little-endian)'
400 >  elif grep 'format:.__floa.:tamrof' conftest.dmp >/dev/null 2>&1; then
401 >    ac_cv_c_float_format='VAX D-float'
402 >  elif grep 'format:..PDP-1.:tamrof' conftest.dmp >/dev/null 2>&1; then
403 >    ac_cv_c_float_format='PDP-10'
404 >  elif grep 'format:.BMHEXF.:tamrof' conftest.dmp >/dev/null 2>&1; then
405 >    ac_cv_c_float_format='IBM 370 hex'
406 >  else
407 >    AC_MSG_ERROR(Unknown floating point format)
408 >  fi],
409 >  [AC_MSG_ERROR(compile failed)])
410 > ])
411 > # IEEE is the default format.  If the float endianness isn't the same
412 > # as the integer endianness, we have to set FLOAT_WORDS_BIG_ENDIAN
413 > # (which is a tristate: yes, no, default).  This is only an issue with
414 > # IEEE; the other formats are only supported by a few machines each,
415 > # all with the same endianness.
416 > format=IEEE_FLOAT_FORMAT
417 > fbigend=
418 > case $ac_cv_c_float_format in
419 >    'IEEE (big-endian)' )
420 >        if test $ac_cv_c_bigendian = no; then
421 >            fbigend=1
422 >        fi
423 >        ;;
424 >    'IEEE (little-endian)' )
425 >        if test $ac_cv_c_bigendian = yes; then
426 >            fbigend=0
427 >        fi
428 >        ;;
429 >    'VAX D-float' )
430 >        format=VAX_FLOAT_FORMAT
431 >        ;;
432 >    'PDP-10' )
433 >        format=PDP10_FLOAT_FORMAT
434 >        ;;
435 >    'IBM 370 hex' )
436 >        format=IBM_FLOAT_FORMAT
437 >        ;;
438 > esac
439 > AC_DEFINE_UNQUOTED(HOST_FLOAT_FORMAT, $format,
440 >  [Define to the floating point format of the host machine.])
441 > if test -n "$fbigend"; then
442 >        AC_DEFINE_UNQUOTED(HOST_FLOAT_WORDS_BIG_ENDIAN, $fbigend,
443 >  [Define to 1 if the host machine stores floating point numbers in
444 >   memory with the word containing the sign bit at the lowest address,
445 >   or to 0 if it does it the other way around.
446 >
447 >   This macro should not be defined if the ordering is the same as for
448 >   multi-word integers.])
449 > fi
450 > ])
451 >
452 > dnl Select appropriate FPU source.
453 > gcc_AC_C_FLOAT_FORMAT
454 > AC_CHECK_HEADERS(ieee754.h ieeefp.h floatingpoint.h nan.h)
455 >
456 > for fpe in $FPE_CORE_TEST_ORDER; do
457 >  case $fpe in
458 >  ieee)
459 >    case $ac_cv_c_float_format in
460 >    IEEE*)
461 >      FPE_CORE="IEEE fpu core"
462 >      DEFINES="$DEFINES -DFPU_IEEE"
463 >      FPUSRCS="../uae_cpu/fpu/fpu_ieee.cpp"
464 >      dnl Math functions not mandated by C99 standard
465 >      AC_CHECK_FUNCS(isnanl isinfl)
466 >      dnl Math functions required by C99 standard, but probably not
467 >      dnl implemented everywhere. In that case, we fall back to the
468 >      dnl regular variant for doubles.
469 >      AC_CHECK_FUNCS(logl log10l expl powl fabsl sqrtl)
470 >      AC_CHECK_FUNCS(sinl cosl tanl sinhl coshl tanhl)
471 >      AC_CHECK_FUNCS(asinl acosl atanl asinhl acoshl atanhl)
472 >      AC_CHECK_FUNCS(floorl ceill)
473 >      break
474 >      ;;
475 >    esac
476 >    ;;
477 >  x86)
478 >    if [[ ":$HAVE_GCC27:$HAVE_I386:$HAVE_GAS:" = ":yes:yes:yes:" ]]; then
479 >      FPE_CORE="i387 fpu core"
480 >      DEFINES="$DEFINES -DFPU_X86"
481 >      FPUSRCS="../uae_cpu/fpu/fpu_x86.cpp"
482 >      break
483 >    fi
484 >    ;;
485 >  uae)
486 >    FPE_CORE="uae fpu core"
487 >    DEFINES="$DEFINES -DFPU_UAE"
488 >    FPUSRCS="../uae_cpu/fpu/fpu_uae.cpp"
489 >    break
490 >    ;;
491 >  *)
492 >    AC_MSG_ERROR([Internal configure.in script error for $fpe fpu core])
493 >    ;;
494 >  esac
495 > done
496 > if [[ "x$FPE_CORE" = "x" ]]; then
497 >  AC_MSG_ERROR([Sorry, no suitable FPU core found in $FPE_CORE_TEST_ORDER])
498 > fi
499 >
500 > dnl Check for certain math functions
501 > AC_CHECK_FUNCS(atanh)
502 > AC_CHECK_FUNCS(isnan isinf finite isnormal signbit)
503 >
504 > dnl UAE CPU sources for all non-m68k-native architectures.
505 > CPUINCLUDES="-I../uae_cpu"
506 > CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cpp ../uae_cpu/readcpu.cpp $FPUSRCS cpustbl.cpp cpudefs.cpp $CPUSRCS $JITSRCS"
507 >
508 > dnl We really want SDL for now
509 > AC_CHECK_TOOL(sdl_config, sdl-config, [AC_MSG_ERROR([Sorry, you currently need SDL for this port])])
510 > SDL_CFLAGS=`$sdl_config --cflags`
511 > AC_SUBST(SDL_CFLAGS)
512 > SDL_LIBS=`$sdl_config --libs`
513 > AC_SUBST(SDL_LIBS)
514 > AC_DEFINE(USE_SDL, 1, [Define to enble SDL support])
515 > AC_DEFINE(USE_SDL_VIDEO, 1, [Define to enable SDL video graphics support])
516 > AC_DEFINE(USE_SDL_AUDIO, 1, [Define to enable SDL audio support])
517 >
518 > dnl Remove the "-g" option if set for GCC.
519 > if [[ "x$HAVE_GCC27" = "xyes" ]]; then
520 >  CFLAGS=`echo $CFLAGS | sed -e 's/-g\b//g'`
521 >  CXXFLAGS=`echo $CXXFLAGS | sed -e 's/-g\b//g'`
522 > fi
523 >
524 > dnl Generate Makefile.
525 > AC_SUBST(DEFINES)
526 > AC_SUBST(CPUINCLUDES)
527 > AC_SUBST(CPUSRCS)
528 > AC_CONFIG_FILES([Makefile])
529 > AC_OUTPUT
530 >
531 > dnl Print summary.
532 > echo
533 > echo Basilisk II configuration summary:
534 > echo
535 > echo Use JIT compiler ....................... : $WANT_JIT
536 > echo JIT debug mode ......................... : $WANT_JIT_DEBUG
537 > echo Floating-Point emulation core .......... : $FPE_CORE
538 > echo Assembly optimizations ................. : $ASM_OPTIMIZATIONS
539 > echo Addressing mode ........................ : $ADDRESSING_MODE
540 > echo GTK user interface ..................... : $WANT_GTK
541 > echo
542 > echo "Configuration done. Now type \"make\" (or \"gmake\")."

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines