try to get export/visibility and build conditionals right for surfaces/, once more
authorPaul Davis <paul@linuxaudiosystems.com>
Sat, 25 Jan 2014 18:57:28 +0000 (13:57 -0500)
committerPaul Davis <paul@linuxaudiosystems.com>
Sat, 25 Jan 2014 18:57:28 +0000 (13:57 -0500)
libs/surfaces/control_protocol/control_protocol/visibility.h
libs/surfaces/frontier/wscript
libs/surfaces/generic_midi/interface.cc
libs/surfaces/mackie/interface.cc
libs/surfaces/mackie/wscript
libs/surfaces/osc/interface.cc
libs/surfaces/tranzport/wscript
libs/surfaces/wiimote/interface.cc
libs/surfaces/wiimote/wscript
libs/surfaces/wscript

index 88dcff094075cca9eede93b98d64eea49cd7a135..62e3b02913ab6a232830f9ae8f5a608c1325cb6a 100644 (file)
   #define LIBCONTROLCP_DLL_LOCAL  __attribute__ ((visibility ("hidden")))
 #endif
 
-#ifdef LIBCONTROLCP_STATIC // libcontrolcp is not a DLL
-  #define LIBCONTROLCP_API
-  #define LIBCONTROLCP_LOCAL
-#else
-  #ifdef LIBCONTROLCP_DLL_EXPORTS // defined if we are building the libcontrolcp DLL (instead of using it)
+#ifdef LIBCONTROLCP_DLL_EXPORTS // defined if we are building the libcontrolcp DLL (instead of using it)
     #define LIBCONTROLCP_API LIBCONTROLCP_DLL_EXPORT
-  #else
+#else
     #define LIBCONTROLCP_API LIBCONTROLCP_DLL_IMPORT
-  #endif 
-  #define LIBCONTROLCP_LOCAL LIBCONTROLCP_DLL_LOCAL
-#endif
+#endif 
+#define LIBCONTROLCP_LOCAL LIBCONTROLCP_DLL_LOCAL
+
+/* These should be used by surfaces/control interfaces. They use (probably)
+ * libcontrolcp but they are not part of it. The idea here is to avoid
+ * having to define per-surface macros for each and every surface. Instead,
+ * every surface defines ARDOURSURFACE_DLL_EXPORTS during building and
+ * uses ARDOURSURFACE_API in its declarations.
+ */
+
+#ifdef ARDOURSURFACE_DLL_EXPORTS // defined if we are building the libcontrolcp DLL (instead of using it)
+    #define ARDOURSURFACE_API LIBCONTROLCP_DLL_EXPORT
+#else
+    #define ARDOURSURFACE_API LIBCONTROLCP_DLL_IMPORT
+#endif 
+#define ARDOURSURFACE_LOCAL LIBCONTROLCP_DLL_LOCAL
+
 
 #endif /* __libcontrolcp_visibility_h__ */
index ac8341c64d8023f2d8224e8b6e5fc2e29c1e260f..4fcbe6fde369b49f2bc4f0ae8f3dfd9629739949 100644 (file)
@@ -34,7 +34,8 @@ def build(bld):
             midicontrollable.cc
     '''
     obj.export_includes = ['./generic_midi']
-    obj.defines     = [ 'PACKAGE="ardour_frontier"' ]
+    obj.defines      = [ 'PACKAGE="ardour_frontier"' ]
+    obj.defines     += [ 'ARDOURSURFACE_DLL_EXPORTS' ]
     obj.includes     = ['.', './generic_midi']
     obj.name         = 'libgeneric_midi'
     obj.target       = 'generic_midi'
index 0b75a720cc7de7844c5dc75a6886fcb0d2369013..5cd080f2f55f14940bde5de576fdaa76b9a11da5 100644 (file)
@@ -68,5 +68,5 @@ static ControlProtocolDescriptor generic_midi_descriptor = {
        /*destroy :           */   delete_generic_midi_protocol
 };
        
-extern "C" LIBCONTROLCP_API ControlProtocolDescriptor* protocol_descriptor () { return &generic_midi_descriptor; }
+extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &generic_midi_descriptor; }
 
index 35216da26380278f2d14d8276d16e1023bc5a099..abef84817d4cbf58e48023cd6f5bacc8044b4fd5 100644 (file)
@@ -90,4 +90,4 @@ static ControlProtocolDescriptor mackie_descriptor = {
 };
        
 
-extern "C" LIBCONTROLCP_API ControlProtocolDescriptor* protocol_descriptor () { return &mackie_descriptor; }
+extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &mackie_descriptor; }
index 2dc546a5d7bded0bdb3566c8417f1750e1bb79a9..c1e63e2894a0615e6cbf9a7105a8ee4e84cb806e 100644 (file)
@@ -42,12 +42,10 @@ def build(bld):
             types.cc
     '''
     obj.export_includes = ['./mackie']
-    obj.defines     = [ 'PACKAGE="ardour_mackie"' ]
-    # need ../libs because some GTK2 header files require stuff there
-    obj.includes     = ['.', '../libs']
+    obj.defines      = [ 'PACKAGE="ardour_mackie"' ]
+    obj.defines     += [ 'ARDOURSURFACE_DLL_EXPORTS' ]
+    obj.includes     = [ '.' ]
     obj.name         = 'libardour_mcp'
-    obj.defines      = [ 'LIBCONTROLCP_EXPORTS' ]
-    obj.defines     += [ 'PACKAGE="libardour_mcp"' ]
     obj.target       = 'ardour_mcp'
     obj.uselib       = 'GTKMM'
     obj.use          = 'libardour libardour_cp libgtkmm2ext'
index 7c09828f462e1cd9ab844a7b09802a42c7638fb9..f20d89841809017b742cea2d68c8621dd39fa031 100644 (file)
@@ -57,5 +57,5 @@ static ControlProtocolDescriptor osc_descriptor = {
        destroy : delete_osc_protocol
 };
 
-extern "C" LIBCONTROLCP_API ControlProtocolDescriptor* protocol_descriptor () { return &osc_descriptor; }
+extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &osc_descriptor; }
 
index 05fd7cf5d6d2e673e057f2c775c4a5941a0d5860..83c39f1d115375e7925675ed80748de3ea9da9ae 100644 (file)
@@ -39,10 +39,10 @@ def build(bld):
             wheel_modes.cc
     '''
     obj.export_includes = ['./tranzport']
-    obj.defines     = [ 'PACKAGE="ardour_tranzport"' ]
+    obj.defines      = [ 'PACKAGE="ardour_tranzport"' ]
+    obj.defines     += [ 'ARDOURSURFACE_DLL_EXPORTS' ]
     obj.includes     = ['.', './tranzport']
     obj.name         = 'libardour_tranzport'
-    obj.defines      = [ 'ARDOURSURFACE_DLL_EXPORTS' ]
     obj.target       = 'ardour_tranzport'
     obj.use          = 'libardour libardour_cp'
     obj.vnum         = LIBARDOUR_TRANZPORT_LIB_VERSION
index 8695facb8dd4a584901e74442b9a0f01400850be..9a704e445e87f46773c59c88ba7e58a18eeb8ff3 100644 (file)
@@ -61,5 +61,5 @@ static ControlProtocolDescriptor wiimote_descriptor = {
        destroy : delete_wiimote_protocol
 };
 
-extern "C" LIBCONTROLCP_API ControlProtocolDescriptor* protocol_descriptor () { return &wiimote_descriptor; }
+extern "C" ARDOURSURFACE_API ControlProtocolDescriptor* protocol_descriptor () { return &wiimote_descriptor; }
 
index e63713c855ba4d19f1201ec52a43de1bb2fbf36a..8513a5be513305e6f989fa57d94d13b150595d0c 100644 (file)
@@ -25,10 +25,10 @@ def build(bld):
             interface.cc
     '''
     obj.export_includes = ['./wiimote']
-    obj.defines     = [ 'PACKAGE="ardour_wiimote"' ]
+    obj.defines      = [ 'PACKAGE="ardour_wiimote"' ]
+    obj.defines     += [ 'ARDOURSURFACE_DLL_EXPORTS' ]
     obj.includes     = ['.', '../libs']
     obj.name         = 'libardour_wiimote'
-    obj.defines      = [ 'ARDOURSURFACE_DLL_EXPORTS' ]
     obj.target       = 'ardour_wiimote'
     obj.uselib       = 'GTKMM CWIID'
     obj.use          = 'libardour libardour_cp libgtkmm2ext'
index abf0250ca582f54c8ac0b52a5c88ac1724215d26..71bb35d6cc8f7d44b3978a5ac154ea2018ea39e2 100644 (file)
@@ -38,15 +38,13 @@ def configure(conf):
     autowaf.set_recursive()
     autowaf.configure(conf)
     
-    if (conf.env['build_target'] == 'mingw'): return
-
     #autowaf.check_pkg(conf, 'libusb-1.0', uselib_store='USB', mandatory=False)
     #if Options.options.tranzport and conf.is_defined('HAVE_USB'):
     #    conf.define('BUILD_TRANZPORT', 1)
 
     if autowaf.check_pkg (conf, 'liblo', mandatory=False, uselib_store="LO", atleast_version="0.24"):
         children += [ 'osc' ]
+
     conf.check_cc (header_name='cwiid.h', define_name='HAVE_CWIID_H',mandatory=False)
     if conf.is_defined('HAVE_CWIID_H'):
         conf.check_cc (header_name='bluetooth/bluetooth.h', define_name='HAVE_BLUETOOTH_H',mandatory=False)
@@ -67,8 +65,16 @@ def configure(conf):
 
 
 def build(bld):
-    for i in children:
-        bld.recurse (i)
+    bld.recurse('control_protocol')
+    bld.recurse('generic_midi')
+    bld.recurse('mackie')
+
+    if bld.is_defined ('HAVE_LO'):
+        bld.recurse('osc')
+    if bld.is_defined('BUILD_WIIMOTE'):
+        bld.recurse('wiimote')
+    if bld.is_defined('BUILD_TRANZPORT'):
+        bld.recurse('tranzport')
 
 def shutdown():
     autowaf.shutdown()