Author: faridz
Date: Wed Nov 15 06:15:58 2006
New Revision: 475243

URL: http://svn.apache.org/viewvc?view=rev&rev=475243
Log:
2006-11-15 Farid Zaripov <[EMAIL PROTECTED]>

        * COLLAPSE_STATIC_LOCALS.cpp: Removed "./" from the LDOPTS.
        * COLLAPSE_TEMPLATE_LOCALS.cpp: Ditto.
        * COLLAPSE_TEMPLATE_STATICS.cpp: Ditto.
        * EXPORT.cpp: Ditto.
        * EXTERN_FUNCTION_TEMPLATE.cpp: Ditto.
        * EXTERN_INLINE.cpp: Ditto.
        * EXTERN_MEMBER_TEMPLATE.cpp: Ditto.
        * EXTERN_TEMPLATE.cpp: Ditto.
        * EXTERN_TEMPLATE_BEFORE_DEFINITION.cpp: Ditto.
        * IMPLICIT_INSTANTIATION.cpp: Ditto.
        * LIB_EXCEPTIONS.cpp: Ditto.
        * collapse_static_locals.lib.cpp (bar) [_WIN32 && _DLL]: Added
        __declspec (dllexport) to the function definition.
        * collapse_template_locals.lib.cpp (bar): Ditto.
        * collapse_template_statics.lib.cpp (bar): Ditto.
        * extern_inline.lib.cpp (foo): Ditto.
        * lib_exceptions.lib.cpp (foo): Ditto.
        * configure.wsf (runExeTests): Removed replacing the "./" in LDOPTS.
        (compileLibs): Added parameter: shared.
        (makeLibrary): Ditto. Added creation of the dynamic library (dll)
        instead of static library, if shared is true

Modified:
    incubator/stdcxx/trunk/etc/config/src/COLLAPSE_STATIC_LOCALS.cpp
    incubator/stdcxx/trunk/etc/config/src/COLLAPSE_TEMPLATE_LOCALS.cpp
    incubator/stdcxx/trunk/etc/config/src/COLLAPSE_TEMPLATE_STATICS.cpp
    incubator/stdcxx/trunk/etc/config/src/EXPORT.cpp
    incubator/stdcxx/trunk/etc/config/src/EXTERN_FUNCTION_TEMPLATE.cpp
    incubator/stdcxx/trunk/etc/config/src/EXTERN_INLINE.cpp
    incubator/stdcxx/trunk/etc/config/src/EXTERN_MEMBER_TEMPLATE.cpp
    incubator/stdcxx/trunk/etc/config/src/EXTERN_TEMPLATE.cpp
    incubator/stdcxx/trunk/etc/config/src/EXTERN_TEMPLATE_BEFORE_DEFINITION.cpp
    incubator/stdcxx/trunk/etc/config/src/IMPLICIT_INSTANTIATION.cpp
    incubator/stdcxx/trunk/etc/config/src/LIB_EXCEPTIONS.cpp
    incubator/stdcxx/trunk/etc/config/src/collapse_static_locals.lib.cpp
    incubator/stdcxx/trunk/etc/config/src/collapse_template_locals.lib.cpp
    incubator/stdcxx/trunk/etc/config/src/collapse_template_statics.lib.cpp
    incubator/stdcxx/trunk/etc/config/src/extern_inline.lib.cpp
    incubator/stdcxx/trunk/etc/config/src/lib_exceptions.lib.cpp
    incubator/stdcxx/trunk/etc/config/windows/configure.wsf

Modified: incubator/stdcxx/trunk/etc/config/src/COLLAPSE_STATIC_LOCALS.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/COLLAPSE_STATIC_LOCALS.cpp?view=diff&rev=475243&r1=475242&r2=475243
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/COLLAPSE_STATIC_LOCALS.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/COLLAPSE_STATIC_LOCALS.cpp Wed Nov 15 
06:15:58 2006
@@ -8,7 +8,7 @@
 #  ifndef _RWSTD_NO_collapse_static_locals.lib
 
      // link this compiled translation unit with the lib below
