* integrate bFTGL with Scons
authorNathan Letwory <nathan@letworyinteractive.com>
Fri, 6 May 2005 13:37:18 +0000 (13:37 +0000)
committerNathan Letwory <nathan@letworyinteractive.com>
Fri, 6 May 2005 13:37:18 +0000 (13:37 +0000)
* add some ENV = os.environ's here and there (help those who have msvc toolkit installed)

Note for OSX users: check from your config.opts the correct info for the precompiled ftgl lib is used.

SConstruct
extern/SConscript
extern/bFTGL/SConscript [new file with mode: 0644]
extern/qhull/SConscript
extern/solid/SConscript
source/blender/makesdna/intern/SConscript
tools/scons/bs/bs_libs.py

index 7a81b1bb500fcb00ee92b068dc82c0403b723ad2..41c419c8f57feba0a8468884c2b95d5b9ff6a694 100644 (file)
@@ -49,12 +49,12 @@ if os.path.isdir (bs_globals.root_build_dir) == 0:
 version='2.36'
 shortversion = '236' # for wininst target -> nsis installer creation
 
-sdl_env = Environment ()
-freetype_env = Environment ()
-env = Environment ()
+sdl_env = Environment (ENV = os.environ)
+freetype_env = Environment (ENV = os.environ)
+env = Environment (ENV = os.environ)
 
 if sys.platform == 'linux2' or sys.platform == 'linux-i386':
-       use_international = 'false'
+       use_international = 'true'
        use_gameengine = 'true'
        use_openal = 'false'
        use_fmod = 'false'
@@ -101,11 +101,11 @@ if sys.platform == 'linux2' or sys.platform == 'linux-i386':
        sdl_libpath = sdl_env.Dictionary()['LIBPATH']
        sdl_lib = sdl_env.Dictionary()['LIBS']
        # SOLID library information
-       solid_lib = []                                              # TODO
-       solid_libpath = []                                          # TODO
+       solid_lib = []
+       solid_libpath = []
        solid_include = ['#extern/solid']
-       qhull_lib = []                                              # TODO
-       qhull_libpath = []                                          # TODO
+       qhull_lib = []
+       qhull_libpath = []
        qhull_include = ['#extern/qhull/include']
        # ODE library information
        ode_lib = ['ode']
@@ -117,9 +117,9 @@ if sys.platform == 'linux2' or sys.platform == 'linux-i386':
        python_include = [sysconfig.get_python_inc ()]
        python_linkflags = Split (sysconfig.get_config_var('LINKFORSHARED'))
        # International support information
-       ftgl_lib = ['ftgl']
-       ftgl_libpath = ['#../lib/linux-glibc2.2.5-i386/ftgl/lib']
-       ftgl_include = ['#../lib/linux-glibc2.2.5-i386/ftgl/include']
+       ftgl_lib = []
+       ftgl_libpath = []
+       ftgl_include = ['#extern/bFTGL/include']
        freetype_env.ParseConfig ('pkg-config --cflags --libs freetype2 2>/dev/null || freetype-config --cflags --libs 2>/dev/null')
        freetype_lib = freetype_env.Dictionary()['LIBS']
        freetype_libpath = freetype_env.Dictionary()['LIBPATH']
@@ -231,9 +231,9 @@ elif sys.platform == 'darwin':
                                                '-framework', 'IOKit' , 
                                                '-framework', 'AppKit']
        # International stuff
-       ftgl_lib = ['ftgl']
-       ftgl_libpath = [darwin_precomp + 'ftgl/lib']
-       ftgl_include = [darwin_precomp + 'ftgl/include']
+       ftgl_lib = []
+       ftgl_libpath = []
+       ftgl_include = ['#extern/bFTGL/include']
        freetype_lib = ['libfreetype']
        freetype_libpath = [darwin_precomp + 'freetype/lib']
        freetype_include = [darwin_precomp + 'freetype/include']
@@ -295,11 +295,11 @@ elif sys.platform == 'cygwin':
        sdl_cflags = []
        #sdl_cflags = '-DWIN32'
        # SOLID library information
-       solid_lib = []                                                                                    # TODO
-       solid_libpath = []                                                                                # TODO
+       solid_lib = []
+       solid_libpath = []
        solid_include = ['#extern/solid']
-       qhull_lib = []                                                                                    # TODO
-       qhull_libpath = []                                                                                # TODO
+       qhull_lib = []
+       qhull_libpath = []
        qhull_include = ['#extern/qhull/include']
        # ODE library information
        ode_lib = ['ode']
@@ -311,9 +311,9 @@ elif sys.platform == 'cygwin':
        python_lib = ['python22']
        python_linkflags = []
        # International stuff
-       ftgl_lib = ['ftgl']
-       ftgl_libpath = ['#../lib/windows/gcc/ftgl/lib']
-       ftgl_include = ['#../lib/windows/gcc/ftgl/include']
+       ftgl_lib = []
+       ftgl_libpath = []
+       ftgl_include = ['#extern/bFTGL/include']
        freetype_lib = ['freetype']
        freetype_libpath = ['#../lib/windows/gcc/freetype/lib']
        freetype_include = ['#../lib/windows/gcc/freetype/include']
@@ -412,9 +412,9 @@ elif sys.platform == 'win32':
        python_lib = ['python23']
        python_linkflags = []
        # International stuff
-       ftgl_lib = ['ftgl_static_ST']
-       ftgl_libpath = ['#../lib/windows/ftgl/lib']
-       ftgl_include = ['#../lib/windows/ftgl/include']
+       ftgl_lib = []
+       ftgl_libpath = []
+       ftgl_include = ['#extern/bFTGL/include']
        freetype_lib = ['freetype2ST']
        freetype_libpath = ['#../lib/windows/freetype/lib']
        freetype_include = ['#../lib/windows/freetype/include']
@@ -474,15 +474,15 @@ elif string.find (sys.platform, 'sunos') != -1:
        sdl_libpath = sdl_env.Dictionary()['LIBPATH']
        sdl_lib = sdl_env.Dictionary()['LIBS']
        # SOLID library information
-       solid_lib = []                                                                                    # TODO
-       solid_libpath = []                                                                                # TODO
+       solid_lib = []
+       solid_libpath = []
        solid_include = ['#extern/solid']
-       qhull_lib = []                                                                                    # TODO
-       qhull_libpath = []                                                                                # TODO
+       qhull_lib = []
+       qhull_libpath = []
        qhull_include = ['#extern/qhull/include']
        # ODE library information
-       ode_lib = []                                                                                            # TODO
-       ode_libpath = []                                                                                        # TODO
+       ode_lib = []
+       ode_libpath = []
        ode_include = ['#extern/ode/dist/include/ode']
        # Python variables.
        python_lib = ['python%d.%d' % sys.version_info[0:2]]
@@ -490,9 +490,9 @@ elif string.find (sys.platform, 'sunos') != -1:
        python_include = [sysconfig.get_python_inc ()]
        python_linkflags = []
        # International support information
-       ftgl_lib = ['ftgl']
-       ftgl_libpath = ['#../lib/solaris-2.8-sparc/ftgl/lib']
-       ftgl_include = ['#../lib/solaris-2.8-sparc/ftgl/include']
+       ftgl_lib = []
+       ftgl_libpath = []
+       ftgl_include = ['#extern/bFTGL/include']
        freetype_lib = ['freetype']
        freetype_libpath = ['#../lib/solaris-2.8-sparc/freetype/lib']
        freetype_include = ['#../lib/solaris-2.8-sparc/freetype/include']
@@ -559,15 +559,15 @@ elif string.find (sys.platform, 'irix') != -1:
        sdl_libpath = [irix_precomp + '/sdl/lib']
        sdl_lib = ['SDL', 'libSDL.a']
        # SOLID library information
-       solid_lib = []                                                                                    # TODO
-       solid_libpath = []                                                                                # TODO
+       solid_lib = []
+       solid_libpath = []
        solid_include = [irix_precomp + '/solid/include']
