Index: runant.pl
===================================================================
RCS file: /home/cvspublic/jakarta-ant/src/script/runant.pl,v
retrieving revision 1.3
diff -u -r1.3 runant.pl
--- runant.pl	2001/10/17 00:27:34	1.3
+++ runant.pl	2001/11/13 18:48:19
@@ -22,7 +22,8 @@
 #
 # - the "java" executable/script is on the command path
 # - ANT_HOME has been set
-# - target platform uses ":" as classpath separator or perl indicates it is dos/win32
+# - target platform uses ":" as classpath separator or perl indicates it is dos,
+#   win32, or netware
 # - target platform uses "/" as directory separator.
 
 #be fussy about variables
@@ -53,9 +54,18 @@
 
 #ISSUE: what java wants to split up classpath varies from platform to platform 
 #and perl is not too hot at hinting which box it is on.
-#here I assume ":" 'cept on win32 and dos. Add extra tests here as needed.
+#here I assume ":" 'cept on win32, dos, and netware. Add extra tests here as 
+#needed.
 my $s=":";
-if(($^O eq "MSWin32") || ($^O eq "dos") || ($^O eq "cygwin"))
+
+my $onnetware = 0;
+if ($^O eq "NetWare")
+{
+  $onnetware = 1;
+}
+
+if(($^O eq "MSWin32") || ($^O eq "dos") || ($^O eq "cygwin") || 
+   ($onnetware == 1))
         {
         $s=";";
         }
@@ -67,6 +77,13 @@
         print "warning: no initial classpath\n" if ($debug);
         $localpath="";
         }
+if ($onnetware == 1)
+{
+# avoid building a command line bigger than 512 characters - make localpath
+# only include the "extra" stuff, and add in the system classpath as an expanded
+# variable. 
+  $localpath="";
+}
 
 #add jar files. I am sure there is a perl one liner to do this.
 my $jarpattern="$HOME/lib/*.jar";
@@ -106,6 +123,7 @@
 my @ANT_ARGS=split(" ", $ENV{ANT_ARGS});
 
 #jikes
+print "\n \$ANT_OPTS=@ANT_OPTS\n" if ($debug);
 if($ENV{JIKESPATH} ne "")
         {
         push @ANT_OPTS, "-Djikes.class.path=$ENV{JIKESPATH}";
@@ -113,7 +131,19 @@
 
 #construct arguments to java
 my @ARGS;
-push @ARGS, "-classpath", "$localpath", "-Dant.home=$HOME";
+
+if ($onnetware == 1)
+{
+# make classpath literally $CLASSPATH; and then the contents of $localpath
+# this is to avoid pushing us over the 512 character limit
+# even skip the ; - that is already in $localpath
+  push @ARGS, "-classpath", "\$CLASSPATH$localpath";
+}
+else
+{
+  push @ARGS, "-classpath", "$localpath";
+}
+push @ARGS, "-Dant.home=$HOME";
 push @ARGS, @ANT_OPTS;
 push @ARGS, "org.apache.tools.ant.Main", @ANT_ARGS;
 push @ARGS, @ARGV;
