Commit 8371b7b5c0d97e713c9d74e0f8bbfd66e17d377d
- Diff rendering mode:
- inline
- side by side
SConstruct
(13 / 6)
|   | |||
| 3 | 3 | ||
| 4 | 4 | EnsureSConsVersion(1, 0) | |
| 5 | 5 | ||
| 6 | # FIXME: sometimes it would be good to build for a different python | ||
| 7 | # version than the one running scons. (But how to find all paths then?) | ||
| 6 | 8 | python = 'python%d.%d' % (sys.version_info[0], sys.version_info[1]) | |
| 7 | 9 | print 'Building for', python | |
| 8 | 10 | ||
| … | … | ||
| 17 | 17 | ||
| 18 | 18 | SConsignFile() # no .scsonsign into $PREFIX please | |
| 19 | 19 | ||
| 20 | # Does option parsing really screw up the win32 build? if no, remove comment | ||
| 21 | #if sys.platform == "win32": | ||
| 22 | # env = Environment(ENV=os.environ) | ||
| 23 | #else: | ||
| 20 | if sys.platform == "darwin": | ||
| 21 | default_prefix = '/opt/local/' | ||
| 22 | else: | ||
| 23 | default_prefix = '/usr/local/' | ||
| 24 | 24 | ||
| 25 | 25 | opts = Variables() | |
| 26 | opts.Add(PathVariable('prefix', 'autotools-style installation prefix', '/usr/local', validator=PathVariable.PathIsDirCreate)) | ||
| 26 | opts.Add(PathVariable('prefix', 'autotools-style installation prefix', default_prefix, validator=PathVariable.PathIsDirCreate)) | ||
| 27 | |||
| 27 | 28 | opts.Add(BoolVariable('debug', 'enable HEAVY_DEBUG and disable optimizations', False)) | |
| 28 | 29 | env = Environment(ENV=os.environ, options=opts) | |
| 29 | 30 | if sys.platform == "win32": | |
| … | … | ||
| 43 | 43 | if sys.platform == "win32": | |
| 44 | 44 | env.ParseConfig('pkg-config --cflags --libs python25') # These two '.pc' files you probably have to make for yourself. | |
| 45 | 45 | env.ParseConfig('pkg-config --cflags --libs numpy') # Place them among the other '.pc' files ( where the 'glib-2.0.pc' is located .. probably ) | |
| 46 | elif sys.platform == "darwin": | ||
| 47 | env.ParseConfig('python-config --cflags') | ||
| 48 | env.ParseConfig('python-config --ldflags') | ||
| 46 | 49 | else: | |
| 47 | 50 | # some distros use python2.5-config, others python-config2.5 | |
| 48 | 51 | try: | |
| 49 | 52 | env.ParseConfig(python + '-config --cflags --ldflags') | |
| 50 | 53 | except OSError: | |
| 51 | 54 | print 'going to try python-config instead' | |
| 52 | env.ParseConfig('python-config --cflags --ldflags') | ||
| 55 | env.ParseConfig('python-config --ldflags') | ||
| 56 | env.ParseConfig('python-config --cflags') | ||
| 53 | 57 | ||
| 54 | 58 | if env.get('CPPDEFINES'): | |
| 55 | 59 | # make sure assertions are enabled |
lib/SConscript
(2 / 0)
|   | |||
| 14 | 14 | src = 'mypaintlib_wrap.cpp' | |
| 15 | 15 | if sys.platform == "win32": # there 's a better way to do this | |
| 16 | 16 | module = env.LoadableModule('_mypaintlib', Split(src), SHLIBPREFIX="", SHLIBSUFFIX=".pyd") | |
| 17 | elif sys.platform == "darwin": | ||
| 18 | module = env.LoadableModule('_mypaintlib', Split(src), SHLIBPREFIX="", SHLIBSUFFIX=".so") | ||
| 17 | 19 | else: | |
| 18 | 20 | module = env.LoadableModule('_mypaintlib', Split(src), SHLIBPREFIX="") | |
| 19 | 21 |

