SF.net SVN: ant-contrib: [119] trunk/cpptasks/src/net/sf/antcontrib/ cpptasks

[email protected]
Newsgroups gmane.comp.java.ant-contrib.devel
Message-ID <[email protected]>
Revision: 119
          http://svn.sourceforge.net/ant-contrib/?rev=119&view=rev
Author:   darius42
Date:     2007-05-13 07:27:55 -0700 (Sun, 13 May 2007)

Log Message:
-----------
Address 1716271, fix linker issues with shared libraries with VisualAge.

Modified Paths:
--------------
    trunk/cpptasks/src/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java
    trunk/cpptasks/src/net/sf/antcontrib/cpptasks/ibm/VisualAgeLinker.java

Modified: trunk/cpptasks/src/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java
===================================================================
--- trunk/cpptasks/src/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java	2007-04-25 17:58:06 UTC (rev 118)
+++ trunk/cpptasks/src/net/sf/antcontrib/cpptasks/gcc/AbstractLdLinker.java	2007-05-13 14:27:55 UTC (rev 119)
@@ -115,13 +115,13 @@
             //
             if (set.getType() != previousLibraryType) {
                     if (set.getType() != null && "static".equals(set.getType().getValue())) {
-                            endargs.addElement("-Bstatic");
+                            endargs.addElement(getStaticLibFlag());
                             previousLibraryType = set.getType();
                     } else {
                             if (set.getType() == null ||
                                             !"framework".equals(set.getType().getValue()) ||
                                                         !isDarwin()) {
-                                    endargs.addElement("-Bdynamic");
+                                    endargs.addElement(getDynamicLibFlag());
                                     previousLibraryType = set.getType();
                             }
                     }
@@ -322,4 +322,12 @@
         return super.prepareArguments(task, outputDir, outputFile,
                 finalSources, config);
     }
+
+    protected String getDynamicLibFlag() {
+        return "-Bdynamic";
+    }
+
+    protected String getStaticLibFlag() {
+        return "-Bstatic";
+    }
 }

Modified: trunk/cpptasks/src/net/sf/antcontrib/cpptasks/ibm/VisualAgeLinker.java
===================================================================
--- trunk/cpptasks/src/net/sf/antcontrib/cpptasks/ibm/VisualAgeLinker.java	2007-04-25 17:58:06 UTC (rev 118)
+++ trunk/cpptasks/src/net/sf/antcontrib/cpptasks/ibm/VisualAgeLinker.java	2007-05-13 14:27:55 UTC (rev 119)
@@ -31,7 +31,7 @@
     private static final String[] objFiles = new String[]{".o", ".a", ".lib",
             ".dll", ".so", ".sl"};
     private static final VisualAgeLinker dllLinker = new VisualAgeLinker(
-            "makeC++SharedLib", objFiles, discardFiles, "lib", ".so");
+            "xlC", objFiles, discardFiles, "lib", ".a");
     private static final VisualAgeLinker instance = new VisualAgeLinker("xlC",
             objFiles, discardFiles, "", "");
     public static VisualAgeLinker getInstance() {
@@ -50,7 +50,7 @@
             //args.addElement("-g");
         }
         if (linkType.isSharedLibrary()) {
-            //args.addElement("-G");
+            args.addElement("-qmkshrobj");
         }
     }
     public Linker getLinker(LinkType type) {
@@ -69,7 +69,15 @@
      * would lock up.  Using a stock response.
      */
     public String getIdentifier() {
-    	return "VisualAge linker - unidentified version";
+        return "VisualAge linker - unidentified version";
     }
+
+    protected String getDynamicLibFlag() {
+        return "-bdynamic";  
+    }
+
+    protected String getStaticLibFlag() {
+        return "-bstatic";
+    }
     
 }


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.