* Re: [patch] Packager files
@ 2008-07-06 16:57 Gerald Pfeifer
0 siblings, 0 replies; 7+ messages in thread
From: Gerald Pfeifer @ 2008-07-06 16:57 UTC (permalink / raw)
To: java-patches, Andrew Haley, Joshua Sumali; +Cc: gcc
Joshua Sumali wrote:
> Attached patch puts files aot-compile-rm, aot-compile, and
> rebuild-gcj-db into libjava/contrib. These files are taken from
> java-gcj-compat and are intended to be available for packagers. This
> is the second part of merging java-gcj-compat into libgcj (also see
> sdk styled directory patch).
Do we really want to add these with a default installation??
In addition, aot-compile and rebuild-gcj-db behave nicely in that
they honor --program-suffix and provide man pages.
However, this patch does add a regression in that we now install
share/python/aotcompile.py and share/python/classfile.py
by default, poisoning global namespace.
This is a problem we need to fix since it won't allow installing both
GCC 4.4 and GCC 4.5 into the same prefix leveraging --program-suffix.
Gerald
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch] Packager files
2008-06-13 12:52 ` Matthias Klose
@ 2008-06-18 20:50 ` Joshua Sumali
0 siblings, 0 replies; 7+ messages in thread
From: Joshua Sumali @ 2008-06-18 20:50 UTC (permalink / raw)
To: java-patches
Matthias Klose wrote:
> Andrew Haley schrieb:
>
>> Joshua Sumali wrote:
>>
>>
>>> Attached patch puts files aot-compile-rm, aot-compile, and
>>> rebuild-gcj-db into libjava/contrib. These files are taken from
>>> java-gcj-compat and are intended to be available for packagers. This is
>>> the second part of merging java-gcj-compat into libgcj (also see sdk
>>> styled directory patch).
>>>
>> Thanks.
>>
>> I think we'll want these installed in $bindir.
>>
>
> In this case the binary names should be `transform'ed as well.
>
> documentation about aot-compile and gcj-dbtool in gcc/java/gcj.texi would be nice.
>
> Matthias
>
>
FYI: The patch for the docs and the updated packager files is now part
of the "Create sdk style directory on install" thread that I started
Josh
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch] Packager files
2008-06-13 11:35 ` Andrew Haley
@ 2008-06-16 13:57 ` Joshua Sumali
0 siblings, 0 replies; 7+ messages in thread
From: Joshua Sumali @ 2008-06-16 13:57 UTC (permalink / raw)
To: java-patches; +Cc: Thomas Fitzsimmons
Andrew Haley wrote:
> Andrew Haley wrote:
>
>> Joshua Sumali wrote:
>>
>>
>>> Attached patch puts files aot-compile-rm, aot-compile, and
>>> rebuild-gcj-db into libjava/contrib. These files are taken from
>>> java-gcj-compat and are intended to be available for packagers. This is
>>> the second part of merging java-gcj-compat into libgcj (also see sdk
>>> styled directory patch).
>>>
>> Thanks.
>>
>> I think we'll want these installed in $bindir.
>>
>
> 2 more things:
>
> aot-compile as you submitted it is broken in that it imports "aotcompile".
> You didn't provide this file.
>
> We don't want aot-compile-rpm to be installed in $bindir by default, as it's
> Red Hat specific. It's OK to put it in to contrib. Howeverwe do want
> aot-compile to be installed.
>
> Andrew.
>
>
Hi,
I can provide a patch for aotcompile.py, but this is originally
generated from aotcompile.py.in from ./configure in java-gcj-compat,
mainly to fill in these 3 lines:
PATHS = {"make": "@MAKE@",
"gcj": "@GCJ_BIN_DIR@/gcj@gcc_suffix@",
"dbtool": "@GCJ_BIN_DIR@/gcj-dbtool@gcc_suffix@"}
(which turns into something like: )
PATHS = {"make": "/usr/bin/make",
"gcj": "/usr/bin/gcj",
"dbtool": "/usr/bin/gcj-dbtool"}
Since I'm assuming these files will be used in the spec file, I don't
think we'll be using a ./configure to fill those lines in, so should I
just be posting the already-filled-in aotcompile.py?
Thanks,
Josh
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch] Packager files
2008-06-13 10:40 ` Andrew Haley
2008-06-13 11:35 ` Andrew Haley
@ 2008-06-13 12:52 ` Matthias Klose
2008-06-18 20:50 ` Joshua Sumali
1 sibling, 1 reply; 7+ messages in thread
From: Matthias Klose @ 2008-06-13 12:52 UTC (permalink / raw)
To: Andrew Haley; +Cc: Joshua Sumali, java-patches, Thomas Fitzsimmons
Andrew Haley schrieb:
> Joshua Sumali wrote:
>
>> Attached patch puts files aot-compile-rm, aot-compile, and
>> rebuild-gcj-db into libjava/contrib. These files are taken from
>> java-gcj-compat and are intended to be available for packagers. This is
>> the second part of merging java-gcj-compat into libgcj (also see sdk
>> styled directory patch).
>
> Thanks.
>
> I think we'll want these installed in $bindir.
In this case the binary names should be `transform'ed as well.
documentation about aot-compile and gcj-dbtool in gcc/java/gcj.texi would be nice.
Matthias
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch] Packager files
2008-06-13 10:40 ` Andrew Haley
@ 2008-06-13 11:35 ` Andrew Haley
2008-06-16 13:57 ` Joshua Sumali
2008-06-13 12:52 ` Matthias Klose
1 sibling, 1 reply; 7+ messages in thread
From: Andrew Haley @ 2008-06-13 11:35 UTC (permalink / raw)
To: Joshua Sumali; +Cc: java-patches, Thomas Fitzsimmons
Andrew Haley wrote:
> Joshua Sumali wrote:
>
>> Attached patch puts files aot-compile-rm, aot-compile, and
>> rebuild-gcj-db into libjava/contrib. These files are taken from
>> java-gcj-compat and are intended to be available for packagers. This is
>> the second part of merging java-gcj-compat into libgcj (also see sdk
>> styled directory patch).
>
> Thanks.
>
> I think we'll want these installed in $bindir.
2 more things:
aot-compile as you submitted it is broken in that it imports "aotcompile".
You didn't provide this file.
We don't want aot-compile-rpm to be installed in $bindir by default, as it's
Red Hat specific. It's OK to put it in to contrib. Howeverwe do want
aot-compile to be installed.
Andrew.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [patch] Packager files
2008-06-12 20:59 Joshua Sumali
@ 2008-06-13 10:40 ` Andrew Haley
2008-06-13 11:35 ` Andrew Haley
2008-06-13 12:52 ` Matthias Klose
0 siblings, 2 replies; 7+ messages in thread
From: Andrew Haley @ 2008-06-13 10:40 UTC (permalink / raw)
To: Joshua Sumali; +Cc: java-patches, Thomas Fitzsimmons
Joshua Sumali wrote:
> Attached patch puts files aot-compile-rm, aot-compile, and
> rebuild-gcj-db into libjava/contrib. These files are taken from
> java-gcj-compat and are intended to be available for packagers. This is
> the second part of merging java-gcj-compat into libgcj (also see sdk
> styled directory patch).
Thanks.
I think we'll want these installed in $bindir.
Also, we'll want something more sophisticated than "for base in /usr/lib*"
for multilibs, but I'm not sure exactly what. That can wait until a
later patch.
Andrew.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [patch] Packager files
@ 2008-06-12 20:59 Joshua Sumali
2008-06-13 10:40 ` Andrew Haley
0 siblings, 1 reply; 7+ messages in thread
From: Joshua Sumali @ 2008-06-12 20:59 UTC (permalink / raw)
To: java-patches; +Cc: Thomas Fitzsimmons
[-- Attachment #1: Type: text/plain, Size: 304 bytes --]
Hi,
Attached patch puts files aot-compile-rm, aot-compile, and
rebuild-gcj-db into libjava/contrib. These files are taken from
java-gcj-compat and are intended to be available for packagers. This is
the second part of merging java-gcj-compat into libgcj (also see sdk
styled directory patch).
Josh
[-- Attachment #2: gcc-libjava-contrib.patch --]
[-- Type: text/x-patch, Size: 8666 bytes --]
Index: ChangeLog
===================================================================
--- ChangeLog (revision 136724)
+++ ChangeLog (working copy)
@@ -1,3 +1,10 @@
+2008-06-12 Joshua Sumali <jsumali@redhat.com>
+
+ * contrib/aot-compile-rpm: New file. This file is meant to be available
+ for packagers (originally from java-gcj-compat).
+ * contrib/aot-compile: Likewise.
+ * contrib/rebuild-gcj-db: Likewise.
+
2008-06-07 Joseph Myers <joseph@codesourcery.com>
* configure.host (strongarm*-elf, xscale*-elf): Remove.
Index: contrib/aot-compile-rpm
===================================================================
--- contrib/aot-compile-rpm (revision 0)
+++ contrib/aot-compile-rpm (revision 0)
@@ -0,0 +1,96 @@
+#!/usr/bin/env python
+
+## Copyright (C) 2005, 2006, 2007 Red Hat, Inc.
+## 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 aotcompile
+import os
+import sys
+
+def libdir():
+ cmd = "%s -p" % aotcompile.PATHS["dbtool"]
+ dir = os.path.abspath(os.popen(cmd, "r").readline().rstrip())
+ dir, base = os.path.split(dir)
+ if base != "classmap.db":
+ raise aotcompile.Error, "%s: unexpected output" % cmd
+ dir, base = os.path.split(dir)
+ if not base.startswith("gcj-"):
+ raise aotcompile.Error, "%s: unexpected output" % cmd
+ return dir
+
+def writeSourceList(srcdir, dstpath):
+ def visit(fp, dir, items):
+ for item in items:
+ path = os.path.join(dir, item)
+ if os.path.isfile(path):
+ print >>fp, path
+ dstdir = os.path.dirname(dstpath)
+ if not os.path.isdir(dstdir):
+ os.makedirs(dstdir)
+ os.path.walk(srcdir, visit, open(dstpath, "w"))
+
+def copy(srcdir, dstdir, suffix):
+ srcdir = os.path.join(srcdir, suffix.lstrip(os.sep))
+ dstdir = os.path.join(dstdir, suffix.lstrip(os.sep))
+ os.makedirs(os.path.dirname(dstdir))
+ aotcompile.system(("/bin/cp", "-a", srcdir, dstdir))
+
+try:
+ name = os.environ.get("RPM_PACKAGE_NAME")
+ if name is None:
+ raise aotcompile.Error, "not for use outside rpm specfiles"
+ arch = os.environ.get("RPM_ARCH")
+ if arch == "noarch":
+ raise aotcompile.Error, "cannot be used on noarch packages"
+ srcdir = os.environ.get("RPM_BUILD_ROOT")
+ if srcdir in (None, "/"):
+ raise aotcompile.Error, "bad $RPM_BUILD_ROOT"
+ tmpdir = os.path.join(os.getcwd(), "aot-compile-rpm")
+ if os.path.exists(tmpdir):
+ raise aotcompile.Error, "%s exists" % tmpdir
+ dstdir = os.path.join(libdir(), "gcj", name)
+
+ compiler = aotcompile.Compiler(srcdir, dstdir, tmpdir)
+ compiler.gcjflags[0:0] = os.environ.get("RPM_OPT_FLAGS", "").split()
+
+ # XXX: This script should not accept options, because having
+ # them it cannot be integrated into rpm. But, gcj cannot
+ # build each and every jarfile yet, so we must be able to
+ # exclude until it can.
+ # XXX --exclude is also used in the jonas rpm to stop
+ # everything being made a subset of the mammoth client
+ # jarfile. Should adjust the subset checker's bias to
+ # favour many small jarfiles over one big one.
+ try:
+ options, exclusions = sys.argv[1:], []
+ while options:
+ if options.pop(0) != "--exclude":
+ raise ValueError
+ compiler.exclusions.append(
+ os.path.join(srcdir, options.pop(0).lstrip(os.sep)))
+ except:
+ print >>sys.stderr, "usage: %s [--exclude PATH]..." % (
+ os.path.basename(sys.argv[0]))
+ sys.exit(1)
+
+ sourcelist = os.path.join(tmpdir, "sources.list")
+ writeSourceList(os.getcwd(), sourcelist)
+ compiler.gcjflags.append("-fsource-filename=" + sourcelist)
+
+ compiler.compile()
+ copy(tmpdir, srcdir, dstdir)
+
+except aotcompile.Error, e:
+ print >>sys.stderr, "%s: error: %s" % (
+ os.path.basename(sys.argv[0]), e)
+ sys.exit(1)
Property changes on: contrib/aot-compile-rpm
___________________________________________________________________
Name: svn:executable
+ *
Index: contrib/aot-compile
===================================================================
--- contrib/aot-compile (revision 0)
+++ contrib/aot-compile (revision 0)
@@ -0,0 +1,87 @@
+#!/usr/bin/env python
+
+## Copyright (C) 2006 Red Hat, Inc.
+## 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 aotcompile
+import getopt
+import os
+import sys
+
+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)
Property changes on: contrib/aot-compile
___________________________________________________________________
Name: svn:executable
+ *
Index: contrib/rebuild-gcj-db
===================================================================
--- contrib/rebuild-gcj-db (revision 0)
+++ contrib/rebuild-gcj-db (revision 0)
@@ -0,0 +1,16 @@
+#!/bin/bash
+# rebuild-gcj-db
+
+# Rebuild all the standard databases.
+for base in /usr/lib*; do
+ dbLocation=`/usr/bin/gcj-dbtool -p $base`
+ libdir=$base/gcj
+ if ! test -d $libdir; then
+ # No shared libraries here.
+ continue
+ fi
+ dirname $dbLocation | xargs mkdir -p
+ /usr/bin/gcj-dbtool -n $dbLocation 64
+ find $libdir -follow -name '*.db' -print0 | \
+ xargs -0 /usr/bin/gcj-dbtool -m $dbLocation $dbLocation
+done
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2008-07-06 16:57 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-07-06 16:57 [patch] Packager files Gerald Pfeifer
-- strict thread matches above, loose matches on Subject: below --
2008-06-12 20:59 Joshua Sumali
2008-06-13 10:40 ` Andrew Haley
2008-06-13 11:35 ` Andrew Haley
2008-06-16 13:57 ` Joshua Sumali
2008-06-13 12:52 ` Matthias Klose
2008-06-18 20:50 ` Joshua Sumali
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).