From: Curt A. <ca...@us...> - 2004-05-11 04:50:55
|
Update of /cvsroot/ant-contrib/cpptasks/src/net/sf/antcontrib/cpptasks/gcc In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26613/src/net/sf/antcontrib/cpptasks/gcc Modified Files: AbstractArLibrarian.java AbstractLdLinker.java Log Message: versioninfo support for msvc and bcc (bug 941119) Index: AbstractArLibrarian.java =================================================================== RCS file: /cvsroot/ant-contrib/cpptasks/src/net/sf/antcontrib/cpptasks/gcc/AbstractArLibrarian.java,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** AbstractArLibrarian.java 5 May 2004 03:50:44 -0000 1.15 --- AbstractArLibrarian.java 11 May 2004 04:50:12 -0000 1.16 *************** *** 23,26 **** --- 23,27 ---- import net.sf.antcontrib.cpptasks.compiler.CommandLineLinkerConfiguration; import net.sf.antcontrib.cpptasks.compiler.LinkType; + import net.sf.antcontrib.cpptasks.VersionInfo; import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum; *************** *** 73,78 **** return Integer.MAX_VALUE; } ! public String[] getOutputFileNames(String baseName) { ! String[] baseNames = super.getOutputFileNames(baseName); if (outputPrefix.length() > 0) { for(int i = 0; i < baseNames.length; i++) { --- 74,79 ---- return Integer.MAX_VALUE; } ! public String[] getOutputFileNames(String baseName, VersionInfo versionInfo) { ! String[] baseNames = super.getOutputFileNames(baseName, versionInfo); if (outputPrefix.length() > 0) { for(int i = 0; i < baseNames.length; i++) { Index: AbstractLdLinker.java =================================================================== RCS file: /cvsroot/ant-contrib/cpptasks/src/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** AbstractLdLinker.java 5 May 2004 03:50:44 -0000 1.17 --- AbstractLdLinker.java 11 May 2004 04:50:12 -0000 1.18 *************** *** 1,4 **** /* ! * * Copyright 2002-2004 The Ant-Contrib project * --- 1,4 ---- /* ! * * Copyright 2002-2004 The Ant-Contrib project * *************** *** 24,27 **** --- 24,28 ---- import net.sf.antcontrib.cpptasks.compiler.CommandLineLinkerConfiguration; import net.sf.antcontrib.cpptasks.compiler.LinkType; + import net.sf.antcontrib.cpptasks.VersionInfo; import net.sf.antcontrib.cpptasks.types.LibrarySet; import net.sf.antcontrib.cpptasks.types.LibraryTypeEnum; *************** *** 29,33 **** /** * Abstract adapter for ld-like linkers ! * * @author Curt Arnold */ --- 30,34 ---- /** * Abstract adapter for ld-like linkers ! * * @author Curt Arnold */ *************** *** 43,50 **** } public void addBase(long base, Vector args) { ! if (base >= 0) { ! args.addElement("--image-base"); ! args.addElement(Long.toHexString(base)); ! } } public void addFixed(Boolean fixed, Vector args) { --- 44,51 ---- } public void addBase(long base, Vector args) { ! if (base >= 0) { ! args.addElement("--image-base"); ! args.addElement(Long.toHexString(base)); ! } } public void addFixed(Boolean fixed, Vector args) { *************** *** 77,83 **** } public void addIncremental(boolean incremental, Vector args) { ! if (incremental) { ! args.addElement("-i"); ! } } protected int addLibraryPatterns(String[] libnames, StringBuffer buf, --- 78,84 ---- } public void addIncremental(boolean incremental, Vector args) { ! if (incremental) { ! args.addElement("-i"); ! } } protected int addLibraryPatterns(String[] libnames, StringBuffer buf, *************** *** 102,112 **** String[] libs = set.getLibs(); if (libdir != null) { ! if (set.getType() != null && ! "framework".equals(set.getType().getValue()) && ! isDarwin()) { ! endargs.addElement("-F" + libdir.getAbsolutePath()); ! } else { ! endargs.addElement("-L" + libdir.getAbsolutePath()); ! } } // --- 103,113 ---- String[] libs = set.getLibs(); if (libdir != null) { ! if (set.getType() != null && ! "framework".equals(set.getType().getValue()) && ! isDarwin()) { ! endargs.addElement("-F" + libdir.getAbsolutePath()); ! } else { ! endargs.addElement("-L" + libdir.getAbsolutePath()); ! } } // *************** *** 114,135 **** // if (set.getType() != previousLibraryType) { ! if (set.getType() != null && "static".equals(set.getType().getValue())) { ! endargs.addElement("-Bstatic"); ! previousLibraryType = set.getType(); ! } else { ! if (set.getType() == null || ! !"framework".equals(set.getType().getValue()) || ! !isDarwin()) { ! endargs.addElement("-Bdynamic"); ! previousLibraryType = set.getType(); ! } ! } } StringBuffer buf = new StringBuffer("-l"); ! if (set.getType() != null && ! "framework".equals(set.getType().getValue()) && ! isDarwin()) { ! buf.setLength(0); ! buf.append("-framework "); } int initialLength = buf.length(); --- 115,136 ---- // if (set.getType() != previousLibraryType) { ! if (set.getType() != null && "static".equals(set.getType().getValue())) { ! endargs.addElement("-Bstatic"); ! previousLibraryType = set.getType(); ! } else { ! if (set.getType() == null || ! !"framework".equals(set.getType().getValue()) || ! !isDarwin()) { ! endargs.addElement("-Bdynamic"); ! previousLibraryType = set.getType(); ! } ! } } StringBuffer buf = new StringBuffer("-l"); ! if (set.getType() != null && ! "framework".equals(set.getType().getValue()) && ! isDarwin()) { ! buf.setLength(0); ! buf.append("-framework "); } int initialLength = buf.length(); *************** *** 155,167 **** } public void addMap(boolean map, Vector args) { ! if (map) { ! args.addElement("-M"); ! } } public void addStack(int stack, Vector args) { ! if (stack > 0) { ! args.addElement("--stack"); ! args.addElement(Integer.toString(stack)); ! } } /* (non-Javadoc) --- 156,168 ---- } public void addMap(boolean map, Vector args) { ! if (map) { ! args.addElement("-M"); ! } } public void addStack(int stack, Vector args) { ! if (stack > 0) { ! args.addElement("--stack"); ! args.addElement(Integer.toString(stack)); ! } } /* (non-Javadoc) *************** *** 169,178 **** */ protected void addEntry(String entry, Vector args) { ! if (entry != null) { ! args.addElement("-e"); ! args.addElement(entry); ! } } ! public String getCommandFileSwitch(String commandFile) { throw new IllegalStateException("ld does not support command files"); --- 170,179 ---- */ protected void addEntry(String entry, Vector args) { ! if (entry != null) { ! args.addElement("-e"); ! args.addElement(entry); ! } } ! public String getCommandFileSwitch(String commandFile) { throw new IllegalStateException("ld does not support command files"); *************** *** 180,184 **** /** * Returns library path. ! * */ protected File[] getEnvironmentIncludePath() { --- 181,185 ---- /** * Returns library path. ! * */ protected File[] getEnvironmentIncludePath() { *************** *** 195,199 **** /** * Returns library path. ! * */ public File[] getLibraryPath() { --- 196,200 ---- /** * Returns library path. ! * */ public File[] getLibraryPath() { *************** *** 204,232 **** int patternCount = libnames.length; if (libType == null) { ! patternCount *= 2; } String[] patterns = new String[patternCount]; int offset = 0; if (libType == null || "static".equals(libType.getValue())) { ! offset = addLibraryPatterns(libnames, buf, "lib", ".a", patterns, 0); } if (libType != null && "framework".equals(libType.getValue()) && isDarwin()) { ! for(int i = 0; i < libnames.length; i++) { ! buf.setLength(0); ! buf.append(libnames[i]); ! buf.append(".framework/"); ! buf.append(libnames[i]); ! patterns[offset++] = buf.toString(); ! } } else { ! if (libType == null || !"static".equals(libType.getValue())) { ! if (isHPUX()) { ! offset = addLibraryPatterns(libnames, buf, "lib", ".sl", patterns, ! offset); ! } else { ! offset = addLibraryPatterns(libnames, buf, "lib", ".so", patterns, ! offset); ! } ! } } return patterns; --- 205,233 ---- int patternCount = libnames.length; if (libType == null) { ! patternCount *= 2; } String[] patterns = new String[patternCount]; int offset = 0; if (libType == null || "static".equals(libType.getValue())) { ! offset = addLibraryPatterns(libnames, buf, "lib", ".a", patterns, 0); } if (libType != null && "framework".equals(libType.getValue()) && isDarwin()) { ! for(int i = 0; i < libnames.length; i++) { ! buf.setLength(0); ! buf.append(libnames[i]); ! buf.append(".framework/"); ! buf.append(libnames[i]); ! patterns[offset++] = buf.toString(); ! } } else { ! if (libType == null || !"static".equals(libType.getValue())) { ! if (isHPUX()) { ! offset = addLibraryPatterns(libnames, buf, "lib", ".sl", patterns, ! offset); ! } else { ! offset = addLibraryPatterns(libnames, buf, "lib", ".so", patterns, ! offset); ! } ! } } return patterns; *************** *** 235,250 **** return Integer.MAX_VALUE; } ! public String[] getOutputFileNames(String baseName) { ! String[] baseNames = super.getOutputFileNames(baseName); ! if (outputPrefix.length() > 0) { ! for(int i = 0; i < baseNames.length; i++) { ! baseNames[i] = outputPrefix + baseNames[i]; ! } ! } return baseNames; } - public String[] getOutputFileSwitch(String outputFile) { - return GccProcessor.getOutputFileSwitch("-o", outputFile); - } public boolean isCaseSensitive() { return true; --- 236,248 ---- return Integer.MAX_VALUE; } ! public String[] getOutputFileNames(String baseName, VersionInfo versionInfo) { ! String[] baseNames = super.getOutputFileNames(baseName, versionInfo); ! if (outputPrefix.length() > 0) { ! for(int i = 0; i < baseNames.length; i++) { ! baseNames[i] = outputPrefix + baseNames[i]; ! } ! } return baseNames; } public boolean isCaseSensitive() { return true; *************** *** 260,264 **** * Prepares argument list for exec command. Will return null if command * line would exceed allowable command line buffer. ! * * @param outputFile * linker output file --- 258,262 ---- * Prepares argument list for exec command. Will return null if command * line would exceed allowable command line buffer. ! * * @param outputFile * linker output file |