From 862965f4f71b19f251934b11d1e998831ccbaee6 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Tue, 25 Aug 2009 03:26:35 -0700 Subject: [PATCH] openal32: Add a stub DLL thunk. --- configure | 73 ++++++++++++++++++++++++++++ configure.ac | 13 +++++ dlls/openal32/Makefile.in | 14 ++++++ dlls/openal32/openal.c | 47 ++++++++++++++++++ dlls/openal32/openal32.spec | 97 +++++++++++++++++++++++++++++++++++++ include/config.h.in | 3 ++ 6 files changed, 247 insertions(+) create mode 100644 dlls/openal32/Makefile.in create mode 100644 dlls/openal32/openal.c create mode 100644 dlls/openal32/openal32.spec diff --git a/configure b/configure index 3874a35a0bf..329b2437d86 100755 --- a/configure +++ b/configure @@ -617,6 +617,7 @@ LDPATH BUILTINFLAG EXTRACFLAGS LIBKSTAT +LIBOPENAL LIBMPG123 PNGINCL FONTCONFIGINCL @@ -792,6 +793,7 @@ with_jpeg with_ldap with_mpg123 with_nas +with_openal with_opengl with_openssl with_oss @@ -1476,6 +1478,7 @@ Optional Packages: --without-ldap do not use LDAP --without-mpg123 do not use the mpg123 library --without-nas do not use the NAS sound support + --without-openal do not use OpenAL --without-opengl do not use OpenGL --without-openssl do not use OpenSSL --without-oss do not use the OSS sound support @@ -2617,6 +2620,12 @@ if test "${with_nas+set}" = set; then : fi +# Check whether --with-openal was given. +if test "${with_openal+set}" = set; then : + withval=$with_openal; if test "x$withval" = "xno"; then ac_cv_header_AL_al_h=no; fi +fi + + # Check whether --with-opengl was given. if test "${with_opengl+set}" = set; then : withval=$with_opengl; @@ -5650,6 +5659,7 @@ done for ac_header in \ + AL/al.h \ AudioUnit/AudioUnit.h \ Carbon/Carbon.h \ CoreAudio/CoreAudio.h \ @@ -11326,6 +11336,60 @@ esac fi test "x$ac_cv_lib_mpg123_mpg123_feed" = xyes || enable_winemp3_acm=${enable_winemp3_acm:-no} +if test "$ac_cv_header_AL_al_h" = "yes" +then + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for alGetSource3i in -lopenal" >&5 +$as_echo_n "checking for alGetSource3i in -lopenal... " >&6; } +if test "${ac_cv_lib_openal_alGetSource3i+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lopenal $LIBS" +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char alGetSource3i (); +int +main () +{ +return alGetSource3i (); + ; + return 0; +} +_ACEOF +if ac_fn_c_try_link "$LINENO"; then : + ac_cv_lib_openal_alGetSource3i=yes +else + ac_cv_lib_openal_alGetSource3i=no +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_openal_alGetSource3i" >&5 +$as_echo "$ac_cv_lib_openal_alGetSource3i" >&6; } +if test "x$ac_cv_lib_openal_alGetSource3i" = x""yes; then : + LIBOPENAL="-lopenal" + +fi + +fi +if test "x$ac_cv_lib_openal_alGetSource3i" != xyes; then : + case "x$with_openal" in + x) wine_notices="$wine_notices|libopenal ${notice_platform}development files not found (or too old), OpenAL won't be supported." ;; + xno) ;; + *) as_fn_error "libopenal ${notice_platform}development files not found (or too old), OpenAL won't be supported. +This is an error since --with-openal was requested." "$LINENO" 5 ;; +esac +fi +test "x$ac_cv_lib_openal_alGetSource3i" = xyes || enable_openal32=${enable_openal32:-no} + if test "$ac_cv_header_kstat_h" = "yes" then { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kstat_open in -lkstat" >&5 @@ -15961,6 +16025,14 @@ ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS dlls/olethk32/Makefile: dlls/olethk32/Makefile.in dlls/Makedll.rules" ac_config_files="$ac_config_files dlls/olethk32/Makefile" +ALL_MAKEFILES="$ALL_MAKEFILES \\ + dlls/openal32/Makefile" +test "x$enable_openal32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ + openal32" +ALL_MAKEFILE_DEPENDS="$ALL_MAKEFILE_DEPENDS +dlls/openal32/Makefile: dlls/openal32/Makefile.in dlls/Makedll.rules" +ac_config_files="$ac_config_files dlls/openal32/Makefile" + ALL_MAKEFILES="$ALL_MAKEFILES \\ dlls/opengl32/Makefile" test "x$enable_opengl32" != xno && ALL_DLL_DIRS="$ALL_DLL_DIRS \\ @@ -18855,6 +18927,7 @@ do "dlls/olesvr.dll16/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/olesvr.dll16/Makefile" ;; "dlls/olesvr32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/olesvr32/Makefile" ;; "dlls/olethk32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/olethk32/Makefile" ;; + "dlls/openal32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/openal32/Makefile" ;; "dlls/opengl32/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/opengl32/Makefile" ;; "dlls/opengl32/tests/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/opengl32/tests/Makefile" ;; "dlls/pdh/Makefile") CONFIG_FILES="$CONFIG_FILES dlls/pdh/Makefile" ;; diff --git a/configure.ac b/configure.ac index 0d2e860cde3..adec95f6231 100644 --- a/configure.ac +++ b/configure.ac @@ -53,6 +53,8 @@ AC_ARG_WITH(mpg123, AS_HELP_STRING([--without-mpg123],[do not use the mpg123 [if test "x$withval" = "xno"; then ac_cv_header_mpg123_h=no; fi]) AC_ARG_WITH(nas, AS_HELP_STRING([--without-nas],[do not use the NAS sound support]), [if test "x$withval" = "xno"; then ac_cv_header_audio_audiolib_h=no; fi]) +AC_ARG_WITH(openal, AS_HELP_STRING([--without-openal],[do not use OpenAL]), + [if test "x$withval" = "xno"; then ac_cv_header_AL_al_h=no; fi]) AC_ARG_WITH(opengl, AS_HELP_STRING([--without-opengl],[do not use OpenGL])) AC_ARG_WITH(openssl, AS_HELP_STRING([--without-openssl],[do not use OpenSSL]), [if test "x$withval" = "xno"; then ac_cv_header_openssl_err_h=no; ac_cv_header_openssl_ssl_h=no; fi]) @@ -294,6 +296,7 @@ dnl **** Check for header files **** AC_SYS_LARGEFILE() AC_CHECK_HEADERS(\ + AL/al.h \ AudioUnit/AudioUnit.h \ Carbon/Carbon.h \ CoreAudio/CoreAudio.h \ @@ -1417,6 +1420,15 @@ WINE_NOTICE_WITH(mpg123,[test "x$ac_cv_lib_mpg123_mpg123_feed" != xyes], [libmpg123 ${notice_platform}development files not found (or too old), mp3 codec won't be supported.]) test "x$ac_cv_lib_mpg123_mpg123_feed" = xyes || enable_winemp3_acm=${enable_winemp3_acm:-no} +dnl **** Check for OpenAL 1.1 **** +if test "$ac_cv_header_AL_al_h" = "yes" +then + AC_CHECK_LIB(openal,alGetSource3i,[AC_SUBST(LIBOPENAL,"-lopenal")]) +fi +WINE_NOTICE_WITH(openal,[test "x$ac_cv_lib_openal_alGetSource3i" != xyes], + [libopenal ${notice_platform}development files not found (or too old), OpenAL won't be supported.]) +test "x$ac_cv_lib_openal_alGetSource3i" = xyes || enable_openal32=${enable_openal32:-no} + dnl **** Check for libkstat **** if test "$ac_cv_header_kstat_h" = "yes" then @@ -2346,6 +2358,7 @@ WINE_CONFIG_MAKEFILE([dlls/olepro32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_D WINE_CONFIG_MAKEFILE([dlls/olesvr.dll16/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS],[enable_win16]) WINE_CONFIG_MAKEFILE([dlls/olesvr32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/olethk32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) +WINE_CONFIG_MAKEFILE([dlls/openal32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/opengl32/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) WINE_CONFIG_MAKEFILE([dlls/opengl32/tests/Makefile],[dlls/Maketest.rules],[dlls],[ALL_TEST_DIRS],[enable_tests]) WINE_CONFIG_MAKEFILE([dlls/pdh/Makefile],[dlls/Makedll.rules],[dlls],[ALL_DLL_DIRS]) diff --git a/dlls/openal32/Makefile.in b/dlls/openal32/Makefile.in new file mode 100644 index 00000000000..b237706681c --- /dev/null +++ b/dlls/openal32/Makefile.in @@ -0,0 +1,14 @@ +TOPSRCDIR = @top_srcdir@ +TOPOBJDIR = ../.. +SRCDIR = @srcdir@ +VPATH = @srcdir@ +MODULE = openal32.dll +IMPORTS = kernel32 ntdll +EXTRALIBS = @LIBOPENAL@ + +C_SRCS = \ + openal.c + +@MAKE_DLL_RULES@ + +@DEPENDENCIES@ # everything below this line is overwritten by make depend diff --git a/dlls/openal32/openal.c b/dlls/openal32/openal.c new file mode 100644 index 00000000000..b2ee1e99d82 --- /dev/null +++ b/dlls/openal32/openal.c @@ -0,0 +1,47 @@ +/* + * OpenAL32.dll thunk. Wraps Win32 OpenAL function calls around a native + * implementation. + * + * Copyright 2007 Nick Burns (adger44@hotmail.com) + * Copyright 2007,2009 Chris Robinson + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +#include "config.h" + +#include +#include + +#include "windef.h" +#include "winbase.h" +#include "wine/debug.h" + +WINE_DEFAULT_DEBUG_CHANNEL(openal32); + + +/*********************************************************************** + * OpenAL initialisation routine + */ +BOOL WINAPI DllMain( HINSTANCE hinst, DWORD reason, LPVOID reserved ) +{ + switch(reason) + { + case DLL_WINE_PREATTACH: + return FALSE; /* prefer native version */ + } + + return TRUE; +} diff --git a/dlls/openal32/openal32.spec b/dlls/openal32/openal32.spec new file mode 100644 index 00000000000..80a2a01cb41 --- /dev/null +++ b/dlls/openal32/openal32.spec @@ -0,0 +1,97 @@ +#OpenAL ALC_1_0 +@ stub alcCreateContext +@ stub alcMakeContextCurrent +@ stub alcProcessContext +@ stub alcSuspendContext +@ stub alcDestroyContext +@ stub alcGetCurrentContext +@ stub alcGetContextsDevice +@ stub alcOpenDevice +@ stub alcCloseDevice +@ stub alcGetError +@ stub alcIsExtensionPresent +@ stub alcGetProcAddress +@ stub alcGetEnumValue +@ stub alcGetString +@ stub alcGetIntegerv +#OpenAL AL_1_0 +@ stub alEnable +@ stub alDisable +@ stub alIsEnabled +@ stub alGetString +@ stub alGetBooleanv +@ stub alGetIntegerv +@ stub alGetFloatv +@ stub alGetDoublev +@ stub alGetBoolean +@ stub alGetInteger +@ stub alGetFloat +@ stub alGetDouble +@ stub alGetError +@ stub alIsExtensionPresent +@ stub alGetProcAddress +@ stub alGetEnumValue +@ stub alListenerf +@ stub alListener3f +@ stub alListenerfv +@ stub alListeneri +@ stub alGetListenerf +@ stub alGetListener3f +@ stub alGetListenerfv +@ stub alGetListeneri +@ stub alGetListeneriv +@ stub alGenSources +@ stub alDeleteSources +@ stub alIsSource +@ stub alSourcef +@ stub alSource3f +@ stub alSourcefv +@ stub alSourcei +@ stub alGetSourcef +@ stub alGetSource3f +@ stub alGetSourcefv +@ stub alGetSourcei +@ stub alGetSourceiv +@ stub alSourcePlayv +@ stub alSourceStopv +@ stub alSourceRewindv +@ stub alSourcePausev +@ stub alSourcePlay +@ stub alSourceStop +@ stub alSourceRewind +@ stub alSourcePause +@ stub alSourceQueueBuffers +@ stub alSourceUnqueueBuffers +@ stub alGenBuffers +@ stub alDeleteBuffers +@ stub alIsBuffer +@ stub alBufferData +@ stub alGetBufferf +@ stub alGetBufferfv +@ stub alGetBufferi +@ stub alGetBufferiv +@ stub alDopplerFactor +@ stub alDopplerVelocity +@ stub alDistanceModel +#OpenAL ALC_1_1 +@ stub alcCaptureOpenDevice +@ stub alcCaptureCloseDevice +@ stub alcCaptureStart +@ stub alcCaptureStop +@ stub alcCaptureSamples +#OpenAL AL_1_1 +@ stub alListener3i +@ stub alListeneriv +@ stub alGetListener3i +@ stub alSource3i +@ stub alSourceiv +@ stub alGetSource3i +@ stub alBufferf +@ stub alBuffer3f +@ stub alBufferfv +@ stub alBufferi +@ stub alBuffer3i +@ stub alBufferiv +@ stub alGetBuffer3f +@ stub alGetBuffer3i +@ stub alSpeedOfSound diff --git a/include/config.h.in b/include/config.h.in index 6956963b99f..161a41c0923 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -14,6 +14,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_ALSA_ASOUNDLIB_H +/* Define to 1 if you have the header file. */ +#undef HAVE_AL_AL_H + /* Define to 1 if you have the header file. */ #undef HAVE_ARPA_INET_H