summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorjbj <devnull@localhost>2005-07-12 11:29:05 +0000
committerjbj <devnull@localhost>2005-07-12 11:29:05 +0000
commit378fa2a5acc1acac4da88dacba76644ea331bad4 (patch)
tree2667774d7512fa96d6cd2e1e2fd52f2d82126ffe /scripts
parenta237ec26e0ac5e2442c96803c98f85bf7df33baf (diff)
downloadrpm-378fa2a5acc1acac4da88dacba76644ea331bad4.tar.gz
rpm-378fa2a5acc1acac4da88dacba76644ea331bad4.tar.bz2
rpm-378fa2a5acc1acac4da88dacba76644ea331bad4.zip
- added brp-java-gcjcompile build helper.
CVS patchset: 7872 CVS date: 2005/07/12 11:29:05
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.am4
-rw-r--r--scripts/brp-java-gcjcompile40
2 files changed, 42 insertions, 2 deletions
diff --git a/scripts/Makefile.am b/scripts/Makefile.am
index 2d18b0a99..68847c54b 100644
--- a/scripts/Makefile.am
+++ b/scripts/Makefile.am
@@ -3,7 +3,7 @@
AUTOMAKE_OPTIONS = 1.4 foreign
EXTRA_DIST = \
- brp-compress brp-python-bytecompile brp-redhat \
+ brp-compress brp-python-bytecompile brp-java-gcjcompile brp-redhat \
brp-strip brp-strip-comment-note \
brp-strip-shared brp-strip-static-archive brp-sparc64-linux \
check-files check-prereqs convertrpmrc.sh cross-build \
@@ -24,7 +24,7 @@ all:
configdir = ${prefix}/lib/rpm
config_SCRIPTS = \
- brp-compress brp-python-bytecompile brp-redhat \
+ brp-compress brp-python-bytecompile brp-java-gcjcompile brp-redhat \
brp-strip brp-strip-comment-note \
brp-strip-shared brp-strip-static-archive brp-sparc64-linux \
check-files check-prereqs convertrpmrc.sh cross-build \
diff --git a/scripts/brp-java-gcjcompile b/scripts/brp-java-gcjcompile
new file mode 100644
index 000000000..708a64952
--- /dev/null
+++ b/scripts/brp-java-gcjcompile
@@ -0,0 +1,40 @@
+#!/bin/sh
+
+# If using normal root, avoid changing anything.
+[ -z "$RPM_BUILD_ROOT" -o "$RPM_BUILD_ROOT" = "/" ] && exit 0
+
+# If we are a noarch package, avoid changing anything.
+[ "$RPM_ARCH" = "noarch" ] && exit 0
+
+# If we don't have the required executables, avoid changing anything.
+gcj=${1:-/usr/bin/gcj}
+[ ! -x "$gcj" -o ! -x "$gcj-dbtool" ] && exit 0
+
+# Now get to work...
+libdir="/usr/lib" # XXX need to sed this in or something
+dbdir=`gcj-dbtool -p "$libdir"`.d/"$RPM_PACKAGE_NAME-$RPM_PACKAGE_VERSION"
+cflags="$RPM_OPT_FLAGS -fPIC -findirect-dispatch"
+ldflags="-Wl,-Bsymbolic"
+
+# XXX make it so you can override the list, for mx4j et al.
+for jar in `find $RPM_BUILD_ROOT -type f -name "*.?ar"`; do
+ [ `head -c 2 "$jar"` != "PK" ] && continue
+
+ [ -d "$RPM_BUILD_ROOT/$libdir" ] || mkdir -p "$RPM_BUILD_ROOT/$libdir"
+
+ lib="$libdir/lib`basename $jar`.so"
+ [ -f "$RPM_BUILD_ROOT/$lib" ] && continue
+
+ # XXX need splits to handle #158308
+ # (til then we can just compile big ones ourselves)
+ echo "$PS4$gcj -shared $cflags $ldflags -o $lib $jar"
+ $gcj -shared $cflags $ldflags -o "$RPM_BUILD_ROOT/$lib" "$jar"
+
+ [ -d "$RPM_BUILD_ROOT/$dbdir" ] || mkdir -p "$RPM_BUILD_ROOT/$dbdir"
+
+ db="$dbdir/`basename $jar`.db"
+ [ -f "$RPM_BUILD_ROOT/$db" ] && exit 1
+
+ $gcj-dbtool -n "$RPM_BUILD_ROOT/$db" 64
+ $gcj-dbtool -f "$RPM_BUILD_ROOT/$db" "$jar" "$lib"
+done