2009-08-28 13:27:15 -04:00
|
|
|
|
|
|
|
|
import os
|
|
|
|
|
|
|
|
|
|
def insert( env , options ):
|
|
|
|
|
|
|
|
|
|
if not foundxulrunner( env , options ):
|
2009-11-20 14:24:20 -05:00
|
|
|
if os.path.exists( "usr/include/mozjs/" ):
|
|
|
|
|
env.Append( CPPDEFINES=[ "MOZJS" ] )
|
2009-08-28 13:27:15 -04:00
|
|
|
|
|
|
|
|
|
|
|
|
|
def foundxulrunner( env , options ):
|
|
|
|
|
best = None
|
|
|
|
|
|
|
|
|
|
for x in os.listdir( "/usr/include" ):
|
|
|
|
|
if x.find( "xulrunner" ) != 0:
|
|
|
|
|
continue
|
|
|
|
|
if x == "xulrunner":
|
|
|
|
|
best = x
|
|
|
|
|
break
|
|
|
|
|
best = x
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if best is None:
|
|
|
|
|
print( "warning: using ubuntu without xulrunner-dev. we reccomend installing it" )
|
|
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
incroot = "/usr/include/" + best + "/"
|
|
|
|
|
libroot = "/usr/lib"
|
2009-10-12 14:20:52 -04:00
|
|
|
if options["linux64"] and os.path.exists("/usr/lib64"):
|
2009-08-28 13:27:15 -04:00
|
|
|
libroot += "64";
|
|
|
|
|
libroot += "/" + best
|
2009-10-12 14:20:52 -04:00
|
|
|
|
2009-08-28 13:27:15 -04:00
|
|
|
|
2009-08-29 21:17:34 -04:00
|
|
|
if not os.path.exists( libroot ):
|
|
|
|
|
print( "warning: found xulrunner include but not lib for: " + best )
|
2009-08-28 13:27:15 -04:00
|
|
|
return False
|
|
|
|
|
|
|
|
|
|
env.Prepend( LIBPATH=[ libroot ] )
|
|
|
|
|
env.Prepend( RPATH=[ libroot ] )
|
|
|
|
|
|
|
|
|
|
env.Prepend( CPPPATH=[ incroot + "stable/" ,
|
2010-04-15 10:15:10 -04:00
|
|
|
incroot + "unstable/" ,
|
|
|
|
|
incroot ] )
|
|
|
|
|
env.Prepend( CPPPATH=[ "/usr/include/nspr/" ] )
|
2009-08-28 13:27:15 -04:00
|
|
|
|
2009-09-03 14:48:47 -04:00
|
|
|
env.Append( CPPDEFINES=[ "XULRUNNER" , "OLDJS" ] )
|
2010-01-27 11:25:57 -05:00
|
|
|
if best.find( "1.9.0" ) >= 0 or best.endswith("1.9"):
|
2010-04-15 11:49:16 -04:00
|
|
|
if best.endswith( "1.9.1.9" ):
|
|
|
|
|
pass
|
|
|
|
|
else:
|
|
|
|
|
env.Append( CPPDEFINES=[ "XULRUNNER190" ] )
|
2009-08-28 13:27:15 -04:00
|
|
|
return True
|