-       qhull_lib = []                                                                                    # TODO
-       qhull_libpath = []                                                                                # TODO
+       qhull_lib = []
+       qhull_libpath = []
        qhull_include = ['#extern/qhull/include']
        # ODE library information
-       ode_lib = []                                                                                            # TODO
-       ode_libpath = []                                                                                        # TODO
+       ode_lib = []
+       ode_libpath = []
        ode_include = [irix_precomp + '/ode/include']
        # Python library information
        python_libpath = [irix_precomp + '/python/lib/python2.2/config']
@@ -575,9 +575,9 @@ elif string.find (sys.platform, 'irix') != -1:
        python_lib = ['python2.2']
        python_linkflags = []
        # International support information
-       ftgl_lib = ['ftgl']
-       ftgl_libpath = [irix_precomp + '/ftgl/lib']
-       ftgl_include = [irix_precomp + '/ftgl/include']
+        ftgl_lib = []
+        ftgl_libpath = []
+        ftgl_include = ['#extern/bFTGL/include']
        freetype_lib = ['freetype']
        freetype_libpath = [irix_precomp + '/freetype/lib']
        freetype_include = [irix_precomp + '/freetype/include']
@@ -641,11 +641,11 @@ elif sys.platform=='openbsd3':
        sdl_libpath = sdl_env.Dictionary()['LIBPATH']
        sdl_lib = sdl_env.Dictionary()['LIBS']
        # SOLID library information
-       solid_lib = []                                   # TODO
-       solid_libpath = []              # TODO
+       solid_lib = []
+       solid_libpath = []
        solid_include = ['#extern/solid']
-       qhull_lib = []     # TODO
-       qhull_libpath = []  # TODO
+       qhull_lib = []
+       qhull_libpath = []
        qhull_include = ['#extern/qhull/include']
        # ODE library information
        ode_lib = ['ode']
@@ -657,9 +657,9 @@ elif sys.platform=='openbsd3':
        python_include = [sysconfig.get_python_inc ()]
        python_linkflags = []
        # International support information
-       ftgl_lib = ['ftgl']
-       ftgl_libpath = ['#../lib/linux-glibc2.2.5-i386/ftgl/lib']
-       ftgl_include = ['#../lib/linux-glibc2.2.5-i386/ftgl/include']
+        ftgl_lib = []
+        ftgl_libpath = []
+        ftgl_include = ['#extern/bFTGL/include']
        freetype_env.ParseConfig('pkg-config --cflags --libs freetype2')
        freetype_lib = freetype_env.Dictionary()['LIBS']
        freetype_libpath = freetype_env.Dictionary()['LIBPATH']
@@ -720,11 +720,11 @@ elif sys.platform=='freebsd4' or sys.platform=='freebsd5':
        sdl_libpath = ['/usr/local/include/SDL11']
        sdl_lib = sdl_env.Dictionary()['LIBS']
        # SOLID library information
-       solid_lib = []                                   # TODO
-       solid_libpath = []              # TODO
+       solid_lib = []
+       solid_libpath = []
        solid_include = ['#extern/solid']
-       qhull_lib = []     # TODO
-       qhull_libpath = []  # TODO
+       qhull_lib = []
+       qhull_libpath = []
        qhull_include = ['#extern/qhull/include']
        # ODE library information
        ode_lib = ['ode']
@@ -736,9 +736,9 @@ elif sys.platform=='freebsd4' or sys.platform=='freebsd5':
        python_include = [sysconfig.get_python_inc ()]
        python_linkflags = []
        # International support information
-       ftgl_lib = ['ftgl']
-       ftgl_libpath = ['#../lib/linux-glibc2.2.5-i386/ftgl/lib']
-       ftgl_include = ['#../lib/linux-glibc2.2.5-i386/ftgl/include']
+       ftgl_lib = []
+       ftgl_libpath = []
+       ftgl_include = ['#extern/bFTGL/include']
        freetype_env.ParseConfig('pkg-config --cflags --libs freetype2')
        freetype_lib = freetype_env.Dictionary()['LIBS']
        freetype_libpath = freetype_env.Dictionary()['LIBPATH']
