summaryrefslogtreecommitdiffstats
path: root/src/openal-1-libtype-static.patch
blob: c1fca5c33c87db9b4bb1d76909fbfbe6ce2249ee (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
This file is part of mingw-cross-env.
See doc/index.html for further information.

This patch has been taken from:
http://opensource.creative.com/pipermail/openal-devel/2010-November/005759.html

diff -r 37cec05f2c93 CMakeLists.txt
--- a/CMakeLists.txt	Sun Nov 28 20:53:45 2010 +0100
+++ b/CMakeLists.txt	Sun Nov 28 22:12:22 2010 +0100
@@ -428,6 +428,14 @@
 SET(includedir "\${prefix}/include")
 SET(PACKAGE_VERSION "${LIB_VERSION}")
 
+# Library type (static/shared)
+IF(NOT LIBTYPE)
+    SET(LIBTYPE SHARED)
+ENDIF()
+IF(LIBTYPE STREQUAL "STATIC")
+    SET(PKG_CONFIG_CFLAGS -DAL_LIBTYPE_STATIC ${PKG_CONFIG_CFLAGS})
+ENDIF()
+
 # End configuration
 CONFIGURE_FILE(
     "${OpenAL_SOURCE_DIR}/config.h.in"
@@ -438,9 +446,6 @@
     @ONLY)
 
 # Build a library
-IF(NOT LIBTYPE)
-    SET(LIBTYPE SHARED)
-ENDIF()
 ADD_LIBRARY(${LIBNAME} ${LIBTYPE} ${OPENAL_OBJS} ${ALC_OBJS})
 SET_TARGET_PROPERTIES(${LIBNAME} PROPERTIES DEFINE_SYMBOL AL_BUILD_LIBRARY
                                             COMPILE_FLAGS -DAL_ALEXT_PROTOTYPES
@@ -477,6 +482,7 @@
 
 IF(EXAMPLES)
     ADD_EXECUTABLE(openal-info examples/openal-info.c)
+    ADD_DEFINITIONS(${PKG_CONFIG_CFLAGS})
     TARGET_LINK_LIBRARIES(openal-info ${LIBNAME})
     INSTALL(TARGETS openal-info
             RUNTIME DESTINATION bin
diff -r 37cec05f2c93 include/AL/al.h
--- a/include/AL/al.h	Sun Nov 28 20:53:45 2010 +0100
+++ b/include/AL/al.h	Sun Nov 28 22:12:22 2010 +0100
@@ -5,7 +5,7 @@
 extern "C" {
 #endif
 
-#if defined(_WIN32) && !defined(_XBOX)
+#if defined(_WIN32) && !defined(_XBOX) && !defined(AL_LIBTYPE_STATIC)
  #if defined(AL_BUILD_LIBRARY)
   #define AL_API __declspec(dllexport)
  #else
diff -r 37cec05f2c93 include/AL/alc.h
--- a/include/AL/alc.h	Sun Nov 28 20:53:45 2010 +0100
+++ b/include/AL/alc.h	Sun Nov 28 22:12:22 2010 +0100
@@ -5,7 +5,7 @@
 extern "C" {
 #endif
 
-#if defined(_WIN32) && !defined(_XBOX)
+#if defined(_WIN32) && !defined(_XBOX) && !defined(AL_LIBTYPE_STATIC)
  #if defined(AL_BUILD_LIBRARY)
   #define ALC_API __declspec(dllexport)
  #else
diff -r 37cec05f2c93 openal.pc.in
--- a/openal.pc.in	Sun Nov 28 20:53:45 2010 +0100
+++ b/openal.pc.in	Sun Nov 28 22:12:22 2010 +0100
@@ -8,4 +8,4 @@
 Requires: @PKG_CONFIG_REQUIRES@
 Version: @PACKAGE_VERSION@
 Libs: -L${libdir} -l@LIBNAME@ @PKG_CONFIG_LIBS@
-Cflags: -I${includedir}
+Cflags: -I${includedir} @PKG_CONFIG_CFLAGS@