better way to do dll (helptools module)
Allan CORNET [Fri, 28 Aug 2009 12:57:06 +0000 (14:57 +0200)]
scilab/modules/helptools/Makefile.am
scilab/modules/helptools/includes/dynlib_helptools.h [new file with mode: 0644]
scilab/modules/helptools/includes/gw_helptools.h
scilab/modules/helptools/src/c/helptools.vcproj
scilab/modules/helptools/src/c/helptools_header.def [deleted file]

index e321839..b574897 100644 (file)
@@ -69,7 +69,8 @@ libscihelptools_la_etc_DATA = etc/helptools.quit etc/helptools.start
 
 #### helptools : include files ####
 libscihelptools_la_includedir=$(pkgincludedir)/helptools
-libscihelptools_la_include_HEADERS = includes/gw_helptools.h
+libscihelptools_la_include_HEADERS = includes/gw_helptools.h \
+       includes/dynlib.h
 
 
 #### helptools : bin files ####
diff --git a/scilab/modules/helptools/includes/dynlib_helptools.h b/scilab/modules/helptools/includes/dynlib_helptools.h
new file mode 100644 (file)
index 0000000..dec3989
--- /dev/null
@@ -0,0 +1,28 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) DIGITEO - 2009 - Allan CORNET
+* 
+* 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
+*
+*/
+
+/*--------------------------------------------------------------------------*/ 
+#ifndef __DYNLIB_HELPTOOLS_H__
+#define __DYNLIB_HELPTOOLS_H__
+
+#ifdef _MSC_VER
+#ifdef HELPTOOLS_EXPORTS
+#define HELPTOOLS_IMPEXP __declspec(dllexport)
+#else
+#define HELPTOOLS_IMPEXP __declspec(dllimport)
+#endif
+#else
+#define HELPTOOLS_IMPEXP
+#endif
+
+#endif /* __DYNLIB_HELPTOOLS_H__ */
+/*--------------------------------------------------------------------------*/ 
index 9e62c64..6b57776 100644 (file)
 #ifndef __GW_HELPTOOLS__
 #define __GW_HELPTOOLS__
 /*--------------------------------------------------------------------------*/ 
-#include "machine.h"
+#include "dynlib_helptools.h"
 /*--------------------------------------------------------------------------*/ 
-int gw_helptools(void);
+HELPTOOLS_IMPEXP int gw_helptools(void);
 /*--------------------------------------------------------------------------*/ 
-int sci_buildDoc(char *fname,unsigned long fname_len);
+HELPTOOLS_IMPEXP int sci_buildDoc(char *fname,unsigned long fname_len);
 /*--------------------------------------------------------------------------*/ 
 #endif /*  __GW_HELPTOOLS__ */
 /*--------------------------------------------------------------------------*/
index a124b99..7af06c2 100644 (file)
                        <Tool
                                Name="VCPreLinkEventTool"
                                Description="Make dependencies"
-                               CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;cd $(IntDir) &gt;nul&#x0D;&#x0A;for %%f in (*.obj) do  ..\..\..\..\..\bin\dumpexts -o %%~nf.def -n helptools.dll %%f &gt;NUL&#x0D;&#x0A;copy *.def helptoolstmp.def  &gt;NUL&#x0D;&#x0A;copy ..\helptools_header.def+helptoolstmp.def  ..\helptools.def &gt;NUL&#x0D;&#x0A;del *.def  &gt;NUL&#x0D;&#x0A;cd ..  &gt;NUL&#x0D;&#x0A;"
+                               CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
                                AdditionalDependencies="libscilab.lib"
                                OutputFile="$(SolutionDir)/bin/$(ProjectName).dll"
                                LinkIncremental="1"
-                               ModuleDefinitionFile="helptools.def"
+                               ModuleDefinitionFile=""
                                GenerateDebugInformation="true"
                                SubSystem="2"
                                RandomizedBaseAddress="1"
                        <Tool
                                Name="VCPreLinkEventTool"
                                Description="Make dependencies"
