Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Maintenance:12.2_ArchPorts
libgda
libgda-better-javadetection.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File libgda-better-javadetection.patch of Package libgda
From e77368ba68e6275e331c8a4f24b4b07cc81c2f6d Mon Sep 17 00:00:00 2001 From: Vivien Malerba <malerba@gnome-db.org> Date: Sun, 03 Jun 2012 16:08:51 +0000 Subject: Java detection improvements use java.home as well as java.library.path --- diff --git a/getsp.class b/getsp.class index d4e9227..ec4e45a 100644 --- a/getsp.class +++ b/getsp.class Binary files differ diff --git a/getsp.java b/getsp.java index c2e295f..f926129 100644 --- a/getsp.java +++ b/getsp.java @@ -8,28 +8,53 @@ public class getsp { if (args[0].compareTo("-test")==0) { System.out.println("Test1234OK"); } - else if (args[0].compareTo("-libs")==0) { + else if (args[0].compareTo("-libs")==0) { String prefix="-L"; if (args.length>1) prefix=args[1]; - String lp=System.getProperty("java.library.path"); + // we're not using StringTokenizer in case the JVM is very crude int i=0,j,k=0; String r=null; String pss=System.getProperty("path.separator"); char ps=':'; if (pss!=null && pss.length()>0) ps=pss.charAt(0); + + // using java.library.path + String lp=System.getProperty("java.home"); j=lp.length(); while (i<=j) { if (i==j || lp.charAt(i)==ps) { String lib=lp.substring(k,i); + String suffix="/lib/amd64/server"; + k=i+1; + if (lib.compareTo(".")!=0) + r=(r==null)?(prefix+lib+suffix):(r+" "+prefix+lib+suffix); + } + i++; + } + + // using java.home + lp=System.getProperty("java.library.path"); + j=lp.length(); + i=0; + k=0; + while (i<=j) { + if (i==j || lp.charAt(i)==ps) { + String lib=lp.substring(k,i); k=i+1; if (lib.compareTo(".")!=0) r=(r==null)?(prefix+lib):(r+" "+prefix+lib); } i++; } + if (r!=null) System.out.println(r); - } else + } else if (args[0].compareTo("-ldpath")==0) { + String lp1=System.getProperty("java.home")+"/lib/amd64/server"; + String lp2=System.getProperty("java.library.path"); + System.out.println(lp1+":"+lp2); + } + else System.out.println(System.getProperty(args[0])); } } diff --git a/m4/java.m4 b/m4/java.m4 index 7f8e264..dc1e121 100644 --- a/m4/java.m4 +++ b/m4/java.m4 @@ -215,7 +215,7 @@ m4_define([_JAVA_CHECK_INTERNAL], *) RUN_JAVA(JAVA_LIBS, [-classpath ${srcdir} getsp -libs]) JAVA_LIBS="${JAVA_LIBS} -ljvm" - RUN_JAVA(JAVA_LD_PATH, [-classpath ${srcdir} getsp java.library.path]) + RUN_JAVA(JAVA_LD_PATH, [-classpath ${srcdir} getsp -ldpath]) ;; esac # note that we actually don't test JAVA_LIBS - we hope that the detection -- cgit v0.9.0.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor