On Sat, Dec 2, 2017 at 10:42 AM, Peter Kovacs <[email protected]> wrote:

> sounds great from what you write. Lets try SCons build system.
> Where can I find your changes so I can help? Have you checked them into
> trunk?
>
>
Please find a patch with my current SCons changes attached.

Currently only main/fileaccess builds, on Windows and FreeBSD, and doesn't
even build completely as I haven't done the "ComponentTarget" yet. You run
"scons" in main/ or "scons -u" in main/fileaccess. AOO has to already be
built.



> I have some expreience with python, which will come in handy.
>
>
That's great to hear. Please let me know what you think about the
structure, classes, should we use globals and soenv and SCon's Environment,
etc. There is no easier time to make changes than at the beginning.

Should we make a separate branch for SCons or develop in trunk? It doesn't
alter any existing files so it shouldn't interfere with our existing build.


> Meanwhile I read Scons Documentation.
>
> Am Samstag, den 02.12.2017, 10:05 +0200 schrieb Damjan Jovanovic:
> > Hi
> >
> > After days of failing to add a few new simple features to gbuild,
> > I've now
> > reached my limits, and have begun experimenting with the SCons build
> > system
> > instead.
> >
> > It's starting to work. Having ported some of gbuild.mk, LinkTarget.mk
> > and
> > platform/freebsd.mk to SCons, as well as a module's local gbuild
> > files, I
> > can now compile files and (badly) link them into libraries, and clean
> > the
> > build.
> >
> > SCons is an advanced next-generation build system like gbuild, with
> > high
> > level declarative syntax in Python, support for multiple modules that
> > build
> > in parallel, header dependencies, file change detection through MD5
> > sums of
> > contents instead of timestamps so rebuilds are faster, etc. It builds
> > C,
> > C++, Objective C, Java, Fortran, D, the sorely necessary Flex and
> > Yacc that
> > gbuild doesn't support. It supports tons of platforms and compilers,
> > including OS/2. It's maintainable and usable, can print debugging
> > info such
> > as dependency trees, and is generally pleasant to work with. We've
> > discussed it before on this list, but I never got to trying it until
> > now.
> >
> > Virtually everything gbuild does, is already done by SCons, and often
> > done
> > much better. The syntax for SCons files is similar/related to
> > gbuild's
> > syntax, so an automated conversion from gbuild to SCons might even be
> > possible.
> >
> > So far, I have defines, includes and C[XX]FLAGS working. I've
> > structured it
> > a bit better, with platform-specific files in classes that only
> > provide
> > variables to slot in higher up, instead of one giant set of globally
> > mutable global variables like in gbuild. Linking still needs a bit of
> > work.
> > Windows is next on the list, as Cygwin will be the ultimate test of
> > whether
> > we can use it.
> >
> > I am very hopeful. SCons has a long history and is used by other
> > projects,
> > while only OO.o derivatives use gbuild. It's well documented. It
> > supports
> > features we need which gbuild doesn't, like library version names and
> > flex/yacc. It's supposed to work on Windows, both inside and outside
> > of
> > Cygwin and could help us build without Cygwin some day. It supports
> > many
> > versions of Visual Studio and could help us in upgrading to a new
> > one. We
> > will need to add custom builders to SCons for our custom file formats
> > like
> > IDL, but it's just Python, not my favorite language but infinitely
> > better
> > than GNU make.
> >
> > It would help if someone could review my changes, as I am not very
> > familiar
> > with Python and there might be better ways to write some of the code.
> > I'll
> > post a patch for review after some further development.
> >
> > Thank you
> > Damjan
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [email protected]
> For additional commands, e-mail: [email protected]
>
>
Index: SConstruct
===================================================================
--- SConstruct  (nonexistent)
+++ SConstruct  (working copy)
@@ -0,0 +1 @@
+SConscript('fileaccess/SConscript', variant_dir='fileaccess/build', 
duplicate=0)
Index: site_scons/aooplatform.py
===================================================================
--- site_scons/aooplatform.py   (nonexistent)
+++ site_scons/aooplatform.py   (working copy)
@@ -0,0 +1,45 @@
+class Platform:
+    def getGUI(self):
+        raise Exception('Unimplemented')
+
+    def getCOMID(self):
+        raise Exception('Unimplemented')
+
+    def getCompilerDefs(self, soenv):
+        raise Exception('Unimplemented')
+
+    def getCPUDefs(self, soenv):
+        raise Exception('Unimplemented')
+
+    def getOSDefs(self, soenv):
+        raise Exception('Unimplemented')
+
+    def getLibraryDefs(self, soenv):
+        raise Exception('Unimplemented')
+
+    def getCFlags(self, soenv):
+        raise Exception('Unimplemented')
+
+    def getCXXFlags(self, soenv):
+        raise Exception('Unimplemented')
+
+    def getInclude(self, soenv):
+        raise Exception('Unimplemented')
+
+    def getIncludeStl(self, soenv):
+        raise Exception('Unimplemented')
+
+    def getExceptionFlags(self, soenv, enabled):
+        raise Exception('Unimplemented')
+
+    def getCompilerOptFlags(self, enabled, debugLevel):
+        raise Exception('Unimplemented')
+
+    def getDebugCFlags(self, compiler, enableSymbols):
+        raise Exception('Unimplemented')
+
+    def getLibraryLDFlags(self, soenv, layer, outDirLocation, debugging, 
debugLevel):
+        raise Exception('Unimplemented')
+
+    def getStandardLibs(self):
+        raise Exception('Unimplemented')
\ No newline at end of file