-                               CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;cd $(IntDir) &gt;nul&#x0D;&#x0A;for %%f in (*.obj) do  ..\..\..\..\..\bin\dumpexts -o %%~nf.def -n helptools.dll %%f &gt;NUL&#x0D;&#x0A;copy *.def helptoolstmp.def  &gt;NUL&#x0D;&#x0A;copy ..\helptools_header.def+helptoolstmp.def  ..\helptools.def &gt;NUL&#x0D;&#x0A;del *.def  &gt;NUL&#x0D;&#x0A;cd ..  &gt;NUL&#x0D;&#x0A;"
+                               CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
                                AdditionalDependencies="libscilab.lib"
                                OutputFile="$(SolutionDir)/bin/$(ProjectName).dll"
                                LinkIncremental="1"
-                               ModuleDefinitionFile="helptools.def"
+                               ModuleDefinitionFile=""
                                GenerateDebugInformation="true"
                                SubSystem="2"
                                RandomizedBaseAddress="1"
                        <Tool
                                Name="VCPreLinkEventTool"
                                Description="Make dependencies"
-                               CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;cd $(IntDir) &gt;nul&#x0D;&#x0A;for %%f in (*.obj) do  ..\..\..\..\..\bin\dumpexts -o %%~nf.def -n helptools.dll %%f &gt;NUL&#x0D;&#x0A;copy *.def helptoolstmp.def  &gt;NUL&#x0D;&#x0A;copy ..\helptools_header.def+helptoolstmp.def  ..\helptools.def &gt;NUL&#x0D;&#x0A;del *.def  &gt;NUL&#x0D;&#x0A;cd ..  &gt;NUL&#x0D;&#x0A;"
+                               CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
                                AdditionalDependencies="libscilab.lib"
                                OutputFile="$(SolutionDir)/bin/$(ProjectName).dll"
                                LinkIncremental="1"
-                               ModuleDefinitionFile="helptools.def"
+                               ModuleDefinitionFile=""
                                GenerateDebugInformation="false"
                                SubSystem="2"
                                OptimizeReferences="2"
                        <Tool
                                Name="VCPreLinkEventTool"
                                Description="Make dependencies"
-                               CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;cd $(IntDir) &gt;nul&#x0D;&#x0A;for %%f in (*.obj) do  ..\..\..\..\..\bin\dumpexts -o %%~nf.def -n helptools.dll %%f &gt;NUL&#x0D;&#x0A;copy *.def helptoolstmp.def  &gt;NUL&#x0D;&#x0A;copy ..\helptools_header.def+helptoolstmp.def  ..\helptools.def &gt;NUL&#x0D;&#x0A;del *.def  &gt;NUL&#x0D;&#x0A;cd ..  &gt;NUL&#x0D;&#x0A;"
+                               CommandLine="lib /DEF:&quot;$(InputDir)LibScilab_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X64 /OUT:&quot;$(InputDir)LibScilab.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;"
                        />
                        <Tool
                                Name="VCLinkerTool"
                                AdditionalDependencies="libscilab.lib"
                                OutputFile="$(SolutionDir)/bin/$(ProjectName).dll"
                                LinkIncremental="1"
-                               ModuleDefinitionFile="helptools.def"
+                               ModuleDefinitionFile=""
                                GenerateDebugInformation="false"
                                SubSystem="2"
                                OptimizeReferences="2"
                                >
                        </File>
                        <File
+                               RelativePath="..\..\includes\dynlib_helptools.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\jni\GiwsException.hxx"
                                >
                        </File>
                        <File
+                               RelativePath="..\..\includes\gw_helptools.h"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\resource.h"
                                >
                        </File>
                <Filter
                        Name="Libraries Dependencies"
                        >
-                       <File
-                               RelativePath=".\helptools_header.def"
-                               >
-                       </File>
                        <Filter
                                Name="Imports"
                                >
diff --git a/scilab/modules/helptools/src/c/helptools_header.def b/scilab/modules/helptools/src/c/helptools_header.def
deleted file mode 100644 (file)
index 32ae78c..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-LIBRARY    helptools.dll
-
-
-EXPORTS
-