|
|
869034e |
diff -up frysk-0.4/frysk-common/frysk-common.ac.jni frysk-0.4/frysk-common/frysk-common.ac
|
|
|
6a61aff |
--- frysk-0.4/frysk-common/frysk-common.ac.jni 2016-04-13 10:57:04.450272141 -0400
|
|
|
6a61aff |
+++ frysk-0.4/frysk-common/frysk-common.ac 2016-04-13 10:57:04.468272119 -0400
|
|
|
869034e |
@@ -43,9 +43,6 @@
|
|
|
869034e |
|
|
|
869034e |
AC_CANONICAL_HOST
|
|
|
869034e |
|
|
|
869034e |
-
|
|
|
869034e |
-AC_ARG_VAR([GCJFLAGS], [GCJ compiler flags])
|
|
|
869034e |
-
|
|
|
869034e |
dnl This test is used by `elfutils' and as we share its interface we need
|
|
|
869034e |
dnl to have consistent ABI of any structures possibly containing `off_t'.
|
|
|
869034e |
dnl This test must come as early as possible after the compiler configuration
|
|
|
869034e |
@@ -76,34 +73,7 @@ if test "x$ac_env_CFLAGS_set" != xset; t
|
|
|
869034e |
fi
|
|
|
869034e |
|
|
|
869034e |
AM_PROG_AS
|
|
|
869034e |
-
|
|
|
869034e |
-# XXX: AM_PROG_GCJ doesn't take arguments, hack around it by first
|
|
|
869034e |
-# explictly searching for the GCJ program pushing it into the
|
|
|
869034e |
-# environment where AM_PROG_GCJ will find it.
|
|
|
869034e |
-
|
|
|
869034e |
-AC_CHECK_PROGS([GCJ], [gcj4 gcj], [gcj])
|
|
|
869034e |
AM_PROG_GCJ
|
|
|
869034e |
-if test "x$ac_env_GCJFLAGS_set" != xset; then
|
|
|
869034e |
- test x"$GCJFLAGS" = "x-g -O2" && GCJFLAGS="-g -O"
|
|
|
869034e |
-fi
|
|
|
869034e |
-
|
|
|
869034e |
-# Find all the GCJ utilities. Prefer gcc4.
|
|
|
869034e |
-
|
|
|
869034e |
-AC_CHECK_PROGS([GCJH], [gcjh4 gcjh gjavah])
|
|
|
869034e |
-# gjavah defaults to jni, while gcjh defaults to cni.
|
|
|
869034e |
-# gcjh doesn't support -cni, only -jni.
|
|
|
869034e |
-GCJHFLAGS=""
|
|
|
869034e |
-test x"${GCJH}" = xgjavah && GCJHFLAGS="-cni"
|
|
|
869034e |
-AC_SUBST([GCJHFLAGS])
|
|
|
869034e |
-AC_CHECK_PROGS([JAR], [fastjar4 fastjar jar], [fastjar])
|
|
|
869034e |
-AC_CHECK_PROGS([GCJ_DBTOOL], [gcj-dbtool4 gcj-dbtool], [gcj-dbtool])
|
|
|
869034e |
-AC_CHECK_PROGS([GIJ], [gij4 gij], [gij])
|
|
|
869034e |
-
|
|
|
869034e |
-# GCJ for Java 1.5 does not include jv-scan. If it wasn't found, mark
|
|
|
869034e |
-# it as such.
|
|
|
869034e |
-AC_CHECK_PROGS([JV_SCAN], [jv-scan4 jv-scan], [no])
|
|
|
869034e |
-AM_CONDITIONAL([HAVE_JV_SCAN], test x"${JV_SCAN}" != xno)
|
|
|
869034e |
-
|
|
|
869034e |
|
|
|
869034e |
# Check for the ECJ compiler.
|
|
|
869034e |
|
|
|
869034e |
@@ -125,63 +95,15 @@ AC_DEFUN([AC_LANG_COMPILER(Java)], [])
|
|
|
869034e |
AU_DEFUN([AC_LANG_JAVAC], [AC_LANG(Java)])
|
|
|
869034e |
AC_LANG(Java)
|
|
|
869034e |
|
|
|
869034e |
-
|
|
|
869034e |
-# Two possible compilers: either GCJ (wrapper round ECJ); or ECJ. In
|
|
|
869034e |
-# the latter case, need to explicitly run compiler from within the GIJ
|
|
|
869034e |
-# runtime so that ECJ sees the classpath environment, in particular
|
|
|
869034e |
-# things like gnu.gcj.RawDataManaged. Start out assuming GCJ (with
|
|
|
869034e |
-# the -fsource=1.4 flag), if that fails, fall back to ECJ.
|
|
|
869034e |
-
|
|
|
869034e |
-# See gcj accepts -fsource=1.4, if not only use the warning flags. If
|
|
|
869034e |
-# it is available also use it for the GCJFLAGS.
|
|
|
869034e |
-
|
|
|
869034e |
-AC_MSG_CHECKING([for working java compiler])
|
|
|
869034e |
-JAVAC=${JAVAC:-${GCJ} -C -fsource=1.4}
|
|
|
869034e |
-JAVACFLAGS=${JAVACFLAGS:-${GCJFLAGS} -g -classpath \$(SOURCEPATH):\$(CLASSPATH)}
|
|
|
869034e |
-AC_COMPILE_IFELSE([public class conftest{}],
|
|
|
869034e |
- [JAVAC_IS=gcj
|
|
|
869034e |
- if test "x$ac_env_GCJFLAGS_set" != xset; then
|
|
|
869034e |
- GCJFLAGS="$GCJFLAGS -fsource=1.4"
|
|
|
869034e |
- fi],
|
|
|
869034e |
- [JAVAC_IS=ecj
|
|
|
869034e |
- JAVAC='$(GIJ) --classpath $(ECJ_JAR):$(CLASSPATH) org.eclipse.jdt.internal.compiler.batch.Main -1.4'
|
|
|
869034e |
- JAVACFLAGS='-warn:+semicolon -sourcepath $(SOURCEPATH) -classpath $(CLASSPATH)'])
|
|
|
869034e |
+JAVAC='$(JAVA) -cp $(ECJ_JAR):$(CLASSPATH) org.eclipse.jdt.internal.compiler.batch.Main -1.4'
|
|
|
869034e |
+JAVACFLAGS='-warn:+semicolon -sourcepath $(SOURCEPATH) -classpath $(CLASSPATH)'
|
|
|
869034e |
AC_SUBST([JAVAC])
|
|
|
869034e |
AC_SUBST([JAVACFLAGS])
|
|
|
869034e |
-AC_SUBST([JAVAC_IS])
|
|
|
869034e |
-AC_MSG_RESULT([${JAVAC_IS} ($JAVAC)])
|
|
|
869034e |
-
|
|
|
869034e |
-# Some versions of gcj don't support -Wall. Some versions generate
|
|
|
869034e |
-# good warnings without it. So explictily test for it.
|
|
|
869034e |
-
|
|
|
869034e |
-AC_MSG_CHECKING([whether GCJ needs -Wall])
|
|
|
869034e |
-if test "x$ac_env_GCJFLAGS_set" == xset ; then
|
|
|
869034e |
- GCJ_WALL="not needed"
|
|
|
869034e |
-elif test x"${JAVAC_IS}" = xgcj ; then
|
|
|
869034e |
- # A newer GCJ (using it for JAVAC) which has a good
|
|
|
869034e |
- # default set of warnings so do not need -Wall. However,
|
|
|
869034e |
- # older GCJs barf on stray semicolons so always check for them
|
|
|
869034e |
- # to help with compatibility.
|
|
|
869034e |
- GCJ_WALL=-Wextraneous-semicolon
|
|
|
869034e |
- JAVACFLAGS="$JAVACFLAGS ${GCJ_WALL}"
|
|
|
869034e |
- GCJFLAGS="$GCJFLAGS ${GCJ_WALL}"
|
|
|
869034e |
-else
|
|
|
869034e |
- # Older GCJ (not using it for JAVAC) need the full gamit.
|
|
|
869034e |
- GCJ_WALL="-Wextraneous-semicolon -Wall"
|
|
|
869034e |
- GCJFLAGS="$GCJFLAGS ${GCJ_WALL}"
|
|
|
869034e |
-fi
|
|
|
869034e |
-AC_MSG_RESULT([${GCJ_WALL}])
|
|
|
869034e |
-
|
|
|
869034e |
|
|
|
869034e |
-# Always use GIJ as the byte code interpreter. java programs, run
|
|
|
869034e |
-# during the build, need to see the GNU Java environment. That
|
|
|
869034e |
-# environment contains classes such as gnu.gcj.RawData which can be
|
|
|
869034e |
-# found using reflection.
|
|
|
869034e |
-
|
|
|
869034e |
-JAVA="${JAVA:-$GIJ}"
|
|
|
869034e |
+JAVA="${JAVA:-java}"
|
|
|
869034e |
AC_SUBST([JAVA])
|
|
|
869034e |
|
|
|
869034e |
-
|
|
|
869034e |
+AC_CHECK_PROGS([JAR], [fastjar4 fastjar jar], [fastjar])
|
|
|
869034e |
# Check for the availablity of fig2dev
|
|
|
869034e |
|
|
|
869034e |
AC_PATH_PROG(FIG2DEV, fig2dev)
|
|
|
869034e |
@@ -247,15 +169,3 @@ AC_SUBST([lib64dir])
|
|
|
869034e |
FRYSK_DO_ARCH32_TEST
|
|
|
869034e |
FRYSK_WERROR
|
|
|
869034e |
FRYSK_COVERAGE
|
|
|
869034e |
-
|
|
|
869034e |
-AC_MSG_CHECKING([direct .jar to .o compilation (--enable-jar-compile)])
|
|
|
869034e |
-AC_ARG_ENABLE([jar-compile],
|
|
|
869034e |
- [ --enable-jar-compile Enable direct compilation of jars],
|
|
|
869034e |
- [case "${enableval}" in
|
|
|
869034e |
- yes) jar_compile=yes ;;
|
|
|
869034e |
- no) jar_compile=no;;
|
|
|
869034e |
- *) AC_MSG_ERROR([bad value ${enableval} for --enable-jar-compile]) ;;
|
|
|
869034e |
- esac],
|
|
|
869034e |
- [jar_compile=yes])
|
|
|
869034e |
-AC_MSG_RESULT([$jar_compile])
|
|
|
869034e |
-AM_CONDITIONAL([JAR_COMPILE], [test x$jar_compile = xyes])
|
|
|
869034e |
diff -up frysk-0.4/frysk-common/Makefile.gen.sh.jni frysk-0.4/frysk-common/Makefile.gen.sh
|
|
|
6a61aff |
--- frysk-0.4/frysk-common/Makefile.gen.sh.jni 2016-04-13 10:57:04.452272139 -0400
|
|
|
6a61aff |
+++ frysk-0.4/frysk-common/Makefile.gen.sh 2016-04-13 10:57:04.468272119 -0400
|
|
|
869034e |
@@ -40,10 +40,7 @@
|
|
|
869034e |
|
|
|
869034e |
if test $# -eq 0 ; then
|
|
|
869034e |
cat <<EOF 1>&2
|
|
|
869034e |
-Usage: $0 [ --cni | --jni ] <source-dir>... <.jar-file>... <_JAR-macro>...
|
|
|
869034e |
-
|
|
|
869034e |
---cni: Include CNI directories in build.
|
|
|
869034e |
---jni: Include JNI directories in build and build with JNI abi.
|
|
|
869034e |
+Usage: $0 <source-dir>... <.jar-file>... <_JAR-macro>...
|
|
|
869034e |
|
|
|
869034e |
<source-dir>:
|
|
|
869034e |
|
|
|
869034e |
@@ -66,8 +63,6 @@ EOF
|
|
|
869034e |
exit 1
|
|
|
869034e |
fi
|
|
|
869034e |
|
|
|
869034e |
-cni=false
|
|
|
869034e |
-jni=false
|
|
|
869034e |
dirs=
|
|
|
869034e |
jars=
|
|
|
869034e |
JARS=
|
|
|
869034e |
@@ -75,8 +70,6 @@ GEN_ARGS="$@"
|
|
|
869034e |
while test $# -gt 0
|
|
|
869034e |
do
|
|
|
869034e |
case "$1" in
|
|
|
869034e |
- --cni ) cni=true ;;
|
|
|
869034e |
- --jni ) jni=true ;;
|
|
|
869034e |
*.jar ) jars="${jars} $1" ;;
|
|
|
869034e |
*_JAR ) JARS="${JARS} $1" ;;
|
|
|
869034e |
* ) dirs="${dirs} $1" ;;
|
|
|
869034e |
@@ -121,13 +114,10 @@ JARS=`echo ${JARS}`
|
|
|
869034e |
-o -path '[A-Za-z]*\.cxx-in' -print \
|
|
|
869034e |
-o -path '[A-Za-z]*\.c-in' -print \
|
|
|
869034e |
-o -path '[A-Za-z]*\.cxx' -print \
|
|
|
869034e |
- -o -path '*/cni/[A-Za-z]*\.[sS]' -print \
|
|
|
869034e |
-o -path '*/jni/[A-Za-z]*\.[sS]' -print \
|
|
|
869034e |
-o -type f -name 'test*' -print
|
|
|
869034e |
) \
|
|
|
869034e |
-| if $cni ; then cat ; else grep -v '/cni/' ; fi \
|
|
|
869034e |
-| if $jni ; then cat ; else grep -v '/jni/' ; fi \
|
|
|
869034e |
-| sort -f > files.tmp
|
|
|
869034e |
+| grep -v -e '\/cni\/' | sort -f > files.tmp
|
|
|
869034e |
|
|
|
869034e |
if cmp files.tmp files.list > /dev/null 2>&1
|
|
|
869034e |
then
|
|
|
869034e |
@@ -404,19 +394,11 @@ print_jar_rule ()
|
|
|
869034e |
# print_jar_rule $1 $2
|
|
|
869034e |
$1.jar: \$($2_JAR)
|
|
|
869034e |
cp \$($2_JAR) $1.jar
|
|
|
869034e |
-BUILT_SOURCES += $1.jar
|
|
|
869034e |
+#BUILT_SOURCES += $1.jar
|
|
|
869034e |
+# For moment bundle these into frysk's private java directory
|
|
|
869034e |
+java_DATA += $1.jar
|
|
|
869034e |
GEN_JARS += $1.jar
|
|
|
869034e |
-noinst_LIBRARIES += libfrysk-$1.a
|
|
|
869034e |
-libfrysk_$1_a_LIBADD = $1.o
|
|
|
869034e |
-$1.o: $1.jar
|
|
|
869034e |
-libfrysk_$1_a_SOURCES =
|
|
|
869034e |
-libfrysk_$1_so_SOURCES =
|
|
|
869034e |
-frysk_$1_db_SOURCES =
|
|
|
869034e |
-CLEANFILES += $1.jar $1.o libfrysk-$1.a libfrysk-$1.so
|
|
|
869034e |
-libfrysk-$1.so: libfrysk-$1.a
|
|
|
869034e |
-noinst_PROGRAMS += frysk-$1.db
|
|
|
869034e |
-solib_PROGRAMS += libfrysk-$1.so
|
|
|
869034e |
-frysk-$1.db: libfrysk-$1.so $1.jar
|
|
|
869034e |
+CLEANFILES += $1.jar
|
|
|
869034e |
EOF
|
|
|
869034e |
}
|
|
|
869034e |
|
|
|
869034e |
@@ -458,32 +440,8 @@ done
|
|
|
869034e |
|
|
|
869034e |
test x"${dirs}" = x && exit 0
|
|
|
869034e |
|
|
|
869034e |
-
|
|
|
869034e |
-print_header "... the lib${GEN_DIRNAME}.a skeleton"
|
|
|
869034e |
-
|
|
|
869034e |
-sources=lib${GEN_MAKENAME}_a_SOURCES
|
|
|
869034e |
-
|
|
|
869034e |
-# Most of the directory's sources will be built into a single archive
|
|
|
869034e |
-# (.a). Start with a skeleton for that archive and then accumulate
|
|
|
869034e |
-# the relevant files.
|
|
|
869034e |
-automake_variable ${sources} =
|
|
|
869034e |
-
|
|
|
869034e |
cat <
|
|
|
869034e |
|
|
|
869034e |
-noinst_LIBRARIES += lib${GEN_DIRNAME}.a
|
|
|
869034e |
-if JAR_COMPILE
|
|
|
869034e |
-${sources} += ${GEN_DIRNAME}.jar
|
|
|
869034e |
-endif
|
|
|
869034e |
-GEN_GCJ_LDADD_LIST += lib${GEN_DIRNAME}.a
|
|
|
869034e |
-
|
|
|
869034e |
-# Compile the .a into a .so; Makefile.rules contains the rule and does
|
|
|
869034e |
-# not use libtool.
|
|
|
869034e |
-
|
|
|
869034e |
-solib_PROGRAMS += lib${GEN_DIRNAME}.so
|
|
|
869034e |
-lib${GEN_MAKENAME}_so_SOURCES =
|
|
|
869034e |
-lib${GEN_DIRNAME}.so: lib${GEN_DIRNAME}.a
|
|
|
869034e |
-
|
|
|
869034e |
-
|
|
|
869034e |
# Using that list, convert to .class files and from there to a .jar.
|
|
|
869034e |
# Since java compilers don't abort on a warning, fake the behavior by
|
|
|
869034e |
# checking for any output.
|
|
|
869034e |
@@ -491,14 +449,6 @@ lib${GEN_DIRNAME}.so: lib${GEN_DIRNAME}.
|
|
|
869034e |
java_DATA += ${GEN_DIRNAME}.jar
|
|
|
869034e |
CLEANFILES += ${GEN_DIRNAME}.jar
|
|
|
869034e |
|
|
|
869034e |
-# Finally, merge the .so and .jar files into the java .db file.
|
|
|
869034e |
-
|
|
|
869034e |
-noinst_PROGRAMS += ${GEN_DIRNAME}.db
|
|
|
869034e |
-${GEN_MAKENAME}_db_SOURCES =
|
|
|
869034e |
-${GEN_DIRNAME}.db: lib${GEN_DIRNAME}.so ${GEN_DIRNAME}.jar
|
|
|
869034e |
- \$(GCJ_DBTOOL) -n \$@.tmp
|
|
|
869034e |
- \$(GCJ_DBTOOL) -a \$@.tmp ${GEN_DIRNAME}.jar lib${GEN_DIRNAME}.so
|
|
|
869034e |
- mv \$@.tmp \$@
|
|
|
869034e |
EOF
|
|
|
869034e |
|
|
|
869034e |
|
|
|
869034e |
@@ -506,18 +456,13 @@ EOF
|
|
|
869034e |
# Test runner program.
|
|
|
869034e |
|
|
|
869034e |
cat <
|
|
|
869034e |
-TestRunner_SOURCES = TestRunner.java
|
|
|
869034e |
CLEANFILES += TestRunner.java
|
|
|
869034e |
-if !JAR_COMPILE
|
|
|
869034e |
-${sources} += ${GEN_SOURCENAME}/JUnitTests.java
|
|
|
869034e |
-endif
|
|
|
869034e |
BUILT_SOURCES += ${GEN_SOURCENAME}/JUnitTests.java
|
|
|
869034e |
SCRIPT_BUILT += ${GEN_SOURCENAME}/JUnitTests.java
|
|
|
869034e |
TESTS += TestRunner
|
|
|
869034e |
-noinst_PROGRAMS += TestRunner Runner JniRunner
|
|
|
869034e |
+noinst_PROGRAMS += Runner TestRunner
|
|
|
869034e |
noinst_DATA += TestRunner.jar
|
|
|
869034e |
EOF
|
|
|
869034e |
-echo_LDFLAGS TestRunner
|
|
|
869034e |
|
|
|
869034e |
|
|
|
869034e |
# Generate SOURCES list for all files.
|
|
|
869034e |
@@ -537,19 +482,37 @@ for suffix in .java .java-sh .mkenum .sh
|
|
|
869034e |
test "${b}" = JUnitTests && continue # hack
|
|
|
869034e |
test -r "${d}/${b}.g" && continue
|
|
|
869034e |
test -r "${d}/${b}.sed" && continue
|
|
|
869034e |
- echo "if !JAR_COMPILE"
|
|
|
869034e |
- echo "${sources} += ${file}"
|
|
|
869034e |
- echo "endif"
|
|
|
869034e |
;;
|
|
|
869034e |
esac
|
|
|
869034e |
echo "${GEN_DIRNAME}.jar: ${name}.java"
|
|
|
869034e |
if has_main ${file} ; then
|
|
|
869034e |
name_=`echo_name_ ${name}`
|
|
|
869034e |
- echo_PROGRAMS ${name}
|
|
|
869034e |
check_MANS ${name}
|
|
|
869034e |
- echo "${name_}_SOURCES ="
|
|
|
869034e |
- echo "${name_}_LINK = \$(GCJLINK) \$(${name_}_LDFLAGS)"
|
|
|
869034e |
- echo_LDFLAGS ${name}
|
|
|
869034e |
+ dir=`echo /"${name}" | sed -e 's,.*/\([a-z]*\)dir/.*,\1,'`
|
|
|
869034e |
+ case "${name}" in
|
|
|
869034e |
+ *.java-in )
|
|
|
869034e |
+ # .java-in programs are never installed.
|
|
|
869034e |
+ echo "noinst_SCRIPTS += ${name}"
|
|
|
869034e |
+ ;;
|
|
|
869034e |
+ *pkglibdir/* )
|
|
|
869034e |
+ echo "noinst_SCRIPTS += ${name}"
|
|
|
869034e |
+ ;;
|
|
|
869034e |
+ *dir/* )
|
|
|
869034e |
+ # extract the directory prefix
|
|
|
869034e |
+ echo "${dir}_SCRIPTS += ${name}"
|
|
|
869034e |
+ ;;
|
|
|
869034e |
+ * )
|
|
|
869034e |
+ echo "noinst_SCRIPTS += ${name}"
|
|
|
869034e |
+ ;;
|
|
|
869034e |
+ esac
|
|
|
869034e |
+ cat <
|
|
|
869034e |
+${name}: Makefile
|
|
|
869034e |
+ mkdir -p ${d}
|
|
|
869034e |
+ echo "#!/bin/sh" >> ${name}.tmp
|
|
|
869034e |
+ echo exec /usr/bin/java -cp \"\$(javadir)/*\" ${name} \"\\\$\$@\" >> ${name}.tmp
|
|
|
869034e |
+ chmod a+x ${name}.tmp
|
|
|
869034e |
+ mv ${name}.tmp ${name}
|
|
|
869034e |
+EOF
|
|
|
869034e |
fi
|
|
|
869034e |
done || exit 1
|
|
|
869034e |
done
|
|
|
869034e |
@@ -566,9 +529,6 @@ for suffix in .java-in .java-sh .mkenum
|
|
|
869034e |
d=`dirname ${file}`
|
|
|
869034e |
b=`basename ${file} ${suffix}`
|
|
|
869034e |
name="${d}/${b}${s}"
|
|
|
869034e |
- echo "if !JAR_COMPILE"
|
|
|
869034e |
- echo "${sources} += ${file}"
|
|
|
869034e |
- echo "endif"
|
|
|
869034e |
echo "BUILT_SOURCES += ${name}"
|
|
|
869034e |
echo "SCRIPT_BUILT += ${name}"
|
|
|
869034e |
case "${suffix}" in
|
|
|
869034e |
@@ -598,7 +558,7 @@ generate_compile ()
|
|
|
869034e |
fi
|
|
|
869034e |
# Generate the rules for 32-bit compile
|
|
|
869034e |
echo_arch32_PROGRAMS ${name} ${name}.${suffix}
|
|
|
869034e |
- else
|
|
|
869034e |
+ elif test x"${sources}" != x- ; then
|
|
|
869034e |
automake_variable ${sources} += ${file}
|
|
|
869034e |
fi
|
|
|
869034e |
case "${file}" in
|
|
|
869034e |
@@ -618,60 +578,6 @@ generate_compile ()
|
|
|
869034e |
esac
|
|
|
869034e |
}
|
|
|
869034e |
|
|
|
869034e |
-# What type of build?
|
|
|
869034e |
-if $cni ; then
|
|
|
869034e |
- : default
|
|
|
869034e |
-elif $jni ; then
|
|
|
869034e |
- echo "AM_GCJFLAGS += -fjni"
|
|
|
869034e |
-else
|
|
|
869034e |
- : default
|
|
|
869034e |
-fi
|
|
|
869034e |
-
|
|
|
869034e |
-# Grep the *.cxx and *.hxx files forming a list of included files.
|
|
|
869034e |
-# Assume these are all generated from .class files found in the master
|
|
|
869034e |
-# .jar.
|
|
|
869034e |
-
|
|
|
869034e |
-generate_cni_header () {
|
|
|
869034e |
- local file=$1
|
|
|
869034e |
- local d=$2
|
|
|
869034e |
- local b=$3
|
|
|
869034e |
- local suffix=$4
|
|
|
869034e |
- local _file=`echo $file | tr '[/.]' '[__]'`
|
|
|
869034e |
- sed -n \
|
|
|
869034e |
- -e 's,#include "\(.*\)\.h".*,include - \1,p' \
|
|
|
869034e |
- -e 's,#include \([A-Z][A-Z0-9_]*\).*,minclude \1 -,p' \
|
|
|
869034e |
- -e 's,#define \([A-Z0-9_]*\) "\(.*\)\.h".*,define \1 \2,p' \
|
|
|
869034e |
- < $file > $$.tmp
|
|
|
869034e |
- while read action m h j; do
|
|
|
869034e |
- echo "# file=$file action=$action m=$m h=$h"
|
|
|
869034e |
- if test "$action" = "minclude" ; then
|
|
|
869034e |
- # Assume file defining macro depends on this file
|
|
|
869034e |
- automake_variable $m = \$\($_file\)
|
|
|
869034e |
- elif has_java_source ${h} ; then
|
|
|
869034e |
- echo "JAVAH_CNI_BUILT += ${h}.h"
|
|
|
869034e |
- echo "CLEANFILES += ${h}.h"
|
|
|
869034e |
- echo "CLEANFILES += ${h}\\\$\$*.h"
|
|
|
869034e |
- j=`echo ${h} | tr '[_]' '[/]'`
|
|
|
869034e |
- echo "${h}.h: $j.java | ${GEN_DIRNAME}.jar"
|
|
|
869034e |
- case $action in
|
|
|
869034e |
- include)
|
|
|
869034e |
- case "$suffix" in
|
|
|
869034e |
- cxx) echo "$d/$b.o: ${h}.h" ;;
|
|
|
869034e |
- hxx) # remember what this file includes
|
|
|
869034e |
- automake_variable $_file += ${h}.h ;;
|
|
|
869034e |
- esac
|
|
|
869034e |
- ;;
|
|
|
869034e |
- define)
|
|
|
869034e |
- echo "$d/$b.o: ${h}.h"
|
|
|
869034e |
- # Assume file using this macro is a dependency.
|
|
|
869034e |
- echo "$d/$b.o: \$($m)"
|
|
|
869034e |
- ;;
|
|
|
869034e |
- esac
|
|
|
869034e |
- fi
|
|
|
869034e |
- done < $$.tmp
|
|
|
869034e |
- rm -f $$.tmp
|
|
|
869034e |
-}
|
|
|
869034e |
-
|
|
|
869034e |
# Grep the *.cxx and *.hxx files forming a list of classes that are
|
|
|
869034e |
# native.
|
|
|
869034e |
|
|
|
869034e |
@@ -785,9 +691,6 @@ BEGIN { FS = "=" }
|
|
|
869034e |
echo "$d/$c: $d/$b.antlred"
|
|
|
869034e |
echo "BUILT_SOURCES += $d/$c"
|
|
|
869034e |
echo "ANTLR_BUILT += $d/$c"
|
|
|
869034e |
- echo "if !JAR_COMPILE"
|
|
|
869034e |
- echo "${sources} += $d/$c"
|
|
|
869034e |
- echo "endif"
|
|
|
869034e |
done
|
|
|
869034e |
done
|
|
|
869034e |
|
|
|
869034e |
@@ -884,10 +787,6 @@ while read file dir base suffix ; do
|
|
|
869034e |
echo ""
|
|
|
869034e |
|
|
|
869034e |
case $file in
|
|
|
869034e |
- */cni/*.cxx | */cni/*.cxx-in | */cni/*.cxx-sh | */cni/*.hxx)
|
|
|
869034e |
- generate_cni_header $file $dir $base $suffix
|
|
|
869034e |
- generate_compile $file $dir $base $suffix ${sources}
|
|
|
869034e |
- ;;
|
|
|
869034e |
*/jni/*.cxx | */jni/*.cxx-in | */jni/*.cxx-sh | jnixx/*.cxx )
|
|
|
869034e |
generate_jnixx_class $file $dir $base $suffix
|
|
|
869034e |
generate_compile $file $dir $base $suffix \
|
|
|
869034e |
@@ -897,8 +796,8 @@ while read file dir base suffix ; do
|
|
|
869034e |
;;
|
|
|
869034e |
*.cxx | *.c | *.S | *.cxx-in | *.c-in | *.S-in \
|
|
|
869034e |
| *.cxx-sh | *.c-sh | *.S-sh )
|
|
|
869034e |
- # Non-cni/jni source.
|
|
|
869034e |
- generate_compile $file $dir $base $suffix ${sources}
|
|
|
869034e |
+ # Non-jni source (presumably with main).
|
|
|
869034e |
+ generate_compile $file $dir $base $suffix -
|
|
|
869034e |
;;
|
|
|
869034e |
esac
|
|
|
869034e |
|
|
|
869034e |
diff -up frysk-0.4/frysk-common/Makefile.rules.jni frysk-0.4/frysk-common/Makefile.rules
|
|
|
6a61aff |
--- frysk-0.4/frysk-common/Makefile.rules.jni 2016-04-13 10:57:04.461272128 -0400
|
|
|
6a61aff |
+++ frysk-0.4/frysk-common/Makefile.rules 2016-04-13 10:57:04.468272119 -0400
|
|
|
869034e |
@@ -77,7 +77,6 @@ man_MANS =
|
|
|
869034e |
LDADD =
|
|
|
869034e |
ANTLR_BUILT =
|
|
|
869034e |
SCRIPT_BUILT =
|
|
|
869034e |
-JAVAH_CNI_BUILT =
|
|
|
869034e |
root_srcdir = $(dir $(top_srcdir))
|
|
|
869034e |
abs_root_srcdir = $(dir $(abs_top_srcdir))
|
|
|
869034e |
|
|
|
869034e |
@@ -140,21 +139,6 @@ ACLOCAL_AMFLAGS = -I common/m4
|
|
|
869034e |
|
|
|
869034e |
SOURCEPATH = $(subst $(space),:,$(strip $(GEN_SOURCEPATH)))
|
|
|
869034e |
CLASSPATH = $(subst $(space),:,$(strip $(GEN_CLASSPATH)))
|
|
|
869034e |
-DBPATH = $(subst $(space),:,$(strip \
|
|
|
869034e |
- $(patsubst %.jar,%.db,$(filter %.jar,$(GEN_CLASSPATH))) \
|
|
|
869034e |
- $(foreach dir,$(patsubst %/$(JAVAROOT),%,$(filter-out %.jar,$(GEN_CLASSPATH))),$(dir)/$(notdir $(dir)).db) \
|
|
|
869034e |
- ))
|
|
|
869034e |
-
|
|
|
869034e |
-# XXX: GCJ: I think there should be a -Wextraneous-throws; I think
|
|
|
869034e |
-# -Wno-deprecated is backward; I think -Wredundant-modifiers is broken
|
|
|
869034e |
-# with gcc4. It appears to complain about abstract methods in a
|
|
|
869034e |
-# non-abstract class when the class actually is abstract.
|
|
|
869034e |
-
|
|
|
869034e |
-AM_GCJFLAGS = \
|
|
|
869034e |
- $(patsubst %,-I%,$(GEN_SOURCEPATH) $(GEN_CLASSPATH)) \
|
|
|
869034e |
- -fPIC \
|
|
|
869034e |
- $(ZZZ)
|
|
|
869034e |
-
|
|
|
869034e |
|
|
|
869034e |
AM_CXXFLAGS = \
|
|
|
869034e |
-I$(srcdir) \
|
|
|
869034e |
@@ -163,6 +147,7 @@ AM_CXXFLAGS = \
|
|
|
869034e |
-I/usr/include/elfutils \
|
|
|
869034e |
-I$(srcdir)/../frysk-imports/libunwind/include \
|
|
|
869034e |
-I$(top_builddir)/../frysk-imports/libunwind/include \
|
|
|
869034e |
+ -I/usr/lib/jvm/java/include -I/usr/lib/jvm/java/include/linux \
|
|
|
869034e |
-fPIC \
|
|
|
869034e |
$(ZZZ)
|
|
|
869034e |
|
|
|
869034e |
@@ -192,7 +177,6 @@ jni: ${GEN_DIRNAME}.jar
|
|
|
869034e |
.PHONY: built-sources
|
|
|
869034e |
built-sources: $(BUILT_SOURCES)
|
|
|
869034e |
$(ANTLR_BUILT): | $(SCRIPT_BUILT)
|
|
|
869034e |
-$(JAVAH_CNI_BUILT): | $(SCRIPT_BUILT) $(ANTLR_BUILT)
|
|
|
869034e |
|
|
|
869034e |
|
|
|
869034e |
# Rules for building a .java file from any of a .mkclass file, a
|
|
|
869034e |
@@ -345,8 +329,6 @@ TestRunner.jar: TestRunner.java
|
|
|
869034e |
# Make gets confused about which root to build TestRunner.o from -
|
|
|
869034e |
# .jar or .java, spell it out.
|
|
|
869034e |
|
|
|
869034e |
-TestRunner.o: TestRunner.java
|
|
|
869034e |
- $(GCJCOMPILE) -c $<
|
|
|
869034e |
TestRunner.java: common/TestRunner.java-in
|
|
|
869034e |
$(SUBST)
|
|
|
869034e |
|
|
|
869034e |
@@ -404,37 +386,13 @@ Runner:
|
|
|
869034e |
chmod a+x $@.tmp
|
|
|
869034e |
mv $@.tmp $@
|
|
|
869034e |
|
|
|
869034e |
-JniRunner:
|
|
|
869034e |
+TestRunner:
|
|
|
869034e |
rm -f $@
|
|
|
869034e |
echo "#!/bin/sh" >> $@.tmp
|
|
|
869034e |
echo "exec ./Runner TestRunner \"\$$@\"" >> $@.tmp
|
|
|
869034e |
chmod a+x $@.tmp
|
|
|
869034e |
mv $@.tmp $@
|
|
|
869034e |
|
|
|
869034e |
-# Generate one or more .h files, one per named class, and using CNI,
|
|
|
869034e |
-# from the corresponding .java file. Anonymous classes are pruned.
|
|
|
869034e |
-
|
|
|
869034e |
-# This assumes that the directories .jar file has already been built.
|
|
|
869034e |
-
|
|
|
869034e |
-.java.h:
|
|
|
869034e |
- b=`basename $*` ; \
|
|
|
869034e |
- d=`dirname $*` ; \
|
|
|
869034e |
- classes=`$(JAR) tf $(GEN_DIRNAME).jar | grep \
|
|
|
869034e |
- -e $$d/$$b'\.class' \
|
|
|
869034e |
- -e $$d/$$b'$$[^0-9]*\.class' \
|
|
|
869034e |
- | sed -e 's,.class$$,,'`; \
|
|
|
869034e |
- echo $$classes ; \
|
|
|
869034e |
- for class in $$classes ; do \
|
|
|
869034e |
- outputdir=`dirname $$class`; \
|
|
|
869034e |
- outputfile=`basename $$class`.h; \
|
|
|
869034e |
- echo "$$class => $$outputdir/$$outputfile"; \
|
|
|
869034e |
- rm -f $$outputdir/$$outputfile ; \
|
|
|
869034e |
- $(GCJH) -I $(GEN_DIRNAME).jar \
|
|
|
869034e |
- -o $$outputdir/$$outputfile \
|
|
|
869034e |
- $(GCJHFLAGS) $$class ; \
|
|
|
869034e |
- done
|
|
|
869034e |
-
|
|
|
869034e |
-
|
|
|
869034e |
# Shared library rule (for moment assume that .a contains PIC code).
|
|
|
869034e |
SUFFIXES += .so
|
|
|
869034e |
.a.so:
|
|
|
869034e |
@@ -463,6 +421,7 @@ JNI_OBJECT_LIST =
|
|
|
869034e |
lib$(GEN_DIRNAME)-jni.so: $(JNI_ARCHIVE_LIST) $(JNI_OBJECT_LIST)
|
|
|
869034e |
lib$(GEN_DIRNAME)-jni.so: lib$(GEN_DIRNAME)-jni.a
|
|
|
869034e |
soname=`basename $@` ; \
|
|
|
869034e |
+ echo soname=$$soname ; \
|
|
|
869034e |
$(CC) -shared -o $@.tmp \
|
|
|
869034e |
-Wl,--whole-archive \
|
|
|
869034e |
-Wl,$< \
|
|
|
869034e |
@@ -485,9 +444,11 @@ solibdir = $(libdir)
|
|
|
869034e |
solib_PROGRAMS =
|
|
|
869034e |
|
|
|
869034e |
# The shared java directory (typically /usr/share/java/; contains
|
|
|
869034e |
-# things like .jar files.
|
|
|
869034e |
+# things like .jar files) but here is architecture specific as frsyk,
|
|
|
869034e |
+# it turns out, has some 32vs64 java code - see bug 211824 in
|
|
|
869034e |
+# fedoraproject.org
|
|
|
869034e |
|
|
|
869034e |
-javadir = $(datadir)/java
|
|
|
869034e |
+javadir = $(pkglibdir)/java
|
|
|
869034e |
java_DATA =
|
|
|
869034e |
|
|
|
869034e |
# Assembler rule.
|
|
|
869034e |
@@ -505,57 +466,7 @@ $(srcdir)/Makefile.gen: $(srcdir)/common
|
|
|
869034e |
autogen: clean
|
|
|
869034e |
$(SHELL) $(srcdir)/autogen.sh
|
|
|
869034e |
|
|
|
869034e |
-# Given a .jar, just convert it into a .o, and a .db
|
|
|
869034e |
-
|
|
|
869034e |
SUFFIXES += .jar
|
|
|
869034e |
-.jar.o:
|
|
|
869034e |
- $(GCJCOMPILE) -c $<
|
|
|
869034e |
-
|
|
|
869034e |
-# Since automake only adds GCJCOMPILE to Makefile.in when its seen
|
|
|
869034e |
-# .java source, provide our own definition.
|
|
|
869034e |
-GCJCOMPILE ?= $(GCJ) $(AM_GCJFLAGS) $(GCJFLAGS)
|
|
|
869034e |
-
|
|
|
869034e |
-SUFFIXES += .db
|
|
|
869034e |
-.jar.db:
|
|
|
869034e |
- $(GCJ_DBTOOL) -n $@.tmp
|
|
|
869034e |
- $(GCJ_DBTOOL) -a $@.tmp $*.jar lib$*.so
|
|
|
869034e |
- mv $@.tmp $@
|
|
|
869034e |
-
|
|
|
869034e |
-# Given a .java file convert it to a .o file.
|
|
|
869034e |
-
|
|
|
869034e |
-# XXX: GCJ has a bug where it totally scrambles nested classes with
|
|
|
869034e |
-# identical names. Reject any code with duplicate class names.
|
|
|
869034e |
-
|
|
|
869034e |
-# XXX: GCJ has a bug where, when given a -Werror fail, it still exits
|
|
|
869034e |
-# with success. Hack around this by, when -Werror was specified,
|
|
|
869034e |
-# saving the message in a log file and then checking that it is empty.
|
|
|
869034e |
-
|
|
|
869034e |
-.java.o:
|
|
|
869034e |
-if HAVE_JV_SCAN
|
|
|
869034e |
- dups=`$(JV_SCAN) --list-class $< \
|
|
|
869034e |
- | tr '[ ]' '[\n]' \
|
|
|
869034e |
- | sed -n -e 's,^.*$$\([A-Z]\),\1,p' \
|
|
|
869034e |
- | sort | uniq -d` ; \
|
|
|
869034e |
- if test x"$$dups" != x ; then \
|
|
|
869034e |
- echo "Duplicate class names tickle a GCJ bug: $$dups" ; \
|
|
|
869034e |
- exit 1 ; \
|
|
|
869034e |
- fi
|
|
|
869034e |
-endif
|
|
|
869034e |
- depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`; \
|
|
|
869034e |
- if $(GCJCOMPILE) -MT $@ -MD -MP -MF "$$depbase.Tpo" -c -o $@ $< 2>&1 \
|
|
|
869034e |
- | tee $*.log ; then : ; else \
|
|
|
869034e |
- rm $*.log ; \
|
|
|
869034e |
- exit 1 ; \
|
|
|
869034e |
- fi ; \
|
|
|
869034e |
- if test -s $*.log \
|
|
|
869034e |
- && expr " $(GCJCOMPILE) " : '.* -Werror ' > /dev/null ; then \
|
|
|
869034e |
- rm -f "$$depbase.Tpo"; \
|
|
|
869034e |
- rm -f $*.log ; \
|
|
|
869034e |
- rm -f $@ ; \
|
|
|
869034e |
- exit 1 ; \
|
|
|
869034e |
- fi ; \
|
|
|
869034e |
- mv -f "$$depbase.Tpo" "$$depbase.Po"; \
|
|
|
869034e |
- rm -f $*.log
|
|
|
869034e |
|
|
|
869034e |
# Rule for generating ANTLR output that compiles cleanly using the
|
|
|
869034e |
# current compiler. The problem here is that raw ANTLR output
|
|
|
869034e |
@@ -609,20 +520,13 @@ SUFFIXES += .antlred .g
|
|
|
869034e |
echo "Parsing compiler warnings from $$b..." ; \
|
|
|
869034e |
rm -f $$t/*.antlr-fixes ; \
|
|
|
869034e |
rm -rf $$t/classes ; mkdir -p $$t/classes ; \
|
|
|
869034e |
- case "$(JAVAC_IS)" in \
|
|
|
869034e |
- gcj) $(JAVAC) $(JAVACFLAGS) \
|
|
|
869034e |
- -d $$t/classes \
|
|
|
869034e |
- -I $$t \
|
|
|
869034e |
- $$t/$$d/$$b.java \
|
|
|
869034e |
- 2>&1 || true ;; \
|
|
|
869034e |
- ecj) $(JAVAC) \
|
|
|
869034e |
+ ( $(JAVAC) \
|
|
|
869034e |
-d $$t/classes \
|
|
|
869034e |
-warn:+semicolon \
|
|
|
869034e |
-sourcepath $$t:$(SOURCEPATH) \
|
|
|
869034e |
-classpath $(CLASSPATH) \
|
|
|
869034e |
$$t/$$d/$$b.java \
|
|
|
869034e |
- 2>&1 || true ;; \
|
|
|
869034e |
- esac | ( \
|
|
|
869034e |
+ 2>&1 || true ) | ( \
|
|
|
869034e |
cd $$t ; \
|
|
|
869034e |
$(AWK) -f @abs_srcdir@/common/antlr-warnings.awk \
|
|
|
869034e |
) ; \
|
|
|
869034e |
@@ -742,17 +646,10 @@ ${GEN_DIRNAME}.jar: files-java.list $(GE
|
|
|
869034e |
rm -rf $(JAVAROOT)
|
|
|
869034e |
mkdir -p $(JAVAROOT)
|
|
|
869034e |
$(JAVAC) -d $(JAVAROOT) $(JAVACFLAGS) \
|
|
|
869034e |
- @$(top_builddir)/files-java.list \
|
|
|
869034e |
- 2>&1 | tee $*.log
|
|
|
869034e |
- if test -s $*.log \
|
|
|
869034e |
- && expr " $(GCJCOMPILE) " : '.* -Werror ' > /dev/null ; \
|
|
|
869034e |
- then rm $*.log ; false ; \
|
|
|
869034e |
- fi
|
|
|
869034e |
- rm -f $*.log
|
|
|
869034e |
+ @$(top_builddir)/files-java.list
|
|
|
869034e |
cd $(JAVAROOT) ; \
|
|
|
869034e |
- find * -name '*.class' -print \
|
|
|
869034e |
- | sort \
|
|
|
869034e |
- | $(JAR) -@ -cf $@
|
|
|
869034e |
+ find * -name '*.class' -print | sort > classes.list ; \
|
|
|
869034e |
+ $(JAR) cf $@ @classes.list
|
|
|
869034e |
mv $(JAVAROOT)/$@ $@
|
|
|
869034e |
|
|
|
869034e |
# Check that everything, well except for a few exceptions, is using
|
|
|
869034e |
diff -up frysk-0.4/frysk-core/Makefile.am.jni frysk-0.4/frysk-core/Makefile.am
|
|
|
6a61aff |
--- frysk-0.4/frysk-core/Makefile.am.jni 2016-04-13 10:57:04.464272124 -0400
|
|
|
6a61aff |
+++ frysk-0.4/frysk-core/Makefile.am 2016-04-13 10:57:04.468272119 -0400
|
|
|
869034e |
@@ -46,22 +46,6 @@ GEN_CLASSPATH += ../frysk-imports/jline.
|
|
|
869034e |
GEN_CLASSPATH += ../frysk-imports/antlr.jar
|
|
|
869034e |
GEN_CLASSPATH += ../frysk-imports/junit.jar
|
|
|
869034e |
GEN_CLASSPATH += ../frysk-imports/getopt.jar
|
|
|
869034e |
-GEN_GCJ_LDADD_LIST += ../frysk-sys/libfrysk-sys.a
|
|
|
869034e |
-GEN_GCJ_LDADD_LIST += ../frysk-imports/libfrysk-jline.a
|
|
|
869034e |
-GEN_GCJ_LDADD_LIST += ../frysk-imports/libfrysk-antlr.a
|
|
|
869034e |
-GEN_GCJ_LDADD_LIST += ../frysk-imports/libfrysk-junit.a
|
|
|
869034e |
-GEN_GCJ_LDADD_LIST += ../frysk-imports/libfrysk-getopt.a
|
|
|
869034e |
-if USE_LIBUNWIND
|
|
|
869034e |
-GEN_GCJ_LDADD_LIST += ../frysk-imports/libunwind-i386/src/.libs/libunwind-x86.a \
|
|
|
869034e |
- ../frysk-imports/libunwind-x86_64/src/.libs/libunwind-x86_64.a \
|
|
|
869034e |
- ../frysk-imports/libunwind-ppc32/src/.libs/libunwind-ppc32.a \
|
|
|
869034e |
- ../frysk-imports/libunwind-ppc64/src/.libs/libunwind-ppc64.a
|
|
|
869034e |
-endif
|
|
|
869034e |
-GEN_GCJ_LDADD_LIST += -lstdc++
|
|
|
869034e |
-# Stub bfd_getb32 and bfd_getl32 for PPC64. Unconditionally
|
|
|
869034e |
-# link -lbfd_get just for simplification.
|
|
|
869034e |
-GEN_GCJ_LDADD_LIST += -laudit
|
|
|
869034e |
-GEN_GCJ_LDADD_LIST += -lasm -ldw -lebl -lelf
|
|
|
869034e |
|
|
|
869034e |
# For TestExec.java
|
|
|
869034e |
noinst_PROGRAMS += frysk/pkglibdir/funit-exec-alias
|
|
|
869034e |
@@ -251,8 +235,10 @@ install-exec-local: install-sysroot-loca
|
|
|
869034e |
uninstall-local: uninstall-sysroot-local
|
|
|
869034e |
.PHONY: install-sysroot-local uninstall-sysroot-local
|
|
|
869034e |
install-sysroot-local:
|
|
|
869034e |
+ mkdir -p $(DESTDIR)$(pkglibdir)
|
|
|
869034e |
cp -r $(TEST_SYSROOT) $(DESTDIR)$(pkglibdir)
|
|
|
869034e |
if DO_ARCH32_TEST
|
|
|
869034e |
+ mkdir -p $(DESTDIR)$(pkglib32dir)
|
|
|
869034e |
cp -r $(TEST32_SYSROOT) $(DESTDIR)$(pkglib32dir)
|
|
|
869034e |
endif
|
|
|
869034e |
# we don't want this installed, but noinst_SCRIPTS has no effect
|
|
|
869034e |
diff -up frysk-0.4/frysk-gtk/Makefile.am.jni frysk-0.4/frysk-gtk/Makefile.am
|
|
|
6a61aff |
--- frysk-0.4/frysk-gtk/Makefile.am.jni 2016-04-13 10:57:04.461272128 -0400
|
|
|
6a61aff |
+++ frysk-0.4/frysk-gtk/Makefile.am 2016-04-13 10:57:04.468272119 -0400
|
|
|
869034e |
@@ -62,7 +62,6 @@ GEN_GCJ_LDADD_LIST += -laudit
|
|
|
869034e |
GEN_GCJ_LDADD_LIST += -lasm -ldw -lebl -lelf
|
|
|
869034e |
|
|
|
869034e |
# Hack, need to compile this entire sub-tree with JNI.
|
|
|
869034e |
-AM_GCJFLAGS += -fjni
|
|
|
869034e |
AM_CFLAGS += $(GTK_CFLAGS) $(FRYSK_GTK_CFLAGS)
|
|
|
869034e |
|
|
|
869034e |
solib_PROGRAMS += EggTrayIcon/libEggTrayIcon.so
|
|
|
869034e |
diff -up frysk-0.4/frysk-imports/configure.ac.jni frysk-0.4/frysk-imports/configure.ac
|
|
|
6a61aff |
--- frysk-0.4/frysk-imports/configure.ac.jni 2016-04-13 10:57:04.464272124 -0400
|
|
|
6a61aff |
+++ frysk-0.4/frysk-imports/configure.ac 2016-04-13 10:57:04.469272118 -0400
|
|
|
869034e |
@@ -53,7 +53,6 @@ AC_CONFIG_FILES([
|
|
|
869034e |
Makefile
|
|
|
869034e |
jline/Makefile
|
|
|
869034e |
getopt/Makefile
|
|
|
869034e |
- tests/Makefile
|
|
|
869034e |
junit/Makefile])
|
|
|
869034e |
|
|
|
869034e |
# Even though "libunwind" is not built, it is still included in the
|
|
|
869034e |
diff -up frysk-0.4/frysk-imports/junit/Makefile.am.jni frysk-0.4/frysk-imports/junit/Makefile.am
|
|
|
869034e |
--- frysk-0.4/frysk-imports/junit/Makefile.am.jni 2008-06-09 14:03:07.000000000 -0400
|
|
|
6a61aff |
+++ frysk-0.4/frysk-imports/junit/Makefile.am 2016-04-13 10:57:04.469272118 -0400
|
|
|
869034e |
@@ -43,7 +43,9 @@ noinst_DATA = junit.jar
|
|
|
869034e |
# Make a jar file.
|
|
|
869034e |
junit.jar: classdir
|
|
|
869034e |
cd classdir ; \
|
|
|
869034e |
- find * -name '*.class' -print | $(JAR) -@ -cf $@.tmp
|
|
|
869034e |
+ rm -f classes.list ; \
|
|
|
869034e |
+ find * -name '*.class' -print > classes.list ; \
|
|
|
869034e |
+ $(JAR) cf $@.tmp @classes.list
|
|
|
869034e |
mv classdir/$@.tmp $@
|
|
|
869034e |
|
|
|
869034e |
classdir:
|
|
|
869034e |
diff -up frysk-0.4/frysk-imports/Makefile.am.jni frysk-0.4/frysk-imports/Makefile.am
|
|
|
6a61aff |
--- frysk-0.4/frysk-imports/Makefile.am.jni 2016-04-13 10:57:04.462272126 -0400
|
|
|
6a61aff |
+++ frysk-0.4/frysk-imports/Makefile.am 2016-04-13 10:57:04.469272118 -0400
|
|
|
869034e |
@@ -59,7 +59,6 @@ CHECK_SUBDIRS = \
|
|
|
869034e |
jline \
|
|
|
869034e |
junit \
|
|
|
869034e |
getopt \
|
|
|
869034e |
- tests \
|
|
|
869034e |
$(LIBUNWIND_DIR)
|
|
|
869034e |
|
|
|
869034e |
check-recursive: SUBDIRS = $(CHECK_SUBDIRS)
|
|
|
869034e |
@@ -79,7 +78,7 @@ install-recursive \
|
|
|
869034e |
installcheck-recursive \
|
|
|
869034e |
installdirs-recursive \
|
|
|
869034e |
uninstall-info-recursive \
|
|
|
869034e |
-uninstall-recursive: SUBDIRS = tests
|
|
|
869034e |
+uninstall-recursive: SUBDIRS =
|
|
|
869034e |
|
|
|
869034e |
GEN_CLASSPATH += getopt.jar
|
|
|
869034e |
GEN_CLASSPATH += junit.jar
|
|
|
869034e |
diff -up frysk-0.4/frysk-sys/bootstrap.sh.jni frysk-0.4/frysk-sys/bootstrap.sh
|
|
|
869034e |
--- frysk-0.4/frysk-sys/bootstrap.sh.jni 2008-06-09 14:03:07.000000000 -0400
|
|
|
6a61aff |
+++ frysk-0.4/frysk-sys/bootstrap.sh 2016-04-13 10:57:04.469272118 -0400
|
|
|
869034e |
@@ -45,7 +45,7 @@ FILE_LIST="frysk \
|
|
|
869034e |
inua \
|
|
|
869034e |
lib"
|
|
|
869034e |
|
|
|
869034e |
-./common/Makefile.gen.sh --jni --cni $FILE_LIST
|
|
|
869034e |
+./common/Makefile.gen.sh $FILE_LIST
|
|
|
869034e |
|
|
|
869034e |
# Generate everything (always run with --add-missing).
|
|
|
869034e |
|
|
|
869034e |
diff -up frysk-0.4/frysk-sys/frysk/sys/proc/jni/Exe.cxx.jni frysk-0.4/frysk-sys/frysk/sys/proc/jni/Exe.cxx
|
|
|
6a61aff |
--- frysk-0.4/frysk-sys/frysk/sys/proc/jni/Exe.cxx.jni 2016-04-13 10:57:04.411272189 -0400
|
|
|
6a61aff |
+++ frysk-0.4/frysk-sys/frysk/sys/proc/jni/Exe.cxx 2016-04-13 10:57:04.469272118 -0400
|
|
|
869034e |
@@ -87,7 +87,7 @@ frysk::sys::proc::Exe::getName(jnixx::en
|
|
|
869034e |
}
|
|
|
869034e |
|
|
|
869034e |
if (access(link, F_OK) != 0) {
|
|
|
869034e |
- errnoException(env, errno, "file %s", link);
|
|
|
869034e |
+ errnoException(env, errno, "access", "file %s", link);
|
|
|
869034e |
}
|
|
|
869034e |
|
|
|
869034e |
// Note that some kernels have a "feature" where the link can become
|
|
|
869034e |
diff -up frysk-0.4/frysk-sys/jnixx/ClassWalker.java.jni frysk-0.4/frysk-sys/jnixx/ClassWalker.java
|
|
|
869034e |
--- frysk-0.4/frysk-sys/jnixx/ClassWalker.java.jni 2008-06-09 14:03:07.000000000 -0400
|
|
|
6a61aff |
+++ frysk-0.4/frysk-sys/jnixx/ClassWalker.java 2016-04-13 10:57:04.469272118 -0400
|
|
|
869034e |
@@ -73,10 +73,10 @@ abstract class ClassWalker {
|
|
|
869034e |
void walk(Class klass) {
|
|
|
869034e |
if (klass == null)
|
|
|
869034e |
return;
|
|
|
869034e |
+ walk(klass.getSuperclass());
|
|
|
869034e |
if (visited.contains(klass))
|
|
|
869034e |
return;
|
|
|
869034e |
visited.add(klass);
|
|
|
869034e |
- walk(klass.getSuperclass());
|
|
|
869034e |
if (klass.isArray()) {
|
|
|
869034e |
walk(klass.getComponentType());
|
|
|
869034e |
acceptArray(klass);
|
|
|
869034e |
diff -up frysk-0.4/frysk-sys/jnixx/Main.java.jni frysk-0.4/frysk-sys/jnixx/Main.java
|
|
|
869034e |
--- frysk-0.4/frysk-sys/jnixx/Main.java.jni 2008-06-09 14:03:07.000000000 -0400
|
|
|
6a61aff |
+++ frysk-0.4/frysk-sys/jnixx/Main.java 2016-04-13 10:57:04.469272118 -0400
|
|
|
869034e |
@@ -163,7 +163,6 @@ class Main {
|
|
|
869034e |
p.println("JNIEXPORT jint");
|
|
|
869034e |
p.println("JNI_OnLoad(JavaVM* javaVM, void* reserved)");
|
|
|
869034e |
while (p.dent(0, "{", "}")) {
|
|
|
869034e |
- p.println("fprintf(stderr, \"vm loaded\\n\");");
|
|
|
869034e |
p.println("::jnixx::vm = javaVM;");
|
|
|
869034e |
p.println("return JNI_VERSION_1_2;");
|
|
|
869034e |
}
|
|
|
869034e |
diff -up frysk-0.4/frysk-sys/jnixx/PrintCxxDefinitions.java.jni frysk-0.4/frysk-sys/jnixx/PrintCxxDefinitions.java
|
|
|
869034e |
--- frysk-0.4/frysk-sys/jnixx/PrintCxxDefinitions.java.jni 2008-06-09 14:03:07.000000000 -0400
|
|
|
6a61aff |
+++ frysk-0.4/frysk-sys/jnixx/PrintCxxDefinitions.java 2016-04-13 10:57:04.469272118 -0400
|
|
|
869034e |
@@ -159,10 +159,6 @@ class PrintCxxDefinitions extends ClassW
|
|
|
869034e |
return;
|
|
|
869034e |
if (klass.isArray())
|
|
|
869034e |
return;
|
|
|
869034e |
- p.println();
|
|
|
869034e |
- p.print("jclass ");
|
|
|
869034e |
- p.printQualifiedCxxName(klass);
|
|
|
869034e |
- p.println("::_class;");
|
|
|
869034e |
printer.visit(klass);
|
|
|
869034e |
}
|
|
|
869034e |
void acceptInterface(Class klass) {
|
|
|
869034e |
diff -up frysk-0.4/frysk-sys/jnixx/PrintDeclarations.java.jni frysk-0.4/frysk-sys/jnixx/PrintDeclarations.java
|
|
|
869034e |
--- frysk-0.4/frysk-sys/jnixx/PrintDeclarations.java.jni 2008-06-09 14:03:07.000000000 -0400
|
|
|
6a61aff |
+++ frysk-0.4/frysk-sys/jnixx/PrintDeclarations.java 2016-04-13 10:57:04.469272118 -0400
|
|
|
869034e |
@@ -143,8 +143,9 @@ class PrintDeclarations extends ClassWal
|
|
|
869034e |
p.printGlobalCxxName(parent);
|
|
|
869034e |
p.println("() { }");
|
|
|
869034e |
}
|
|
|
869034e |
+ // cached per-instance copy - a local-ref
|
|
|
869034e |
+ p.println("private: jclass _class = NULL;");
|
|
|
869034e |
// Static get-class method - a class knows its own class.
|
|
|
869034e |
- p.println("private: static jclass _class;");
|
|
|
869034e |
p.println("public: static inline jclass _class_(::jnixx::env _env);");
|
|
|
869034e |
JniBindings.printDeclarations(p, klass);
|
|
|
869034e |
}
|
|
|
869034e |
diff -up frysk-0.4/frysk-sys/jnixx/Printer.java.jni frysk-0.4/frysk-sys/jnixx/Printer.java
|
|
|
869034e |
--- frysk-0.4/frysk-sys/jnixx/Printer.java.jni 2008-06-09 14:03:07.000000000 -0400
|
|
|
6a61aff |
+++ frysk-0.4/frysk-sys/jnixx/Printer.java 2016-04-13 10:57:04.469272118 -0400
|
|
|
869034e |
@@ -318,6 +318,7 @@ class Printer {
|
|
|
869034e |
|| name.equals("or")
|
|
|
869034e |
|| name.equals("xor")
|
|
|
869034e |
|| name.equals("not")
|
|
|
869034e |
+ || name.equals("register")
|
|
|
869034e |
) {
|
|
|
869034e |
return name + "$";
|
|
|
869034e |
} else {
|
|
|
869034e |
diff -up frysk-0.4/frysk-sys/jnixx/PrintHxxDefinitions.java.jni frysk-0.4/frysk-sys/jnixx/PrintHxxDefinitions.java
|
|
|
869034e |
--- frysk-0.4/frysk-sys/jnixx/PrintHxxDefinitions.java.jni 2008-06-09 14:03:07.000000000 -0400
|
|
|
6a61aff |
+++ frysk-0.4/frysk-sys/jnixx/PrintHxxDefinitions.java 2016-04-13 10:57:04.470272116 -0400
|
|
|
869034e |
@@ -72,6 +72,14 @@ class PrintHxxDefinitions extends ClassW
|
|
|
869034e |
}
|
|
|
869034e |
p.print(")");
|
|
|
869034e |
while (p.dent(0, "{", "}")) {
|
|
|
869034e |
+ if (isStatic) {
|
|
|
869034e |
+ p.println("jclass _class = _class_(_env);");
|
|
|
869034e |
+ } else {
|
|
|
869034e |
+ p.print("if (_class == NULL)");
|
|
|
869034e |
+ while (p.dent(1, "{", "}")) {
|
|
|
869034e |
+ p.println("_class = _class_(_env);");
|
|
|
869034e |
+ }
|
|
|
869034e |
+ }
|
|
|
869034e |
p.print("if (");
|
|
|
869034e |
p.printID(field);
|
|
|
869034e |
p.print(" == NULL)");
|
|
|
869034e |
@@ -81,7 +89,7 @@ class PrintHxxDefinitions extends ClassW
|
|
|
869034e |
if (isStatic) {
|
|
|
869034e |
p.print("Static");
|
|
|
869034e |
}
|
|
|
869034e |
- p.print("FieldID(_class_(_env), \"");
|
|
|
869034e |
+ p.print("FieldID(_class, \"");
|
|
|
869034e |
p.print(field.getName());
|
|
|
869034e |
p.print("\", \"");
|
|
|
869034e |
p.printJniSignature(type);
|
|
|
869034e |
@@ -130,16 +138,25 @@ class PrintHxxDefinitions extends ClassW
|
|
|
869034e |
p.print("static jmethodID ");
|
|
|
869034e |
p.printID(method);
|
|
|
869034e |
p.println(";");
|
|
|
869034e |
+ if (isStatic) {
|
|
|
869034e |
+ p.println("jclass _class = _class_(_env);");
|
|
|
869034e |
+ }
|
|
|
869034e |
p.print("if (");
|
|
|
869034e |
p.printID(method);
|
|
|
869034e |
p.print(" == NULL)");
|
|
|
869034e |
while (p.dent(1, "{", "}")) {
|
|
|
869034e |
+ if (!isStatic) {
|
|
|
869034e |
+ p.print("if (_class == NULL)");
|
|
|
869034e |
+ while (p.dent(2, "{", "}")) {
|
|
|
869034e |
+ p.println("_class = _class_(_env);");
|
|
|
869034e |
+ }
|
|
|
869034e |
+ }
|
|
|
869034e |
p.printID(method);
|
|
|
869034e |
p.print(" = _env.Get");
|
|
|
869034e |
if (isStatic) {
|
|
|
869034e |
p.print("Static");
|
|
|
869034e |
}
|
|
|
869034e |
- p.print("MethodID(_class_(_env), \"");
|
|
|
869034e |
+ p.print("MethodID(_class, \"");
|
|
|
869034e |
p.print(method.getName());
|
|
|
869034e |
p.print("\", \"");
|
|
|
869034e |
p.printJniSignature(method);
|
|
|
869034e |
@@ -183,6 +200,7 @@ class PrintHxxDefinitions extends ClassW
|
|
|
869034e |
p.printFormalCxxParameters(constructor, true);
|
|
|
869034e |
p.print(")");
|
|
|
869034e |
while (p.dent(0, "{", "}")) {
|
|
|
869034e |
+ p.println("jclass _class = _class_(_env);");
|
|
|
869034e |
p.print("static jmethodID ");
|
|
|
869034e |
p.printID(constructor);
|
|
|
869034e |
p.println(";");
|
|
|
869034e |
@@ -191,7 +209,7 @@ class PrintHxxDefinitions extends ClassW
|
|
|
869034e |
p.print(" == NULL)");
|
|
|
869034e |
while (p.dent(1, "{", "}")) {
|
|
|
869034e |
p.printID(constructor);
|
|
|
869034e |
- p.print(" = _env.GetMethodID(_class_(_env), \"<init>\", \"(");
|
|
|
869034e |
+ p.print(" = _env.GetMethodID(_class, \"<init>\", \"(");
|
|
|
869034e |
p.printJniSignature(constructor.getParameterTypes());
|
|
|
869034e |
p.println(")V\");");
|
|
|
869034e |
}
|
|
|
869034e |
@@ -237,12 +255,9 @@ class PrintHxxDefinitions extends ClassW
|
|
|
869034e |
p.printQualifiedCxxName(klass);
|
|
|
869034e |
p.print("::_class_(::jnixx::env _env)");
|
|
|
869034e |
while (p.dent(0, "{", "}")) {
|
|
|
869034e |
- while (p.dent(1, "if (_class == NULL) {", "}")) {
|
|
|
869034e |
- p.print("_class = _env.FindClass(\"");
|
|
|
869034e |
- p.print(klass.getName());
|
|
|
869034e |
- p.println("\");");
|
|
|
869034e |
- }
|
|
|
869034e |
- p.println("return _class;");
|
|
|
869034e |
+ p.print("return _env.FindClass(\"");
|
|
|
869034e |
+ p.print(klass.getName().replace('.', '/'));
|
|
|
869034e |
+ p.println("\");");
|
|
|
869034e |
}
|
|
|
869034e |
JniBindings.printDefinitions(p, klass);
|
|
|
869034e |
printer.visit(klass);
|
|
|
869034e |
diff -up frysk-0.4/frysk-sys/Makefile.am.jni frysk-0.4/frysk-sys/Makefile.am
|
|
|
6a61aff |
--- frysk-0.4/frysk-sys/Makefile.am.jni 2016-04-13 10:57:04.467272120 -0400
|
|
|
6a61aff |
+++ frysk-0.4/frysk-sys/Makefile.am 2016-04-13 10:57:26.720244636 -0400
|
|
|
6a61aff |
@@ -47,19 +47,6 @@ GEN_CLASSPATH += ../frysk-imports/jline.
|
|
|
869034e |
GEN_CLASSPATH += ../frysk-imports/antlr.jar
|
|
|
869034e |
GEN_CLASSPATH += ../frysk-imports/junit.jar
|
|
|
869034e |
GEN_CLASSPATH += ../frysk-imports/getopt.jar
|
|
|
869034e |
-GEN_GCJ_LDADD_LIST += ../frysk-imports/libfrysk-jline.a
|
|
|
869034e |
-GEN_GCJ_LDADD_LIST += ../frysk-imports/libfrysk-antlr.a
|
|
|
869034e |
-GEN_GCJ_LDADD_LIST += ../frysk-imports/libfrysk-junit.a
|
|
|
869034e |
-GEN_GCJ_LDADD_LIST += ../frysk-imports/libfrysk-getopt.a
|
|
|
869034e |
-if USE_LIBUNWIND
|
|
|
869034e |
-GEN_GCJ_LDADD_LIST += ../frysk-imports/libunwind-i386/src/.libs/libunwind-x86.a \
|
|
|
869034e |
- ../frysk-imports/libunwind-x86_64/src/.libs/libunwind-x86_64.a \
|
|
|
869034e |
- ../frysk-imports/libunwind-ppc32/src/.libs/libunwind-ppc32.a \
|
|
|
869034e |
- ../frysk-imports/libunwind-ppc64/src/.libs/libunwind-ppc64.a
|
|
|
869034e |
-endif
|
|
|
869034e |
-GEN_GCJ_LDADD_LIST += -lstdc++ -laudit
|
|
|
869034e |
-GEN_GCJ_LDADD_LIST += -lasm -ldw -lebl -lelf
|
|
|
6a61aff |
-
|
|
|
869034e |
|
|
|
869034e |
# Force a few dependencies
|
|
|
6a61aff |
lib/unwind/cni/Unwind%.cxx: lib/unwind/Unwind%.java lib/unwind/cni/UnwindH.hxx
|
|
|
6a61aff |
@@ -69,6 +56,7 @@ lib/unwind/Unwind%.java: lib/unwind/Unwi
|
|
|
869034e |
# Depend on these runtimes.
|
|
|
869034e |
JNI_LIBRARY_LIST += -lstdc++
|
|
|
869034e |
JNI_LIBRARY_LIST += -laudit
|
|
|
869034e |
+JNI_LIBRARY_LIST += -ldw
|
|
|
869034e |
# Bundle in the local libunwind code.
|
|
|
869034e |
JNI_OBJECT_LIST += ../frysk-imports/libunwind-i386/src/{,dwarf/,mi/,x86/}.libs/*.o
|
|
|
869034e |
JNI_OBJECT_LIST += ../frysk-imports/libunwind-x86_64/src/{,dwarf/,mi/,x86_64/}.libs/*.o
|