coverage must be link staticly to scilab 10/17410/2
Antoine ELIAS [Thu, 29 Oct 2015 12:58:45 +0000 (13:58 +0100)]
Change-Id: I1db1bbf911384313b0aae4f8d2098d6375bb0f45

scilab/modules/coverage/Makefile.am
scilab/modules/coverage/Makefile.in
scilab/modules/coverage/coverage.vcxproj
scilab/modules/coverage/coverage.vcxproj.filters
scilab/modules/coverage/includes/coverage_gw.hxx
scilab/modules/coverage/sci_gateway/coverage_gateway.xml [deleted file]
scilab/modules/coverage/sci_gateway/cpp/coverage_gw.cpp [new file with mode: 0644]
scilab/modules/functions_manager/functions_manager.vcxproj
scilab/modules/functions_manager/includes/dynamic_modules.hxx
scilab/modules/functions_manager/src/cpp/dynamic_modules.cpp

index 427de79..78b7ebc 100644 (file)
@@ -36,7 +36,8 @@ GATEWAY_CXX_SOURCES = \
     sci_gateway/cpp/sci_covStart.cpp \
     sci_gateway/cpp/sci_covWrite.cpp \
     sci_gateway/cpp/sci_covStop.cpp \
-    sci_gateway/cpp/sci_covMerge.cpp
+    sci_gateway/cpp/sci_covMerge.cpp \
+    sci_gateway/cpp/coverage_gw.cpp
 
 libscicoverage_la_CPPFLAGS = \
     -I$(srcdir)/includes/ \
@@ -82,4 +83,4 @@ libscicoverage_la_includedir=$(pkgincludedir)
 
 #### coverage : gateway declaration ####
 libscicoverage_la_sci_gatewaydir = $(mydatadir)/sci_gateway
-libscicoverage_la_sci_gateway_DATA = sci_gateway/coverage_gateway.xml
+libscicoverage_la_sci_gateway_DATA =
index 8ac1fc1..62186e4 100644 (file)
@@ -186,7 +186,8 @@ libscicoverage_la_DEPENDENCIES = libscicoverage-algo.la \
 am__objects_2 = sci_gateway/cpp/libscicoverage_la-sci_covStart.lo \
        sci_gateway/cpp/libscicoverage_la-sci_covWrite.lo \
        sci_gateway/cpp/libscicoverage_la-sci_covStop.lo \
-       sci_gateway/cpp/libscicoverage_la-sci_covMerge.lo
+       sci_gateway/cpp/libscicoverage_la-sci_covMerge.lo \
+       sci_gateway/cpp/libscicoverage_la-coverage_gw.lo
 am_libscicoverage_la_OBJECTS = $(am__objects_2)
 libscicoverage_la_OBJECTS = $(am_libscicoverage_la_OBJECTS)
 libscicoverage_la_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CXX \
@@ -645,7 +646,8 @@ GATEWAY_CXX_SOURCES = \
     sci_gateway/cpp/sci_covStart.cpp \
     sci_gateway/cpp/sci_covWrite.cpp \
     sci_gateway/cpp/sci_covStop.cpp \
-    sci_gateway/cpp/sci_covMerge.cpp
+    sci_gateway/cpp/sci_covMerge.cpp \
+    sci_gateway/cpp/coverage_gw.cpp
 
 libscicoverage_la_CPPFLAGS = \
     -I$(srcdir)/includes/ \
@@ -689,7 +691,7 @@ libscicoverage_la_includedir = $(pkgincludedir)
 
 #### coverage : gateway declaration ####
 libscicoverage_la_sci_gatewaydir = $(mydatadir)/sci_gateway
-libscicoverage_la_sci_gateway_DATA = sci_gateway/coverage_gateway.xml
+libscicoverage_la_sci_gateway_DATA = 
 all: all-am
 
 .SUFFIXES:
@@ -813,6 +815,9 @@ sci_gateway/cpp/libscicoverage_la-sci_covStop.lo:  \
 sci_gateway/cpp/libscicoverage_la-sci_covMerge.lo:  \
        sci_gateway/cpp/$(am__dirstamp) \
        sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
+sci_gateway/cpp/libscicoverage_la-coverage_gw.lo:  \
+       sci_gateway/cpp/$(am__dirstamp) \
+       sci_gateway/cpp/$(DEPDIR)/$(am__dirstamp)
 
 libscicoverage.la: $(libscicoverage_la_OBJECTS) $(libscicoverage_la_DEPENDENCIES) $(EXTRA_libscicoverage_la_DEPENDENCIES) 
        $(AM_V_CXXLD)$(libscicoverage_la_LINK) -rpath $(pkglibdir) $(libscicoverage_la_OBJECTS) $(libscicoverage_la_LIBADD) $(LIBS)
@@ -827,6 +832,7 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
+@AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicoverage_la-coverage_gw.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicoverage_la-sci_covMerge.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicoverage_la-sci_covStart.Plo@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@sci_gateway/cpp/$(DEPDIR)/libscicoverage_la-sci_covStop.Plo@am__quote@
@@ -948,6 +954,13 @@ sci_gateway/cpp/libscicoverage_la-sci_covMerge.lo: sci_gateway/cpp/sci_covMerge.
 @AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
 @am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicoverage_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libscicoverage_la-sci_covMerge.lo `test -f 'sci_gateway/cpp/sci_covMerge.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/sci_covMerge.cpp
 
+sci_gateway/cpp/libscicoverage_la-coverage_gw.lo: sci_gateway/cpp/coverage_gw.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_CXX)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicoverage_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -MT sci_gateway/cpp/libscicoverage_la-coverage_gw.lo -MD -MP -MF sci_gateway/cpp/$(DEPDIR)/libscicoverage_la-coverage_gw.Tpo -c -o sci_gateway/cpp/libscicoverage_la-coverage_gw.lo `test -f 'sci_gateway/cpp/coverage_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/coverage_gw.cpp
+@am__fastdepCXX_TRUE@  $(AM_V_at)$(am__mv) sci_gateway/cpp/$(DEPDIR)/libscicoverage_la-coverage_gw.Tpo sci_gateway/cpp/$(DEPDIR)/libscicoverage_la-coverage_gw.Plo
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     $(AM_V_CXX)source='sci_gateway/cpp/coverage_gw.cpp' object='sci_gateway/cpp/libscicoverage_la-coverage_gw.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCXX_FALSE@ $(AM_V_CXX@am__nodep@)$(LIBTOOL) $(AM_V_lt) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicoverage_la_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS) -c -o sci_gateway/cpp/libscicoverage_la-coverage_gw.lo `test -f 'sci_gateway/cpp/coverage_gw.cpp' || echo '$(srcdir)/'`sci_gateway/cpp/coverage_gw.cpp
+
 mostlyclean-libtool:
        -rm -f *.lo
 
index a59d27e..379960a 100644 (file)
     </PreBuildEvent>
   </ItemDefinitionGroup>
   <ItemGroup>
+    <ClCompile Include="sci_gateway\cpp\coverage_gw.cpp" />
     <ClCompile Include="sci_gateway\cpp\sci_covMerge.cpp" />
     <ClCompile Include="sci_gateway\cpp\sci_covStart.cpp" />
     <ClCompile Include="sci_gateway\cpp\sci_covStop.cpp" />
index f4e0790..2b6fd87 100644 (file)
@@ -61,6 +61,9 @@
     <ClCompile Include="src\c\DllmainCoverage.c">
       <Filter>Source Files</Filter>
     </ClCompile>
+    <ClCompile Include="sci_gateway\cpp\coverage_gw.cpp">
+      <Filter>Source Files</Filter>
+    </ClCompile>
   </ItemGroup>
   <ItemGroup>
     <ClInclude Include="includes\CodePrinter.hxx">
index 637093c..adcd83d 100644 (file)
 
 #include "dynlib_coverage.h"
 
+class CoverageModule
+{
+private:
+    CoverageModule() {};
+    ~CoverageModule() {};
+
+public:
+    COVERAGE_IMPEXP static int Load();
+    COVERAGE_IMPEXP static int Unload()
+    {
+        return 1;
+    }
+};
+
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_covStart, COVERAGE_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_covWrite, COVERAGE_IMPEXP);
 CPP_GATEWAY_PROTOTYPE_EXPORT(sci_covStop, COVERAGE_IMPEXP);
diff --git a/scilab/modules/coverage/sci_gateway/coverage_gateway.xml b/scilab/modules/coverage/sci_gateway/coverage_gateway.xml
deleted file mode 100644 (file)
index a279425..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE module SYSTEM "../../functions/xml/gateway.dtd">
-<!--
-/*
- *  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
- *  Copyright (C) 2011 - DIGITEO - Antoine ELIAS
- *
- * This file must be used under the terms of the CeCILL.
- * This source file is licensed as described in the file COPYING, which
- * you should have received as part of this distribution.  The terms
- * are also available at
- * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
- *
- */
- Scilab
- Interface description. In this file, we define the list of the function which
- will be available into Scilab and the link to the "native" function.
-
- Don't touch if you do not know what you are doing
--->
-<module name="coverage">
-    <gateway name="sci_covStart"            function="covStart"             type="1" />
-    <gateway name="sci_covWrite"            function="covWrite"             type="1" />
-    <gateway name="sci_covStop"             function="covStop"              type="1" />
-    <gateway name="sci_covMerge"            function="covMerge"             type="1" />
-</module>
diff --git a/scilab/modules/coverage/sci_gateway/cpp/coverage_gw.cpp b/scilab/modules/coverage/sci_gateway/cpp/coverage_gw.cpp
new file mode 100644 (file)
index 0000000..446bcb2
--- /dev/null
@@ -0,0 +1,26 @@
+/*
+*  Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+*  Copyright (C) 2015 - Scilab Enterprises - Antoine ELIAS
+*
+*  This file must be used under the terms of the CeCILL.
+*  This source file is licensed as described in the file COPYING, which
+*  you should have received as part of this distribution.  The terms
+*  are also available at
+*  http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+*
+*/
+
+#include "coverage_gw.hxx"
+#include "function.hxx"
+#include "context.hxx"
+
+#define MODULE_NAME L"coverage"
+
+int CoverageModule::Load()
+{
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"covStart", &sci_covStart, NULL, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"covWrite", &sci_covWrite, NULL, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"covStop", &sci_covStop, NULL, MODULE_NAME));
+    symbol::Context::getInstance()->addFunction(types::Function::createFunction(L"covMerge", &sci_covMerge, NULL, MODULE_NAME));
+    return 1;
+}
index 19a9f68..767255a 100644 (file)
     <ProjectReference Include="..\core\sci_gateway\cpp\core_gw.vcxproj">
       <Project>{3e933eb6-d427-4828-9b30-b6b9987491f6}</Project>
     </ProjectReference>
+    <ProjectReference Include="..\coverage\coverage.vcxproj">
+      <Project>{b150e4a2-2ec1-4be0-b416-95cfeb13e2ff}</Project>
+    </ProjectReference>
     <ProjectReference Include="..\data_structures\src\c\data_structures.vcxproj">
       <Project>{b7a168a0-dfc0-4c6d-b0cc-6079912a4a76}</Project>
     </ProjectReference>
index 7072fcd..0581fc1 100644 (file)
@@ -206,10 +206,4 @@ public :
     static int Load();
 };
 
-class CoverageModule : public GenericModule
-{
-public :
-    static int Load();
-};
-
 #endif /* !__DYNAMIC_MODULES_HXX_ */
index f3821b5..69d11bc 100644 (file)
@@ -651,22 +651,3 @@ int SlintModule::Load()
     FREE(pwstLibName);
     return 1;
 }
-
-int CoverageModule::Load()
-{
-    std::wstring wstModuleName = L"coverage";
-#ifdef _MSC_VER
-    wchar_t* pwstLibName = buildModuleDynLibraryNameW(wstModuleName.c_str(), DYNLIB_NAME_FORMAT_1);
-#else
-    wchar_t* pwstLibName = buildModuleDynLibraryNameW(wstModuleName.c_str(), DYNLIB_NAME_FORMAT_3);
-#endif
-    vectGateway vect = loadGatewaysName(wstModuleName);
-
-    for (int i = 0 ; i < (int)vect.size() ; i++)
-    {
-        symbol::Context::getInstance()->addFunction(types::Function::createFunction(vect[i].wstFunction, vect[i].wstName, pwstLibName, vect[i].iType, NULL, wstModuleName));
-    }
-
-    FREE(pwstLibName);
-    return 1;
-}