]> git.saurik.com Git - wxWidgets.git/commitdiff
changes to make building plugins possible; build wxSound SDL plugin on Unix
authorVáclav Slavík <vslavik@fastmail.fm>
Sun, 1 Feb 2004 18:31:54 +0000 (18:31 +0000)
committerVáclav Slavík <vslavik@fastmail.fm>
Sun, 1 Feb 2004 18:31:54 +0000 (18:31 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@25458 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

build/bakefiles/common.bkl
build/bakefiles/config.bkl
build/bakefiles/files.bkl
build/bakefiles/monolithic.bkl
build/bakefiles/multilib.bkl
build/bakefiles/plugins.bkl [new file with mode: 0644]
build/bakefiles/plugins_deps.bkl [new file with mode: 0644]
build/bakefiles/wx.bkl
build/bakefiles/wxwin.py

index 4be742cddb58ab6d01659dec7c1ec9e3c5c0bf40..afda35b57858795114db2a2da52aa7b73b8f46a7 100644 (file)
@@ -10,7 +10,8 @@
     <using module="wxwin"/>
 
     <include file="config.bkl"/>
     <using module="wxwin"/>
 
     <include file="config.bkl"/>
-    
+
+    <include file="plugins_deps.bkl"/>
     
     <!-- ================================================================== -->
     <!--                     wxWindows version numbers:                     -->
     
     <!-- ================================================================== -->
     <!--                     wxWindows version numbers:                     -->
@@ -464,9 +465,9 @@ $(TAB)copy "$(DOLLAR)(InputPath)" $(SETUPHDIR)\wx\setup.h
     <!-- =============================================================== -->
 
     <if cond="WX_STABLE_BRANCH=='1'">
     <!-- =============================================================== -->
 
     <if cond="WX_STABLE_BRANCH=='1'">
-        <set var="PLUGIN_VERSION">
+        <set var="PLUGIN_VERSION0">
             <if cond="PLATFORM_UNIX=='1'">
             <if cond="PLATFORM_UNIX=='1'">
-                -$(WXVER_MAJOR).$(WXVER_MINOR)
+                $(WXVER_MAJOR).$(WXVER_MINOR)
             </if>
             <if cond="PLATFORM_UNIX=='0'">
                 $(WXVER_MAJOR)$(WXVER_MINOR)
             </if>
             <if cond="PLATFORM_UNIX=='0'">
                 $(WXVER_MAJOR)$(WXVER_MINOR)
@@ -474,32 +475,50 @@ $(TAB)copy "$(DOLLAR)(InputPath)" $(SETUPHDIR)\wx\setup.h
         </set>
     </if>
     <if cond="WX_STABLE_BRANCH=='0'">
         </set>
     </if>
     <if cond="WX_STABLE_BRANCH=='0'">
-        <set var="PLUGIN_VERSION">
+        <set var="PLUGIN_VERSION0">
             <if cond="PLATFORM_UNIX=='1'">
             <if cond="PLATFORM_UNIX=='1'">
-                -$(WXVER_MAJOR).$(WXVER_MINOR).$(WXVER_RELEASE)
+                $(WXVER_MAJOR).$(WXVER_MINOR).$(WXVER_RELEASE)
             </if>
             <if cond="PLATFORM_UNIX=='0'">
                 $(WXVER_MAJOR)$(WXVER_MINOR)$(WXVER_RELEASE)
             </if>
         </set>
     </if>
             </if>
             <if cond="PLATFORM_UNIX=='0'">
                 $(WXVER_MAJOR)$(WXVER_MINOR)$(WXVER_RELEASE)
             </if>
         </set>
     </if>
+    <set var="PLUGVERDELIM">
+        <if cond="PLATFORM_UNIX=='1'">-</if>
+        <if cond="PLATFORM_UNIX=='0'"></if>
+    </set>
+    <set var="PLUGIN_VERSION">$(PLUGVERDELIM)$(PLUGIN_VERSION0)</set>
+    
+    <set var="PLUGINSUFFIX">
+        <if cond="UNICODE=='0' and BUILD=='release'"></if>
+        <if cond="UNICODE=='0' and BUILD=='debug'">_d</if>
+        <if cond="UNICODE=='1' and BUILD=='release'">_u</if>
+        <if cond="UNICODE=='1' and BUILD=='debug'">_ud</if>
+    </set>
+
+    <set var="PLUGINS_INST_DIR" make_var="1">
+        $(LIBDIR)/wx/$(PLUGIN_VERSION0)
+    </set>
 
     <define-rule name="wx-base-plugin" extends="module">
         <template>
             <dllname>
 
     <define-rule name="wx-base-plugin" extends="module">
         <template>
             <dllname>
-                $(id)$(addPrefixIfNotEmpty('_',WXNAMESUFFIX))$(PLUGIN_VERSION)$(WXCOMPILER)
+                $(id)$(PLUGINSUFFIX)$(PLUGIN_VERSION)$(WXCOMPILER)
             </dllname>
             <define>WXUSINGDLL</define>
             <define>wxUSE_GUI=0</define>
             </dllname>
             <define>WXUSINGDLL</define>
             <define>wxUSE_GUI=0</define>
+            <install-to>$(PLUGINS_INST_DIR)</install-to>
         </template>
     </define-rule>
     
     <define-rule name="wx-gui-plugin" extends="module">
         <template template="wx">
             <dllname>
         </template>
     </define-rule>
     
     <define-rule name="wx-gui-plugin" extends="module">
         <template template="wx">
             <dllname>
-                $(id)_$(PORTNAME)$(WXUNIVNAME)$(WXNAMESUFFIX)$(PLUGIN_VERSION)$(WXCOMPILER)
+                $(id)_$(PORTNAME)$(WXUNIVNAME)$(PLUGINSUFFIX)$(PLUGIN_VERSION)$(WXCOMPILER)
             </dllname>
             <define>WXUSINGDLL</define>
             </dllname>
             <define>WXUSINGDLL</define>
+            <install-to>$(PLUGINS_INST_DIR)</install-to>
         </template>
     </define-rule>
     
         </template>
     </define-rule>
     
index 1177b1527d44b6b54003db4ea26f1a611e179941..930eb771c67761cfb84469abdf4d5beadc510ba6 100644 (file)
@@ -100,6 +100,20 @@ Acts according to DEBUG_INFO by default.
         </description>
     </option>
     
         </description>
     </option>
     
+    <if cond="FORMAT=='autoconf'"> <!-- FIXME - temporary -->
+        <option name="USE_PLUGINS">
+            <values>0,1</values>
+            <default-value>1</default-value>
+            <description>
+                Build parts of the library as dynamically loadable plugins
+                (only supported in multilib build)?
+            </description>
+        </option>
+    </if>
+    <if cond="FORMAT!='autoconf'">
+        <set var="USE_PLUGINS">0</set> <!-- FIXME - temporary -->
+    </if>
+    
     <option name="USE_GUI">
         <values>0,1</values>
         <values-description>Base,GUI</values-description>
     <option name="USE_GUI">
         <values>0,1</values>
         <values-description>Base,GUI</values-description>
@@ -181,6 +195,7 @@ compiled .lib files and setup.h under the lib/ toplevel directory.
         <option name="EXTRALIBS_ODBC"/>
         <option name="EXTRALIBS_GUI"/>
         <option name="EXTRALIBS_OPENGL"/>
         <option name="EXTRALIBS_ODBC"/>
         <option name="EXTRALIBS_GUI"/>
         <option name="EXTRALIBS_OPENGL"/>
+        <option name="EXTRALIBS_SDL"/>
         <option name="HOST_SUFFIX"/>
         <option name="SAMPLES_RPATH_FLAG"/>
         <option name="SAMPLES_RPATH_POSTLINK"/>
         <option name="HOST_SUFFIX"/>
         <option name="SAMPLES_RPATH_FLAG"/>
         <option name="SAMPLES_RPATH_POSTLINK"/>
@@ -188,6 +203,10 @@ compiled .lib files and setup.h under the lib/ toplevel directory.
         <set var="TOP_SRCDIR">$(top_srcdir)/</set>
         <set var="RUNTIME_LIBS">dynamic</set>
         <set var="WXTOPDIR"/> <!-- to be overriden on bakefile cmd line -->
         <set var="TOP_SRCDIR">$(top_srcdir)/</set>
         <set var="RUNTIME_LIBS">dynamic</set>
         <set var="WXTOPDIR"/> <!-- to be overriden on bakefile cmd line -->
+    
+        <option name="WITH_PLUGIN_SDL">
+            <values>0,1</values>
+        </option>
     </if>
 
     
     </if>
 
     
@@ -223,6 +242,9 @@ it if SHARED=1 unless you know what you are doing.
             <if cond="COMPILER=='vc'">opengl32.lib glu32.lib</if>
             <if cond="COMPILER=='gcc'">-lopengl32 -lglu32</if>
         </set>
             <if cond="COMPILER=='vc'">opengl32.lib glu32.lib</if>
             <if cond="COMPILER=='gcc'">-lopengl32 -lglu32</if>
         </set>
+        <set var="EXTRALIBS_SDL"/>
+
+        <set var="WITH_PLUGIN_SDL">0</set>
 
         <set var="SRCDIR">
             <if cond="BUILDING_LIB=='1'">..$(DIRSEP)..</if>
 
         <set var="SRCDIR">
             <if cond="BUILDING_LIB=='1'">..$(DIRSEP)..</if>
index 3f9c161b492f49ba3fea2fe8536ba14f8e72bf9d..2e5cf6e31327ab9a96cf1468b9f0b7a8b1ce5570 100644 (file)
@@ -1993,6 +1993,7 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
     wx/joystick.h
     wx/laywin.h
     wx/sashwin.h
     wx/joystick.h
     wx/laywin.h
     wx/sashwin.h
+    wx/sound.h
     wx/splash.h
     wx/taskbar.h
     wx/tipdlg.h
     wx/splash.h
     wx/taskbar.h
     wx/tipdlg.h
@@ -2033,13 +2034,13 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
 <set var="ADVANCED_UNIX_SRC" hints="files">
     src/common/taskbarcmn.cpp
     src/unix/joystick.cpp
 <set var="ADVANCED_UNIX_SRC" hints="files">
     src/common/taskbarcmn.cpp
     src/unix/joystick.cpp
+    src/unix/sound.cpp
     src/unix/taskbarx11.cpp
     src/unix/taskbarx11.cpp
-    src/unix/wave.cpp
 </set>
 <set var="ADVANCED_UNIX_HDR" hints="files">
     wx/unix/joystick.h
 </set>
 <set var="ADVANCED_UNIX_HDR" hints="files">
     wx/unix/joystick.h
+    wx/unix/sound.h
     wx/unix/taskbarx11.h
     wx/unix/taskbarx11.h
-    wx/unix/wave.h
 </set>
 
 
 </set>
 
 
@@ -2165,6 +2166,13 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
 </set>
 
 
 </set>
 
 
+<!-- ====================================================================== -->
+<!--                             Misc plugin sources:                       -->
+<!-- ====================================================================== -->
+
+<set var="UNIX_SOUND_SRC_SDL" hints="files">
+    src/unix/sound_sdl.cpp
+</set>
 
 <!-- ====================================================================== -->
 <!--                    Define sources for specific libraries:              -->
 
 <!-- ====================================================================== -->
 <!--                    Define sources for specific libraries:              -->
@@ -2337,5 +2345,20 @@ IMPORTANT: please read docs/tech/tn0016.txt before modifying this file!
         $(NET_CMN_SRC) $(NET_UNIX_SRC) $(NET_WIN32_SRC)
         $(XML_SRC) $(ODBC_SRC)
     </set>
         $(NET_CMN_SRC) $(NET_UNIX_SRC) $(NET_WIN32_SRC)
         $(XML_SRC) $(ODBC_SRC)
     </set>
-
+    
+    
+    
+    <!-- ================================================================ -->
+    <!--        Define where plugins sources go if USE_PLUGINS=0          -->
+    <!-- ================================================================ -->
+
+    <!-- wxAdv sources -->
+    <set var="PLUGIN_ADV_SRC">
+        <if cond="FORMAT=='autoconf' and PLATFORM_UNIX=='1' and USE_PLUGINS=='0'">
+            $(UNIX_SOUND_SRC_SDL)
+        </if>
+    </set>
+    
+    <set var="PLUGIN_MONOLIB_SRC">$(PLUGIN_ADV_SRC)</set>
+    
 </makefile>
 </makefile>
index 80b1ba7fc1dc933ffb571a8a0bd8a68217b44e17..a5ea3ae4cdd08269ebc67c33a6061cfa01630356 100644 (file)
          cond="SHARED=='1' and MONOLITHIC=='1'">
         <define>wxUSE_BASE=1</define> 
         <define>WXMAKINGDLL</define>
          cond="SHARED=='1' and MONOLITHIC=='1'">
         <define>wxUSE_BASE=1</define> 
         <define>WXMAKINGDLL</define>
-        <sources>$(MONOLIB_SRC)</sources>
+        <sources>$(MONOLIB_SRC) $(PLUGIN_MONOLIB_SRC)</sources>
         <ldlibs>$(EXTRALIBS_XML)</ldlibs>
         <ldlibs>$(EXTRALIBS_HTML)</ldlibs>
         <ldlibs>$(EXTRALIBS_ODBC)</ldlibs>
         <ldlibs>$(EXTRALIBS_XML)</ldlibs>
         <ldlibs>$(EXTRALIBS_HTML)</ldlibs>
         <ldlibs>$(EXTRALIBS_ODBC)</ldlibs>
+        <ldlibs>$(PLUGIN_MONOLIB_EXTRALIBS)</ldlibs>
         <msvc-headers>$(ALL_HEADERS)</msvc-headers>
     </dll>
     
     <lib id="monolib" template="wx_lib"
          cond="SHARED=='0' and MONOLITHIC=='1'">
         <define>wxUSE_BASE=1</define> 
         <msvc-headers>$(ALL_HEADERS)</msvc-headers>
     </dll>
     
     <lib id="monolib" template="wx_lib"
          cond="SHARED=='0' and MONOLITHIC=='1'">
         <define>wxUSE_BASE=1</define> 
-        <sources>$(MONOLIB_SRC)</sources>
+        <sources>$(MONOLIB_SRC) $(PLUGIN_MONOLIB_SRC)</sources>
         <msvc-headers>$(ALL_HEADERS)</msvc-headers>
     </lib>
 
         <msvc-headers>$(ALL_HEADERS)</msvc-headers>
     </lib>
 
index 3f0c11451d848c21fbf9b32c1c2dc69f74b0f36b..2c2688e14534305a547b60c4483676675f557865 100644 (file)
          cond="SHARED=='1' and USE_GUI=='1' and MONOLITHIC=='0'">
         <define>WXUSINGDLL</define>
         <define>WXMAKINGDLL_ADV</define>
          cond="SHARED=='1' and USE_GUI=='1' and MONOLITHIC=='0'">
         <define>WXUSINGDLL</define>
         <define>WXMAKINGDLL_ADV</define>
-        <sources>$(ADVANCED_SRC)</sources>
+        <sources>$(ADVANCED_SRC) $(PLUGIN_ADV_SRC)</sources>
         <msvc-headers>$(ADVANCED_HDR)</msvc-headers>
         <library>coredll</library>
         <library>basedll</library>
         <msvc-headers>$(ADVANCED_HDR)</msvc-headers>
         <library>coredll</library>
         <library>basedll</library>
+        <ldlibs>$(PLUGIN_ADV_EXTRALIBS)</ldlibs>
     </dll>
     
     <lib id="advlib" template="wx_lib"
          cond="SHARED=='0' and USE_GUI=='1' and MONOLITHIC=='0'">
     </dll>
     
     <lib id="advlib" template="wx_lib"
          cond="SHARED=='0' and USE_GUI=='1' and MONOLITHIC=='0'">
-        <sources>$(ADVANCED_SRC)</sources>
+        <sources>$(ADVANCED_SRC) $(PLUGIN_ADV_SRC)</sources>
         <msvc-headers>$(ADVANCED_HDR)</msvc-headers>
     </lib>
     
         <msvc-headers>$(ADVANCED_HDR)</msvc-headers>
     </lib>
     
     </lib>
     
     <set var="MSVC6PRJ_MERGED_TARGETS" append="1">xml=xmllib+xmldll</set>
     </lib>
     
     <set var="MSVC6PRJ_MERGED_TARGETS" append="1">xml=xmllib+xmldll</set>
-
+    
 </makefile>
 </makefile>
diff --git a/build/bakefiles/plugins.bkl b/build/bakefiles/plugins.bkl
new file mode 100644 (file)
index 0000000..2875292
--- /dev/null
@@ -0,0 +1,16 @@
+<?xml version="1.0" ?>
+<!-- $Id$ -->
+
+<makefile>
+     
+    <!-- ================================================================ -->
+    <!--                        Unix audio plugins                        -->
+    <!-- ================================================================ -->
+    
+    <wx-base-plugin id="sound_sdl" cond="WITH_PLUGIN_SDL=='1'">
+        <sources>$(UNIX_SOUND_SRC_SDL)</sources>
+        <ldlibs>$(EXTRALIBS_SDL)</ldlibs>
+    </wx-base-plugin>
+
+
+</makefile>
diff --git a/build/bakefiles/plugins_deps.bkl b/build/bakefiles/plugins_deps.bkl
new file mode 100644 (file)
index 0000000..f4a2dff
--- /dev/null
@@ -0,0 +1,21 @@
+<?xml version="1.0" ?>
+<!-- $Id$ -->
+
+<makefile>
+
+    <!-- Additional dependencies of core libraries if plugins are
+         disabled (these would be deps of the plugins if they were
+         enabled): -->
+     
+    <set var="PLUGIN_ADV_EXTRALIBS">
+        <if cond="USE_PLUGINS=='0'">
+            $(EXTRALIBS_SDL)
+        </if>
+    </set>
+
+
+    <!-- monolithic library must link against all this: -->
+
+    <set var="PLUGIN_MONOLIB_EXTRALIBS">$(PLUGIN_ADV_EXTRALIBS)</set>
+
+</makefile>
index ca49867463ca7659c36c891ce7fe309aa788d984..d92d892f2c14df3dd1d34861852afc9bc5a61fa0 100644 (file)
     </phony>
 
     <set var="BUILDING_LIB">1</set>
     </phony>
 
     <set var="BUILDING_LIB">1</set>
-
+    
     <!-- common rules, names etc. for wx: -->
     <include file="common.bkl"/>
     <!-- common rules, names etc. for wx: -->
     <include file="common.bkl"/>
-
+    
     <!-- list of files sorted into categories: -->
     <include file="files.bkl"/>
     <!-- list of files sorted into categories: -->
     <include file="files.bkl"/>
-
+    
     <!-- wxWindows variant where everything is in one library: -->
     <include file="monolithic.bkl"/>
     <!-- ...and when there are multiple libraries: -->
     <include file="multilib.bkl"/>
     <!-- OpenGL canvas is built as separate library in both cases: -->
     <include file="opengl.bkl"/>
     <!-- wxWindows variant where everything is in one library: -->
     <include file="monolithic.bkl"/>
     <!-- ...and when there are multiple libraries: -->
     <include file="multilib.bkl"/>
     <!-- OpenGL canvas is built as separate library in both cases: -->
     <include file="opengl.bkl"/>
-    
-    
+    <!-- Dynamically loadable plugins: -->
+    <include file="plugins.bkl"/>
     <!-- Samples target (not dependency of 'all'): -->
     <subproject id="samples">
         <installable>no</installable>
     <!-- Samples target (not dependency of 'all'): -->
     <subproject id="samples">
         <installable>no</installable>
index 5c1483e3bcde39e487d7bff9d2eea185cc220dd0..7a1473b623bebc8c5e4ce658546c111a6c2e85c3 100644 (file)
@@ -43,6 +43,7 @@ EXTRALIBS = {
     'xml' : '$(EXTRALIBS_XML)',
     'html' : '$(EXTRALIBS_HTML)',
     'odbc' : '$(EXTRALIBS_ODBC)',
     'xml' : '$(EXTRALIBS_XML)',
     'html' : '$(EXTRALIBS_HTML)',
     'odbc' : '$(EXTRALIBS_ODBC)',
+    'adv' : '$(PLUGIN_ADV_EXTRALIBS)',
 }
 
 def mkLibName(wxid):
 }
 
 def mkLibName(wxid):
@@ -142,4 +143,4 @@ def headersOnly(files):
 
 def makeDspDependency(lib):
     """Returns suitable entry for <depends-on-dsp> for main libs."""
 
 def makeDspDependency(lib):
     """Returns suitable entry for <depends-on-dsp> for main libs."""
-    return '%s:$(nativePaths(WXTOPDIR))build\msw\wx_%s.dsp' % (lib,lib)
+    return '%s:$(nativePaths(WXTOPDIR))build\\msw\\wx_%s.dsp' % (lib,lib)