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