From f002abe258f5d1406d01ebc3fda05c8a87709dfb Mon Sep 17 00:00:00 2001 From: Greg V Date: Fri, 18 May 2018 02:51:33 +0300 Subject: [PATCH] Add dummy cdrom ioctl module for other OSes --- configure.ac | 13 ++++++++++++- src/Makefile.am | 4 ++++ src/cdrom-ioctl-dummy.c | 20 ++++++++++++++++++++ 3 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 src/cdrom-ioctl-dummy.c diff --git a/configure.ac b/configure.ac index 00dd888..1e3b094 100644 --- a/configure.ac +++ b/configure.ac @@ -118,6 +118,7 @@ AC_CHECK_LIB([pthread], [pthread_create]) build_macosx="no" build_linux="no" build_win="no" +build_other="no" case "$host" in *-*-darwin*) @@ -135,7 +136,7 @@ case "$host" in build_win="yes" AC_SUBST(SET_MAKE, 'MAKE=mingw32-make') ;; - *) + *-*-linux*) AC_CHECK_LIB([GL], [glGetError], [], \ [echo "You need to install the OpenGL library." exit -1]) @@ -144,12 +145,22 @@ case "$host" in exit -1]) build_linux="yes" ;; + *) + AC_CHECK_LIB([GL], [glGetError], [], \ + [echo "You need to install the OpenGL library." + exit -1]) + AC_CHECK_LIB([openal], [alGetError], [], \ + [echo "You need to install the OpenAL library." + exit -1]) + build_other="yes" + ;; esac LIBS="$LIBS $WX_LIBS $SDL_LIBS" AM_CONDITIONAL(OS_LINUX, [test "$build_linux" = "yes"]) AM_CONDITIONAL(OS_WINDOWS, [test "$build_win" = "yes"]) +AM_CONDITIONAL(OS_OTHER, [test "$build_other" = "yes"]) AM_CONDITIONAL(OS_MACOSX, [test "$build_macosx" = "yes"]) AC_OUTPUT([Makefile src/Makefile]) diff --git a/src/Makefile.am b/src/Makefile.am index 1c0fd4c..7bbb5be 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -97,6 +97,10 @@ if OS_LINUX pcem_SOURCES += cdrom-ioctl-linux.c wx-sdl2-display.c endif +if OS_OTHER +pcem_SOURCES += cdrom-ioctl-dummy.c wx-sdl2-display.c +endif + if OS_MACOSX pcem_SOURCES += cdrom-ioctl-osx.c wx-sdl2-display.c pcem_CFLAGS += -DPCEM_RENDER_WITH_TIMER -DPCEM_RENDER_TIMER_LOOP diff --git a/src/cdrom-ioctl-dummy.c b/src/cdrom-ioctl-dummy.c new file mode 100644 index 0000000..a4229ac --- /dev/null +++ b/src/cdrom-ioctl-dummy.c @@ -0,0 +1,20 @@ +/*Dummy CD-ROM support for other OSes*/ + +#include + +int old_cdrom_drive; + +void ioctl_audio_callback(int16_t *output, int len) { } + +void ioctl_audio_stop() { } + +void ioctl_reset() { } + +void ioctl_set_drive(char d) { } + +int ioctl_open(char d) +{ + return 0; +} + +void ioctl_close(void) { }