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(readline, readline) |
93 |
|
AC_CHECK_LIB(termcap, tputs) |
125 |
|
AC_DEFINE(HAVE_PTHREADS) |
126 |
|
fi |
127 |
|
AC_CHECK_FUNCS(pthread_cancel) |
128 |
+ |
AC_CHECK_FUNCS(pthread_mutexattr_setprotocol) |
129 |
+ |
AC_CHECK_FUNCS(pthread_mutexattr_settype) |
130 |
|
|
131 |
|
dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. |
132 |
|
SEMSRC= |
170 |
|
if [[ "x$WANT_GTK" = "xyes" ]]; then |
171 |
|
AM_PATH_GTK(1.2.0, [ |
172 |
|
AC_DEFINE(ENABLE_GTK) |
171 |
– |
CFLAGS="$CFLAGS $GTK_CFLAGS" |
173 |
|
CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" |
174 |
|
LIBS="$LIBS $GTK_LIBS" |
175 |
|
UISRCS=prefs_editor_gtk.cpp |
176 |
+ |
B2_PATH_GNOMEUI([ |
177 |
+ |
AC_DEFINE(HAVE_GNOMEUI) |
178 |
+ |
CXXFLAGS="$CXXFLAGS $GNOMEUI_CFLAGS" |
179 |
+ |
LIBS="$LIBS $GNOMEUI_LIBS" |
180 |
+ |
], []) |
181 |
|
], [ |
182 |
|
AC_MSG_WARN([Could not find GTK+, disabling user interface.]) |
183 |
|
WANT_GTK=no |
197 |
|
]) |
198 |
|
fi |
199 |
|
|
200 |
+ |
dnl We use 64-bit file size support if possible. |
201 |
+ |
dnl FIXME: Use AC_SYS_LARGEFILE from autoconf 2.5+ |
202 |
+ |
if [[ "x$OS_TYPE" = "xlinux" ]]; then |
203 |
+ |
AC_DEFINE(_USE_LARGEFILE_SOURCE, 1, [Get more functions for correct standard I/O]) |
204 |
+ |
AC_DEFINE(_FILE_OFFSET_BITS, 64, [Get 64-bit file size support]) |
205 |
+ |
fi |
206 |
+ |
|
207 |
|
dnl Checks for header files. |
208 |
|
AC_HEADER_STDC |
209 |
|
AC_CHECK_HEADERS(unistd.h fcntl.h sys/time.h sys/mman.h) |
219 |
|
AC_CHECK_SIZEOF(void *, 4) |
220 |
|
AC_TYPE_OFF_T |
221 |
|
AC_CHECK_TYPE(loff_t, off_t) |
222 |
< |
TYPE_SOCKLEN_T |
222 |
> |
AC_CHECK_TYPE(caddr_t, [char *]) |
223 |
|
AC_TYPE_SIZE_T |
224 |
|
AC_TYPE_SIGNAL |
225 |
|
AC_HEADER_TIME |
226 |
|
AC_STRUCT_TM |
227 |
|
|
228 |
+ |
dnl Check whether sys/socket.h defines type socklen_t. |
229 |
+ |
dnl (extracted from ac-archive/Miscellaneous) |
230 |
+ |
AC_CACHE_CHECK("for socklen_t", |
231 |
+ |
ac_cv_type_socklen_t, [ |
232 |
+ |
AC_TRY_COMPILE([ |
233 |
+ |
#include <sys/types.h> |
234 |
+ |
#include <sys/socket.h> |
235 |
+ |
], [socklen_t len = 42; return 0;], |
236 |
+ |
ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no, |
237 |
+ |
dnl When cross-compiling, do not assume anything. |
238 |
+ |
ac_cv_type_socklen_t="guessing no" |
239 |
+ |
) |
240 |
+ |
]) |
241 |
+ |
if [[ "x$ac_cv_type_socklen_t" != "xyes" ]]; then |
242 |
+ |
AC_DEFINE(socklen_t, int) |
243 |
+ |
fi |
244 |
+ |
|
245 |
|
dnl Checks for library functions. |
246 |
|
AC_CHECK_FUNCS(strdup cfmakeraw) |
247 |
|
AC_CHECK_FUNCS(clock_gettime timer_create) |
693 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
694 |
|
|
695 |
|
dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher. |
696 |
+ |
dnl Also set "-fno-exceptions" for C++ because exception handling requires |
697 |
+ |
dnl the frame pointer. |
698 |
|
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then |
699 |
|
CFLAGS="$CFLAGS -fomit-frame-pointer" |
700 |
< |
CXXFLAGS="$CXXFLAGS -fomit-frame-pointer" |
700 |
> |
CXXFLAGS="$CXXFLAGS -fomit-frame-pointer -fno-exceptions" |
701 |
|
fi |
702 |
|
|
703 |
|
dnl (gb) Do not merge constants since it breaks fpu/fpu_x86.cpp. |