scons: sf bug#625: use PKG_CONFIG_PATH and PKG_CONFIG_LIBDIR from user environment; resolves homebrew OSX compilation issues on various systems
This commit is contained in:
parent
ed1a068d4f
commit
09d861b55c
|
@ -62,6 +62,10 @@ if os.environ.has_key('CPPFLAGS'):
|
||||||
env.Append(CPPFLAGS = os.environ['CPPFLAGS'].split())
|
env.Append(CPPFLAGS = os.environ['CPPFLAGS'].split())
|
||||||
if os.environ.has_key('LDFLAGS'):
|
if os.environ.has_key('LDFLAGS'):
|
||||||
env.Append(LINKFLAGS = os.environ['LDFLAGS'].split())
|
env.Append(LINKFLAGS = os.environ['LDFLAGS'].split())
|
||||||
|
if os.environ.has_key('PKG_CONFIG_PATH'):
|
||||||
|
env['ENV']['PKG_CONFIG_PATH'] = os.environ['PKG_CONFIG_PATH']
|
||||||
|
if os.environ.has_key('PKG_CONFIG_LIBDIR'):
|
||||||
|
env['ENV']['PKG_CONFIG_LIBDIR'] = os.environ['PKG_CONFIG_LIBDIR']
|
||||||
|
|
||||||
print "platform: ", env['PLATFORM']
|
print "platform: ", env['PLATFORM']
|
||||||
|
|
||||||
|
@ -112,16 +116,12 @@ else:
|
||||||
Exit(1)
|
Exit(1)
|
||||||
# Add compiler and linker flags from pkg-config
|
# Add compiler and linker flags from pkg-config
|
||||||
config_string = 'pkg-config --cflags --libs gtk+-2.0'
|
config_string = 'pkg-config --cflags --libs gtk+-2.0'
|
||||||
if env['PLATFORM'] == 'darwin':
|
|
||||||
config_string = 'PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ ' + config_string
|
|
||||||
env.ParseConfig(config_string)
|
env.ParseConfig(config_string)
|
||||||
env.Append(CPPDEFINES=["_GTK2"])
|
env.Append(CPPDEFINES=["_GTK2"])
|
||||||
env.Append(CCFLAGS = ["-D_GTK"])
|
env.Append(CCFLAGS = ["-D_GTK"])
|
||||||
if env['GTK3']:
|
if env['GTK3']:
|
||||||
# Add compiler and linker flags from pkg-config
|
# Add compiler and linker flags from pkg-config
|
||||||
config_string = 'pkg-config --cflags --libs gtk+-3.0'
|
config_string = 'pkg-config --cflags --libs gtk+-3.0'
|
||||||
if env['PLATFORM'] == 'darwin':
|
|
||||||
config_string = 'PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ ' + config_string
|
|
||||||
env.ParseConfig(config_string)
|
env.ParseConfig(config_string)
|
||||||
env.Append(CPPDEFINES=["_GTK3"])
|
env.Append(CPPDEFINES=["_GTK3"])
|
||||||
env.Append(CCFLAGS = ["-D_GTK"])
|
env.Append(CCFLAGS = ["-D_GTK"])
|
||||||
|
|
|
@ -2,8 +2,6 @@
|
||||||
# Thanks Antonio Ospite!
|
# Thanks Antonio Ospite!
|
||||||
Import('env')
|
Import('env')
|
||||||
config_string = 'pkg-config --cflags --libs x11'
|
config_string = 'pkg-config --cflags --libs x11'
|
||||||
if env['PLATFORM'] == 'darwin':
|
|
||||||
config_string = 'PKG_CONFIG_PATH=/opt/X11/lib/pkgconfig/ ' + config_string
|
|
||||||
env.ParseConfig(config_string)
|
env.ParseConfig(config_string)
|
||||||
Export('env')
|
Export('env')
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue