1 |
|
dnl Process this file with autoconf to produce a configure script. |
2 |
< |
dnl Written in 1999 by Christian Bauer et al. |
2 |
> |
dnl Written in 2002 by Christian Bauer et al. |
3 |
|
|
4 |
|
AC_INIT(main_unix.cpp) |
5 |
|
AC_PREREQ(2.12) |
87 |
|
if grep mon_init $mon_srcdir/mon.h >/dev/null 2>/dev/null; then |
88 |
|
AC_MSG_RESULT(yes) |
89 |
|
AC_DEFINE(ENABLE_MON) |
90 |
< |
MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c" |
90 |
> |
MONSRCS="$mon_srcdir/mon.cpp $mon_srcdir/mon_6502.cpp $mon_srcdir/mon_z80.cpp $mon_srcdir/mon_cmd.cpp $mon_srcdir/mon_disass.cpp $mon_srcdir/mon_ppc.cpp $mon_srcdir/mon_lowmem.cpp $mon_srcdir/disass/floatformat.c $mon_srcdir/disass/i386-dis.c $mon_srcdir/disass/m68k-dis.c $mon_srcdir/disass/m68k-opc.c" |
91 |
|
CXXFLAGS="$CXXFLAGS -I$mon_srcdir -I$mon_srcdir/disass" |
92 |
+ |
AC_CHECK_LIB(ncurses, tgetent, , |
93 |
+ |
AC_CHECK_LIB(termcap, tgetent, , |
94 |
+ |
AC_CHECK_LIB(termlib, tgetent, , |
95 |
+ |
AC_CHECK_LIB(terminfo, tgetent, , |
96 |
+ |
AC_CHECK_LIB(Hcurses, tgetent, , |
97 |
+ |
AC_CHECK_LIB(curses, tgetent)))))) |
98 |
|
AC_CHECK_LIB(readline, readline) |
93 |
– |
AC_CHECK_LIB(termcap, tputs) |
99 |
|
AC_CHECK_HEADERS(readline.h history.h readline/readline.h readline/history.h) |
100 |
|
else |
101 |
|
AC_MSG_RESULT(no) |
130 |
|
AC_DEFINE(HAVE_PTHREADS) |
131 |
|
fi |
132 |
|
AC_CHECK_FUNCS(pthread_cancel) |
133 |
+ |
AC_CHECK_FUNCS(pthread_mutexattr_setprotocol) |
134 |
+ |
AC_CHECK_FUNCS(pthread_mutexattr_settype) |
135 |
|
|
136 |
|
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. |
137 |
|
SEMSRC= |
175 |
|
if [[ "x$WANT_GTK" = "xyes" ]]; then |
176 |
|
AM_PATH_GTK(1.2.0, [ |
177 |
|
AC_DEFINE(ENABLE_GTK) |
171 |
– |
CFLAGS="$CFLAGS $GTK_CFLAGS" |
178 |
|
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
179 |
|
LIBS="$LIBS $GTK_LIBS" |
180 |
|
UISRCS=prefs_editor_gtk.cpp |
181 |
+ |
B2_PATH_GNOMEUI([ |
182 |
+ |
AC_DEFINE(HAVE_GNOMEUI) |
183 |
+ |
CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS" |
184 |
+ |
LIBS="$LIBS $GNOMEUI_LIBS" |
185 |
+ |
], []) |
186 |
|
], [ |
187 |
|
AC_MSG_WARN([Could not find GTK+, disabling user interface.]) |
188 |
|
WANT_GTK=no |
202 |
|
]) |
203 |
|
fi |
204 |
|
|
205 |
+ |
dnl We use 64-bit file size support if possible. |
206 |
+ |
dnl FIXME: Use AC_SYS_LARGEFILE from autoconf 2.5+ |
207 |
+ |
if [[ "x$OS_TYPE" = "xlinux" ]]; then |
208 |
+ |
AC_DEFINE(_USE_LARGEFILE_SOURCE, 1, [Get more functions for correct standard I/O]) |
209 |
+ |
AC_DEFINE(_FILE_OFFSET_BITS, 64, [Get 64-bit file size support]) |
210 |
+ |
fi |
211 |
+ |
|
212 |
|
dnl Checks for header files. |
213 |
|
AC_HEADER_STDC |
214 |
|
AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/mman.h) |
224 |
|
AC_CHECK_SIZEOF(void *, 4) |
225 |
|
AC_TYPE_OFF_T |
226 |
|
AC_CHECK_TYPE(loff_t, off_t) |
227 |
< |
TYPE_SOCKLEN_T |
227 |
> |
AC_CHECK_TYPE(caddr_t, [char *]) |
228 |
|
AC_TYPE_SIZE_T |
229 |
|
AC_TYPE_SIGNAL |
230 |
|
AC_HEADER_TIME |
231 |
|
AC_STRUCT_TM |
232 |
|
|
233 |
+ |
dnl Check whether sys/socket.h defines type socklen_t. |
234 |
+ |
dnl (extracted from ac-archive/Miscellaneous) |
235 |
+ |
AC_CACHE_CHECK("for socklen_t", |
236 |
+ |
ac_cv_type_socklen_t, [ |
237 |
+ |
AC_TRY_COMPILE([ |
238 |
+ |
#include <sys/types.h> |
239 |
+ |
#include <sys/socket.h> |
240 |
+ |
], [socklen_t len = 42; return 0;], |
241 |
+ |
ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no, |
242 |
+ |
dnl When cross-compiling, do not assume anything. |
243 |
+ |
ac_cv_type_socklen_t="guessing no" |
244 |
+ |
) |
245 |
+ |
]) |
246 |
+ |
if [[ "x$ac_cv_type_socklen_t" != "xyes" ]]; then |
247 |
+ |
AC_DEFINE(socklen_t, int) |
248 |
+ |
fi |
249 |
+ |
|
250 |
|
dnl Checks for library functions. |
251 |
|
AC_CHECK_FUNCS(strdup cfmakeraw) |
252 |
|
AC_CHECK_FUNCS(clock_gettime timer_create) |
587 |
|
] |
588 |
|
) |
589 |
|
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals") |
590 |
< |
|
590 |
> |
|
591 |
|
dnl Otherwise, check for subterfuges. |
592 |
|
if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then |
593 |
|
AC_CACHE_CHECK("whether we then have a subterfuge for your system", |
608 |
|
AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, "$ac_cv_have_sigcontext_hack") |
609 |
|
fi |
610 |
|
|
611 |
+ |
dnl Check if we can ignore the fault (instruction skipping in SIGSEGV handler) |
612 |
+ |
AC_CACHE_CHECK("whether we can skip instruction in SIGSEGV handler", |
613 |
+ |
ac_cv_have_skip_instruction, [ |
614 |
+ |
AC_LANG_SAVE |
615 |
+ |
AC_LANG_CPLUSPLUS |
616 |
+ |
AC_TRY_RUN([ |
617 |
+ |
#define HAVE_SIGSEGV_SKIP_INSTRUCTION 1 |
618 |
+ |
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
619 |
+ |
#include "vm_alloc.cpp" |
620 |
+ |
#include "sigsegv.cpp" |
621 |
+ |
], ac_cv_have_skip_instruction=yes, ac_cv_have_skip_instruction=no, |
622 |
+ |
dnl When cross-compiling, do not assume anything. |
623 |
+ |
ac_cv_have_skip_instruction=no |
624 |
+ |
) |
625 |
+ |
AC_LANG_RESTORE |
626 |
+ |
] |
627 |
+ |
) |
628 |
+ |
AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_INSTRUCTION, "$ac_cv_have_skip_instruction") |
629 |
+ |
|
630 |
|
dnl Can we do Video on SEGV Signals ? |
631 |
|
CAN_VOSF=no |
632 |
|
if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then |
717 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
718 |
|
|
719 |
|
dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher. |
720 |
+ |
dnl Also set "-fno-exceptions" for C++ because exception handling requires |
721 |
+ |
dnl the frame pointer. |
722 |
|
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then |
723 |
|
CFLAGS="$CFLAGS -fomit-frame-pointer" |
724 |
< |
CXXFLAGS="$CXXFLAGS -fomit-frame-pointer" |
724 |
> |
CXXFLAGS="$CXXFLAGS -fomit-frame-pointer -fno-exceptions" |
725 |
|
fi |
726 |
|
|
727 |
|
dnl (gb) Do not merge constants since it breaks fpu/fpu_x86.cpp. |
843 |
|
CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -Ofast" |
844 |
|
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -Ofast" |
845 |
|
CXXFLAGS="-LANG:std $CXXFLAGS" |
846 |
< |
LDFLAGS="$LDFLAGS -Ofast" |
846 |
> |
LDFLAGS="$LDFLAGS -ipa" |
847 |
|
fi |
848 |
|
|
849 |
|
dnl Generate Makefile. |