diff options
author | jonkri <[email protected]> | 2008-10-01 15:18:44 +0000 |
---|---|---|
committer | jonkri <[email protected]> | 2008-10-01 15:18:44 +0000 |
commit | 15254861eca42c5d0cdd008eb0c89ee4d953d48d (patch) | |
tree | f74598f0337feaf0f1425af3dd9d336cad018e19 /src/main/java/net/sf/antcontrib | |
parent | ccfd2df5248f621f43923c7b21499a3d0d87c90f (diff) |
Fixed support for long MinGW Windows commands. Thanks to Curt Arnold for pointing at this solution.
git-svn-id: file:///home/sven/projects/JOGL/temp/ant-contrib/svn/ant-contrib-code/cpptasks/trunk@175 32d7a393-a5a9-423c-abd3-5d954feb1f2f
Diffstat (limited to 'src/main/java/net/sf/antcontrib')
-rw-r--r-- | src/main/java/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java index 999ccf7..ba88d46 100644 --- a/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java +++ b/src/main/java/net/sf/antcontrib/cpptasks/gcc/GccCCompiler.java @@ -1,5 +1,5 @@ /* - * + * * Copyright 2001-2004 The Ant-Contrib project * * Licensed under the Apache License, Version 2.0 (the "License"); @@ -32,7 +32,7 @@ import net.sf.antcontrib.cpptasks.OptimizationEnum; /** * Adapter for the GCC C/C++ compiler - * + * * @author Adam Murdoch */ public final class GccCCompiler extends GccCompatibleCCompiler { @@ -106,14 +106,14 @@ public final class GccCCompiler extends GccCompatibleCCompiler { libtoolCompiler, newEnvironment, env); isPICMeaningful = System.getProperty("os.name").indexOf("Windows") < 0; } - public void addImpliedArgs(final Vector args, + public void addImpliedArgs(final Vector args, final boolean debug, - final boolean multithreaded, - final boolean exceptions, + final boolean multithreaded, + final boolean exceptions, final LinkType linkType, final Boolean rtti, final OptimizationEnum optimization) { - super.addImpliedArgs(args, debug, multithreaded, + super.addImpliedArgs(args, debug, multithreaded, exceptions, linkType, rtti, optimization); if (isPICMeaningful && linkType.isSharedLibrary()) { args.addElement("-fPIC"); @@ -130,9 +130,9 @@ public final class GccCCompiler extends GccCompatibleCCompiler { } /** * Create parser to determine dependencies. - * + * * Will create appropriate parser (C++, FORTRAN) based on file extension. - * + * */ protected Parser createParser(File source) { if (source != null) { @@ -237,6 +237,16 @@ public final class GccCCompiler extends GccCompatibleCCompiler { return GccLinker.getInstance().getLinker(linkType); } public int getMaximumCommandLength() { - return Integer.MAX_VALUE; + /* + * Window-specific compilers use a limit of 2048 to prevent over + * running the available command line length, while the Unix compilers + * assume that they have an unlimited command line. + */ + if(System.getProperty("os.name").indexOf("Windows") >= 0) { + return 2048; + } + else { + return Integer.MAX_VALUE; + } } } |