1# -*- mode:python -*- 2 3# Copyright (c) 2004-2005 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 80 unchanged lines hidden (view full) --- 89 90m4env = Environment(ENV=os.environ) 91if env.get('CC'): 92 m4env['CC'] = env['CC'] 93if env.get('CXX'): 94 m4env['CXX'] = env['CXX'] 95 96# If we have gm4 use it |
97if m4env.Detect('gm4'): |
98 m4env['M4'] = 'gm4' 99 100# Check that m4 is available |
101import SCons.Tool.m4 102if not SCons.Tool.m4.exists(m4env): |
103 print "Error: Can't find version of M4 macro processor. " + \ 104 "Please install M4 and try again." 105 Exit(1) 106 107m4env.Append(M4FLAGS='-DSRCDIR=%s' % Dir('.').path) 108m4env['M4COM'] = '$M4 $M4FLAGS $SOURCES > $TARGET' 109m4env.M4(target=File('libelf_convert.c'), 110 source=[File('elf_types.m4'), File('libelf_convert.m4')]) 111m4env.M4(target=File('libelf_fsize.c'), 112 source=[File('elf_types.m4'), File('libelf_fsize.m4')]) 113m4env.M4(target=File('libelf_msize.c'), 114 source=[File('elf_types.m4'), File('libelf_msize.m4')]) 115m4env.Library('elf', elf_files) 116 117env.Append(CPPPATH=Dir('.')) 118env.Append(LIBS=['elf']) 119env.Append(LIBPATH=[Dir('.')]) 120 |