Property changes on: site_scons/aooplatform.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: site_scons/freebsd.py
===================================================================
--- site_scons/freebsd.py       (nonexistent)
+++ site_scons/freebsd.py       (working copy)
@@ -0,0 +1,187 @@
+import subprocess
+import aooplatform
+
+class FreeBSD(aooplatform.Platform):
+    def __init__(self):
+        self.GXX_INCLUDE_PATH = None
+        self.layerRPaths = {}
+        self.layerRPaths['URELIB'] = '$ORIGIN'
+        self.layerRPaths['UREBIN'] = '$ORIGIN/../lib:$ORIGIN'
+        self.layerRPaths['OOO'] = '$ORIGIN:$ORIGIN/../ure-link/lib'
+        self.layerRPaths['BRAND'] = 
'$ORIGIN:$ORIGIN/../basis-link/program:$ORIGIN/../basis-link/ure-link/lib'
+        self.layerRPaths['SDKBIN'] = '$ORIGIN/../../ure-link/lib'
+        self.layerRPaths['NONEBIN'] = '$ORIGIN/../lib:$ORIGIN'
+
+    def getGUI(self):
+        return 'UNX'
+
+    def getCOMID(self):
+        return 'gcc3'
+
+    def getCompilerDefs(self, soenv):
+        if self.GXX_INCLUDE_PATH is None:
+            gccVersion = subprocess.Popen("gcc -dumpversion", shell=True, 
stdout=subprocess.PIPE).stdout.readline().rstrip()
+            self.GXX_INCLUDE_PATH = soenv['COMPATH'] + "/include/c++/" + 
gccVersion
+        return [
+            soenv['COM'],
+            'HAVE_GCC_VISIBILITY_FEATURE',
+            'CPPU_ENV=gcc3',
+            'GXX_INCLUDE_PATH=' + self.GXX_INCLUDE_PATH
+        ]
+
+    def getCPUDefs(self, soenv):
+        return [soenv['CPUNAME']]
+
+    def getOSDefs(self, soenv):
+        defs = [
+            soenv['OS'],
+            '_PTHREADS',
+            'UNIX',
+            'UNX'
+        ]
+        if 'PTHREAD_CFLAGS' in soenv:
+            defs += [soenv['PTHREAD_CFLAGS']]
+        return defs
+
+    def getCFlags(self, soenv):
+        flags = [
+            '-Wall',
+            '-Wendif-labels',
+            '-Wextra',
+            '-Wshadow',
+            '-fPIC',
+            '-fmessage-length=0',
+            '-fno-common',
+            '-fno-strict-aliasing',
+            '-fvisibility=hidden',
+            '-pipe'
+        ]
+        if soenv['EXTERNAL_WARNINGS_NOT_ERRORS'] != 'TRUE':
+            flags += ['-Werror']
+        if 'SYSBASE' in soenv:
+            flags += ['--sysroot=' + soenv['SYSBASE']]
+        return flags
+
+    def getCXXFlags(self, soenv):
+        flags = [
+            '-Wall',
+            '-Wendif-labels',
+            '-Wextra',
+            '-Wno-ctor-dtor-privacy',
+            '-Wno-non-virtual-dtor',
+            '-Wshadow',
+            '-fPIC',
+            '-fmessage-length=0',
+            '-fno-common',
+            '-fno-strict-aliasing',
+            '-fno-use-cxa-atexit',
+            '-fvisibility-inlines-hidden',
+            '-fvisibility=hidden',
+            '-pipe'
+        ]
+        if soenv['EXTERNAL_WARNINGS_NOT_ERRORS'] != 'TRUE':
+            flags += ['-Werror']
+        if 'SYSBASE' in soenv:
+            flags += ['--sysroot=' + soenv['SYSBASE']]
+        if soenv['COM'] == 'CLANG':
+            flags += ['-DHAVE_STL_INCLUDE_PATH']
+        else:
+            flags += ['-DBOOST_TR1_DISABLE_INCLUDE_NEXT', 
'-DBOOST_TR1_GCC_INCLUDE_PATH=c++']
+        return flags
+
+    def getInclude(self, soenv):
+        includes = []
+        for i in soenv['SOLARINC'].split(' '):
+            if i.endswith('/stl'):
+                continue;
+            if i.startswith('-I'):
+                includes.append(i[2:])
+        return includes
+
+    def getIncludeStl(self, soenv):
+        includes = []
+        for i in soenv['SOLARINC'].split(' '):
+            if i.startswith('-I') and i.endswith('/stl'):
+                includes.append(i[2:])
+        return includes
+
+    def getExceptionFlags(self, soenv, enabled):
+        flags = []
+        if enabled:
+            flags += ['-DEXCEPTIONS_ON', '-fexceptions']
+            if soenv['COM'] == 'GCC':
+                flags += ['-fno-enforce-eh-specs'];
+        else:
+            flags += ['-DEXCEPTIONS_OFF', '-fno-exceptions']
+        return flags
+
+    def getCompilerOptFlags(self, enabled, debugLevel):
+        if enabled:
+            if debugLevel == 2:
+                return ['-O0']
+            else:
+                return ['-Os']
+        else:
+            return ['-O0']
+
+    def getDebugCFlags(self, compiler, enableSymbols):
+        if compiler == 'CLANG':
+            if enableSymbols == 'SMALL':
+                return ['-ggdb1', '-fno-inline']
+            else:
+                return ['-ggdb3', '-fno-inline']
+        else:
+            if enableSymbols == 'SMALL':
+                return ['-ggdb1', '-finline-limit=0', '-fno-inline', 
'-fno-default-inline']
+            else:
+                return ['-ggdb3', '-finline-limit=0', '-fno-inline', 
'-fno-default-inline']
+
+    def getRPATH(self, layer):
+        return self.layerRPaths[layer]
+
+    def getLibraryDefs(self, soenv):
+        return []
+
+    def getLDFlags(self, soenv, debugging, debugLevel):
+        sysbase = soenv.get('SYSBASE')
+        if sysbase is None:
+            sysbase = ''
+        flags = [
+            '-Wl,-rpath-link,' + sysbase + '/lib:' + sysbase + '/usr/lib',
+            '-Wl,-z,combreloc',
+            '-Wl,-z,defs'
+        ]
+        if soenv.get('FBSD_GCC_RPATH') is not None:
+            flags += [soenv['FBSD_GCC_RPATH']]
+        if sysbase != '':
+            flags += ['--sysroot=' + sysbase]
+        if soenv['HAVE_LD_HASH_STYLE'] == 'TRUE':
+            flags += ['-Wl,--hash-style=both']
+        if soenv['HAVE_LD_BSYMBOLIC_FUNCTIONS'] == 'TRUE':
+            flags += [
+                '-Wl,--dynamic-list-cpp-new',
+                '-Wl,--dynamic-list-cpp-typeinfo',
+                '-Wl,-Bsymbolic-functions'
+            ]
+        if debugLevel == 0:
+            flags += ['-Wl,-O1']
+        return flags;
+
+    def getLDPATH(self, soenv):
+        path = soenv['SOLARLIB']
+        path = path.replace('-L../lib ', '')
+        path = path.replace('-L', '')
+        return path.split()
+
+    def getLibraryLDFlags(self, soenv, layer, outDirLocation, debugging, 
debugLevel):
+        flags = self.getLDFlags(soenv, debugging, debugLevel)
+        flags += [ '-Wl,-z,noexecstack' ]
+        flags += [
+            '-Wl,-z,origin',
+            '-Wl,-rpath,' + self.getRPATH(layer),
+            '-Wl,-rpath-link,' + outDirLocation
+        ]
+        return flags
+
+    def getStandardLibs(self):
+        return []

