- add configure test for BX_HAVE_GETTIMEOFDAY

- hardcode BX_HAVE_GETTIMEOFDAY=0 if cross compiling for VC++
  (this part hasn't been tested)
- modified files: configure configure.in config.h.in iodev/pit_wrap.cc
This commit is contained in:
Bryce Denney 2002-09-22 01:56:18 +00:00
parent 3bfeab23c9
commit e41655a78c
4 changed files with 91 additions and 14 deletions

View File

@ -194,6 +194,7 @@
#define BX_HAVE_NANOSLEEP 0
#define BX_HAVE_ABORT 0
#define BX_HAVE_SOCKLEN_T 0
#define BX_HAVE_GETTIMEOFDAY 0
// This turns on Roland Mainz's idle hack. Presently it is specific to the X11
// gui. If people try to enable it elsewhere, give a compile error after the

96
bochs/configure vendored
View File

@ -1,5 +1,5 @@
#! /bin/sh
# From configure.in Id: configure.in,v 1.116 2002/09/20 15:34:51 kevinlawton Exp .
# From configure.in Id: configure.in,v 1.117 2002/09/20 23:16:23 bdenney Exp .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.53.
#
@ -7510,6 +7510,85 @@ _ACEOF
fi
done
for ac_func in gettimeofday
do
as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
echo "$as_me:$LINENO: checking for $ac_func" >&5
echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6
if eval "test \"\${$as_ac_var+set}\" = set"; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
#line $LINENO "configure"
#include "confdefs.h"
/* System header to define __stub macros and hopefully few prototypes,
which can conflict with char $ac_func (); below. */
#include <assert.h>
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char $ac_func ();
char (*f) ();
#ifdef F77_DUMMY_MAIN
# ifdef __cplusplus
extern "C"
# endif
int F77_DUMMY_MAIN() { return 1; }
#endif
int
main ()
{
/* The GNU C library defines this for functions which it implements
to always fail with ENOSYS. Some functions are actually named
something starting with __ and the normal name is an alias. */
#if defined (__stub_$ac_func) || defined (__stub___$ac_func)
choke me
#else
f = $ac_func;
#endif
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
eval "$as_ac_var=yes"
else
echo "$as_me: failed program was:" >&5
cat conftest.$ac_ext >&5
eval "$as_ac_var=no"
fi
rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5
echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6
if test `eval echo '${'$as_ac_var'}'` = yes; then
cat >>confdefs.h <<_ACEOF
#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
_ACEOF
cat >>confdefs.h <<\_ACEOF
#define BX_HAVE_GETTIMEOFDAY 1
_ACEOF
fi
done
echo "$as_me:$LINENO: checking for socklen_t" >&5
echo $ECHO_N "checking for socklen_t... $ECHO_C" >&6
if test "${ac_cv_type_socklen_t+set}" = set; then
@ -8174,8 +8253,6 @@ if test "${enable_x86_64+set}" = set; then
echo "$as_me:$LINENO: result: yes" >&5
echo "${ECHO_T}yes" >&6
OBJS64='$(OBJS64)'
CPU32LIB='cpu/libcpu.a'
CPU32OBJS='cpu/*.o'
cat >>confdefs.h <<\_ACEOF
#define BX_SUPPORT_X86_64 1
_ACEOF
@ -8185,8 +8262,6 @@ _ACEOF
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
OBJS64=''
CPU32LIB=''
CPU32OBJS=''
cat >>confdefs.h <<\_ACEOF
#define BX_SUPPORT_X86_64 0
_ACEOF
@ -8198,8 +8273,6 @@ else
echo "$as_me:$LINENO: result: no" >&5
echo "${ECHO_T}no" >&6
OBJS64=''
CPU32LIB=''
CPU32OBJS=''
cat >>confdefs.h <<\_ACEOF
#define BX_SUPPORT_X86_64 0
_ACEOF
@ -8209,8 +8282,6 @@ _ACEOF
fi;
echo "$as_me:$LINENO: checking for cpu level" >&5
echo $ECHO_N "checking for cpu level... $ECHO_C" >&6
# Check whether --enable-cpu-level or --disable-cpu-level was given.
@ -10346,6 +10417,7 @@ _ACEOF
COMMAND_SEPARATOR=""
CD_UP_ONE="cd .."
CD_UP_TWO="cd ..\.."
have_gettimeofday=0 # even though it may exist in build environment
cat >>confdefs.h <<\_ACEOF
#define BX_64BIT_CONSTANTS_USE_LL 0
_ACEOF
@ -10376,6 +10448,10 @@ _ACEOF
cat >>confdefs.h <<\_ACEOF
#define HAVE_LIBREADLINE 0
_ACEOF
cat >>confdefs.h <<\_ACEOF
#define BX_HAVE_GETTIMEOFDAY 0
_ACEOF
;;
@ -11853,8 +11929,6 @@ s,@BX_USE_SLOWDOWN_TIMER@,$BX_USE_SLOWDOWN_TIMER,;t t
s,@SLOWDOWN_OBJS@,$SLOWDOWN_OBJS,;t t
s,@BX_USE_IDLE_HACK@,$BX_USE_IDLE_HACK,;t t
s,@OBJS64@,$OBJS64,;t t
s,@CPU32LIB@,$CPU32LIB,;t t
s,@CPU32OBJS@,$CPU32OBJS,;t t
s,@IOAPIC_OBJS@,$IOAPIC_OBJS,;t t
s,@APIC_OBJS@,$APIC_OBJS,;t t
s,@BX_SPLIT_HD_SUPPORT@,$BX_SPLIT_HD_SUPPORT,;t t

View File

@ -2,7 +2,7 @@ dnl // Process this file with autoconf to produce a configure script.
AC_PREREQ(2.5)
AC_INIT(bochs.h)
AC_REVISION([[$Id: configure.in,v 1.117 2002-09-20 23:16:23 bdenney Exp $]])
AC_REVISION([[$Id: configure.in,v 1.118 2002-09-22 01:56:18 bdenney Exp $]])
AC_CONFIG_HEADER(config.h)
dnl // Put Bochs version information right here so that it gets substituted
@ -103,6 +103,7 @@ AC_CHECK_FUNCS(sleep, AC_DEFINE(BX_HAVE_SLEEP))
AC_CHECK_FUNCS(usleep, AC_DEFINE(BX_HAVE_USLEEP))
AC_CHECK_FUNCS(nanosleep, AC_DEFINE(BX_HAVE_NANOSLEEP))
AC_CHECK_FUNCS(abort, AC_DEFINE(BX_HAVE_ABORT))
AC_CHECK_FUNCS(gettimeofday, AC_DEFINE(BX_HAVE_GETTIMEOFDAY))
AC_CHECK_TYPE(socklen_t, AC_DEFINE(BX_HAVE_SOCKLEN_T), , [#include <sys/types.h>
#include <sys/socket.h>])
@ -1332,6 +1333,7 @@ case "$target" in
COMMAND_SEPARATOR=""
CD_UP_ONE="cd .."
CD_UP_TWO="cd ..\.."
have_gettimeofday=0 # even though it may exist in build environment
AC_DEFINE(BX_64BIT_CONSTANTS_USE_LL, 0)
AC_DEFINE(inline, __inline)
AC_DEFINE(BX_NO_EMPTY_STRUCTS, 1)
@ -1340,6 +1342,7 @@ case "$target" in
AC_DEFINE(BX_HAVE_STRTOULL, 0)
AC_DEFINE(BX_HAVE_STRTOUQ, 0)
AC_DEFINE(HAVE_LIBREADLINE, 0)
AC_DEFINE(BX_HAVE_GETTIMEOFDAY, 0)
;;
esac

View File

@ -1,5 +1,5 @@
/////////////////////////////////////////////////////////////////////////
// $Id: pit_wrap.cc,v 1.25 2002-09-21 04:02:51 yakovlev Exp $
// $Id: pit_wrap.cc,v 1.26 2002-09-22 01:56:18 bdenney Exp $
/////////////////////////////////////////////////////////////////////////
//
// Copyright (C) 2002 MandrakeSoft S.A.
@ -77,7 +77,6 @@ bx_pit_c bx_pit;
#endif
#define DEBUG_REALTIME_WITH_PRINTF 0
#define BX_HAVE_GETTIMEOFDAY 1
#define DEBUG_GETTIMEOFDAY_WITH_PRINTF 1