diff options
author | Sven Gothel <[email protected]> | 2023-01-23 09:59:09 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2023-01-23 09:59:09 +0100 |
commit | 2bdb8fea6470935244b16569c1febc7f366ac367 (patch) | |
tree | f7c40b872ac550ee263a0bb7e3acc09840ce39fa | |
parent | c70333101afd4ee36a5b55e9b616dcdf59925cb5 (diff) |
Move AbstractLdLinker.isHPUX() to AbstractProcessor using Platform.OS_TYPE; Adopt more flexible 'hp-ux' parsing to Platform
3 files changed, 14 insertions, 14 deletions
diff --git a/src/main/java/net/sf/antcontrib/cpptasks/Platform.java b/src/main/java/net/sf/antcontrib/cpptasks/Platform.java index fd8ce22..76d2cb0 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/Platform.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/Platform.java @@ -53,9 +53,6 @@ public class Platform { if ( osLower.startsWith("sunos") ) { return OSType.SUNOS; } - if ( osLower.startsWith("hp-ux") ) { - return OSType.HPUX; - } if ( osLower.startsWith("windows") ) { return OSType.WINDOWS; } @@ -65,6 +62,12 @@ public class Platform { if ( osLower.startsWith("ios") ) { return OSType.IOS; } + if ( osLower.startsWith("hp-ux") || + ( osLower.startsWith("hp") && osLower.indexOf("ux") >= 0 ) + ) + { + return OSType.HPUX; + } throw new RuntimeException("Please port OS detection to your platform (" + OS_NAME + ")"); } } diff --git a/src/main/java/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java b/src/main/java/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java index 7ce1872..a240346 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/compiler/AbstractProcessor.java @@ -114,17 +114,20 @@ public abstract class AbstractProcessor implements Processor, Cloneable { /** * Returns true if the target operating system is Mac OS X or Darwin. - * - * @return boolean */ protected boolean isDarwin() { return OSType.MACOS == Platform.OS_TYPE; } /** + * Returns true if the target operating system is HP-UX. + */ + protected boolean isHPUX() { + return OSType.HPUX == Platform.OS_TYPE; + } + + /** * Returns true if the target operating system is MS Windows. - * - * @return boolean */ protected boolean isWindows() { return OSType.WINDOWS == Platform.OS_TYPE; diff --git a/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java b/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java index 8543d4f..57424a8 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java @@ -274,13 +274,7 @@ public abstract class AbstractLdLinker extends CommandLineLinker { public boolean isCaseSensitive() { return true; } - protected boolean isHPUX() { - final String osname = System.getProperty("os.name").toLowerCase(); - if (osname.indexOf("hp") >= 0 && osname.indexOf("ux") >= 0) { - return true; - } - return false; - } + /** * Prepares argument list for exec command. Will return null if command * line would exceed allowable command line buffer. |