diff options
author | H. Peter Anvin <hpa@zytor.com> | 2008-09-09 09:54:03 -0700 |
---|---|---|
committer | H. Peter Anvin <hpa@zytor.com> | 2008-09-09 09:54:03 -0700 |
commit | 49039ab636449017677cafca6549ca5c4ddf943c (patch) | |
tree | b118175d808412b1cfcf8fbe3c0dc8de9e2af7d1 /macros.pl | |
parent | 5618e0063d205ff1214ac5291f24b857144bf950 (diff) | |
download | nasm-49039ab636449017677cafca6549ca5c4ddf943c.tar.gz |
macros.pl: don't include macros for disabled output formats
Don't include macros for output formats we aren't compiling in.
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
Diffstat (limited to 'macros.pl')
-rwxr-xr-x | macros.pl | 17 |
1 files changed, 13 insertions, 4 deletions
@@ -47,7 +47,9 @@ print OUT "\n"; print OUT "#include \"tables.h\"\n"; print OUT "#include \"nasmlib.h\"\n"; print OUT "#include \"hashtbl.h\"\n"; +print OUT "#include \"outform.h\"\n"; print OUT "\n"; +print OUT "#if 1\n"; print OUT "const unsigned char nasm_stdmac[] = {"; my $npkg = 0; @@ -71,9 +73,15 @@ foreach $fname ( @ARGV ) { undef $pkg; my @out_alias = split(/\s+/, $1); printf OUT " /* %4d */ 0\n", $index++; - print OUT "};\n"; + print OUT "};\n#endif\n"; $index = 0; - printf OUT "const unsigned char %s_stdmac[] = {\n", $out_alias[0]; + print OUT "\n"; + my $pfx = '#if'; + foreach my $al (@out_alias) { + print OUT $pfx, " defined(OF_\U${al}\E)"; + $pfx = ' ||'; + } + printf OUT "\nconst unsigned char %s_stdmac[] = {\n", $out_alias[0]; print OUT " /* From $fname */\n"; $lastname = $fname; push(@out_list, $out_alias[0]); @@ -84,8 +92,9 @@ foreach $fname ( @ARGV ) { die "$0: $fname: duplicate package: $pkg\n"; } printf OUT " /* %4d */ 0\n", $index++; - print OUT "};\n"; + print OUT "};\n#endif\n"; $index = 0; + print OUT "\n#if 1\n"; printf OUT "static const unsigned char nasm_stdmac_%s[] = {\n", $pkg; print OUT " /* From $fname */\n"; $lastname = $fname; @@ -126,7 +135,7 @@ foreach $fname ( @ARGV ) { } close(INPUT); } -printf OUT " /* %4d */ 0\n};\n\n", $index++; +printf OUT " /* %4d */ 0\n};\n#endif\n\n", $index++; print OUT "const unsigned char * const nasm_stdmac_after_tasm = ", "&nasm_stdmac[$tasm_count];\n\n"; |