From e8bcb173e590b1d2b9513c28a4cb11e7ead20a02 Mon Sep 17 00:00:00 2001 From: Bryce Denney Date: Fri, 7 Dec 2001 22:18:40 +0000 Subject: [PATCH] - detect when MacOS X cdrom code can be used: when the header file "IOKit/storage/IOCDMedia.h" is available. --- bochs/configure | 89 ++++++++++++++++++++++++++++++++++------------ bochs/configure.in | 11 +++--- 2 files changed, 72 insertions(+), 28 deletions(-) diff --git a/bochs/configure b/bochs/configure index d2a70da11..34053138d 100755 --- a/bochs/configure +++ b/bochs/configure @@ -88,7 +88,7 @@ ac_help="$ac_help ac_help="$ac_help --with-rfb use RFB protocol, works with VNC viewer" ac_help="$ac_help - --with-amigaos use MorphOS (Amiga)" + --with-amigaos use MorphOS (Amiga)" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -4297,12 +4297,47 @@ EOF fi +ac_safe=`echo "IOKit/storage/IOCDMedia.h" | sed 'y%./+-%__p_%'` +echo $ac_n "checking for IOKit/storage/IOCDMedia.h""... $ac_c" 1>&6 +echo "configure:4303: checking for IOKit/storage/IOCDMedia.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:4313: \"$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* + eval "ac_cv_header_$ac_safe=yes" +else + echo "$ac_err" >&5 + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_header_$ac_safe=no" +fi +rm -f conftest* +fi +if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then + echo "$ac_t""yes" 1>&6 + can_use_osx_cdrom=yes + +else + echo "$ac_t""no" 1>&6 +fi + + echo $ac_n "checking for CDROM support""... $ac_c" 1>&6 -echo "configure:4302: checking for CDROM support" >&5 +echo "configure:4337: checking for CDROM support" >&5 # Check whether --enable-cdrom or --disable-cdrom was given. if test "${enable_cdrom+set}" = set; then enableval="$enable_cdrom" - if test "$enableval" = no; then + if test "$enableval" = no; then echo "$ac_t""no" 1>&6 CDROM_OBJS='' cat >> confdefs.h <<\EOF @@ -4315,6 +4350,11 @@ EOF if test "$with_amigaos" = yes; then # use the amiga cdrom file instead. CDROM_OBJS="cdrom_amigaos.o" + elif test "$can_use_osx_cdrom" = yes; then + # use cdrom_osx + echo "$ac_t""Using OSX IOKit CD Interface" 1>&6 + CDROM_OBJS="cdrom_osx.o" + EXTRA_LINK_OPTS="${EXTRA_LINK_OPTS} -framework IOKit -framework CoreFoundation" elif test "$with_beos" = yes; then # use the beos cdrom file instead CDROM_OBJS="$CDROM_OBJS cdrom_beos.o" @@ -4339,8 +4379,9 @@ fi + echo $ac_n "checking for Sound Blaster 16 support""... $ac_c" 1>&6 -echo "configure:4344: checking for Sound Blaster 16 support" >&5 +echo "configure:4385: 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" @@ -4414,7 +4455,7 @@ fi echo $ac_n "checking for I/O Interface to the debugger""... $ac_c" 1>&6 -echo "configure:4418: checking for I/O Interface to the debugger" >&5 +echo "configure:4459: checking for I/O Interface to the debugger" >&5 IODEBUG_OBJS='' # Check whether --enable-iodebug or --disable-iodebug was given. if test "${enable_iodebug+set}" = set; then @@ -4539,7 +4580,7 @@ fi echo $ac_n "checking for gui library to use""... $ac_c" 1>&6 -echo "configure:4543: checking for gui library to use" >&5 +echo "configure:4584: checking for gui library to use" >&5 if (test "$with_x11" != yes) && \ (test "$with_beos" != yes) && \ @@ -4726,7 +4767,7 @@ fi if test "$use_curses" = yes; then echo $ac_n "checking for mvaddch in -lcurses""... $ac_c" 1>&6 -echo "configure:4730: checking for mvaddch in -lcurses" >&5 +echo "configure:4771: 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 @@ -4734,7 +4775,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:4790: \"$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 @@ -4766,7 +4807,7 @@ else fi echo $ac_n "checking for mvaddch in -lncurses""... $ac_c" 1>&6 -echo "configure:4770: checking for mvaddch in -lncurses" >&5 +echo "configure:4811: 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 @@ -4774,7 +4815,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:4830: \"$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 @@ -4806,7 +4847,7 @@ else fi echo $ac_n "checking for mvaddch in -ltermlib""... $ac_c" 1>&6 -echo "configure:4810: checking for mvaddch in -ltermlib" >&5 +echo "configure:4851: 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 @@ -4814,7 +4855,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:4870: \"$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 @@ -4854,18 +4895,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:4858: checking for -pthread arg to compiler" >&5 +echo "configure:4899: 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:4869: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:4910: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* # it compiles with -pthread @@ -4881,7 +4922,7 @@ else # now try with -lpthread CFLAGS="$CFLAGS_SAVE" echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:4885: checking for pthread_create in -lpthread" >&5 +echo "configure:4926: 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 @@ -4889,7 +4930,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:4945: \"$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 @@ -4959,12 +5000,13 @@ if test ! -d build/linux; then mkdir build/linux; 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:4968: checking for $ac_word" >&5 +echo "configure:5010: 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 @@ -4999,7 +5041,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:5003: checking for $ac_word" >&5 +echo "configure:5045: 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 @@ -5231,6 +5273,7 @@ s%@CD_UP_TWO@%$CD_UP_TWO%g s%@VERSION@%$VERSION%g s%@VER_STRING@%$VER_STRING%g s%@REL_STRING@%$REL_STRING%g +s%@EXTRA_LINK_OPTS@%$EXTRA_LINK_OPTS%g s%@GZIP@%$GZIP%g s%@TAR@%$TAR%g diff --git a/bochs/configure.in b/bochs/configure.in index e66467a75..160c0ed9f 100644 --- a/bochs/configure.in +++ b/bochs/configure.in @@ -764,6 +764,10 @@ AC_ARG_ENABLE(x86-debugger, ] ) +AC_CHECK_HEADER(IOKit/storage/IOCDMedia.h, + can_use_osx_cdrom=yes + ) + AC_MSG_CHECKING(for CDROM support) AC_ARG_ENABLE(cdrom, [ --enable-cdrom CDROM support], @@ -777,7 +781,7 @@ AC_ARG_ENABLE(cdrom, if test "$with_amigaos" = yes; then # use the amiga cdrom file instead. CDROM_OBJS="cdrom_amigaos.o" - elif test "$with_osxcdrom" = yes; then + elif test "$can_use_osx_cdrom" = yes; then # use cdrom_osx AC_MSG_RESULT(Using OSX IOKit CD Interface) CDROM_OBJS="cdrom_osx.o" @@ -794,6 +798,7 @@ AC_ARG_ENABLE(cdrom, AC_DEFINE(BX_SUPPORT_CDROM, 0) ] ) + AC_SUBST(CDROM_OBJS) @@ -919,10 +924,6 @@ AC_ARG_WITH(amigaos, [ --with-amigaos use MorphOS (Amiga)], ) -AC_ARG_WITH(osxcdrom, - [ --with-osxcdrom use Mac OSX cdrom driver], - ) - AC_MSG_CHECKING(for gui library to use) dnl // make sure X Windows is default if no other chosen