ensure absolute path and add more helpers
This commit is contained in:
parent
fb7a499219
commit
299dbd1831
|
@ -34,8 +34,10 @@ public class VMControlLibrary {
|
||||||
private static final String VMCONTROL_TAR =
|
private static final String VMCONTROL_TAR =
|
||||||
getProperty("control.tar", VMWARE_LIB + "/perl/control.tar");
|
getProperty("control.tar", VMWARE_LIB + "/perl/control.tar");
|
||||||
|
|
||||||
|
private static final String VMCONTROL = "vmcontrol";
|
||||||
|
|
||||||
private static final String VMCONTROL_OBJ =
|
private static final String VMCONTROL_OBJ =
|
||||||
getProperty("vmcontrol.o", "control-only/vmcontrol.o");
|
getProperty("vmcontrol.o", "control-only/" + VMCONTROL + ".o");
|
||||||
|
|
||||||
private static final String GCC =
|
private static final String GCC =
|
||||||
getProperty("bin.gcc", "/usr/bin/gcc");
|
getProperty("bin.gcc", "/usr/bin/gcc");
|
||||||
|
@ -82,12 +84,18 @@ public class VMControlLibrary {
|
||||||
System.setProperty(PROP_VMCONTROL_SHLIB, lib);
|
System.setProperty(PROP_VMCONTROL_SHLIB, lib);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void link()
|
||||||
|
throws IOException {
|
||||||
|
|
||||||
|
link(VMCONTROL + ".so");
|
||||||
|
}
|
||||||
|
|
||||||
public static void link(String name)
|
public static void link(String name)
|
||||||
throws IOException {
|
throws IOException {
|
||||||
|
|
||||||
setSharedLibrary(name);
|
File out = new File(name).getAbsoluteFile();
|
||||||
|
setSharedLibrary(out.getPath());
|
||||||
|
|
||||||
File out = new File(name);
|
|
||||||
if (out.exists()) {
|
if (out.exists()) {
|
||||||
return; //already linked
|
return; //already linked
|
||||||
}
|
}
|
||||||
|
@ -128,6 +136,10 @@ public class VMControlLibrary {
|
||||||
exec(link_args);
|
exec(link_args);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static boolean isLoaded() {
|
||||||
|
return VMwareObject.LOADED;
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) throws Exception {
|
public static void main(String[] args) throws Exception {
|
||||||
link(args[0]);
|
link(args[0]);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue