SConscript (4500:068356f4fa81) SConscript (4504:936dfda07b50)
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
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
97subp = subprocess.Popen("gm4 --version", shell=True, stdout=subprocess.PIPE,
98 stderr=subprocess.STDOUT, close_fds=True)
99if subp.communicate()[0].find('GNU') >= 0:
97if m4env.Detect('gm4'):
100 m4env['M4'] = 'gm4'
101
102# Check that m4 is available
98 m4env['M4'] = 'gm4'
99
100# Check that m4 is available
103if not m4env.get('M4'):
101import SCons.Tool.m4
102if not SCons.Tool.m4.exists(m4env):
104 print "Error: Can't find version of M4 macro processor. " + \
105 "Please install M4 and try again."
106 Exit(1)
107
108m4env.Append(M4FLAGS='-DSRCDIR=%s' % Dir('.').path)
109m4env['M4COM'] = '$M4 $M4FLAGS $SOURCES > $TARGET'
110m4env.M4(target=File('libelf_convert.c'),
111 source=[File('elf_types.m4'), File('libelf_convert.m4')])
112m4env.M4(target=File('libelf_fsize.c'),
113 source=[File('elf_types.m4'), File('libelf_fsize.m4')])
114m4env.M4(target=File('libelf_msize.c'),
115 source=[File('elf_types.m4'), File('libelf_msize.m4')])
116m4env.Library('elf', elf_files)
117
118env.Append(CPPPATH=Dir('.'))
119env.Append(LIBS=['elf'])
120env.Append(LIBPATH=[Dir('.')])
121
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