Commit 8371b7b5c0d97e713c9d74e0f8bbfd66e17d377d

build: some darvin specific stuff

http://forum.intilinux.com/mypaint-development-and-suggestions/mac-osx-port/15/
http://www.zhadum.ch/osx.diff
SConstruct
(13 / 6)
  
33
44EnsureSConsVersion(1, 0)
55
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?)
68python = 'python%d.%d' % (sys.version_info[0], sys.version_info[1])
79print 'Building for', python
810
1717
1818SConsignFile() # no .scsonsign into $PREFIX please
1919
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:
20if sys.platform == "darwin":
21 default_prefix = '/opt/local/'
22else:
23 default_prefix = '/usr/local/'
2424
2525opts = Variables()
26opts.Add(PathVariable('prefix', 'autotools-style installation prefix', '/usr/local', validator=PathVariable.PathIsDirCreate))
26opts.Add(PathVariable('prefix', 'autotools-style installation prefix', default_prefix, validator=PathVariable.PathIsDirCreate))
27
2728opts.Add(BoolVariable('debug', 'enable HEAVY_DEBUG and disable optimizations', False))
2829env = Environment(ENV=os.environ, options=opts)
2930if sys.platform == "win32":
4343if sys.platform == "win32":
4444 env.ParseConfig('pkg-config --cflags --libs python25') # These two '.pc' files you probably have to make for yourself.
4545 env.ParseConfig('pkg-config --cflags --libs numpy') # Place them among the other '.pc' files ( where the 'glib-2.0.pc' is located .. probably )
46elif sys.platform == "darwin":
47 env.ParseConfig('python-config --cflags')
48 env.ParseConfig('python-config --ldflags')
4649else:
4750 # some distros use python2.5-config, others python-config2.5
4851 try:
4952 env.ParseConfig(python + '-config --cflags --ldflags')
5053 except OSError:
5154 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')
5357
5458if env.get('CPPDEFINES'):
5559 # make sure assertions are enabled
  
1414src = 'mypaintlib_wrap.cpp'
1515if sys.platform == "win32": # there 's a better way to do this
1616 module = env.LoadableModule('_mypaintlib', Split(src), SHLIBPREFIX="", SHLIBSUFFIX=".pyd")
17elif sys.platform == "darwin":
18 module = env.LoadableModule('_mypaintlib', Split(src), SHLIBPREFIX="", SHLIBSUFFIX=".so")
1719else:
1820 module = env.LoadableModule('_mypaintlib', Split(src), SHLIBPREFIX="")
1921