[Libreoffice-commits] core.git: solenv/bin

Miklos Vajna vmiklos at collabora.co.uk
Sat Feb 28 12:53:16 PST 2015


 solenv/bin/native-code.py |   23 +++++++++++++++++++++--
 1 file changed, 21 insertions(+), 2 deletions(-)

New commits:
commit a1d7f029a06832bae59991398c8bc6ab2c2d6443
Author: Miklos Vajna <vmiklos at collabora.co.uk>
Date:   Sat Feb 28 21:17:22 2015 +0100

    solenv: sfx's ScriptLibraryContainer depends on #if HAVE_FEATURE_SCRIPTING
    
    Change-Id: Ib5238d44d7bce6651ddbdc4f843f5aaab4eb97c2

diff --git a/solenv/bin/native-code.py b/solenv/bin/native-code.py
index c787a23..2350e47 100755
--- a/solenv/bin/native-code.py
+++ b/solenv/bin/native-code.py
@@ -224,7 +224,7 @@ writer_factory_list = [
 
 writer_constructor_list = [
 # basic/util/sb.component
-    "com_sun_star_comp_sfx2_ScriptLibraryContainer_get_implementation",
+    ("com_sun_star_comp_sfx2_ScriptLibraryContainer_get_implementation", "#if HAVE_FEATURE_SCRIPTING"),
 # filter/source/textfilterdetect/textfd.component 
     "com_sun_star_comp_filters_PlainTextFilterDetect_get_implementation",
 # sw/util/sw.component
@@ -257,6 +257,12 @@ constructor_map = {
     'writer' : writer_constructor_list,
     }
 
+def get_constructor_guard(constructor):
+    if type(full_constructor_map[constructor]) is bool:
+        return None
+    else:
+        return full_constructor_map[constructor]
+
 # instead of outputting native-code.cxx, reduce the services.rdb according to
 # the constraints, so that we can easily emulate what services do we need to
 # add for a fully functional file loading / saving / ...
@@ -302,7 +308,10 @@ full_constructor_map = {}
 if options.groups:
     for constructor_group in options.groups:
         for constructor in constructor_map[constructor_group]:
-            full_constructor_map[constructor] = True
+            if type(constructor) is tuple:
+                full_constructor_map[constructor[0]] = constructor[1]
+            else:
+                full_constructor_map[constructor] = True
 
 # dict of all the factories that we need according to -g's
 full_factory_map = {}
@@ -341,7 +350,12 @@ for entry in sorted(full_factory_map.keys()):
 
 print ('')
 for constructor in sorted(full_constructor_map.keys()):
+    constructor_guard = get_constructor_guard(constructor)
+    if constructor_guard:
+        print (constructor_guard)
     print ('void * '+constructor+'( void *, void * );')
+    if constructor_guard:
+        print ('#endif')
 
 print ("""
 const lib_to_factory_mapping *
@@ -391,7 +405,12 @@ lo_get_constructor_map(void)
     static lib_to_constructor_mapping map[] = {""")
 
 for constructor in sorted(full_constructor_map.keys()):
+    constructor_guard = get_constructor_guard(constructor)
+    if constructor_guard:
+        print (constructor_guard)
     print ('        { "' +constructor+ '", ' +constructor+ ' },')
+    if constructor_guard:
+        print ('#endif')
 
 print ("""
         { 0, 0 }


More information about the Libreoffice-commits mailing list