| OLD | NEW |
| 1 # -*- python -*- | 1 # -*- python -*- |
| 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 Import('env') | 6 Import('env') |
| 7 | 7 |
| 8 # | 8 # |
| 9 # | 9 # |
| 10 # Build on x86 only. | 10 # Build on x86 only. |
| (...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 117 target=c_file, | 117 target=c_file, |
| 118 source=['unreviewed/%s-x86_%s.rl' % (automata, bits), rl_file], | 118 source=['unreviewed/%s-x86_%s.rl' % (automata, bits), rl_file], |
| 119 action=['ragel -G2 -I%s ${SOURCES[0]} -o ${TARGET}' % (rl_src_dir)] | 119 action=['ragel -G2 -I%s ${SOURCES[0]} -o ${TARGET}' % (rl_src_dir)] |
| 120 ) | 120 ) |
| 121 automatas.append(c_file) | 121 automatas.append(c_file) |
| 122 | 122 |
| 123 # Generate 32 and 64 bit versions of decoders and validators | 123 # Generate 32 and 64 bit versions of decoders and validators |
| 124 env.AlwaysBuild(env.Alias('valgen', automatas)) | 124 env.AlwaysBuild(env.Alias('valgen', automatas)) |
| 125 env.AlwaysBuild(env.Alias('valclean', action=[Delete(x) for x in automatas])) | 125 env.AlwaysBuild(env.Alias('valclean', action=[Delete(x) for x in automatas])) |
| 126 | 126 |
| 127 # Generate 32 and 64 bit versions of decoders and validators. | 127 # Generate 32 and 64 bit versions of decoders and validators. Both libraries |
| 128 # are used for command-line decoder and validator those detect specific |
| 129 # architecture of the ELF file provided. |
| 128 for bits in ['32', '64']: | 130 for bits in ['32', '64']: |
| 129 for automata in ['decoder', 'validator']: | 131 env.ComponentLibrary('dfa_validate_x86_%s' % bits, |
| 130 env.ComponentLibrary('%s_x86_%s' % (automata, bits), | 132 ['gen/validator-x86_%s.c' % bits]) |
| 131 ['gen/%s-x86_%s.c' % (automata, bits)]) | 133 env.ComponentLibrary('dfa_decode_x86_%s' % bits, |
| 134 ['gen/decoder-x86_%s.c' % bits]) |
| 132 | 135 |
| 136 # Glue library called from service runtime. The source file depends on the |
| 137 # target architecture. |
| 138 caller_lib_bits = None |
| 139 if env.Bit('target_x86_32'): |
| 140 caller_lib_bits = '32' |
| 141 if env.Bit('target_x86_64'): |
| 142 caller_lib_bits = '64' |
| 143 if caller_lib_bits: |
| 144 caller_lib = 'dfa_validate_caller_x86_%s' % caller_lib_bits |
| 145 env.ComponentLibrary(caller_lib, |
| 146 ['unreviewed/dfa_validate_%s.c' % caller_lib_bits]) |
| 147 |
| 148 # Command-line decoder. |
| 133 env.ComponentProgram( | 149 env.ComponentProgram( |
| 134 'decoder-test', | 150 'decoder-test', |
| 135 ['unreviewed/decoder-test.c'], | 151 ['unreviewed/decoder-test.c'], |
| 136 EXTRA_LIBS=['decoder_x86_32', 'decoder_x86_64']) | 152 EXTRA_LIBS=['dfa_decode_x86_32', 'dfa_decode_x86_64']) |
| 137 | 153 |
| 154 # Command-line validator. |
| 138 env.ComponentProgram( | 155 env.ComponentProgram( |
| 139 'validator-test', | 156 'validator-test', |
| 140 ['unreviewed/validator-test.c'], | 157 ['unreviewed/validator-test.c'], |
| 141 EXTRA_LIBS=['validator_x86_32', 'validator_x86_64']) | 158 EXTRA_LIBS=['dfa_validate_x86_32', 'dfa_validate_x86_64']) |
| OLD | NEW |