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