Skip to content
Snippets Groups Projects
Commit bcd5d1c9 authored by Nathan Letwory's avatar Nathan Letwory
Browse files

* integrate bFTGL with Scons

* 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.
parent c68c3c25
Branches
Tags
No related merge requests found
...@@ -49,12 +49,12 @@ if os.path.isdir (bs_globals.root_build_dir) == 0: ...@@ -49,12 +49,12 @@ if os.path.isdir (bs_globals.root_build_dir) == 0:
version='2.36' version='2.36'
shortversion = '236' # for wininst target -> nsis installer creation shortversion = '236' # for wininst target -> nsis installer creation
sdl_env = Environment () sdl_env = Environment (ENV = os.environ)
freetype_env = Environment () freetype_env = Environment (ENV = os.environ)
env = Environment () env = Environment (ENV = os.environ)
if sys.platform == 'linux2' or sys.platform == 'linux-i386': if sys.platform == 'linux2' or sys.platform == 'linux-i386':
use_international = 'false' use_international = 'true'
use_gameengine = 'true' use_gameengine = 'true'
use_openal = 'false' use_openal = 'false'
use_fmod = 'false' use_fmod = 'false'
...@@ -101,11 +101,11 @@ if sys.platform == 'linux2' or sys.platform == 'linux-i386': ...@@ -101,11 +101,11 @@ if sys.platform == 'linux2' or sys.platform == 'linux-i386':
sdl_libpath = sdl_env.Dictionary()['LIBPATH'] sdl_libpath = sdl_env.Dictionary()['LIBPATH']
sdl_lib = sdl_env.Dictionary()['LIBS'] sdl_lib = sdl_env.Dictionary()['LIBS']
# SOLID library information # SOLID library information
solid_lib = [] # TODO solid_lib = []
solid_libpath = [] # TODO solid_libpath = []
solid_include = ['#extern/solid'] solid_include = ['#extern/solid']
qhull_lib = [] # TODO qhull_lib = []
qhull_libpath = [] # TODO qhull_libpath = []
qhull_include = ['#extern/qhull/include'] qhull_include = ['#extern/qhull/include']
# ODE library information # ODE library information
ode_lib = ['ode'] ode_lib = ['ode']
...@@ -117,9 +117,9 @@ if sys.platform == 'linux2' or sys.platform == 'linux-i386': ...@@ -117,9 +117,9 @@ if sys.platform == 'linux2' or sys.platform == 'linux-i386':
python_include = [sysconfig.get_python_inc ()] python_include = [sysconfig.get_python_inc ()]
python_linkflags = Split (sysconfig.get_config_var('LINKFORSHARED')) python_linkflags = Split (sysconfig.get_config_var('LINKFORSHARED'))
# International support information # International support information
ftgl_lib = ['ftgl'] ftgl_lib = []
ftgl_libpath = ['#../lib/linux-glibc2.2.5-i386/ftgl/lib'] ftgl_libpath = []
ftgl_include = ['#../lib/linux-glibc2.2.5-i386/ftgl/include'] ftgl_include = ['#extern/bFTGL/include']
freetype_env.ParseConfig ('pkg-config --cflags --libs freetype2 2>/dev/null || freetype-config --cflags --libs 2>/dev/null') 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_lib = freetype_env.Dictionary()['LIBS']
freetype_libpath = freetype_env.Dictionary()['LIBPATH'] freetype_libpath = freetype_env.Dictionary()['LIBPATH']
...@@ -231,9 +231,9 @@ elif sys.platform == 'darwin': ...@@ -231,9 +231,9 @@ elif sys.platform == 'darwin':
'-framework', 'IOKit' , '-framework', 'IOKit' ,
'-framework', 'AppKit'] '-framework', 'AppKit']
# International stuff # International stuff
ftgl_lib = ['ftgl'] ftgl_lib = []
ftgl_libpath = [darwin_precomp + 'ftgl/lib'] ftgl_libpath = []
ftgl_include = [darwin_precomp + 'ftgl/include'] ftgl_include = ['#extern/bFTGL/include']
freetype_lib = ['libfreetype'] freetype_lib = ['libfreetype']
freetype_libpath = [darwin_precomp + 'freetype/lib'] freetype_libpath = [darwin_precomp + 'freetype/lib']
freetype_include = [darwin_precomp + 'freetype/include'] freetype_include = [darwin_precomp + 'freetype/include']
...@@ -295,11 +295,11 @@ elif sys.platform == 'cygwin': ...@@ -295,11 +295,11 @@ elif sys.platform == 'cygwin':
sdl_cflags = [] sdl_cflags = []
#sdl_cflags = '-DWIN32' #sdl_cflags = '-DWIN32'
# SOLID library information # SOLID library information
solid_lib = [] # TODO solid_lib = []
solid_libpath = [] # TODO solid_libpath = []
solid_include = ['#extern/solid'] solid_include = ['#extern/solid']
qhull_lib = [] # TODO qhull_lib = []
qhull_libpath = [] # TODO qhull_libpath = []
qhull_include = ['#extern/qhull/include'] qhull_include = ['#extern/qhull/include']
# ODE library information # ODE library information
ode_lib = ['ode'] ode_lib = ['ode']
...@@ -311,9 +311,9 @@ elif sys.platform == 'cygwin': ...@@ -311,9 +311,9 @@ elif sys.platform == 'cygwin':
python_lib = ['python22'] python_lib = ['python22']
python_linkflags = [] python_linkflags = []
# International stuff # International stuff
ftgl_lib = ['ftgl'] ftgl_lib = []
ftgl_libpath = ['#../lib/windows/gcc/ftgl/lib'] ftgl_libpath = []
ftgl_include = ['#../lib/windows/gcc/ftgl/include'] ftgl_include = ['#extern/bFTGL/include']
freetype_lib = ['freetype'] freetype_lib = ['freetype']
freetype_libpath = ['#../lib/windows/gcc/freetype/lib'] freetype_libpath = ['#../lib/windows/gcc/freetype/lib']
freetype_include = ['#../lib/windows/gcc/freetype/include'] freetype_include = ['#../lib/windows/gcc/freetype/include']
...@@ -412,9 +412,9 @@ elif sys.platform == 'win32': ...@@ -412,9 +412,9 @@ elif sys.platform == 'win32':
python_lib = ['python23'] python_lib = ['python23']
python_linkflags = [] python_linkflags = []
# International stuff # International stuff
ftgl_lib = ['ftgl_static_ST'] ftgl_lib = []
ftgl_libpath = ['#../lib/windows/ftgl/lib'] ftgl_libpath = []
ftgl_include = ['#../lib/windows/ftgl/include'] ftgl_include = ['#extern/bFTGL/include']
freetype_lib = ['freetype2ST'] freetype_lib = ['freetype2ST']
freetype_libpath = ['#../lib/windows/freetype/lib'] freetype_libpath = ['#../lib/windows/freetype/lib']
freetype_include = ['#../lib/windows/freetype/include'] freetype_include = ['#../lib/windows/freetype/include']
...@@ -474,15 +474,15 @@ elif string.find (sys.platform, 'sunos') != -1: ...@@ -474,15 +474,15 @@ elif string.find (sys.platform, 'sunos') != -1:
sdl_libpath = sdl_env.Dictionary()['LIBPATH'] sdl_libpath = sdl_env.Dictionary()['LIBPATH']
sdl_lib = sdl_env.Dictionary()['LIBS'] sdl_lib = sdl_env.Dictionary()['LIBS']
# SOLID library information # SOLID library information
solid_lib = [] # TODO solid_lib = []
solid_libpath = [] # TODO solid_libpath = []
solid_include = ['#extern/solid'] solid_include = ['#extern/solid']
qhull_lib = [] # TODO qhull_lib = []
qhull_libpath = [] # TODO qhull_libpath = []
qhull_include = ['#extern/qhull/include'] qhull_include = ['#extern/qhull/include']
# ODE library information # ODE library information
ode_lib = [] # TODO ode_lib = []
ode_libpath = [] # TODO ode_libpath = []
ode_include = ['#extern/ode/dist/include/ode'] ode_include = ['#extern/ode/dist/include/ode']
# Python variables. # Python variables.
python_lib = ['python%d.%d' % sys.version_info[0:2]] python_lib = ['python%d.%d' % sys.version_info[0:2]]
...@@ -490,9 +490,9 @@ elif string.find (sys.platform, 'sunos') != -1: ...@@ -490,9 +490,9 @@ elif string.find (sys.platform, 'sunos') != -1:
python_include = [sysconfig.get_python_inc ()] python_include = [sysconfig.get_python_inc ()]
python_linkflags = [] python_linkflags = []
# International support information # International support information
ftgl_lib = ['ftgl'] ftgl_lib = []
ftgl_libpath = ['#../lib/solaris-2.8-sparc/ftgl/lib'] ftgl_libpath = []
ftgl_include = ['#../lib/solaris-2.8-sparc/ftgl/include'] ftgl_include = ['#extern/bFTGL/include']
freetype_lib = ['freetype'] freetype_lib = ['freetype']
freetype_libpath = ['#../lib/solaris-2.8-sparc/freetype/lib'] freetype_libpath = ['#../lib/solaris-2.8-sparc/freetype/lib']
freetype_include = ['#../lib/solaris-2.8-sparc/freetype/include'] freetype_include = ['#../lib/solaris-2.8-sparc/freetype/include']
...@@ -559,15 +559,15 @@ elif string.find (sys.platform, 'irix') != -1: ...@@ -559,15 +559,15 @@ elif string.find (sys.platform, 'irix') != -1:
sdl_libpath = [irix_precomp + '/sdl/lib'] sdl_libpath = [irix_precomp + '/sdl/lib']
sdl_lib = ['SDL', 'libSDL.a'] sdl_lib = ['SDL', 'libSDL.a']
# SOLID library information # SOLID library information
solid_lib = [] # TODO solid_lib = []
solid_libpath = [] # TODO solid_libpath = []
solid_include = [irix_precomp + '/solid/include'] solid_include = [irix_precomp + '/solid/include']
qhull_lib = [] # TODO qhull_lib = []
qhull_libpath = [] # TODO qhull_libpath = []
qhull_include = ['#extern/qhull/include'] qhull_include = ['#extern/qhull/include']
# ODE library information # ODE library information
ode_lib = [] # TODO ode_lib = []
ode_libpath = [] # TODO ode_libpath = []
ode_include = [irix_precomp + '/ode/include'] ode_include = [irix_precomp + '/ode/include']
# Python library information # Python library information
python_libpath = [irix_precomp + '/python/lib/python2.2/config'] python_libpath = [irix_precomp + '/python/lib/python2.2/config']
...@@ -575,9 +575,9 @@ elif string.find (sys.platform, 'irix') != -1: ...@@ -575,9 +575,9 @@ elif string.find (sys.platform, 'irix') != -1:
python_lib = ['python2.2'] python_lib = ['python2.2']
python_linkflags = [] python_linkflags = []
# International support information # International support information
ftgl_lib = ['ftgl'] ftgl_lib = []
ftgl_libpath = [irix_precomp + '/ftgl/lib'] ftgl_libpath = []
ftgl_include = [irix_precomp + '/ftgl/include'] ftgl_include = ['#extern/bFTGL/include']
freetype_lib = ['freetype'] freetype_lib = ['freetype']
freetype_libpath = [irix_precomp + '/freetype/lib'] freetype_libpath = [irix_precomp + '/freetype/lib']
freetype_include = [irix_precomp + '/freetype/include'] freetype_include = [irix_precomp + '/freetype/include']
...@@ -641,11 +641,11 @@ elif sys.platform=='openbsd3': ...@@ -641,11 +641,11 @@ elif sys.platform=='openbsd3':
sdl_libpath = sdl_env.Dictionary()['LIBPATH'] sdl_libpath = sdl_env.Dictionary()['LIBPATH']
sdl_lib = sdl_env.Dictionary()['LIBS'] sdl_lib = sdl_env.Dictionary()['LIBS']
# SOLID library information # SOLID library information
solid_lib = [] # TODO solid_lib = []
solid_libpath = [] # TODO solid_libpath = []
solid_include = ['#extern/solid'] solid_include = ['#extern/solid']
qhull_lib = [] # TODO qhull_lib = []
qhull_libpath = [] # TODO qhull_libpath = []
qhull_include = ['#extern/qhull/include'] qhull_include = ['#extern/qhull/include']
# ODE library information # ODE library information
ode_lib = ['ode'] ode_lib = ['ode']
...@@ -657,9 +657,9 @@ elif sys.platform=='openbsd3': ...@@ -657,9 +657,9 @@ elif sys.platform=='openbsd3':
python_include = [sysconfig.get_python_inc ()] python_include = [sysconfig.get_python_inc ()]
python_linkflags = [] python_linkflags = []
# International support information # International support information
ftgl_lib = ['ftgl'] ftgl_lib = []
ftgl_libpath = ['#../lib/linux-glibc2.2.5-i386/ftgl/lib'] ftgl_libpath = []
ftgl_include = ['#../lib/linux-glibc2.2.5-i386/ftgl/include'] ftgl_include = ['#extern/bFTGL/include']
freetype_env.ParseConfig('pkg-config --cflags --libs freetype2') freetype_env.ParseConfig('pkg-config --cflags --libs freetype2')
freetype_lib = freetype_env.Dictionary()['LIBS'] freetype_lib = freetype_env.Dictionary()['LIBS']
freetype_libpath = freetype_env.Dictionary()['LIBPATH'] freetype_libpath = freetype_env.Dictionary()['LIBPATH']
...@@ -720,11 +720,11 @@ elif sys.platform=='freebsd4' or sys.platform=='freebsd5': ...@@ -720,11 +720,11 @@ elif sys.platform=='freebsd4' or sys.platform=='freebsd5':
sdl_libpath = ['/usr/local/include/SDL11'] sdl_libpath = ['/usr/local/include/SDL11']
sdl_lib = sdl_env.Dictionary()['LIBS'] sdl_lib = sdl_env.Dictionary()['LIBS']
# SOLID library information # SOLID library information
solid_lib = [] # TODO solid_lib = []
solid_libpath = [] # TODO solid_libpath = []
solid_include = ['#extern/solid'] solid_include = ['#extern/solid']
qhull_lib = [] # TODO qhull_lib = []
qhull_libpath = [] # TODO qhull_libpath = []
qhull_include = ['#extern/qhull/include'] qhull_include = ['#extern/qhull/include']
# ODE library information # ODE library information
ode_lib = ['ode'] ode_lib = ['ode']
...@@ -736,9 +736,9 @@ elif sys.platform=='freebsd4' or sys.platform=='freebsd5': ...@@ -736,9 +736,9 @@ elif sys.platform=='freebsd4' or sys.platform=='freebsd5':
python_include = [sysconfig.get_python_inc ()] python_include = [sysconfig.get_python_inc ()]
python_linkflags = [] python_linkflags = []
# International support information # International support information
ftgl_lib = ['ftgl'] ftgl_lib = []
ftgl_libpath = ['#../lib/linux-glibc2.2.5-i386/ftgl/lib'] ftgl_libpath = []
ftgl_include = ['#../lib/linux-glibc2.2.5-i386/ftgl/include'] ftgl_include = ['#extern/bFTGL/include']
freetype_env.ParseConfig('pkg-config --cflags --libs freetype2') freetype_env.ParseConfig('pkg-config --cflags --libs freetype2')
freetype_lib = freetype_env.Dictionary()['LIBS'] freetype_lib = freetype_env.Dictionary()['LIBS']
freetype_libpath = freetype_env.Dictionary()['LIBPATH'] freetype_libpath = freetype_env.Dictionary()['LIBPATH']
...@@ -863,7 +863,7 @@ else: ...@@ -863,7 +863,7 @@ else:
#----------------------------------------------------------------------------- #-----------------------------------------------------------------------------
list_opts = [] list_opts = []
user_options = Options (bs_globals.config_file) 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 ( user_options.AddOptions (
('VERSION', 'Blender version', version), ('VERSION', 'Blender version', version),
(EnumOption ('BUILD_BINARY', 'release', (EnumOption ('BUILD_BINARY', 'release',
...@@ -965,7 +965,7 @@ user_options_dict = user_options_env.Dictionary() ...@@ -965,7 +965,7 @@ user_options_dict = user_options_env.Dictionary()
Help(user_options.GenerateHelpText(user_options_env)) Help(user_options.GenerateHelpText(user_options_env))
bs_globals.root_build_dir = user_options_dict['BUILD_DIR'] bs_globals.root_build_dir = user_options_dict['BUILD_DIR']
# SET MODULE VARS # # SET MODULE VARS #
init_env = Environment() init_env = Environment(ENV = os.environ)
bs_globals.user_options_dict = user_options_dict bs_globals.user_options_dict = user_options_dict
bs_globals.init_env = init_env bs_globals.init_env = init_env
...@@ -1108,7 +1108,7 @@ if bs_globals.enable_clean == 0: ...@@ -1108,7 +1108,7 @@ if bs_globals.enable_clean == 0:
if sys.platform=='win32': if sys.platform=='win32':
if user_options_dict['BUILD_BINARY']=='debug': if user_options_dict['BUILD_BINARY']=='debug':
browser = Environment() browser = Environment(ENV = os.environ)
browser_tmp = bs_globals.root_build_dir+'bscmake.tmp' browser_tmp = bs_globals.root_build_dir+'bscmake.tmp'
browser.Command ('blender.bsc', 'blender$PROGSUFFIX', browser.Command ('blender.bsc', 'blender$PROGSUFFIX',
['dir /b/s '+bs_globals.root_build_dir+'*.sbr >'+browser_tmp, ['dir /b/s '+bs_globals.root_build_dir+'*.sbr >'+browser_tmp,
...@@ -1136,7 +1136,7 @@ if bs_globals.enable_clean == 0: ...@@ -1136,7 +1136,7 @@ if bs_globals.enable_clean == 0:
player_blender.Program (target='blenderplayer', source=d_obj) player_blender.Program (target='blenderplayer', source=d_obj)
if sys.platform=='win32': if sys.platform=='win32':
if user_options_dict['BUILD_BINARY']=='debug': if user_options_dict['BUILD_BINARY']=='debug':
browser = Environment() browser = Environment(ENV = os.environ)
browser_tmp = bs_globals.root_build_dir+'bscmake.tmp' browser_tmp = bs_globals.root_build_dir+'bscmake.tmp'
browser.Command ('blenderplayer.bsc', 'blenderplayer$PROGSUFFIX', browser.Command ('blenderplayer.bsc', 'blenderplayer$PROGSUFFIX',
['dir /b/s '+bs_globals.root_build_dir+'*.sbr >'+browser_tmp, ['dir /b/s '+bs_globals.root_build_dir+'*.sbr >'+browser_tmp,
......
#!/usr/bin/python #!/usr/bin/python
Import('user_options_dict')
print "externs..."
SConscript(['qhull/SConscript', SConscript(['qhull/SConscript',
'solid/SConscript']) 'solid/SConscript'])
if user_options_dict['USE_INTERNATIONAL'] == 1:
print "bftgl"
SConscript(['bFTGL/SConscript'])
\ No newline at end of file
#!/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)
#!/usr/bin/python #!/usr/bin/python
import sys import sys
import os
qhull_env = Environment() qhull_env = Environment(ENV = os.environ)
# Import the C flags set in the SConstruct file # Import the C flags set in the SConstruct file
Import ('cflags') Import ('cflags')
......
#!/usr/bin/python #!/usr/bin/python
import sys import sys
solid_env = Environment() import os
solid_env = Environment(ENV = os.environ)
# Import the C flags set in the SConstruct file # Import the C flags set in the SConstruct file
Import ('cflags') Import ('cflags')
......
#!/usr/bin/python #!/usr/bin/python
import sys import sys
import os
Import ('cflags') Import ('cflags')
Import ('defines') Import ('defines')
...@@ -8,7 +9,7 @@ Import ('user_options_dict') ...@@ -8,7 +9,7 @@ Import ('user_options_dict')
# TODO: make sure the makesdna program does not get installed on the system. # TODO: make sure the makesdna program does not get installed on the system.
source_files = ['makesdna.c'] 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', makesdna_tool.Append (CPPPATH = ['#/intern/guardedalloc',
'..']) '..'])
......
...@@ -41,8 +41,11 @@ def international_libs(env): ...@@ -41,8 +41,11 @@ def international_libs(env):
env.Append (LIBS=bs_globals.user_options_dict['FREETYPE_LIBRARY']) env.Append (LIBS=bs_globals.user_options_dict['FREETYPE_LIBRARY'])
env.Append (LIBPATH=bs_globals.user_options_dict['FREETYPE_LIBPATH']) env.Append (LIBPATH=bs_globals.user_options_dict['FREETYPE_LIBPATH'])
env.Append (LIBS=['blender_FTF']) env.Append (LIBS=['blender_FTF'])
if sys.platform=='darwin':
env.Append (LIBS=bs_globals.user_options_dict['FTGL_LIBRARY']) env.Append (LIBS=bs_globals.user_options_dict['FTGL_LIBRARY'])
env.Append (LIBPATH=bs_globals.user_options_dict['FTGL_LIBPATH']) 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']) env.Append (LIBS=bs_globals.user_options_dict['FREETYPE_LIBRARY'])
def blender_libs(env): def blender_libs(env):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment