From c4a45ccd43dcb2f967b1a4e1f5e8719c2a4fbab6 Mon Sep 17 00:00:00 2001 From: Tony Theodore Date: Fri, 1 Oct 2010 02:03:08 +1000 Subject: package openal: combine patch files, portability fixes, and add test program --- src/openal-1-fixes.patch | 57 +++++++++++++++++++++++++++++++++++++++++++++++ src/openal-1-static.patch | 21 ----------------- src/openal-2-static.patch | 21 ----------------- src/openal-test.c | 21 +++++++++++++++++ src/openal.mk | 12 +++++----- 5 files changed, 85 insertions(+), 47 deletions(-) create mode 100644 src/openal-1-fixes.patch delete mode 100644 src/openal-1-static.patch delete mode 100644 src/openal-2-static.patch create mode 100644 src/openal-test.c diff --git a/src/openal-1-fixes.patch b/src/openal-1-fixes.patch new file mode 100644 index 0000000..5510d7a --- /dev/null +++ b/src/openal-1-fixes.patch @@ -0,0 +1,57 @@ +# This file is part of mingw-cross-env. +# See doc/index.html for further information. + +diff -urN openal-soft-1.12.854.orig/include/AL/al.h openal-soft-1.12.854.new/include/AL/al.h +--- openal-soft-1.12.854.orig/include/AL/al.h 2010-03-29 17:23:32.000000000 +1100 ++++ openal-soft-1.12.854.new/include/AL/al.h 2010-10-01 01:04:45.000000000 +1000 +@@ -5,6 +5,10 @@ + extern "C" { + #endif + ++#if 1 ++ #define AL_API ++ #define AL_APIENTRY ++#else + #if defined(_WIN32) && !defined(_XBOX) + #if defined(AL_BUILD_LIBRARY) + #define AL_API __declspec(dllexport) +@@ -18,6 +22,7 @@ + #define AL_API extern + #endif + #endif ++#endif + + #if defined(_WIN32) + #define AL_APIENTRY __cdecl +diff -urN openal-soft-1.12.854.orig/include/AL/alc.h openal-soft-1.12.854.new/include/AL/alc.h +--- openal-soft-1.12.854.orig/include/AL/alc.h 2010-03-29 17:23:52.000000000 +1100 ++++ openal-soft-1.12.854.new/include/AL/alc.h 2010-10-01 01:04:45.000000000 +1000 +@@ -5,6 +5,10 @@ + extern "C" { + #endif + ++#if 1 ++ #define ALC_API ++ #define ALC_APIENTRY ++#else + #if defined(_WIN32) && !defined(_XBOX) + #if defined(AL_BUILD_LIBRARY) + #define ALC_API __declspec(dllexport) +@@ -18,6 +22,7 @@ + #define ALC_API extern + #endif + #endif ++#endif + + #if defined(_WIN32) + #define ALC_APIENTRY __cdecl +diff -urN openal-soft-1.12.854.orig/openal.pc.in openal-soft-1.12.854.new/openal.pc.in +--- openal-soft-1.12.854.orig/openal.pc.in 2008-07-24 04:55:49.000000000 +1000 ++++ openal-soft-1.12.854.new/openal.pc.in 2010-10-01 01:04:45.000000000 +1000 +@@ -7,5 +7,5 @@ + Description: OpenAL is a cross-platform 3D audio API + Requires: @PKG_CONFIG_REQUIRES@ + Version: @PACKAGE_VERSION@ +-Libs: -L${libdir} -l@LIBNAME@ @PKG_CONFIG_LIBS@ ++Libs: -L${libdir} -l@LIBNAME@ @PKG_CONFIG_LIBS@ -lwinmm + Cflags: -I${includedir} diff --git a/src/openal-1-static.patch b/src/openal-1-static.patch deleted file mode 100644 index d18d4dc..0000000 --- a/src/openal-1-static.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/include/AL/al.h 2010-03-29 08:23:32.000000000 +0200 -+++ b/include/AL/al.h 2010-09-30 15:45:27.845778136 +0200 -@@ -5,6 +5,10 @@ - extern "C" { - #endif - -+#if 1 -+ #define AL_API -+ #define AL_APIENTRY -+#else - #if defined(_WIN32) && !defined(_XBOX) - #if defined(AL_BUILD_LIBRARY) - #define AL_API __declspec(dllexport) -@@ -18,6 +22,7 @@ - #define AL_API extern - #endif - #endif -+#endif - - #if defined(_WIN32) - #define AL_APIENTRY __cdecl diff --git a/src/openal-2-static.patch b/src/openal-2-static.patch deleted file mode 100644 index 05b2023..0000000 --- a/src/openal-2-static.patch +++ /dev/null @@ -1,21 +0,0 @@ ---- a/include/AL/alc.h 2010-03-29 08:23:52.000000000 +0200 -+++ b/include/AL/alc.h 2010-09-30 15:45:54.681777409 +0200 -@@ -5,6 +5,10 @@ - extern "C" { - #endif - -+#if 1 -+ #define ALC_API -+ #define ALC_APIENTRY -+#else - #if defined(_WIN32) && !defined(_XBOX) - #if defined(AL_BUILD_LIBRARY) - #define ALC_API __declspec(dllexport) -@@ -18,6 +22,7 @@ - #define ALC_API extern - #endif - #endif -+#endif - - #if defined(_WIN32) - #define ALC_APIENTRY __cdecl diff --git a/src/openal-test.c b/src/openal-test.c new file mode 100644 index 0000000..59f08cd --- /dev/null +++ b/src/openal-test.c @@ -0,0 +1,21 @@ +/* This file is part of mingw-cross-env. */ +/* See doc/index.html for further information. */ + +#include + +int main(int argc, char **argv) +{ + ALCdevice *dev; + ALCcontext *ctx; + + (void)argc; + (void)argv; + + dev = alcOpenDevice(0); + ctx = alcCreateContext(dev, 0); + + alcDestroyContext(ctx); + alcCloseDevice(dev); + + return 0; +} \ No newline at end of file diff --git a/src/openal.mk b/src/openal.mk index 8998484..f29cfc8 100644 --- a/src/openal.mk +++ b/src/openal.mk @@ -33,9 +33,11 @@ define $(PKG)_BUILD -DCMAKE_INSTALL_PREFIX='$(PREFIX)/$(TARGET)' \ -DCMAKE_BUILD_TYPE=Release \ -DLIBTYPE=STATIC - cd '$(1)/build' && $(MAKE) -j '$(JOBS)' - cd '$(1)/build' && cp -fv OpenAL32.a $(PREFIX)/$(TARGET)/lib/libOpenAL32.a - cd '$(1)/build' && cp -rfv openal.pc $(PREFIX)/$(TARGET)/lib/pkgconfig - $(SED) -i 's,^\(Libs:.*\),\1 -lwinmm,' $(PREFIX)/$(TARGET)/lib/pkgconfig/openal.pc - cd '$(1)' && cp -rfv include/* $(PREFIX)/$(TARGET)/include + $(MAKE) -C '$(1)/build' -j '$(JOBS)' install + ln -sf '$(PREFIX)/$(TARGET)/lib/OpenAL32.a' '$(PREFIX)/$(TARGET)/lib/libOpenAL32.a' + + '$(TARGET)-gcc' \ + -W -Wall -Werror -ansi -pedantic \ + '$(2).c' -o '$(PREFIX)/$(TARGET)/bin/test-openal.exe' \ + `'$(TARGET)-pkg-config' openal --cflags --libs` endef -- cgit v0.12