@@ -863,7 +863,7 @@ else:
 #-----------------------------------------------------------------------------
 list_opts = []
 user_options = Options (bs_globals.config_file)
-user_options_env = Environment (options = user_options)
+user_options_env = Environment (ENV = os.environ, options = user_options)
 user_options.AddOptions (
                ('VERSION', 'Blender version', version),
                (EnumOption ('BUILD_BINARY', 'release',
@@ -965,7 +965,7 @@ user_options_dict = user_options_env.Dictionary()
 Help(user_options.GenerateHelpText(user_options_env))
 bs_globals.root_build_dir = user_options_dict['BUILD_DIR']
 # SET MODULE VARS #
-init_env = Environment()
+init_env = Environment(ENV = os.environ)
 
 bs_globals.user_options_dict = user_options_dict
 bs_globals.init_env = init_env
@@ -1108,7 +1108,7 @@ if bs_globals.enable_clean == 0:
        
        if sys.platform=='win32':
                if user_options_dict['BUILD_BINARY']=='debug':
-                       browser = Environment()
+                       browser = Environment(ENV = os.environ)
                        browser_tmp = bs_globals.root_build_dir+'bscmake.tmp'
                        browser.Command ('blender.bsc', 'blender$PROGSUFFIX',
                                ['dir /b/s '+bs_globals.root_build_dir+'*.sbr >'+browser_tmp,
@@ -1136,7 +1136,7 @@ if bs_globals.enable_clean == 0:
                        player_blender.Program (target='blenderplayer', source=d_obj)
                if sys.platform=='win32':
                        if user_options_dict['BUILD_BINARY']=='debug':
-                               browser = Environment()
+                               browser = Environment(ENV = os.environ)
                                browser_tmp = bs_globals.root_build_dir+'bscmake.tmp'
                                browser.Command ('blenderplayer.bsc', 'blenderplayer$PROGSUFFIX',
                                ['dir /b/s '+bs_globals.root_build_dir+'*.sbr >'+browser_tmp,
index 4d58ee6447dd6b56db0c3d7cb8067f60a0ccbc86..f5f4267988dbb523e43b21f263b672559ba0ef7e 100644 (file)
@@ -1,3 +1,13 @@
 #!/usr/bin/python
+
+Import('user_options_dict')
+
+
+print "externs..."
 SConscript(['qhull/SConscript',
-            'solid/SConscript'])
\ No newline at end of file
+            'solid/SConscript'])
+            
+            
+if user_options_dict['USE_INTERNATIONAL'] == 1:
+    print "bftgl"
+    SConscript(['bFTGL/SConscript'])
\ No newline at end of file
diff --git a/extern/bFTGL/SConscript b/extern/bFTGL/SConscript
new file mode 100644 (file)
index 0000000..5504965
--- /dev/null
@@ -0,0 +1,53 @@
+#!/usr/bin/python
+import sys
+import os
+
+ftgl_env = Environment(ENV=os.environ)
+
+# Import the C flags set in the SConstruct file
+Import ('cflags')
+Import ('defines')
+Import ('user_options_dict')
+
+if sys.platform=='linux2' or sys.platform=='linux-i386':
+       ftgl_env.Append (CCFLAGS = ['-O2', '-ansi'])
+elif sys.platform=='win32':
+       ftgl_env.Append (CCFLAGS = ['/O2'])
+elif sys.platform=='sunos':
+       ftgl_env.Append (CCFLAGS = ['Xc', '-v', '-fast'])
+elif sys.platform=='darwin':
+       ftgl_env.Append (CCFLAGS = ['-O2', '-pipe', '-fPIC', '-funsigned-char', '-ffast-math', '-mpowerpc' , '-mtune=G4'])
+else:
+       ftgl_env.Append (CCFLAGS = cflags)
+
+ftgl_env.Append (CPPDEFINES = defines)
+ftgl_env.Append (CPPPATH = ['include',
+                             'src'])
+
+ftgl_env.Append (CPPPATH = user_options_dict['FREETYPE_INCLUDE'])
+
+source_files = [
+               'src/FTBitmapGlyph.cpp',
+               'src/FTCharmap.cpp',
+               'src/FTContour.cpp',
+               'src/FTExtrdGlyph.cpp',
+               'src/FTFace.cpp',
+               'src/FTFont.cpp',
+               'src/FTGLBitmapFont.cpp',
+               'src/FTGLExtrdFont.cpp',
+               'src/FTGLOutlineFont.cpp',
+               'src/FTGLPixmapFont.cpp',
+               'src/FTGLPolygonFont.cpp',
+               'src/FTGLTextureFont.cpp',
+               'src/FTGlyph.cpp',
+               'src/FTGlyphContainer.cpp',
+               'src/FTLibrary.cpp',
+               'src/FTOutlineGlyph.cpp',
+               'src/FTPixmapGlyph.cpp',
+               'src/FTPoint.cpp',
+               'src/FTPolyGlyph.cpp',
+               'src/FTSize.cpp',
+               'src/FTTextureGlyph.cpp',
+               'src/FTVectoriser.cpp']
+
+ftgl_env.Library (target='#'+user_options_dict['BUILD_DIR']+'/lib/extern_ftgl', source=source_files)
index 5c87b8d34528b153ade2969503202410999de312..927ca3a6a0d73a796bd774c87f8108d2487d57ae 100644 (file)
@@ -1,7 +1,8 @@
 #!/usr/bin/python
 import sys
+import os
 
-qhull_env = Environment()
+qhull_env = Environment(ENV = os.environ)
 
 # Import the C flags set in the SConstruct file
 Import ('cflags')
index 12996b6a7ff609415291916819f7cf500bd95c11..00402d640e807a980540335aff43388a802b7f51 100644 (file)
@@ -1,6 +1,8 @@
 #!/usr/bin/python
 import sys
-solid_env = Environment()
+import os
+
+solid_env = Environment(ENV = os.environ)
 
 # Import the C flags set in the SConstruct file
 Import ('cflags')
index 4046819ffd57aa0eedfe8b7e1c9ca3b506398b85..10c7eda9730c6fc97f31fcbe829c5840bdfcda34 100644 (file)
@@ -1,5 +1,6 @@
 #!/usr/bin/python
 import sys
+import os
 
 Import ('cflags')
 Import ('defines')
@@ -8,7 +9,7 @@ Import ('user_options_dict')
 # TODO: make sure the makesdna program does not get installed on the system.
 source_files = ['makesdna.c']
 
-makesdna_tool = Environment (CCFLAGS='-DBASE_HEADER="\\"source/blender/makesdna/\\"" ')
+makesdna_tool = Environment (ENV = os.environ, CCFLAGS='-DBASE_HEADER="\\"source/blender/makesdna/\\"" ')
 
 makesdna_tool.Append (CPPPATH = ['#/intern/guardedalloc',
                                  '..'])
index 3783b926dfb9f7286d3082bb0b1e60364a4b6334..aa6b39967230112af87b4606aa179a98741116d9 100644 (file)
@@ -41,8 +41,11 @@ def international_libs(env):
                env.Append (LIBS=bs_globals.user_options_dict['FREETYPE_LIBRARY'])
                env.Append (LIBPATH=bs_globals.user_options_dict['FREETYPE_LIBPATH'])
                env.Append (LIBS=['blender_FTF'])
-               env.Append (LIBS=bs_globals.user_options_dict['FTGL_LIBRARY'])
-               env.Append (LIBPATH=bs_globals.user_options_dict['FTGL_LIBPATH'])
+               if sys.platform=='darwin':
+                       env.Append (LIBS=bs_globals.user_options_dict['FTGL_LIBRARY'])
+                       env.Append (LIBPATH=bs_globals.user_options_dict['FTGL_LIBPATH'])
+               else:
+                       env.Append (LIBS=['extern_ftgl'])
                env.Append (LIBS=bs_globals.user_options_dict['FREETYPE_LIBRARY'])
 
 def blender_libs(env):