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