diff --git a/bindings/java/src/jni/generate.pl b/bindings/java/src/jni/generate.pl index 6dcb719c..0ea92d87 100644 --- a/bindings/java/src/jni/generate.pl +++ b/bindings/java/src/jni/generate.pl @@ -985,19 +985,19 @@ my $cfile = 'javasigar_generated.c'; my $hfile = 'javasigar_generated.h'; my $pfile = 'Sigar_generated.xs'; -if ((stat $0)[9] < (stat "src/jni/$cfile")[9]) { - print "$cfile unchanged\n"; - exit; -} - -print "generating $cfile\n"; - my $build_src = $ARGV[0] or die "usage: $0 build_directory"; if (! -d $build_src) { die "$build_src: $!"; } +if ((stat $0)[9] < (stat "$build_src/$cfile")[9]) { + print "$cfile unchanged\n"; + exit; +} + +print "generating $cfile\n"; + chdir $build_src; my $jsrc = 'net/hyperic/sigar';