Property changes on: site_scons/freebsd.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: site_scons/site_init.py
===================================================================
--- site_scons/site_init.py     (nonexistent)
+++ site_scons/site_init.py     (working copy)
@@ -0,0 +1,230 @@
+#**************************************************************
+#  
+#  Licensed to the Apache Software Foundation (ASF) under one
+#  or more contributor license agreements.  See the NOTICE file
+#  distributed with this work for additional information
+#  regarding copyright ownership.  The ASF licenses this file
+#  to you under the Apache License, Version 2.0 (the
+#  "License"); you may not use this file except in compliance
+#  with the License.  You may obtain a copy of the License at
+#  
+#    http://www.apache.org/licenses/LICENSE-2.0
+#  
+#  Unless required by applicable law or agreed to in writing,
+#  software distributed under the License is distributed on an
+#  "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+#  KIND, either express or implied.  See the License for the
+#  specific language governing permissions and limitations
+#  under the License.
+#  
+#**************************************************************
+
+from SCons.Script import *
+import sys
+import os
+
+siteDir, myFilename = os.path.split(os.path.abspath(__file__))
+mainDir, siteDir2 = os.path.split(siteDir)
+
+# Or should we patch set_soenv to generate us a .py file?
+def _loadJavaProperties(filepath):
+    props = {}
+    with open(filepath, "rt") as f:
+        for line in f:
+            l = line.strip()
+            if l and not l.startswith('#'):
+                eq = l.find('=')
+                if eq >= 0:
+                    key = l[:eq].strip()
+                    value = l[(eq+1):].strip()
+                    props[key] = value
+    return props
+
+soenv = _loadJavaProperties(mainDir + os.sep + 'ant.properties')
+
+############################
+# Product and debug settings
+############################
+
+PRODUCT = (soenv.get('PRODUCT') == 'TRUE')
+
+if 'DEBUG' in soenv:
+    DEBUGLEVEL = 2
+elif PRODUCT:
+    DEBUGLEVEL = 1
+else:
+    DEBUGLEVEL = 0
+
+DEBUGGING = False
+if DEBUGLEVEL == 2:
+    DEBUGGING = True
+
+if soenv.get('ENABLE_SYMBOLS') == 'SMALL':
+    DEBUGGING = True
+elif soenv.get('ENABLE_SYMBOLS') == 'TRUE':
+    DEBUGGING = True
+
+if soenv.get('ENABLE_CRASHDUMP') == 'TRUE':
+    DEBUGGING = True
+
+#####################
+# Precompiled headers
+#####################
+
+ENABLE_PCH = (soenv.get('ENABLE_PCH') == 'TRUE')
+
+#######
+# Paths
+#######
+
+OUTDIR = soenv['SOLARVERSION'] + "/" + soenv['INPATH']
+WORKDIR = OUTDIR + "/workdir"
+OUTDIRLOCATION = OUTDIR + os.sep + 'lib'
+
+###########
+# Platforms
+###########
+
+if soenv['OS'] == 'FREEBSD':
+    from freebsd import *
+    platform = FreeBSD()
+elif soenv['OS'] == 'WNT':
+    from windows import *
+    platform = Windows()
+else:
+    raise Exception ('Unsupported OS: ' + soenv['OS'])
+
+GUI = platform.getGUI()
+COMID = platform.getCOMID()
+
+######
+# Defs
+######
+
+GLOBALDEFS = [
+    '_REENTRANT',
+    'CUI',
+    'ENABLE_LAYOUT_EXPERIMENTAL=0',
+    'ENABLE_LAYOUT=0',
+    'OSL_DEBUG_LEVEL=' + str(DEBUGLEVEL),
+    'SOLAR_JAVA',
+    'SUPD=' + soenv['UPD'],
+    'VCL'
+]
+
+GLOBALDEFS += platform.getOSDefs(soenv)
+GLOBALDEFS += platform.getCompilerDefs(soenv)
+GLOBALDEFS += platform.getCPUDefs(soenv)
+
+if PRODUCT:
+    GLOBALDEFS += ['PRODUCT', 'PRODUCT_FULL']
+else:
+    GLOBALDEFS += ['DBG_UTIL', 'STLP_DEBUG']
+
+if DEBUGLEVEL == 2:
+    GLOBALDEFS += ['DEBUG'];
+else:
+    GLOBALDEFS += ['OPTIMIZE', 'NDEBUG']
+
+if 'ENABLE_GTK' in soenv:
+    GLOBALDEFS += ['ENABLE_GTK']
+if 'ENABLE_KDE' in soenv:
+    GLOBALDEFS += ['ENABLE_KDE']
+if 'ENABLE_KDE4' in soenv:
+    GLOBALDEFS += ['ENABLE_KDE4']
+if 'ENABLE_GRAPHITE' in soenv:
+    GLOBALDEFS += ['ENABLE_GRAPHITE']
+
+
+###########
+# Libraries
+###########
+
+# FIXME: this probably belongs elsewhere
+UCBHELPER_MAJOR=4
+UDK_MAJOR=3
+
+if GUI == 'UNX' or soenv['COM'] == 'GCC':
+    if GUI+soenv['COM'] == 'WNTGCC':
+        CPPULIB = 'cppu' + UDK_MAJOR
+        CPPUHELPERLIB = 'cppuhelper' + UDK_MAJOR + COMID
+    elif GUI == 'OS2':
+        CPPULIB = 'cppu' + UDK_MAJOR
+        CPPUHELPERLIB = 'cppuh' + UDK_MAJOR
+    else:
+        CPPULIB = 'uno_cppu'
+        CPPUHELPERLIB = 'uno_cppuhelper' + COMID
+
+    if GUI+soenv['COM'] == 'WNTGCC' or GUI == 'OS2':
+        SALLIB = 'sal' + UDK_MAJOR
+    else:
+        SALLIB = 'uno_sal'
+
+    TOOLSLIB = 'tl'
+
+    if GUI == 'OS2':
+        UCBHELPERLIB = 'ucbh' + UCBHELPER_MAJOR
+    else:
+        UCBHELPERLIB=  'ucbhelper' + COMID
+
+    UNOTOOLSLIB = 'utl'
+
+else:
+    CPPULIB = 'icppu'
+    CPPUHELPERLIB = 'icppuhelper'
+    SALLIB = 'isal'
+    TOOLSLIB = 'itools'
+    UCBHELPERLIB = 'iucbhelper'
+    UNOTOOLSLIB = 'iutl'
+
+STDLIBS = platform.getStandardLibs()
+
+###########
+# API
+###########
+
+def SetUpSharedLibraryEnvironment(name, layer):
+    env = Environment()
+    env.Replace(CC=soenv['CC'])
+    env.Replace(CXX=soenv['CXX'])
+
+    env.Append(CPPPATH=platform.getInclude(soenv))
+
+    defines = GLOBALDEFS
+    defines += platform.getLibraryDefs(soenv)
+    env.Append(CPPDEFINES=defines)
+
+    cflags = platform.getCFlags(soenv)
+    cxxflags = platform.getCXXFlags(soenv)
+    if DEBUGGING:
+        cflags += platform.getDebugCFlags(soenv['COM'], 
soenv['ENABLE_SYMBOLS'])
+        cxxflags += platform.getDebugCFlags(soenv['COM'], 
soenv['ENABLE_SYMBOLS'])
+    env.Append(CFLAGS=cflags)
+    env.Append(CXXFLAGS=cxxflags)
+
+    env.Append(LINKFLAGS=platform.getLibraryLDFlags(soenv, layer, 
OUTDIRLOCATION, DEBUGGING, DEBUGLEVEL))
+    env.Append(LIBPATH=platform.getLDPATH(soenv))
+
+    return env
+
+
+def AddAPI(env, names):
+    for name in names:
+        env.Append(CPPPATH=OUTDIR + '/inc/' + name)
+
+def AddExceptionSharedObjects(env, names):
+    return AddCxxSharedObjects(env, names,
+        platform.getExceptionFlags(soenv, True)
+        + platform.getCompilerOptFlags(DEBUGLEVEL < 2, DEBUGLEVEL))
+
+def AddNoExceptionSharedObjects(env, names):
+    return AddCxxSharedObjects(env, names,
+        platform.getExceptionFlags(soenv, False)
+        + platform.getCompilerOptFlags(DEBUGLEVEL < 2, DEBUGLEVEL))
+
+def AddCxxSharedObjects(env, names, flags):
+    objects = []
+    for name in names:
+        objects.append(env.SharedObject(name, CXXFLAGS=flags))
+    return objects
+

