comparison src/openal-1-libtype-static.patch @ 1449:a28d4559075c

replace the ugly hacks with clean patches for package openal
author Volker Grabsch <vog@notjusthosting.com>
date Sun, 28 Nov 2010 22:28:35 +0100
parents
children
comparison
equal deleted inserted replaced
1448:866560a7ee0a 1449:a28d4559075c
1 This file is part of mingw-cross-env.
2 See doc/index.html for further information.
3
4 This patch has been taken from:
5 http://opensource.creative.com/pipermail/openal-devel/2010-November/005759.html
6
7 diff -r 37cec05f2c93 CMakeLists.txt
8 --- a/CMakeLists.txt Sun Nov 28 20:53:45 2010 +0100
9 +++ b/CMakeLists.txt Sun Nov 28 22:12:22 2010 +0100
10 @@ -428,6 +428,14 @@
11 SET(includedir "\${prefix}/include")
12 SET(PACKAGE_VERSION "${LIB_VERSION}")
13
14 +# Library type (static/shared)
15 +IF(NOT LIBTYPE)
16 + SET(LIBTYPE SHARED)
17 +ENDIF()
18 +IF(LIBTYPE STREQUAL "STATIC")
19 + SET(PKG_CONFIG_CFLAGS -DAL_LIBTYPE_STATIC ${PKG_CONFIG_CFLAGS})
20 +ENDIF()
21 +
22 # End configuration
23 CONFIGURE_FILE(
24 "${OpenAL_SOURCE_DIR}/config.h.in"
25 @@ -438,9 +446,6 @@
26 @ONLY)
27
28 # Build a library
29 -IF(NOT LIBTYPE)
30 - SET(LIBTYPE SHARED)
31 -ENDIF()
32 ADD_LIBRARY(${LIBNAME} ${LIBTYPE} ${OPENAL_OBJS} ${ALC_OBJS})
33 SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES DEFINE_SYMBOL AL_BUILD_LIBRARY
34 COMPILE_FLAGS -DAL_ALEXT_PROTOTYPES
35 @@ -477,6 +482,7 @@
36
37 IF(EXAMPLES)
38 ADD_EXECUTABLE(openal-info examples/openal-info.c)
39 + ADD_DEFINITIONS(${PKG_CONFIG_CFLAGS})
40 TARGET_LINK_LIBRARIES(openal-info ${LIBNAME})
41 INSTALL(TARGETS openal-info
42 RUNTIME DESTINATION bin
43 diff -r 37cec05f2c93 include/AL/al.h
44 --- a/include/AL/al.h Sun Nov 28 20:53:45 2010 +0100
45 +++ b/include/AL/al.h Sun Nov 28 22:12:22 2010 +0100
46 @@ -5,7 +5,7 @@
47 extern "C" {
48 #endif
49
50 -#if defined(_WIN32) && !defined(_XBOX)
51 +#if defined(_WIN32) && !defined(_XBOX) && !defined(AL_LIBTYPE_STATIC)
52 #if defined(AL_BUILD_LIBRARY)
53 #define AL_API __declspec(dllexport)
54 #else
55 diff -r 37cec05f2c93 include/AL/alc.h
56 --- a/include/AL/alc.h Sun Nov 28 20:53:45 2010 +0100
57 +++ b/include/AL/alc.h Sun Nov 28 22:12:22 2010 +0100
58 @@ -5,7 +5,7 @@
59 extern "C" {
60 #endif
61
62 -#if defined(_WIN32) && !defined(_XBOX)
63 +#if defined(_WIN32) && !defined(_XBOX) && !defined(AL_LIBTYPE_STATIC)
64 #if defined(AL_BUILD_LIBRARY)
65 #define ALC_API __declspec(dllexport)
66 #else
67 diff -r 37cec05f2c93 openal.pc.in
68 --- a/openal.pc.in Sun Nov 28 20:53:45 2010 +0100
69 +++ b/openal.pc.in Sun Nov 28 22:12:22 2010 +0100
70 @@ -8,4 +8,4 @@
71 Requires: @PKG_CONFIG_REQUIRES@
72 Version: @PACKAGE_VERSION@
73 Libs: -L${libdir} -l@LIBNAME@ @PKG_CONFIG_LIBS@
74 -Cflags: -I${includedir}
75 +Cflags: -I${includedir} @PKG_CONFIG_CFLAGS@