5 |
|
AC_PREREQ(2.12) |
6 |
|
AC_CONFIG_HEADER(config.h) |
7 |
|
|
8 |
– |
dnl These defines are necessary to get 64-bit file size support. |
9 |
– |
AC_DEFINE(_USE_LARGEFILE_SOURCE, 1, [Get more functions for correct standard I/O]) |
10 |
– |
AC_DEFINE(_FILE_OFFSET_BITS, 64, [Get 64-bit file size support]) |
11 |
– |
|
8 |
|
dnl Options. |
9 |
|
AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], [WANT_XF86_DGA=yes]) |
10 |
|
AC_ARG_ENABLE(xf86-vidmode, [ --enable-xf86-vidmode use the XFree86 VidMode extension [default=yes]], [WANT_XF86_VIDMODE=$enableval], [WANT_XF86_VIDMODE=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/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) |
97 |
– |
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= |
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) |
257 |
|
dnl Darwin seems to define mach_task_self() instead of task_self(). |
258 |
|
AC_CHECK_FUNCS(mach_task_self task_self) |
259 |
|
|
260 |
+ |
dnl Check for headers and functions related to pty support (sshpty.c) |
261 |
+ |
dnl From openssh-3.2.2p1 configure.ac |
262 |
+ |
|
263 |
+ |
AC_CHECK_HEADERS(strings.h login.h sys/bsdtty.h sys/stat.h util.h pty.h) |
264 |
+ |
AC_CHECK_FUNCS(_getpty vhangup strlcpy) |
265 |
+ |
|
266 |
+ |
case "$host" in |
267 |
+ |
*-*-hpux10.26) |
268 |
+ |
disable_ptmx_check=yes |
269 |
+ |
;; |
270 |
+ |
*-*-linux*) |
271 |
+ |
no_dev_ptmx=1 |
272 |
+ |
;; |
273 |
+ |
mips-sony-bsd|mips-sony-newsos4) |
274 |
+ |
AC_DEFINE(HAVE_NEWS4) |
275 |
+ |
;; |
276 |
+ |
*-*-sco3.2v4*) |
277 |
+ |
no_dev_ptmx=1 |
278 |
+ |
;; |
279 |
+ |
*-*-sco3.2v5*) |
280 |
+ |
no_dev_ptmx=1 |
281 |
+ |
;; |
282 |
+ |
esac |
283 |
+ |
|
284 |
+ |
if test -z "$no_dev_ptmx" ; then |
285 |
+ |
if test "x$disable_ptmx_check" != "xyes" ; then |
286 |
+ |
AC_CHECK_FILE("/dev/ptmx", |
287 |
+ |
[ |
288 |
+ |
AC_DEFINE_UNQUOTED(HAVE_DEV_PTMX) |
289 |
+ |
have_dev_ptmx=1 |
290 |
+ |
] |
291 |
+ |
) |
292 |
+ |
fi |
293 |
+ |
fi |
294 |
+ |
AC_CHECK_FILE("/dev/ptc", |
295 |
+ |
[ |
296 |
+ |
AC_DEFINE_UNQUOTED(HAVE_DEV_PTS_AND_PTC) |
297 |
+ |
have_dev_ptc=1 |
298 |
+ |
] |
299 |
+ |
) |
300 |
+ |
|
301 |
+ |
dnl (end of code from openssh-3.2.2p1 configure.ac) |
302 |
+ |
|
303 |
+ |
|
304 |
|
dnl Select system-dependant source files. |
305 |
|
SERIALSRC=serial_unix.cpp |
306 |
|
ETHERSRC=../dummy/ether_dummy.cpp |
631 |
|
] |
632 |
|
) |
633 |
|
AC_TRANSLATE_DEFINE(HAVE_SIGINFO_T, "$ac_cv_have_extended_signals") |
634 |
< |
|
634 |
> |
|
635 |
|
dnl Otherwise, check for subterfuges. |
636 |
|
if [[ "x$ac_cv_have_extended_signals" = "xno" ]]; then |
637 |
|
AC_CACHE_CHECK("whether we then have a subterfuge for your system", |
652 |
|
AC_TRANSLATE_DEFINE(HAVE_SIGCONTEXT_SUBTERFUGE, "$ac_cv_have_sigcontext_hack") |
653 |
|
fi |
654 |
|
|
655 |
+ |
dnl Check if we can ignore the fault (instruction skipping in SIGSEGV handler) |
656 |
+ |
AC_CACHE_CHECK("whether we can skip instruction in SIGSEGV handler", |
657 |
+ |
ac_cv_have_skip_instruction, [ |
658 |
+ |
AC_LANG_SAVE |
659 |
+ |
AC_LANG_CPLUSPLUS |
660 |
+ |
AC_TRY_RUN([ |
661 |
+ |
#define HAVE_SIGSEGV_SKIP_INSTRUCTION 1 |
662 |
+ |
#define CONFIGURE_TEST_SIGSEGV_RECOVERY |
663 |
+ |
#include "vm_alloc.cpp" |
664 |
+ |
#include "sigsegv.cpp" |
665 |
+ |
], ac_cv_have_skip_instruction=yes, ac_cv_have_skip_instruction=no, |
666 |
+ |
dnl When cross-compiling, do not assume anything. |
667 |
+ |
ac_cv_have_skip_instruction=no |
668 |
+ |
) |
669 |
+ |
AC_LANG_RESTORE |
670 |
+ |
] |
671 |
+ |
) |
672 |
+ |
AC_TRANSLATE_DEFINE(HAVE_SIGSEGV_SKIP_INSTRUCTION, "$ac_cv_have_skip_instruction") |
673 |
+ |
|
674 |
|
dnl Can we do Video on SEGV Signals ? |
675 |
|
CAN_VOSF=no |
676 |
|
if [[ "$ac_cv_have_extended_signals" = "yes" -o "$ac_cv_have_sigcontext_hack" = "yes" ]]; then |
761 |
|
], [AC_MSG_RESULT(yes); HAVE_GCC30=yes], AC_MSG_RESULT(no)) |
762 |
|
|
763 |
|
dnl Set "-fomit-frame-pointer" on i386 GCC 2.7 or higher. |
764 |
+ |
dnl Also set "-fno-exceptions" for C++ because exception handling requires |
765 |
+ |
dnl the frame pointer. |
766 |
|
if [[ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_I386" = "xyes" ]]; then |
767 |
|
CFLAGS="$CFLAGS -fomit-frame-pointer" |
768 |
< |
CXXFLAGS="$CXXFLAGS -fomit-frame-pointer" |
768 |
> |
CXXFLAGS="$CXXFLAGS -fomit-frame-pointer -fno-exceptions" |
769 |
|
fi |
770 |
|
|
771 |
|
dnl (gb) Do not merge constants since it breaks fpu/fpu_x86.cpp. |
887 |
|
CFLAGS="`echo $CFLAGS | sed -e 's/-g//g'` -Ofast" |
888 |
|
CXXFLAGS="`echo $CXXFLAGS | sed -e 's/-g//g'` -Ofast" |
889 |
|
CXXFLAGS="-LANG:std $CXXFLAGS" |
890 |
< |
LDFLAGS="$LDFLAGS -Ofast" |
890 |
> |
LDFLAGS="$LDFLAGS -ipa" |
891 |
|
fi |
892 |
|
|
893 |
|
dnl Generate Makefile. |