-     // LDOPTS = ./collapse_static_locals.lib$(LIBSUFFIX)
+     // LDOPTS = collapse_static_locals.lib$(LIBSUFFIX)
 
 #  endif   // _RWSTD_NO_collapse_static_locals.lib
 #endif   // 0

Modified: incubator/stdcxx/trunk/etc/config/src/COLLAPSE_TEMPLATE_LOCALS.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/COLLAPSE_TEMPLATE_LOCALS.cpp?view=diff&rev=475243&r1=475242&r2=475243
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/COLLAPSE_TEMPLATE_LOCALS.cpp 
(original)
+++ incubator/stdcxx/trunk/etc/config/src/COLLAPSE_TEMPLATE_LOCALS.cpp Wed Nov 
15 06:15:58 2006
@@ -8,7 +8,7 @@
 #  ifndef _RWSTD_NO_collapse_template_locals.lib
 
      // link this compiled translation unit with the lib below
-     // LDOPTS = ./collapse_template_locals.lib$(LIBSUFFIX)
+     // LDOPTS = collapse_template_locals.lib$(LIBSUFFIX)
 
 #  endif   // _RWSTD_NO_collapse_template_locals.lib
 #endif   // 0

Modified: incubator/stdcxx/trunk/etc/config/src/COLLAPSE_TEMPLATE_STATICS.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/COLLAPSE_TEMPLATE_STATICS.cpp?view=diff&rev=475243&r1=475242&r2=475243
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/COLLAPSE_TEMPLATE_STATICS.cpp 
(original)
+++ incubator/stdcxx/trunk/etc/config/src/COLLAPSE_TEMPLATE_STATICS.cpp Wed Nov 
15 06:15:58 2006
@@ -8,7 +8,7 @@
 #  ifndef _RWSTD_NO_collapse_template_statics.lib
 
      // link this compiled translation unit with the lib below
-     // LDOPTS = ./collapse_template_statics.lib$(LIBSUFFIX)
+     // LDOPTS = collapse_template_statics.lib$(LIBSUFFIX)
 
 #  endif   // _RWSTD_NO_collapse_template_statics.lib
 #endif   // 0

Modified: incubator/stdcxx/trunk/etc/config/src/EXPORT.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/EXPORT.cpp?view=diff&rev=475243&r1=475242&r2=475243
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/EXPORT.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/EXPORT.cpp Wed Nov 15 06:15:58 2006
@@ -9,7 +9,7 @@
 
 // establish a dependency on EXPORT_KEYWORD.cpp which must be
 // compiled first since it defines the exported function template
-// LDOPTS = ./EXPORT_KEYWORD.o 
+// LDOPTS = EXPORT_KEYWORD.o 
 #endif   // _RWSTD_NO_EXPORT_KEYWORD
 
 

Modified: incubator/stdcxx/trunk/etc/config/src/EXTERN_FUNCTION_TEMPLATE.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/EXTERN_FUNCTION_TEMPLATE.cpp?view=diff&rev=475243&r1=475242&r2=475243
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/EXTERN_FUNCTION_TEMPLATE.cpp 
(original)
+++ incubator/stdcxx/trunk/etc/config/src/EXTERN_FUNCTION_TEMPLATE.cpp Wed Nov 
15 06:15:58 2006
@@ -9,7 +9,7 @@
 
 // link the object file produced by compiling this file
 // with the object file below
-// LDOPTS = ./extern_function_template_imp.o
+// LDOPTS = extern_function_template_imp.o
 
 #endif   // _RWSTD_NO_extern_function_template_imp
 

Modified: incubator/stdcxx/trunk/etc/config/src/EXTERN_INLINE.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/EXTERN_INLINE.cpp?view=diff&rev=475243&r1=475242&r2=475243
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/EXTERN_INLINE.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/EXTERN_INLINE.cpp Wed Nov 15 06:15:58 
2006
@@ -8,7 +8,7 @@
 #  ifndef _RWSTD_NO_extern_inline.lib
 
      // link this compiled translation unit with the lib below
