summaryrefslogtreecommitdiff
path: root/source4/build/scons
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-09-20 17:49:19 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:38:31 -0500
commit920a627ba814d78a1765a6c1c7209ff29acc6153 (patch)
tree193937ab55ada69c24f970dc00d722e03980a466 /source4/build/scons
parent5c40f9cd9b59041b3382ec24a1091a60134dd8c5 (diff)
downloadsamba-920a627ba814d78a1765a6c1c7209ff29acc6153.tar.gz
samba-920a627ba814d78a1765a6c1c7209ff29acc6153.tar.bz2
samba-920a627ba814d78a1765a6c1c7209ff29acc6153.zip
r10356: Make the proto generator work with scons
(This used to be commit a2268f1dd441059955bee30cf2a9028656c14099)
Diffstat (limited to 'source4/build/scons')
-rw-r--r--source4/build/scons/et.py23
-rw-r--r--source4/build/scons/iconv.py10
-rw-r--r--source4/build/scons/pidl.py17
-rw-r--r--source4/build/scons/proto.py16
4 files changed, 33 insertions, 33 deletions
diff --git a/source4/build/scons/et.py b/source4/build/scons/et.py
index cba40af92a..ea251cd142 100644
--- a/source4/build/scons/et.py
+++ b/source4/build/scons/et.py
@@ -5,22 +5,29 @@ Tool-specific initialization for et
"""
import SCons.Defaults
-import SCons.Scanner.ET
import SCons.Util
-
-et_scanner = SCons.Scanner.ET.ETScan()
+import SCons.Tool
et_builder = SCons.Builder.Builder(action='$ETCOM',
src_suffix = '.et',
- suffix='.c',
- scanner = et_scanner)
+ suffix='.c')
def generate(env):
- env['ET'] = 'FIXME'
- env['PROTOCOM'] = '$ET $SOURCE'
+ env['ET'] = env.Detect('et_compile')
+ env['ETCOM'] = '$ET $SOURCE'
env['BUILDERS']['ET'] = et_builder
def exists(env):
- return env.Detect('FIXME')
+ return env.Detect(['et_compile'])
+
+def generate(env):
+ """Add Builders and construction variables for lex to an Environment."""
+ c_file, cxx_file = SCons.Tool.createCFileBuilders(env)
+ c_file.add_action('.l', SCons.Defaults.LexAction)
+ cxx_file.add_action('.ll', SCons.Defaults.LexAction)
+ env['LEX'] = env.Detect('flex') or 'lex'
+ env['LEXFLAGS'] = SCons.Util.CLVar('')
+ env['LEXCOM'] = '$LEX $LEXFLAGS -t $SOURCES > $TARGET'
+
diff --git a/source4/build/scons/iconv.py b/source4/build/scons/iconv.py
index ef82dc475d..940e2d814d 100644
--- a/source4/build/scons/iconv.py
+++ b/source4/build/scons/iconv.py
@@ -1,6 +1,12 @@
# Based on the M4 macro by Bruno Haible.
-def _CheckIconvPath(path):
+def exists(env):
+ return True
+
+def generate(env):
+ env['custom_tests']['CheckIconv'] = CheckIconv
+
+def _CheckIconvPath(context,path):
# Some systems have iconv in libc, some have it in libiconv (OSF/1 and
# those with the standalone portable libiconv installed).
context.Message("checking for iconv in " + path)
@@ -58,7 +64,7 @@ def CheckIconv(context):
look_dirs = ['/usr','/usr/local','/sw']
for p in look_dirs:
- _CheckIconvPath(p) #FIXME: Handle return value
+ _CheckIconvPath(context,p) #FIXME: Handle return value
if context.TryRun("""
#include <iconv.h>
diff --git a/source4/build/scons/pidl.py b/source4/build/scons/pidl.py
index c0c29d2035..6bddea3ee4 100644
--- a/source4/build/scons/pidl.py
+++ b/source4/build/scons/pidl.py
@@ -16,17 +16,10 @@ pidl_builder = SCons.Builder.Builder(action='$PIDLCOM',
scanner = idl_scanner)
def generate(env):
- env['PIDL'] = 'pidl'
- env['PIDLCPP'] = env['CPP']
- env['PIDLFLAGS'] = []
- env['PIDLCOM'] = 'CPP=$PIDLCPP $PIDL $PIDLFLAGS -- $SOURCE'
- env['BUILDERS']['NdrMarshaller'] = pidl_builder
+ env['PIDL'] = env.Detect('pidl') or './pidl/pidl'
+ env['PIDLFLAGS'] = []
+ env['PIDLCOM'] = 'CPP=$CPP $PIDL $PIDLFLAGS -- $SOURCE'
+ env['BUILDERS']['NdrMarshaller'] = pidl_builder
def exists(env):
- if (env.Detect('./pidl/pidl')):
- return 1
-
- if (env.Detect('pidl')):
- return 1
-
- return 0
+ return env.Detect(['./pidl/pidl','pidl'])
diff --git a/source4/build/scons/proto.py b/source4/build/scons/proto.py
index 6a53bfb4ab..b3255fc7e8 100644
--- a/source4/build/scons/proto.py
+++ b/source4/build/scons/proto.py
@@ -5,22 +5,16 @@ Tool-specific initialization for mkproto (C Proto File generator)
"""
import SCons.Defaults
-import SCons.Scanner.C
import SCons.Util
-c_scanner = SCons.Scanner.C.CScan()
-
proto_builder = SCons.Builder.Builder(action='$PROTOCOM',
- src_suffix = '.idl',
- suffix='.h',
- scanner = c_scanner)
+ src_suffix = '.c',
+ suffix='.h')
def generate(env):
- env['MKPROTO'] = './script/mkproto.sh'
- env['PROTOCOM'] = '$MKPROTO "$PERL" -h _PROTO_H_ ${TARGETS[0]} $SOURCE'
- env['BUILDERS']['ProtoHeader'] = proto_builder
+ env['MKPROTO'] = './script/mkproto.sh'
+ env['PROTOCOM'] = '$MKPROTO "$PERL" -h _PROTO_H_ ${TARGETS[0]} $SOURCE'
+ env['BUILDERS']['CProtoHeader'] = proto_builder
def exists(env):
return env.Detect('./script/mkproto.sh')
-
-