changed dependency generation.

bug fix in package location determination.


git-svn-id: https://svn.code.sf.net/p/jode/code/trunk@1162 379699f6-c40d-0410-875b-85095c16579e
branch_1_1
jochen 26 years ago
parent 8eab046f28
commit 6a7b61f3c4
  1. 5
      jode/acinclude.m4
  2. 31
      jode/javaDependencies.pl.in

@ -26,12 +26,13 @@ AC_DEFUN(JODE_CHECK_CLASS,
if (IFS=":" if (IFS=":"
clazz=`echo $1 | sed -e 's/\./\//g' -e 's/\(.*\)/\1.class/'` clazz=`echo $1 | sed -e 's/\./\//g' -e 's/\(.*\)/\1.class/'`
jode_found=0 jode_found=0
for path in $2; do myclasspath=$2;
for path in $myclasspath; do
if test -d $path; then if test -d $path; then
if test -e $path/$clazz; then if test -e $path/$clazz; then
exit 0 exit 0
fi fi
elif $UNZIP -v -C $path $clazz &>/dev/null ; then elif $UNZIP -v -C `$SUBSTCP $path` $clazz &>/dev/null ; then
exit 0 exit 0
fi fi
done; done;

@ -28,7 +28,8 @@
# #
# Usage: # Usage:
# javaDependencies.pl -classpath <cp> [-dependdir <depdir> [-subdir <subdir>]] # javaDependencies.pl -classpath <cp> [-dependdir <depdir> [-subdir <subdir>]]
# <classfile> # [-depfile <depfile>]
# <classfiles>
# #
# cp: colon separated paths to the java files we should depend on. # cp: colon separated paths to the java files we should depend on.
# depdir: if set, use this path as path to the java files when printing # depdir: if set, use this path as path to the java files when printing
@ -36,7 +37,8 @@
# useful, if you want to make use of VPATH settings in Makefile. # useful, if you want to make use of VPATH settings in Makefile.
# subdir: if set, this is the path from depdir to the current directory. # subdir: if set, this is the path from depdir to the current directory.
# Use it to remove unneccessary ../../$subdir/ # Use it to remove unneccessary ../../$subdir/
# class: The class file (not an inner class) for which the dependencies # depfile: the name of the dependency file, default is "Makefile.dep".
# class: The class files (not inner classes) for which the dependencies
# should be generated. We will also look for inner and anon # should be generated. We will also look for inner and anon
# classes. # classes.
@ -62,12 +64,20 @@ sub readUTF () {
unpack("a$ulength", $buff); unpack("a$ulength", $buff);
} }
$clazz = pop; $depfile = "Makefile.dep" if (!defined($depfile));
$clazz =~ /(.*)\.class/ or die "not a class file"; open DEPFILE, ">$depfile";
$base = $1; print DEPFILE <<EOF;
my ($filename, %done); # This dependency file is automatically created by $0 from class files.
%done=(); # Do not edit.
for $filename ($clazz, glob("$base\\\$*.class")) {
EOF
foreach $clazz (@ARGV) {
next if $clazz =~ (/^.*\$.*\.class/);
$clazz =~ /([^\$]*)(\$.*)?\.class/ or die "not a class file";
$base = $1;
my ($filename, %done);
%done=();
for $filename ($clazz, glob("$base\\\$*.class")) {
open FILE, $filename; open FILE, $filename;
binmode FILE; binmode FILE;
@ -167,7 +177,8 @@ for $filename ($clazz, glob("$base\\\$*.class")) {
} }
} }
if (@deplist) { if (@deplist) {
print "# Dependencies of $filename\n"; print DEPFILE "$clazz: " . join (" ", @deplist) . "\n";
print "$clazz: " . join (" ", @deplist) . "\n"; }
} }
} }
close DEPFILE;

Loading…
Cancel
Save