merge (with conflict fixes) with master (even against rgareus' recommendation)
[ardour.git] / libs / pbd / wscript
index 0655e1ca4895da56102f21b02d307d1d2e835157..6b3e12b5396e9818f680c03c784a5cfc5ee24b57 100644 (file)
@@ -38,7 +38,6 @@ libpbd_sources = [
     'controllable.cc',
     'controllable_descriptor.cc',
     'clear_dir.cc',
-    'crossthread.cc',
     'cpus.cc',
     'debug.cc',
     'enumwriter.cc',
@@ -46,20 +45,25 @@ libpbd_sources = [
     'enums.cc',
     'epa.cc',
     'error.cc',
+    'ffs.cc',
     'file_manager.cc',
     'file_utils.cc',
     'fpu.cc',
+    'glib_semaphore.cc',
     'id.cc',
     'locale_guard.cc',
+    'localtime_r.cc',
     'malign.cc',
     'mountpoint.cc',
     'openuri.cc',
     'pathexpand.cc',
     'pathscanner.cc',
+    'pbd.cc',
     'pool.cc',
     'property_list.cc',
     'pthread_utils.cc',
     'receiver.cc',
+    'resource.cc',
     'search_path.cc',
     'semutils.cc',
     'shortpath.cc',
@@ -85,24 +89,22 @@ def options(opt):
 def configure(conf):
     conf.load('compiler_cxx')
     autowaf.build_version_files(path_prefix+'pbd/version.h', path_prefix+'version.cc',
-                    'libpbd', MAJOR, MINOR, MICRO)
+                    'libpbd', MAJOR, MINOR, MICRO, 'LIBPBD_API', 'pbd/libpbd_visibility.h')
     autowaf.configure(conf)
     autowaf.check_pkg(conf, 'libxml-2.0', uselib_store='XML')
     autowaf.check_pkg(conf, 'sigc++-2.0', uselib_store='SIGCPP', atleast_version='2.0')
-    if sys.platform != 'darwin':
-        autowaf.check_pkg(conf, 'uuid', uselib_store='UUID')
 
     conf.check(function_name='getmntent', header_name='mntent.h', define_name='HAVE_GETMNTENT',mandatory=False)
     conf.check(header_name='execinfo.h', define_name='HAVE_EXECINFO',mandatory=False)
     conf.check(header_name='unistd.h', define_name='HAVE_UNISTD',mandatory=False)
     conf.check_cc(function_name='posix_memalign', header_name='stdlib.h', cflags='-D_XOPEN_SOURCE=600', define_name='HAVE_POSIX_MEMALIGN', mandatory=False)
+    conf.check(function_name='localtime_r', header_name='time.h', define_name='HAVE_LOCALTIME_R',mandatory=False)
 
     conf.write_config_header('libpbd-config.h', remove=False)
 
     # Boost headers
     autowaf.check_header(conf, 'cxx', 'boost/shared_ptr.hpp')
     autowaf.check_header(conf, 'cxx', 'boost/weak_ptr.hpp')
-    # autowaf.check_header(conf, 'cxx', 'boost/uuid/uuid.hpp')
 
 def build(bld):
     
@@ -113,14 +115,20 @@ def build(bld):
     if bld.is_defined ('INTERNAL_SHARED_LIBS'):
         print('BUILD SHARED LIB')
         obj              = bld.shlib(features = 'cxx cxxshlib', source=libpbd_sources)
+        obj.defines = [ 'LIBPBD_DLL_EXPORTS=1' ]
     else:
         print('BUILD STATIC LIB')
         obj              = bld.stlib(features = 'cxx cxxstlib', source=libpbd_sources)
         obj.cxxflags     = [ '-fPIC' ]
+        obj.cflags     = [ '-fPIC' ]
+        obj.defines      = []
 
     if bld.is_defined('DEBUG_RT_ALLOC'):
         obj.source += 'debug_rt_alloc.c'
 
+    if bld.env['build_target'] != 'mingw':
+        obj.source += [ 'crossthread.cc' ]
+
     obj.export_includes = ['.']
     obj.includes     = ['.']
     obj.name         = 'libpbd'
@@ -133,7 +141,7 @@ def build(bld):
         obj.uselib += ' OSX'
     obj.vnum         = LIBPBD_LIB_VERSION
     obj.install_path = os.path.join(bld.env['LIBDIR'], 'ardour3')
-    obj.defines     = ['PACKAGE="' + I18N_PACKAGE + '"']
+    obj.defines     += [ 'PACKAGE="' + I18N_PACKAGE + '"' ]
     
     if bld.env['build_target'] == 'x86_64':
         obj.defines += [ 'USE_X86_64_ASM' ]
@@ -144,6 +152,7 @@ def build(bld):
         testobj.source       = '''
                 test/testrunner.cc
                 test/xpath.cc
+                test/mutex_test.cc
                 test/scalar_properties.cc
                 test/signals_test.cc
                 test/convert_test.cc
@@ -155,7 +164,7 @@ def build(bld):
         testobj.uselib       = 'CPPUNIT XML SNDFILE'
         testobj.use          = 'libpbd'
         testobj.name         = 'libpbd-tests'
-        if sys.platform != 'darwin':
+        if sys.platform != 'darwin' and bld.env['build_target'] != 'mingw':
             testobj.linkflags    = ['-lrt']