You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@openoffice.apache.org by da...@apache.org on 2020/07/04 18:44:05 UTC

[openoffice] 02/11: Preliminary AllLangResTarget implementation in SCons.

This is an automated email from the ASF dual-hosted git repository.

damjan pushed a commit to branch scons-build
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit f714b799e1e25400c1990f187563f6b1f65b57e7
Author: Damjan Jovanovic <da...@apache.org>
AuthorDate: Sun Jun 28 17:02:48 2020 +0200

    Preliminary AllLangResTarget implementation in SCons.
    
    Patch by: me
---
 .../openoffice/gotoSCons/SConsConverter.java       |   9 ++
 .../gotoSCons/targets/AllLangResTarget.java        |  89 ++++++++++++++-
 .../openoffice/gotoSCons/targets/Module.java       |   4 +
 .../openoffice/gotoSCons/targets/SrsTarget.java    |  35 ++++++
 main/SConstruct                                    |   1 +
 main/site_scons/AllLangRes.py                      | 120 ++++++++++++++++++---
 main/site_scons/_alllangres.py                     |  34 +++---
 main/site_scons/platform/freebsd.py                |   3 +-
 main/site_scons/platform/windows.py                |   4 +-
 main/site_scons/site_init.py                       |   2 +
 main/site_scons/tests/Generators/.sconsign.dblite  | Bin 0 -> 2138 bytes
 main/site_scons/tests/Generators/SConstruct        |  11 ++
 main/site_scons/tests/Generators/file.input        |   0
 main/site_scons/tests/Generators/file2.input       |   0
 main/site_scons/tests/IDLScanner/.sconsign.dblite  | Bin 0 -> 2152 bytes
 main/site_scons/tests/IDLScanner/SConstruct        |  10 ++
 main/site_scons/tests/IDLScanner/header.h          |   1 +
 main/site_scons/tests/IDLScanner/source.idl        |   4 +
 main/site_scons/tests/IDLScanner/target.idl        |   4 +
 main/uui/SConscript                                |  29 +++++
 20 files changed, 329 insertions(+), 31 deletions(-)

diff --git a/gotoSCons/src/main/java/org/apache/openoffice/gotoSCons/SConsConverter.java b/gotoSCons/src/main/java/org/apache/openoffice/gotoSCons/SConsConverter.java
index 059a6ea..db22e75 100644
--- a/gotoSCons/src/main/java/org/apache/openoffice/gotoSCons/SConsConverter.java
+++ b/gotoSCons/src/main/java/org/apache/openoffice/gotoSCons/SConsConverter.java
@@ -26,6 +26,7 @@ import java.io.PrintStream;
 import java.util.Map;
 import java.util.TreeMap;
 import java.util.TreeSet;
+import org.apache.openoffice.gotoSCons.targets.AllLangResTarget;
 import org.apache.openoffice.gotoSCons.targets.BaseBinary;
 import org.apache.openoffice.gotoSCons.targets.Executable;
 import org.apache.openoffice.gotoSCons.targets.Library;
@@ -56,6 +57,10 @@ public class SConsConverter {
             convertExecutable(exe);
         }
         
+        for (AllLangResTarget allLangResTarget : module.getAllLangResTargets().values()) {
+            convertAllLangResTarget(allLangResTarget);
+        }
+        
         for (Pkg pkg : module.getPackages().values()) {
             convertPackage(module, pkg);
         }
@@ -160,6 +165,10 @@ public class SConsConverter {
         out.println();
     }
     
+    private void convertAllLangResTarget(AllLangResTarget allLangResTarget) throws Exception {
+        out.println();
+    }
+    
     private String convertObjects(BaseBinary binary) throws Exception {
         String objectsVariable = binary.getName() + "Objects";
         if (binary.getExceptionObjects().isEmpty() && binary.getNoexceptionObjects().isEmpty()) {
diff --git a/gotoSCons/src/main/java/org/apache/openoffice/gotoSCons/targets/AllLangResTarget.java b/gotoSCons/src/main/java/org/apache/openoffice/gotoSCons/targets/AllLangResTarget.java
index f6799bf..cf3f16c 100644
--- a/gotoSCons/src/main/java/org/apache/openoffice/gotoSCons/targets/AllLangResTarget.java
+++ b/gotoSCons/src/main/java/org/apache/openoffice/gotoSCons/targets/AllLangResTarget.java
@@ -25,8 +25,14 @@ import java.io.BufferedReader;
 import java.io.File;
 import java.io.FileInputStream;
 import java.io.InputStreamReader;
+import java.util.ArrayList;
 import java.util.Arrays;
+import java.util.Map;
+import java.util.Set;
+import java.util.TreeMap;
+import java.util.TreeSet;
 import org.apache.openoffice.gotoSCons.GBuildParser;
+import org.apache.openoffice.gotoSCons.Utils;
 import org.apache.openoffice.gotoSCons.raw.ListNode;
 import org.apache.openoffice.gotoSCons.raw.Node;
 import org.apache.openoffice.gotoSCons.raw.ValueNode;
@@ -196,6 +202,10 @@ import org.apache.openoffice.gotoSCons.raw.ValueNode;
 public class AllLangResTarget extends BaseTarget {
     private File filename;
     private String name;
+    private String resLocation;
+    private ArrayList<String> srs = new ArrayList<>();
+    private Map<String,SrsTarget> srsTargets = new TreeMap<>();
+
 
     public AllLangResTarget(File filename) throws Exception {
         this.filename = filename;
@@ -219,6 +229,16 @@ public class AllLangResTarget extends BaseTarget {
             
             if (function.equals("gb_AllLangResTarget_AllLangResTarget")) {
                 parseAllLangResTargetAllLangResTarget(args);
+            } else if (function.equals("gb_AllLangResTarget_set_reslocation")) {
+                parseSetResLocation(args);
+            } else if (function.equals("gb_AllLangResTarget_add_srs")) {
+                parseAddSrs(args);
+            } else if (function.equals("gb_SrsTarget_SrsTarget")) {
+                parseSrsTargetSrsTarget(args);
+            } else if (function.equals("gb_SrsTarget_set_include")) {
+                parseSrsTargetSetInclude(args);
+            } else if (function.equals("gb_SrsTarget_add_files")) {
+                parseSrsTargetAddFiles(args);
             } else {
                 throw new Exception("UNHANDLED FUNCTION " + function);
             }
@@ -229,8 +249,75 @@ public class AllLangResTarget extends BaseTarget {
     
     private void parseAllLangResTargetAllLangResTarget(String[] args) throws Exception {
         if (args.length != 1) {
-            throw new Exception("Expected 2 arg, got " + Arrays.toString(args));
+            throw new Exception("Expected 1 arg, got " + Arrays.toString(args));
         }
         this.name = args[0];
     }
+    
+    private void parseSetResLocation(String[] args) throws Exception {
+        if (args.length != 2) {
+            throw new Exception("Expected 2 args, got " + Arrays.toString(args));
+        }
+        if (!args[0].equals(name)) {
+            throw new Exception("Target name isn't " + name);
+        }
+        
+        resLocation = args[1];
+    }
+    
+    private void parseAddSrs(String[] args) throws Exception {
+        if (args.length != 2) {
+            throw new Exception("Expected 2 args, got " + Arrays.toString(args));
+        }
+        if (!args[0].equals(name)) {
+            throw new Exception("Target name isn't " + name);
+        }
+        
+        srs.add(args[1]);
+    }
+    
+    private void parseSrsTargetSrsTarget(String[] args) throws Exception {
+        if (args.length != 1) {
+            throw new Exception("Expected 1 arg, got " + Arrays.toString(args));
+        }
+        String name = args[0];
+        SrsTarget srsTarget = new SrsTarget(name);
+        srsTargets.put(name, srsTarget);
+    }
+    
+    private void parseSrsTargetSetInclude(String[] args) throws Exception {
+        if (args.length != 2) {
+            throw new Exception("Expected 2 args, got " + Arrays.toString(args));
+        }
+        SrsTarget srsTarget = srsTargets.get(args[0]);
+        if (srsTarget == null) {
+            throw new Exception("No SrsTarget " + name);
+        }
+
+        Set<String> includes = new TreeSet<>();
+        for (String arg : Utils.spaceSeparatedTokens(args[1])) {
+            if (!includes.add(arg)) {
+                throw new Exception("Duplicate include " + arg);
+            }
+        }
+        srsTarget.setIncludes(includes);
+    }
+    
+    private void parseSrsTargetAddFiles(String[] args) throws Exception {
+        if (args.length != 2) {
+            throw new Exception("Expected 2 args, got " + Arrays.toString(args));
+        }
+        SrsTarget srsTarget = srsTargets.get(args[0]);
+        if (srsTarget == null) {
+            throw new Exception("No SrsTarget " + name);
+        }
+
+        Set<String> files = new TreeSet<>();
+        for (String arg : Utils.spaceSeparatedTokens(args[1])) {
+            if (!files.add(arg)) {
+                throw new Exception("Duplicate file object " + arg);
+            }
+        }
+        srsTarget.addFiles(files);
+    }
 }
diff --git a/gotoSCons/src/main/java/org/apache/openoffice/gotoSCons/targets/Module.java b/gotoSCons/src/main/java/org/apache/openoffice/gotoSCons/targets/Module.java
index 5dba1f5..30c1ac8 100644
--- a/gotoSCons/src/main/java/org/apache/openoffice/gotoSCons/targets/Module.java
+++ b/gotoSCons/src/main/java/org/apache/openoffice/gotoSCons/targets/Module.java
@@ -134,6 +134,10 @@ public class Module extends BaseTarget {
     public File getFilename() {
         return filename;
     }
+
+    public Map<String, AllLangResTarget> getAllLangResTargets() {
+        return allLangResTargets;
+    }
     
     public Map<String, Library> getLibraries() {
         return libraries;
diff --git a/gotoSCons/src/main/java/org/apache/openoffice/gotoSCons/targets/SrsTarget.java b/gotoSCons/src/main/java/org/apache/openoffice/gotoSCons/targets/SrsTarget.java
new file mode 100644
index 0000000..7bc421b
--- /dev/null
+++ b/gotoSCons/src/main/java/org/apache/openoffice/gotoSCons/targets/SrsTarget.java
@@ -0,0 +1,35 @@
+/*
+ * To change this license header, choose License Headers in Project Properties.
+ * To change this template file, choose Tools | Templates
+ * and open the template in the editor.
+ */
+package org.apache.openoffice.gotoSCons.targets;
+
+import java.util.Set;
+import java.util.TreeSet;
+
+/**
+ *
+ * @author dj
+ */
+public class SrsTarget {
+    private String name;
+    private Set<String> includes = new TreeSet<>();
+    private Set<String> files = new TreeSet<>();
+
+    public SrsTarget(String name) throws Exception {
+        this.name = name;
+    }
+    
+    public void setIncludes(Set<String> includes) {
+        this.includes = includes;
+    }
+    
+    public void addFiles(Set<String> files) throws Exception {
+        for (String file : files) {
+            if (!this.files.add(file)) {
+                throw new Exception("Duplicate file object " + file);
+            }
+        }
+    }
+}
diff --git a/main/SConstruct b/main/SConstruct
index 2cfa6a8..ec677ab 100644
--- a/main/SConstruct
+++ b/main/SConstruct
@@ -1,2 +1,3 @@
 SConscript('fileaccess/SConscript', variant_dir=WORKDIR+'/scons/fileaccess', duplicate=0)
 SConscript('store/SConscript', variant_dir=WORKDIR+'/scons/store', duplicate=0)
+SConscript('uui/SConscript', variant_dir=WORKDIR+'/scons/uui', duplicate=0)
diff --git a/main/site_scons/AllLangRes.py b/main/site_scons/AllLangRes.py
index 91ac44a..1708876 100644
--- a/main/site_scons/AllLangRes.py
+++ b/main/site_scons/AllLangRes.py
@@ -19,48 +19,144 @@
 #  
 #**************************************************************
 
+from SCons.Scanner import ClassicCPP
 from SCons.Script import *
 from config import soenv
 from globals import *
-import SCons.Tool.CScanner
+import shutil
+import os.path
+
+ResTarget_DEFIMAGESLOCATION='${SOLARSRC}/default_images/'
 
 class AllLangResTarget:
-    def __init__(self, name):
+    def __init__(self, name, srsTargets):
         self.env = DefaultEnvironment().Clone()
 
-        withLang = env.get('AOO_WITH_LANG')
+        withLang = self.env.get('AOO_WITH_LANG')
         if withLang == None or withLang == '':
             langs = set()
         else:
-            langs = set(env['AOO_WITH_LANG'].split())
+            langs = set(self.env['AOO_WITH_LANG'].split())
         if 'en-US' not in langs:
             langs.add('en-US')
 
         self.resTargets = []
         for lang in langs:
-            self.resTargets.add(ResTarget(name, lang))
+            self.resTargets.append(ResTarget(name, lang, srsTargets))
+
+    def SetResLocation(self, resLocation):
+        for resTarget in self.resTargets:
+            resTarget.SetResLocation(resLocation)
+
+    def SetImageLocations(self, imageLocations):
+        for resTarget in self.resTargets:
+            resTarget.SetImageLocations(imageLocations)
 
-# FIXME: necessary?
-#    def AddSrs(self, srsPath):
-        
 
 class ResTarget:
-    def __init__(self, library, lang):
+    def __init__(self, library, lang, srsTargets):
+        self.env = DefaultEnvironment().Clone()
+        self.env.Append(ENV=platform.getExecutableEnvironment(soenv))
+        
         self.library = library
-        self.lang = lang
+        self.env['AOO_LANGUAGE'] = lang
+
+        self.env['AOO_DEFIMAGESLOCATION'] = ResTarget_DEFIMAGESLOCATION
+        self.resLocation = library
+        self.imageLocations = []
+        
+        self.SetImageLocations(self.imageLocations)
+
+        submodulePath = ''
+        if os.path.exists(Dir(self.env.subst('${AOO_DEFIMAGESLOCATION}') + self.resLocation).abspath):
+            submodulePath = Dir(self.env.subst('${AOO_DEFIMAGESLOCATION}') + self.resLocation)
+        self.env['AOO_SUBMODULE'] = submodulePath
+        self.env['AOO_IMAGELISTDIR'] = File('Res/ResTarget/' + library + lang + '.ilst').Dir('.').abspath
+        targetFile = File('Res/ResTarget/' + library + lang + '.res')
+        self.env.Command(targetFile, srsTargets, ' '.join([
+            '${OUTDIR}/bin/rsc',
+            '-r',
+            '-p',
+            '-lg${AOO_LANGUAGE}',
+            '-fs=${TARGET}',
+            '${AOO_IMAGEARGS}',
+            '-lip=${AOO_DEFIMAGESLOCATION}res/${AOO_LANGUAGE}',
+            '-lip=${AOO_DEFIMAGESLOCATION}res',
+            '-subMODULE=${AOO_SUBMODULE}',
+            '-subGLOBALRES=${AOO_DEFIMAGESLOCATION}res',
+            '-oil=${AOO_IMAGELISTDIR}',
+            '${SOURCE}']))
+
+    def SetReslocation(self, resLocation):
+        self.resLocation = resLocation
+        self.SetImageLocations(self.imageLocations)
+
+    def SetImageLocations(self, imageLocations):
+        self.imageLocations = imageLocations
+        imageList = []
+        for location in [ self.resLocation ] + self.imageLocations:
+            self._addLocationIfExists(imageList, '${AOO_DEFIMAGESLOCATION}' + location + '/' + self.library)
+            self._addLocationIfExists(imageList, '${AOO_DEFIMAGESLOCATION}' + location + '/imglist/${AOO_LANGUAGE}')
+            self._addLocationIfExists(imageList, '${AOO_DEFIMAGESLOCATION}' + location + '/imglist')
+            self._addLocationIfExists(imageList, '${AOO_DEFIMAGESLOCATION}' + location + '/res/${AOO_LANGUAGE}')
+            self._addLocationIfExists(imageList, '${AOO_DEFIMAGESLOCATION}' + location + '/res')
+            self._addLocationIfExists(imageList, '${AOO_DEFIMAGESLOCATION}' + location)
+        imageArgs = ' '.join(imageList)
+        self.env['AOO_IMAGEARGS'] = self.env.subst(imageArgs)
+
+    @staticmethod
+    def _addLocationIfExists(imageList, location):
+        abspath = Dir(location).abspath
+        if os.path.exists(abspath):
+            imageList.append('-lip=' + abspath)
+
+
+def build_srs(target, source, env):
+    # Concatenates the sources into the target.
+    # shutil.copyfileobj() was benchmarked as being the fastest:
+    # https://stackoverflow.com/questions/13613336/python-concatenate-text-files
+    with open(target[0].abspath, 'wb') as outfd:
+        for f in source:
+            with open(f.abspath, 'rb') as infd:
+                shutil.copyfileobj(infd, outfd)
+    return 0
 
 class SrsTarget:
     def __init__(self, srsPath):
         self.env = DefaultEnvironment().Clone()
+        self.env.Append(ENV=platform.getExecutableEnvironment(soenv))
+        self.env.Append(SCANNERS=ClassicCPP("AOOSRCScanner", '.src', "CPPPATH", '^[ \t]*#[ \t]*(?:include|import)[ \t]*(<|")([^>"]+)(>|")'))
+        self.srsPath = srsPath
 
     def SetInclude(self, includes):
         self.env.Replace(CPPPATH=includes)
 
     def AddFiles(self, files):
-        
+        parts = []
+        for file in files:
+            srsPartTarget = SrsPartTarget(self.env, file)
+            parts.append(srsPartTarget.target)
+        self.objects = self.env.Command('Res/SrsTarget/' + self.srsPath + '.srs', parts,
+            Action(build_srs))
 
 class SrsPartTarget:
-    def __init__(self):
+    def __init__(self, env, file):
+        srcFile = File(file)
+        dstFile = File('Res/SrsPartTarget/' + file)
+#        print('srcFile.path = ' + srcFile.path)
+#        print('srcFile.abspath = ' + srcFile.abspath)
+#        print('srcFile.srcnode().path = ' + srcFile.srcnode().path)
+#        print('srcFile.srcnode().abspath = ' + srcFile.srcnode().abspath)
+
+        env2 = env.Clone()
+        for var in env['CPPPATH']:
+            env2.Append(RSC_CPPPATH = ' -I' + var)
+        for var in env['CPPDEFINES']:
+            env2.Append(RSC_CPPDEFINES = ' -D' + var)
+
+        self.target = env2.Command(dstFile, srcFile.srcnode(),
+            '${OUTDIR}/bin/rsc -s ${RSC_CPPPATH} ${RSC_CPPDEFINES} -fp=$TARGET $SOURCE')
 
 class SrsPartMergeTarget:
     def __init__(self):
+        pass
diff --git a/main/site_scons/_alllangres.py b/main/site_scons/_alllangres.py
index 7c14c7b..48b0aa3 100644
--- a/main/site_scons/_alllangres.py
+++ b/main/site_scons/_alllangres.py
@@ -9,22 +9,24 @@
 #
 #                          AllLangResTarget(name)
 #                      (meta-target; delivers an empty timestamp file)
-#                            ^             ^
-#                           /               \
-#                          /                 \
-#                         /                   \
-#      ResTarget(nameen-US,name,en-US)         ResTarget(nameen-GB,name,en-GB)
-#      $(WORKDIR)/ResTarget/$(resName).res     $(WORKDIR)/ResTarget/$(resName).res
-#      $(WORKDIR)/ResTarget/nameen-US.res      $(WORKDIR)/ResTarget/nameen-GB.res
-#        ^                                       ^                        ^
-#        | rsc                                   |                        |
-#        |                                       |                        |
-#      SrsTarget                               SrsTarget                 SrsTarget
+#                            ^                         ^
+#                           /                           \                                           For each lang, makes a ResTarget.
+#                          /                             \                                          The ResTarget and its image list
+#                         /                               \                                         are the ONLY deliverables.
+#      ResTarget(nameen-US,name,en-US)                      ResTarget(nameen-GB,name,en-GB)
+#      $(WORKDIR)/ResTarget/$(resName).res                  $(WORKDIR)/ResTarget/$(resName).res
+#      $(WORKDIR)/ResTarget/nameen-US.res                   $(WORKDIR)/ResTarget/nameen-GB.res
+#        ^                                                      ^                                   For each file added though
+#        | rsc                                                  |                                   gb_AllLangResTarget_add_srs(), makes a
+#        |                                                      |                                   SrsTarget per ResTarget (realistically,
+#        |                                                      |                                   exactly 1 SrsTarget per ResTarget):
+#      SrsTarget                                             SrsTarget
 #      $(WORKDIR)/SrsTarget/$(srsName).srs
 #      $(WORKDIR)/SrsTarget/uui/res.srs
 #        ^
-#        | concatenate
-#        +----------+
+#        |                                                                                          For each file added through
+#        | concatenate                                                                              gb_SrsTarget_add_files(), makes an
+#        +----------+                                                                               SrsPartTarget:
 #        |           \
 #        |            \
 #      SrcPartTarget   SrcPartTarget
@@ -33,9 +35,9 @@
 #                        ^                   ^
 #                        | rsc               | rsc
 #                        |                   |
-# (when not translating) |                   | (when translating)
-#                        |                   |
-#                        |                SrcPartMergeTarget
+# (when not translating) |                   | (when translating)                                   We only make a SrsPartMergeTarget
+#                        |                   |                                                      when translating, and it's exactly
+#                        |                SrcPartMergeTarget                                        one per SrcPartTarget.
 #                        |                $(WORKDIR)/SrsPartMergeTarget/$(1)
 #                        |                $(WORKDIR)/SrsPartMergeTarget/uui/source/ids.src
 #                        |                 ^
diff --git a/main/site_scons/platform/freebsd.py b/main/site_scons/platform/freebsd.py
index 8f0f188..d04c956 100644
--- a/main/site_scons/platform/freebsd.py
+++ b/main/site_scons/platform/freebsd.py
@@ -246,7 +246,8 @@ class FreeBSD(aooplatform.Platform):
 
     def getExecutableEnvironment(self, soenv):
         return {
-            'LD_LIBRARY_PATH' : soenv['OUTDIR'] + '/lib'
+            'LD_LIBRARY_PATH' : soenv['OUTDIR'] + '/lib',
+            'SOLARBINDIR' : soenv['OUTDIR'] + '/bin'
         }
     
     def getTargetTypeGUIFlags(self, isGUI):
diff --git a/main/site_scons/platform/windows.py b/main/site_scons/platform/windows.py
index b596e14..7615651 100644
--- a/main/site_scons/platform/windows.py
+++ b/main/site_scons/platform/windows.py
@@ -289,7 +289,9 @@ class Windows(aooplatform.Platform):
         return self.layerComponentPrefixes[layer]
 
     def getExecutableEnvironment(self, soenv):
-        return {}
+        return {
+            'SOLARBINDIR' : soenv['OUTDIR'] + '/bin'
+        }
 
     def getTargetTypeGUIFlags(self, isGUI):
         if isGUI:
diff --git a/main/site_scons/site_init.py b/main/site_scons/site_init.py
index 1a750ef..c38fc50 100644
--- a/main/site_scons/site_init.py
+++ b/main/site_scons/site_init.py
@@ -41,6 +41,7 @@ env.Append(CXXFLAGS = platform.getCFlags(soenv))
 
 ## Add some common paths to the SCons environment, without AOO_ prefix
 
+env['SOLARSRC'] = soenv['SOLARSRC']
 env['OUTDIR'] = soenv['OUTDIR']
 env['WORKDIR'] = soenv['WORKDIR']
 env['SOLARENV'] = soenv['SOLARENV']
@@ -58,6 +59,7 @@ else:
 
 from sharedLibrary import AOOSharedLibrary
 from sharedObjects import AOOSharedObjects
+from AllLangRes import *
 
 def CreateSharedLibraryEnvironment(name, group):
     env = Environment()
diff --git a/main/site_scons/tests/Generators/.sconsign.dblite b/main/site_scons/tests/Generators/.sconsign.dblite
new file mode 100644
index 0000000..bee032d
Binary files /dev/null and b/main/site_scons/tests/Generators/.sconsign.dblite differ
diff --git a/main/site_scons/tests/Generators/SConstruct b/main/site_scons/tests/Generators/SConstruct
new file mode 100644
index 0000000..686f1bc
--- /dev/null
+++ b/main/site_scons/tests/Generators/SConstruct
@@ -0,0 +1,11 @@
+def generate_actions(source, target, env, for_signature):
+    return 'echo %s %s > %s' % (sources[0], sources[1], target[0])
+
+bld = Builder(generator = generate_actions)
+env = Environment(BUILDERS = {'Foo' : bld})
+sources = ['file.input']
+env.Foo('target', sources)
+sources.append('file2.input')
+
+
+print('Starting build')
diff --git a/main/site_scons/tests/Generators/file.input b/main/site_scons/tests/Generators/file.input
new file mode 100644
index 0000000..e69de29
diff --git a/main/site_scons/tests/Generators/file2.input b/main/site_scons/tests/Generators/file2.input
new file mode 100644
index 0000000..e69de29
diff --git a/main/site_scons/tests/IDLScanner/.sconsign.dblite b/main/site_scons/tests/IDLScanner/.sconsign.dblite
new file mode 100644
index 0000000..bcffd0e
Binary files /dev/null and b/main/site_scons/tests/IDLScanner/.sconsign.dblite differ
diff --git a/main/site_scons/tests/IDLScanner/SConstruct b/main/site_scons/tests/IDLScanner/SConstruct
new file mode 100644
index 0000000..0f59582
--- /dev/null
+++ b/main/site_scons/tests/IDLScanner/SConstruct
@@ -0,0 +1,10 @@
+#from SCons.Tool import CScanner
+from SCons.Scanner import ClassicCPP
+
+env = Environment()
+
+#SourceFileScanner.add_scanner('.idl', CScanner)
+# Taken from src/engine/SCons/Scanner/C.py in the scons tree and modified:
+env.Append(SCANNERS=ClassicCPP("AOOIDLScanner", '.idl', "CPPPATH", '^[ \t]*#[ \t]*(?:include|import)[ \t]*(<|")([^>"]+)(>|")'))
+
+env.Command('target.idl', 'source.idl', Copy("$TARGET", "$SOURCE"))
diff --git a/main/site_scons/tests/IDLScanner/header.h b/main/site_scons/tests/IDLScanner/header.h
new file mode 100644
index 0000000..73ac22d
--- /dev/null
+++ b/main/site_scons/tests/IDLScanner/header.h
@@ -0,0 +1 @@
+#define A 00
diff --git a/main/site_scons/tests/IDLScanner/source.idl b/main/site_scons/tests/IDLScanner/source.idl
new file mode 100644
index 0000000..62bb177
--- /dev/null
+++ b/main/site_scons/tests/IDLScanner/source.idl
@@ -0,0 +1,4 @@
+#include "header.h"
+
+interface X {
+}
diff --git a/main/site_scons/tests/IDLScanner/target.idl b/main/site_scons/tests/IDLScanner/target.idl
new file mode 100644
index 0000000..62bb177
--- /dev/null
+++ b/main/site_scons/tests/IDLScanner/target.idl
@@ -0,0 +1,4 @@
+#include "header.h"
+
+interface X {
+}
diff --git a/main/uui/SConscript b/main/uui/SConscript
new file mode 100644
index 0000000..238cead
--- /dev/null
+++ b/main/uui/SConscript
@@ -0,0 +1,29 @@
+#print("Dir(.)=" + Dir('.').path)
+#print("Dir(#.)=" + Dir('#.').path)
+
+srsTarget = SrsTarget('uui/res')
+srsTarget.SetInclude(env['CPPPATH'] + ['uui/source/'])
+srsTarget.AddFiles([
+        'source/cookiedg.src',
+        'source/ids.src',
+        'source/logindlg.src',
+        'source/masterpassworddlg.src',
+        'source/masterpasscrtdlg.src',
+        'source/openlocked.src',
+        'source/passworddlg.src',
+        'source/passworderrs.src',
+        'source/fltdlg.src',
+        'source/unknownauthdlg.src',
+        'source/sslwarndlg.src',
+        'source/secmacrowarnings.src',
+        'source/filechanged.src',
+        'source/alreadyopen.src',
+        'source/lockfailed.src',
+        'source/trylater.src',
+        'source/nameclashdlg.src',
+        'source/newerverwarn.src'
+
+])
+
+#ResTarget('uui', 'en-US', [srsTarget.objects])
+AllLangResTarget('uui', [srsTarget.objects])