URL
https://opencores.org/ocsvn/openrisc/openrisc/trunk
Subversion Repositories openrisc
[/] [openrisc/] [trunk/] [gnu-dev/] [or1k-gcc/] [libjava/] [classpath/] [scripts/] [check_jni_methods.sh.in] - Rev 821
Go to most recent revision | Compare with Previous | Blame | View Log
#!/bin/sh# Fail if any command failsset -eTMPFILE=/tmp/check-jni-methods.$$.1TMPFILE2=/tmp/check-jni-methods.$$.2TMPFILE3=/tmp/check-jni-methods.$$.3TMPFILE4=/tmp/check-jni-methods.$$.4# Find all methods defined in the header files generated# from the java source files.grep -h '^JNIEXPORT .* Java_' @abs_top_srcdir@/include/*.h | \LC_ALL=C sed -e 's,.*JNICALL \(Java_[a-z_A-Z0-9]*\).*$,\1,' > $TMPFILEgrep -h '^JNIEXPORT .* Java_' @abs_top_builddir@/include/*.h | \LC_ALL=C sed -e 's,.*JNICALL \(Java_[a-z_A-Z0-9]*\).*$,\1,' >> $TMPFILEsort -u $TMPFILE > $TMPFILE4mv $TMPFILE4 $TMPFILE# Find all methods in the JNI C source files.find @abs_top_srcdir@/native/jni -name \*.c | \xargs grep -h '^Java_' | \LC_ALL=C sed -e 's,^\(Java_[a-z_A-Z0-9]*\).*$,\1,' > $TMPFILE2# Or in the the C++ files. (Note that cpp doesn't follow gnu conventions atm)# So we try to match both GNU style and some other style.find @abs_top_srcdir@/native/jni -name \*.cpp | \xargs grep -h '^Java_' | \LC_ALL=C sed -e 's,^\(Java_[a-z_A-Z0-9]*\).*$,\1,' >> $TMPFILE2find @abs_top_srcdir@/native/jni -name \*.cpp | \xargs egrep -h '^(JNIEXPORT .* JNICALL )?Java_' | \cut -f4 -d\ | \LC_ALL=C sed -e 's,^\JNIEXPORT .* JNICALL \(Java_[a-z_A-Z0-9]*\).*$,\1,' >> $TMPFILE2mv $TMPFILE2 $TMPFILE3sort $TMPFILE3 | uniq > $TMPFILE2rm $TMPFILE3# Write temporary ignore file.cat > $TMPFILE3 << EOF< Java_gnu_java_awt_peer_gtk_GtkMenuComponentPeer_dispose< Java_java_lang_VMSystem_arraycopy< Java_java_lang_VMSystem_identityHashCodeEOF# Compare again silently.# Use fgrep and direct the output to /dev/null for compatibility with older# grep instead of using the non portable -q.if diff $TMPFILE $TMPFILE2 | grep '^[<>] Java' | \fgrep -v -f $TMPFILE3 > /dev/null;thenPROBLEM=1echo "Found a problem with the JNI methods declared and implemented."echo "(<) missing in implementation, (>) missing in header files"# Compare the found method lists.diff $TMPFILE $TMPFILE2 | grep '^[<>] Java' | fgrep -v -f $TMPFILE3fi# Cleanup.rm -f $TMPFILE $TMPFILE2 $TMPFILE3if test "$PROBLEM" = "1" ; thenexit 1fiexit 0
Go to most recent revision | Compare with Previous | Blame | View Log
