enabled libbreakgen library on Mac

This commit is contained in:
nik
2011-03-31 16:41:58 +04:00
parent 8660555012
commit a521a78b93
2 changed files with 27 additions and 11 deletions
@@ -38,20 +38,28 @@ public class AppMain {
static {
String binPath = System.getProperty(PROPERTY_BINPATH) + File.separator;
final String osName = System.getProperty("os.name").toLowerCase();
String arch = System.getProperty("os.arch").toLowerCase();
String libPath = null;
if (osName.startsWith("windows")) {
if (System.getProperty("os.arch").equals("amd64")) {
if (arch.equals("amd64")) {
libPath = binPath + "breakgen64.dll";
}
else {
libPath = binPath + "breakgen.dll";
}
} else if (osName.startsWith("linux")) {
if (System.getProperty("os.arch").toLowerCase().equals("amd64")) {
if (arch.equals("amd64")) {
libPath = binPath + "libbreakgen64.so";
} else {
libPath = binPath + "libbreakgen.so";
}
} else if (osName.startsWith("mac")) {
if (arch.endsWith("64")) {
libPath = binPath + "libbreakgen64.jnilib";
} else {
libPath = binPath + "libbreakgen.jnilib";
}
}
try {
if (libPath != null) {
@@ -59,7 +67,9 @@ public class AppMain {
}
}
catch (UnsatisfiedLinkError e) {
//Do nothing, unknown os or some other error => no ctrl-break is available
if (new File(libPath).exists() && osName.startsWith("mac")) {
e.printStackTrace();
}
}
}
@@ -86,19 +96,16 @@ public class AppMain {
System.exit(1);
}
}
} catch (IOException e) {
return;
} catch (IllegalArgumentException iae) {
return;
} catch (SecurityException se) {
return;
} catch (IOException ignored) {
} catch (IllegalArgumentException ignored) {
} catch (SecurityException ignored) {
}
}
}, "Monitor Ctrl-Break");
try {
t.setDaemon(true);
t.start();
} catch (Exception e) {}
} catch (Exception ignored) {}
String mainClass = args[0];
String[] parms = new String[args.length - 1];