-     // LDOPTS = ./extern_inline.lib$(LIBSUFFIX)
+     // LDOPTS = extern_inline.lib$(LIBSUFFIX)
 
 #  endif   // _RWSTD_NO_extern_inline.lib
 #endif   // 0

Modified: incubator/stdcxx/trunk/etc/config/src/EXTERN_MEMBER_TEMPLATE.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/EXTERN_MEMBER_TEMPLATE.cpp?view=diff&rev=475243&r1=475242&r2=475243
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/EXTERN_MEMBER_TEMPLATE.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/EXTERN_MEMBER_TEMPLATE.cpp Wed Nov 15 
06:15:58 2006
@@ -25,7 +25,7 @@
 #ifndef _RWSTD_NO_extern_template_imp
 
 // link with the object file below
-// LDOPTS = ./extern_template_imp.o
+// LDOPTS = extern_template_imp.o
 
 #endif   // _RWSTD_NO_extern_template_imp
 

Modified: incubator/stdcxx/trunk/etc/config/src/EXTERN_TEMPLATE.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/EXTERN_TEMPLATE.cpp?view=diff&rev=475243&r1=475242&r2=475243
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/EXTERN_TEMPLATE.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/EXTERN_TEMPLATE.cpp Wed Nov 15 
06:15:58 2006
@@ -15,7 +15,7 @@
 #ifndef _RWSTD_NO_extern_template_imp
 
 // link with the object file below
-// LDOPTS = ./extern_template_imp.o
+// LDOPTS = extern_template_imp.o
 
 #endif   // _RWSTD_NO_extern_template_imp
 

Modified: 
incubator/stdcxx/trunk/etc/config/src/EXTERN_TEMPLATE_BEFORE_DEFINITION.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/EXTERN_TEMPLATE_BEFORE_DEFINITION.cpp?view=diff&rev=475243&r1=475242&r2=475243
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/EXTERN_TEMPLATE_BEFORE_DEFINITION.cpp 
(original)
+++ incubator/stdcxx/trunk/etc/config/src/EXTERN_TEMPLATE_BEFORE_DEFINITION.cpp 
Wed Nov 15 06:15:58 2006
@@ -7,7 +7,7 @@
 #ifndef _RWSTD_NO_extern_template_before_definition_imp
   // establish a dependency on the source file to get it
   // compiled first and  link with the object file
-  // LDOPTS = ./extern_template_before_definition_imp.o
+  // LDOPTS = extern_template_before_definition_imp.o
 #endif
 
 #ifdef _RWSTD_NO_IMPLICIT_INCLUSION

Modified: incubator/stdcxx/trunk/etc/config/src/IMPLICIT_INSTANTIATION.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/IMPLICIT_INSTANTIATION.cpp?view=diff&rev=475243&r1=475242&r2=475243
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/IMPLICIT_INSTANTIATION.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/IMPLICIT_INSTANTIATION.cpp Wed Nov 15 
06:15:58 2006
@@ -6,7 +6,7 @@
 
 #ifndef _RWSTD_NO_EXPLICIT_INSTANTIATION
     // establish a dependency
-    // LDOPTS = ./EXPLICIT_INSTANTIATION.o
+    // LDOPTS = EXPLICIT_INSTANTIATION.o
 #endif   // _RWSTD_NO_EXPLICIT_INSTANTIATION
 
 

Modified: incubator/stdcxx/trunk/etc/config/src/LIB_EXCEPTIONS.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/LIB_EXCEPTIONS.cpp?view=diff&rev=475243&r1=475242&r2=475243
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/LIB_EXCEPTIONS.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/LIB_EXCEPTIONS.cpp Wed Nov 15 
06:15:58 2006
@@ -8,7 +8,7 @@
 #  ifndef _RWSTD_NO_lib_exceptions.lib
 
      // link this compiled translation unit with the lib below
-     // LDOPTS = ./lib_exceptions.lib$(LIBSUFFIX)
+     // LDOPTS = lib_exceptions.lib$(LIBSUFFIX)
 
 #  endif   // _RWSTD_NO_lib_exceptions.lib
 #endif   // 0

Modified: incubator/stdcxx/trunk/etc/config/src/collapse_static_locals.lib.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/collapse_static_locals.lib.cpp?view=diff&rev=475243&r1=475242&r2=475243
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/collapse_static_locals.lib.cpp 
(original)
+++ incubator/stdcxx/trunk/etc/config/src/collapse_static_locals.lib.cpp Wed 
Nov 15 06:15:58 2006
@@ -8,6 +8,9 @@
 }
 
 // bar() returns foo()
+#if defined (_WIN32) && defined (_DLL)
+__declspec (dllexport)
+#endif  // _WIN32 && _DLL
 int bar ()
 {
     return foo ();

Modified: incubator/stdcxx/trunk/etc/config/src/collapse_template_locals.lib.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/collapse_template_locals.lib.cpp?view=diff&rev=475243&r1=475242&r2=475243
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/collapse_template_locals.lib.cpp 
(original)
+++ incubator/stdcxx/trunk/etc/config/src/collapse_template_locals.lib.cpp Wed 
Nov 15 06:15:58 2006
@@ -10,6 +10,9 @@
 
 
 // bar() returns foo()
+#if defined (_WIN32) && defined (_DLL)
+__declspec (dllexport)
+#endif  // _WIN32 && _DLL
 int bar ()
 {
     return foo (0);

Modified: 
incubator/stdcxx/trunk/etc/config/src/collapse_template_statics.lib.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/collapse_template_statics.lib.cpp?view=diff&rev=475243&r1=475242&r2=475243
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/collapse_template_statics.lib.cpp 
(original)
+++ incubator/stdcxx/trunk/etc/config/src/collapse_template_statics.lib.cpp Wed 
Nov 15 06:15:58 2006
@@ -11,6 +11,9 @@
 T S<T>::t;
 
 
+#if defined (_WIN32) && defined (_DLL)
+__declspec (dllexport)
+#endif  // _WIN32 && _DLL
 int bar ()
 {
     // S<int>::t instantiated and modified in COLLAPSE_TEMPLATE_STATICS.cpp

Modified: incubator/stdcxx/trunk/etc/config/src/extern_inline.lib.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/extern_inline.lib.cpp?view=diff&rev=475243&r1=475242&r2=475243
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/extern_inline.lib.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/extern_inline.lib.cpp Wed Nov 15 
06:15:58 2006
@@ -1,4 +1,7 @@
 
+#if defined (_WIN32) && defined (_DLL)
+__declspec (dllexport)
+#endif  // _WIN32 && _DLL
 extern inline int foo (int i)
 {
     return i + 1;

Modified: incubator/stdcxx/trunk/etc/config/src/lib_exceptions.lib.cpp
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/src/lib_exceptions.lib.cpp?view=diff&rev=475243&r1=475242&r2=475243
==============================================================================
--- incubator/stdcxx/trunk/etc/config/src/lib_exceptions.lib.cpp (original)
+++ incubator/stdcxx/trunk/etc/config/src/lib_exceptions.lib.cpp Wed Nov 15 
06:15:58 2006
@@ -1,6 +1,9 @@
 
 #include "config.h"
 
+#if defined (_WIN32) && defined (_DLL)
+__declspec (dllexport)
+#endif  // _WIN32 && _DLL
 int foo (int i)
 {
     if (i)

Modified: incubator/stdcxx/trunk/etc/config/windows/configure.wsf
URL: 
http://svn.apache.org/viewvc/incubator/stdcxx/trunk/etc/config/windows/configure.wsf?view=diff&rev=475243&r1=475242&r2=475243
==============================================================================
--- incubator/stdcxx/trunk/etc/config/windows/configure.wsf (original)
+++ incubator/stdcxx/trunk/etc/config/windows/configure.wsf Wed Nov 15 06:15:58 
2006
@@ -243,7 +243,7 @@
     checkHeaders();
 
     // compile .lib.cpp s
-    if (0 == compileLibs())
+    if (0 == compileLibs(confInfo.dll))
     {
         WScript.StdErr.WriteLine(
             "You may see log here: " + logFileNameURI);
@@ -711,7 +711,7 @@
 }
 
 //compiles all libraries (.lib.cpp files)
-function compileLibs()
+function compileLibs(shared)
 {
     var folder = fso.GetFolder(srcDir);
     var fc = new Enumerator(folder.Files);
@@ -723,7 +723,7 @@
              continue; //not a library file
         }
         var outLibName = file.Name.replace(/\.cpp/i, ".lib");
-        if (makeLibrary(srcDir + "\\" + file.Name, outLibName) != 0)
+        if (makeLibrary(srcDir + "\\" + file.Name, outLibName, shared) != 0)
         {
             WScript.StdErr.WriteLine(
                 "Configure: Fatal error: Failed to build library " 
@@ -826,10 +826,10 @@
                     (/^[^A-Z_a-z0-9]*LDOPTS\s*=\s*(\S*)\s*$/m).exec(srcText);
                 if (ldopts != null)
                 {
-                    // remove first "./" and replace $(LIBSUFFIX) with .lib
-                    // and replace .o with .obj
-                    modules += " " + ldopts[1].replace(/^\.\//, stageDir + 
"\\").
-                        replace(/\$\(LIBSUFFIX\)/, ".lib").replace(/\.o/, 
".obj");
+                    // replace $(LIBSUFFIX) with .lib and replace .o with .obj
+                    modules += " " + stageDir + "\\" +
+                        ldopts[1].replace(/\$\(LIBSUFFIX\)/, ".lib").
+                                  replace(/\.o/, ".obj");
                 }
                 var exeFile = base + ".exe";
                 var fullExeName = fileBase + ".exe";
@@ -1028,7 +1028,7 @@
 // performs compilation of the source files to the library file
 // src - string with source file names delimited by space
 // outFile - filename of the library file
-function makeLibrary(srcFiles, outFile)
+function makeLibrary(srcFiles, outFile, shared)
 {
     var ret = compileFiles(srcFiles);
     if (ret != 0)
@@ -1036,13 +1036,31 @@
 
     var objNames = srcFiles.replace(/(?:[\S]+[/\\\\])?([^/\\\\]+\.)cpp/gi, 
         stageDir + "/$1obj");
-        
-    var command = AR + "/OUT:\"" + stageDir + "\\" + outFile + "\"" +
-                    joinArray(objNames.split(" "), "");
-    var message = "Making library with command \"" + command + "\"";
-    logLine(message);
-    return WshShell.Run("cmd /c \"" + command +"\" >> " 
-        + logFileName + " 2>&1", runWindowMode, true);
+
+    if (shared)
+    {
+        var libname = "\"" + stageDir + "\\" + outFile + "\"";
+        var dllname = "\"" + stageDir + "\\" + basename(outFile, "\\.lib") + 
".dll\"";
+        var command = LD + " ";
+        command += joinArray(objNames.split(" "), "");
+        command += " /Fe" + dllname + " /link /DLL " + LDFLAGS +
+                   " /IMPLIB:" + libname;
+        var message = "Making library with command \"" + command + "\"";
+        logLine(message);
+        ret = WshShell.Run("cmd /c \"" + command +"\" >> " 
+            + logFileName + " 2>&1", runWindowMode, true);
+    }
+    else
+    {
+        var command = AR + " /OUT:\"" + stageDir + "\\" + outFile + "\"" +
+                      joinArray(objNames.split(" "), "");
+        var message = "Making library with command \"" + command + "\"";
+        logLine(message);
+        ret = WshShell.Run("cmd /c \"" + command +"\" >> " 
+            + logFileName + " 2>&1", runWindowMode, true);
+    }
+    
+    return ret;
 }
 
 // append line to the log file


Reply via email to