From a13fe7da0614799a03c8fb16828f9c3bf2ca8d49 Mon Sep 17 00:00:00 2001 From: Dane Springmeyer Date: Tue, 13 Aug 2013 20:02:14 -0400 Subject: [PATCH] fix 'the table of contents is empty' error when cross compiling for android by respecting RANLIB and AR settings from environment --- SConstruct | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/SConstruct b/SConstruct index 989954c37..89a8e3850 100644 --- a/SConstruct +++ b/SConstruct @@ -114,10 +114,17 @@ PLUGINS = { # plugins with external dependencies } +def init_environment(env): + env.Decider('MD5-timestamp') + env.SourceCode(".", None) + if os.environ.get('RANLIB'): + env['RANLIB'] = os.environ['RANLIB'] + if os.environ.get('AR'): + env['AR'] = os.environ['AR'] + #### SCons build options and initial setup #### env = Environment(ENV=os.environ) -env.Decider('MD5-timestamp') -env.SourceCode(".", None) +init_environment(env) def color_print(color,text,newline=True): # 1 - red @@ -1032,8 +1039,7 @@ if not preconfigured: color_print(1,"SCons CONFIG not found: '%s'" % conf) # Recreate the base environment using modified `opts` env = Environment(ENV=os.environ,options=opts) - env.Decider('MD5-timestamp') - env.SourceCode(".", None) + init_environment(env) env['USE_CONFIG'] = True else: color_print(4,'SCons USE_CONFIG specified as false, will not inherit variables python config file...')