aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorajwong@chromium.org <ajwong@chromium.org@4ff67af0-8c30-449e-8e8b-ad334ec8d88c>2009-10-23 20:15:55 +0000
committerajwong@chromium.org <ajwong@chromium.org@4ff67af0-8c30-449e-8e8b-ad334ec8d88c>2009-10-23 20:15:55 +0000
commit2d2528818471f6a8387e565414b5d315758c14ea (patch)
treeb9bc80297cb3c13a993f8e92d92c2f176042aeef
parent45afe016bed87b9c6946184709058b39ede3f77f (diff)
downloadpatched-yasm-2d2528818471f6a8387e565414b5d315758c14ea.tar.gz
Patching yasm to be gyp friendly.
BUG=22307 TEST=none Review URL: http://codereview.chromium.org/326016 git-svn-id: http://src.chromium.org/svn/trunk/deps/third_party/yasm/patched-yasm@29937 4ff67af0-8c30-449e-8e8b-ad334ec8d88c
-rw-r--r--libyasm/genmodule.c13
-rwxr-xr-xmodules/arch/x86/gen_x86_insn.py14
2 files changed, 18 insertions, 9 deletions
diff --git a/libyasm/genmodule.c b/libyasm/genmodule.c
index d271f6c..c332135 100644
--- a/libyasm/genmodule.c
+++ b/libyasm/genmodule.c
@@ -32,7 +32,6 @@
#include "compat-queue.h"
-#define OUTPUT "module.c"
#define MAXNAME 128
#define MAXLINE 1024
#define MAXMODULES 128
@@ -58,12 +57,14 @@ main(int argc, char *argv[])
include *inc;
int isam = 0;
int linecont = 0;
+ char *outfile;
- if (argc != 3) {
- fprintf(stderr, "Usage: %s <module.in> <Makefile[.am]>\n", argv[0]);
+ if (argc != 4) {
+ fprintf(stderr, "Usage: %s <module.in> <Makefile[.am]> <outfile>\n", argv[0]);
return EXIT_FAILURE;
}
+ outfile = argv[3];
str = malloc(MAXLINE);
/* Starting with initial input Makefile, look for include <file> or
@@ -167,10 +168,10 @@ keepgoing:
fclose(in);
}
- out = fopen(OUTPUT, "wt");
+ out = fopen(outfile, "wt");
if (!out) {
- fprintf(stderr, "Could not open `%s'.\n", OUTPUT);
+ fprintf(stderr, "Could not open `%s'.\n", outfile);
return EXIT_FAILURE;
}
@@ -181,7 +182,7 @@ keepgoing:
if (!in) {
fprintf(stderr, "Could not open `%s'.\n", argv[1]);
fclose(out);
- remove(OUTPUT);
+ remove(outfile);
return EXIT_FAILURE;
}
diff --git a/modules/arch/x86/gen_x86_insn.py b/modules/arch/x86/gen_x86_insn.py
index 3000fc6..3d5d23e 100755
--- a/modules/arch/x86/gen_x86_insn.py
+++ b/modules/arch/x86/gen_x86_insn.py
@@ -26,6 +26,10 @@
#
# NOTE: operands are arranged in NASM / Intel order (e.g. dest, src)
rcstag = "$Id: gen_x86_insn.py 2193 2009-04-04 23:03:41Z peter $"
+
+import os
+import sys
+
try:
scriptname = rcstag.split()[1]
scriptrev = rcstag.split()[2]
@@ -7333,6 +7337,10 @@ for val, suf in enumerate(["", "z", "y", "yz", "x", "xz", "xy", "xyz"]):
# Output generation
#####################################################################
-output_groups(file("x86insns.c", "wt"))
-output_gas_insns(file("x86insn_gas.gperf", "wt"))
-output_nasm_insns(file("x86insn_nasm.gperf", "wt"))
+out_dir = ""
+if len(sys.argv) > 1:
+ out_dir = sys.argv[1]
+
+output_groups(file(os.path.join(out_dir, "x86insns.c"), "wt"))
+output_gas_insns(file(os.path.join(out_dir, "x86insn_gas.gperf"), "wt"))
+output_nasm_insns(file(os.path.join(out_dir, "x86insn_nasm.gperf"), "wt"))