summaryrefslogtreecommitdiff
path: root/libjava/contrib/aot-compile.in
diff options
context:
space:
mode:
authorupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
committerupstream source tree <ports@midipix.org>2015-03-15 20:14:05 -0400
commit554fd8c5195424bdbcabf5de30fdc183aba391bd (patch)
tree976dc5ab7fddf506dadce60ae936f43f58787092 /libjava/contrib/aot-compile.in
downloadcbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.bz2
cbb-gcc-4.6.4-554fd8c5195424bdbcabf5de30fdc183aba391bd.tar.xz
obtained gcc-4.6.4.tar.bz2 from upstream website;upstream
verified gcc-4.6.4.tar.bz2.sig; imported gcc-4.6.4 source tree from verified upstream tarball. downloading a git-generated archive based on the 'upstream' tag should provide you with a source tree that is binary identical to the one extracted from the above tarball. if you have obtained the source via the command 'git clone', however, do note that line-endings of files in your working directory might differ from line-endings of the respective files in the upstream repository.
Diffstat (limited to 'libjava/contrib/aot-compile.in')
-rw-r--r--libjava/contrib/aot-compile.in88
1 files changed, 88 insertions, 0 deletions
diff --git a/libjava/contrib/aot-compile.in b/libjava/contrib/aot-compile.in
new file mode 100644
index 000000000..91cfc67d9
--- /dev/null
+++ b/libjava/contrib/aot-compile.in
@@ -0,0 +1,88 @@
+#!/usr/bin/env python
+
+## Copyright (C) 2006, 2011 Free Software Foundation
+## Written by Gary Benson <gbenson@redhat.com>
+##
+## This program is free software; you can redistribute it and/or modify
+## it under the terms of the GNU General Public License as published by
+## the Free Software Foundation; either version 2 of the License, or
+## (at your option) any later version.
+##
+## This program is distributed in the hope that it will be useful,
+## but WITHOUT ANY WARRANTY; without even the implied warranty of
+## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+## GNU General Public License for more details.
+
+import sys
+sys.path.insert(0, "@python_mod_dir_expanded@")
+import aotcompile
+import getopt
+import os
+
+usage = """\
+Usage: %s [OPTION...] SRCDIR DSTDIR
+AOT-compile all Java bytecode in SRCDIR into DSTDIR.
+
+Options:
+ -M, --make=PATH make executable to use (%s)
+ -C, --gcj=PATH gcj executable to use (%s)
+ -D, --dbtool=PATH gcj-dbtool executable to use (%s)
+ -m, --makeflags=FLAGS flags to pass to make during build
+ -c, --gcjflags=FLAGS flags to pass to gcj during compilation
+ in addition to %s
+ -l, --ldflags=FLAGS flags to pass to gcj during linking
+ in addition to %s
+ -e, --exclude=PATH do not compile PATH
+
+Extra flags may also be passed using the AOT_MAKEFLAGS, AOT_GCJFLAGS
+and AOT_LDFLAGS environment variables.""" % (
+ os.path.basename(sys.argv[0]),
+ aotcompile.PATHS["make"],
+ aotcompile.PATHS["gcj"],
+ aotcompile.PATHS["dbtool"],
+ repr(" ".join(aotcompile.GCJFLAGS)),
+ repr(" ".join(aotcompile.LDFLAGS)))
+
+try:
+ if os.environ.has_key("RPM_PACKAGE_NAME"):
+ raise aotcompile.Error, "not for use within rpm specfiles"
+
+ try:
+ opts, args = getopt.getopt(
+ sys.argv[1:],
+ "M:C:D:m:c:l:e:",
+ ["make=", "gcj=", "dbtool=",
+ "makeflags=" "gcjflags=", "ldflags=",
+ "exclude="])
+ srcdir, dstdir = args
+ except:
+ print >>sys.stderr, usage
+ sys.exit(1)
+
+ compiler = aotcompile.Compiler(srcdir, dstdir)
+ for o, a in opts:
+ if o in ("-M", "--make"):
+ aotcompile.PATHS["make"] = a
+ if o in ("-C", "--gcj"):
+ aotcompile.PATHS["gcj"] = a
+ if o in ("-D", "--dbtool"):
+ aotcompile.PATHS["dbtool"] = a
+ if o in ("-m", "--makeflags"):
+ compiler.makeflags[0:0] = a.split()
+ if o in ("-c", "--gcjflags"):
+ compiler.gcjflags[0:0] = a.split()
+ if o in ("-l", "--ldflags"):
+ compiler.ldflags[0:0] = a.split()
+ if o in ("-e", "--exclude"):
+ compiler.exclusions.append(a)
+
+ compiler.makeflags[0:0] = os.environ.get("AOT_MAKEFLAGS", "").split()
+ compiler.gcjflags[0:0] = os.environ.get("AOT_GCJFLAGS", "").split()
+ compiler.ldflags[0:0] = os.environ.get("AOT_LDFLAGS", "").split()
+
+ compiler.compile()
+
+except aotcompile.Error, e:
+ print >>sys.stderr, "%s: error: %s" % (
+ os.path.basename(sys.argv[0]), e)
+ sys.exit(1)