Property changes on: site_scons/site_init.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: site_scons/windows.py
===================================================================
--- site_scons/windows.py       (nonexistent)
+++ site_scons/windows.py       (working copy)
@@ -0,0 +1,219 @@
+import subprocess
+import aooplatform
+
+class Windows(aooplatform.Platform):
+    def __init__(self):
+        pass
+
+    def getGUI(self):
+        return 'WNT'
+
+    def getCOMID(self):
+        return 'MSC'
+
+    def getCompilerDefs(self, soenv):
+        return [
+            'MSC',
+            '_CRT_NON_CONFORMING_SWPRINTFS',
+            '_CRT_NONSTDC_NO_DEPRECATE',
+            '_CRT_SECURE_NO_DEPRECATE',
+            '_MT',
+            '_DLL',
+            'BOOST_MEM_FN_ENABLE_CDECL',
+            'CPPU_ENV=msci',
+            'FULL_DESK',
+            'M1500'
+        ]
+
+    def getCPUDefs(self, soenv):
+        return [
+            'INTEL',
+            '_X86_=1'
+        ]
+
+    def getOSDefs(self, soenv):
+        return [
+            'WINVER=0x0500',
+            '_WIN32_IE=0x0500',
+            'NT351',
+            'WIN32',
+            'WNT'
+        ]
+
+    def getCFlags(self, soenv):
+        flags = [
+            '-Gd',
+            '-GR',
+            '-Gs',
+            '-GS',
+            '-nologo',
+            '-Wall',
+            '-wd4005',
+            '-wd4061',
+            '-wd4127',
+            '-wd4180',
+            '-wd4189',
+            '-wd4191',
+            '-wd4217',
+            '-wd4250',
+            '-wd4251',
+            '-wd4255',
+            '-wd4275',
+            '-wd4290',
+            '-wd4294',
+            '-wd4350',
+            '-wd4355',
+            '-wd4365',
+            '-wd4503',
+            '-wd4505',
+            '-wd4511',
+            '-wd4512',
+            '-wd4514',
+            '-wd4611',
+            '-wd4619',
+            '-wd4625',
+            '-wd4626',
+            '-wd4640',
+            '-wd4668',
+            '-wd4675',
+            '-wd4692',
+            '-wd4710',
+            '-wd4711',
+            '-wd4738',
+            '-wd4786',
+            '-wd4800',
+            '-wd4820',
+            '-wd4826',
+            '-Zc:wchar_t-',
+            '-Zm500'
+        ]
+        if soenv['EXTERNAL_WARNINGS_NOT_ERRORS'] != 'TRUE':
+            flags += ['-WX']
+        return flags
+
+    def getCXXFlags(self, soenv):
+        flags = [
+            '-Gd',
+            '-GR',
+            '-Gs',
+            '-GS',
+            '-Gy',
+            '-nologo',
+            '-Wall',
+            '-wd4005',
+            '-wd4061',
+            '-wd4127',
+            '-wd4180',
+            '-wd4189',
+            '-wd4191',
+            '-wd4217',
+            '-wd4250',
+            '-wd4251',
+            '-wd4275',
+            '-wd4290',
+            '-wd4294',
+            '-wd4350',
+            '-wd4355',
+            '-wd4365',
+            '-wd4503',
+            '-wd4505',
+            '-wd4511',
+            '-wd4512',
+            '-wd4514',
+            '-wd4611',
+            '-wd4619',
+            '-wd4625',
+            '-wd4626',
+            '-wd4640',
+            '-wd4668',
+            '-wd4675',
+            '-wd4692',
+            '-wd4710',
+            '-wd4711',
+            '-wd4738',
+            '-wd4786',
+            '-wd4800',
+            '-wd4820',
+            '-wd4826',
+            '-Zc:wchar_t-',
+            '-Zm500'
+        ]
+        if soenv['EXTERNAL_WARNINGS_NOT_ERRORS'] != 'TRUE':
+            flags += ['-WX']
+        return flags
+
+    def getInclude(self, soenv):
+        includes = []
+        for i in soenv['SOLARINC'].split(' '):
+            if i.endswith('/stl'):
+                continue;
+            if i.startswith('-I'):
+                includes.append(i[2:])
+        return includes
+
+    def getIncludeStl(self, soenv):
+        includes = []
+        for i in soenv['SOLARINC'].split(' '):
+            if i.startswith('-I') and i.endswith('/stl'):
+                includes.append(i[2:])
+        return includes
+
+    def getExceptionFlags(self, soenv, enabled):
+        flags = []
+        if enabled:
+            flags += ['-DEXCEPTIONS_ON', '-EHa']
+        else:
+            flags += ['-DEXCEPTIONS_OFF']
+        return flags
+
+    def getCompilerOptFlags(self, enabled, debugLevel):
+        if enabled:
+            if debugLevel == 2:
+                return []
+            else:
+                return ['-Ob1', '-Oxs', '-Oy-']
+        else:
+            return ['-Od']
+
+    def getDebugCFlags(self, compiler, debugging, enableSymbols):
+        return ['-Zi']
+
+    def getLibraryDefs(self, soenv):
+        return ['_DLL_']
+
+    def getLDFlags(self, soenv, debugging, debugLevel):
+        flags = [
+            '-MACHINE:IX86',
+            '-NODEFAULTLIB'
+        ]
+        if debugging:
+            flags += ['-DEBUG']
+        return flags;
+
+    def getLDPATH(self, soenv):
+        path = []
+        ilib = soenv['ILIB']
+        ilib = ilib.replace(';', ' ')
+        for i in ilib.split(' '):
+            if i != '.':
+                path += [i]
+        return path
+
+    def getLibraryLDFlags(self, soenv, layer, outDirLocation, debugging, 
debugLevel):
+        flags = self.getLDFlags(soenv, debugging, debugLevel)
+        flags += [
+            '-DLL',
+            '-OPT:NOREF',
+            '-SAFESEH',
+            '-NXCOMPAT',
+            '-DYNAMICBASE',
+        ]
+        return flags
+
+    def getStandardLibs(self):
+        return [
+            'kernel32',
+            'msvcrt',
+            'oldnames',
+            'uwinapi'
+        ]
\ No newline at end of file

Property changes on: site_scons/windows.py
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+native
\ No newline at end of property
Index: fileaccess/SConscript
===================================================================
--- fileaccess/SConscript       (nonexistent)
+++ fileaccess/SConscript       (working copy)
@@ -0,0 +1,31 @@
+env = SetUpSharedLibraryEnvironment('fileacc', 'OOO')
+
+env.Prepend(CPPPATH = 'inc')
+AddAPI(env, [
+    'offapi',
+    'udkapi'
+])
+
+env.Append(CPPDEFINES = [ 'FILEACCESS_DLLIMPLEMENTATION' ])
+
+fileacc = env.SharedLibrary(
+    'fileacc',
+    ['source/FileAccess.cxx'],
+    LIBS = [
+        CPPULIB,
+        CPPUHELPERLIB,
+        SALLIB,
+        TOOLSLIB,
+        UCBHELPERLIB,
+        UNOTOOLSLIB
+    ] + STDLIBS
+)
+
+installLib = env.Install(OUTDIR + '/lib', fileacc)
+
+installXml = env.Install(OUTDIR + '/xml', 'source/fileacc.xml')
+
+env.Alias('install', [
+    installLib,
+    installXml
+])
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to