The R Project SVN R

Rev

Rev 35572 | Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
35526 urbaneks 1
public class getsp {
2
    public static void main(String[] args) {
3
	if (args!=null && args.length>0) {
4
	    if (args[0].compareTo("-libs")==0) {
5
		String prefix="-L";
6
		if (args.length>1) prefix=args[1];
7
		String lp=System.getProperty("java.library.path");
8
		// we're not using StringTokenizer in case the JVM is very crude
9
		int i=0,j,k=0;
10
		String r=null;
11
		String pss=System.getProperty("path.separator");
12
		char ps=':';
13
		if (pss!=null && pss.length()>0) ps=pss.charAt(0);
14
		j=lp.length();
15
		while (i<=j) {
16
		    if (i==j || lp.charAt(i)==ps) {
17
			String lib=lp.substring(k,i);
18
			k=i+1;
19
			if (lib.compareTo(".")!=0)
20
			    r=(r==null)?(prefix+lib):(r+" "+prefix+lib);
21
		    }
22
		    i++;
23
		}
24
		if (r!=null) System.out.println(r);
25
	    } else
26
		System.out.println(System.getProperty(args[0]));
27
	}
28
    }
29
}