1# This file is generated; do not edit. 2 3import os 4 5Import("env") 6 7env = env.Clone(COMPONENT_NAME='base', 8 TARGET_NAME='linux_versioninfo') 9 10configurations = { 11 'Debug' : { 12 'Append' : dict( 13 CCFLAGS = [ 14 '-Werror', 15 '-pthread', 16 '-fno-exceptions', 17 '-fno-asynchronous-unwind-tables', 18 '-fvisibility=hidden', 19 '-Wall', 20 '-D_FILE_OFFSET_BITS=64', 21 '-O0', 22 '-g' 23 ], 24 CPPDEFINES = [ 25 '__STDC_FORMAT_MACROS', 26 'CHROMIUM_BUILD', 27 '_DEBUG' 28 ], 29 CPPPATH = [ 30 env.Dir('$SRC_DIR/base/..'), 31 env.Dir('${SHARED_INTERMEDIATE_DIR}') 32 ], 33 CXXFLAGS = [ 34 '-fno-rtti', 35 '-fno-threadsafe-statics', 36 '-fvisibility-inlines-hidden' 37 ], 38 LINKFLAGS = [ 39 '-pthread', 40 '-rdynamic' 41 ], 42 ), 43 'FilterOut' : dict( 44 ), 45 'Replace' : dict( 46 FLOCK_LDMODULE = ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'], 47 FLOCK_LINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'], 48 FLOCK_SHLINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'], 49 IMPLICIT_COMMAND_DEPENDENCIES = '0', 50 LDMODULECOM = [['$FLOCK_LDMODULE', 51 '-o', 52 '$TARGET', 53 '$_LIBDIRFLAGS', 54 '$LDMODULEFLAGS', 55 '$SOURCES', 56 '-Wl,--start-group', 57 '$_LIBFLAGS', 58 '-Wl,--end-group']], 59 LIBPATH = ['$LIB_DIR'], 60 LINKCOM = [['$FLOCK_LINK', 61 '-o', 62 '$TARGET', 63 '$_LIBDIRFLAGS', 64 '$LINKFLAGS', 65 '$SOURCES', 66 '-Wl,--start-group', 67 '$_LIBFLAGS', 68 '-Wl,--end-group']], 69 SHLINKCOM = [['$FLOCK_SHLINK', 70 '-o', 71 '$TARGET', 72 '$_LIBDIRFLAGS', 73 '$SHLINKFLAGS', 74 '$SOURCES', 75 '-Wl,--start-group', 76 '$_LIBFLAGS', 77 '-Wl,--end-group']], 78 ), 79 'ImportExternal' : [ 80 'AS', 81 'CC', 82 'CXX', 83 'LINK', 84 ], 85 'PropagateExternal' : [ 86 'AS', 87 'CC', 88 'CCACHE_DIR', 89 'CXX', 90 'DISTCC_DIR', 91 'DISTCC_HOSTS', 92 'HOME', 93 'INCLUDE_SERVER_ARGS', 94 'INCLUDE_SERVER_PORT', 95 'LINK', 96 'CHROME_BUILD_TYPE', 97 'CHROMIUM_BUILD', 98 'OFFICIAL_BUILD', 99 ], 100 }, 101 'Release' : { 102 'Append' : dict( 103 CCFLAGS = [ 104 '-Werror', 105 '-pthread', 106 '-fno-exceptions', 107 '-fno-asynchronous-unwind-tables', 108 '-fvisibility=hidden', 109 '-Wall', 110 '-D_FILE_OFFSET_BITS=64', 111 '-O2', 112 '-fno-ident', 113 '-fdata-sections', 114 '-ffunction-sections' 115 ], 116 CPPDEFINES = [ 117 '__STDC_FORMAT_MACROS', 118 'CHROMIUM_BUILD', 119 'NDEBUG', 120 'NVALGRIND' 121 ], 122 CPPPATH = [ 123 env.Dir('$SRC_DIR/base/..'), 124 env.Dir('${SHARED_INTERMEDIATE_DIR}') 125 ], 126 CXXFLAGS = [ 127 '-fno-rtti', 128 '-fno-threadsafe-statics', 129 '-fvisibility-inlines-hidden' 130 ], 131 LINKFLAGS = [ 132 '-pthread', 133 '-Wl,--gc-sections' 134 ], 135 ), 136 'FilterOut' : dict( 137 ), 138 'Replace' : dict( 139 FLOCK_LDMODULE = ['flock', '$TOP_BUILDDIR/linker.lock', '$LDMODULE'], 140 FLOCK_LINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$LINK'], 141 FLOCK_SHLINK = ['flock', '$TOP_BUILDDIR/linker.lock', '$SHLINK'], 142 IMPLICIT_COMMAND_DEPENDENCIES = '0', 143 LDMODULECOM = [['$FLOCK_LDMODULE', 144 '-o', 145 '$TARGET', 146 '$_LIBDIRFLAGS', 147 '$LDMODULEFLAGS', 148 '$SOURCES', 149 '-Wl,--start-group', 150 '$_LIBFLAGS', 151 '-Wl,--end-group']], 152 LIBPATH = ['$LIB_DIR'], 153 LINKCOM = [['$FLOCK_LINK', 154 '-o', 155 '$TARGET', 156 '$_LIBDIRFLAGS', 157 '$LINKFLAGS', 158 '$SOURCES', 159 '-Wl,--start-group', 160 '$_LIBFLAGS', 161 '-Wl,--end-group']], 162 SHLINKCOM = [['$FLOCK_SHLINK', 163 '-o', 164 '$TARGET', 165 '$_LIBDIRFLAGS', 166 '$SHLINKFLAGS', 167 '$SOURCES', 168 '-Wl,--start-group', 169 '$_LIBFLAGS', 170 '-Wl,--end-group']], 171 ), 172 'ImportExternal' : [ 173 'AS', 174 'CC', 175 'CXX', 176 'LINK', 177 ], 178 'PropagateExternal' : [ 179 'AS', 180 'CC', 181 'CCACHE_DIR', 182 'CXX', 183 'DISTCC_DIR', 184 'DISTCC_HOSTS', 185 'HOME', 186 'INCLUDE_SERVER_ARGS', 187 'INCLUDE_SERVER_PORT', 188 'LINK', 189 'CHROME_BUILD_TYPE', 190 'CHROMIUM_BUILD', 191 'OFFICIAL_BUILD', 192 ], 193 }, 194} 195 196config = configurations[env['CONFIG_NAME']] 197env.Append(**config['Append']) 198env.FilterOut(**config['FilterOut']) 199env.Replace(**config['Replace']) 200 201# Scons forces -fPIC for SHCCFLAGS on some platforms. 202# Disable that so we can control it from cflags in gyp. 203# Note that Scons itself is inconsistent with its -fPIC 204# setting. SHCCFLAGS forces -fPIC, and SHCFLAGS does not. 205# This will make SHCCFLAGS consistent with SHCFLAGS. 206env['SHCCFLAGS'] = ['$CCFLAGS'] 207 208for _var in config['ImportExternal']: 209 if _var in ARGUMENTS: 210 env[_var] = ARGUMENTS[_var] 211 elif _var in os.environ: 212 env[_var] = os.environ[_var] 213for _var in config['PropagateExternal']: 214 if _var in ARGUMENTS: 215 env[_var] = ARGUMENTS[_var] 216 elif _var in os.environ: 217 env['ENV'][_var] = os.environ[_var] 218 219env['ENV']['LD_LIBRARY_PATH'] = env.subst('$LIB_DIR') 220 221if ARGUMENTS.get('COVERAGE') not in (None, '0'): 222 env.AppendUnique( 223 CCFLAGS = [ 224 '-fprofile-arcs', 225 '-ftest-coverage' 226 ], 227 LINKFLAGS = [ 228 '-fprofile-arcs' 229 ], 230 ) 231 232if ARGUMENTS.get('PROFILE') not in (None, '0'): 233 env.AppendUnique( 234 CCFLAGS = [ 235 '-pg', 236 '-g' 237 ], 238 LINKFLAGS = [ 239 '-pg' 240 ], 241 ) 242 243if ARGUMENTS.get('SYMBOLS') not in (None, '0'): 244 env.AppendUnique( 245 CCFLAGS = [ 246 '-g' 247 ], 248 ) 249 250input_files = [ 251 'file_version_info_linux.cc', 252] 253 254target_files = [] 255prerequisites = [] 256 257if GetOption('verbose'): 258 _action = Action([['cd', 259 '$SRC_DIR/base', 260 '&&', 261 'python', 262 '../chrome/tools/build/version.py', 263 '-f', 264 '../chrome/VERSION', 265 '-f', 266 '../chrome/app/theme/chromium/BRANDING', 267 '-f', 268 '${SHARED_INTERMEDIATE_DIR}/build/LASTCHANGE', 269 'file_version_info_linux.h.version', 270 '${SHARED_INTERMEDIATE_DIR}/base/file_version_info_linux.h']]) 271else: 272 _action = Action([['cd', 273 '$SRC_DIR/base', 274 '&&', 275 'python', 276 '../chrome/tools/build/version.py', 277 '-f', 278 '../chrome/VERSION', 279 '-f', 280 '../chrome/app/theme/chromium/BRANDING', 281 '-f', 282 '${SHARED_INTERMEDIATE_DIR}/build/LASTCHANGE', 283 'file_version_info_linux.h.version', 284 '${SHARED_INTERMEDIATE_DIR}/base/file_version_info_linux.h']], 'Generating version information') 285_outputs = env.Command( 286 ['${SHARED_INTERMEDIATE_DIR}/base/file_version_info_linux.h'], 287 ['$SRC_DIR/base/file_version_info_linux.h.version', 288 '$SRC_DIR/base/../chrome/VERSION', 289 '$SRC_DIR/base/../chrome/app/theme/chromium/BRANDING', 290 '${SHARED_INTERMEDIATE_DIR}/build/LASTCHANGE'], 291 _action 292) 293prerequisites.extend(_outputs) 294target_files.extend(_outputs) 295 296_result = [] 297for infile in input_files: 298 if env.compilable(infile): 299 if (type(infile) == type('') 300 and (infile.startswith('$SRC_DIR/base/') 301 or not os.path.isabs(env.subst(infile)))): 302 # Force files below the build directory by replacing all '..' 303 # elements in the path with '__': 304 base, ext = os.path.splitext(os.path.normpath(infile)) 305 base = [d == '..' and '__' or d for d in base.split('/')] 306 base = os.path.join(*base) 307 object = '${OBJ_DIR}/${COMPONENT_NAME}/${TARGET_NAME}/' + base 308 if not infile.startswith('$SRC_DIR/base/'): 309 infile = '$SRC_DIR/base/' + infile 310 infile = env.StaticObject(object, infile)[0] 311 else: 312 infile = env.StaticObject(infile)[0] 313 _result.append(infile) 314input_files = _result 315 316_outputs = env.GypStaticLibrary('linux_versioninfo', input_files) 317target_files.extend(_outputs) 318 319gyp_target = env.Alias('linux_versioninfo', target_files) 320env.Requires(gyp_target, prerequisites) 321Return("gyp_target") 322