diff --git a/bochs/config.h.in b/bochs/config.h.in index 84e560927..593eb6440 100644 --- a/bochs/config.h.in +++ b/bochs/config.h.in @@ -499,6 +499,7 @@ typedef unsigned int Boolean; #define BX_HAVE_STRTOULL 0 #define BX_HAVE_STRTOUQ 0 #define BX_HAVE_STRDUP 0 +#define BX_HAVE_STRUCT_TIMEVAL 0 // set if your compiler does not permit an empty struct #define BX_NO_EMPTY_STRUCTS 0 diff --git a/bochs/configure b/bochs/configure index ee4dd04e9..6024c4983 100755 --- a/bochs/configure +++ b/bochs/configure @@ -2585,17 +2585,44 @@ fi done -echo $ac_n "checking if compiler allows empty structs""... $ac_c" 1>&6 -echo "configure:2590: checking if compiler allows empty structs" >&5 +echo $ac_n "checking for struct timeval""... $ac_c" 1>&6 +echo "configure:2590: checking for struct timeval" >&5 cat > conftest.$ac_ext < +int main() { +struct timeval x; +; return 0; } +EOF +if { (eval echo configure:2599: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then + rm -rf conftest* + + echo "$ac_t""yes" 1>&6 + cat >> confdefs.h <<\EOF +#define BX_HAVE_STRUCT_TIMEVAL 1 +EOF + + +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "$ac_t""no" 1>&6 +fi +rm -f conftest* + +echo $ac_n "checking if compiler allows empty structs""... $ac_c" 1>&6 +echo "configure:2617: checking if compiler allows empty structs" >&5 +cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2626: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2613,16 +2640,16 @@ fi rm -f conftest* echo $ac_n "checking if compiler allows __attribute__""... $ac_c" 1>&6 -echo "configure:2617: checking if compiler allows __attribute__" >&5 +echo "configure:2644: checking if compiler allows __attribute__" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2653: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2648,16 +2675,16 @@ ac_link='${CXX-g++} -o conftest${ac_exeext} $CXXFLAGS $CPPFLAGS $LDFLAGS conftes cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking for hash_map.h""... $ac_c" 1>&6 -echo "configure:2652: checking for hash_map.h" >&5 +echo "configure:2679: checking for hash_map.h" >&5 cat > conftest.$ac_ext < int main() { ; return 0; } EOF -if { (eval echo configure:2661: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2688: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 @@ -2682,7 +2709,7 @@ cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking for control panel""... $ac_c" 1>&6 -echo "configure:2686: checking for control panel" >&5 +echo "configure:2713: checking for control panel" >&5 # Check whether --enable-control-panel or --disable-control-panel was given. if test "${enable_control_panel+set}" = set; then enableval="$enable_control_panel" @@ -2714,7 +2741,7 @@ fi echo $ac_n "checking for number of processors""... $ac_c" 1>&6 -echo "configure:2718: checking for number of processors" >&5 +echo "configure:2745: checking for number of processors" >&5 # Check whether --enable-processors or --disable-processors was given. if test "${enable_processors+set}" = set; then enableval="$enable_processors" @@ -2818,16 +2845,16 @@ fi echo $ac_n "checking if compiler allows blank labels""... $ac_c" 1>&6 -echo "configure:2822: checking if compiler allows blank labels" >&5 +echo "configure:2849: checking if compiler allows blank labels" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2858: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2845,16 +2872,16 @@ fi rm -f conftest* echo $ac_n "checking if compiler allows LL for 64-bit constants""... $ac_c" 1>&6 -echo "configure:2849: checking if compiler allows LL for 64-bit constants" >&5 +echo "configure:2876: checking if compiler allows LL for 64-bit constants" >&5 cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2885: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* echo "$ac_t""yes" 1>&6 else @@ -2872,7 +2899,7 @@ fi rm -f conftest* echo $ac_n "checking for cpu level""... $ac_c" 1>&6 -echo "configure:2876: checking for cpu level" >&5 +echo "configure:2903: checking for cpu level" >&5 # Check whether --enable-cpu-level or --disable-cpu-level was given. if test "${enable_cpu_level+set}" = set; then enableval="$enable_cpu_level" @@ -2966,7 +2993,7 @@ fi echo $ac_n "checking for dynamic translation support""... $ac_c" 1>&6 -echo "configure:2970: checking for dynamic translation support" >&5 +echo "configure:2997: checking for dynamic translation support" >&5 # Check whether --enable-dynamic or --disable-dynamic was given. if test "${enable_dynamic+set}" = set; then enableval="$enable_dynamic" @@ -3039,7 +3066,7 @@ fi echo $ac_n "checking for APIC support""... $ac_c" 1>&6 -echo "configure:3043: checking for APIC support" >&5 +echo "configure:3070: checking for APIC support" >&5 # Check whether --enable-apic or --disable-apic was given. if test "${enable_apic+set}" = set; then enableval="$enable_apic" @@ -3094,7 +3121,7 @@ fi echo $ac_n "checking for split hard disk image support""... $ac_c" 1>&6 -echo "configure:3098: checking for split hard disk image support" >&5 +echo "configure:3125: checking for split hard disk image support" >&5 # Check whether --enable-split-hd or --disable-split-hd was given. if test "${enable_split_hd+set}" = set; then enableval="$enable_split_hd" @@ -3125,7 +3152,7 @@ fi echo $ac_n "checking for NE2000 support""... $ac_c" 1>&6 -echo "configure:3129: checking for NE2000 support" >&5 +echo "configure:3156: checking for NE2000 support" >&5 # Check whether --enable-ne2000 or --disable-ne2000 was given. if test "${enable_ne2000+set}" = set; then enableval="$enable_ne2000" @@ -3138,17 +3165,17 @@ EOF NE2K_OBJS='ne2k.o eth.o eth_null.o' ac_safe=`echo "net/bpf.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for net/bpf.h""... $ac_c" 1>&6 -echo "configure:3142: checking for net/bpf.h" >&5 +echo "configure:3169: checking for net/bpf.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3152: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3179: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3193,7 +3220,7 @@ fi echo $ac_n "checking for i440FX PCI support""... $ac_c" 1>&6 -echo "configure:3197: checking for i440FX PCI support" >&5 +echo "configure:3224: checking for i440FX PCI support" >&5 # Check whether --enable-pci or --disable-pci was given. if test "${enable_pci+set}" = set; then enableval="$enable_pci" @@ -3228,7 +3255,7 @@ fi echo $ac_n "checking for port e9 hack""... $ac_c" 1>&6 -echo "configure:3232: checking for port e9 hack" >&5 +echo "configure:3259: checking for port e9 hack" >&5 # Check whether --enable-port-e9-hack or --disable-port-e9-hack was given. if test "${enable_port_e9_hack+set}" = set; then enableval="$enable_port_e9_hack" @@ -3259,7 +3286,7 @@ fi echo $ac_n "checking for use of .cpp as suffix""... $ac_c" 1>&6 -echo "configure:3263: checking for use of .cpp as suffix" >&5 +echo "configure:3290: checking for use of .cpp as suffix" >&5 # Check whether --enable-cpp or --disable-cpp was given. if test "${enable_cpp+set}" = set; then enableval="$enable_cpp" @@ -3301,7 +3328,7 @@ fi echo $ac_n "checking for Bochs internal debugger support""... $ac_c" 1>&6 -echo "configure:3305: checking for Bochs internal debugger support" >&5 +echo "configure:3332: checking for Bochs internal debugger support" >&5 # Check whether --enable-debugger or --disable-debugger was given. if test "${enable_debugger+set}" = set; then enableval="$enable_debugger" @@ -3339,7 +3366,7 @@ fi echo $ac_n "checking for disassembler support""... $ac_c" 1>&6 -echo "configure:3343: checking for disassembler support" >&5 +echo "configure:3370: checking for disassembler support" >&5 # Check whether --enable-disasm or --disable-disasm was given. if test "${enable_disasm+set}" = set; then enableval="$enable_disasm" @@ -3386,7 +3413,7 @@ fi echo $ac_n "checking whether to use readline""... $ac_c" 1>&6 -echo "configure:3390: checking whether to use readline" >&5 +echo "configure:3417: checking whether to use readline" >&5 # Check whether --enable-readline or --disable-readline was given. if test "${enable_readline+set}" = set; then enableval="$enable_readline" @@ -3408,7 +3435,7 @@ fi if test "$want_readline" = yes; then echo $ac_n "checking for readline in -lreadline""... $ac_c" 1>&6 -echo "configure:3412: checking for readline in -lreadline" >&5 +echo "configure:3439: checking for readline in -lreadline" >&5 ac_lib_var=`echo readline'_'readline | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3416,7 +3443,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lreadline $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3458: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -3462,17 +3489,17 @@ fi ac_safe=`echo "readline/history.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for readline/history.h""... $ac_c" 1>&6 -echo "configure:3466: checking for readline/history.h" >&5 +echo "configure:3493: checking for readline/history.h" >&5 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:3476: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3503: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` if test -z "$ac_err"; then rm -rf conftest* @@ -3500,7 +3527,7 @@ fi echo $ac_n "checking for loader support""... $ac_c" 1>&6 -echo "configure:3504: checking for loader support" >&5 +echo "configure:3531: checking for loader support" >&5 # Check whether --enable-loader or --disable-loader was given. if test "${enable_loader+set}" = set; then enableval="$enable_loader" @@ -3538,7 +3565,7 @@ fi INSTRUMENT_DIR='instrument/stubs' echo $ac_n "checking for instrumentation support""... $ac_c" 1>&6 -echo "configure:3542: checking for instrumentation support" >&5 +echo "configure:3569: checking for instrumentation support" >&5 # Check whether --enable-instrumentation or --disable-instrumentation was given. if test "${enable_instrumentation+set}" = set; then enableval="$enable_instrumentation" @@ -3673,7 +3700,7 @@ fi echo $ac_n "checking for VGA emulation""... $ac_c" 1>&6 -echo "configure:3677: checking for VGA emulation" >&5 +echo "configure:3704: checking for VGA emulation" >&5 # Check whether --enable-vga or --disable-vga was given. if test "${enable_vga+set}" = set; then enableval="$enable_vga" @@ -3707,7 +3734,7 @@ fi echo $ac_n "checking for FPU emulation""... $ac_c" 1>&6 -echo "configure:3711: checking for FPU emulation" >&5 +echo "configure:3738: checking for FPU emulation" >&5 FPU_VAR='' FPU_GLUE_OBJ='' # Check whether --enable-fpu or --disable-fpu was given. @@ -3752,7 +3779,7 @@ fi echo $ac_n "checking for x86 debugger support""... $ac_c" 1>&6 -echo "configure:3756: checking for x86 debugger support" >&5 +echo "configure:3783: checking for x86 debugger support" >&5 # Check whether --enable-x86-debugger or --disable-x86-debugger was given. if test "${enable_x86_debugger+set}" = set; then enableval="$enable_x86_debugger" @@ -3788,7 +3815,7 @@ fi echo $ac_n "checking for CDROM support""... $ac_c" 1>&6 -echo "configure:3792: checking for CDROM support" >&5 +echo "configure:3819: checking for CDROM support" >&5 # Check whether --enable-cdrom or --disable-cdrom was given. if test "${enable_cdrom+set}" = set; then enableval="$enable_cdrom" @@ -3830,7 +3857,7 @@ fi echo $ac_n "checking for Sound Blaster 16 support""... $ac_c" 1>&6 -echo "configure:3834: checking for Sound Blaster 16 support" >&5 +echo "configure:3861: checking for Sound Blaster 16 support" >&5 # Check whether --enable-sb16 or --disable-sb16 was given. if test "${enable_sb16+set}" = set; then enableval="$enable_sb16" @@ -3979,7 +4006,7 @@ fi echo $ac_n "checking for gui library to use""... $ac_c" 1>&6 -echo "configure:3983: checking for gui library to use" >&5 +echo "configure:4010: checking for gui library to use" >&5 if (test "$with_x11" != yes) && \ (test "$with_beos" != yes) && \ @@ -4125,7 +4152,7 @@ fi if test "$use_curses" = yes; then echo $ac_n "checking for mvaddch in -lcurses""... $ac_c" 1>&6 -echo "configure:4129: checking for mvaddch in -lcurses" >&5 +echo "configure:4156: checking for mvaddch in -lcurses" >&5 ac_lib_var=`echo curses'_'mvaddch | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4133,7 +4160,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4175: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4165,7 +4192,7 @@ else fi echo $ac_n "checking for mvaddch in -lncurses""... $ac_c" 1>&6 -echo "configure:4169: checking for mvaddch in -lncurses" >&5 +echo "configure:4196: checking for mvaddch in -lncurses" >&5 ac_lib_var=`echo ncurses'_'mvaddch | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4173,7 +4200,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lncurses $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4215: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4205,7 +4232,7 @@ else fi echo $ac_n "checking for mvaddch in -ltermlib""... $ac_c" 1>&6 -echo "configure:4209: checking for mvaddch in -ltermlib" >&5 +echo "configure:4236: checking for mvaddch in -ltermlib" >&5 ac_lib_var=`echo termlib'_'mvaddch | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4213,7 +4240,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ltermlib $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4255: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4253,18 +4280,18 @@ fi if test "$with_rfb" = yes; then # first see if compiler takes "-pthread" argument echo $ac_n "checking for -pthread arg to compiler""... $ac_c" 1>&6 -echo "configure:4257: checking for -pthread arg to compiler" >&5 +echo "configure:4284: checking for -pthread arg to compiler" >&5 CFLAGS_SAVE="$CFLAGS" CFLAGS="$CFLAGS -pthread" cat > conftest.$ac_ext < int main() { pthread_create(0,0,0,0); ; return 0; } EOF -if { (eval echo configure:4268: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4295: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* # it compiles with -pthread @@ -4280,7 +4307,7 @@ else # now try with -lpthread CFLAGS="$CFLAGS_SAVE" echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:4284: checking for pthread_create in -lpthread" >&5 +echo "configure:4311: checking for pthread_create in -lpthread" >&5 ac_lib_var=`echo pthread'_'pthread_create | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -4288,7 +4315,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4330: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_lib_$ac_lib_var=yes" else @@ -4351,7 +4378,7 @@ fi # Extract the first word of "gzip", so it can be a program name with args. set dummy gzip; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4355: checking for $ac_word" >&5 +echo "configure:4382: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GZIP'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -4386,7 +4413,7 @@ fi # Extract the first word of "tar", so it can be a program name with args. set dummy tar; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:4390: checking for $ac_word" >&5 +echo "configure:4417: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_TAR'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else diff --git a/bochs/configure.in b/bochs/configure.in index a7dc401f1..6d0833015 100644 --- a/bochs/configure.in +++ b/bochs/configure.in @@ -28,6 +28,15 @@ AC_CHECK_FUNCS(strtoull, AC_DEFINE(BX_HAVE_STRTOULL)) AC_CHECK_FUNCS(strtouq, AC_DEFINE(BX_HAVE_STRTOUQ)) AC_CHECK_FUNCS(strdup, AC_DEFINE(BX_HAVE_STRDUP)) +AC_MSG_CHECKING(for struct timeval) +AC_TRY_COMPILE([#include ], + [struct timeval x;], + [ + AC_MSG_RESULT(yes) + AC_DEFINE(BX_HAVE_STRUCT_TIMEVAL, 1) + ], + AC_MSG_RESULT(no)) + AC_MSG_CHECKING(if compiler allows empty structs) AC_TRY_COMPILE([], [typedef struct { } junk;], AC_MSG_RESULT(yes),