From 6d8e94c1dd0669d7a1e799fac60a5cb20262be63 Mon Sep 17 00:00:00 2001 From: cebix <> Date: Sat, 23 Oct 1999 17:58:00 +0000 Subject: [PATCH] - audio_linux.cpp renamed to audio_oss_esd.cpp (now also used under FreeBSD) and added support for ESD - medium removal is allowed for CD-ROM on exit - added mkinstalldirs to "make install" target --- BasiliskII/ChangeLog | 8 + BasiliskII/src/Unix/Makefile.in | 6 +- BasiliskII/src/Unix/aclocal.m4 | 166 ++++ .../audio_linux.cpp => audio_oss_esd.cpp} | 181 ++-- BasiliskII/src/Unix/config.h.in | 6 + BasiliskII/src/Unix/configure | 911 +++++++++++------- BasiliskII/src/Unix/configure.in | 116 +-- BasiliskII/src/Unix/mkinstalldirs | 40 + BasiliskII/src/Unix/user_strings_unix.cpp | 1 + BasiliskII/src/Unix/user_strings_unix.h | 1 + BasiliskII/src/cdrom.cpp | 1 + 11 files changed, 994 insertions(+), 443 deletions(-) rename BasiliskII/src/Unix/{Linux/audio_linux.cpp => audio_oss_esd.cpp} (72%) create mode 100755 BasiliskII/src/Unix/mkinstalldirs diff --git a/BasiliskII/ChangeLog b/BasiliskII/ChangeLog index 516c6a86..57f17b3f 100644 --- a/BasiliskII/ChangeLog +++ b/BasiliskII/ChangeLog @@ -1,3 +1,11 @@ +V0.8 - + - medium removal is allowed in CDROMExit() + - Unix: added support for ESD audio output; merged with OSS audio + and put in a new "audio_oss_esd.cpp" file which is also used under + FreeBSD 3.x + - Unix: added mkinstalldirs to "make install" target + - Unix: cleaned up the configure script + V0.8 (snapshot) - 21.Oct.1999 - sony.cpp/disk.cpp/cdrom.cpp: disk insertions are now checked for by an interrupt routine diff --git a/BasiliskII/src/Unix/Makefile.in b/BasiliskII/src/Unix/Makefile.in index 184d2bfd..74a7e420 100644 --- a/BasiliskII/src/Unix/Makefile.in +++ b/BasiliskII/src/Unix/Makefile.in @@ -62,13 +62,15 @@ $(APP): $(OBJ_DIR) $(OBJS) modules: cd Linux/NetDriver; make -install: $(APP) +install: $(APP) installdirs $(INSTALL_PROGRAM) $(APP) $(bindir)/$(APP) -$(INSTALL_DATA) $(APP).1 $(man1dir)/$(APP).1 - $(INSTALL) -d $(datadir)/$(APP) $(INSTALL_DATA) keycodes $(datadir)/$(APP)/keycodes $(INSTALL_DATA) fbdevices $(datadir)/$(APP)/fbdevices +installdirs: + $(SHELL) mkinstalldirs $(bindir) $(man1dir) $(datadir)/$(APP) + uninstall: rm -f $(bindir)/$(APP) rm -f $(man1dir)/$(APP).1 diff --git a/BasiliskII/src/Unix/aclocal.m4 b/BasiliskII/src/Unix/aclocal.m4 index 463c4367..6aeeeabb 100644 --- a/BasiliskII/src/Unix/aclocal.m4 +++ b/BasiliskII/src/Unix/aclocal.m4 @@ -168,3 +168,169 @@ main () AC_SUBST(GTK_LIBS) rm -f conf.gtktest ]) + + +# Configure paths for ESD +# Manish Singh 98-9-30 +# stolen back from Frank Belew +# stolen from Manish Singh +# Shamelessly stolen from Owen Taylor + +dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) +dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS +dnl +AC_DEFUN(AM_PATH_ESD, +[dnl +dnl Get the cflags and libraries from the esd-config script +dnl +AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)], + esd_prefix="$withval", esd_prefix="") +AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)], + esd_exec_prefix="$withval", esd_exec_prefix="") +AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program], + , enable_esdtest=yes) + + if test x$esd_exec_prefix != x ; then + esd_args="$esd_args --exec-prefix=$esd_exec_prefix" + if test x${ESD_CONFIG+set} != xset ; then + ESD_CONFIG=$esd_exec_prefix/bin/esd-config + fi + fi + if test x$esd_prefix != x ; then + esd_args="$esd_args --prefix=$esd_prefix" + if test x${ESD_CONFIG+set} != xset ; then + ESD_CONFIG=$esd_prefix/bin/esd-config + fi + fi + + AC_PATH_PROG(ESD_CONFIG, esd-config, no) + min_esd_version=ifelse([$1], ,0.2.7,$1) + AC_MSG_CHECKING(for ESD - version >= $min_esd_version) + no_esd="" + if test "$ESD_CONFIG" = "no" ; then + no_esd=yes + else + ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` + ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` + + esd_major_version=`$ESD_CONFIG $esd_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` + esd_minor_version=`$ESD_CONFIG $esd_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` + esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` + if test "x$enable_esdtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $ESD_CFLAGS" + LIBS="$LIBS $ESD_LIBS" +dnl +dnl Now check if the installed ESD is sufficiently new. (Also sanity +dnl checks the results of esd-config to some extent +dnl + rm -f conf.esdtest + AC_TRY_RUN([ +#include +#include +#include +#include + +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } + else + new_str = NULL; + + return new_str; +} + +int main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.esdtest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_esd_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_esd_version"); + exit(1); + } + + if (($esd_major_version > major) || + (($esd_major_version == major) && ($esd_minor_version > minor)) || + (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); + printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); + printf("*** to point to the correct copy of esd-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 1; + } +} + +],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + if test "x$no_esd" = x ; then + AC_MSG_RESULT(yes) + ifelse([$2], , :, [$2]) + else + AC_MSG_RESULT(no) + if test "$ESD_CONFIG" = "no" ; then + echo "*** The esd-config script installed by ESD could not be found" + echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the ESD_CONFIG environment variable to the" + echo "*** full path to esd-config." + else + if test -f conf.esdtest ; then + : + else + echo "*** Could not run ESD test program, checking why..." + CFLAGS="$CFLAGS $ESD_CFLAGS" + LIBS="$LIBS $ESD_LIBS" + AC_TRY_LINK([ +#include +#include +], [ return 0; ], + [ echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding ESD or finding the wrong" + echo "*** version of ESD. If it is not finding ESD, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"], + [ echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means ESD was incorrectly installed" + echo "*** or that you have moved ESD since it was installed. In the latter case, you" + echo "*** may want to edit the esd-config script: $ESD_CONFIG" ]) + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + ESD_CFLAGS="" + ESD_LIBS="" + ifelse([$3], , :, [$3]) + fi + AC_SUBST(ESD_CFLAGS) + AC_SUBST(ESD_LIBS) + rm -f conf.esdtest +]) diff --git a/BasiliskII/src/Unix/Linux/audio_linux.cpp b/BasiliskII/src/Unix/audio_oss_esd.cpp similarity index 72% rename from BasiliskII/src/Unix/Linux/audio_linux.cpp rename to BasiliskII/src/Unix/audio_oss_esd.cpp index 1f121f52..ad049ee4 100644 --- a/BasiliskII/src/Unix/Linux/audio_linux.cpp +++ b/BasiliskII/src/Unix/audio_oss_esd.cpp @@ -1,5 +1,5 @@ /* - * audio_linux.cpp - Audio support, Linux (OSS) implementation + * audio_oss_esd.cpp - Audio support, implementation for OSS and ESD (Linux and FreeBSD) * * Basilisk II (C) 1997-1999 Christian Bauer * @@ -21,12 +21,19 @@ #include "sysdeps.h" #include -#include #include #include #include #include +#ifdef __linux__ +#include +#endif + +#ifdef __FreeBSD__ +#include +#endif + #include "cpu_emulation.h" #include "main.h" #include "prefs.h" @@ -34,6 +41,10 @@ #include "audio.h" #include "audio_defs.h" +#if ENABLE_ESD +#include +#endif + #define DEBUG 0 #include "debug.h" @@ -46,16 +57,20 @@ uint16 audio_sample_sizes[] = {16}; int audio_num_channel_counts = 1; uint16 audio_channel_counts[] = {2}; +// Constants +#define DSP_NAME "/dev/dsp" + // Global variables -static int dsp_fd = -1; // fd of /dev/dsp -static int mixer_fd = -1; // fd of /dev/mixer -static sem_t audio_irq_done_sem; // Signal from interrupt to streaming thread: data block read -static bool sem_inited = false; // Flag: audio_irq_done_sem initialized -static pthread_t stream_thread; // Audio streaming thread -static pthread_attr_t stream_thread_attr; // Streaming thread attributes -static bool stream_thread_active = false; -static int sound_buffer_size; // Size of sound buffer in bytes -static bool little_endian = false; // Flag: DSP accepts only little-endian 16-bit sound data +static int audio_fd = -1; // fd of /dev/dsp or ESD +static int mixer_fd = -1; // fd of /dev/mixer +static sem_t audio_irq_done_sem; // Signal from interrupt to streaming thread: data block read +static bool sem_inited = false; // Flag: audio_irq_done_sem initialized +static int sound_buffer_size; // Size of sound buffer in bytes +static bool little_endian = false; // Flag: DSP accepts only little-endian 16-bit sound data +static pthread_t stream_thread; // Audio streaming thread +static pthread_attr_t stream_thread_attr; // Streaming thread attributes +static bool stream_thread_active = false; // Flag: streaming thread installed +static volatile bool stream_thread_cancel = false; // Flag: cancel streaming thread // Prototypes static void *stream_func(void *arg); @@ -65,6 +80,86 @@ static void *stream_func(void *arg); * Initialization */ +// Init using /dev/dsp, returns false on error +bool audio_init_dsp(void) +{ + printf("Using " DSP_NAME " audio output\n"); + + // Get supported sample formats + unsigned long format; + ioctl(audio_fd, SNDCTL_DSP_GETFMTS, &format); + if ((format & (AFMT_U8 | AFMT_S16_BE | AFMT_S16_LE)) == 0) { + WarningAlert(GetString(STR_AUDIO_FORMAT_WARN)); + close(audio_fd); + audio_fd = -1; + return false; + } + if (format & (AFMT_S16_BE | AFMT_S16_LE)) + audio_sample_sizes[0] = 16; + else + audio_sample_sizes[0] = 8; + if (!(format & AFMT_S16_BE)) + little_endian = true; + + // Set DSP parameters + format = AudioStatus.sample_size == 8 ? AFMT_U8 : (little_endian ? AFMT_S16_LE : AFMT_S16_BE); + ioctl(audio_fd, SNDCTL_DSP_SETFMT, &format); + int frag = 0x0004000c; // Block size: 4096 frames + ioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &frag); + int stereo = (AudioStatus.channels == 2); + ioctl(audio_fd, SNDCTL_DSP_STEREO, &stereo); + int rate = AudioStatus.sample_rate >> 16; + ioctl(audio_fd, SNDCTL_DSP_SPEED, &rate); + + // Get sound buffer size + ioctl(audio_fd, SNDCTL_DSP_GETBLKSIZE, &audio_frames_per_block); + D(bug("DSP_GETBLKSIZE %d\n", audio_frames_per_block)); + sound_buffer_size = (AudioStatus.sample_size >> 3) * AudioStatus.channels * audio_frames_per_block; + return true; +} + +// Init using ESD, returns false on error +bool audio_init_esd(void) +{ +#if ENABLE_ESD + printf("Using ESD audio output\n"); + + // ESD audio format + esd_format_t format = ESD_STREAM | ESD_PLAY; + if (AudioStatus.sample_size == 8) + format |= ESD_BITS8; + else + format |= ESD_BITS16; + if (AudioStatus.channels == 1) + format |= ESD_MONO; + else + format |= ESD_STEREO; + +#if WORDS_BIGENDIAN + little_endian = false; +#else + little_endian = true; +#endif + + // Open connection to ESD server + audio_fd = esd_play_stream(format, AudioStatus.sample_rate >> 16, NULL, NULL); + if (audio_fd < 0) { + char str[256]; + sprintf(str, GetString(STR_NO_ESD_WARN), strerror(errno)); + WarningAlert(str); + return false; + } + + // Sound buffer size = 4096 frames + audio_frames_per_block = 4096; + sound_buffer_size = (AudioStatus.sample_size >> 3) * AudioStatus.channels * audio_frames_per_block; + return true; +#else + ErrorAlert("Basilisk II has been compiled with ESD support disabled."); + return false; +#endif +} + void AudioInit(void) { char str[256]; @@ -81,44 +176,20 @@ void AudioInit(void) if (PrefsFindBool("nosound")) return; - // Open /dev/dsp - dsp_fd = open("/dev/dsp", O_WRONLY); - if (dsp_fd < 0) { - sprintf(str, GetString(STR_NO_AUDIO_DEV_WARN), "/dev/dsp", strerror(errno)); + // Try to open /dev/dsp + audio_fd = open(DSP_NAME, O_WRONLY); + if (audio_fd < 0) { +#if ENABLE_ESD + if (!audio_init_esd()) + return; +#else + sprintf(str, GetString(STR_NO_AUDIO_DEV_WARN), DSP_NAME, strerror(errno)); WarningAlert(str); return; - } - - // Get supported sample formats - unsigned long format; - ioctl(dsp_fd, SNDCTL_DSP_GETFMTS, &format); - if ((format & (AFMT_U8 | AFMT_S16_BE | AFMT_S16_LE)) == 0) { - WarningAlert(GetString(STR_AUDIO_FORMAT_WARN)); - close(dsp_fd); - dsp_fd = -1; - return; - } - if (format & (AFMT_S16_BE | AFMT_S16_LE)) - audio_sample_sizes[0] = 16; - else - audio_sample_sizes[0] = 8; - if (!(format & AFMT_S16_BE)) - little_endian = true; - - // Set DSP parameters - format = AudioStatus.sample_size == 8 ? AFMT_U8 : (little_endian ? AFMT_S16_LE : AFMT_S16_BE); - ioctl(dsp_fd, SNDCTL_DSP_SETFMT, &format); - int frag = 0x0004000c; // Block size: 4096 frames - ioctl(dsp_fd, SNDCTL_DSP_SETFRAGMENT, &frag); - int stereo = (AudioStatus.channels == 2); - ioctl(dsp_fd, SNDCTL_DSP_STEREO, &stereo); - int rate = AudioStatus.sample_rate >> 16; - ioctl(dsp_fd, SNDCTL_DSP_SPEED, &rate); - - // Get sound buffer size - ioctl(dsp_fd, SNDCTL_DSP_GETBLKSIZE, &audio_frames_per_block); - D(bug("DSP_GETBLKSIZE %d\n", audio_frames_per_block)); - sound_buffer_size = (AudioStatus.sample_size >> 3) * AudioStatus.channels * audio_frames_per_block; +#endif + } else + if (!audio_init_dsp()) + return; // Try to open /dev/mixer mixer_fd = open("/dev/mixer", O_RDWR); @@ -156,7 +227,10 @@ void AudioExit(void) { // Stop stream and delete semaphore if (stream_thread_active) { + stream_thread_cancel = true; +#ifdef HAVE_PTHREAD_CANCEL pthread_cancel(stream_thread); +#endif pthread_join(stream_thread, NULL); stream_thread_active = false; } @@ -164,8 +238,8 @@ void AudioExit(void) sem_destroy(&audio_irq_done_sem); // Close /dev/dsp - if (dsp_fd > 0) - close(dsp_fd); + if (audio_fd > 0) + close(audio_fd); // Close /dev/mixer if (mixer_fd > 0) @@ -205,7 +279,7 @@ static void *stream_func(void *arg) int16 *last_buffer = new int16[sound_buffer_size / 2]; memset(silent_buffer, 0, sound_buffer_size); - for (;;) { + while (!stream_thread_cancel) { if (AudioStatus.num_sources) { // Trigger audio interrupt to get new buffer @@ -228,7 +302,7 @@ static void *stream_func(void *arg) // Send data to DSP if (work_size == sound_buffer_size && !little_endian) - write(dsp_fd, Mac2HostAddr(ReadMacInt32(apple_stream_info + scd_buffer)), sound_buffer_size); + write(audio_fd, Mac2HostAddr(ReadMacInt32(apple_stream_info + scd_buffer)), sound_buffer_size); else { // Last buffer or little-endian DSP if (little_endian) { @@ -238,7 +312,7 @@ static void *stream_func(void *arg) } else memcpy(last_buffer, Mac2HostAddr(ReadMacInt32(apple_stream_info + scd_buffer)), work_size); memset((uint8 *)last_buffer + work_size, 0, sound_buffer_size - work_size); - write(dsp_fd, last_buffer, sound_buffer_size); + write(audio_fd, last_buffer, sound_buffer_size); } D(bug("stream: data written\n")); } else @@ -247,10 +321,9 @@ static void *stream_func(void *arg) } else { // Audio not active, play silence -silence: write(dsp_fd, silent_buffer, sound_buffer_size); +silence: write(audio_fd, silent_buffer, sound_buffer_size); } } - ioctl(dsp_fd, SNDCTL_DSP_SYNC); delete[] silent_buffer; delete[] last_buffer; return NULL; diff --git a/BasiliskII/src/Unix/config.h.in b/BasiliskII/src/Unix/config.h.in index 5b1eba6f..4046a809 100644 --- a/BasiliskII/src/Unix/config.h.in +++ b/BasiliskII/src/Unix/config.h.in @@ -72,3 +72,9 @@ /* Define if you have the header file. */ #undef HAVE_UNISTD_H + +/* Define if you have the posix4 library (-lposix4). */ +#undef HAVE_LIBPOSIX4 + +/* Define if you have the pthread library (-lpthread). */ +#undef HAVE_LIBPTHREAD diff --git a/BasiliskII/src/Unix/configure b/BasiliskII/src/Unix/configure index 4c1ad4eb..a2fd0247 100755 --- a/BasiliskII/src/Unix/configure +++ b/BasiliskII/src/Unix/configure @@ -12,11 +12,13 @@ ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: ac_help="$ac_help - --enable-xf86-dga use the XFree86 DGA extension (default)" + --enable-xf86-dga use the XFree86 DGA extension [default=yes]" ac_help="$ac_help - --enable-fbdev-dga use direct frame buffer access via /dev/fb (default)" + --enable-fbdev-dga use direct frame buffer access via /dev/fb [default=yes]" ac_help="$ac_help - --enable-ui use GTK user interface (default)" + --enable-esd Enlightened Sound Daemon support [default=yes]" +ac_help="$ac_help + --enable-ui use GTK user interface [default=yes]" ac_help="$ac_help --with-x use the X Window System" ac_help="$ac_help @@ -25,6 +27,12 @@ ac_help="$ac_help --with-gtk-exec-prefix=PFX Exec prefix where GTK is installed (optional)" ac_help="$ac_help --disable-gtktest Do not try to compile and run a test GTK program" +ac_help="$ac_help + --with-esd-prefix=PFX Prefix where ESD is installed (optional)" +ac_help="$ac_help + --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)" +ac_help="$ac_help + --disable-esdtest Do not try to compile and run a test ESD program" # Initialize some variables set by options. # The variables have the same names as the options, with @@ -540,6 +548,7 @@ fi WANT_XF86_DGA=yes WANT_FBDEV_DGA=yes +WANT_ESD=yes WANT_UI=yes # Check whether --enable-xf86-dga or --disable-xf86-dga was given. if test "${enable_xf86_dga+set}" = set; then @@ -553,6 +562,12 @@ if test "${enable_fbdev_dga+set}" = set; then WANT_FBDEV_DGA=$enableval fi +# Check whether --enable-esd or --disable-esd was given. +if test "${enable_esd+set}" = set; then + enableval="$enable_esd" + WANT_ESD=$enableval +fi + # Check whether --enable-ui or --disable-ui was given. if test "${enable_ui+set}" = set; then enableval="$enable_ui" @@ -563,7 +578,7 @@ fi # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:567: checking for $ac_word" >&5 +echo "configure:582: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -593,7 +608,7 @@ if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:597: checking for $ac_word" >&5 +echo "configure:612: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -644,7 +659,7 @@ fi # Extract the first word of "cl", so it can be a program name with args. set dummy cl; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:648: checking for $ac_word" >&5 +echo "configure:663: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -676,7 +691,7 @@ fi fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:680: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 +echo "configure:695: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -687,12 +702,12 @@ cross_compiling=$ac_cv_prog_cc_cross cat > conftest.$ac_ext << EOF -#line 691 "configure" +#line 706 "configure" #include "confdefs.h" main(){return(0);} EOF -if { (eval echo configure:696: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:711: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cc_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -718,12 +733,12 @@ if test $ac_cv_prog_cc_works = no; then { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:722: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:737: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 cross_compiling=$ac_cv_prog_cc_cross echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 -echo "configure:727: checking whether we are using GNU C" >&5 +echo "configure:742: checking whether we are using GNU C" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -732,7 +747,7 @@ else yes; #endif EOF -if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:736: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:751: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gcc=yes else ac_cv_prog_gcc=no @@ -751,7 +766,7 @@ ac_test_CFLAGS="${CFLAGS+set}" ac_save_CFLAGS="$CFLAGS" CFLAGS= echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 -echo "configure:755: checking whether ${CC-cc} accepts -g" >&5 +echo "configure:770: checking whether ${CC-cc} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -783,7 +798,7 @@ else fi echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 -echo "configure:787: checking how to run the C preprocessor" >&5 +echo "configure:802: checking how to run the C preprocessor" >&5 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= @@ -798,13 +813,13 @@ else # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:808: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:823: \"$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 : @@ -815,13 +830,13 @@ else rm -rf conftest* CPP="${CC-cc} -E -traditional-cpp" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:825: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:840: \"$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 : @@ -832,13 +847,13 @@ else rm -rf conftest* CPP="${CC-cc} -nologo -E" cat > conftest.$ac_ext < Syntax Error EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:842: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:857: \"$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 : @@ -867,7 +882,7 @@ do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:871: checking for $ac_word" >&5 +echo "configure:886: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_prog_CXX'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -899,7 +914,7 @@ test -n "$CXX" || CXX="gcc" echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works""... $ac_c" 1>&6 -echo "configure:903: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 +echo "configure:918: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) works" >&5 ac_ext=C # CXXFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. @@ -910,12 +925,12 @@ cross_compiling=$ac_cv_prog_cxx_cross cat > conftest.$ac_ext << EOF -#line 914 "configure" +#line 929 "configure" #include "confdefs.h" int main(){return(0);} EOF -if { (eval echo configure:919: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:934: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ac_cv_prog_cxx_works=yes # If we can't run a trivial program, we are probably using a cross compiler. if (./conftest; exit) 2>/dev/null; then @@ -941,12 +956,12 @@ if test $ac_cv_prog_cxx_works = no; then { echo "configure: error: installation or configuration problem: C++ compiler cannot create executables." 1>&2; exit 1; } fi echo $ac_n "checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 -echo "configure:945: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 +echo "configure:960: checking whether the C++ compiler ($CXX $CXXFLAGS $LDFLAGS) is a cross-compiler" >&5 echo "$ac_t""$ac_cv_prog_cxx_cross" 1>&6 cross_compiling=$ac_cv_prog_cxx_cross echo $ac_n "checking whether we are using GNU C++""... $ac_c" 1>&6 -echo "configure:950: checking whether we are using GNU C++" >&5 +echo "configure:965: checking whether we are using GNU C++" >&5 if eval "test \"`echo '$''{'ac_cv_prog_gxx'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -955,7 +970,7 @@ else yes; #endif EOF -if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:959: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then +if { ac_try='${CXX-g++} -E conftest.C'; { (eval echo configure:974: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ac_cv_prog_gxx=yes else ac_cv_prog_gxx=no @@ -974,7 +989,7 @@ ac_test_CXXFLAGS="${CXXFLAGS+set}" ac_save_CXXFLAGS="$CXXFLAGS" CXXFLAGS= echo $ac_n "checking whether ${CXX-g++} accepts -g""... $ac_c" 1>&6 -echo "configure:978: checking whether ${CXX-g++} accepts -g" >&5 +echo "configure:993: checking whether ${CXX-g++} accepts -g" >&5 if eval "test \"`echo '$''{'ac_cv_prog_cxx_g'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -1006,7 +1021,7 @@ else fi echo $ac_n "checking whether ${MAKE-make} sets \${MAKE}""... $ac_c" 1>&6 -echo "configure:1010: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "configure:1025: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1063,7 +1078,7 @@ ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 -echo "configure:1067: checking for a BSD compatible install" >&5 +echo "configure:1082: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1116,12 +1131,60 @@ test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' +echo $ac_n "checking for sem_init in -lposix4""... $ac_c" 1>&6 +echo "configure:1136: checking for sem_init in -lposix4" >&5 +ac_lib_var=`echo posix4'_'sem_init | sed 'y%./+-%__p_%'` +if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + ac_save_LIBS="$LIBS" +LIBS="-lposix4 $LIBS" +cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_lib_$ac_lib_var=no" +fi +rm -f conftest* +LIBS="$ac_save_LIBS" + +fi +if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_lib=HAVE_LIB`echo posix4 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 +fi + + # If we find X, set shell vars x_includes and x_libraries to the # paths, otherwise set no_x=yes. # Uses ac_ vars as temps to allow command line to override cache and checks. # --without-x overrides everything else, but does not touch the cache. echo $ac_n "checking for X""... $ac_c" 1>&6 -echo "configure:1125: checking for X" >&5 +echo "configure:1188: checking for X" >&5 # Check whether --with-x or --without-x was given. if test "${with_x+set}" = set; then @@ -1183,12 +1246,12 @@ if test "$ac_x_includes" = NO; then # First, try using that file with no special directory specified. cat > conftest.$ac_ext < EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:1192: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:1255: \"$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* @@ -1257,14 +1320,14 @@ if test "$ac_x_libraries" = NO; then ac_save_LIBS="$LIBS" LIBS="-l$x_direct_test_library $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1331: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* LIBS="$ac_save_LIBS" # We can link X programs with no special library path. @@ -1370,17 +1433,17 @@ else case "`(uname -sr) 2>/dev/null`" in "SunOS 5"*) echo $ac_n "checking whether -R must be followed by a space""... $ac_c" 1>&6 -echo "configure:1374: checking whether -R must be followed by a space" >&5 +echo "configure:1437: checking whether -R must be followed by a space" >&5 ac_xsave_LIBS="$LIBS"; LIBS="$LIBS -R$x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1447: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_nospace=yes else @@ -1396,14 +1459,14 @@ rm -f conftest* else LIBS="$ac_xsave_LIBS -R $x_libraries" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1470: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* ac_R_space=yes else @@ -1435,7 +1498,7 @@ rm -f conftest* # libraries were built with DECnet support. And karl@cs.umb.edu says # the Alpha needs dnet_stub (dnet does not exist). echo $ac_n "checking for dnet_ntoa in -ldnet""... $ac_c" 1>&6 -echo "configure:1439: checking for dnet_ntoa in -ldnet" >&5 +echo "configure:1502: checking for dnet_ntoa in -ldnet" >&5 ac_lib_var=`echo dnet'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1443,7 +1506,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1521: \"$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 @@ -1476,7 +1539,7 @@ fi if test $ac_cv_lib_dnet_dnet_ntoa = no; then echo $ac_n "checking for dnet_ntoa in -ldnet_stub""... $ac_c" 1>&6 -echo "configure:1480: checking for dnet_ntoa in -ldnet_stub" >&5 +echo "configure:1543: checking for dnet_ntoa in -ldnet_stub" >&5 ac_lib_var=`echo dnet_stub'_'dnet_ntoa | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1484,7 +1547,7 @@ else ac_save_LIBS="$LIBS" LIBS="-ldnet_stub $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1562: \"$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 @@ -1524,12 +1587,12 @@ fi # The nsl library prevents programs from opening the X display # on Irix 5.2, according to dickey@clark.net. echo $ac_n "checking for gethostbyname""... $ac_c" 1>&6 -echo "configure:1528: checking for gethostbyname" >&5 +echo "configure:1591: checking for gethostbyname" >&5 if eval "test \"`echo '$''{'ac_cv_func_gethostbyname'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1619: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_gethostbyname=yes" else @@ -1573,7 +1636,7 @@ fi if test $ac_cv_func_gethostbyname = no; then echo $ac_n "checking for gethostbyname in -lnsl""... $ac_c" 1>&6 -echo "configure:1577: checking for gethostbyname in -lnsl" >&5 +echo "configure:1640: checking for gethostbyname in -lnsl" >&5 ac_lib_var=`echo nsl'_'gethostbyname | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1581,7 +1644,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lnsl $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1659: \"$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 @@ -1622,12 +1685,12 @@ fi # -lsocket must be given before -lnsl if both are needed. # We assume that if connect needs -lnsl, so does gethostbyname. echo $ac_n "checking for connect""... $ac_c" 1>&6 -echo "configure:1626: checking for connect" >&5 +echo "configure:1689: checking for connect" >&5 if eval "test \"`echo '$''{'ac_cv_func_connect'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1717: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_connect=yes" else @@ -1671,7 +1734,7 @@ fi if test $ac_cv_func_connect = no; then echo $ac_n "checking for connect in -lsocket""... $ac_c" 1>&6 -echo "configure:1675: checking for connect in -lsocket" >&5 +echo "configure:1738: checking for connect in -lsocket" >&5 ac_lib_var=`echo socket'_'connect | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1679,7 +1742,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lsocket $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1757: \"$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 @@ -1714,12 +1777,12 @@ fi # gomez@mi.uni-erlangen.de says -lposix is necessary on A/UX. echo $ac_n "checking for remove""... $ac_c" 1>&6 -echo "configure:1718: checking for remove" >&5 +echo "configure:1781: checking for remove" >&5 if eval "test \"`echo '$''{'ac_cv_func_remove'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1809: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_remove=yes" else @@ -1763,7 +1826,7 @@ fi if test $ac_cv_func_remove = no; then echo $ac_n "checking for remove in -lposix""... $ac_c" 1>&6 -echo "configure:1767: checking for remove in -lposix" >&5 +echo "configure:1830: checking for remove in -lposix" >&5 ac_lib_var=`echo posix'_'remove | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1771,7 +1834,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lposix $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1849: \"$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 @@ -1806,12 +1869,12 @@ fi # BSDI BSD/OS 2.1 needs -lipc for XOpenDisplay. echo $ac_n "checking for shmat""... $ac_c" 1>&6 -echo "configure:1810: checking for shmat" >&5 +echo "configure:1873: checking for shmat" >&5 if eval "test \"`echo '$''{'ac_cv_func_shmat'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1901: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_shmat=yes" else @@ -1855,7 +1918,7 @@ fi if test $ac_cv_func_shmat = no; then echo $ac_n "checking for shmat in -lipc""... $ac_c" 1>&6 -echo "configure:1859: checking for shmat in -lipc" >&5 +echo "configure:1922: checking for shmat in -lipc" >&5 ac_lib_var=`echo ipc'_'shmat | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1863,7 +1926,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lipc $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1941: \"$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 @@ -1907,7 +1970,7 @@ fi # libraries we check for below, so use a different variable. # --interran@uluru.Stanford.EDU, kb@cs.umb.edu. echo $ac_n "checking for IceConnectionNumber in -lICE""... $ac_c" 1>&6 -echo "configure:1911: checking for IceConnectionNumber in -lICE" >&5 +echo "configure:1974: checking for IceConnectionNumber in -lICE" >&5 ac_lib_var=`echo ICE'_'IceConnectionNumber | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -1915,7 +1978,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lICE $X_EXTRA_LIBS $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:1993: \"$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 @@ -1953,14 +2016,12 @@ fi if [ "x$no_x" = "xyes" ]; then { echo "configure: error: You need X11 to run Basilisk II." 1>&2; exit 1; } fi - CFLAGS="$CFLAGS $X_CFLAGS" CXXFLAGS="$CXXFLAGS $X_CFLAGS" LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" -STATICLIBS= echo $ac_n "checking for pthread_create in -lpthread""... $ac_c" 1>&6 -echo "configure:1964: checking for pthread_create in -lpthread" >&5 +echo "configure:2025: 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 @@ -1968,7 +2029,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:2044: \"$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 @@ -1994,15 +2055,19 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - HAVE_PTHREADS=yes + ac_tr_lib=HAVE_LIB`echo pthread | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 -HAVE_PTHREADS=no -fi -if [ "x$HAVE_PTHREADS" = "xno" ]; then - echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 -echo "configure:2006: checking for pthread_create in -lc_r" >&5 + echo $ac_n "checking for pthread_create in -lc_r""... $ac_c" 1>&6 +echo "configure:2071: checking for pthread_create in -lc_r" >&5 ac_lib_var=`echo c_r'_'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 @@ -2010,7 +2075,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lc_r $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2090: \"$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 @@ -2036,15 +2101,19 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - HAVE_PTHREADS=yes + ac_tr_lib=HAVE_LIB`echo c_r | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 -HAVE_PTHREADS=no -fi - if [ "x$HAVE_PTHREADS" = "xno" ]; then - echo $ac_n "checking for pthread_create in -lPTL""... $ac_c" 1>&6 -echo "configure:2048: checking for pthread_create in -lPTL" >&5 + echo $ac_n "checking for pthread_create in -lPTL""... $ac_c" 1>&6 +echo "configure:2117: checking for pthread_create in -lPTL" >&5 ac_lib_var=`echo PTL'_'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 @@ -2052,7 +2121,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lPTL $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2136: \"$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 @@ -2078,32 +2147,38 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - HAVE_PTHREADS=yes + ac_tr_lib=HAVE_LIB`echo PTL | sed -e 's/[^a-zA-Z0-9_]/_/g' \ + -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` + cat >> confdefs.h <&6 -HAVE_PTHREADS=no + + { echo "configure: error: You need pthreads to run Basilisk II." 1>&2; exit 1; } + fi - if [ "x$HAVE_PTHREADS" = "xno" ]; then - { echo "configure: error: You need pthreads to run Basilisk II." 1>&2; exit 1; } - else - LIBS="$LIBS -lPTL" - fi - else - LIBS="$LIBS -lc_r" - fi -else - LIBS="$LIBS -lpthread" + fi -for ac_func in pthread_cancel + + +fi + + +SEMSRCS= +for ac_func in sem_init do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2102: checking for $ac_func" >&5 +echo "configure:2177: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -2147,13 +2222,15 @@ EOF else echo "$ac_t""no" 1>&6 +SEMSRCS=posix_sem.cpp + fi done if [ "x$WANT_XF86_DGA" = "xyes" ]; then echo $ac_n "checking for XF86DGAQueryExtension in -lXxf86dga""... $ac_c" 1>&6 -echo "configure:2157: checking for XF86DGAQueryExtension in -lXxf86dga" >&5 +echo "configure:2234: checking for XF86DGAQueryExtension in -lXxf86dga" >&5 ac_lib_var=`echo Xxf86dga'_'XF86DGAQueryExtension | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -2161,7 +2238,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lXxf86dga $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2253: \"$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 @@ -2187,23 +2264,22 @@ LIBS="$ac_save_LIBS" fi if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then echo "$ac_t""yes" 1>&6 - HAVE_DGA=yes -else - echo "$ac_t""no" 1>&6 -HAVE_DGA=no -fi - - if [ "x$HAVE_DGA" = "xno" ]; then - echo "configure: warning: Could not find XFree86 DGA extension, ignoring --enable-xf86-dga." 1>&2 - DEFINES="$DEFINES -DENABLE_XF86_DGA=0" - else + DEFINES="$DEFINES -DENABLE_XF86_DGA=1" LIBS="$LIBS -lXxf86dga" if [ "x$WANT_FBDEV_DGA" = "xyes" ]; then echo "configure: warning: Cannot have both --enable-xf86-dga and --enable-fbdev-dga, ignoring --enable-fbdev-dga." 1>&2 WANT_FBDEV_DGA=no fi - fi + +else + echo "$ac_t""no" 1>&6 + + echo "configure: warning: Could not find XFree86 DGA extension, ignoring --enable-xf86-dga." 1>&2 + DEFINES="$DEFINES -DENABLE_XF86_DGA=0" + +fi + else DEFINES="$DEFINES -DENABLE_XF86_DGA=0" fi @@ -2213,6 +2289,7 @@ else DEFINES="$DEFINES -DENABLE_FBDEV_DGA=0" fi +UISRCS=../dummy/prefs_editor_dummy.cpp if [ "x$WANT_UI" = "xyes" ]; then # Check whether --with-gtk-prefix or --without-gtk-prefix was given. if test "${with_gtk_prefix+set}" = set; then @@ -2255,7 +2332,7 @@ fi # Extract the first word of "gtk-config", so it can be a program name with args. set dummy gtk-config; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 -echo "configure:2259: checking for $ac_word" >&5 +echo "configure:2336: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_GTK_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2290,7 +2367,7 @@ fi min_gtk_version=1.2.0 echo $ac_n "checking for GTK - version >= $min_gtk_version""... $ac_c" 1>&6 -echo "configure:2294: checking for GTK - version >= $min_gtk_version" >&5 +echo "configure:2371: checking for GTK - version >= $min_gtk_version" >&5 no_gtk="" if test "$GTK_CONFIG" = "no" ; then no_gtk=yes @@ -2313,7 +2390,7 @@ echo "configure:2294: checking for GTK - version >= $min_gtk_version" >&5 echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < @@ -2376,7 +2453,7 @@ main () } EOF -if { (eval echo configure:2380: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2457: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2394,7 +2471,13 @@ fi fi if test "x$no_gtk" = x ; then echo "$ac_t""yes" 1>&6 - : + + DEFINES="$DEFINES -DENABLE_GTK=1" + CFLAGS="$CFLAGS $GTK_CFLAGS" + CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + UISRCS=prefs_editor_gtk.cpp + else echo "$ac_t""no" 1>&6 if test "$GTK_CONFIG" = "no" ; then @@ -2410,7 +2493,7 @@ fi CFLAGS="$CFLAGS $GTK_CFLAGS" LIBS="$LIBS $GTK_LIBS" cat > conftest.$ac_ext < @@ -2420,7 +2503,7 @@ int main() { return ((gtk_major_version) || (gtk_minor_version) || (gtk_micro_version)); ; return 0; } EOF -if { (eval echo configure:2424: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:2507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* echo "*** The test program compiled, but did not run. This usually means" echo "*** that the run-time linker is not finding GTK or finding the wrong" @@ -2452,137 +2535,270 @@ rm -f conftest* fi GTK_CFLAGS="" GTK_LIBS="" - : + + echo "configure: warning: Could not find GTK+, disabling user interface." 1>&2 + WANT_UI=no + fi rm -f conf.gtktest - if [ "x$no_gtk" = "xyes" ]; then - echo "Did not find gtk+, disabling user interface." - WANT_UI=no - GTK_CFLAGS= - GTK_LIBS= - else - DEFINES="$DEFINES -DENABLE_GTK=1" - fi - CFLAGS="$CFLAGS $GTK_CFLAGS" - CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" - LIBS="$LIBS $GTK_LIBS" fi -SEMSRCS= -for ac_func in sem_init -do -echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:2479: checking for $ac_func" >&5 -if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then +if [ "x$WANT_ESD" = "xyes" ]; then + # Check whether --with-esd-prefix or --without-esd-prefix was given. +if test "${with_esd_prefix+set}" = set; then + withval="$with_esd_prefix" + esd_prefix="$withval" +else + esd_prefix="" +fi + +# Check whether --with-esd-exec-prefix or --without-esd-exec-prefix was given. +if test "${with_esd_exec_prefix+set}" = set; then + withval="$with_esd_exec_prefix" + esd_exec_prefix="$withval" +else + esd_exec_prefix="" +fi + +# Check whether --enable-esdtest or --disable-esdtest was given. +if test "${enable_esdtest+set}" = set; then + enableval="$enable_esdtest" + : +else + enable_esdtest=yes +fi + + + if test x$esd_exec_prefix != x ; then + esd_args="$esd_args --exec-prefix=$esd_exec_prefix" + if test x${ESD_CONFIG+set} != xset ; then + ESD_CONFIG=$esd_exec_prefix/bin/esd-config + fi + fi + if test x$esd_prefix != x ; then + esd_args="$esd_args --prefix=$esd_prefix" + if test x${ESD_CONFIG+set} != xset ; then + ESD_CONFIG=$esd_prefix/bin/esd-config + fi + fi + + # Extract the first word of "esd-config", so it can be a program name with args. +set dummy esd-config; ac_word=$2 +echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 +echo "configure:2592: checking for $ac_word" >&5 +if eval "test \"`echo '$''{'ac_cv_path_ESD_CONFIG'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 +else + case "$ESD_CONFIG" in + /*) + ac_cv_path_ESD_CONFIG="$ESD_CONFIG" # Let the user override the test with a path. + ;; + ?:/*) + ac_cv_path_ESD_CONFIG="$ESD_CONFIG" # Let the user override the test with a dos path. + ;; + *) + IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" + ac_dummy="$PATH" + for ac_dir in $ac_dummy; do + test -z "$ac_dir" && ac_dir=. + if test -f $ac_dir/$ac_word; then + ac_cv_path_ESD_CONFIG="$ac_dir/$ac_word" + break + fi + done + IFS="$ac_save_ifs" + test -z "$ac_cv_path_ESD_CONFIG" && ac_cv_path_ESD_CONFIG="no" + ;; +esac +fi +ESD_CONFIG="$ac_cv_path_ESD_CONFIG" +if test -n "$ESD_CONFIG"; then + echo "$ac_t""$ESD_CONFIG" 1>&6 +else + echo "$ac_t""no" 1>&6 +fi + + min_esd_version=0.2.8 + echo $ac_n "checking for ESD - version >= $min_esd_version""... $ac_c" 1>&6 +echo "configure:2627: checking for ESD - version >= $min_esd_version" >&5 + no_esd="" + if test "$ESD_CONFIG" = "no" ; then + no_esd=yes + else + ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags` + ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs` + + esd_major_version=`$ESD_CONFIG $esd_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\1/'` + esd_minor_version=`$ESD_CONFIG $esd_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\2/'` + esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \ + sed 's/\([0-9]*\).\([0-9]*\).\([0-9]*\)/\3/'` + if test "x$enable_esdtest" = "xyes" ; then + ac_save_CFLAGS="$CFLAGS" + ac_save_LIBS="$LIBS" + CFLAGS="$CFLAGS $ESD_CFLAGS" + LIBS="$LIBS $ESD_LIBS" + rm -f conf.esdtest + if test "$cross_compiling" = yes; then + echo $ac_n "cross compiling; assumed OK... $ac_c" else cat > conftest.$ac_ext < -/* Override any gcc2 internal prototype to avoid an error. */ -/* 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(); -int main() { +#include +#include +#include +#include -/* 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 -$ac_func(); -#endif - -; return 0; } -EOF -if { (eval echo configure:2507: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_func_$ac_func=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_func_$ac_func=no" -fi -rm -f conftest* -fi - -if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then - echo "$ac_t""yes" 1>&6 - ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` - cat >> confdefs.h <&6 -fi -done - -if [ "x$ac_cv_func_sem_init" = "xno" ]; then - echo $ac_n "checking for sem_init in -lposix4""... $ac_c" 1>&6 -echo "configure:2533: checking for sem_init in -lposix4" >&5 -ac_lib_var=`echo posix4'_'sem_init | sed 'y%./+-%__p_%'` -if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then - echo $ac_n "(cached) $ac_c" 1>&6 -else - ac_save_LIBS="$LIBS" -LIBS="-lposix4 $LIBS" -cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=yes" -else - echo "configure: failed program was:" >&5 - cat conftest.$ac_ext >&5 - rm -rf conftest* - eval "ac_cv_lib_$ac_lib_var=no" -fi -rm -f conftest* -LIBS="$ac_save_LIBS" - -fi -if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then - echo "$ac_t""yes" 1>&6 - HAVE_LIBPOSIX4=yes -else - echo "$ac_t""no" 1>&6 -HAVE_LIBPOSIX4=no -fi - - if [ "x$HAVE_LIBPOSIX4" = "xno" ]; then - SEMSRCS="posix_sem.cpp" +char* +my_strdup (char *str) +{ + char *new_str; + + if (str) + { + new_str = malloc ((strlen (str) + 1) * sizeof(char)); + strcpy (new_str, str); + } else - LIBS="$LIBS -lposix4" + new_str = NULL; + + return new_str; +} + +int main () +{ + int major, minor, micro; + char *tmp_version; + + system ("touch conf.esdtest"); + + /* HP/UX 9 (%@#!) writes to sscanf strings */ + tmp_version = my_strdup("$min_esd_version"); + if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) { + printf("%s, bad version string\n", "$min_esd_version"); + exit(1); + } + + if (($esd_major_version > major) || + (($esd_major_version == major) && ($esd_minor_version > minor)) || + (($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro))) + { + return 0; + } + else + { + printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version); + printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro); + printf("*** best to upgrade to the required version.\n"); + printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n"); + printf("*** to point to the correct copy of esd-config, and remove the file\n"); + printf("*** config.cache before re-running configure\n"); + return 1; + } +} + + +EOF +if { (eval echo configure:2709: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +then + : +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -fr conftest* + no_esd=yes +fi +rm -fr conftest* +fi + + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi fi + if test "x$no_esd" = x ; then + echo "$ac_t""yes" 1>&6 + + DEFINES="$DEFINES -DENABLE_ESD=1" + CFLAGS="$CFLAGS $ESD_CFLAGS" + CXXFLAGS="$CXXFLAGS $ESD_CFLAGS" + LIBS="$LIBS $ESD_LIBS" + + else + echo "$ac_t""no" 1>&6 + if test "$ESD_CONFIG" = "no" ; then + echo "*** The esd-config script installed by ESD could not be found" + echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in" + echo "*** your path, or set the ESD_CONFIG environment variable to the" + echo "*** full path to esd-config." + else + if test -f conf.esdtest ; then + : + else + echo "*** Could not run ESD test program, checking why..." + CFLAGS="$CFLAGS $ESD_CFLAGS" + LIBS="$LIBS $ESD_LIBS" + cat > conftest.$ac_ext < +#include + +int main() { + return 0; +; return 0; } +EOF +if { (eval echo configure:2758: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + echo "*** The test program compiled, but did not run. This usually means" + echo "*** that the run-time linker is not finding ESD or finding the wrong" + echo "*** version of ESD. If it is not finding ESD, you'll need to set your" + echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point" + echo "*** to the installed location Also, make sure you have run ldconfig if that" + echo "*** is required on your system" + echo "***" + echo "*** If you have an old version installed, it is best to remove it, although" + echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + echo "*** The test program failed to compile or link. See the file config.log for the" + echo "*** exact error that occured. This usually means ESD was incorrectly installed" + echo "*** or that you have moved ESD since it was installed. In the latter case, you" + echo "*** may want to edit the esd-config script: $ESD_CONFIG" +fi +rm -f conftest* + CFLAGS="$ac_save_CFLAGS" + LIBS="$ac_save_LIBS" + fi + fi + ESD_CFLAGS="" + ESD_LIBS="" + + echo "configure: warning: Could not find ESD, disabling ESD support." 1>&2 + WANT_ESD=no + + fi + + + rm -f conf.esdtest + fi echo $ac_n "checking for ANSI C header files""... $ac_c" 1>&6 -echo "configure:2581: checking for ANSI C header files" >&5 +echo "configure:2797: checking for ANSI C header files" >&5 if eval "test \"`echo '$''{'ac_cv_header_stdc'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -2590,7 +2806,7 @@ else #include EOF ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" -{ (eval echo configure:2594: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2810: \"$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* @@ -2607,7 +2823,7 @@ rm -f conftest* if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2625,7 +2841,7 @@ fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat > conftest.$ac_ext < EOF @@ -2646,7 +2862,7 @@ if test "$cross_compiling" = yes; then : else cat > conftest.$ac_ext < #define ISLOWER(c) ('a' <= (c) && (c) <= 'z') @@ -2657,7 +2873,7 @@ if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2); exit (0); } EOF -if { (eval echo configure:2661: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:2877: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then : else @@ -2684,17 +2900,17 @@ for ac_hdr in unistd.h fcntl.h sys/time.h do ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 -echo "configure:2688: checking for $ac_hdr" >&5 +echo "configure:2904: checking for $ac_hdr" >&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:2698: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:2914: \"$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* @@ -2722,14 +2938,14 @@ done echo $ac_n "checking whether byte ordering is bigendian""... $ac_c" 1>&6 -echo "configure:2726: checking whether byte ordering is bigendian" >&5 +echo "configure:2942: checking whether byte ordering is bigendian" >&5 if eval "test \"`echo '$''{'ac_cv_c_bigendian'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_bigendian=unknown # See if sys/param.h defines the BYTE_ORDER macro. cat > conftest.$ac_ext < #include @@ -2740,11 +2956,11 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2744: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2960: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* # It does; now see whether it defined to BIG_ENDIAN or not. cat > conftest.$ac_ext < #include @@ -2755,7 +2971,7 @@ int main() { #endif ; return 0; } EOF -if { (eval echo configure:2759: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:2975: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_bigendian=yes else @@ -2775,7 +2991,7 @@ if test "$cross_compiling" = yes; then { echo "configure: error: can not run test program while cross compiling" 1>&2; exit 1; } else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3008: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_c_bigendian=no else @@ -2812,12 +3028,12 @@ EOF fi echo $ac_n "checking for working const""... $ac_c" 1>&6 -echo "configure:2816: checking for working const" >&5 +echo "configure:3032: checking for working const" >&5 if eval "test \"`echo '$''{'ac_cv_c_const'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3086: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_const=yes else @@ -2887,21 +3103,21 @@ EOF fi echo $ac_n "checking for inline""... $ac_c" 1>&6 -echo "configure:2891: checking for inline" >&5 +echo "configure:3107: checking for inline" >&5 if eval "test \"`echo '$''{'ac_cv_c_inline'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat > conftest.$ac_ext <&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3121: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_c_inline=$ac_kw; break else @@ -2927,7 +3143,7 @@ EOF esac echo $ac_n "checking size of short""... $ac_c" 1>&6 -echo "configure:2931: checking size of short" >&5 +echo "configure:3147: checking size of short" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_short'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2935,7 +3151,7 @@ else ac_cv_sizeof_short=2 else cat > conftest.$ac_ext < main() @@ -2946,7 +3162,7 @@ main() exit(0); } EOF -if { (eval echo configure:2950: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3166: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_short=`cat conftestval` else @@ -2966,7 +3182,7 @@ EOF echo $ac_n "checking size of int""... $ac_c" 1>&6 -echo "configure:2970: checking size of int" >&5 +echo "configure:3186: checking size of int" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_int'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -2974,7 +3190,7 @@ else ac_cv_sizeof_int=4 else cat > conftest.$ac_ext < main() @@ -2985,7 +3201,7 @@ main() exit(0); } EOF -if { (eval echo configure:2989: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_int=`cat conftestval` else @@ -3005,7 +3221,7 @@ EOF echo $ac_n "checking size of long""... $ac_c" 1>&6 -echo "configure:3009: checking size of long" >&5 +echo "configure:3225: checking size of long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3013,7 +3229,7 @@ else ac_cv_sizeof_long=4 else cat > conftest.$ac_ext < main() @@ -3024,7 +3240,7 @@ main() exit(0); } EOF -if { (eval echo configure:3028: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3244: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long=`cat conftestval` else @@ -3044,7 +3260,7 @@ EOF echo $ac_n "checking size of long long""... $ac_c" 1>&6 -echo "configure:3048: checking size of long long" >&5 +echo "configure:3264: checking size of long long" >&5 if eval "test \"`echo '$''{'ac_cv_sizeof_long_long'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else @@ -3052,7 +3268,7 @@ else ac_cv_sizeof_long_long=8 else cat > conftest.$ac_ext < main() @@ -3063,7 +3279,7 @@ main() exit(0); } EOF -if { (eval echo configure:3067: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null +if { (eval echo configure:3283: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext} && (./conftest; exit) 2>/dev/null then ac_cv_sizeof_long_long=`cat conftestval` else @@ -3083,12 +3299,12 @@ EOF echo $ac_n "checking for off_t""... $ac_c" 1>&6 -echo "configure:3087: checking for off_t" >&5 +echo "configure:3303: checking for off_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_off_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3116,12 +3332,12 @@ EOF fi echo $ac_n "checking for loff_t""... $ac_c" 1>&6 -echo "configure:3120: checking for loff_t" >&5 +echo "configure:3336: checking for loff_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_loff_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3149,12 +3365,12 @@ EOF fi echo $ac_n "checking for size_t""... $ac_c" 1>&6 -echo "configure:3153: checking for size_t" >&5 +echo "configure:3369: checking for size_t" >&5 if eval "test \"`echo '$''{'ac_cv_type_size_t'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #if STDC_HEADERS @@ -3182,12 +3398,12 @@ EOF fi echo $ac_n "checking whether time.h and sys/time.h may both be included""... $ac_c" 1>&6 -echo "configure:3186: checking whether time.h and sys/time.h may both be included" >&5 +echo "configure:3402: checking whether time.h and sys/time.h may both be included" >&5 if eval "test \"`echo '$''{'ac_cv_header_time'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3196,7 +3412,7 @@ int main() { struct tm *tp; ; return 0; } EOF -if { (eval echo configure:3200: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3416: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_header_time=yes else @@ -3217,12 +3433,12 @@ EOF fi echo $ac_n "checking whether struct tm is in sys/time.h or time.h""... $ac_c" 1>&6 -echo "configure:3221: checking whether struct tm is in sys/time.h or time.h" >&5 +echo "configure:3437: checking whether struct tm is in sys/time.h or time.h" >&5 if eval "test \"`echo '$''{'ac_cv_struct_tm'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext < #include @@ -3230,7 +3446,7 @@ int main() { struct tm *tp; tp->tm_sec; ; return 0; } EOF -if { (eval echo configure:3234: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then +if { (eval echo configure:3450: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then rm -rf conftest* ac_cv_struct_tm=time.h else @@ -3254,12 +3470,12 @@ fi for ac_func in strdup cfmakeraw do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3258: checking for $ac_func" >&5 +echo "configure:3474: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3502: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3309,12 +3525,12 @@ done for ac_func in nanosleep clock_gettime timer_create do echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 -echo "configure:3313: checking for $ac_func" >&5 +echo "configure:3529: checking for $ac_func" >&5 if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3557: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then + rm -rf conftest* + eval "ac_cv_func_$ac_func=yes" +else + echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 + rm -rf conftest* + eval "ac_cv_func_$ac_func=no" +fi +rm -f conftest* +fi + +if eval "test \"`echo '$ac_cv_func_'$ac_func`\" = yes"; then + echo "$ac_t""yes" 1>&6 + ac_tr_func=HAVE_`echo $ac_func | tr 'abcdefghijklmnopqrstuvwxyz' 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` + cat >> confdefs.h <&6 +fi +done + +for ac_func in pthread_cancel +do +echo $ac_n "checking for $ac_func""... $ac_c" 1>&6 +echo "configure:3584: checking for $ac_func" >&5 +if eval "test \"`echo '$''{'ac_cv_func_$ac_func'+set}'`\" = set"; then + echo $ac_n "(cached) $ac_c" 1>&6 +else + cat > conftest.$ac_ext < +/* Override any gcc2 internal prototype to avoid an error. */ +/* 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(); + +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 +$ac_func(); +#endif + +; return 0; } +EOF +if { (eval echo configure:3612: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then rm -rf conftest* eval "ac_cv_func_$ac_func=yes" else @@ -3366,11 +3637,11 @@ SYSSRCS="../dummy/ether_dummy.cpp ../dummy/scsi_dummy.cpp ../dummy/audio_dummy.c if MACHINE=`uname -a 2>/dev/null`; then case "$MACHINE" in Linux*) - SYSSRCS="Linux/ether_linux.cpp Linux/scsi_linux.cpp Linux/audio_linux.cpp" + SYSSRCS="Linux/ether_linux.cpp Linux/scsi_linux.cpp audio_oss_esd.cpp" ;; FreeBSD*3.*) echo $ac_n "checking for cam_open_btl in -lcam""... $ac_c" 1>&6 -echo "configure:3374: checking for cam_open_btl in -lcam" >&5 +echo "configure:3645: checking for cam_open_btl in -lcam" >&5 ac_lib_var=`echo cam'_'cam_open_btl | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3378,7 +3649,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lcam $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3664: \"$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 @@ -3415,17 +3686,17 @@ fi else ac_safe=`echo "/sys/cam/cam.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for /sys/cam/cam.h""... $ac_c" 1>&6 -echo "configure:3419: checking for /sys/cam/cam.h" >&5 +echo "configure:3690: checking for /sys/cam/cam.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:3429: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3700: \"$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* @@ -3449,7 +3720,7 @@ fi if [ "x$ac_cv_header__sys_cam_cam_h" = "xno" ]; then { echo "configure: error: Cannot find kernel includes for CAM library." 1>&2; exit 1; } fi - SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp ../dummy/audio_dummy.cpp" + SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp audio_oss_esd.cpp" CXXFLAGS="$CXXFLAGS -I/sys" CFLAGS="$CFLAGS -I/sys" LIBS="$LIBS -lcam" @@ -3458,7 +3729,7 @@ fi ;; FreeBSD*) echo $ac_n "checking for scsi_open in -lscsi""... $ac_c" 1>&6 -echo "configure:3462: checking for scsi_open in -lscsi" >&5 +echo "configure:3733: checking for scsi_open in -lscsi" >&5 ac_lib_var=`echo scsi'_'scsi_open | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 @@ -3466,7 +3737,7 @@ else ac_save_LIBS="$LIBS" LIBS="-lscsi $LIBS" cat > conftest.$ac_ext <&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then +if { (eval echo configure:3752: \"$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 @@ -3503,17 +3774,17 @@ fi else ac_safe=`echo "scsi.h sys/scsiio.h" | sed 'y%./+-%__p_%'` echo $ac_n "checking for scsi.h sys/scsiio.h""... $ac_c" 1>&6 -echo "configure:3507: checking for scsi.h sys/scsiio.h" >&5 +echo "configure:3778: checking for scsi.h sys/scsiio.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:3517: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } +{ (eval echo configure:3788: \"$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* @@ -3553,20 +3824,13 @@ fi ;; esac fi -if [ "x$WANT_UI" = "xyes" ]; then - SYSSRCS="$SYSSRCS prefs_editor_gtk.cpp" -else - SYSSRCS="$SYSSRCS ../dummy/prefs_editor_dummy.cpp" -fi -if [ "x$SEMSRCS" != "x" ]; then - SYSSRCS="$SYSSRCS $SEMSRCS" -fi +SYSSRCS="$SYSSRCS $SEMSRCS $UISRCS" HAVE_I386=no echo $ac_n "checking for x86 target CPU""... $ac_c" 1>&6 -echo "configure:3568: checking for x86 target CPU" >&5 +echo "configure:3832: checking for x86 target CPU" >&5 cat > conftest.$ac_ext <&6 -echo "configure:3591: checking for SPARC target CPU" >&5 +echo "configure:3855: checking for SPARC target CPU" >&5 cat > conftest.$ac_ext <&6 -echo "configure:3614: checking for GAS .p2align feature" >&5 +echo "configure:3878: checking for GAS .p2align feature" >&5 cat >conftest.S << EOF .text .p2align 5 @@ -3620,9 +3884,9 @@ echo "$ac_t""$HAVE_GAS" 1>&6 HAVE_GCC27=no echo $ac_n "checking for GCC 2.7 or higher""... $ac_c" 1>&6 -echo "configure:3624: checking for GCC 2.7 or higher" >&5 +echo "configure:3888: checking for GCC 2.7 or higher" >&5 cat > conftest.$ac_ext < 1 || __GNUC_MINOR__ - 1 > 5 yes @@ -3656,7 +3920,7 @@ elif [ "x$HAVE_GCC27" = "xyes" -a "x$HAVE_SPARC" = "xyes" -a "x$HAVE_GAS" = "xye case "$MACHINE" in SunOS*) echo $ac_n "checking SPARC CPU architecture""... $ac_c" 1>&6 -echo "configure:3660: checking SPARC CPU architecture" >&5 +echo "configure:3924: checking SPARC CPU architecture" >&5 SPARC_TYPE=`Solaris/which_sparc` echo "$ac_t""$SPARC_TYPE" 1>&6 case "$SPARC_TYPE" in @@ -3682,7 +3946,6 @@ CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cp - trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure @@ -3830,8 +4093,10 @@ s%@X_EXTRA_LIBS@%$X_EXTRA_LIBS%g s%@GTK_CONFIG@%$GTK_CONFIG%g s%@GTK_CFLAGS@%$GTK_CFLAGS%g s%@GTK_LIBS@%$GTK_LIBS%g +s%@ESD_CONFIG@%$ESD_CONFIG%g +s%@ESD_CFLAGS@%$ESD_CFLAGS%g +s%@ESD_LIBS@%$ESD_LIBS%g s%@DEFINES@%$DEFINES%g -s%@STATICLIBS@%$STATICLIBS%g s%@SYSSRCS@%$SYSSRCS%g s%@CPUINCLUDES@%$CPUINCLUDES%g s%@CPUSRCS@%$CPUSRCS%g diff --git a/BasiliskII/src/Unix/configure.in b/BasiliskII/src/Unix/configure.in index 80230326..d9ad3611 100644 --- a/BasiliskII/src/Unix/configure.in +++ b/BasiliskII/src/Unix/configure.in @@ -8,10 +8,12 @@ AC_CONFIG_HEADER(config.h) dnl Options. WANT_XF86_DGA=yes WANT_FBDEV_DGA=yes +WANT_ESD=yes WANT_UI=yes -AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension (default)], [WANT_XF86_DGA=$enableval], []) -AC_ARG_ENABLE(fbdev-dga, [ --enable-fbdev-dga use direct frame buffer access via /dev/fb (default)], [WANT_FBDEV_DGA=$enableval], []) -AC_ARG_ENABLE(ui, [ --enable-ui use GTK user interface (default)], [WANT_UI=$enableval], []) +AC_ARG_ENABLE(xf86-dga, [ --enable-xf86-dga use the XFree86 DGA extension [default=yes]], [WANT_XF86_DGA=$enableval], []) +AC_ARG_ENABLE(fbdev-dga, [ --enable-fbdev-dga use direct frame buffer access via /dev/fb [default=yes]], [WANT_FBDEV_DGA=$enableval], []) +AC_ARG_ENABLE(esd, [ --enable-esd Enlightened Sound Daemon support [default=yes]], [WANT_ESD=$enableval], []) +AC_ARG_ENABLE(ui, [ --enable-ui use GTK user interface [default=yes]], [WANT_UI=$enableval], []) dnl Checks for programs. AC_PROG_CC @@ -21,51 +23,45 @@ AC_PROG_MAKE_SET AC_PROG_INSTALL dnl Checks for libraries. +AC_CHECK_LIB(posix4, sem_init) + +dnl We need X11. AC_PATH_XTRA if [[ "x$no_x" = "xyes" ]]; then AC_MSG_ERROR([You need X11 to run Basilisk II.]) fi - CFLAGS="$CFLAGS $X_CFLAGS" CXXFLAGS="$CXXFLAGS $X_CFLAGS" LIBS="$LIBS $X_PRE_LIBS $X_LIBS -lX11 -lXext $X_EXTRA_LIBS" -STATICLIBS= -dnl We need pthreads. -AC_CHECK_LIB(pthread, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no) -if [[ "x$HAVE_PTHREADS" = "xno" ]]; then - dnl Check even the libc_r (FreeBSD) - AC_CHECK_LIB(c_r, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no) - if [[ "x$HAVE_PTHREADS" = "xno" ]]; then - dnl Or maybe the user has PTL (NetBSD) - AC_CHECK_LIB(PTL, pthread_create, HAVE_PTHREADS=yes, HAVE_PTHREADS=no) - if [[ "x$HAVE_PTHREADS" = "xno" ]]; then +dnl We need pthreads. Try libpthread first, then libc_r (FreeBSD), then PTL. +AC_CHECK_LIB(pthread, pthread_create, , [ + AC_CHECK_LIB(c_r, pthread_create, , [ + AC_CHECK_LIB(PTL, pthread_create, , [ AC_MSG_ERROR([You need pthreads to run Basilisk II.]) - else - LIBS="$LIBS -lPTL" - fi - else - LIBS="$LIBS -lc_r" - fi -else - LIBS="$LIBS -lpthread" -fi -AC_CHECK_FUNCS(pthread_cancel) + ]) + ]) +]) -dnl We use DGA if possible. +dnl If POSIX.4 semaphores are not available, we emulate them with pthread mutexes. +SEMSRCS= +AC_CHECK_FUNCS(sem_init, , [ + SEMSRCS=posix_sem.cpp +]) + +dnl We use DGA (XFree86 or fbdev) if possible. if [[ "x$WANT_XF86_DGA" = "xyes" ]]; then - AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, HAVE_DGA=yes, HAVE_DGA=no) - if [[ "x$HAVE_DGA" = "xno" ]]; then - AC_MSG_WARN([Could not find XFree86 DGA extension, ignoring --enable-xf86-dga.]) - DEFINES="$DEFINES -DENABLE_XF86_DGA=0" - else + AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, [ DEFINES="$DEFINES -DENABLE_XF86_DGA=1" LIBS="$LIBS -lXxf86dga" if [[ "x$WANT_FBDEV_DGA" = "xyes" ]]; then AC_MSG_WARN([Cannot have both --enable-xf86-dga and --enable-fbdev-dga, ignoring --enable-fbdev-dga.]) WANT_FBDEV_DGA=no fi - fi + ], [ + AC_MSG_WARN([Could not find XFree86 DGA extension, ignoring --enable-xf86-dga.]) + DEFINES="$DEFINES -DENABLE_XF86_DGA=0" + ]) else DEFINES="$DEFINES -DENABLE_XF86_DGA=0" fi @@ -76,32 +72,31 @@ else fi dnl We use GTK+ if possible. +UISRCS=../dummy/prefs_editor_dummy.cpp if [[ "x$WANT_UI" = "xyes" ]]; then - AM_PATH_GTK(1.2.0) - if [[ "x$no_gtk" = "xyes" ]]; then - echo "Did not find gtk+, disabling user interface." - WANT_UI=no - GTK_CFLAGS= - GTK_LIBS= - else + AM_PATH_GTK(1.2.0, [ DEFINES="$DEFINES -DENABLE_GTK=1" - fi - CFLAGS="$CFLAGS $GTK_CFLAGS" - CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" - LIBS="$LIBS $GTK_LIBS" + CFLAGS="$CFLAGS $GTK_CFLAGS" + CXXFLAGS="$CXXFLAGS $GTK_CFLAGS" + LIBS="$LIBS $GTK_LIBS" + UISRCS=prefs_editor_gtk.cpp + ], [ + AC_MSG_WARN([Could not find GTK+, disabling user interface.]) + WANT_UI=no + ]) fi -dnl We need POSIX.4 semaphores (and other POSIX.4 blessings). -SEMSRCS= -AC_CHECK_FUNCS(sem_init) -if [[ "x$ac_cv_func_sem_init" = "xno" ]]; then - AC_CHECK_LIB(posix4, sem_init, HAVE_LIBPOSIX4=yes, HAVE_LIBPOSIX4=no) - if [[ "x$HAVE_LIBPOSIX4" = "xno" ]]; then - dnl Emulate semaphores with pthread mutexes - SEMSRCS="posix_sem.cpp" - else - LIBS="$LIBS -lposix4" - fi +dnl We use ESD if possible. +if [[ "x$WANT_ESD" = "xyes" ]]; then + AM_PATH_ESD(0.2.8, [ + DEFINES="$DEFINES -DENABLE_ESD=1" + CFLAGS="$CFLAGS $ESD_CFLAGS" + CXXFLAGS="$CXXFLAGS $ESD_CFLAGS" + LIBS="$LIBS $ESD_LIBS" + ], [ + AC_MSG_WARN([Could not find ESD, disabling ESD support.]) + WANT_ESD=no + ]) fi dnl Checks for header files. @@ -125,13 +120,14 @@ AC_STRUCT_TM dnl Checks for library functions. AC_CHECK_FUNCS(strdup cfmakeraw) AC_CHECK_FUNCS(nanosleep clock_gettime timer_create) +AC_CHECK_FUNCS(pthread_cancel) dnl Select system-dependant source files. SYSSRCS="../dummy/ether_dummy.cpp ../dummy/scsi_dummy.cpp ../dummy/audio_dummy.cpp" if MACHINE=`uname -a 2>/dev/null`; then case "$MACHINE" in Linux*) - SYSSRCS="Linux/ether_linux.cpp Linux/scsi_linux.cpp Linux/audio_linux.cpp" + SYSSRCS="Linux/ether_linux.cpp Linux/scsi_linux.cpp audio_oss_esd.cpp" ;; FreeBSD*3.*) dnl Check for the CAM library @@ -146,7 +142,7 @@ if MACHINE=`uname -a 2>/dev/null`; then dnl to access directly to the functions in the kernel :) --Orlando AC_MSG_ERROR([Cannot find kernel includes for CAM library.]) fi - SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp ../dummy/audio_dummy.cpp" + SYSSRCS="../dummy/ether_dummy.cpp FreeBSD/scsi_freebsd.cpp audio_oss_esd.cpp" CXXFLAGS="$CXXFLAGS -I/sys" CFLAGS="$CFLAGS -I/sys" LIBS="$LIBS -lcam" @@ -180,14 +176,7 @@ if MACHINE=`uname -a 2>/dev/null`; then ;; esac fi -if [[ "x$WANT_UI" = "xyes" ]]; then - SYSSRCS="$SYSSRCS prefs_editor_gtk.cpp" -else - SYSSRCS="$SYSSRCS ../dummy/prefs_editor_dummy.cpp" -fi -if [[ "x$SEMSRCS" != "x" ]]; then - SYSSRCS="$SYSSRCS $SEMSRCS" -fi +SYSSRCS="$SYSSRCS $SEMSRCS $UISRCS" dnl Check for i386 CPU. HAVE_I386=no @@ -272,7 +261,6 @@ CPUSRCS="../uae_cpu/basilisk_glue.cpp ../uae_cpu/memory.cpp ../uae_cpu/newcpu.cp dnl Generate Makefile. AC_SUBST(DEFINES) -AC_SUBST(STATICLIBS) AC_SUBST(SYSSRCS) AC_SUBST(CPUINCLUDES) AC_SUBST(CPUSRCS) diff --git a/BasiliskII/src/Unix/mkinstalldirs b/BasiliskII/src/Unix/mkinstalldirs new file mode 100755 index 00000000..6b3b5fc5 --- /dev/null +++ b/BasiliskII/src/Unix/mkinstalldirs @@ -0,0 +1,40 @@ +#! /bin/sh +# mkinstalldirs --- make directory hierarchy +# Author: Noah Friedman +# Created: 1993-05-16 +# Public domain + +# $Id$ + +errstatus=0 + +for file +do + set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` + shift + + pathcomp= + for d + do + pathcomp="$pathcomp$d" + case "$pathcomp" in + -* ) pathcomp=./$pathcomp ;; + esac + + if test ! -d "$pathcomp"; then + echo "mkdir $pathcomp" + + mkdir "$pathcomp" || lasterr=$? + + if test ! -d "$pathcomp"; then + errstatus=$lasterr + fi + fi + + pathcomp="$pathcomp/" + done +done + +exit $errstatus + +# mkinstalldirs ends here diff --git a/BasiliskII/src/Unix/user_strings_unix.cpp b/BasiliskII/src/Unix/user_strings_unix.cpp index d3831461..7e410cf7 100644 --- a/BasiliskII/src/Unix/user_strings_unix.cpp +++ b/BasiliskII/src/Unix/user_strings_unix.cpp @@ -43,6 +43,7 @@ user_string_def platform_strings[] = { {STR_SCSI_DEVICE_OPEN_WARN, "Cannot open %s (%s). SCSI Manager access to this device will be disabled."}, {STR_SCSI_DEVICE_NOT_SCSI_WARN, "%s doesn't seem to comply to the Generic SCSI API. SCSI Manager access to this device will be disabled."}, {STR_NO_AUDIO_DEV_WARN, "Cannot open %s (%s). Audio output will be disabled."}, + {STR_NO_ESD_WARN, "Cannot open ESD connection. Audio output will be disabled."}, {STR_AUDIO_FORMAT_WARN, "Audio hardware doesn't support signed 16 bit format. Audio output will be disabled."}, {STR_KEYCODE_FILE_WARN, "Cannot open keycode translation file %s (%s)."}, {STR_KEYCODE_VENDOR_WARN, "Cannot find vendor '%s' in keycode translation file %s."}, diff --git a/BasiliskII/src/Unix/user_strings_unix.h b/BasiliskII/src/Unix/user_strings_unix.h index 922b165e..f4de3dfd 100644 --- a/BasiliskII/src/Unix/user_strings_unix.h +++ b/BasiliskII/src/Unix/user_strings_unix.h @@ -34,6 +34,7 @@ enum { STR_SCSI_DEVICE_OPEN_WARN, STR_SCSI_DEVICE_NOT_SCSI_WARN, STR_NO_AUDIO_DEV_WARN, + STR_NO_ESD_WARN, STR_AUDIO_FORMAT_WARN, STR_KEYCODE_FILE_WARN, STR_KEYCODE_VENDOR_WARN, diff --git a/BasiliskII/src/cdrom.cpp b/BasiliskII/src/cdrom.cpp index 2d4a2057..39ecbe7a 100644 --- a/BasiliskII/src/cdrom.cpp +++ b/BasiliskII/src/cdrom.cpp @@ -310,6 +310,7 @@ void CDROMExit(void) { DriveInfo *info = first_drive_info, *next; while (info != NULL) { + SysAllowRemoval(info->fh); Sys_close(info->fh); next = info->next; delete info;