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:
+2
-1
@@ -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
@@ -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";
|
||||||
|
|||||||
Reference in New Issue
Block a user