Look in JAVA_LIBS for the system-wide java libraries rather than hard

coding the path to /usr/share/java. This allows us to set JAVA_LIBS to the
path to yolibs when building and running Narya code.


git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@858 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2002-01-16 00:41:52 +00:00
parent 17b7dac87a
commit 40013948c2
2 changed files with 6 additions and 3 deletions
+2 -1
View File
@@ -55,8 +55,9 @@ if (defined $libpath) {
my $classpath = "-classpath $root/dist/classes"; my $classpath = "-classpath $root/dist/classes";
# add zip and jar files from our lib/ directory and the system lib/ directory # add zip and jar files from our lib/ directory and the system lib/ directory
my @dirs = ( "$root/lib", "/usr/share/java" ); my @dirs = ( "$root/lib", $ENV{"JAVA_LIBS"} );
foreach $dir (@dirs) { foreach $dir (@dirs) {
next unless (defined $dir);
if (opendir(DIR, $dir)) { if (opendir(DIR, $dir)) {
foreach $lib (grep { /.(zip|jar)/ && -f "$dir/$_" } readdir(DIR)) { foreach $lib (grep { /.(zip|jar)/ && -f "$dir/$_" } readdir(DIR)) {
$classpath .= ":$dir/$lib"; $classpath .= ":$dir/$lib";
+4 -2
View File
@@ -57,9 +57,11 @@ if (defined $libpath) {
# put everything in our class path # put everything in our class path
my $classpath = "-classpath $root/tests/dist/classes:$root/dist/classes"; my $classpath = "-classpath $root/tests/dist/classes:$root/dist/classes";
# add zip and jar files from our lib/ directory and the system lib/ directory # add zip and jar files from our lib/ directory and the global Java
my @dirs = ( "$root/lib", "/usr/share/java" ); # libraries directory
my @dirs = ( "$root/lib", $ENV{"JAVA_LIBS"} );
foreach $dir (@dirs) { foreach $dir (@dirs) {
next unless (defined $dir);
if (opendir(DIR, $dir)) { if (opendir(DIR, $dir)) {
foreach $lib (grep { /.(zip|jar)/ && -f "$dir/$_" } readdir(DIR)) { foreach $lib (grep { /.(zip|jar)/ && -f "$dir/$_" } readdir(DIR)) {
$classpath .= ":$dir/$lib"; $classpath .= ":$dir/$lib";