add module dynamic_link (not finish and not enabled on linux & windows)
Allan Cornet [Thu, 24 Jan 2008 15:52:46 +0000 (15:52 +0000)]
108 files changed:
scilab/modules/dynamic_link/Makefile.am [new file with mode: 0644]
scilab/modules/dynamic_link/changelog.txt [new file with mode: 0644]
scilab/modules/dynamic_link/dynamic_link.iss [new file with mode: 0644]
scilab/modules/dynamic_link/etc/dynamic_link.quit [new file with mode: 0644]
scilab/modules/dynamic_link/etc/dynamic_link.start [new file with mode: 0644]
scilab/modules/dynamic_link/help/en_US/G_make.xml [new file with mode: 0644]
scilab/modules/dynamic_link/help/en_US/VCtoLCCLib.xml [new file with mode: 0644]
scilab/modules/dynamic_link/help/en_US/addchapter.sce [new file with mode: 0644]
scilab/modules/dynamic_link/help/en_US/addinter.xml [new file with mode: 0644]
scilab/modules/dynamic_link/help/en_US/chooselcccompiler.xml [new file with mode: 0644]
scilab/modules/dynamic_link/help/en_US/configure_lcc.xml [new file with mode: 0644]
scilab/modules/dynamic_link/help/en_US/configure_msvc.xml [new file with mode: 0644]
scilab/modules/dynamic_link/help/en_US/findlcccompiler.xml [new file with mode: 0644]
scilab/modules/dynamic_link/help/en_US/findmsvccompiler.xml [new file with mode: 0644]
scilab/modules/dynamic_link/help/en_US/ilib_build.xml [new file with mode: 0644]
scilab/modules/dynamic_link/help/en_US/ilib_compile.xml [new file with mode: 0644]
scilab/modules/dynamic_link/help/en_US/ilib_for_link.xml [new file with mode: 0644]
scilab/modules/dynamic_link/help/en_US/ilib_gen_Make.xml [new file with mode: 0644]
scilab/modules/dynamic_link/help/en_US/ilib_gen_gateway.xml [new file with mode: 0644]
scilab/modules/dynamic_link/help/en_US/ilib_gen_loader.xml [new file with mode: 0644]
scilab/modules/dynamic_link/help/en_US/link.xml [new file with mode: 0644]
scilab/modules/dynamic_link/help/en_US/with_lcc.xml [new file with mode: 0644]
scilab/modules/dynamic_link/includes/AddFunctionInTable.h [new file with mode: 0644]
scilab/modules/dynamic_link/includes/addinter.h [new file with mode: 0644]
scilab/modules/dynamic_link/includes/gw_dynamic_link.h [new file with mode: 0644]
scilab/modules/dynamic_link/licence.txt [new file with mode: 0644]
scilab/modules/dynamic_link/locales/en_US/dynamic_link.pot [new file with mode: 0644]
scilab/modules/dynamic_link/locales/fr_FR/incremental_link.po [new file with mode: 0644]
scilab/modules/dynamic_link/macros/G_make.sci [new file with mode: 0644]
scilab/modules/dynamic_link/macros/VCtoLCCLib.sci [new file with mode: 0644]
scilab/modules/dynamic_link/macros/buildmacros.bat [new file with mode: 0644]
scilab/modules/dynamic_link/macros/buildmacros.sce [new file with mode: 0644]
scilab/modules/dynamic_link/macros/chooselcccompiler.sci [new file with mode: 0644]
scilab/modules/dynamic_link/macros/cleanmacros.bat [new file with mode: 0644]
scilab/modules/dynamic_link/macros/configure_lcc.sci [new file with mode: 0644]
scilab/modules/dynamic_link/macros/configure_msvc.sci [new file with mode: 0644]
scilab/modules/dynamic_link/macros/findlcccompiler.sci [new file with mode: 0644]
scilab/modules/dynamic_link/macros/findmsvccompiler.sci [new file with mode: 0644]
scilab/modules/dynamic_link/macros/haveacompiler.sci [new file with mode: 0644]
scilab/modules/dynamic_link/macros/ilib_build.sci [new file with mode: 0644]
scilab/modules/dynamic_link/macros/ilib_compile.sci [new file with mode: 0644]
scilab/modules/dynamic_link/macros/ilib_for_link.sci [new file with mode: 0644]
scilab/modules/dynamic_link/macros/ilib_gen_Make.sci [new file with mode: 0644]
scilab/modules/dynamic_link/macros/ilib_gen_gateway.sci [new file with mode: 0644]
scilab/modules/dynamic_link/macros/ilib_gen_loader.sci [new file with mode: 0644]
scilab/modules/dynamic_link/macros/ilib_mex_build.sci [new file with mode: 0644]
scilab/modules/dynamic_link/macros/ilib_unix_soname.sci [new file with mode: 0644]
scilab/modules/dynamic_link/macros/with_lcc.sci [new file with mode: 0644]
scilab/modules/dynamic_link/readme.txt [new file with mode: 0644]
scilab/modules/dynamic_link/sci_gateway/c/gw_dynamic_link.c [new file with mode: 0644]
scilab/modules/dynamic_link/sci_gateway/c/sci_addinter.c [new file with mode: 0644]
scilab/modules/dynamic_link/sci_gateway/c/sci_c_link.c [new file with mode: 0644]
scilab/modules/dynamic_link/sci_gateway/c/sci_call.c [new file with mode: 0644]
scilab/modules/dynamic_link/sci_gateway/c/sci_getdynlibext.c [new file with mode: 0644]
scilab/modules/dynamic_link/sci_gateway/c/sci_link.c [new file with mode: 0644]
scilab/modules/dynamic_link/sci_gateway/c/sci_ulink.c [new file with mode: 0644]
scilab/modules/dynamic_link/sci_gateway/dynamic_link_gateway.xml [new file with mode: 0644]
scilab/modules/dynamic_link/sci_gateway/fortran/sci_c_link.f [new file with mode: 0644]
scilab/modules/dynamic_link/sci_gateway/fortran/sci_fort.f [new file with mode: 0644]
scilab/modules/dynamic_link/src/c/AddFunctionInTable.c [new file with mode: 0644]
scilab/modules/dynamic_link/src/c/DllmainIncremental_link.c [new file with mode: 0644]
scilab/modules/dynamic_link/src/c/LibScilab_Import.def [new file with mode: 0644]
scilab/modules/dynamic_link/src/c/addinter.c [new file with mode: 0644]
scilab/modules/dynamic_link/src/c/dynamic_link.c [new file with mode: 0644]
scilab/modules/dynamic_link/src/c/dynamic_link.h [new file with mode: 0644]
scilab/modules/dynamic_link/src/c/dynamic_link.vcproj [new file with mode: 0644]
scilab/modules/dynamic_link/src/c/dynamic_link_f_Import.def [new file with mode: 0644]
scilab/modules/dynamic_link/src/c/dynamic_link_header.def [new file with mode: 0644]
scilab/modules/dynamic_link/src/fortran/LibScilab_Import.def [new file with mode: 0644]
scilab/modules/dynamic_link/src/fortran/dynamic_link_f.vfproj [new file with mode: 0644]
scilab/modules/dynamic_link/src/fortran/dynamic_link_f2c.vcproj [new file with mode: 0644]
scilab/modules/dynamic_link/src/fortran/dynamic_link_f_header.def [new file with mode: 0644]
scilab/modules/dynamic_link/src/fortran/output_stream_Import.def [new file with mode: 0644]
scilab/modules/dynamic_link/src/fortran/string_Import.def [new file with mode: 0644]
scilab/modules/dynamic_link/src/scripts/Makedll.incl [new file with mode: 0644]
scilab/modules/dynamic_link/src/scripts/Makefile.am [new file with mode: 0644]
scilab/modules/dynamic_link/src/scripts/Makefile.in [new file with mode: 0644]
scilab/modules/dynamic_link/src/scripts/aclocal.m4 [new file with mode: 0644]
scilab/modules/dynamic_link/src/scripts/compilerDetection.sh [new file with mode: 0644]
scilab/modules/dynamic_link/src/scripts/config.guess [new file with mode: 0644]
scilab/modules/dynamic_link/src/scripts/config.sub [new file with mode: 0644]
scilab/modules/dynamic_link/src/scripts/configure [new file with mode: 0644]
scilab/modules/dynamic_link/src/scripts/configure.ac [new file with mode: 0644]
scilab/modules/dynamic_link/src/scripts/depcomp [new file with mode: 0644]
scilab/modules/dynamic_link/src/scripts/install-sh [new file with mode: 0644]
scilab/modules/dynamic_link/src/scripts/libtool [new file with mode: 0644]
scilab/modules/dynamic_link/src/scripts/ltmain.sh [new file with mode: 0644]
scilab/modules/dynamic_link/src/scripts/missing [new file with mode: 0644]
scilab/modules/dynamic_link/src/scripts/scicompile.sh [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/addinter.c [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/addinter.dia.ref [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/addinter.tst [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/call.dia.ref [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/call.tst [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/externals.f [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/ilib_build.dia.ref [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/ilib_build.tst [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/ilib_for_link.dia.ref [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/ilib_for_link.tst [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/link.dia.ref [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/link.tst [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/links.dia.ref [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/links.tst [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/optim_external.dia.ref [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/optim_external.tst [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/schur_external.dia.ref [new file with mode: 0644]
scilab/modules/dynamic_link/tests/unit_tests/schur_external.tst [new file with mode: 0644]
scilab/modules/dynamic_link/version.xml [new file with mode: 0644]

diff --git a/scilab/modules/dynamic_link/Makefile.am b/scilab/modules/dynamic_link/Makefile.am
new file mode 100644 (file)
index 0000000..564c9ab
--- /dev/null
@@ -0,0 +1,64 @@
+##########\r
+### Sylvestre Ledru <sylvestre.ledru@inria.fr>\r
+### INRIA - Scilab 2006 \r
+##########\r
+\r
+DYNAMIC_LINK_C_SOURCES = src/c/addinter.c \\r
+src/c/dynamic_link.c \\r
+src/c/AddFunctionInTable.c\r
+\r
+GATEWAY_C_SOURCES = sci_gateway/c/gw_dynamic_link.c \\r
+sci_gateway/c/sci_getdynlibext.c \\r
+sci_gateway/c/sci_addinter.c \\r
+sci_gateway/c/sci_call.c \\r
+sci_gateway/c/sci_link.c \\r
+sci_gateway/c/sci_ulink.c \\r
+sci_gateway/c/sci_c_link.c\r
+\r
+GATEWAY_FORTRAN_SOURCES = sci_gateway/fortran/sci_fort.f \r
+\r
+libscidynamic_link_la_CFLAGS = \\r
+-I$(top_srcdir)/modules/output_stream/includes \\r
+-I$(top_srcdir)/libs/dynamiclibrary/includes \\r
+-Isrc/c/ \\r
+-Iincludes/\r
+\r
+pkglib_LTLIBRARIES = libscidynamic_link.la\r
+libscidynamic_link_la_SOURCES = $(DYNAMIC_LINK_C_SOURCES) $(GATEWAY_C_SOURCES) $(GATEWAY_FORTRAN_SOURCES)\r
+\r
+libscidynamic_link_la_LIBADD = $(top_builddir)/libs/dynamiclibrary/libscidynamiclibrary.la\r
+\r
+#### Target ######\r
+modulename=dynamic_link\r
+\r
+\r
+#### dynamic_link : Conf files ####\r
+libscidynamic_link_la_rootdir = $(mydatadir)\r
+libscidynamic_link_la_root_DATA = changelog.txt licence.txt readme.txt version.xml\r
+\r
+#### dynamic_link : init scripts #### \r
+libscidynamic_link_la_etcdir = $(mydatadir)/etc\r
+libscidynamic_link_la_etc_DATA = etc/dynamic_link.quit etc/dynamic_link.start\r
+\r
+#### dynamic_link : gateway declaration ####\r
+libscidynamic_link_la_sci_gatewaydir = $(mydatadir)/sci_gateway\r
+libscidynamic_link_la_sci_gateway_DATA = sci_gateway/dynamic_link_gateway.xml\r
+\r
+\r
+#### dynamic_link : compilation scripts #### \r
+libscidynamic_link_la_scriptdir = $(mydatadir)/src/scripts/\r
+libscidynamic_link_la_script_DATA = src/scripts/Makefile.in \\r
+src/scripts/configure.ac \\r
+src/scripts/ltmain.sh \\r
+src/scripts/Makefile.am \\r
+src/scripts/aclocal.m4\r
+\r
+libscidynamic_link_la_script_SCRIPTS = src/scripts/compilerDetection.sh \\r
+src/scripts/config.guess \\r
+src/scripts/config.sub \\r
+src/scripts/configure \\r
+src/scripts/depcomp \\r
+src/scripts/install-sh \\r
+src/scripts/missing \\r
+src/scripts/scicompile.sh\r
+include $(top_srcdir)/Makefile.incl.am\r
diff --git a/scilab/modules/dynamic_link/changelog.txt b/scilab/modules/dynamic_link/changelog.txt
new file mode 100644 (file)
index 0000000..08894ca
--- /dev/null
@@ -0,0 +1 @@
+changelog dynamic_link module
\ No newline at end of file
diff --git a/scilab/modules/dynamic_link/dynamic_link.iss b/scilab/modules/dynamic_link/dynamic_link.iss
new file mode 100644 (file)
index 0000000..a909379
--- /dev/null
@@ -0,0 +1,51 @@
+;##############################################################################################################\r
+; Script d'installation Inno Setup (5.2.1) pour scilab\r
+; Allan CORNET\r
+; Version TRUNK\r
+; Copyright INRIA 2007\r
+;##############################################################################################################\r
+;--------------------------------------------------------------------------------------------------------------\r
+; dynamic_link module\r
+;--------------------------------------------------------------------------------------------------------------\r
+;\r
+#define DYNAMIC_LINK "dynamic_link"\r
+;\r
+Source: bin\{#DYNAMIC_LINK}.dll; DestDir: {app}\bin; Components: {#COMPN_SCILAB}\r
+Source: bin\{#DYNAMIC_LINK}.lib; DestDir: {app}\bin; Components: {#COMPN_SCILAB}\r
+Source: bin\dynamic_link_f.dll; DestDir: {app}\bin; Components: {#COMPN_SCILAB}\r
+Source: bin\dynamic_link_f.lib; DestDir: {app}\bin; Components: {#COMPN_SCILAB}\r
+\r
+;\r
+Source: modules\{#DYNAMIC_LINK}\VERSION.xml; DestDir: {app}\modules\{#DYNAMIC_LINK}; Components: {#COMPN_SCILAB}\r
+Source: modules\{#DYNAMIC_LINK}\readme.txt; DestDir: {app}\modules\{#DYNAMIC_LINK}; Components: {#COMPN_SCILAB}\r
+Source: modules\{#DYNAMIC_LINK}\licence.txt; DestDir: {app}\modules\{#DYNAMIC_LINK}; Components: {#COMPN_SCILAB}\r
+Source: modules\{#DYNAMIC_LINK}\changelog.txt; DestDir: {app}\modules\{#DYNAMIC_LINK}; Components: {#COMPN_SCILAB}\r
+;\r
+Source: modules\{#DYNAMIC_LINK}\etc\{#DYNAMIC_LINK}.quit; DestDir: {app}\modules\{#DYNAMIC_LINK}\etc; Components: {#COMPN_SCILAB}\r
+Source: modules\{#DYNAMIC_LINK}\etc\{#DYNAMIC_LINK}.start; DestDir: {app}\modules\{#DYNAMIC_LINK}\etc; Components: {#COMPN_SCILAB}\r
+;\r
+Source: modules\{#DYNAMIC_LINK}\sci_gateway\dynamic_link_gateway.xml; DestDir: {app}\modules\{#DYNAMIC_LINK}\sci_gateway; Components: {#COMPN_SCILAB}\r
+;\r
+Source: modules\{#DYNAMIC_LINK}\help\addchapter.sce; DestDir: {app}\modules\{#DYNAMIC_LINK}\help; Flags: recursesubdirs; Components:  {#COMPN_SCILAB}\r
+;\r
+Source: modules\{#DYNAMIC_LINK}\help\*.htm; DestDir: {app}\modules\{#DYNAMIC_LINK}\help; Flags: recursesubdirs; Components: {#COMPN_SCILAB}\r
+;\r
+Source: modules\{#DYNAMIC_LINK}\src\scripts\Makedll.incl; DestDir: {app}\modules\{#DYNAMIC_LINK}\src\scripts; Components: {#COMPN_SCILAB}\r
+;\r
+Source: modules\{#DYNAMIC_LINK}\includes\*.h; DestDir: {app}\modules\{#DYNAMIC_LINK}\includes; Components: {#COMPN_SCILAB}\r
+;\r
+Source: modules\{#DYNAMIC_LINK}\macros\lib; DestDir: {app}\modules\{#DYNAMIC_LINK}\macros; Flags: recursesubdirs; Components: {#COMPN_SCILAB}\r
+Source: modules\{#DYNAMIC_LINK}\macros\names; DestDir: {app}\modules\{#DYNAMIC_LINK}\macros; Flags: recursesubdirs; Components: {#COMPN_SCILAB}\r
+Source: modules\{#DYNAMIC_LINK}\macros\*.bin; DestDir: {app}\modules\{#DYNAMIC_LINK}\macros; Flags: recursesubdirs; Components: {#COMPN_SCILAB}\r
+Source: modules\{#DYNAMIC_LINK}\macros\*.sci; DestDir: {app}\modules\{#DYNAMIC_LINK}\macros; Flags: recursesubdirs; Components: {#COMPN_SCILAB}\r
+Source: modules\{#DYNAMIC_LINK}\macros\buildmacros.sce; DestDir: {app}\modules\{#DYNAMIC_LINK}\macros; Flags: recursesubdirs; Components: {#COMPN_SCILAB}\r
+Source: modules\{#DYNAMIC_LINK}\macros\buildmacros.bat; DestDir: {app}\modules\{#DYNAMIC_LINK}\macros; Flags: recursesubdirs; Components: {#COMPN_SCILAB}\r
+Source: modules\{#DYNAMIC_LINK}\macros\cleanmacros.bat; DestDir: {app}\modules\{#DYNAMIC_LINK}\macros; Flags: recursesubdirs; Components: {#COMPN_SCILAB}\r
+;\r
+;Source: modules\{#DYNAMIC_LINK}\demos\*.*; DestDir: {app}\modules\{#DYNAMIC_LINK}\demos; Flags: recursesubdirs; Components: {#COMPN_SCILAB}\r
+;\r
+Source: modules\{#DYNAMIC_LINK}\examples\*.*; DestDir: {app}\modules\{#DYNAMIC_LINK}\examples; Flags: recursesubdirs; Components: {#COMPN_SCILAB}\r
+;\r
+Source: modules\{#DYNAMIC_LINK}\tests\*.*; DestDir: {app}\modules\{#DYNAMIC_LINK}\tests; Flags: recursesubdirs; Components: {#COMPN_SCILAB} and {#COMPN_TESTS}\r
+;\r
+;--------------------------------------------------------------------------------------------------------------\r
diff --git a/scilab/modules/dynamic_link/etc/dynamic_link.quit b/scilab/modules/dynamic_link/etc/dynamic_link.quit
new file mode 100644 (file)
index 0000000..54ecfd8
--- /dev/null
@@ -0,0 +1,9 @@
+// ====================================================================\r
+// This file contains command to be executed at the end \r
+// of a scilab session for dynamic_link module\r
+// Copyright INRIA 2008\r
+// Allan CORNET\r
+// ====================================================================\r
+// delete help chapter\r
+del_help_chapter('dynamic_link',%T);\r
+// ====================================================================\r
diff --git a/scilab/modules/dynamic_link/etc/dynamic_link.start b/scilab/modules/dynamic_link/etc/dynamic_link.start
new file mode 100644 (file)
index 0000000..eb0750c
--- /dev/null
@@ -0,0 +1,36 @@
+// ====================================================================\r
+// dynamic_link module initialisation file \r
+// Copyright INRIA 2008\r
+// Allan CORNET\r
+// ====================================================================\r
+//Load  functions librarie\r
+load('SCI/modules/dynamic_link/macros/lib');\r
+// ====================================================================\r
+//add help chapter\r
+add_module_help_chapter('dynamic_link');\r
+// LCC initialization =================================================\r
+global LCC; \r
+if ~MSDOS then\r
+ LCC=%F;\r
+end\r
+// Configure Environment Variables for Ms Visual C ====================\r
+if MSDOS then\r
+       if (~isdef('WSCI')) then\r
+        WSCI=getlongpathname(pathconvert(SCI,%f,%f,'w'))\r
+       end\r
+       if (findmsvccompiler()<>'unknown') then\r
+    configure_msvc();\r
+    LCC=%F; // Always choose MsVc if it is installed by default\r
+    clear configure_msvc setmsvc71 setmsvc70 setmsvc60 setmsvc50\r
+    clear setmsvc80std setmsvc80pro setmsvc90express setmsvc80express\r
+  else\r
+    if (findlcccompiler()) then\r
+      LCC=%T;\r
+      configure_lcc();\r
+    end\r
+  end\r
+  clear findmsvccompiler\r
+end\r
+// ====================================================================\r
+clear LCC \r
+// ====================================================================\r
diff --git a/scilab/modules/dynamic_link/help/en_US/G_make.xml b/scilab/modules/dynamic_link/help/en_US/G_make.xml
new file mode 100644 (file)
index 0000000..edab189
--- /dev/null
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>\r
+<!DOCTYPE MAN SYSTEM "../../../../modules/helptools/help.dtd">\r
+<MAN>\r
+  <LANGUAGE>eng</LANGUAGE>\r
+  <TITLE>G_make</TITLE>\r
+  <TYPE>Scilab Function</TYPE>\r
+  <DATE>$LastChangedDate: 2006-09-03 11:54:48 +0200 (Sun, 03 Sep 2006) $</DATE>\r
+  <SHORT_DESCRIPTION name="G_make"> call make or nmake</SHORT_DESCRIPTION>\r
+  <CALLING_SEQUENCE>\r
+    <CALLING_SEQUENCE_ITEM>Rfiles=G_make(files,dllname)  </CALLING_SEQUENCE_ITEM>\r
+  </CALLING_SEQUENCE>\r
+  <PARAM>\r
+    <PARAM_INDENT>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>files</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: a character string or a vector of character string.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>dllname</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: a character string.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>Rfiles</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: vector of character string. <VERB>Rfiles</VERB> can be used as a first argument when calling <VERB>addinter</VERB> function.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+    </PARAM_INDENT>\r
+  </PARAM>\r
+  <DESCRIPTION>\r
+    <P>\r
+    On Unix like systems (i.e unix or windows/gcwin32) <VERB>G_make</VERB> calls\r
+    the <VERB>make</VERB> utility for building target <VERB>files</VERB> and returns\r
+    the value of <VERB>files</VERB> in the variable <VERB>Rfiles</VERB>. On windows platforms, (i.e when\r
+    Scilab was compiled with Microsoft Visual Studio C++ 2005 or more). <VERB>G_make</VERB> calls\r
+    the <VERB>nmake</VERB> utility for building target <VERB>dllname</VERB> and it\r
+    returns the value of <VERB>dllname</VERB> in the variable <VERB>Rfiles</VERB>. \r
+    Of course <VERB>G_make</VERB> will work if apropriate Makefiles are \r
+    provided in the current Scilab directory.</P>\r
+    <P><VERB>G_make</VERB> can be used to provide OS independant call to addinter. \r
+    and such examples can be found in the directory\r
+    <VERB>SCIDIR/examples/addinter-examples</VERB></P>\r
+    <VERBATIM>\r
+<![CDATA[\r
+files=G_make([TMPDIR+'/ex1cI.o',TMPDIR+'/ex1c.o'],'ex1c.dll');// compilation \r
+addinter(files,'foobar','foubare'); // link \r
+   ]]>\r
+    </VERBATIM>\r
+  </DESCRIPTION>\r
+  <SEE_ALSO>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>addinter</LINK>\r
+    </SEE_ALSO_ITEM>\r
+  </SEE_ALSO>\r
+</MAN>\r
diff --git a/scilab/modules/dynamic_link/help/en_US/VCtoLCCLib.xml b/scilab/modules/dynamic_link/help/en_US/VCtoLCCLib.xml
new file mode 100644 (file)
index 0000000..d3bfb1b
--- /dev/null
@@ -0,0 +1,22 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE MAN SYSTEM "../../../../modules/helptools/help.dtd">\r
+<MAN>\r
+  <LANGUAGE>eng</LANGUAGE>\r
+  <TITLE>VCtoLCCLib</TITLE>\r
+  <TYPE>Scilab Function</TYPE>\r
+  <DATE>$LastChangedDate: 2006-08-30 13:26:08 +0200 (mer, 30 aoû 2006) $</DATE>\r
+  <SHORT_DESCRIPTION name="VCtoLCCLib">converts Ms VC libs to LCC-Win32 libs.</SHORT_DESCRIPTION>\r
+\r
+  <CALLING_SEQUENCE>\r
+    <CALLING_SEQUENCE_ITEM>VCtoLCCLib()</CALLING_SEQUENCE_ITEM>\r
+  </CALLING_SEQUENCE>\r
+  \r
+\r
+  <DESCRIPTION>\r
+    <P>converts Ms VC libs to LCC-Win32 libs.</P>\r
+  </DESCRIPTION>\r
+\r
+  <EXAMPLE><![CDATA[bOK=chooselcccompiler();VCtoLCCLib()]]></EXAMPLE>\r
+\r
+  <AUTHOR>Allan CORNET</AUTHOR>\r
+</MAN>
\ No newline at end of file
diff --git a/scilab/modules/dynamic_link/help/en_US/addchapter.sce b/scilab/modules/dynamic_link/help/en_US/addchapter.sce
new file mode 100644 (file)
index 0000000..5eb9bbe
--- /dev/null
@@ -0,0 +1,10 @@
+// ====================================================================\r
+// help dynamic_link module\r
+// Add chapter\r
+// Copyright INRIA 2008\r
+// Allan CORNET\r
+// ====================================================================\r
+path = SCI+'/modules/dynamic_link/help/'+getdefaultlanguage();\r
+add_help_chapter("Dynamic Link",path,%T);\r
+clear path add_help_chapter;\r
+// ====================================================================\r
diff --git a/scilab/modules/dynamic_link/help/en_US/addinter.xml b/scilab/modules/dynamic_link/help/en_US/addinter.xml
new file mode 100644 (file)
index 0000000..69dce9c
--- /dev/null
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>\r
+<!DOCTYPE MAN SYSTEM "../../../../modules/helptools/help.dtd">\r
+<MAN>\r
+  <LANGUAGE>eng</LANGUAGE>\r
+  <TITLE>addinter</TITLE>\r
+  <TYPE>Scilab Function</TYPE>\r
+  <DATE>$LastChangedDate: 2007-12-10 17:18:42 +0100 (Mon, 10 Dec 2007) $</DATE>\r
+  <SHORT_DESCRIPTION name="addinter"> new functions interface dynamic link at run time</SHORT_DESCRIPTION>\r
+  <CALLING_SEQUENCE>\r
+    <CALLING_SEQUENCE_ITEM>addinter(files,spname,fcts)  </CALLING_SEQUENCE_ITEM>\r
+  </CALLING_SEQUENCE>\r
+  <PARAM>\r
+    <PARAM_INDENT>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>files</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: a character string or a vector of character string contain object files used to define the new Scilab interface routine (interface code, user routines or libraries, system libraries).</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>spname</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: a character string. Name of interface routine entry point</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>fcts</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: vector of character strings. The name of new Scilab function implemented in the new interface (in <VERB> fin</VERB> the order ).</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+    </PARAM_INDENT>\r
+  </PARAM>\r
+  <DESCRIPTION>\r
+    <P><VERB>addinter</VERB> performs dynamic link of a compiled C or Fortran\r
+    new Scilab interface routine (see <VERB>intersci</VERB> documentation)\r
+    and define corresponding scilab functions.</P>\r
+    <P>\r
+    You can use the command <VERB>link('show')</VERB> to get the number of the shared libraries.\r
+    And to reload a new version of an interface a call to <VERB>ulink</VERB> is \r
+    necessary to get rid of the old version.</P>\r
+    <P>\r
+    See <VERB>link</VERB> for more precision on use.</P>\r
+  </DESCRIPTION>\r
+  <SEE_ALSO>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>link</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>intersci</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>newfun</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>clearfun</LINK>\r
+    </SEE_ALSO_ITEM>\r
+  </SEE_ALSO>\r
+</MAN>\r
diff --git a/scilab/modules/dynamic_link/help/en_US/chooselcccompiler.xml b/scilab/modules/dynamic_link/help/en_US/chooselcccompiler.xml
new file mode 100644 (file)
index 0000000..0877827
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE MAN SYSTEM "../../../../modules/helptools/help.dtd">\r
+<MAN>\r
+  <LANGUAGE>eng</LANGUAGE>\r
+  <TITLE>chooselcccompiler</TITLE>\r
+  <TYPE>Scilab Function</TYPE>\r
+  <DATE>$LastChangedDate: 2006-08-30 13:26:08 +0200 (mer, 30 aoû 2006) $</DATE>\r
+  <SHORT_DESCRIPTION name="chooselcccompiler">choose LCC-Win32 as the default C Compiler.</SHORT_DESCRIPTION>\r
+\r
+  <CALLING_SEQUENCE>\r
+    <CALLING_SEQUENCE_ITEM>bOK=chooselcccompiler()</CALLING_SEQUENCE_ITEM>\r
+  </CALLING_SEQUENCE>\r
+\r
+  <PARAM>\r
+    <PARAM_INDENT>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>bOK</PARAM_NAME>\r
+\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: returns %T if LCC-Win32 is the default C Compiler.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+    </PARAM_INDENT>\r
+  </PARAM>\r
+\r
+  <DESCRIPTION>\r
+    <P>choose LCC-Win32 as the default C Compiler.</P>\r
+  </DESCRIPTION>\r
+\r
+  <EXAMPLE><![CDATA[bOK=chooselcccompiler()]]></EXAMPLE>\r
+\r
+  <AUTHOR>Allan CORNET</AUTHOR>\r
+</MAN>
\ No newline at end of file
diff --git a/scilab/modules/dynamic_link/help/en_US/configure_lcc.xml b/scilab/modules/dynamic_link/help/en_US/configure_lcc.xml
new file mode 100644 (file)
index 0000000..bae5d67
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE MAN SYSTEM "../../../../modules/helptools/help.dtd">\r
+<MAN>\r
+  <LANGUAGE>eng</LANGUAGE>\r
+  <TITLE>configure_lcc</TITLE>\r
+  <TYPE>Scilab Function</TYPE>\r
+  <DATE>$LastChangedDate: 2006-08-30 13:26:08 +0200 (mer, 30 aoû 2006) $</DATE>\r
+  <SHORT_DESCRIPTION name="configure_lcc">set environments variables for LCC-Win32 C Compiler.</SHORT_DESCRIPTION>\r
+\r
+  <CALLING_SEQUENCE>\r
+    <CALLING_SEQUENCE_ITEM>bOK=configure_lcc()</CALLING_SEQUENCE_ITEM>\r
+  </CALLING_SEQUENCE>\r
+\r
+  <PARAM>\r
+    <PARAM_INDENT>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>bOK</PARAM_NAME>\r
+\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: returns %T if environments variables for LCC-Win32 C Compiler are OK. </SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+    </PARAM_INDENT>\r
+  </PARAM>\r
+\r
+  <DESCRIPTION>\r
+    <P>set environments variables for LCC-Win32 C Compiler.</P>\r
+  </DESCRIPTION>\r
+\r
+  <EXAMPLE><![CDATA[bOK=configure_lcc()\r
+]]></EXAMPLE>\r
+\r
+  <AUTHOR>Allan CORNET</AUTHOR>\r
+</MAN>\r
diff --git a/scilab/modules/dynamic_link/help/en_US/configure_msvc.xml b/scilab/modules/dynamic_link/help/en_US/configure_msvc.xml
new file mode 100644 (file)
index 0000000..fafc5a5
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE MAN SYSTEM "../../../../modules/helptools/help.dtd">\r
+<MAN>\r
+  <LANGUAGE>eng</LANGUAGE>\r
+\r
+  <TITLE>configure_msvc</TITLE>\r
+\r
+  <TYPE>Scilab Function</TYPE>\r
+\r
+  <DATE>$LastChangedDate: 2006-09-03 11:54:48 +0200 (Sun, 03 Sep 2006) $</DATE>\r
+\r
+  <SHORT_DESCRIPTION name="configure_msvc">set environments variables for Microsoft C Compiler.</SHORT_DESCRIPTION>\r
+\r
+  <CALLING_SEQUENCE>\r
+    <CALLING_SEQUENCE_ITEM>bOK=configure_msvc()</CALLING_SEQUENCE_ITEM>\r
+  </CALLING_SEQUENCE>\r
+\r
+  <PARAM>\r
+    <PARAM_INDENT>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>bOK</PARAM_NAME>\r
+\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: returns %T if environments variables for Ms C Compiler are OK. </SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+    </PARAM_INDENT>\r
+  </PARAM>\r
+\r
+  <DESCRIPTION>\r
+    <P>set environments variables for Microsoft C Compiler.</P>\r
+  </DESCRIPTION>\r
+\r
+  <EXAMPLE><![CDATA[bOK=configure_msvc()\r
+]]></EXAMPLE>\r
+\r
+  <AUTHOR>Allan CORNET</AUTHOR>\r
+</MAN>
\ No newline at end of file
diff --git a/scilab/modules/dynamic_link/help/en_US/findlcccompiler.xml b/scilab/modules/dynamic_link/help/en_US/findlcccompiler.xml
new file mode 100644 (file)
index 0000000..b225696
--- /dev/null
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE MAN SYSTEM "../../../../modules/helptools/help.dtd">\r
+<MAN>\r
+  <LANGUAGE>eng</LANGUAGE>\r
+  <TITLE>findlcccompiler</TITLE>\r
+  <TYPE>Scilab Function</TYPE>\r
+  <DATE>$LastChangedDate: 2006-08-30 13:26:08 +0200 (mer, 30 aoû 2006) $</DATE>\r
+  <SHORT_DESCRIPTION name="findlccccompiler">detects LCC-Win32 C Compiler</SHORT_DESCRIPTION>\r
+\r
+  <CALLING_SEQUENCE>\r
+    <CALLING_SEQUENCE_ITEM>ret=findlcccompiler()</CALLING_SEQUENCE_ITEM>\r
+  </CALLING_SEQUENCE>\r
+\r
+  <PARAM>\r
+    <PARAM_INDENT>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>ret</PARAM_NAME>\r
+\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: returns %T or %F</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+    </PARAM_INDENT>\r
+  </PARAM>\r
+\r
+  <DESCRIPTION>\r
+    <P>detects LCC-Win32 C Compiler.</P>\r
+  </DESCRIPTION>\r
+\r
+  <EXAMPLE><![CDATA[ret=findlcccompiler()\r
+]]></EXAMPLE>\r
+\r
+  <AUTHOR>Allan CORNET</AUTHOR>\r
+</MAN>
\ No newline at end of file
diff --git a/scilab/modules/dynamic_link/help/en_US/findmsvccompiler.xml b/scilab/modules/dynamic_link/help/en_US/findmsvccompiler.xml
new file mode 100644 (file)
index 0000000..2ed1c8c
--- /dev/null
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE MAN SYSTEM "../../../../modules/helptools/help.dtd">\r
+<MAN>\r
+  <LANGUAGE>eng</LANGUAGE>\r
+\r
+  <TITLE>findmsvccompiler</TITLE>\r
+\r
+  <TYPE>Scilab Function</TYPE>\r
+\r
+  <DATE>$LastChangedDate: 2006-09-03 11:54:48 +0200 (Sun, 03 Sep 2006) $</DATE>\r
+\r
+  <SHORT_DESCRIPTION name="findmsvccompiler">detects Microsoft C Compiler</SHORT_DESCRIPTION>\r
+\r
+  <CALLING_SEQUENCE>\r
+    <CALLING_SEQUENCE_ITEM>msvc=findmsvccompiler()</CALLING_SEQUENCE_ITEM>\r
+  </CALLING_SEQUENCE>\r
+\r
+  <PARAM>\r
+    <PARAM_INDENT>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>msvc</PARAM_NAME>\r
+\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: returns 'msvc50','msvc60','msvc70','msvc71','unknown'</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+    </PARAM_INDENT>\r
+  </PARAM>\r
+\r
+  <DESCRIPTION>\r
+    <P>detects Microsoft C Compiler.</P>\r
+  </DESCRIPTION>\r
+\r
+  <EXAMPLE><![CDATA[msvc=findmsvccompiler()\r
+]]></EXAMPLE>\r
+\r
+  <AUTHOR>Allan CORNET</AUTHOR>\r
+</MAN>
\ No newline at end of file
diff --git a/scilab/modules/dynamic_link/help/en_US/ilib_build.xml b/scilab/modules/dynamic_link/help/en_US/ilib_build.xml
new file mode 100644 (file)
index 0000000..aa428c1
--- /dev/null
@@ -0,0 +1,131 @@
+<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>\r
+<!DOCTYPE MAN SYSTEM "../../../../modules/helptools/help.dtd">\r
+<MAN>\r
+  <LANGUAGE>eng</LANGUAGE>\r
+  <TITLE>ilib_build</TITLE>\r
+  <TYPE>Scilab Function</TYPE>\r
+  <DATE>$LastChangedDate: 2006-09-03 11:54:48 +0200 (Sun, 03 Sep 2006) $</DATE>\r
+  <SHORT_DESCRIPTION name="ilib_build"> utility for shared library management</SHORT_DESCRIPTION>\r
+  <CALLING_SEQUENCE>\r
+    <CALLING_SEQUENCE_ITEM>ilib_build(lib_name,table,files,libs [,makename,ldflags,cflags,fflags])  </CALLING_SEQUENCE_ITEM>\r
+  </CALLING_SEQUENCE>\r
+  <PARAM>\r
+    <PARAM_INDENT>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>lib_name</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: a character string, the generic name of the library without path and extension.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>table</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: 2 column string matrix giving the table of pairs 'scilab-name', 'interface name'</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>files</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: string matrix giving objects files needed for shared library creation</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>libs</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: string matrix giving extra libraries needed for shred library creation</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>makename</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: character string. The path of the Makefile file without extension.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>ldflags,cflags,fflags</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: character strings to provide options for the loader, the C compiler and the Fortran compiler.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+    </PARAM_INDENT>\r
+  </PARAM>\r
+  <DESCRIPTION>\r
+    <P>\r
+    This tool is used to create shared libraries and to generate a \r
+    loader file which can be used to dynamically load the shared library \r
+    into Scilab with <VERB>addinter</VERB></P>\r
+    <P>\r
+    Many examples are provided in <VERB>examples/interface-tour-so</VERB>\r
+    directory.</P>\r
+  </DESCRIPTION>\r
+  <EXAMPLE>\r
+<![CDATA[\r
+//Here with give a complete example on adding new primitive to Scilab\r
+//create the procedure files\r
+f1=['extern double fun2();'\r
+    'void fun1(x,y)'\r
+    'double *x, *y;'\r
+    '{*y=fun2(*x)/(*x);}'];\r
+\r
+mputl(f1,'fun1.c')\r
+\r
+f2=['#include <math.h>'\r
+    'double fun2(x)'\r
+    'double x;'\r
+    '{ return( sin(x+1.));}'];\r
+mputl(f2,'fun2.c');\r
+\r
+//creating the interface file\r
+i=['#include ""stack-c.h""'\r
+   'extern int fun1 _PARAMS(( double *x, double *y));'\r
+   'int intfun1(fname)' \r
+   'char * fname;'\r
+   '{'\r
+   '  int m1,n1,l1;'\r
+   '  CheckRhs(1,1);'\r
+   '  CheckLhs(1,1);'\r
+   '  GetRhsVar(1, ""d"", &m1, &n1, &l1);'\r
+   '  fun1(stk(l1),stk(l1));'\r
+   '  LhsVar(1) = 1;'\r
+   '  return 0;'\r
+   '}'];\r
+mputl(i,'intfun1.c')\r
+\r
+//creating the shared library (a gateway, a Makefile and a loader are \r
+//generated. \r
+\r
+files=['fun1.o','fun2.o','intfun1.o'];\r
+ilib_build('foo',['scifun1','intfun1'],files,[]);\r
+\r
+// load the shared library \r
+\r
+exec loader.sce \r
+\r
+//using the new primitive\r
+scifun1(33)\r
+ ]]>\r
+  </EXAMPLE>\r
+  <SEE_ALSO>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>addinter</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>link</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_compile</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_gen_Make</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_gen_gateway</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_gen_loader</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_for_link</LINK>\r
+    </SEE_ALSO_ITEM>\r
+  </SEE_ALSO>\r
+</MAN>\r
diff --git a/scilab/modules/dynamic_link/help/en_US/ilib_compile.xml b/scilab/modules/dynamic_link/help/en_US/ilib_compile.xml
new file mode 100644 (file)
index 0000000..1ca7d2e
--- /dev/null
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>\r
+<!DOCTYPE MAN SYSTEM "../../../../modules/helptools/help.dtd">\r
+<MAN>\r
+  <LANGUAGE>eng</LANGUAGE>\r
+  <TITLE>ilib_compile</TITLE>\r
+  <TYPE>Scilab Function</TYPE>\r
+  <DATE>$LastChangedDate: 2006-09-03 11:54:48 +0200 (Sun, 03 Sep 2006) $</DATE>\r
+  <SHORT_DESCRIPTION name="ilib_compile"> ilib_build utility: executes the\r
+    makefile produced by ilib_gen_Make</SHORT_DESCRIPTION>\r
+  <CALLING_SEQUENCE>\r
+    <CALLING_SEQUENCE_ITEM>libn=ilib_compile(lib_name,makename [,files])  </CALLING_SEQUENCE_ITEM>\r
+  </CALLING_SEQUENCE>\r
+  <PARAM>\r
+    <PARAM_INDENT>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>lib_name</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: a character string, the generic name of the library without path and extension.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>makename</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: character string. The path of the Makefile file without extension.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>files</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: optionnal vector of character strings. If files is given the make is performed on each \r
+           target contained in files then a whole make is performed </SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>libn</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: character string. The path of the really generated shared library file.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+    </PARAM_INDENT>\r
+  </PARAM>\r
+  <DESCRIPTION>\r
+    <P>\r
+    Utility function used by <VERB>ilib_build</VERB></P>\r
+    <P>\r
+    This executes the  makefile produced by <VERB>ilib_gen_Make</VERB>, compiles\r
+    the C and fortran files and generates the shared library.</P>\r
+    <P>\r
+    Shared libraries can then be used with the <VERB>link</VERB> and\r
+    <VERB>addinter</VERB> scilab function for dynamic link.</P>\r
+  </DESCRIPTION>\r
+  <SEE_ALSO>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>addinter</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>link</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_build</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_gen_Make</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_gen_gateway</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_gen_loader</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_for_link</LINK>\r
+    </SEE_ALSO_ITEM>\r
+  </SEE_ALSO>\r
+</MAN>\r
diff --git a/scilab/modules/dynamic_link/help/en_US/ilib_for_link.xml b/scilab/modules/dynamic_link/help/en_US/ilib_for_link.xml
new file mode 100644 (file)
index 0000000..2e4957b
--- /dev/null
@@ -0,0 +1,162 @@
+<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>\r
+<!DOCTYPE MAN SYSTEM "../../../../modules/helptools/help.dtd">\r
+<MAN>\r
+  <LANGUAGE>eng</LANGUAGE>\r
+  <TITLE>ilib_for_link</TITLE>\r
+  <TYPE>Scilab Function</TYPE>\r
+  <DATE>$LastChangedDate: 2008-01-14 16:52:36 +0100 (Mon, 14 Jan 2008) $</DATE>\r
+  <SHORT_DESCRIPTION name="ilib_for_link"> utility for shared library management with link</SHORT_DESCRIPTION>\r
+  <CALLING_SEQUENCE>\r
+    <CALLING_SEQUENCE_ITEM>libn=ilib_for_link(names,files,libs,flag [,makename\r
+      [,loadername [,libname [,ldflags [,cflags [,fflags [,cc]]]]]]])  </CALLING_SEQUENCE_ITEM>\r
+  </CALLING_SEQUENCE>\r
+  <PARAM>\r
+    <PARAM_INDENT>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>names</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: a string matrix giving the entry names which are to be linked.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>files</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: string matrix giving objects files needed for shared library creation</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>libs</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: string matrix giving extra libraries needed for shred library creation</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>flag</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: a string flag (&quot;c&quot; or &quot;f&quot;) for C or Fortran entry points.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>makename</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: character string. The pathname of the Makefile file without extension (default value <VERB>Makelib</VERB>).</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>loadername</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: character string. The pathname of the loader file (default\r
+           value is   <VERB>loader.sce</VERB>).</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>libname</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: optional character string. The name of the generated shared\r
+           library (default value  is '', and in this case the name is derived\r
+           from <VERB>names(1)</VERB>).</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>ldflags</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: optional character string. It can be used to add specific linker options in the\r
+           generated Makefile. Default value is ''</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+     <PARAM_ITEM>\r
+        <PARAM_NAME>cflags</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: optional character  string. It can be used to add specific C compiler options in the\r
+           generated Makefile. Default value is ''</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+     <PARAM_ITEM>\r
+        <PARAM_NAME>fflags</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: optional character  string. It can be used to add specific Fortran compiler options in the\r
+           generated Makefile. Default value is ''</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+    <PARAM_ITEM>\r
+        <PARAM_NAME>cc</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: optional character  string. It can be used to specify a C compiler. Default value is ''</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>libn</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: character string. The path of the really generated shared library file.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+    </PARAM_INDENT>\r
+  </PARAM>\r
+  <DESCRIPTION>\r
+    <P>\r
+    This tool is used to create shared libraries and to generate a \r
+    loader file which can be used to dynamically load the shared library \r
+    into Scilab with the <VERB>link</VERB> function. New entry points \r
+    given by <VERB>names</VERB> are then accessible through the <VERB>call</VERB> \r
+    function or with non linear tools <VERB>ode</VERB>, <VERB>optim</VERB>,...</P>\r
+    <P>\r
+    The file to compile are supposed to be located given by\r
+    <VERB>makename</VERB>. If <VERB>makename</VERB> sets a path different to the\r
+    current directory, <VERB>loader</VERB> script must be located in\r
+    the same directory using the <VERB>loadername</VERB> variable.</P>\r
+    <P>\r
+    Many examples are provided in <VERB>examples/link-examples-so</VERB>\r
+    directory.</P>\r
+  </DESCRIPTION>\r
+  <EXAMPLE>\r
+<![CDATA[\r
+chdir(TMPDIR)\r
+f1=['int ext1c(n, a, b, c)'\r
+    'int *n;     double *a, *b, *c;'\r
+    '{int k;'\r
+    '  for (k = 0; k < *n; ++k) '\r
+    '      c[k] = a[k] + b[k];'\r
+    '  return(0);}'];\r
+\r
+mputl(f1,'fun1.c')\r
+\r
+//creating the shared library (a gateway, a Makefile and a loader are \r
+//generated. \r
+\r
+ilib_for_link('ext1c','fun1.o',[],"c") \r
+\r
+// load the shared library \r
+\r
+exec loader.sce \r
+\r
+//using the new primitive\r
+a=[1,2,3];b=[4,5,6];n=3;\r
+c=call('ext1c',n,1,'i',a,2,'d',b,3,'d','out',[1,3],4,'d');\r
+if norm(c-(a+b)) > %eps then pause,end\r
+\r
+ ]]>\r
+  </EXAMPLE>\r
+  <SEE_ALSO>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>addinter</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>link</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_compile</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_gen_Make</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_gen_gateway</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_gen_loader</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_for_link</LINK>\r
+    </SEE_ALSO_ITEM>\r
+  </SEE_ALSO>\r
+</MAN>\r
diff --git a/scilab/modules/dynamic_link/help/en_US/ilib_gen_Make.xml b/scilab/modules/dynamic_link/help/en_US/ilib_gen_Make.xml
new file mode 100644 (file)
index 0000000..57f461c
--- /dev/null
@@ -0,0 +1,115 @@
+<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>\r
+<!DOCTYPE MAN SYSTEM "../../../../modules/helptools/help.dtd">\r
+<MAN>\r
+  <LANGUAGE>eng</LANGUAGE>\r
+  <TITLE>ilib_gen_Make</TITLE>\r
+  <TYPE>Scilab Function</TYPE>\r
+  <DATE>$LastChangedDate: 2006-09-03 11:54:48 +0200 (Sun, 03 Sep 2006) $</DATE>\r
+  <SHORT_DESCRIPTION name="ilib_gen_Make"> utility for  <VERB>ilib_build</VERB>: produces a makefile for building shared libraries</SHORT_DESCRIPTION>\r
+  <CALLING_SEQUENCE>\r
+    <CALLING_SEQUENCE_ITEM>Makename=ilib_gen_Make(name,files,libs,makename [,with_gateway,ldflags,cflags,fflags])  </CALLING_SEQUENCE_ITEM>\r
+  </CALLING_SEQUENCE>\r
+  <PARAM>\r
+    <PARAM_INDENT>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>lib_name</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: a character string, the generic name of the library without path and extension.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>files</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: a vector of character string. The names of the C or Fortran files without the extension and the path part.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>libs</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: a vector of character string. additionnal libraries paths or [].</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>makename</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: character string. The path of the Makefile file.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>with_gateway</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: a boolean. If true a file with name &lt;lib_name&gt;_gateway is\r
+           added. Default value is %t</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>ldflags</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: a string. It can be used to add specific linker options in the\r
+           generated Makefile. Default value is ''</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+     <PARAM_ITEM>\r
+        <PARAM_NAME>cflags</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: a string. It can be used to add specific C compiler options in the\r
+           generated Makefile. Default value is ''</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+     <PARAM_ITEM>\r
+        <PARAM_NAME>fflags</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: a string. It can be used to add specific Fortran compiler options in the\r
+           generated Makefile. Default value is ''</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>Makename</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: character string. The path of the really generated Makefile file.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+    </PARAM_INDENT>\r
+  </PARAM>\r
+  <DESCRIPTION>\r
+    <P>\r
+    Utility function used by <VERB>ilib_build</VERB></P>\r
+    <P>\r
+    This function generates a makefile adapted to the Operating System for\r
+    building shared libraries to be loaded in Scilab. Proper options and\r
+    paths are set.</P>\r
+    <P>\r
+    Shared libraries can then be used with the <VERB>link</VERB> and\r
+    <VERB>addinter</VERB> scilab function for incremental linking.</P>\r
+    <P>\r
+    The shared library is build from a set of C or Fortran routines\r
+    stored in a directory and if required from a set of external\r
+    libraries.</P>\r
+    <P>\r
+    Files are not required to exist, when makefile is generated, but of\r
+    course are required for executing the makefile.</P>\r
+  </DESCRIPTION>\r
+  <SEE_ALSO>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>addinter</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>link</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_build</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_compile</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_gen_gateway</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_gen_loader</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_for_link</LINK>\r
+    </SEE_ALSO_ITEM>\r
+  </SEE_ALSO>\r
+</MAN>\r
diff --git a/scilab/modules/dynamic_link/help/en_US/ilib_gen_gateway.xml b/scilab/modules/dynamic_link/help/en_US/ilib_gen_gateway.xml
new file mode 100644 (file)
index 0000000..6345e20
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>\r
+<!DOCTYPE MAN SYSTEM "../../../../modules/helptools/help.dtd">\r
+<MAN>\r
+       <LANGUAGE>eng</LANGUAGE>\r
+       <TITLE>ilib_gen_gateway</TITLE>\r
+       <TYPE>Scilab Function</TYPE>\r
+       <DATE>$LastChangedDate: 2007-08-27 14:09:33 +0200 (Mon, 27 Aug 2007) $</DATE>\r
+       <SHORT_DESCRIPTION name="ilib_gen_gateway"> utility for <VERB>ilib_build</VERB>, generates a gateway file.  </SHORT_DESCRIPTION>\r
+       <CALLING_SEQUENCE>\r
+               <CALLING_SEQUENCE_ITEM>ilib_gen_gateway(name,table)  </CALLING_SEQUENCE_ITEM>\r
+       </CALLING_SEQUENCE>\r
+       <PARAM>\r
+               <PARAM_INDENT>\r
+                       <PARAM_ITEM>\r
+                               <PARAM_NAME>name</PARAM_NAME>\r
+                               <PARAM_DESCRIPTION>\r
+                                       <SP>: a character string, the generic name of the library without path and extension.</SP>\r
+                               </PARAM_DESCRIPTION>\r
+                       </PARAM_ITEM>\r
+                       <PARAM_ITEM>\r
+                               <PARAM_NAME>table</PARAM_NAME>\r
+                               <PARAM_DESCRIPTION>\r
+                                       <SP>: 2 column string matrix giving the table of pairs 'scilab-name' 'interface name'</SP>\r
+                               </PARAM_DESCRIPTION>\r
+                       </PARAM_ITEM>\r
+               </PARAM_INDENT>\r
+       </PARAM>\r
+       <DESCRIPTION>\r
+               <P>\r
+                       Utility function used by <VERB>ilib_build</VERB>\r
+                       This function generates a gateway file used by <VERB>addinter</VERB>.</P>\r
+       </DESCRIPTION>\r
+       <SEE_ALSO>\r
+               <SEE_ALSO_ITEM>\r
+                       <LINK>addinter</LINK>\r
+               </SEE_ALSO_ITEM>\r
+               <SEE_ALSO_ITEM>\r
+                       <LINK>link</LINK>\r
+               </SEE_ALSO_ITEM>\r
+               <SEE_ALSO_ITEM>\r
+                       <LINK>ilib_build</LINK>\r
+               </SEE_ALSO_ITEM>\r
+               <SEE_ALSO_ITEM>\r
+                       <LINK>ilib_compile</LINK>\r
+               </SEE_ALSO_ITEM>\r
+               <SEE_ALSO_ITEM>\r
+                       <LINK>ilib_gen_Make</LINK>\r
+               </SEE_ALSO_ITEM>\r
+               <SEE_ALSO_ITEM>\r
+                       <LINK>ilib_gen_loader</LINK>\r
+               </SEE_ALSO_ITEM>\r
+               <SEE_ALSO_ITEM>\r
+                       <LINK>ilib_for_link</LINK>\r
+               </SEE_ALSO_ITEM>\r
+       </SEE_ALSO>\r
+</MAN>\r
diff --git a/scilab/modules/dynamic_link/help/en_US/ilib_gen_loader.xml b/scilab/modules/dynamic_link/help/en_US/ilib_gen_loader.xml
new file mode 100644 (file)
index 0000000..c0bc503
--- /dev/null
@@ -0,0 +1,56 @@
+<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>\r
+<!DOCTYPE MAN SYSTEM "../../../../modules/helptools/help.dtd">\r
+<MAN>\r
+  <LANGUAGE>eng</LANGUAGE>\r
+  <TITLE>ilib_gen_loader</TITLE>\r
+  <TYPE>Scilab Function</TYPE>\r
+  <DATE>$LastChangedDate: 2006-09-03 11:54:48 +0200 (Sun, 03 Sep 2006) $</DATE>\r
+  <SHORT_DESCRIPTION name="ilib_gen_loader"> utility for <VERB>ilib_build</VERB>: generates a loader file</SHORT_DESCRIPTION>\r
+  <CALLING_SEQUENCE>\r
+    <CALLING_SEQUENCE_ITEM>ilib_gen_loader(name,table)  </CALLING_SEQUENCE_ITEM>\r
+  </CALLING_SEQUENCE>\r
+  <PARAM>\r
+    <PARAM_INDENT>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>name</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: a character string, the generic name of the library without path and extension.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>table</PARAM_NAME>\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: 2 column string matrix giving the table of pairs 'scilab-name' 'interface name'</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+    </PARAM_INDENT>\r
+  </PARAM>\r
+  <DESCRIPTION>\r
+    <P>\r
+    Utility function used by <VERB>ilib_build</VERB>\r
+    This function generates a loader file.</P>\r
+  </DESCRIPTION>\r
+  <SEE_ALSO>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>addinter</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>link</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_build</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_compile</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_gen_Make</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_gen_loader</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_for_link</LINK>\r
+    </SEE_ALSO_ITEM>\r
+  </SEE_ALSO>\r
+</MAN>\r
diff --git a/scilab/modules/dynamic_link/help/en_US/link.xml b/scilab/modules/dynamic_link/help/en_US/link.xml
new file mode 100644 (file)
index 0000000..e365859
--- /dev/null
@@ -0,0 +1,138 @@
+<?xml version="1.0" encoding="ISO-8859-1" standalone="no"?>\r
+<!DOCTYPE MAN SYSTEM "../../../../modules/helptools/help.dtd">\r
+<MAN>\r
+  <LANGUAGE>eng</LANGUAGE>\r
+  <TITLE>link</TITLE>\r
+  <TYPE>Scilab Function</TYPE>\r
+  <DATE>$LastChangedDate: 2007-12-10 17:13:52 +0100 (Mon, 10 Dec 2007) $</DATE>\r
+  <SHORT_DESCRIPTION name="link"> dynamic linker </SHORT_DESCRIPTION>\r
+  <CALLING_SEQUENCE>\r
+    <CALLING_SEQUENCE_ITEM>x=link(files [, sub-names,flag]);  </CALLING_SEQUENCE_ITEM>\r
+    <CALLING_SEQUENCE_ITEM>link(x , sub-names [, flag]);     </CALLING_SEQUENCE_ITEM>\r
+\r
+    <CALLING_SEQUENCE_ITEM>ulink(x)  </CALLING_SEQUENCE_ITEM>\r
+    <CALLING_SEQUENCE_ITEM>lst=link('show')  </CALLING_SEQUENCE_ITEM>\r
+    <CALLING_SEQUENCE_ITEM>lst=link()  </CALLING_SEQUENCE_ITEM>\r
+  </CALLING_SEQUENCE>\r
+  \r
+  <PARAM>\r
+    <PARAM_INDENT>\r
+      <PARAM_ITEM>\r
+       <PARAM_NAME>files</PARAM_NAME>\r
+       <PARAM_DESCRIPTION>\r
+         <SP>: a character string or a vector of character strings, the files\r
+           names used to define the new entry point (compiled routines, user\r
+           libraries, system libraries,..)</SP>\r
+       </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+\r
+      <PARAM_ITEM>\r
+       <PARAM_NAME>sub-names</PARAM_NAME>\r
+       <PARAM_DESCRIPTION>\r
+         <SP>: a character string or a vector of character strings . Name of\r
+           the entry points in <VERB>files</VERB> to be linked.</SP> \r
+       </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+       <PARAM_NAME>x</PARAM_NAME>\r
+       <PARAM_DESCRIPTION>\r
+         <SP>: an integer which gives the id of a shared library linked into\r
+           Scilab with a previous call to <VERB>link</VERB>.</SP> \r
+       </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+      <PARAM_ITEM>\r
+       <PARAM_NAME>flag</PARAM_NAME>\r
+       <PARAM_DESCRIPTION>\r
+         <SP>: character string <VERB>'f'</VERB> or <VERB>'c'</VERB> for\r
+           Fortran (default) or C code.</SP> \r
+       </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+    </PARAM_INDENT>\r
+  </PARAM>\r
+  \r
+  <DESCRIPTION>\r
+  <P><VERB>link</VERB> is a dynamic link facility: this command allows to add new compiled \r
+      Fortran or C routines to Scilab executable code.\r
+      Linked routines can be called interactively by the function <VERB>call</VERB>.\r
+      Linked routines can also be used as &quot;external&quot; for e.g. \r
+      non linear problem solvers (<VERB>ode</VERB>, <VERB>optim</VERB>, <VERB>intg</VERB>, \r
+      <VERB>dassl</VERB>...). \r
+    </P>\r
+    <P><VERB>link()</VERB> returns a string matrix with linked functions. \r
+    </P>\r
+\r
+    <P>a call to <VERB>link</VERB> returns an integer which gives the\r
+         id of the shared  library which is loaded into Scilab. This number\r
+         can then be used as the first argument of the link function in order\r
+         to link additional  function from the linked shared library. The\r
+         shared library is  removed with the <VERB>ulink</VERB> command.</P>\r
+    <P>A routine  can be unlinked with\r
+      <VERB>ulink</VERB>.  If the linked function has been\r
+      modified between two links, it is required to <VERB>ulink</VERB> the previous instance\r
+      before the new link.</P>\r
+\r
+    <P><VERB>link('show')</VERB> returns the current linked routines.</P>\r
+\r
+    <P> To be able to link routines in a system independent way, it is convenient\r
+      to use the <VERB>ilib_for_link</VERB> utility function instead of <VERB>link</VERB>.</P>\r
+\r
+    <P>(Experienced) users may also <VERB>link</VERB> a new Scilab interface routine \r
+      to add a set of new functions. See <LINK>ilib_build</LINK> and\r
+      <LINK>addinter</LINK> functions.  </P>\r
+  </DESCRIPTION>\r
+  \r
+  <EXAMPLE><![CDATA[\r
+    //Example of the use of ilib_for_link with  a simple C code\r
+    f1=['#include <math.h>'\r
+    'void fooc(c,a,b,m,n)'\r
+    'double a[],*b,c[];'\r
+    'int *m,*n;'\r
+    '{'\r
+    '   int i;'\r
+    '   for ( i =0 ; i < (*m)*(*n) ; i++) '\r
+    '     c[i] = sin(a[i]) + *b; '\r
+    '}'];\r
+\r
+    mputl(f1,'fooc.c')\r
+\r
+    //creating the shared library: a Makefile and a loader are \r
+    //generated, the code is compiled and a shared library built.\r
+    ilib_for_link('fooc','fooc.o',[],"c") \r
+\r
+    // display the loader.sce file which calls link\r
+    mprintf('%s\n',mgetl('loader.sce')) \r
+    // load the shared library \r
+    exec loader.sce \r
+\r
+    link('show') \r
+    // call the new linked entry point\r
+    a=linspace(0,%pi,10);b=5;\r
+    y1=call('fooc',a,2,'d',b,3,'d',size(a,1),4,'i',size(a,2),5,'i','out',size(a),1,'d')\r
+    // check\r
+    y1-(sin(a)+b)\r
+    \r
+    ]]></EXAMPLE>\r
+  \r
+  <SEE_ALSO>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>call</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>external</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>c_link</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>addinter</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_for_link</LINK>\r
+    </SEE_ALSO_ITEM>\r
+    <SEE_ALSO_ITEM>\r
+      <LINK>ilib_build</LINK>\r
+    </SEE_ALSO_ITEM>\r
+\r
+  </SEE_ALSO>\r
+  \r
+</MAN>\r
diff --git a/scilab/modules/dynamic_link/help/en_US/with_lcc.xml b/scilab/modules/dynamic_link/help/en_US/with_lcc.xml
new file mode 100644 (file)
index 0000000..0e42a70
--- /dev/null
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<!DOCTYPE MAN SYSTEM "../../../../modules/helptools/help.dtd">\r
+<MAN>\r
+  <LANGUAGE>eng</LANGUAGE>\r
+  <TITLE>with_lcc</TITLE>\r
+  <TYPE>Scilab Function</TYPE>\r
+  <DATE>$LastChangedDate: 2006-08-30 13:26:08 +0200 (mer, 30 aoû 2006) $</DATE>\r
+  <SHORT_DESCRIPTION name="with_lcc">returns if LCC-Win32 is the default C Compiler.</SHORT_DESCRIPTION>\r
+\r
+  <CALLING_SEQUENCE>\r
+    <CALLING_SEQUENCE_ITEM>bOK=with_lcc()</CALLING_SEQUENCE_ITEM>\r
+  </CALLING_SEQUENCE>\r
+\r
+  <PARAM>\r
+    <PARAM_INDENT>\r
+      <PARAM_ITEM>\r
+        <PARAM_NAME>bOK</PARAM_NAME>\r
+\r
+        <PARAM_DESCRIPTION>\r
+          <SP>: returns %T if LCC-Win32 is the default C Compiler.</SP>\r
+        </PARAM_DESCRIPTION>\r
+      </PARAM_ITEM>\r
+    </PARAM_INDENT>\r
+  </PARAM>\r
+\r
+  <DESCRIPTION>\r
+    <P>checks if LCC-Win32 is the default C Compiler.</P>\r
+  </DESCRIPTION>\r
+\r
+  <EXAMPLE><![CDATA[bOK=with_lcc()]]></EXAMPLE>\r
+\r
+  <AUTHOR>Allan CORNET</AUTHOR>\r
+</MAN>
\ No newline at end of file
diff --git a/scilab/modules/dynamic_link/includes/AddFunctionInTable.h b/scilab/modules/dynamic_link/includes/AddFunctionInTable.h
new file mode 100644 (file)
index 0000000..a960173
--- /dev/null
@@ -0,0 +1,31 @@
+/*--------------------------------------------------------------------------*/\r
+/* INRIA 2008 */\r
+/*--------------------------------------------------------------------------*/\r
+#ifndef __ADDFUNCTIONINTABLE_H__\r
+#define __ADDFUNCTIONINTABLE_H__\r
+\r
+#include "machine.h"\r
+\r
+typedef void (*voidf)();\r
+\r
+/* structure entry in functions table */\r
+\r
+typedef struct {\r
+       char *name; /* function name */\r
+       voidf f; /* pointer on function */\r
+} FTAB;\r
+\r
+\r
+/**\r
+* Add a C or fortran function in functions hashtable\r
+*\r
+* @param name  function name\r
+* @param[OUT] rep  result 1 (OK) or 0 (Problem)\r
+* @param table functions hashtable\r
+* @return a pointer on function in functions hashtable\r
+*/\r
+voidf AddFunctionInTable (char *name, int *rep, FTAB *table);  \r
+\r
+#endif /* __ADDFUNCTIONINTABLE_H__ */\r
+/*--------------------------------------------------------------------------*/\r
+\r
diff --git a/scilab/modules/dynamic_link/includes/addinter.h b/scilab/modules/dynamic_link/includes/addinter.h
new file mode 100644 (file)
index 0000000..c63dfe6
--- /dev/null
@@ -0,0 +1,19 @@
+#ifndef __ADDINTER_H__\r
+#define  __ADDINTER_H__\r
+\r
+/** \r
+* the first dynamic interface is at position 500+1 \r
+*/\r
+#define DynInterfStart 500\r
+\r
+/**\r
+*\r
+*/\r
+void RemoveInterf(int Nshared);\r
+\r
+/**\r
+*\r
+*/\r
+int AddInterfaceToScilab(char *filenamelib,char *spname,char **fcts,int sizefcts);\r
+\r
+#endif /*  __ADDINTER_H__ */\r
diff --git a/scilab/modules/dynamic_link/includes/gw_dynamic_link.h b/scilab/modules/dynamic_link/includes/gw_dynamic_link.h
new file mode 100644 (file)
index 0000000..6c98794
--- /dev/null
@@ -0,0 +1,24 @@
+/*--------------------------------------------------------------------------*/\r
+/* INRIA 2008 */\r
+/* Allan CORNET */\r
+/*--------------------------------------------------------------------------*/ \r
+#ifndef __GW_DYNAMIC_LINK__\r
+#define __GW_DYNAMIC_LINK__\r
+/*--------------------------------------------------------------------------*/ \r
+#include "machine.h"\r
+/*--------------------------------------------------------------------------*/\r
+int C2F(gw_dynamic_link)(void);\r
+/*--------------------------------------------------------------------------*/\r
+/* Declaration of all the profile function declared and */\r
+/* used in sci_gateway */\r
+/*--------------------------------------------------------------------------*/ \r
+int C2F(sci_getdynlibext) _PARAMS((char *fname,unsigned long fname_len));\r
+int C2F(sci_addinter) _PARAMS((char *fname,unsigned long fname_len));\r
+int C2F(sci_fort) _PARAMS((char *fname,unsigned long fname_len));\r
+int C2F(sci_call) _PARAMS((char *fname,unsigned long fname_len));\r
+int C2F(sci_link) _PARAMS((char *fname,unsigned long fname_len));\r
+int C2F(sci_ulink) _PARAMS((char *fname,unsigned long fname_len));\r
+int C2F(sci_c_link) _PARAMS((char *fname,unsigned long fname_len));\r
+/*--------------------------------------------------------------------------*/ \r
+#endif /* __GW_DYNAMIC_LINK__ */\r
+/*--------------------------------------------------------------------------*/ \r
diff --git a/scilab/modules/dynamic_link/licence.txt b/scilab/modules/dynamic_link/licence.txt
new file mode 100644 (file)
index 0000000..24b39b4
--- /dev/null
@@ -0,0 +1,3 @@
+licence file\r
+\r
+INRIA 2008
\ No newline at end of file
diff --git a/scilab/modules/dynamic_link/locales/en_US/dynamic_link.pot b/scilab/modules/dynamic_link/locales/en_US/dynamic_link.pot
new file mode 100644 (file)
index 0000000..91e8ef6
--- /dev/null
@@ -0,0 +1,27 @@
+# Localization of the module dynamic_link\r
+# Please see in SCI/tools/localization for localization management\r
+# Copyright (C) 2007/2008 - INRIA / Scilab\r
+# This file is distributed under the same license as the Scilab package.\r
+# Sylvestre Ledru <sylvestre.ledru@inria.fr>, 2007/2008.\r
+#\r
+msgid ""\r
+msgstr ""\r
+"Project-Id-Version: Scilab\n"\r
+"Report-Msgid-Bugs-To: <localization@scilab.org>\n"\r
+"POT-Creation-Date: 2007-11-26 18:05+0100\n"\r
+"Last-Translator: Sylvestre Ledru <sylvestre.ledru@inria.fr>\n"\r
+"Language-Team: Scilab Localization <localization@scilab.org>\n"\r
+"MIME-Version: 1.0\n"\r
+"Content-Type: text/plain; charset=ISO-8859-1\n"\r
+"Content-Transfer-Encoding: 8bit\n"\r
+"Revision-Date: 2007-11-26 18:05+0100\n"\r
+\r
+# File: macros/ilib_for_link.sci, line: 129\r
+#, c-format\r
+msgid "configure : Generate Makefile in %s\n"\r
+msgstr ""\r
+#\r
+# File: macros/ilib_for_link.sci, line: 134\r
+#, c-format\r
+msgid "Copy compilation files (Makefile*, libtool...) to %s\n"\r
+msgstr ""\r
diff --git a/scilab/modules/dynamic_link/locales/fr_FR/incremental_link.po b/scilab/modules/dynamic_link/locales/fr_FR/incremental_link.po
new file mode 100644 (file)
index 0000000..f750f3a
--- /dev/null
@@ -0,0 +1,28 @@
+# Localization of the module dynamic_link\r
+# Please see in SCI/tools/localization for localization management\r
+# Copyright (C) 2007/2008 - INRIA / Scilab\r
+# This file is distributed under the same license as the Scilab package.\r
+# Sylvestre Ledru <sylvestre.ledru@inria.fr>, 2007/2008.\r
+#\r
+msgid ""\r
+msgstr ""\r
+"Project-Id-Version: Scilab\n"\r
+"Report-Msgid-Bugs-To: <localization@scilab.org>\n"\r
+"POT-Creation-Date: 2007-11-26 18:05+0100\n"\r
+"Last-Translator: Sylvestre Ledru <sylvestre.ledru@inria.fr>\n"\r
+"Language-Team: Scilab Localization <localization@scilab.org>\n"\r
+"MIME-Version: 1.0\n"\r
+"Content-Type: text/plain; charset=ISO-8859-1\n"\r
+"Content-Transfer-Encoding: 8bit\n"\r
+"Revision-Date: 2007-11-26 18:05+0100\n"\r
+\r
+# File: macros/ilib_for_link.sci, line: 129\r
+#, c-format\r
+msgid "configure : Generate Makefile in %s\n"\r
+msgstr ""\r
+\r
+#\r
+# File: macros/ilib_for_link.sci, line: 134\r
+#, c-format\r
+msgid "Copy compilation files (Makefile*, libtool...) to %s\n"\r
+msgstr ""\r
diff --git a/scilab/modules/dynamic_link/macros/G_make.sci b/scilab/modules/dynamic_link/macros/G_make.sci
new file mode 100644 (file)
index 0000000..1ffb9d7
--- /dev/null
@@ -0,0 +1,37 @@
+//-----------------------------------------------------------------------------\r
+function [res]=G_make(files,objects_or_dll)\r
+// Copyright INRIA\r
+// Updated by Allan CORNET INRIA 2006\r
+// call make for target files or objects depending \r
+// on OS and compilers\r
+//-----------------------------------------------------------------------------\r
+  if getenv('WIN32','NO')=='OK' then \r
+    if typeof(objects_or_dll)<>'string' then \r
+      error('G_make: objects must be a string');\r
+      return;\r
+    end \r
+    if with_lcc() ==%T then\r
+      host('make -f Makefile.lcc '+objects_or_dll);\r
+    elseif COMPILER=='VC++' then \r
+      // scilab was build with VC++ \r
+      vcvompilerversion=findmsvccompiler();\r
+      if (vcvompilerversion=='msvc80express') | (vcvompilerversion=='msvc80pro') | (vcvompilerversion=='msvc80std') then\r
+        host('nmake /Y /nologo /f Makefile.mak '+objects_or_dll);\r
+      else\r
+        host('nmake /nologo /f Makefile.mak '+objects_or_dll);\r
+      end\r
+      \r
+    else  \r
+      // Scilab was built with gcwin32 \r
+      host('make '+objects_or_dll);\r
+    end\r
+    res=[objects_or_dll];\r
+  else \r
+    mk=[]\r
+    for x=files(:)', if strindex(x,'-l')==[], mk=mk+' '+x ; end ;end \r
+    host('make '+ mk);\r
+    res=files ;\r
+  end \r
+  \r
+endfunction\r
+//-----------------------------------------------------------------------------\r
diff --git a/scilab/modules/dynamic_link/macros/VCtoLCCLib.sci b/scilab/modules/dynamic_link/macros/VCtoLCCLib.sci
new file mode 100644 (file)
index 0000000..90d7ab2
--- /dev/null
@@ -0,0 +1,83 @@
+//-------------------------------------------------------------------\r
+// Allan CORNET INRIA 2004 - 2006\r
+// Export LibScilab for LCC compiler\r
+//-------------------------------------------------------------------\r
+function VCtoLCCLib()\r
+if with_lcc()==%t then\r
+       if MSDOS==%t then\r
+               DirCur=pwd();\r
+               chdir(WSCI+'\bin');\r
+               mkdir('lcclib');\r
+       \r
+               Exportalibrary('LibScilab');\r
+               ExportAtlasLibrary();\r
+               Exportalibrary('lapack');\r
+               Exportalibrary('scicos');\r
+               Exportalibrary('libf2c');\r
+               Exportalibrary('intersci');\r
+       \r
+               chdir(DirCur);\r
+       end\r
+end\r
+endfunction\r
+//-------------------------------------------------------------------\r
+function bOK=Exportalibrary(libraryname)\r
+  printf('\nExports from '+libraryname+'.dll\n');\r
+       unix('pedump /exp '+libraryname+'.dll >'+TMPDIR+filesep()+libraryname+'.lcc');\r
+       printf('Converting Library');\r
+       \r
+       fw=mopen(TMPDIR+filesep()+libraryname+'.exp',"w");\r
+       fr=mopen(TMPDIR+filesep()+libraryname+'.lcc',"r");\r
+       \r
+       if (meof(fr) == 0) then \r
+               line=mfscanf(1,fr,"%s");\r
+               mfprintf(fw,"%s\n",line);\r
+               printf('.');\r
+       end\r
+\r
+       while ( meof(fr) == 0)\r
+               line=mfscanf(1,fr,"%s");\r
+               if (line ~= []) then\r
+                       mfprintf(fw,"_%s\n",line);\r
+               end\r
+       end\r
+\r
+       mclose(fw);\r
+       mclose(fr);\r
+       \r
+       printf('\nBuild '+libraryname+'.lib (Please waiting).\n');\r
+       command='buildLib ""'+TMPDIR+filesep()+libraryname+'.exp""'+' ""'+WSCI+'\bin\lcclib\'+libraryname+'.lib""';\r
+       unix(command);\r
+       bOK=%T;\r
+endfunction\r
+//-------------------------------------------------------------------\r
+function ExportAtlasLibrary()\r
+       \r
+       printf('\nExports from blasplus.dll\n')\r
+       unix('pedump /exp blasplus.dll >'+TMPDIR+'\blasplus.lcc');\r
+       printf('Converting Library');\r
+       \r
+       fw=mopen(TMPDIR+'\blaspluslcc.exp',"w");\r
+       fr=mopen(TMPDIR+'\blasplus.lcc',"r");\r
+\r
+       if (meof(fr) == 0) then \r
+               line=mfscanf(1,fr,"%s");\r
+               mfprintf(fw,"blasplus.dll\n");\r
+       end\r
+\r
+       i=1;\r
+       while ( meof(fr) == 0)\r
+               line=mfscanf(1,fr,"%s");\r
+               if (line ~= []) then\r
+                       mfprintf(fw,"_%s_  %s @%d\n",line,line,i);\r
+                       i=i+1;\r
+                       end\r
+       end\r
+\r
+       mclose(fw);\r
+       mclose(fr);\r
+       \r
+       printf('\nBuild Atlas.lib\n');\r
+       unix('buildLib ""'+TMPDIR+'\Atlaslcc.exp""'+' ""'+WSCI+'\bin\lcclib\'+'blasplus.lib""');\r
+endfunction\r
+//-------------------------------------------------------------------\r
diff --git a/scilab/modules/dynamic_link/macros/buildmacros.bat b/scilab/modules/dynamic_link/macros/buildmacros.bat
new file mode 100644 (file)
index 0000000..c4e35ec
--- /dev/null
@@ -0,0 +1 @@
+@..\..\..\bin\scilex -nwni -ns -e exec('buildmacros.sce');quit;
\ No newline at end of file
diff --git a/scilab/modules/dynamic_link/macros/buildmacros.sce b/scilab/modules/dynamic_link/macros/buildmacros.sce
new file mode 100644 (file)
index 0000000..608f821
--- /dev/null
@@ -0,0 +1,9 @@
+//------------------------------------\r
+// Allan CORNET INRIA 2006\r
+//------------------------------------\r
+if (isdef('genlib') == %f) then\r
+  exec(SCI+'/modules/functions/scripts/buildmacros/loadgenlib.sce');\r
+end\r
+//------------------------------------\r
+genlib('dynamic_linklib','SCI/modules/dynamic_link/macros',%f,%t);\r
+//------------------------------------\r
diff --git a/scilab/modules/dynamic_link/macros/chooselcccompiler.sci b/scilab/modules/dynamic_link/macros/chooselcccompiler.sci
new file mode 100644 (file)
index 0000000..80415c7
--- /dev/null
@@ -0,0 +1,15 @@
+//-----------------------------------------------------------------------------\r
+// Allan CORNET\r
+// INRIA 2007\r
+// force to use LCC-Win32 compiler\r
+//-----------------------------------------------------------------------------\r
+function res=chooselcccompiler()\r
+  res=findlcccompiler();\r
+  if (res) then\r
+    global LCC;\r
+    LCC=res;\r
+    clear LCC;\r
+  end\r
+  configure_lcc();\r
+endfunction\r
+//-----------------------------------------------------------------------------
\ No newline at end of file
diff --git a/scilab/modules/dynamic_link/macros/cleanmacros.bat b/scilab/modules/dynamic_link/macros/cleanmacros.bat
new file mode 100644 (file)
index 0000000..fbd90e5
--- /dev/null
@@ -0,0 +1,3 @@
+@del *.bin 2>NUL\r
+@del lib 2>NUL\r
+@del names 2>NUL
\ No newline at end of file
diff --git a/scilab/modules/dynamic_link/macros/configure_lcc.sci b/scilab/modules/dynamic_link/macros/configure_lcc.sci
new file mode 100644 (file)
index 0000000..3348463
--- /dev/null
@@ -0,0 +1,30 @@
+//-----------------------------------------------------------------------------\r
+// Allan CORNET\r
+// INRIA 2007\r
+//-----------------------------------------------------------------------------\r
+function bOK=configure_lcc()\r
+  if MSDOS then\r
+    try\r
+      lccincludepath=winqueryreg('HKEY_CURRENT_USER','Software\lcc\compiler','includepath');\r
+      lcclibpath=winqueryreg('HKEY_CURRENT_USER','Software\lcc\lcclnk','libpath');\r
+      index=strindex(lccincludepath,filesep());\r
+      szindex=size(index);\r
+      lccbasepath=part(lccincludepath,[1:index(szindex(2))]);\r
+      lccbinpath=lccbasepath+'bin';\r
+      lccexe=lccbinpath+'\lcc.exe';\r
+      if (fileinfo(lccexe)<>[]) then\r
+        PATH=getenv('PATH');\r
+        NEWPATH=lccbinpath+';'+lccincludepath+';'+lcclibpath+';'+PATH;\r
+        setenv('PATH',NEWPATH);\r
+        bOK=%T;\r
+      else\r
+        bOK=%F;\r
+      end\r
+    catch\r
+      bOK=%F;\r
+    end\r
+  else  \r
+    bOK=%F;\r
+  end\r
+endfunction\r
+//-----------------------------------------------------------------------------\r
diff --git a/scilab/modules/dynamic_link/macros/configure_msvc.sci b/scilab/modules/dynamic_link/macros/configure_msvc.sci
new file mode 100644 (file)
index 0000000..60b92d1
--- /dev/null
@@ -0,0 +1,380 @@
+//-----------------------------------------------------------------------------\r
+// Allan CORNET\r
+// INRIA 2005\r
+//-----------------------------------------------------------------------------\r
+function bOK=configure_msvc()\r
+if MSDOS then\r
+  msvc=findmsvccompiler();\r
+  select msvc,\r
+  case 'msvc80pro' then\r
+      bOK=setmsvc80pro()\r
+  case 'msvc80std' then\r
+      bOK=setmsvc80std()    \r
+  case 'msvc90express' then\r
+      bOK=setmsvc90express()      \r
+  case 'msvc80express' then\r
+      bOK=setmsvc80express()\r
+  case 'msvc71' then\r
+      bOK=setmsvc71()\r
+  case 'msvc70' then\r
+      bOK=setmsvc70()\r
+  case 'msvc60' then\r
+      bOK=setmsvc60()\r
+  case 'msvc50' then\r
+      bOK=setmsvc50()\r
+  else\r
+      //disp('Warning Ms Visual C Compiler not found.');\r
+      bOK=%F;\r
+  end\r
+else\r
+  bOK=%F;\r
+end\r
+endfunction\r
+//-----------------------------------------------------------------------------\r
+function bOK=setmsvc80pro()\r
+if MSDOS then\r
+  MSVSDir=winqueryreg('HKEY_LOCAL_MACHINE','Software\Microsoft\VisualStudio\8.0\Setup\VS\Pro','ProductDir');\r
+  if ( part(MSVSDir,length(MSVSDir)) == filesep() ) then MSVSDir=part(MSVSDir,1:length(MSVSDir)-1);end;\r
+  \r
+  err=setenv('VSINSTALLDIR',MSVSDir);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  MSVCDir=MSVSDir+'\VC';\r
+  err=setenv('VCINSTALLDIR',MSVCDir);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  DevEnvDir=MSVSDir+'\Common7\IDE';\r
+  err=setenv('DevEnvDir',DevEnvDir);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  PATH=getenv('PATH','ndef');\r
+  if (PATH =='ndef') then  bOK=%F,return,end\r
+  \r
+  err=setenv('PATH',DevEnvDir+';'+MSVCDir+'\bin;'+MSVSDir+'\Common7\Tools;'+MSVSDir+'\SDK\v2.0\bin;'+MSVCDir+'\VCPackages;'+PATH+";"+WSCI+"\bin;");\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  INCLUDE=getenv('INCLUDE','');  \r
+  INCLUDE=MSVCDir+'\INCLUDE;'+MSVCDir+'\PlatformSDK\include;'+MSVSDir+'\SDK\v2.0\include';\r
+    \r
+  err=setenv("INCLUDE",INCLUDE);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  LIB=getenv('LIB','');  \r
+  LIB=MSVCDir+'\LIB;'+MSVSDir+'\SDK\v2.0\lib;'+MSVSDir+'\VC\PlatformSDK\lib;'+LIB;\r
+  err=setenv("LIB",LIB);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  err=setenv("USE_MT","-MT");\r
+  if (err == %F) then bOK=%F,return,end\r
+    \r
+  bOK=%T\r
+else\r
+  bOK=%F;\r
+end\r
+endfunction\r
+//-----------------------------------------------------------------------------\r
+function bOK=setmsvc80std()\r
+if MSDOS then\r
+  MSVSDir=winqueryreg('HKEY_LOCAL_MACHINE','Software\Microsoft\VisualStudio\8.0\Setup\VS\Std','ProductDir');\r
+  if ( part(MSVSDir,length(MSVSDir)) == filesep() ) then MSVSDir=part(MSVSDir,1:length(MSVSDir)-1);end;\r
+  \r
+  err=setenv('VSINSTALLDIR',MSVSDir);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  MSVCDir=MSVSDir+'\VC';\r
+  err=setenv('VCINSTALLDIR',MSVCDir);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  DevEnvDir=MSVSDir+'\Common7\IDE';\r
+  err=setenv('DevEnvDir',DevEnvDir);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  PATH=getenv('PATH','ndef');\r
+  if (PATH =='ndef') then  bOK=%F,return,end\r
+  \r
+  err=setenv('PATH',DevEnvDir+';'+MSVCDir+'\bin;'+MSVSDir+'\Common7\Tools;'+MSVSDir+'\SDK\v2.0\bin;'+MSVCDir+'\VCPackages;'+PATH+";"+WSCI+"\bin;");\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  INCLUDE=getenv('INCLUDE','');  \r
+  INCLUDE=MSVCDir+'\INCLUDE;'+MSVCDir+'\PlatformSDK\include;'+MSVSDir+'\SDK\v2.0\include';\r
+  err=setenv("INCLUDE",INCLUDE);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  LIB=getenv('LIB','');  \r
+  LIB=MSVCDir+'\LIB;'+MSVSDir+'\SDK\v2.0\lib;'+MSVSDir+'\VC\PlatformSDK\lib;'+LIB;\r
+  err=setenv("LIB",LIB);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  err=setenv("USE_MT","-MT");\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  bOK=%T\r
+else\r
+  bOK=%F;\r
+end\r
+endfunction\r
+//-----------------------------------------------------------------------------\r
+function bOK=setmsvc80express()\r
+if MSDOS then\r
+  MSVSDir=winqueryreg('HKEY_LOCAL_MACHINE','Software\Microsoft\VCExpress\8.0\Setup\VS','ProductDir');\r
+  if ( part(MSVSDir,length(MSVSDir)) == filesep() ) then MSVSDir=part(MSVSDir,1:length(MSVSDir)-1);end;\r
+  \r
+  err=setenv('VSINSTALLDIR',MSVSDir);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  MSVCDir=MSVSDir+'\VC';\r
+  err=setenv('VCINSTALLDIR',MSVCDir);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  DevEnvDir=MSVSDir+'\Common7\IDE';\r
+  err=setenv('DevEnvDir',DevEnvDir);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  PATH=getenv('PATH','ndef');\r
+  if (PATH =='ndef') then  bOK=%F,return,end\r
+  \r
+  err=setenv('PATH',DevEnvDir+';'+MSVCDir+'\bin;'+MSVSDir+'\Common7\Tools;'+MSVSDir+'\SDK\v2.0\bin;'+MSVCDir+'\VCPackages;'+PATH+";"+WSCI+"\bin;");\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  ierr1=execstr("VISTASDK=winqueryreg(''HKEY_LOCAL_MACHINE'',''Software\Microsoft\Microsoft SDKs\Windows'',''CurrentInstallFolder'');","errcatch");  \r
+  ierr2=execstr("W2003R2SDK=winqueryreg(''HKEY_LOCAL_MACHINE'',''Software\Microsoft\MicrosoftSDK\InstalledSDKs\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1'',''Install Dir'');","errcatch");\r
+  ierr3=execstr("W2003SDK=winqueryreg(''HKEY_LOCAL_MACHINE'',''Software\Microsoft\MicrosoftSDK\InstalledSDKs\8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3'',''Install Dir'');","errcatch");\r
+  \r
+  if (ierr1 == 0) then\r
+    WINDOWSSDK = winqueryreg('HKEY_LOCAL_MACHINE','Software\Microsoft\Microsoft SDKs\Windows','CurrentInstallFolder');\r
+    lasterror(%T); // The error message is cleared\r
+  else \r
+    if (ierr2 == 0) then\r
+      WINDOWSSDK = winqueryreg('HKEY_LOCAL_MACHINE','Software\Microsoft\MicrosoftSDK\InstalledSDKs\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1','Install Dir');\r
+      lasterror(%T); // The error message is cleared\r
+    else\r
+      if (ierr3 == 0) then\r
+        WINDOWSSDK = winqueryreg('HKEY_LOCAL_MACHINE','Software\Microsoft\MicrosoftSDK\InstalledSDKs\8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3','Install Dir');\r
+        lasterror(%T); // The error message is cleared\r
+      end\r
+    end\r
+  end\r
+  \r
+  INCLUDE=getenv('INCLUDE','');  \r
+  INCLUDE=MSVCDir+'\INCLUDE;'+WINDOWSSDK+'INCLUDE;'\r
+  err=setenv("INCLUDE",INCLUDE);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  LIB=getenv('LIB',''); \r
+  LIB=MSVCDir+'\LIB;'+MSVSDir+'\SDK\v2.0\lib;'+WINDOWSSDK+'Lib;'+LIB;\r
+  err=setenv("LIB",LIB);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  err=setenv("USE_MT","-MT");\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  bOK=%T\r
+else\r
+  bOK=%F;\r
+end\r
+endfunction\r
+//-----------------------------------------------------------------------------\r
+function bOK=setmsvc90express()\r
+if MSDOS then\r
+  MSVSDir=winqueryreg('HKEY_LOCAL_MACHINE','Software\Microsoft\VCExpress\9.0\Setup\VS','ProductDir');\r
+  if ( part(MSVSDir,length(MSVSDir)) == '\' ) then MSVSDir=part(MSVSDir,1:length(MSVSDir)-1);end;\r
+  \r
+  err=setenv('VSINSTALLDIR',MSVSDir);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  MSVCDir=MSVSDir+'\VC';\r
+  err=setenv('VCINSTALLDIR',MSVCDir);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  DevEnvDir=MSVSDir+'\Common7\IDE';\r
+  err=setenv('DevEnvDir',DevEnvDir);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  PATH=getenv('PATH','ndef');\r
+  if (PATH =='ndef') then  bOK=%F,return,end\r
+  \r
+  err=setenv('PATH',DevEnvDir+';'+MSVCDir+'\bin;'+MSVSDir+'\Common7\Tools;'+MSVSDir+'\SDK\v2.0\bin;'+MSVCDir+'\VCPackages;'+PATH+";"+WSCI+"\bin;");\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  ierr1=execstr("VISTASDK=winqueryreg(''HKEY_LOCAL_MACHINE'',''Software\Microsoft\Microsoft SDKs\Windows'',''CurrentInstallFolder'');","errcatch");  \r
+  ierr2=execstr("W2003R2SDK=winqueryreg(''HKEY_LOCAL_MACHINE'',''Software\Microsoft\MicrosoftSDK\InstalledSDKs\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1'',''Install Dir'');","errcatch");\r
+  ierr3=execstr("W2003SDK=winqueryreg(''HKEY_LOCAL_MACHINE'',''Software\Microsoft\MicrosoftSDK\InstalledSDKs\8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3'',''Install Dir'');","errcatch");\r
+  \r
+  if (ierr1 == 0) then\r
+    WINDOWSSDK = winqueryreg('HKEY_LOCAL_MACHINE','Software\Microsoft\Microsoft SDKs\Windows','CurrentInstallFolder');\r
+    lasterror(%T); // The error message is cleared\r
+  else \r
+    if (ierr2 == 0) then\r
+      WINDOWSSDK = winqueryreg('HKEY_LOCAL_MACHINE','Software\Microsoft\MicrosoftSDK\InstalledSDKs\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1','Install Dir');\r
+      lasterror(%T); // The error message is cleared\r
+    else\r
+      if (ierr3 == 0) then\r
+        WINDOWSSDK = winqueryreg('HKEY_LOCAL_MACHINE','Software\Microsoft\MicrosoftSDK\InstalledSDKs\8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3','Install Dir');\r
+        lasterror(%T); // The error message is cleared\r
+      end\r
+    end\r
+  end\r
+  \r
+  INCLUDE=getenv('INCLUDE','');  \r
+  INCLUDE=MSVCDir+'\INCLUDE;'+WINDOWSSDK+'INCLUDE;'\r
+  err=setenv("INCLUDE",INCLUDE);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  LIB=getenv('LIB',''); \r
+  LIB=MSVCDir+'\LIB;'+MSVSDir+'\SDK\v2.0\lib;'+WINDOWSSDK+'Lib;'+LIB;\r
+  err=setenv("LIB",LIB);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  err=setenv("USE_MT","-MT");\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  bOK=%T\r
+else\r
+  bOK=%F;\r
+end\r
+endfunction\r
+//-----------------------------------------------------------------------------\r
+function bOK=setmsvc71()\r
+if MSDOS then\r
+  MSVCDir=winqueryreg('HKEY_LOCAL_MACHINE','SOFTWARE\Microsoft\VisualStudio\7.1\Setup\VC','ProductDir')\r
+  if ( part(MSVCDir,length(MSVCDir)) == filesep() ) then MSVCDir=part(MSVCDir,1:length(MSVCDir)-1),end;\r
+\r
+  err=setenv('MSVCDir',MSVCDir);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  err=setenv("DevEnvDir",MSVCDir+"\..\Common7\Tools");\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  PATH=getenv('PATH','ndef');\r
+  if (PATH =='ndef') then  bOK=%F,return,end\r
+\r
+  DevEnvDir=getenv('DevEnvDir','ndef');\r
+  if (DevEnvDir =='ndef') then bOK=%F,return,end\r
+  \r
+  err=setenv("PATH",MSVCDir+"\BIN;"+DevEnvDir+";"+DevEnvDir+"\bin;"+MSVCDir+"\..\Common7\IDE;"+PATH+";"+WSCI+"\bin;");\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  INCLUDE=getenv('INCLUDE','');\r
+    \r
+  err=setenv("INCLUDE",MSVCDir+"\ATLMFC\INCLUDE;"+MSVCDir+"\INCLUDE;"+MSVCDir+"\PlatformSDK\include;"+INCLUDE);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  LIB=getenv('LIB','ndef');\r
+    \r
+  err=setenv("LIB",MSVCDir+"\ATLMFC\LIB;"+MSVCDir+"\LIB;"+MSVCDir+"\PlatformSDK\lib;"+LIB);\r
+  if (err == %F) then bOK=%F,return,end\r
+\r
+  bOK=%T\r
+else\r
+  bOK=%F;\r
+end\r
+endfunction\r
+//-----------------------------------------------------------------------------\r
+function bOK=setmsvc70()\r
+if MSDOS then\r
+  MSVCDir=winqueryreg('HKEY_LOCAL_MACHINE','SOFTWARE\Microsoft\VisualStudio\7.0\Setup\VC','ProductDir');\r
+  if ( part(MSVCDir,length(MSVCDir)) == filesep() ) then MSVCDir=part(MSVCDir,1:length(MSVCDir)-1),end;\r
+  \r
+  err=setenv('MSVCDir',MSVCDir);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  err=setenv("DevEnvDir",MSVCDir+"\..\Common7\Tools");\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  DevEnvDir=getenv('DevEnvDir','ndef');\r
+  if (DevEnvDir =='ndef') then bOK=%F,return,end\r
+  \r
+  PATH=getenv('PATH','ndef');\r
+  if (PATH =='ndef') then  bOK=%F,return,end\r
+  \r
+  err=setenv("PATH",MSVCDir+"\BIN;"+DevEnvDir+";"+DevEnvDir+"\bin;"+MSVCDir+"\..\Common7\IDE;"+PATH+";"+SCI+"\bin;");\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  INCLUDE=getenv('INCLUDE','');\r
+    \r
+  err=setenv("INCLUDE",MSVCDir+"\ATLMFC\INCLUDE;"+MSVCDir+"\INCLUDE;"+MSVCDir+"\PlatformSDK\include;"+INCLUDE);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  LIB=getenv('LIB','');\r
+    \r
+  err=setenv("LIB",MSVCDir+"\ATLMFC\LIB;"+MSVCDir+"\LIB;"+MSVCDir+"\PlatformSDK\lib;"+LIB);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  bOK=%T\r
+else\r
+  bOK=%F;\r
+end\r
+endfunction\r
+//-----------------------------------------------------------------------------\r
+function bOK=setmsvc60()\r
+if MSDOS then\r
+  MSVCDir=winqueryreg('HKEY_LOCAL_MACHINE','SOFTWARE\Microsoft\DevStudio\6.0\Products\Microsoft Visual C++','ProductDir');\r
+  if ( part(MSVCDir,length(MSVCDir)) == filesep() ) then MSVCDir=part(MSVCDir,1:length(MSVCDir)-1),end;\r
+  \r
+  err=setenv('MSVCDir',MSVCDir);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  err=setenv("MSDevDir",MSVCDir+"\..\Common\msdev98");\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  MSDevDir=getenv('MSDevDir','ndef');\r
+  if (MSDevDir =='ndef') then bOK=%F,return,end\r
+  \r
+  PATH=getenv('PATH','ndef');\r
+  if (PATH =='ndef') then  bOK=%F,return,end\r
+\r
+  err=setenv("PATH",MSVCDir+'\BIN;'+MSDevDir+'\bin;'+';'+WSCI+'\bin;'+PATH);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  INCLUDE=getenv('INCLUDE','');\r
+  \r
+       err=setenv("INCLUDE",MSVCDir+'\INCLUDE;'+MSVCDir+'\MFC\INCLUDE;'+MSVCDir+'\ATL\INCLUDE;'+INCLUDE);\r
+       if (err == %F) then bOK=%F,return,end\r
+       \r
+       LIB=getenv('LIB','');\r
+    \r
+  err=setenv("LIB",MSVCDir+'\LIB;'+MSVCDir+'\MFC\LIB;'+LIB);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  bOK=%T\r
+else\r
+  bOK=%F;\r
+end\r
+endfunction\r
+//-----------------------------------------------------------------------------\r
+function bOK=setmsvc50()\r
+if MSDOS then\r
+  MSVCDir=winqueryreg('HKEY_LOCAL_MACHINE','SOFTWARE\Microsoft\DevStudio\5.0\Directories','ProductDir');\r
+  if ( part(MSVCDir,length(MSVCDir)) == filesep() ) then MSVCDir=part(MSVCDir,1:length(MSVCDir)-1),end;\r
+  \r
+  err=setenv('MSVCDir',MSVCDir);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  err=setenv("MSDevDir",MSVCDir+"\..\sharedIDE");\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  MSDevDir=getenv('MSDevDir','ndef');\r
+  if (MSDevDir =='ndef') then bOK=%F,return,end\r
+  \r
+  PATH=getenv('PATH','ndef');\r
+  if (PATH =='ndef') then  bOK=%F,return,end\r
+  \r
+  err=setenv("PATH",MSVCDir+'\BIN;'+MSDevDir+'\bin;'+';'+WSCI+'\bin;'+PATH);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  INCLUDE=getenv('INCLUDE','');\r
+  \r
+       err=setenv("INCLUDE",MSVCDir+'\INCLUDE;'+MSVCDir+'\MFC\INCLUDE;'+MSVCDir+'\ATL\INCLUDE;'+INCLUDE);\r
+       if (err == %F) then bOK=%F,return,end\r
+       \r
+       LIB=getenv('LIB','');\r
+    \r
+  err=setenv("LIB",MSVCDir+'\LIB;'+MSVCDir+'\MFC\LIB;'+LIB);\r
+  if (err == %F) then bOK=%F,return,end\r
+  \r
+  bOK=%T\r
+else\r
+  bOK=%F;\r
+end\r
+endfunction\r
+//-----------------------------------------------------------------------------\r
diff --git a/scilab/modules/dynamic_link/macros/findlcccompiler.sci b/scilab/modules/dynamic_link/macros/findlcccompiler.sci
new file mode 100644 (file)
index 0000000..e9ba600
--- /dev/null
@@ -0,0 +1,28 @@
+//-----------------------------------------------------------------------------\r
+// Allan CORNET\r
+// INRIA 2007\r
+// Detect LCC-Win32 compiler\r
+//-----------------------------------------------------------------------------\r
+function res=findlcccompiler()\r
+  if MSDOS then\r
+    res=%F;\r
+    try\r
+      winqueryreg('HKEY_CURRENT_USER','Software\lcc\compiler','includepath')\r
+      res=%T;\r
+    catch\r
+      res=%F;\r
+    end\r
+    if (res) then\r
+      try\r
+        winqueryreg('HKEY_CURRENT_USER','Software\lcc\lcclnk','libpath')\r
+        res=%T;\r
+      catch\r
+        res=%F;\r
+      end\r
+    end\r
+  else\r
+    res=%F\r
+  end\r
+endfunction\r
+//-----------------------------------------------------------------------------\r
+\r
diff --git a/scilab/modules/dynamic_link/macros/findmsvccompiler.sci b/scilab/modules/dynamic_link/macros/findmsvccompiler.sci
new file mode 100644 (file)
index 0000000..554cfd2
--- /dev/null
@@ -0,0 +1,98 @@
+//-----------------------------------------------------------------------------\r
+// Allan CORNET\r
+// INRIA 2005\r
+//-----------------------------------------------------------------------------\r
+function MSCompiler=findmsvccompiler()\r
+  \r
+  MSCompiler='unknown'; // unknown\r
+  \r
+  if MSDOS then\r
+    ierr=-1;\r
+    \r
+    ierr=execstr("MSVS80Pro=winqueryreg(''HKEY_LOCAL_MACHINE'',''Software\Microsoft\VisualStudio\8.0\Setup\VS\Pro'',''ProductDir'');","errcatch");\r
+    if (ierr == 0) then \r
+      MSCompiler='msvc80pro'; // Microsoft Visual 2005 Studio Professional\r
+      return;\r
+    else\r
+      lasterror(%T); // The error message is cleared\r
+    end\r
+    \r
+    ierr=execstr("MSVS80std=winqueryreg(''HKEY_LOCAL_MACHINE'',''Software\Microsoft\VisualStudio\8.0\Setup\VS\Std'',''ProductDir'');","errcatch");\r
+    if (ierr == 0) then \r
+      MSCompiler='msvc80std'; // Microsoft Visual 2005 Studio Standard\r
+      return;\r
+    else\r
+      lasterror(%T); // The error message is cleared\r
+    end\r
+    \r
+    ierr=execstr("MSVS71=winqueryreg(''HKEY_LOCAL_MACHINE'',''SOFTWARE\Microsoft\VisualStudio\7.1\Setup\VC'',''ProductDir'');","errcatch");\r
+    if (ierr == 0) then\r
+      MSCompiler='msvc71'; // Microsoft Visual Studio .NET 2003\r
+      return;\r
+    else\r
+      lasterror(%T); // The error message is cleared\r
+    end\r
+   \r
+    ierr=execstr("MSVS70=winqueryreg(''HKEY_LOCAL_MACHINE'',''SOFTWARE\Microsoft\VisualStudio\7.0\Setup\VC'',''ProductDir'');","errcatch");\r
+    if (ierr == 0) then\r
+      MSCompiler='msvc70';  // Microsoft Visual Studio .NET 2002\r
+      return;\r
+    else\r
+      lasterror(%T); // The error message is cleared\r
+    end\r
+    \r
+    ierr=execstr("MSVS80EXPRESS=winqueryreg(''HKEY_LOCAL_MACHINE'',''Software\Microsoft\VCExpress\8.0\Setup\VS'',''ProductDir'');","errcatch");\r
+    if (ierr == 0) then \r
+      ierr1=execstr("W2003R2SDK=winqueryreg(''HKEY_LOCAL_MACHINE'',''Software\Microsoft\MicrosoftSDK\InstalledSDKs\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1'',''Install Dir'');","errcatch");\r
+      ierr2=execstr("W2003SDK=winqueryreg(''HKEY_LOCAL_MACHINE'',''Software\Microsoft\MicrosoftSDK\InstalledSDKs\8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3'',''Install Dir'');","errcatch");\r
+      ierr3=execstr("VISTASDK=winqueryreg(''HKEY_LOCAL_MACHINE'',''Software\Microsoft\Microsoft SDKs\Windows'',''CurrentInstallFolder'');","errcatch");\r
+      if ( (ierr1 == 0) | (ierr2 == 0) | (ierr3 == 0) ) then \r
+        MSCompiler='msvc80express'; // Microsoft Visual C++ Express 8.0\r
+        lasterror(%T); // The error message is cleared\r
+        return;\r
+      else\r
+        printf('\nWarning : Microsoft Visual C++ 2005 Express Edition has been detected,\nbut not Microsoft Platform SDK for Windows Server 2003 R2 or more.\nPlease install this SDK if you want to use dynamic link with scilab.\n');\r
+        lasterror(%T); // The error message is cleared\r
+      end\r
+    else\r
+      lasterror(%T); // The error message is cleared\r
+    end\r
+    \r
+    ierr=execstr("MSVS90EXPRESS=winqueryreg(''HKEY_LOCAL_MACHINE'',''Software\Microsoft\VCExpress\9.0\Setup\VS'',''ProductDir'');","errcatch");\r
+    if (ierr == 0) then \r
+      ierr1=execstr("W2003R2SDK=winqueryreg(''HKEY_LOCAL_MACHINE'',''Software\Microsoft\MicrosoftSDK\InstalledSDKs\D2FF9F89-8AA2-4373-8A31-C838BF4DBBE1'',''Install Dir'');","errcatch");\r
+      ierr2=execstr("W2003SDK=winqueryreg(''HKEY_LOCAL_MACHINE'',''Software\Microsoft\MicrosoftSDK\InstalledSDKs\8F9E5EF3-A9A5-491B-A889-C58EFFECE8B3'',''Install Dir'');","errcatch");\r
+      ierr3=execstr("VISTASDK=winqueryreg(''HKEY_LOCAL_MACHINE'',''Software\Microsoft\Microsoft SDKs\Windows'',''CurrentInstallFolder'');","errcatch");\r
+      if ( (ierr1 == 0) | (ierr2 == 0) | (ierr3 == 0) ) then \r
+        MSCompiler='msvc90express'; // Microsoft Visual C++ Express 9.0\r
+        lasterror(%T); // The error message is cleared\r
+        return;\r
+      else\r
+        printf('\nWarning : Microsoft Visual C++ 2008 Express Edition has been detected,\nbut not Microsoft Platform SDK for Windows Server 2003 R2 or more.\nPlease install this SDK if you want to use dynamic link with scilab.\n');\r
+        lasterror(%T); // The error message is cleared\r
+      end\r
+    else\r
+      lasterror(%T); // The error message is cleared\r
+               end      \r
+    \r
+    ierr=execstr("MSVS60=winqueryreg(''HKEY_LOCAL_MACHINE'',''SOFTWARE\Microsoft\DevStudio\6.0\Products\Microsoft Visual C++'',''ProductDir'');","errcatch");\r
+    if (ierr == 0) then\r
+      MSCompiler='msvc60';  // Microsoft Visual Studio 6\r
+      return;\r
+    else\r
+      lasterror(%T); // The error message is cleared\r
+    end\r
+    \r
+    ierr=execstr("MSVS50=winqueryreg(''HKEY_LOCAL_MACHINE'',''SOFTWARE\Microsoft\DevStudio\5.0\Directories'',''ProductDir'');","errcatch");\r
+    if (ierr == 0) then\r
+      MSCompiler='msvc50';   // Microsoft Visual Studio 5\r
+      return;\r
+    else\r
+      lasterror(%T); // The error message is cleared\r
+    end\r
+    \r
+  else // MSDOS\r
+    MSCompiler='unknown'; // unknown\r
+  end\r
+endfunction\r
+//-----------------------------------------------------------------------------\r
diff --git a/scilab/modules/dynamic_link/macros/haveacompiler.sci b/scilab/modules/dynamic_link/macros/haveacompiler.sci
new file mode 100644 (file)
index 0000000..7858d8c
--- /dev/null
@@ -0,0 +1,40 @@
+//-----------------------------------------------------------------------------\r
+// Allan CORNET\r
+// INRIA 2005\r
+//-----------------------------------------------------------------------------\r
+function bOK=haveacompiler()\r
+if MSDOS then\r
+  global LCC\r
+  findLCC=LCC;\r
+  clear LCC\r
+  if (findLCC) then\r
+    bOK=%T\r
+  else\r
+    msvc=findmsvccompiler();\r
+    select msvc,\r
+      case 'msvc80pro' then\r
+         bOK=%T\r
+       case 'msvc80std' then\r
+         bOK=%T\r
+           case 'msvc90express' then\r
+         bOK=%T          \r
+       case 'msvc80express' then\r
+         bOK=%T\r
+      case 'msvc71' then\r
+        bOK=%T\r
+      case 'msvc70' then\r
+        bOK=%T\r
+      case 'msvc60' then\r
+        bOK=%T\r
+      case 'msvc50' then\r
+        bOK=%T\r
+      else\r
+        bOK=%F;\r
+     end\r
+  end\r
+else\r
+  // To do under Unix\r
+  bOK=%T;\r
+end\r
+endfunction\r
+//-----------------------------------------------------------------------------\r
diff --git a/scilab/modules/dynamic_link/macros/ilib_build.sci b/scilab/modules/dynamic_link/macros/ilib_build.sci
new file mode 100644 (file)
index 0000000..6c1dc05
--- /dev/null
@@ -0,0 +1,21 @@
+function ilib_build(ilib_name,table,files,libs,makename,ldflags,cflags,fflags)\r
+  // Copyright Enpc \r
+  [lhs,rhs]=argn(0);\r
+  info=1\r
+  if rhs <= 4 then makename = 'Makelib';end\r
+  if rhs <= 5 then ldflags = ""; end \r
+  if rhs <= 6 then cflags  = ""; end \r
+  if rhs <= 7 then fflags  = ""; end \r
+  // generate the gateway file\r
+  if info==1 then write(%io(2),'   generate a gateway file');end\r
+  ilib_gen_gateway(ilib_name,table)\r
+  // generate a loader file\r
+  if info==1 then write(%io(2),'   generate a loader file');end\r
+  ilib_gen_loader(ilib_name,table,libs);\r
+  // generate a Makefile\r
+  if info==1 then write(%io(2),'   generate a Makefile: Makelib');end\r
+  ilib_gen_Make(ilib_name,table,files,libs,makename,%t,ldflags,cflags,fflags);\r
+  // we call make\r
+  if info==1 then write(%io(2),'   running the makefile');end\r
+  ilib_compile(ilib_name,makename,files);\r
+endfunction\r
diff --git a/scilab/modules/dynamic_link/macros/ilib_compile.sci b/scilab/modules/dynamic_link/macros/ilib_compile.sci
new file mode 100644 (file)
index 0000000..8001207
--- /dev/null
@@ -0,0 +1,99 @@
+//-----------------------------------------------------------------------------\r
+function libn=ilib_compile(lib_name,makename,files)\r
+// Copyright ENPC/INRIA\r
+// Updated by Allan CORNET INRIA 2006\r
+// call make for target files or objects depending\r
+// on OS and compilers\r
+// very similar to G_make\r
+// if files is given the make is performed on each \r
+// target contained in files then a whole make is performed \r
+//-----------------------------------------------------------------------------\r
+  [lhs,rhs]=argn(0);\r
+  if rhs < 3 then files=[]; end \r
+  if typeof(lib_name)<>'string' then\r
+    error('ilib_compile: first argument must be a string');\r
+    return ;\r
+  end\r
+  oldpath=getcwd();\r
+  files=files(:)';\r
+  files1=strsubst(strsubst(files,'.obj','') ,'.o','');\r
+  [make_command,lib_name_make,lib_name,path,makename,files]= ...\r
+      ilib_compile_get_names(lib_name,makename,files)  \r
+  if path<> '';  chdir(path);  end \r
+  // first try to build each file step by step \r
+  if MSDOS then\r
+    nf = size(files,'*');\r
+    for i=1:nf \r
+      write(%io(2),'   compilation of '+files1(i));\r
+     unix_s(make_command+makename + ' '+ files(i)); \r
+    end\r
+  // then the shared library \r
+    write(%io(2),'   building shared library (be patient)');\r
+   unix_s(make_command+makename + ' '+ lib_name); \r
+  else\r
+         unix_s("make");\r
+       end\r
+  // a revoir \r
+  libn=path+lib_name_make ; \r
+  chdir(oldpath)\r
+endfunction\r
+//-----------------------------------------------------------------------------\r
+function [make_command,lib_name_make,lib_name,path,makename,files]=ilib_compile_get_names(lib_name,makename,files) \r
+// return is res the correct name for \r
+// makefile, libname, files \r
+  files=strsubst(strsubst(files,'.obj','') ,'.o',''); //compat\r
+  k=strindex(makename,['/','\'])\r
+  if k~=[] then\r
+    path=part(makename,1:k($))\r
+    makename=part(makename,k($)+1:length(makename))\r
+  else\r
+     path=''\r
+  end\r
+  comp_target = COMPILER;\r
+  if with_lcc()==%T then\r
+       lib_name=lib_name+'.dll'\r
+       lib_name_make=lib_name;\r
+       makename = makename + '.lcc' ; \r
+       make_command = 'make -f '\r
+       if files<>[] then files = files + '.obj' ;\r
+       end\r
+  else if getenv('WIN32','NO')=='OK' then\r
+    lib_name=lib_name+'.dll'\r
+    lib_name_make=lib_name;\r
+    select comp_target\r
+     case 'VC++' then \r
+      makename = makename + '.mak' ; \r
+      vcvompilerversion=findmsvccompiler();\r
+      if (vcvompilerversion=='msvc80express') | (vcvompilerversion=='msvc80pro') | (vcvompilerversion=='msvc80std') then\r
+        make_command = 'nmake /Y /nologo /f '\r
+      else\r
+        make_command = 'nmake /nologo /f '\r
+      end  \r
+      if files<>[] then \r
+       files = files + '.obj' ;\r
+      end\r
+     case 'gcc' then \r
+       makename = makename;\r
+       make_command = 'make -f '\r
+       if files<>[] then \r
+        files = files + '.o' ;\r
+       end\r
+    else // like gnuwin32 \r
+       makename = makename;\r
+       make_command = 'make -f '\r
+       if files<>[] then \r
+        files = files + '.o' ;\r
+       end\r
+    end\r
+  else\r
+     if files <> [] then \r
+       files = files + '.o';\r
+     end\r
+     lib_name_make=lib_name+'.'+ilib_unix_soname();\r
+     lib_name = lib_name+'.la'; \r
+     make_command = 'make -f ';\r
+  end\r
+  end\r
+  \r
+endfunction \r
+//-----------------------------------------------------------------------------\r
diff --git a/scilab/modules/dynamic_link/macros/ilib_for_link.sci b/scilab/modules/dynamic_link/macros/ilib_for_link.sci
new file mode 100644 (file)
index 0000000..79c3d0a
--- /dev/null
@@ -0,0 +1,310 @@
+function libn=ilib_for_link(names,files,libs,flag,makename,loadername,libname,ldflags,cflags,fflags,cc)\r
+// Copyright Enpc\r
+// Copyright INRIA\r
+// Generate a shared library which can be used by link \r
+// command. \r
+// names = names of entry points or the name of the library to \r
+// be built (when flag == 'g') \r
+// files = object files to be built \r
+// flag = 'c' or 'f' or '\r
+// \r
+  [lhs,rhs]=argn(0);\r
+  info=1\r
+  if rhs <= 4 then makename = 'Makelib';end\r
+  if rhs <= 5 then loadername = 'loader.sce';end\r
+  if rhs <= 6 then libname = ""; end\r
+  if rhs <= 7 then ldflags = ""; end \r
+  if rhs <= 8 then cflags  = ""; end \r
+  if rhs <= 9 then fflags  = ""; end \r
+  if rhs <= 10 then cc  = ""; end \r
+  // generate a loader file\r
+  if info==1 then write(%io(2),'   Generate a loader file');end\r
+  ilib_link_gen_loader(names,flag,loadername,libs,libname);\r
+  // generate a Makefile\r
+  if info==1 then write(%io(2),'   Generate a Makefile');end\r
+  ilib_link_gen_Make(names,files,libs,makename,libname,...\r
+                    ldflags,cflags,fflags,cc,flag);\r
+  // we call make\r
+  if info==1 then write(%io(2),'   Running the Makefile');end\r
+  if libname=="" then libname = names(1);end\r
+  libn=ilib_compile('lib'+libname,makename,files);\r
+endfunction\r
+\r
+function ilib_link_gen_loader(names,flag,loadername,libs,libname)\r
+//------------------------------------\r
+  rhs=argn(2)\r
+  if rhs <= 4 then libname = ""; end \r
+  if rhs <= 3 then libs=[]; end \r
+  if rhs <= 2 then loadername = 'loader.sce' ; end \r
+  comp_target = COMPILER;\r
+  // suffix to be used for dll\r
+  if with_lcc()==%T then\r
+       if getenv('WIN32','NO')=='OK' then\r
+               lib_suf='dll';\r
+       end\r
+  \r
+  else if getenv('WIN32','NO')=='OK' then\r
+       select comp_target\r
+               case 'VC++'   then lib_suf='dll';\r
+               else lib_suf='dll';\r
+       end\r
+       else\r
+               lib_suf=ilib_unix_soname();\r
+       end\r
+  end\r
+  if libname=="" then libname = names(1);end \r
+    \r
+  fd=mopen(loadername,"w");\r
+  mfprintf(fd,"// generated by builder.sce: Please do not edit this file\n");\r
+  mfprintf(fd,"// ------------------------------------------------------\n");\r
+  if MSDOS then\r
+  mfprintf(fd,"%s_path=get_absolute_file_path(''%s'');\n",libname,basename(loadername+'.x'));\r
+  else\r
+  mfprintf(fd,"%s_path=get_absolute_file_path(''%s'')+%s;\n",libname,basename(loadername+'.x'),"''.libs/''");\r
+//  mfprintf(fd,"%s_path='.libs/';\n",libname);\r
+  end\r
+  \r
+  nl=size(libs,'*') \r
+  for i=1:nl \r
+    if part(libs(i),1)=='/' then\r
+      mfprintf(fd,"link(''%s.%s'');\n",libs(i),lib_suf);\r
+    else\r
+      [diri,basenamei,exti]=fileparts(libs(i));\r
+      if (diri == '') then\r
+        mfprintf(fd,"link(%s_path+''%s.%s'');\n",libname,libs(i),lib_suf);\r
+      else\r
+        mfprintf(fd,"link(''%s.%s'');\n",libs(i),lib_suf);\r
+      end\r
+    end\r
+  end \r
+  mfprintf(fd,"link(%s_path+''lib%s.%s'',[",libname,libname,lib_suf);\r
+  names=names(:)';\r
+  n = size(names,'*');\r
+  for i=1:n\r
+       mfprintf(fd,"''%s''",names(i))\r
+    if i <>n ; mfprintf(fd,","); else mfprintf(fd,"],");end\r
+  end\r
+  mfprintf(fd,"''%s'');\n",flag);\r
+  mfprintf(fd,"// remove temp. variables on stack\n");\r
+  mfprintf(fd,"clear %s_path;\n",libname);\r
+  mfprintf(fd,"clear functions;\n");\r
+  mfprintf(fd,"clear get_file_path;\n");\r
+  mclose(fd);\r
+endfunction\r
+\r
+function ilib_link_gen_Make(names,files,libs,makename,libname,ldflags,cflags,fflags,cc,flag)\r
+//------------------------------------\r
+// generate a Makefile for gateway\r
+  [lhs,rhs]=argn(0);\r
+  if rhs <= 2 then libs = [];end\r
+  if rhs <= 3 then makename = 'Makelib';end\r
+  if rhs <= 4 then libname = "";end\r
+  if rhs <= 5 then ldflags = ""; end \r
+  if rhs <= 6 then cflags  = ""; end \r
+  if rhs <= 7 then fflags  = ""; end \r
+  if rhs <= 8 then cc  = ""; end \r
+  if rhs <= 9 then flag  = "c"; end \r
+  comp_target = COMPILER;\r
+  if with_lcc()==%T then\r
+       Makename = makename+'.lcc';\r
+       ilib_link_gen_Make_lcc(names,files,libs,Makename,libname,...\r
+                              ldflags,cflags,fflags,cc,flag)\r
+  else if getenv('WIN32','NO')=='OK' then\r
+     Makename = makename+'.mak'\r
+      ilib_link_gen_Make_win32(names,files,libs,Makename,libname,...\r
+                              ldflags,cflags,fflags,cc)\r
+  else\r
+     Makename = makename;\r
+     ilib_link_gen_Make_unix(names,files,libs,Makename,libname,...\r
+                            ldflags,cflags,fflags,cc)\r
+  end\r
+  end\r
+endfunction\r
+\r
+function ilib_link_gen_Make_unix(names,files,libs,Makename,libname, ...\r
+                                ldflags,cflags,fflags,cc)\r
+  \r
+  if libname=="" then libname = names(1);end \r
+  linkpath=TMPDIR;\r
+  commandpath=SCI+"/modules/incremental_link/src/scripts/";\r
+//  chdir(commandpath);\r
+       // We launch ./configure in order to produce a "generic" Makefile \r
+       // for this computer\r
+       printf(gettext("configure : Generate Makefile in %s\n"),commandpath );\r
+       unix_w(commandpath+"/compilerDetection.sh");\r
+\r
+       // Copy files => linkpath\r
+       chdir(linkpath)\r
+       printf(gettext("Copy compilation files (Makefile*, libtool...) to %s\n"),linkpath);\r
+       mandatoryFiles=["Makefile.orig", "configure.ac", "configure", "Makefile.am","Makefile.in","config.sub","config.guess","config.status","depcomp","install-sh","ltmain.sh","libtool","missing","aclocal.m4"]\r
+       for x=mandatoryFiles(:)' ;\r
+               copyfile(commandpath+"/"+x,linkpath);\r
+       end\r
+       filelist=""\r
+       for x=files(:)' ; filelist = filelist +" " +x;end\r
+\r
+//    printf(""+commandpath+"/scicompile.sh "+libname+ " " +filelist);\r
+       printf("Modification of the Makefile in " + linkpath+"\n");\r
+       unix_w(""+commandpath+"/scicompile.sh "+libname+ " " +filelist);\r
+// on devrait catcher le code de retour du script et gere/afficher l'erreur\r
+// TODO : voir quoi faire du CFLAGS\r
+       unix_w("make CFLAGS=-I"+SCI+"/modules/core/includes/");\r
+\r
+//  chdir(oldpath)\r
+\r
+       return;\r
+    \r
+  fd=mopen(Makename,"w");\r
+  mfprintf(fd,"# generated by builder.sce: Please do not edit this file\n");\r
+  mfprintf(fd,"# ------------------------------------------------------\n");\r
+  mfprintf(fd,"SCIDIR = %s\n",SCI);\r
+  mfprintf(fd,"OBJS = ")\r
+  \r
+  // add .a \r
+  // for compatibility test if we have already a .a\r
+  for x=libs(:)' ;\r
+   [path,fname,extension]=fileparts(x);\r
+   if (extension == '') then\r
+     mfprintf(fd," %s.a",x);\r
+   else\r
+     mfprintf(fd," %s",x);\r
+   end\r
+  end\r
+  \r
+  mfprintf(fd,"\n") ;\r
+  mfprintf(fd,"OTHERLIBS = ")\r
+  for x=libs(:)' ; mfprintf(fd," %s",x);end\r
+  mfprintf(fd,"\n") ;\r
+  mfprintf(fd,"LIBRARY = lib%s\n",libname);\r
+  mfprintf(fd,"include $(SCIDIR)/Makefile.incl\n");\r
+  if cc<>"" then \r
+    mfprintf(fd,"CC="+cc+ "\n");\r
+  end\r
+  mfprintf(fd,"CFLAGS = $(CC_OPTIONS) "+cflags+ "\n");\r
+  mfprintf(fd,"FFLAGS = $(FC_OPTIONS) "+fflags+ "\n");\r
+  \r
+  mfprintf(fd,"EXTRA_LDFLAGS = "+ ldflags+ "\n");\r
+  mfprintf(fd,"include $(SCIDIR)/config/Makeso.incl\n");\r
+  mclose(fd);\r
+endfunction\r
+\r
+function ilib_link_gen_Make_win32(names,files,libs,Makename,libname,ldflags, ...\r
+                                 cflags,fflags,cc)\r
+                                 \r
+  if libname=="" then libname = names(1);end \r
+  fd=mopen(Makename,"w");\r
+  mfprintf(fd,"# generated by builder.sce : Please do not edit this file\n");\r
+  mfprintf(fd,"# ------------------------------------------------------\n");\r
+  mfprintf(fd,"SCIDIR =%s\n",SCI);\r
+  mfprintf(fd,"SCIDIR1 =%s\n",pathconvert(SCI,%f,%f,'w'));\r
+  mfprintf(fd,"# name of the dll to be built\n"); \r
+  mfprintf(fd,"LIBRARY = lib%s\n",libname);\r
+  mfprintf(fd,"# list of objects file\n");\r
+  mfprintf(fd,"OBJS =");\r
+  for x=files(:)' ; mfprintf(fd," %s",strsubst(x,".o",".obj"));end\r
+  mfprintf(fd,"\n# added libraries \n");\r
+  mfprintf(fd,"OTHERLIBS = ");\r
+  for x=libs(:)' ; mfprintf(fd," %s.lib",x);end\r
+  mfprintf(fd,"\n");\r
+  mfprintf(fd,"!include $(SCIDIR1)\\Makefile.incl.mak\n");\r
+  if cc<>"" then \r
+    mfprintf(fd,"CC="+cc+ "\n");\r
+  end\r
+  \r
+  if findmsvccompiler() <>'msvc90express' then\r
+    mfprintf(fd,"CFLAGS = $(CC_OPTIONS) -DFORDLL -I\""$(SCIDIR)/modules\"" -I\""$(SCIDIR)/modules/core/includes\"""+...\r
+          " -Dmexfunction_=mex$*_  -DmexFunction=mex_$* "+ cflags +" \n"); \r
+    mfprintf(fd,"FFLAGS = $(FC_OPTIONS) -DFORDLL -I\""$(SCIDIR)/modules\"" -I\""$(SCIDIR)/modules/core/includes\"""+...\r
+          " -Dmexfunction=mex$* "+ fflags +"\n"); \r
+       else\r
+    mfprintf(fd,"CFLAGS = $(CC_OPTIONS) -DFORDLL -I\""$(SCIDIR)/modules\"" -I\""$(SCIDIR)/modules/core/includes\"""+...\r
+          " "+ cflags +" \n"); \r
+    mfprintf(fd,"FFLAGS = $(FC_OPTIONS) -DFORDLL -I\""$(SCIDIR)/modules\"" -I\""$(SCIDIR)/modules/core/includes\"""+...\r
+          " "+ fflags +"\n");  \r
+       end\r
+  mfprintf(fd,"EXTRA_LDFLAGS = "+ ldflags+"\n");\r
+  mfprintf(fd,"!include $(SCIDIR1)\\modules\\incremental_link\\src\\scripts\\Makedll.incl \n");\r
+  mclose(fd);\r
+endfunction\r
+\r
+//-------------------------------------------------------------------------------------\r
+function ilib_link_gen_Make_lcc(names,files,libs,Makename,libname,ldflags,cflags,fflags,cc,flag)\r
+// Allan CORNET\r
+// INRIA 2004\r
+  \r
+  if libname == "" then libname = names(1);end \r
+  fd=mopen(Makename,"w");\r
+  mfprintf(fd,"# ------------------------------------------------------------\n");\r
+  mfprintf(fd,"# generated by builder.sce (lcc): Please do not edit this file\n");\r
+  mfprintf(fd,"# ------------------------------------------------------------\n\n");\r
+  mfprintf(fd,"SCIDIR =%s\n",SCI);\r
+  mfprintf(fd,"SCIDIR1 =%s\n",pathconvert(SCI,%f,%f,'w'));\r
+  mfprintf(fd,"DUMPEXTS=""$(SCIDIR1)\\bin\\dumpexts""\n");\r
+  mfprintf(fd,"SCIIMPLIB=$(SCIDIR1)\\bin\\lcclib\\LibScilab.lib $(SCIDIR1)\\bin\\lcclib\\blasplus.lib $(SCIDIR1)\\bin\\lcclib\\libf2c.lib $(SCIDIR1)\\bin\\lcclib\\intersci.lib $(SCIDIR1)\\bin\\lapack.lib $(SCIDIR1)\\bin\\scicos.lib\n\n");\r
+  mfprintf(fd,"CC=lcc\n");\r
+  mfprintf(fd,"LINKER=lcclnk\n");\r
+  mfprintf(fd,"CFLAGS=-I""$(SCIDIR)/modules/core/includes"" -I""$(SCIDIR)/libs/f2c"" -I""$(SCIDIR)/modules/mexlib/includes"" -Dmexfunction_=mex$*_ -DmexFunction=mex_$* -DWIN32 -DSTRICT -DFORDLL -D__STDC__ -DHAVE_EXP10 "+ cflags +" \n"); \r
+  mfprintf(fd,"LINKER_FLAGS=-dll -nounderscores\n");\r
+  mfprintf(fd,"EXTRA_LDFLAGS = "+ ldflags+"\n");\r
+  mfprintf(fd,"O=.obj\n");\r
\r
+  mfprintf(fd,"# name of the dll to be built\n"); \r
+  mfprintf(fd,"LIBRARY = lib%s\n",libname);\r
+  mfprintf(fd,"\n# list of objects file\n");\r
+  \r
+  if (flag =='c') then\r
+       mfprintf(fd,"OBJSC =");\r
+       for x=files(:)' ;\r
+               x=strsubst(x,".obj","");\r
+               x=strsubst(x,".o","");\r
+               mfprintf(fd," %s$(O)",x);\r
+       end\r
+  \r
+       mfprintf(fd,"\nOBJSF=\n");\r
+  else\r
+       mfprintf(fd,"OBJSC =\n");\r
+       mfprintf(fd,"\nOBJSF=");\r
+       for x=files(:)' ;\r
+               x=strsubst(x,".obj","");\r
+               x=strsubst(x,".o","");\r
+               mfprintf(fd," %s$(O)",x);\r
+       end\r
+  end\r
+  \r
+  mfprintf(fd,"\nOBJS = $(OBJSC) $(OBJSF)\n");\r
+  \r
+  mfprintf(fd,"\n# added libraries \n");\r
+  mfprintf(fd,"OTHERLIBS =");\r
+  for x=libs(:)' ;\r
+       mfprintf(fd," ""%s.lib""",x);\r
+  end\r
+  mfprintf(fd,"\n");\r
+  \r
+  mfprintf(fd,"\nall :: $(LIBRARY).dll\n");\r
+  mfprintf(fd,"\n$(LIBRARY).dll: $(OBJS)\n");\r
+  mfprintf(fd,"        $(DUMPEXTS) -o ""$(LIBRARY).def"" ""$*"" $(OBJS)\n");\r
+  mfprintf(fd,"        $(LINKER) $(LINKER_FLAGS) $(OBJS) $(OTHERLIBS) $(SCIIMPLIB) $(XLIBSBIN) $(TERMCAPLIB) $(EXTRA_LDFLAGS) $*.def -o $(LIBRARY).dll\n\n");\r
\r
+\r
+  for x=files(:)' ;\r
+       x=strsubst(x,".obj","");\r
+       x=strsubst(x,".o","");\r
+       mfprintf(fd,"%s$(O):\n",x);\r
+       if (flag =='c') then\r
+               mfprintf(fd,"   $(CC) $(CFLAGS) $*.c\n\n");\r
+       else\r
+               mfprintf(fd,"   @$(SCIDIR1)\\bin\\f2c.exe $*.f \n");\r
+               mfprintf(fd,"   @$(CC) $(CFLAGS) $*.c \n");\r
+               mfprintf(fd,"   del $*.c \n");\r
+       end\r
+  end\r
+       \r
+  mfprintf(fd,"clean:\n");\r
+  mfprintf(fd,"        del *.obj\n");\r
+  mfprintf(fd,"        del *.dll\n");\r
+  mfprintf(fd,"        del *.lib\n");\r
+  mfprintf(fd,"        del *.def\n");\r
\r
+ mclose(fd);\r
+endfunction\r
+//-------------------------------------------------------------------------------------\r
diff --git a/scilab/modules/dynamic_link/macros/ilib_gen_Make.sci b/scilab/modules/dynamic_link/macros/ilib_gen_Make.sci
new file mode 100644 (file)
index 0000000..257bddb
--- /dev/null
@@ -0,0 +1,245 @@
+function Makename=ilib_gen_Make(name,tables,files,libs,makename,with_gateway,ldflags,cflags,fflags,flag)\r
+// flag 'c' or 'f' used with lcc \r
+// Copyright Enpc \r
+//------------------------------------\r
+// generate a Makefile for gateway\r
+  if argn(2)<6 then with_gateway=%t,ldflags='',cflags='',fflags='';end\r
+  files=strsubst(strsubst(files,'.obj','') ,'.o',''); //compat\r
+  // change table if necessary \r
+  if typeof(tables)<>'list' then \r
+    tables= list(tables)\r
+  end\r
+  L=length(tables); \r
+  for it = 1:L \r
+    table = tables(it);\r
+    [mt,nt]=size(table);\r
+    if nt==2 then col= "csci"; table = [table, col(ones(mt,1))];nt=3; end \r
+    if nt<>3 then error('second argument has wrong size ');end \r
+    tables(it)=table;\r
+  end\r
+      \r
+  comp_target = COMPILER;\r
+  if with_lcc() == %T then\r
+       Makename = makename+'.lcc'\r
+       flag='c'\r
+       ilib_gen_Make_lcc(name,tables,files,libs,Makename,with_gateway,ldflags,cflags,fflags,flag)\r
+  else if getenv('WIN32','NO')=='OK' then\r
+    select comp_target\r
+     case 'VC++'   then Makename = makename+'.mak'\r
+      ilib_gen_Make_win32(name,tables,files,libs,Makename,with_gateway,ldflags,cflags,fflags)\r
+     case 'gcc' then \r
+      Makename = makename;\r
+      ilib_gen_Make_unix(name,tables,files,libs,Makename,with_gateway,ldflags,cflags,fflags)\r
+    else\r
+       Makename = makename;\r
+       ilib_gen_Make_win32(name,tables,files,libs,Makename,with_gateway,ldflags,cflags,fflags)\r
+    end\r
+  else\r
+     Makename = makename;\r
+     ilib_gen_Make_unix(name,tables,files,libs,Makename,with_gateway,ldflags,cflags,fflags)\r
+  end\r
+  end\r
+endfunction\r
+\r
+function ilib_gen_Make_unix(name,tables,files,libs,Makename,with_gateway,ldflags,cflags,fflags)\r
+  fd=mopen(Makename,"w");\r
+  mfprintf(fd,"# generated by builder.sce: Please do not edit this file\n");\r
+  mfprintf(fd,"# ------------------------------------------------------\n");\r
+  mfprintf(fd,"SCIDIR = %s\n",SCI);\r
+  mfprintf(fd,"OBJS = ")\r
+  for x=files(:)' ; \r
+    mfprintf(fd," %s.o",x);\r
+  end\r
+  \r
+  if typeof(tables)<>'list' then \r
+    tables= list(tables)\r
+  end\r
+\r
+  L=length(tables); \r
+  \r
+  if with_gateway then \r
+    if L==1 then \r
+      mfprintf(fd," %s.o",name);\r
+    else\r
+       for i=1:L , mfprintf(fd," %s.o",name+string(i));end \r
+    end\r
+  end\r
+  for it=1:L \r
+    table = tables(it)\r
+    [mt,nt]=size(table);\r
+    for i=1:mt ; \r
+      // mex files to be added \r
+      if table(i,3)=='cmex' | table(i,3)=='fmex' | table(i,3)=='Fmex' \r
+       mfprintf(fd," %s.o",table(i,2));\r
+      end\r
+    end\r
+  end\r
+  mfprintf(fd,"\n") ;\r
+  mfprintf(fd,"LIBRARY = %s.a\n",name);\r
+  mfprintf(fd,"include $(SCIDIR)/Makefile.incl\n");\r
+  mfprintf(fd,"CFLAGS = $(CC_OPTIONS) -DmexFunction=mex_$* "+cflags+ "\n");\r
+  mfprintf(fd,"FFLAGS = $(FC_OPTIONS) -Dmexfunction=mex$* "+fflags+ "\n");\r
+\r
+  mfprintf(fd,"EXTRA_LDFLAGS = "+ ldflags+ "\n");\r
+  mfprintf(fd,"include $(SCIDIR)/config/Makeso.incl\n");\r
+\r
+  mclose(fd);\r
+\r
+endfunction\r
+\r
+\r
+function ilib_gen_Make_win32(name,table,files,libs,Makename,with_gateway,ldflags,cflags,fflags)\r
+  fd=mopen(Makename,"w");\r
+  mfprintf(fd,"# generated by builder.sce: Please do not edit this file\n");\r
+  mfprintf(fd,"# ------------------------------------------------------\n");\r
+  mfprintf(fd,"SHELL = /bin/sh\n");\r
+  mfprintf(fd,"SCIDIR =%s\n",SCI);\r
+  mfprintf(fd,"SCIDIR1 =%s\n",pathconvert(SCI,%f,%f,'w'));\r
+  mfprintf(fd,"# name of the dll to be built\n"); \r
+  mfprintf(fd,"LIBRARY = %s\n",name);\r
+  mfprintf(fd,"# list of objects file\n");\r
+  mfprintf(fd,"OBJS =");\r
+  for x=files(:)' ; mfprintf(fd," %s.obj",x);end\r
+\r
+  if typeof(tables)<>'list' then \r
+    tables= list(tables)\r
+  end\r
+  L=length(tables); \r
+\r
+  if with_gateway then \r
+    if L==1 then \r
+      mfprintf(fd," %s.obj",name);\r
+    else\r
+       for i=1:L , mfprintf(fd," %s.obj",name+string(i));end \r
+    end\r
+  end\r
+  \r
+  for it=1:L \r
+    table = tables(it)\r
+    [mt,nt]=size(table);\r
\r
+    for i=1:mt ; \r
+      // mex files to be added \r
+      if table(i,3)=='cmex' | table(i,3)=='fmex' | table(i,3)=='Fmex' \r
+       mfprintf(fd," %s.obj",table(i,2));\r
+      end\r
+    end\r
+  end\r
+  mfprintf(fd,"\n# added libraries \n");\r
+  mfprintf(fd,"OTHERLIBS = ");\r
+  for x=libs(:)' ; mfprintf(fd," %s.lib",x);end\r
+  mfprintf(fd,"\n");\r
+  mfprintf(fd,"!include $(SCIDIR1)\\Makefile.incl.mak\n");\r
+  if findmsvccompiler() <>'msvc90express' then\r
+    mfprintf(fd,"CFLAGS = $(CC_OPTIONS) -DFORDLL -I\""$(SCIDIR)/modules/core/includes\"""+...\r
+          " -Dmexfunction_=mex$*_  -DmexFunction=mex_$* "+ cflags +" \n"); \r
+    mfprintf(fd,"FFLAGS = $(FC_OPTIONS) -DFORDLL -I\""$(SCIDIR)/modules/core/includes\"""+...\r
+          " -Dmexfunction=mex$* "+ fflags +"\n"); \r
+       else\r
+    mfprintf(fd,"CFLAGS = $(CC_OPTIONS) -DFORDLL -I\""$(SCIDIR)/modules/core/includes\"""+...\r
+          " "+ cflags +" \n"); \r
+    mfprintf(fd,"FFLAGS = $(FC_OPTIONS) -DFORDLL -I\""$(SCIDIR)/modules/core/includes\"""+...\r
+          " "+ fflags +"\n"); \r
+       end\r
+  mfprintf(fd,"EXTRA_LDFLAGS = "+ ldflags+"\n");\r
+  mfprintf(fd,"!include $(SCIDIR1)\\modules\\incremental_link\\src\\scripts\\Makedll.incl \n");\r
+  mclose(fd);\r
+endfunction\r
+//---------------------------------------------------------------------------------------\r
+         \r
+function ilib_gen_Make_lcc(name,table,files,libs,Makename,with_gateway,ldflags,cflags,fflags,flag)\r
+// Allan CORNET\r
+//INRIA 2004\r
+  fd=mopen(Makename,"w");\r
+  mfprintf(fd,"# ------------------------------------------------------------\n");\r
+  mfprintf(fd,"# generated by builder.sce (lcc 1): Please do not edit this file\n");\r
+  mfprintf(fd,"# ------------------------------------------------------------\n\n");\r
+  mfprintf(fd,"SCIDIR =%s\n",SCI);\r
+  mfprintf(fd,"SCIDIR1 =%s\n",pathconvert(SCI,%f,%f,'w'));\r
+  mfprintf(fd,"DUMPEXTS=""$(SCIDIR1)\\bin\\dumpexts""\n");\r
+       mfprintf(fd,"SCIIMPLIB=$(SCIDIR1)\\bin\\lcclib\\LibScilab.lib $(SCIDIR1)\\bin\\lcclib\\blasplus.lib $(SCIDIR1)\\bin\\lcclib\\libf2c.lib $(SCIDIR1)\\bin\\interscilcc.lib $(SCIDIR1)\\bin\\lcclib\\lapack.lib $(SCIDIR1)\\bin\\lcclib\\scicos.lib\n\n");\r
+  mfprintf(fd,"CC=lcc\n");\r
+  mfprintf(fd,"LINKER=lcclnk\n");\r
+  mfprintf(fd,"CFLAGS= -ansic msvcrt.lib -I""$(SCIDIR)/modules/core/includes"" -I""$(SCIDIR)/libs/f2c"" -I""$(SCIDIR)/modules/mexlib/includes"" -Dmexfunction_=mex$*_ -DmexFunction=mex_$* -DWIN32 -DSTRICT -DFORDLL -D__STDC__ "+ cflags +" \n"); \r
+  \r
+  mfprintf(fd,"LINKER_FLAGS=-dll -nounderscores\n");\r
+  mfprintf(fd,"EXTRA_LDFLAGS = "+ ldflags+"\n");\r
+  mfprintf(fd,"O=.obj\n");\r
\r
+  mfprintf(fd,"# name of the dll to be built\n"); \r
+  mfprintf(fd,"LIBRARY = %s\n",name);\r
+  mfprintf(fd,"# list of objects file\n");\r
+  mfprintf(fd,"OBJS =");\r
+  for x=files(:)' ; mfprintf(fd," %s$(O)",x);end\r
+\r
+  if typeof(table)<>'list' then \r
+    tables= list(table)\r
+  end\r
+  \r
+  L=length(table); \r
+\r
+  if with_gateway then \r
+    if L==1 then \r
+      mfprintf(fd," %s$(O)",name);\r
+    else\r
+       for i=1:L , mfprintf(fd," %s$(O)",name+string(i));end \r
+    end\r
+  end\r
+  \r
+  for it=1:L \r
+    table = tables(it)\r
+    [mt,nt]=size(table);\r
\r
+    for i=1:mt ; \r
+      // mex files to be added \r
+      if table(i,3)=='cmex' | table(i,3)=='fmex' | table(i,3)=='Fmex' \r
+       mfprintf(fd," %s$(O)",table(i,2));\r
+      end\r
+    end\r
+  end\r
+  \r
+  \r
+  mfprintf(fd,"\n\n# added libraries \n");\r
+  mfprintf(fd,"OTHERLIBS =");\r
+  \r
+  for x=libs(:)' ; mfprintf(fd," %s.lib",x);end\r
+  mfprintf(fd,"\n");\r
+  \r
+  mfprintf(fd,"\n");\r
+  \r
+  mfprintf(fd,"\nall :: $(LIBRARY).dll\n");\r
+  mfprintf(fd,"\n$(LIBRARY).dll: $(OBJS)\n");\r
+  mfprintf(fd,"        $(DUMPEXTS) -o ""$(LIBRARY).def"" ""$*"" $(OBJS)\n");\r
+  mfprintf(fd,"        $(LINKER) $(LINKER_FLAGS) $(OBJS) $(OTHERLIBS) $(SCIIMPLIB) $(XLIBSBIN) $(TERMCAPLIB) $(EXTRA_LDFLAGS) $*.def -o $(LIBRARY).dll\n\n");\r
\r
+\r
+  for x=files(:)' ;\r
+       x=strsubst(x,".obj","");\r
+       x=strsubst(x,".o","");\r
+       mfprintf(fd,"%s$(O):\n",x);\r
+       mfprintf(fd,"   $(CC) $(CFLAGS) $*.c\n\n");\r
+  end\r
+\r
+\r
+  if with_gateway then \r
+    if L==1 then \r
+      mfprintf(fd,"\n%s$(O):\n",name);\r
+      mfprintf(fd,"    $(CC) $(CFLAGS) $*.c\n");\r
+    else\r
+       for i=1:L ;\r
+       mfprintf(fd,"\n%s$(O):\n",name+string(i));\r
+       mfprintf(fd,"   $(CC) $(CFLAGS) $*.c\n");\r
+       end \r
+    end\r
+  end\r
+  \r
+       \r
+  mfprintf(fd,"\nclean:\n");\r
+  mfprintf(fd,"        del *.obj\n");\r
+  mfprintf(fd,"        del *.dll\n");\r
+  mfprintf(fd,"        del *.lib\n");\r
+  mfprintf(fd,"        del *.def\n");\r
\r
+ mclose(fd);\r
+\r
+endfunction
\ No newline at end of file
diff --git a/scilab/modules/dynamic_link/macros/ilib_gen_gateway.sci b/scilab/modules/dynamic_link/macros/ilib_gen_gateway.sci
new file mode 100644 (file)
index 0000000..da7d641
--- /dev/null
@@ -0,0 +1,94 @@
+function ilib_gen_gateway(name,tables)\r
+// Copyright Enpc \r
+//------------------------------------\r
+// generate an interface gateway named name\r
+// from table table taking into account \r
+// attributes of function i.e mex fmex or scilab interface \r
+// if name is a full path just extract the filename \r
+  k=strindex(name,['/','\'])\r
+  if k~=[] then\r
+    path=part(name,1:k($))\r
+    name=part(name,k($)+1:length(name))\r
+  else\r
+     path=''\r
+  end\r
+  name=strsubst(name,'.c','')\r
+  \r
+  if typeof(tables)<>'list' then \r
+    tables= list(tables)\r
+  end\r
+  \r
+  L=length(tables); \r
+\r
+  for itable=1:L \r
+    // loop on a list of tables \r
+    if L<> 1 then \r
+      tname = name +string(itable);\r
+    else \r
+       tname = name ;\r
+    end\r
+    table = tables(itable);\r
+    [mt,nt]=size(table);\r
+    if nt==2 then col= "csci"; table = [table, col(ones(mt,1))];nt = 3 ; end \r
+    if nt<>3 then error('second argument has wrong size ');end \r
+    [gate,names]=new_names(table); \r
+    t=[ '#include <mex.h> ';\r
+       'static int direct_gateway(char *fname,void F(void)) { F();return 0;};'\r
+       'extern Gatefunc ' + names(:) + ';';\r
+       'static GenericTable Tab[]={';\r
+       '  {'+ gate(:)+','+ names(:)+',""'+table(:,1)+'""},';\r
+       '};'\r
+       ' '\r
+       'int C2F('+tname+')()'\r
+       '{'\r
+       '  Rhs = Max(0, Rhs);'\r
+       '  (*(Tab[Fin-1].f))(Tab[Fin-1].name,Tab[Fin-1].F);'\r
+       '  return 0;'\r
+       '}'];\r
+    // first chek if we already have a gateway \r
+    [fd,ierr]=mopen(path+tname+'.c')\r
+    if ierr== 0 then;\r
+      mclose(fd);\r
+      t1=mgetl(path+tname+'.c') \r
+      if t1==t then \r
+       //      write(%io(2),'   gateway '+path+tname+'.c'+' unchanged ');\r
+      else\r
+        mputl(t,path+tname+'.c')    \r
+      end\r
+    else\r
+       // file does not exists we create it \r
+       mputl(t,path+tname+'.c')    \r
+    end\r
+  end\r
+endfunction\r
+\r
+function [gate,names]=new_names(table) \r
+// change names according to types \r
+  [mt,nt]=size(table);\r
+  gate= "mex_gateway"; \r
+  gate = gate(ones(mt,1)); \r
+  names= " "; \r
+  names= names(ones(mt,1)); \r
+  for i=1:mt \r
+    select table(i,3) \r
+     case 'cmex' then \r
+      names(i) = "mex_" + table(i,2)\r
+     case 'fmex' then \r
+      gate(i)="(Myinterfun)fortran_mex_gateway" \r
+      names(i) = "C2F(mex" + table(i,2) + ")"\r
+     case 'Fmex' then \r
+      gate(i)="(Myinterfun)fortran_mex_gateway" \r
+      names(i) = "C2F(mex" + table(i,2) + ")"\r
+     case 'csci'  then \r
+      gate(i)="(Myinterfun)sci_gateway" \r
+      names(i) = table(i,2)\r
+     case 'fsci'  then \r
+      gate(i)="(Myinterfun)sci_gateway" \r
+      names(i) = "C2F(" + table(i,2) + ")"\r
+     case 'direct'  then \r
+      gate(i)="(Myinterfun)direct_gateway" \r
+      names(i) = "C2F(" + table(i,2) + ")"\r
+    else error(999,"wrong interface type "+table(i,3)); \r
+    end \r
+  end \r
+endfunction\r
diff --git a/scilab/modules/dynamic_link/macros/ilib_gen_loader.sci b/scilab/modules/dynamic_link/macros/ilib_gen_loader.sci
new file mode 100644 (file)
index 0000000..ba1d1d9
--- /dev/null
@@ -0,0 +1,66 @@
+function ilib_gen_loader(name,tables,libs)\r
+// Copyright Enpc \r
+//------------------------------------\r
+// generate a loader file for gateway\r
+  if rhs < 3 then libs=[];end \r
+\r
+  if typeof(tables)<>'list' then \r
+    tables= list(tables)\r
+  end\r
+  L=length(tables); \r
+\r
+  for it=1:L \r
+    [mt,nt]=size(tables(it));\r
+    if nt<>3 & nt<>2 then error('second argument has wrong size ');end \r
+  end\r
+  \r
+  comp_target = COMPILER;\r
+  if getenv('WIN32','NO')=='OK' then\r
+    select comp_target\r
+     case 'VC++'   then lib_suf='dll';\r
+     case 'gcc' then lib_suf='dll';\r
+    else lib_suf='dll';\r
+    end\r
+  else\r
+     lib_suf=ilib_unix_soname();\r
+  end\r
+\r
+  fd=mopen('loader.sce',"w");\r
+  mfprintf(fd,"// generated by builder.sce: Please do not edit this file\n");\r
+  mfprintf(fd,"// ------------------------------------------------------\n");\r
+  mfprintf(fd,"%s_path=get_file_path(''loader.sce'');\n",name);\r
+\r
+  nl=size(libs,'*') \r
+  for i=1:nl \r
+    mfprintf(fd,"link(%s_path+''/%s.%s'');\n",name,libs(i),lib_suf);\r
+  end \r
+\r
+  if L == 1 then \r
+    // direct call to addinter \r
+    table = tables(1);\r
+    mfprintf(fd,"functions=[ ''%s'';\n",table(1,1));\r
+    for x=table(2:$,1)' ;mfprintf(fd,"            ''%s'';\n",x);end\r
+    mfprintf(fd,"];\n");\r
+    mfprintf(fd,"addinter(%s_path+''/%s.%s'',''%s'',functions);\n",name, ...\r
+            name,lib_suf,name);\r
+  else\r
+     // on link then a set of addinter \r
+     mfprintf(fd,"ilib=link(%s_path+''/%s.%s'');\n",name, ...\r
+               name,lib_suf);\r
+     for itable=1:L \r
+       // loop on a list of tables \r
+       table = tables(itable);\r
+       mfprintf(fd,"functions=[ ''%s'';\n",table(1,1));\r
+       for x=table(2:$,1)' ;mfprintf(fd,"            ''%s'';\n",x);end\r
+       mfprintf(fd,"];\n");\r
+       mfprintf(fd,"addinter(ilib,''%s'',functions);\n",name+ ...\r
+               string(itable));\r
+     end\r
+  end\r
+  mfprintf(fd,"// remove temp. variables on stack\n");\r
+  mfprintf(fd,"clear %s_path;\n",name);\r
+  mfprintf(fd,"clear functions;\n");\r
+  mfprintf(fd,"clear get_file_path;\n");\r
+  mclose(fd);\r
+endfunction\r
+\r
diff --git a/scilab/modules/dynamic_link/macros/ilib_mex_build.sci b/scilab/modules/dynamic_link/macros/ilib_mex_build.sci
new file mode 100644 (file)
index 0000000..744357e
--- /dev/null
@@ -0,0 +1,23 @@
+function ilib_mex_build(ilib_name,table,files,libs,makename,ldflags,cflags,fflags)\r
+// Copyright Enpc \r
+// \r
+  [lhs,rhs]=argn(0);\r
+  info=1\r
+  if rhs <= 4 then makename = 'Makelib';end\r
+  if rhs <= 5 then ldflags = ""; end \r
+  if rhs <= 6 then cflags  = ""; end \r
+  if rhs <= 7 then fflags  = ""; end \r
+  // generate the gateway file\r
+  if info==1 then write(%io(2),'   generate a gateway file');end\r
+  ilib_gen_gateway(ilib_name,table)\r
+  // generate a loader file\r
+  if info==1 then write(%io(2),'   generate a loader file');end\r
+  ilib_gen_loader(ilib_name,table);\r
+  // generate a Makefile\r
+  if info==1 then write(%io(2),'   generate a Makefile: Makelib');end\r
+  ilib_gen_Make(ilib_name,table,files,libs,makename,%t,ldflags,cflags,fflags);\r
+  // we call make\r
+  if info==1 then write(%io(2),'   running the makefile');end\r
+  ilib_compile(ilib_name,makename,files);\r
+endfunction\r
+\r
diff --git a/scilab/modules/dynamic_link/macros/ilib_unix_soname.sci b/scilab/modules/dynamic_link/macros/ilib_unix_soname.sci
new file mode 100644 (file)
index 0000000..0722c31
--- /dev/null
@@ -0,0 +1,26 @@
+function rep=ilib_unix_soname()\r
+       \r
+       // Copyright Enpc \r
+       // Copyright INRIA\r
+       // try to get the proper sufix for \r
+       // shared unix library sl or so ?\r
+\r
+       commandpath=SCI+"/modules/incremental_link/src/scripts/";\r
+       libtoolconf=unix_g(commandpath+"/libtool --config")\r
+\r
+       //check if shared libraries are built\r
+       k=grep(libtoolconf,'build_libtool_libs')\r
+       \r
+       if strindex(libtoolconf(k),'yes')<>[] then //yes\r
+               //k=grep(libtoolconf,'soname_spec')\r
+               k=grep(libtoolconf,'shrext_cmds=')\r
+               if strindex(libtoolconf(k),".sl")<>[] \r
+                       rep="sl" ;\r
+               else \r
+                       rep="so" ; \r
+               end \r
+       else //no shared library built\r
+               rep='a'\r
+       end\r
+       \r
+endfunction\r
diff --git a/scilab/modules/dynamic_link/macros/with_lcc.sci b/scilab/modules/dynamic_link/macros/with_lcc.sci
new file mode 100644 (file)
index 0000000..b9edf0b
--- /dev/null
@@ -0,0 +1,4 @@
+function r=with_lcc()\r
+global LCC\r
+  r=LCC;\r
+endfunction
\ No newline at end of file
diff --git a/scilab/modules/dynamic_link/readme.txt b/scilab/modules/dynamic_link/readme.txt
new file mode 100644 (file)
index 0000000..267744e
--- /dev/null
@@ -0,0 +1 @@
+readme.txt about dynamic_link module
\ No newline at end of file
diff --git a/scilab/modules/dynamic_link/sci_gateway/c/gw_dynamic_link.c b/scilab/modules/dynamic_link/sci_gateway/c/gw_dynamic_link.c
new file mode 100644 (file)
index 0000000..37a9b6d
--- /dev/null
@@ -0,0 +1,27 @@
+/*--------------------------------------------------------------------------*/\r
+/* INRIA 2008 */\r
+/* Allan CORNET */\r
+/*--------------------------------------------------------------------------*/\r
+#include <string.h>\r
+#include "gw_dynamic_link.h"\r
+#include "stack-c.h"\r
+#include "callFunctionFromGateway.h"\r
+/*--------------------------------------------------------------------------*/\r
+static gw_generic_table Tab[]=\r
+{\r
+       {C2F(sci_getdynlibext),"getdynlibext"},\r
+       {C2F(sci_addinter),"addinter"},\r
+       {C2F(sci_fort),"fort"},\r
+       {C2F(sci_call),"call"},\r
+       {C2F(sci_link),"link"},\r
+       {C2F(sci_ulink),"ulink"},\r
+       {C2F(sci_c_link),"c_link"},\r
+};\r
+/*--------------------------------------------------------------------------*/\r
+int C2F(gw_dynamic_link)()\r
+{  \r
+       Rhs = Max(0, Rhs);\r
+       callFunctionFromGateway(Tab);\r
+       return 0;\r
+}\r
+/*--------------------------------------------------------------------------*/\r
diff --git a/scilab/modules/dynamic_link/sci_gateway/c/sci_addinter.c b/scilab/modules/dynamic_link/sci_gateway/c/sci_addinter.c
new file mode 100644 (file)
index 0000000..a2ed6f7
--- /dev/null
@@ -0,0 +1,71 @@
+/*-----------------------------------------------------------------------------------*/\r
+/* INRIA 2008 */\r
+/* Allan CORNET */\r
+/*-----------------------------------------------------------------------------------*/ \r
+#include "gw_dynamic_link.h"\r
+#include "machine.h"\r
+#include "stack-c.h"\r
+#include "addinter.h"\r
+/*-----------------------------------------------------------------------------------*/\r
+int C2F(sci_addinter) _PARAMS((char *fname,unsigned long fname_len))\r
+{\r
+       CheckRhs(3,3);\r
+       CheckLhs(1,1);\r
+\r
+       if ( (VarType(1) == sci_strings) && \r
+               (VarType(2) == sci_strings) && \r
+               (VarType(3) == sci_strings) )\r
+       {\r
+               char **sharedlibname = NULL;\r
+               char **spname = NULL;\r
+               char **fcts = NULL;\r
+\r
+               int m1 = 0, n1 = 0, l1 = 0;\r
+               int m2 = 0, n2 = 0, l2 = 0;\r
+               int m3 = 0, n3 = 0, l3 = 0;\r
+\r
+               GetRhsVar(1,MATRIX_OF_STRING_DATATYPE,&m1,&n1,&sharedlibname);\r
+               if ( (m1 != n1) && (n1 != 1) )\r
+               {\r
+                       Scierror(999,"Invalid parameter(s).\r\n");\r
+                       return 0;\r
+               }\r
+\r
+               GetRhsVar(2,MATRIX_OF_STRING_DATATYPE,&m2,&n2,&spname);\r
+               GetRhsVar(3,MATRIX_OF_STRING_DATATYPE,&m3,&n3,&fcts);\r
+\r
+               if ( (m2 != n2) && (n2 != 1) )\r
+               {\r
+                       Scierror(999,"Invalid parameter(s).\r\n");\r
+                       return 0;\r
+               }\r
+\r
+\r
+               {\r
+                       int ierr = 0;\r
+\r
+                       ierr = AddInterfaceToScilab(sharedlibname[0],spname[0],fcts,n3);\r
+                       if (ierr == 0)\r
+                       {\r
+                               LhsVar(1) = 0;\r
+                               C2F(putlhsvar)();\r
+                       }\r
+                       else\r
+                       {\r
+                               switch (ierr)\r
+                               {\r
+                               default :\r
+                                       Scierror(999,"%s : unknow error.\r\n",fname);\r
+                                       break;\r
+                               }\r
+                       }\r
+               }\r
+       }\r
+       else\r
+       {\r
+               Scierror(999,"Invalid parameter(s).\r\n");\r
+               return 0;\r
+       }\r
+       return 0;\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
diff --git a/scilab/modules/dynamic_link/sci_gateway/c/sci_c_link.c b/scilab/modules/dynamic_link/sci_gateway/c/sci_c_link.c
new file mode 100644 (file)
index 0000000..d3f0789
--- /dev/null
@@ -0,0 +1,91 @@
+/*--------------------------------------------------------------------------*/\r
+/* INRIA 2006 */\r
+/* Allan CORNET */\r
+/*--------------------------------------------------------------------------*/ \r
+#include "gw_dynamic_link.h"\r
+#include "machine.h"\r
+#include "stack-c.h"\r
+#include "dynamic_link.h"\r
+#include "MALLOC.h"\r
+/*--------------------------------------------------------------------------*/\r
+int C2F(sci_c_link) _PARAMS((char *fname,unsigned long fname_len))\r
+{\r
+       int ilib = 0;\r
+\r
+       CheckRhs(1,2);\r
+       CheckLhs(0,1);  \r
+\r
+       /* [test,ilib]=c_link(routine-name)  */\r
+       /* test = c_link(routine-name)  */\r
+       /* test = c_link(routine-name,num)  */\r
+       \r
+       if (Rhs == 2)\r
+       {\r
+               if (VarType(2) == sci_matrix)\r
+               {\r
+                       int m1 = 0, n1 = 0, l1 = 0;\r
+                       GetRhsVar(1,MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&l1);\r
+                       if ( (m1 == n1) && (n1 == 1) )\r
+                       {\r
+                               ilib = (int)*stk(l1);\r
+                       }\r
+                       else\r
+                       {\r
+                               Scierror(999,"%s : second argument must be a unique id of a shared library.\r\n",fname);\r
+                               return 0;\r
+                       }\r
+               }\r
+       }\r
+       else ilib = -1;\r
+\r
+\r
+       if (VarType(1) == sci_strings)\r
+       {\r
+               char **routinename = NULL;\r
+               int m1 = 0, n1 = 0, l1 = 0;\r
+               GetRhsVar(1,"S",&m1,&n1,&routinename);\r
+\r
+               if ( (m1 == 1) && (n1 == 1) )\r
+               {\r
+                       int *paramoutINT=(int*)MALLOC(sizeof(int));\r
+                       BOOL FindFunction = FALSE;\r
+                       \r
+                       FindFunction = c_link(routinename[0],&ilib);\r
+                       if (routinename) {FREE(routinename);routinename = NULL;}\r
+\r
+                       if (Lhs == 2)\r
+                       {\r
+                               int one = 1;\r
+                               int l = 0;\r
+\r
+                               CreateVar(Rhs+2, MATRIX_OF_INTEGER_DATATYPE, &one, &one,&l);\r
+                               *istk(l) = (int)ilib;\r
+                               LhsVar(2)=Rhs+2;\r
+                       }\r
+\r
+                       if ( FindFunction )\r
+                       {\r
+                               *paramoutINT=(int)(TRUE);\r
+                       }\r
+                       else\r
+                       {\r
+                               *paramoutINT=(int)(FALSE);\r
+                       }\r
+                       \r
+                       CreateVarFromPtr(Rhs+1,MATRIX_OF_BOOLEAN_DATATYPE, &n1, &n1, &paramoutINT);\r
+                       LhsVar(1)=Rhs+1;\r
+                       C2F(putlhsvar)();\r
+                       if (paramoutINT) {FREE(paramoutINT);paramoutINT=NULL;}\r
+               }\r
+               else\r
+               {\r
+                       Scierror(999,"%s: Wrong type for input argument: String expected.\n");\r
+               }\r
+       }\r
+       else\r
+       {\r
+               Error(201);\r
+       }\r
+       return 0;\r
+}\r
+/*--------------------------------------------------------------------------*/\r
diff --git a/scilab/modules/dynamic_link/sci_gateway/c/sci_call.c b/scilab/modules/dynamic_link/sci_gateway/c/sci_call.c
new file mode 100644 (file)
index 0000000..f7b4d7a
--- /dev/null
@@ -0,0 +1,22 @@
+/*--------------------------------------------------------------------------*/\r
+/* INRIA 2006 */\r
+/* Allan CORNET */\r
+/*--------------------------------------------------------------------------*/ \r
+#include "gw_dynamic_link.h"\r
+#include "machine.h"\r
+#include "stack-c.h"\r
+/*--------------------------------------------------------------------------*/\r
+extern int C2F(intfort) _PARAMS((char *fname,unsigned long fname_len)); /* fortran */\r
+/*--------------------------------------------------------------------------*/\r
+int C2F(sci_fort) _PARAMS((char *fname,unsigned long fname_len))\r
+{\r
+       C2F(intfort)(fname,fname_len);\r
+       return 0;\r
+}\r
+/*--------------------------------------------------------------------------*/\r
+int C2F(sci_call) _PARAMS((char *fname,unsigned long fname_len))\r
+{\r
+       C2F(intfort)(fname,fname_len);\r
+       return 0;\r
+}\r
+/*--------------------------------------------------------------------------*/\r
diff --git a/scilab/modules/dynamic_link/sci_gateway/c/sci_getdynlibext.c b/scilab/modules/dynamic_link/sci_gateway/c/sci_getdynlibext.c
new file mode 100644 (file)
index 0000000..dd1036f
--- /dev/null
@@ -0,0 +1,29 @@
+/*--------------------------------------------------------------------------*/\r
+/* INRIA 2007 */\r
+/* Allan CORNET */\r
+/*--------------------------------------------------------------------------*/\r
+#include "MALLOC.h"\r
+#include "machine.h"\r
+#include "stack-c.h"\r
+#include "gw_dynamic_link.h"\r
+/*--------------------------------------------------------------------------*/\r
+int C2F(sci_getdynlibext) _PARAMS((char *fname,unsigned long fname_len))\r
+{\r
+       static int n1 = 0, m1 = 0;\r
+       int outIndex = 0 ;\r
+\r
+       CheckRhs(0,0);\r
+       CheckLhs(1,1);\r
+       \r
+       m1= (int)strlen(SHARED_LIB_EXT);\r
+       n1=1;\r
+\r
+       CreateVar( Rhs+1,STRING_DATATYPE,&m1,&n1,&outIndex);\r
+       strcpy(cstk(outIndex), SHARED_LIB_EXT );\r
+\r
+       LhsVar(1) = Rhs+1;\r
+       C2F(putlhsvar)();\r
+\r
+       return 0;\r
+}\r
+/*--------------------------------------------------------------------------*/\r
diff --git a/scilab/modules/dynamic_link/sci_gateway/c/sci_link.c b/scilab/modules/dynamic_link/sci_gateway/c/sci_link.c
new file mode 100644 (file)
index 0000000..9e558d6
--- /dev/null
@@ -0,0 +1,239 @@
+/*-----------------------------------------------------------------------------------*/\r
+/* INRIA 2008 */\r
+/* Allan CORNET */\r
+/*-----------------------------------------------------------------------------------*/ \r
+#include <string.h>\r
+#include "gw_dynamic_link.h"\r
+#include "machine.h"\r
+#include "stack-c.h"\r
+#include "Scierror.h"\r
+#include "dynamic_link.h"\r
+#include "MALLOC.h"\r
+/*-----------------------------------------------------------------------------------*/\r
+static int linkNoRhs(void);\r
+static int linkOneRhsShow(void);\r
+/*-----------------------------------------------------------------------------------*/\r
+int C2F(sci_link) _PARAMS((char *fname,unsigned long fname_len))\r
+{\r
+       BOOL fflag = FALSE;\r
+       int param1int = -1;\r
+\r
+       char *SharedLibraryName = NULL;\r
+\r
+       char **param2 = NULL;\r
+       int sizeparam2 = 0;\r
+\r
+       char *param3flag = NULL;\r
+\r
+       int returnedID = -1;\r
+       int ierr = 0;\r
+\r
+       CheckRhs(0,3);\r
+       CheckLhs(1,1);\r
+\r
+       if (Rhs == 0)\r
+       {\r
+               return linkNoRhs();\r
+       }\r
+       else\r
+       {\r
+               if (Rhs >= 1)\r
+               {\r
+                       if (VarType(1)== sci_matrix)\r
+                       {\r
+                               int m1 = 0, n1 = 0, l1 = 0;\r
+                               GetRhsVar(1,MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&l1);\r
+                               if ( (m1 == n1) && (n1 == 1) )\r
+                               {\r
+                                       param1int= (int)*stk(l1);\r
+                               }\r
+                               else\r
+                               {\r
+                                       Scierror(999,"%s : first argument must be a unique id of a shared library.\r\n",fname);\r
+                                       return 0;\r
+                               }\r
+                       }\r
+                       else if (VarType(1) == sci_strings)\r
+                       {\r
+                               char **strings = NULL;\r
+                               int m1 = 0, n1 = 0, l1 = 0;\r
+                               GetRhsVar(1,MATRIX_OF_STRING_DATATYPE,&m1,&n1,&strings);\r
+\r
+                               if ( (m1 == 1) && (n1 == 1) )\r
+                               {\r
+                                       SharedLibraryName =(char*)MALLOC(sizeof(char)*(strlen(strings[0])+1));\r
+                                       strcpy(SharedLibraryName,strings[0]);\r
+                               }\r
+                               else\r
+                               {\r
+                                       Scierror(999,"%s : first argument must be a unique dynamic library name.\r\n",fname);\r
+                                       return 0;\r
+                               }\r
+\r
+                               if ( (Rhs == 1) && (strcmp(SharedLibraryName,"show")==0) )\r
+                               {\r
+                                       return linkOneRhsShow();\r
+                               }\r
+                       }\r
+                       else\r
+                       {\r
+                               Scierror(999,"Invalid parameter(s).\r\n");\r
+                               return 0;\r
+                       }\r
+               }\r
+\r
+               if (Rhs >= 2)\r
+               {\r
+                       if (VarType(2) == sci_strings)\r
+                       {\r
+                               int m2 = 0, n2 = 0, l2 = 0;\r
+                               GetRhsVar(2,MATRIX_OF_STRING_DATATYPE,&m2,&n2,&param2);\r
+                               if (m2 == 1)\r
+                               {\r
+                                       sizeparam2 = n2;\r
+                               }\r
+                               else\r
+                               {\r
+                                       Scierror(999,"Invalid parameter(s). It requires a vector of strings.\r\n");\r
+                                       return 0;\r
+                               }\r
+                       }\r
+                       else\r
+                       {\r
+                               Scierror(999,"Invalid parameter. It requires a string or a vector of strings.\r\n");\r
+                               return 0;\r
+                       }\r
+               }\r
+\r
+               if (Rhs == 3)\r
+               {\r
+                       int m3 = 0,n3 = 0,l3 = 0;\r
+                       GetRhsVar(3,"c",&m3,&n3,&l3);\r
+                       if ( ( strcmp(cstk(l3),"f") == 0 ) || ( strcmp(cstk(l3),"c") == 0 ) )\r
+                       {\r
+                               param3flag = (char*)MALLOC(sizeof(char)*( strlen( cstk(l3) )+1 ) );\r
+                               strcpy(param3flag,cstk(l3));\r
+                       }\r
+                       else\r
+                       {\r
+                               Scierror(999,"Invalid parameter(s). It must be 'f' or 'c'.\r\n");\r
+                               return 0;\r
+                       }\r
+               }\r
+               else\r
+               {\r
+                       param3flag = (char*)MALLOC(sizeof(char)*( strlen( "f" )+1 ) );\r
+                       strcpy(param3flag,"f");\r
+               }\r
+\r
+               if (strcmp("f",param3flag)==0) fflag = TRUE;\r
+               else fflag = FALSE;\r
+\r
+               returnedID = scilabLink(param1int,SharedLibraryName,param2,sizeparam2,fflag,&ierr);\r
+               switch (ierr)\r
+               {\r
+               case -1:\r
+                       Scierror(236,"%s : the shared archive was not loaded.\n",fname);\r
+                       break;\r
+\r
+               case -2:\r
+                       Scierror(999,"You can't open shared files max. entry %d reached.\r\n",ENTRYMAX);\r
+                       break;\r
+\r
+               case -3:\r
+                       Scierror(999,"Shared lib %d does not exists.\r\n",param1int);\r
+                       break;\r
+\r
+               case -4:\r
+                       Scierror(999," is already loaded from lib %d\r\n",param1int);\r
+                       break;\r
+               case -5:\r
+                       Scierror(235,"%s : problem with one of the entry point.\n",fname);\r
+                       break;\r
+\r
+               default :\r
+                       {\r
+                               int n,l;\r
+                               n=1;\r
+                               CreateVar(Rhs+1, MATRIX_OF_INTEGER_DATATYPE, &n, &n,&l);\r
+                               *istk(l) = (int)returnedID;\r
+                               LhsVar(1)=Rhs+1;\r
+                               C2F(putlhsvar)();\r
+                       }\r
+                       break;\r
+               }\r
+               if (SharedLibraryName) { FREE(SharedLibraryName); SharedLibraryName=NULL;}\r
+       }\r
+       return 0;\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+static int linkNoRhs(void)\r
+{\r
+       int retval = 0;\r
+       static int l1 = 0,n1 = 0,m1 = 0;\r
+       int sizeFunctionsList = 0;\r
+       char ** FunctionsList = NULL;\r
+\r
+       FunctionsList = getNamesOfFunctionsInSharedLibraries(&sizeFunctionsList);\r
+\r
+       if ( (FunctionsList) && (sizeFunctionsList > 0) )\r
+       {\r
+               int i = 0;\r
+               m1 = sizeFunctionsList;\r
+               n1 = 1;\r
+               CreateVarFromPtr(Rhs+1, "S", &n1, &m1, FunctionsList);\r
+\r
+               LhsVar(1)=Rhs+1;\r
+               C2F(putlhsvar)();\r
+\r
+               for (i=0;i < sizeFunctionsList;i++)\r
+               {\r
+                       if (FunctionsList[i])\r
+                       {\r
+                               FREE(FunctionsList[i]);\r
+                               FunctionsList[i]=NULL;\r
+                       }\r
+               }\r
+               FREE(FunctionsList);\r
+               FunctionsList = NULL;\r
+       }\r
+       else\r
+       {\r
+               m1=0;\r
+               n1=0;\r
+               l1=0;\r
+               CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE,  &m1, &n1, &l1);\r
+               LhsVar(1)=Rhs+1;\r
+               C2F(putlhsvar)();\r
+       }\r
+       return retval;\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+static int linkOneRhsShow(void)\r
+{\r
+       int m1 = 0, n1 = 0, l1 = 0;\r
+       int *IdsList = NULL;\r
+       int sizeIds = 0;\r
+\r
+       ShowDynLinks();\r
+       IdsList = getAllIdSharedLib(&sizeIds);\r
+\r
+       if ( (sizeIds>0) && (IdsList) )\r
+       {\r
+               m1=1;\r
+               n1=sizeIds;\r
+               CreateVarFromPtr(Rhs+1, MATRIX_OF_INTEGER_DATATYPE, &m1, &n1, &IdsList);\r
+               if (IdsList) {FREE(IdsList); IdsList=NULL;}\r
+       }\r
+       else\r
+       {\r
+               m1=0;\r
+               n1=0;\r
+               l1=0;\r
+               CreateVar(Rhs+1,MATRIX_OF_DOUBLE_DATATYPE,  &m1, &n1, &l1);\r
+       }\r
+       LhsVar(1)=Rhs+1;\r
+       C2F(putlhsvar)();\r
+       return 0;\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
diff --git a/scilab/modules/dynamic_link/sci_gateway/c/sci_ulink.c b/scilab/modules/dynamic_link/sci_gateway/c/sci_ulink.c
new file mode 100644 (file)
index 0000000..378b4eb
--- /dev/null
@@ -0,0 +1,52 @@
+/*--------------------------------------------------------------------------*/\r
+/* INRIA 2006 */\r
+/* Allan CORNET */\r
+/*--------------------------------------------------------------------------*/\r
+#include <string.h>\r
+#include "gw_dynamic_link.h"\r
+#include "machine.h"\r
+#include "stack-c.h"\r
+#include "localization.h"\r
+#include "Scierror.h"\r
+#include "dynamic_link.h"\r
+/*--------------------------------------------------------------------------*/\r
+int C2F(sci_ulink) _PARAMS((char *fname,unsigned long fname_len))\r
+{\r
+       static int l1,n1,m1;\r
+\r
+       Rhs = Max(0, Rhs);\r
+       CheckRhs(0,1);\r
+       CheckLhs(1,1);\r
+\r
+       if (Rhs == 0)\r
+       {\r
+               unlinkallsharedlib();\r
+       }\r
+       else\r
+       {\r
+               if ( GetType(1) == sci_matrix )\r
+               {\r
+                       double *params=NULL;\r
+                       int i=0;\r
+                       GetRhsVar(1,MATRIX_OF_DOUBLE_DATATYPE,&m1,&n1,&l1);\r
+                       params=stk(l1);\r
+                       for(i=0;i<m1*n1;i++)\r
+                       {\r
+                               integer ilib = (integer)params[i];\r
+                               unlinksharedlib(&ilib);\r
+                       }\r
+               }\r
+               else\r
+               {\r
+                       Scierror(999,_("%s: Wrong type for first input argument: Integer expected.\n"), fname);\r
+                       return 0;\r
+               }\r
+       }\r
+\r
+       LhsVar(1)=0;\r
+       C2F(putlhsvar)();\r
+\r
+       return 0;\r
+\r
+}\r
+/*--------------------------------------------------------------------------*/\r
diff --git a/scilab/modules/dynamic_link/sci_gateway/dynamic_link_gateway.xml b/scilab/modules/dynamic_link/sci_gateway/dynamic_link_gateway.xml
new file mode 100644 (file)
index 0000000..35c3afa
--- /dev/null
@@ -0,0 +1,31 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>\r
+<!DOCTYPE GATEWAY SYSTEM "../../functions/xml/gateway.dtd">\r
+<GATEWAY name="dynamic_link">\r
+<!-- =================== -->\r
+<!--\r
+ Scilab\r
+ Interface description. In this file, we define the list of the function which\r
+ will be available into Scilab and the link to the "native" function.\r
+\r
+ gatewayId is the position in the hashtable 'Interfaces' defined in the\r
+ file SCI/modules/core/src/c/callinterf.h\r
+\r
+ primitiveId is the position in the hashtable '<module>Table Tab[]' defined\r
+ in the file modules/<module>/sci_gateway/c/gw_<module>.c\r
+\r
+ primitiveName is the name of the Scilab function\r
+\r
+ @author Allan CORNET\r
+ @date INRIA 2008\r
+ ===================\r
+ Don't touch if you do not know what you are doing\r
+-->\r
+<!-- =================== -->\r
+<PRIMITIVE gatewayId="58" primitiveId="1" primitiveName="getdynlibext" />\r
+<PRIMITIVE gatewayId="58" primitiveId="2" primitiveName="addinter" />\r
+<PRIMITIVE gatewayId="58" primitiveId="3" primitiveName="fort" />\r
+<PRIMITIVE gatewayId="58" primitiveId="4" primitiveName="call" />\r
+<PRIMITIVE gatewayId="58" primitiveId="5" primitiveName="link" />\r
+<PRIMITIVE gatewayId="58" primitiveId="6" primitiveName="ulink" />\r
+<PRIMITIVE gatewayId="58" primitiveId="7" primitiveName="c_link" />\r
+</GATEWAY>\r
diff --git a/scilab/modules/dynamic_link/sci_gateway/fortran/sci_c_link.f b/scilab/modules/dynamic_link/sci_gateway/fortran/sci_c_link.f
new file mode 100644 (file)
index 0000000..40e81d2
--- /dev/null
@@ -0,0 +1,42 @@
+      subroutine sciislink(fname) \r
+C     ================================================================\r
+C     [%t|%false,number]=c_link(name [,ilib]) \r
+C     checks if name is linked and optionaly linked form lib number ilib\r
+C     ================================================================\r
+      character*(*) fname\r
+cc    implicit undefined (a-z)\r
+      include 'stack.h'\r
+      integer topk,iadr\r
+c      integer m3,n3,lr3,nlr3,m2,n2,il2,ild2,m1,n1,il1,ild1\r
+      integer ilib,iv ,l1\r
+      logical checkrhs,checklhs,crebmat,getscalar,getsmat,cremat\r
+      iadr(l)=l+l-1\r
+      if (.not.checkrhs(fname,1,2)) return\r
+      if (.not.checklhs(fname,1,2)) return\r
+      topk=top\r
+      if (rhs.eq.2) then \r
+         if(.not.getscalar(fname,topk,top,lr))return\r
+         ilib = int(stk(lr))\r
+         top=top-1\r
+      else\r
+         ilib=-1\r
+      endif\r
+      if(.not.getsmat(fname,topk,top,m3,n3,1,1,lr3,nlr3))return\r
+      call cvstr(nlr3,istk(lr3),buf,1)\r
+      buf(nlr3+1:nlr3+1)=char(0)\r
+      call iislink(buf,ilib)\r
+      if (.not.crebmat(fname,top,1,1,lr)) return\r
+      if (ilib.eq.-1)  then \r
+         istk(lr) = 0\r
+      else\r
+         istk(lr) = 1\r
+      endif\r
+      if ( lhs.eq.2) then \r
+         top=top+1\r
+         if (.not.cremat(fname,top,0,1,1,lr,lc)) return\r
+         stk(lr)= ilib\r
+      endif\r
+      return\r
+      end\r
+\r
+\r
diff --git a/scilab/modules/dynamic_link/sci_gateway/fortran/sci_fort.f b/scilab/modules/dynamic_link/sci_gateway/fortran/sci_fort.f
new file mode 100644 (file)
index 0000000..02ee62c
--- /dev/null
@@ -0,0 +1,309 @@
+      subroutine intfort(fname)\r
+c     =====================================\r
+c     interface for the scilab fort command \r
+c     =====================================\r
+      include 'stack.h'\r
+cc      implicit undefined (a-z)\r
+      character*(*) fname\r
+      character*1   type\r
+      logical checkrhs,checklhs,getsmat,checkval,cresmat2,bufstore\r
+      logical flag,getscalar ,getmat,getrhsvar,cremat,lcres\r
+      logical createvar,pulhsvar\r
+      integer gettype,sadr,iadr,top2,tops,topl,topk\r
+\r
+      parameter (fortname=24)\r
+      character  name*25\r
+      common /cinter/ name\r
+      common /ibfu/ ibuf(intersiz*6)\r
+      iadr(l)=l+l-1\r
+      sadr(l)=(l/2)+1\r
+\r
+      call ref2val\r
+      if (rhs .eq. 0) then\r
+         call error(39)\r
+         return\r
+      endif\r
+      nbvars = 0\r
+      flag=.false.\r
+c     maximum number of variables ( see stack.h) \r
+c     \r
+      namax=intersiz\r
+      call iset(namax,0,ladr,1)\r
+c     get a scilab string the fort function name \r
+      top2=top-rhs+1\r
+      if(.not.getsmat(fname,top,top2,m1,n1,1,1,lrc,nc))return\r
+      name=' '\r
+      if ( nc.gt.fortname ) then \r
+         buf = fname // ' first argument must be of length < 24'\r
+         call error(999)\r
+         return\r
+      endif\r
+      call cvstr(nc,istk(lrc),name,1)\r
+      name(nc+1:nc+1)=char(0)\r
+C     Check the name in the <<fort>> table \r
+      call setinterf(name,irep)\r
+      if ( irep.eq.1) then \r
+         buf = name\r
+         call error(50)\r
+         return\r
+      endif\r
+C     test the argument list : search for 'out' or 'sort'\r
+c     ----------------------------------------------------\r
+      do 81 i=1,rhs-1\r
+         tops=top2+i\r
+         itype = gettype(tops) \r
+         if ( itype.eq.10 ) then \r
+            if(.not.getsmat(fname,top,tops,m1,n1,1,1,lr1,nlr1)) return\r
+            if(.not.checkval(fname,m1*n1,1)) return\r
+            lbuf=1\r
+            if(.not.bufstore(fname,lbuf,lbufi1,lbuff1,lr1,nlr1)) return\r
+            if (buf(lbufi1:lbuff1).eq.'sort'.or.\r
+     $           buf(lbufi1:lbuff1).eq.'out') goto 82 \r
+         endif\r
+ 81   continue\r
+c     'sort' or 'out' are not in the calling list we use the brief form \r
+C     we call the routine directly \r
+C     the routine must deal itself with the stack \r
+c     ----------------------------------------------------\r
+      call interf1(name(1:nc))\r
+      nbvars = 0\r
+      return\r
+c     Now the long form \r
+c     -----------------\r
+ 82   continue\r
+c     for the long form the call to interf is hardcoded \r
+c     with a limit of 30 arguments\r
+      namax=min(intersiz,30)\r
+c     ie : number of input arguments \r
+      ie=(tops-1-top2)/3\r
+c     computing iss : \r
+c     number of output variables described after the 'out'  string \r
+c     -----------------\r
+      jjj=tops+1\r
+      iss=0\r
+ 86   if ( jjj.gt.top) goto 861\r
+      itype = gettype(jjj)\r
+      if (itype.eq.1) then \r
+         if(.not.getmat(fname,top,jjj,it1,m,n,lr1,lc1)) return\r
+         if( m*n.eq.2 ) then \r
+            jjj = jjj+3 \r
+         else\r
+            jjj = jjj+1 \r
+         endif\r
+         iss = iss+1\r
+      else\r
+         err= jjj-top2+1\r
+         call cvname(ids(1,pt+1),fname,0)\r
+         call error(81) \r
+         return\r
+      endif\r
+      goto 86 \r
+ 861  continue\r
+      if( iss.gt.0 .and. lhs.gt.iss) then\r
+         call error(41)\r
+         return\r
+      endif\r
+      if( err.gt.0) return\r
+      ieis=ie+iss\r
+      if(ie.ne.0) then \r
+c     input arguments \r
+c     storing information in ibuf for each input variable\r
+c     ibuf(6*(i-1)+ j) \r
+c       j=1,2,3,4,5,6 ==>[call position,adress of data,type, nrow,ncol\r
+c         number-in-the-caling-stack]\r
+c     -------------------------------------------------------------\r
+         do 87 i=1,ie\r
+            ir1=top2+1+3*(i-1)\r
+            if(.not.getsmat(fname,top,ir1+2,m1,n1,1,1,lr1,nlr1)) return\r
+            if( m1*n1.ne.1.or.nlr1.ne.1) then \r
+               buf = fname // ': argument must be "c","d","i",or "r"'\r
+               call error(999)\r
+               return\r
+            endif\r
+c           stack-position \r
+            ibuf(6+6*(i-1)) = ir1-top2+1\r
+            call cvstr(nlr1,istk(lr1),type,1)\r
+            ibuf(3+6*(i-1)) = ichar(type)\r
+            if(.not.getscalar(fname,top,ir1+1,lr1))return\r
+            ibuf(1+6*(i-1)) = int(stk(lr1))\r
+            if(.not.getrhsvar(2+3*(i-1),type,m1,n1,lr1)) return\r
+            ibuf(2+6*(i-1)) = lr1 \r
+            ibuf(4+6*(i-1)) = m1\r
+            ibuf(5+6*(i-1)) = n1\r
+            if (type.eq.'d' ) then \r
+               ladr(ibuf(1+6*(i-1))) = lr1 \r
+            else if (type.eq.'r') then \r
+               ladr(ibuf(1+6*(i-1))) = sadr(lr1)\r
+            else if (type.eq.'i') then \r
+               ladr(ibuf(1+6*(i-1))) = sadr(lr1)\r
+            else if (type.eq.'c') then \r
+               call cs2st(lr1,lr2)\r
+               ladr(ibuf(1+6*(i-1))) = lr2\r
+            endif\r
+\r
+ 87      continue\r
+      endif\r
+c     Output variables \r
+c     -------------------------------------------------------------\r
+c     icre will output variables which need to be created\r
+      icre=0\r
+      jjj=tops+1\r
+      if(iss.eq.0) goto 95\r
+      do 94 i=1,iss\r
+         ilm=iadr(lstk(jjj))\r
+         if(istk(ilm+1)*istk(ilm+2).eq.1) then \r
+c           output variable is described by position only \r
+            ipla=int(stk(sadr(ilm+4)))\r
+c           get the data of the associated input var \r
+            do 91 j=1,ie\r
+               jj=6*(j-1)\r
+               if(ibuf(jj+1).eq.ipla) then \r
+                  call icopy(6,ibuf(jj+1),1,ibuf(6*(ie+i-1)+1),1)\r
+                  jjj=jjj+1\r
+                  goto 94 \r
+               endif\r
+ 91         continue\r
+            buf = fname // ': output variable described by position'\r
+     $          // ' must be an input variable'\r
+            call error(999)\r
+         else\r
+c           explicit dimension of the output var \r
+            if(.not.getsmat(fname,top,jjj+2,m1,n1,1,1,lr1,nlr1)) return\r
+            if( m1*n1.ne.1.or.nlr1.ne.1) then \r
+               buf = fname // ': argument must be "c","d","i",or "r"'\r
+               call error(999)\r
+               return\r
+            endif\r
+            call cvstr(nlr1,istk(lr1),type,1)\r
+            if(.not.getscalar(fname,top,jjj+1,lr1))return\r
+            ipla = int(stk(lr1))\r
+            if(.not.getmat(fname,top,jjj,it1,m1,n1,lr1,lc1)) return\r
+            if (m1*n1.ne.2) then \r
+               buf = fname \r
+     $              // 'Output argument dimension must be [nr,nc]'\r
+               call error(999)\r
+               return\r
+            endif\r
+            m1 = int(stk(lr1))\r
+            n1 = int(stk(lr1+1))\r
+c           maybe this output variable was also an input variable\r
+c           we must check that dimensions and type are compatible \r
+            iecor=0\r
+            do 910 j=1,ie\r
+               jj=6*(j-1)\r
+               if(ibuf(jj+1).eq.ipla) then \r
+                  iecor= j\r
+                  goto 911\r
+               endif\r
+ 910        continue\r
+ 911        continue \r
+            if ( iecor.eq.0 ) then \r
+c           we must create a new entry \r
+c           for an output variable \r
+               icre=icre+1\r
+               if (.not.createvar(rhs+icre,type,m1,n1,lr1)) return\r
+               ipos=6*(ie+i-1)\r
+               ibuf(ipos+1) = ipla  \r
+               ibuf(ipos+2) = lr1\r
+               ibuf(ipos+3) = ichar(type)\r
+               ibuf(ipos+4) = m1\r
+               ibuf(ipos+5) = n1 \r
+               ibuf(ipos+6) = rhs + icre \r
+               narg = ibuf(6*(ie+i-1)+1)\r
+               if(narg.gt.namax) then\r
+                  call error(70)\r
+                  return\r
+               endif            \r
+               if (type.eq.'d' ) then \r
+                  ladr(ipla) = lr1 \r
+               else if (type.eq.'r') then \r
+                  ladr(ipla) = sadr(lr1)\r
+               else if (type.eq.'i') then \r
+                  ladr(ipla) = sadr(lr1)\r
+               else if (type.eq.'c') then \r
+                  ladr(ipla) = sadr((lr1/4)+1)\r
+               endif\r
+            else\r
+c           we must check input-output consistency \r
+               ii=6*(iecor-1)\r
+               if (m1*n1.gt.ibuf(ii+4)*ibuf(ii+5)\r
+     $              .or.ichar(type).ne.ibuf(ii+3)) then\r
+                  buf = fname // ': incompatibility between '\r
+     $                 //'input and output variable'\r
+                  call error(999)\r
+                  return\r
+               endif\r
+               ibuf(ii+4)=m1\r
+               ibuf(ii+5)=n1\r
+               call icopy(6,ibuf(ii+1),1,ibuf(6*(ie+i-1)+1),1)\r
+            endif\r
+            jjj=jjj+3\r
+         endif\r
+ 94   continue\r
+ 95   continue\r
+      call interf(stk(ladr(1)),stk(ladr(2)),\r
+     $     stk(ladr(3)),stk(ladr(4)),stk(ladr(5)),stk(ladr(6)),\r
+     $     stk(ladr(7)),stk(ladr(8)),stk(ladr(9)),stk(ladr(10)),\r
+     $     stk(ladr(11)),stk(ladr(12)),stk(ladr(13)),stk(ladr(14)),\r
+     $     stk(ladr(15)),stk(ladr(16)),stk(ladr(17)),stk(ladr(18)),\r
+     $     stk(ladr(19)),stk(ladr(20)),stk(ladr(21)),stk(ladr(22)),\r
+     $     stk(ladr(23)),stk(ladr(24)),stk(ladr(25)),stk(ladr(26)),\r
+     $     stk(ladr(27)),stk(ladr(28)),stk(ladr(29)),stk(ladr(30)))\r
+      if(iss.le.0) then\r
+         top=top2\r
+         call objvide(fname,top)\r
+      else\r
+c        check if output variabe are in increasing order in the stack \r
+         lcres=.true.\r
+         ibufprec=0\r
+         do 105 i=1,lhs \r
+            ir1= 6*(ie+1-1)\r
+            if ( ibuf(ir1+1).lt.ibufprec) then \r
+               lcres=.false.\r
+               goto 106 \r
+            else\r
+               ibufprec = ibuf(ir1+1)\r
+            endif\r
+ 105     continue\r
+ 106     continue\r
+         if ( lcres) then \r
+            top=top2-1\r
+         else\r
+            topk=top2-1\r
+            topl=top+icre\r
+            top=topl\r
+         endif\r
+         ir1= 6*(ie+1-1)\r
+         do 104 i=1,lhs\r
+            top=top+1\r
+            type=char(ibuf(ir1+3)) \r
+            m = ibuf(ir1+4)\r
+            n = ibuf(ir1+5)\r
+c     Warning : in the following code copy for \r
+c     overlapping object is necessary \r
+            if (type.eq.'d') then \r
+               if (.not.cremat(fname,top,0,m,n,lr1,lc1)) return\r
+               call unsfdcopy(m*n,stk(ibuf(ir1+2)),1,stk(lr1),1)\r
+            else if (type.eq.'i') then \r
+               if (.not.cremat(fname,top,0,m,n,lr1,lc1)) return\r
+               call stacki2d(m*n,ibuf(ir1+2),lr1)\r
+            else if (type.eq.'r') then \r
+               if (.not.cremat(fname,top,0,m,n,lr1,lc1)) return\r
+               call stackr2d(m*n,ibuf(ir1+2),lr1)\r
+            else if (type.eq.'c') then \r
+               if (.not.cresmat2(fname,top,m*n,lr1)) return\r
+               l1=ibuf(ir1+2)\r
+               call stackc2i(m*n,l1,lr1)\r
+            endif\r
+            ir1=ir1+6\r
+ 104     continue\r
+         if (.not.lcres) then \r
+            do 107 i=1,lhs \r
+               call copyobj(fname,topl+i,topk+i)\r
+ 107        continue\r
+            top=topk+lhs\r
+         endif\r
+      endif\r
+      nbvars = 0\r
+      return\r
+      end\r
diff --git a/scilab/modules/dynamic_link/src/c/AddFunctionInTable.c b/scilab/modules/dynamic_link/src/c/AddFunctionInTable.c
new file mode 100644 (file)
index 0000000..80b6418
--- /dev/null
@@ -0,0 +1,57 @@
+/*--------------------------------------------------------------------------*/\r
+/* INRIA 2008 */\r
+/*--------------------------------------------------------------------------*/ \r
+#include <string.h>\r
+#include "AddFunctionInTable.h"\r
+#include "dynamic_link.h"\r
+#include "MALLOC.h"\r
+/*--------------------------------------------------------------------------*/\r
+#define MAXNAME 32\r
+static char buf[MAXNAME];\r
+/*--------------------------------------------------------------------------*/\r
+static BOOL SearchComp(FTAB *Ftab, char *op, void (**realop) ());\r
+static void Emptyfunc(void) {}\r
+/*--------------------------------------------------------------------------*/\r
+voidf AddFunctionInTable (char *name, int *rep, FTAB *table)\r
+{\r
+       void (*loc)();\r
+       char *s = NULL;\r
+\r
+       strncpy(buf,name,MAXNAME);\r
+       s=buf;\r
+       while ( *s != ' ' && *s != '\0') { s++;};\r
+       *s= '\0';\r
+\r
+       if ( ( SearchComp(table,buf,&loc) == TRUE) || ( SearchInDynLinks(buf,&loc) >= 0 ) )\r
+       {\r
+               *rep = 0;\r
+       }\r
+       else\r
+       {\r
+               loc = Emptyfunc;\r
+               *rep = 1;\r
+       }\r
+       return(loc);\r
+}\r
+/*--------------------------------------------------------------------------*/\r
+static BOOL SearchComp(FTAB *Ftab, char *op, void (**realop) ())\r
+{\r
+       int i=0;\r
+       while ( Ftab[i].name != (char *) 0) \r
+       {\r
+               int j=0;\r
+               j = strcmp(op,Ftab[i].name);\r
+               if ( j == 0 )\r
+               {\r
+                       *realop = Ftab[i].f;\r
+                       return TRUE;\r
+               }\r
+               else\r
+               { \r
+                       if ( j <= 0) return FALSE;\r
+                       else i++;\r
+               }\r
+       }\r
+       return FALSE;\r
+}\r
+/*--------------------------------------------------------------------------*/\r
diff --git a/scilab/modules/dynamic_link/src/c/DllmainIncremental_link.c b/scilab/modules/dynamic_link/src/c/DllmainIncremental_link.c
new file mode 100644 (file)
index 0000000..0fc7a76
--- /dev/null
@@ -0,0 +1,25 @@
+/*--------------------------------------------------------------------------*/\r
+/* INRIA 2007 */\r
+/* Allan CORNET */\r
+/*--------------------------------------------------------------------------*/ \r
+#include <windows.h> \r
+/*--------------------------------------------------------------------------*/ \r
+#pragma comment(lib,"../../../../bin/intl.lib")\r
+/*--------------------------------------------------------------------------*/ \r
+int WINAPI DllMain (HINSTANCE hInstance , DWORD reason, PVOID pvReserved)\r
+{\r
+       switch (reason) \r
+       {\r
+       case DLL_PROCESS_ATTACH:\r
+               break;\r
+       case DLL_PROCESS_DETACH:\r
+               break;\r
+       case DLL_THREAD_ATTACH:\r
+               break;\r
+       case DLL_THREAD_DETACH:\r
+               break;\r
+       }\r
+       return 1;\r
+}\r
+/*--------------------------------------------------------------------------*/ \r
+\r
diff --git a/scilab/modules/dynamic_link/src/c/LibScilab_Import.def b/scilab/modules/dynamic_link/src/c/LibScilab_Import.def
new file mode 100644 (file)
index 0000000..f5b2a9e
--- /dev/null
@@ -0,0 +1,25 @@
+       LIBRARY    Libscilab.dll\r
+\r
+\r
+EXPORTS\r
+;core\r
+;\r
+iop_\r
+stack_\r
+com_\r
+funtab_\r
+namstr_\r
+getWarningMode\r
+getrhsvar_\r
+createvar_\r
+gettype_\r
+putlhsvar_\r
+checklhs_\r
+checkrhs_\r
+vstk_\r
+intersci_\r
+createvarfromptr_\r
+callFunctionFromGateway\r
+ExceptionMessage\r
+vartype_\r
+cvname_\r
diff --git a/scilab/modules/dynamic_link/src/c/addinter.c b/scilab/modules/dynamic_link/src/c/addinter.c
new file mode 100644 (file)
index 0000000..8c6875c
--- /dev/null
@@ -0,0 +1,203 @@
+/*-----------------------------------------------------------------------------------*/\r
+#include <string.h> \r
+#include <stdio.h>\r
+#include "core_math.h"\r
+#include "dynamic_link.h"\r
+#include "../../../string/includes/men_Sutils.h"\r
+#include "addinter.h" \r
+\r
+#include "stack-def.h"\r
+#include "MALLOC.h" /* MALLOC */\r
+#include "sciprint.h"\r
+#include "Funtab.h"\r
+#include "warningmode.h"\r
+#include "GetenvB.h"\r
+#include "localization.h"\r
+#ifdef _MSC_VER\r
+#include "ExceptionMessage.h"\r
+#endif\r
+\r
+\r
+extern int C2F(error)  __PARAMS((integer *n));  \r
+\r
+#include <stdlib.h>\r
+\r
+#define MAXINTERF 50\r
+#define INTERFSIZE 25 \r
+/*-----------------------------------------------------------------------------------*/\r
+extern int C2F(cvname)();\r
+/*-----------------------------------------------------------------------------------*/\r
+typedef struct \r
+{\r
+       char name[INTERFSIZE]; /** name of interface **/\r
+       void (*func)();        /** entrypoint for the interface **/\r
+       int Nshared; /** id of the shared library **/\r
+       BOOL ok;    /** flag set to TRUE if entrypoint can be used **/\r
+} InterfaceElement;\r
+\r
+InterfaceElement DynInterf[MAXINTERF];\r
+/*-----------------------------------------------------------------------------------*/\r
+static int LastInterf=0;\r
+static void initializeInterfaces(void);\r
+/*-----------------------------------------------------------------------------------*/\r
+int AddInterfaceToScilab(char *filenamelib,char *spname,char **fcts,int sizefcts)\r
+{\r
+       int ierr = 0;\r
+       int i = 0;\r
+       int inum = 0;\r
+       int k1 = 0;\r
+       int id[nsiz],zero=0,trois=3,fptr = 0,fptr1 = 0,quatre=4;\r
+\r
+       initializeLink();\r
+       initializeInterfaces();\r
+\r
+       /** Try to unlink the interface if it was previously linked **/\r
+\r
+       for ( i = 0 ; i < LastInterf ; i++) \r
+       {\r
+               if (strcmp(spname,DynInterf[i].name) == 0) \r
+               {\r
+                       unlinksharedlib(&DynInterf[i].Nshared);\r
+                       break;\r
+               }\r
+       }\r
+\r
+       /** Try to find a free position in the interface table : inum **/\r
+       inum=-1;\r
+       for ( i = 0 ; i < LastInterf ; i++) if ( DynInterf[i].ok == 0 ) inum= i;\r
+\r
+       inum = ( inum == -1 ) ? LastInterf : inum ;\r
+\r
+       /** Linking Files and add entry point name iname */\r
+\r
+       if ( inum >=  MAXINTERF ) \r
+       {\r
+               ierr = -1;\r
+               return ierr;\r
+       }\r
+       else\r
+       {\r
+               int IdLib = -1;\r
+               int idinput = -1;\r
+               int ierr1 = 0;\r
+               int one = 1;\r
+               char **subname = NULL;\r
+\r
+               subname = (char **)MALLOC(sizeof (char*));\r
+               subname[0]= spname;\r
+\r
+               /* link then search  */ \r
+               IdLib =scilabLink(idinput,filenamelib,subname,one,TRUE,&ierr1);\r
+               subname[0]= NULL;\r
+               if (subname) { FREE(subname);subname = NULL;}\r
+\r
+               if ( IdLib < 0 ) return IdLib;\r
+\r
+               /** store the linked function in the interface function table DynInterf **/\r
+               DynInterf[inum].Nshared = IdLib;\r
+\r
+               if ( SearchInDynLinks(spname,&DynInterf[inum].func) < 0 ) \r
+               {\r
+                       /* Maximum number of dynamic interfaces */\r
+                       ierr = -6;\r
+                       return ierr;\r
+               }\r
+               else\r
+               {\r
+                       strncpy(DynInterf[inum].name,spname,INTERFSIZE);\r
+                       DynInterf[inum].ok = TRUE;\r
+               }\r
+               if ( inum == LastInterf ) LastInterf++;\r
+\r
+               k1 = inum+1;\r
+               for (i = 0;i < sizefcts; i++)\r
+               {\r
+                       C2F(cvname)(id,fcts[i],&zero,strlen(fcts[i]));\r
+                       fptr1 = fptr = (DynInterfStart+k1)*100 +(i+1);\r
+                       C2F(funtab)(id,&fptr1,&quatre,"NULL_NAME",0); /* clear previous def set fptr1 to 0*/\r
+                       C2F(funtab)(id,&fptr,&trois,"NULL_NAME",0);  /* reinstall */\r
+               }\r
+       }\r
+       return ierr;\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+static void initializeInterfaces(void)\r
+{\r
+       static int first_entry = 0;\r
+\r
+       if ( first_entry == 0) \r
+       {\r
+               int i = 0;\r
+               for ( i= 0 ; i < MAXINTERF ; i++) \r
+               {\r
+                       strcpy(DynInterf[i].name,"");\r
+                       DynInterf[i].func = NULL;\r
+\r
+                       DynInterf[i].Nshared = -1;\r
+                       DynInterf[i].ok = FALSE;\r
+               }\r
+\r
+               first_entry++;\r
+       }\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+/*********************************\r
+* used in unlinksharedlib(i) \r
+*********************************/\r
+void RemoveInterf(int Nshared)\r
+{\r
+       int i;\r
+       for ( i = 0 ; i < LastInterf ; i++ ) \r
+       {\r
+               if ( DynInterf[i].Nshared == Nshared ) \r
+               {\r
+                       DynInterf[i].ok = FALSE;\r
+                       break;\r
+               }\r
+       }\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+/************************************************\r
+* Used when one want to call a function added \r
+* with addinterf the dynamic interface number \r
+* is given by k1=(*k/100)-1\r
+************************************************/\r
+void C2F(userlk)(integer *k)\r
+{\r
+       int k1 = *k - (DynInterfStart+1) ;\r
+       int imes = 9999;\r
+       if ( k1 >= LastInterf || k1 < 0 ) \r
+       {\r
+               if (getWarningMode()) sciprint(_(" results may be inaccurate. rcond = %s\n"),k1);\r
+               C2F(error)(&imes);\r
+               return;\r
+       }\r
+       if ( DynInterf[k1].ok == 1 ) \r
+       {\r
+#ifdef _MSC_VER\r
+#ifndef _DEBUG\r
+               _try\r
+               {\r
+                       (*DynInterf[k1].func)();\r
+               }\r
+               _except (EXCEPTION_EXECUTE_HANDLER)\r
+               {\r
+                       ExceptionMessage(GetExceptionCode(),DynInterf[k1].name);\r
+               }\r
+#else\r
+               (*DynInterf[k1].func)();\r
+#endif\r
+#else\r
+               (*DynInterf[k1].func)();\r
+#endif\r
+       }\r
+       else \r
+       {\r
+               if (getWarningMode()) sciprint(_("Interface %s not linked.\n"),DynInterf[k1].name);\r
+               C2F(error)(&imes);\r
+               return;\r
+       }\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+\r
+\r
diff --git a/scilab/modules/dynamic_link/src/c/dynamic_link.c b/scilab/modules/dynamic_link/src/c/dynamic_link.c
new file mode 100644 (file)
index 0000000..a498f3d
--- /dev/null
@@ -0,0 +1,380 @@
+/*-----------------------------------------------------------------------------------*/\r
+/* INRIA 2007 */\r
+/*-----------------------------------------------------------------------------------*/\r
+#include <string.h> \r
+#include <stdio.h>\r
+#include <stdlib.h>\r
+#include "dynamic_link.h"\r
+#include "dynamiclibrary.h"\r
+#include "../../../string/includes/men_Sutils.h"\r
+#include "MALLOC.h" /* MALLOC */\r
+#include "warningmode.h"\r
+#include "sciprint.h"\r
+#include "stack-c.h"\r
+#include "addinter.h"\r
+#include "localization.h"\r
+#include "Scierror.h"\r
+/*-----------------------------------------------------------------------------------*/\r
+static void Underscores(int isfor, char *ename, char *ename1);\r
+static int SearchFandS(char *op, int ilib);\r
+/*-----------------------------------------------------------------------------------*/\r
+#define MAXNAME  256 \r
+#define TMPL 256\r
+#define debug C2F(iop).ddt==1\r
+/*-----------------------------------------------------------------------------------*/\r
+typedef char Name[MAXNAME];   /* could be changed to dynamic structure */\r
+\r
+typedef void (*function) ();\r
+\r
+typedef struct \r
+{ \r
+       function epoint;            /* the entry point */ \r
+       Name     name;              /* entry point name */\r
+       int      Nshared;           /* number of the shared file */\r
+} Epoints;\r
+\r
+typedef struct \r
+{\r
+       int ok;\r
+       char tmp_file[TMPL];\r
+       unsigned long  shl;\r
+} Hd;\r
+\r
+static Hd  hd[ENTRYMAX]; /* shared libs handler */\r
+static int Nshared = 0;\r
+static int NEpoints = 0; /* Number of Linked names */\r
+static Epoints EP[ENTRYMAX];  /* entryPoints */\r
+/*-----------------------------------------------------------------------------------*/\r
+int scilabLink(int idsharedlibrary,\r
+                          char *filename,\r
+                          char **subnamesarray,int sizesubnamesarray,\r
+                          BOOL fflag,int *ierr)\r
+{\r
+       int IdSharedLib = -1; \r
+\r
+       initializeLink();\r
+\r
+       if (idsharedlibrary == -1) IdSharedLib= Sci_dlopen(filename);\r
+       else IdSharedLib = idsharedlibrary;\r
+\r
+       if (IdSharedLib == -1 ) \r
+       {\r
+               if ( getWarningMode() ) sciprint("link failed for dynamic library '%s'.\r\n",filename);\r
+               *ierr = -1;\r
+               return IdSharedLib;\r
+       }\r
+       if ( (idsharedlibrary == -1) && getWarningMode() ) \r
+       {\r
+               sciprint("shared archive loaded.\r\n");\r
+               sciprint("Link done.\r\n");\r
+       }\r
+\r
+       if (sizesubnamesarray > 0)\r
+       {\r
+               int errorcode = 0;\r
+               int i = 0;\r
+               for(i = 0; i < sizesubnamesarray ; i++)\r
+               {\r
+                       if (fflag) errorcode = Sci_dlsym(subnamesarray[i],IdSharedLib,"f");\r
+                       else errorcode = Sci_dlsym(subnamesarray[i],IdSharedLib,"c");\r
+\r
+                       if (errorcode < 0) *ierr = errorcode;\r
+               }\r
+       }\r
+       return IdSharedLib;\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+int *getAllIdSharedLib(int *sizeList)\r
+{\r
+       int *ListId = NULL;\r
+       int i = 0;\r
+\r
+       *sizeList = 0;\r
+       for ( i = 0 ; i < Nshared ; i++) \r
+       {\r
+               if ( hd[i].ok == TRUE) \r
+               {\r
+                       (*sizeList)++;\r
+                       if (ListId)\r
+                       {\r
+                               ListId = (int *)REALLOC(ListId,(*sizeList)*sizeof(int));\r
+                               ListId[(*sizeList)-1] = i;\r
+                       }\r
+                       else\r
+                       {\r
+                               ListId = (int *)MALLOC((*sizeList)*sizeof(int));\r
+                               ListId[(*sizeList)-1] = i;\r
+                       }\r
+               }\r
+       }\r
+       return ListId;\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+char **getNamesOfFunctionsInSharedLibraries(int *sizearray)\r
+{\r
+       char **NamesOfFunctions = NULL;\r
+       *sizearray = 0;\r
+\r
+       if (NEpoints)\r
+       {\r
+               int i=0;\r
+               for ( i = NEpoints-1 ; i >=0 ; i--) \r
+               {\r
+                       if (EP[i].name)\r
+                       {\r
+                               char *EntryName=(char *)MALLOC(strlen(EP[i].name)*sizeof(char));\r
+\r
+                               (*sizearray)++;\r
+                               if (NamesOfFunctions) NamesOfFunctions = (char **) REALLOC(NamesOfFunctions,(*sizearray)*sizeof(char *));\r
+                               else NamesOfFunctions = (char **) MALLOC((*sizearray)*sizeof(char *));\r
+\r
+                               sprintf(EntryName,"%s",EP[i].name);\r
+                               NamesOfFunctions[(*sizearray)-1]=EntryName;\r
+                       }\r
+               }\r
+       }\r
+       return NamesOfFunctions;\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+/**\r
+* Underscores : deals with the trailing _ \r
+* in entry names \r
+*/\r
+static void Underscores(int isfor, char *ename, char *ename1)\r
+{\r
+#ifdef WLU1\r
+       *ename1='_'; ename1++;\r
+#endif\r
+       strcpy(ename1,ename);\r
+#ifdef WTU\r
+       if (isfor==1) strcat(ename1,"_");\r
+#endif\r
+       return;\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+void initializeLink(void)\r
+{\r
+       static int first_entry = 0;\r
+       int i;\r
+       if ( first_entry == 0)\r
+       {\r
+               for ( i = 0 ; i < ENTRYMAX ; i++) \r
+               {\r
+                       hd[i].ok= FALSE;\r
+                       hd[i].shl =\r
+                               EP[i].Nshared = -1;\r
+               }\r
+               first_entry++;\r
+       }\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+BOOL c_link(char *routinename,int *ilib)\r
+{\r
+       void (*loc)();\r
+       if ( *ilib != -1 ) *ilib = SearchFandS(routinename,*ilib);\r
+       else *ilib = SearchInDynLinks(routinename,&loc);\r
+\r
+       if (*ilib == -1) return FALSE;\r
+       return TRUE;\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+void C2F(iislink)(char *routinename, integer *ilib)\r
+{\r
+       c_link(routinename,ilib);\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+void GetDynFunc(int ii, void (**realop) ())\r
+{\r
+       if ( EP[ii].Nshared != -1 ) *realop = EP[ii].epoint;\r
+       else *realop = (function) 0;\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+int SearchInDynLinks(char *op, void (**realop) ())\r
+{\r
+       int i=0;\r
+       for ( i = NEpoints-1 ; i >=0 ; i--) \r
+       {\r
+               if ( strcmp(op,EP[i].name) == 0) \r
+               {\r
+                       *realop = EP[i].epoint;\r
+                       return(EP[i].Nshared );\r
+               }\r
+       }\r
+       return(-1);\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+/**\r
+* Search a (function,libid) in the table \r
+* Search from end to top \r
+*/\r
+static int SearchFandS(char *op, int ilib)\r
+{\r
+       int i = 0;\r
+       for ( i = NEpoints-1 ; i >=0 ; i--) \r
+       {\r
+               if ( strcmp(op,EP[i].name) == 0 && EP[i].Nshared == ilib)\r
+               {\r
+                       return(i);\r
+               }\r
+       }\r
+       return(-1);\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+void ShowDynLinks(void)\r
+{\r
+       int i=0,count=0;\r
+       if (getWarningMode()) sciprint(_("Number of entry points %d.\nShared libraries :\n"),NEpoints);\r
+       if (getWarningMode())sciprint("[ ");\r
+       for ( i = 0 ; i < Nshared ; i++) \r
+       {\r
+               if ( hd[i].ok == TRUE) { if (getWarningMode())sciprint("%d ",i);count++;}\r
+       }\r
+       if (getWarningMode()) sciprint(_("] : %d libraries.\n"),count);\r
+\r
+       for ( i = NEpoints-1 ; i >=0 ; i--) \r
+       {\r
+               if (getWarningMode()) sciprint(_("Entry point %s in shared library %d.\n"),EP[i].name,EP[i].Nshared);\r
+       }\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+void unlinkallsharedlib(void)\r
+{\r
+       int i=0;\r
+       for ( i = 0 ; i < Nshared ; i++) if ( hd[i].ok == TRUE) Sci_Delsym(i);\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+void unlinksharedlib(integer *i) \r
+{\r
+       /* delete entry points in shared lib *i */\r
+       Sci_Delsym(*i);\r
+       /* delete entry points used in addinter in shared lib *i */\r
+       RemoveInterf(*i);\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+int Sci_dlopen( char *loaded_file)\r
+{\r
+       int retval = 0; /* if >=0 id else error code*/\r
+       static DynLibHandle  hd1 = NULL;\r
+       int i = 0;\r
+\r
+       hd1 = LoadDynLibrary (loaded_file);\r
+\r
+       if ( hd1 == NULL )  return -1 ; /* the shared archive was not loaded. */\r
+\r
+       for ( i = 0 ; i < Nshared ; i++ ) \r
+       {\r
+               if ( hd[i].ok == FALSE) \r
+               {\r
+                       /* Warning x64 windows */\r
+                       #ifdef _MSC_VER\r
+                       hd[i].shl =  PtrToUlong(hd1);\r
+                       #else\r
+                       hd[i].shl = (unsigned long)hd1;\r
+                       #endif\r
+                       \r
+                       hd[i].ok = TRUE;\r
+                       return(i);\r
+               }\r
+       }\r
+\r
+       if ( Nshared == ENTRYMAX ) \r
+       {\r
+               if (getWarningMode()) sciprint("You can't open shared files maxentry %d reached\r\n",ENTRYMAX);\r
+               return(FALSE);\r
+       }\r
+       /* Warning x64 windows */\r
+       #ifdef _MSC_VER\r
+       hd[Nshared].shl =   PtrToUlong(hd1);\r
+       #else\r
+       hd[Nshared].shl = (unsigned long)hd1;\r
+       #endif\r
+       hd[Nshared].ok = TRUE;\r
+       Nshared ++;\r
+       retval = Nshared-1;\r
+\r
+       return retval;\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+int Sci_dlsym(char *ename,int ishared,char *strf)\r
+{\r
+       int ierr = 0;\r
+       DynLibHandle  hd1 = NULL;\r
+       int ish = Min(Max(0,ishared),ENTRYMAX-1);\r
+       char enamebuf[MAXNAME];\r
+\r
+       if ( strf[0] == 'f' ) Underscores(1,ename,enamebuf);\r
+       else Underscores(0,ename,enamebuf);\r
+\r
+       /* lookup the address of the function to be called */\r
+       if ( NEpoints == ENTRYMAX ) \r
+       {\r
+               ierr = -1;\r
+               return ierr;\r
+       }\r
+       if ( hd[ish].ok == FALSE )\r
+       {\r
+               ierr = -3;\r
+               return ierr;\r
+       }\r
+       /** entry was previously loaded **/\r
+       if ( SearchFandS(ename,ish) >= 0 ) \r
+       {\r
+               sciprint("Entry name %s \r\n",ename);\r
+               ierr = -4;\r
+       }\r
+       else\r
+       {\r
+               /* Warning x64 windows */\r
+               #ifdef _MSC_VER\r
+               hd1 = (DynLibHandle)  ULongToHandle(hd[ish].shl);\r
+               #else\r
+               hd1 = (DynLibHandle)  hd[ish].shl;\r
+               #endif\r
+               EP[NEpoints].epoint = (function) GetDynLibFuncPtr (hd1,enamebuf);\r
+               if ( EP[NEpoints].epoint == NULL )\r
+               {\r
+                       if (getWarningMode()) sciprint("%s is not an entry point \r\n",enamebuf);\r
+                       ierr = -5;\r
+               }\r
+               else \r
+               {\r
+                       /* we don't add the _ in the table */\r
+                       if (debug) sciprint("Linking %s \r\n",ename);\r
+                       strncpy(EP[NEpoints].name,ename,MAXNAME);\r
+                       EP[NEpoints].Nshared = ish;\r
+                       NEpoints++;\r
+               }\r
+       }\r
+       return ierr;  \r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
+void Sci_Delsym(int ishared) \r
+{\r
+       int ish = Min(Max(0,ishared),ENTRYMAX-1);\r
+       int i=0;\r
+       for ( i = NEpoints-1 ; i >=0 ; i--) \r
+       {\r
+               if ( EP[i].Nshared == ish )\r
+               {\r
+                       int j;\r
+                       for ( j = i ; j <= NEpoints - 2 ; j++ )\r
+                       {\r
+                               EP[j].epoint = EP[j+1].epoint;\r
+                               EP[j].Nshared = EP[j+1].Nshared;\r
+                               strcpy(EP[j].name,EP[j+1].name);\r
+                       }\r
+                       NEpoints--;\r
+               }\r
+       }\r
+       if ( hd[ish].ok != FALSE)\r
+       {\r
+               /* Warning x64 windows */\r
+               #ifdef _MSC_VER\r
+               FreeDynLibrary ((DynLibHandle) ULongToHandle(hd[ish].shl));\r
+               #else\r
+               FreeDynLibrary ((DynLibHandle) hd[ish].shl);\r
+               #endif\r
+               hd[ish].ok = FALSE;\r
+       }\r
+}\r
+/*-----------------------------------------------------------------------------------*/\r
diff --git a/scilab/modules/dynamic_link/src/c/dynamic_link.h b/scilab/modules/dynamic_link/src/c/dynamic_link.h
new file mode 100644 (file)
index 0000000..7fd9655
--- /dev/null
@@ -0,0 +1,129 @@
+/*-----------------------------------------------------------------------------------*/\r
+/* INRIA 2008 */\r
+/* Allan CORNET */\r
+/*-----------------------------------------------------------------------------------*/\r
+#ifndef __DYNAMIC_LINK_H__\r
+#define __DYNAMIC_LINK_H__\r
+\r
+#include "machine.h"\r
+\r
+#define ENTRYMAX 500\r
+\r
+/**\r
+* Initialize tables \r
+*/\r
+void initializeLink(void);\r
+\r
+/**\r
+* check that a routine name is a loaded\r
+* if *ilib == -1 \r
+*    checks if routinename is a loaded\r
+*    entry point \r
+*    the result is -1 if false \r
+*    or the number in the function table \r
+* \r
+* @param[in] routinename\r
+* @param[in/out] ilib number in the function table (-1 if FALSE)\r
+* @return a BOOL\r
+*/\r
+\r
+\r
+BOOL c_link(char *routinename,int *ilib);\r
+\r
+/**\r
+* OBSOLETE \r
+* if *ilib == -1 \r
+*    checks if routinename is a loaded\r
+*    entry point \r
+*    the result is -1 if false \r
+*               or the number in the function table \r
+* @param[in] routinename\r
+* @param[in/out] ilib\r
+*/\r
+void C2F(iislink)(char *routinename, integer *ilib);\r
+\r
+\r
+/**\r
+* returns the ii functions \r
+* @param ii\r
+* @param ptr on functions\r
+*/\r
+void GetDynFunc(int ii, void (**realop) ());\r
+\r
+/**\r
+* Search a function in the table \r
+* Search from end to top \r
+* @param \r
+* @param \r
+*/\r
+int SearchInDynLinks(char *op, void (**realop) ());\r
+\r
+/**\r
+* Show the linked files \r
+*/\r
+void ShowDynLinks(void);\r
+\r
+/**\r
+* unlink all linked files \r
+*/\r
+void unlinkallsharedlib(void);\r
+\r
+/**\r
+* Unlink a shared lib \r
+* @param i (number of shared lib)\r
+*/\r
+void unlinksharedlib(integer *i);\r
+\r
+\r
+/**\r
+* load a shared archive and call LoadDynLibrary\r
+* the shared lib handler is stored in a Table \r
+* return value is == -1 if the LoadDynLibrary failed \r
+* @param loaded_file\r
+*/\r
+int Sci_dlopen( char *loaded_file);\r
+\r
+/**\r
+* This routine load the entryname ename \r
+* from shared lib ishared \r
+* @return TRUE or FALSE\r
+*/\r
+BOOL Sci_dlsym(char *ename,int ishared,char *strf);\r
+\r
+/**\r
+* Delete entry points associated with shared lib ishared\r
+* then delete the shared lib \r
+@param ishared\r
+*/\r
+void Sci_Delsym(int ishared);\r
+\r
+/**\r
+* @param sizearray returns size of string array returned\r
+* @return string array with functions names loaded\r
+*/\r
+char **getNamesOfFunctionsInSharedLibraries(int *sizearray);\r
+\r
+/**\r
+* call link for scilab\r
+* @param idsharedlibrary\r
+* @param filename (dynamic library name)\r
+* @param subnamesarray (list of functions name in dynamic library)\r
+* @param sizesubnamesarray\r
+* @param fflag\r
+* @param ierr (last error)\r
+* @return id \r
+*/\r
+int scilabLink(int idsharedlibrary,\r
+                          char *filename,\r
+                          char **subnamesarray,int sizesubnamesarray,\r
+                          BOOL fflag,int *ierr);\r
+\r
+/**\r
+* get list of all Id of shared lib\r
+* @param size of returned list\r
+* @return list of Id\r
+*/\r
+int *getAllIdSharedLib(int *sizeList);\r
+\r
+#endif /* __DYNAMIC_LINK_H__ */\r
+/*-----------------------------------------------------------------------------------*/\r
diff --git a/scilab/modules/dynamic_link/src/c/dynamic_link.vcproj b/scilab/modules/dynamic_link/src/c/dynamic_link.vcproj
new file mode 100644 (file)
index 0000000..9e98c16
--- /dev/null
@@ -0,0 +1,300 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="dynamic_link"\r
+       ProjectGUID="{EAB6C580-22B3-4359-BA1D-DD7499A96163}"\r
+       RootNamespace="dynamic_link"\r
+       Keyword="Win32Proj"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="2"\r
+                       CharacterSet="2"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="../../includes;../../src/c;../../../../libs/MALLOC/includes;../../../../libs/dynamiclibrary/includes;../../../output_stream/includes;../../../localization/includes;../../../core/includes;../../../../libs/hashtable;../../../../libs/intl"\r
+                               PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WITH_TK;FORDLL;WIN32;_DEBUG;_WINDOWS;_USRDLL;DYNAMIC_LINK_EXPORTS"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="0"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                               Description="Make dependencies"\r
+                               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;lib /DEF:&quot;$(InputDir)dynamic_link_f_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)dynamic_link_f.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 dynamic_link.dll %%f &gt;nul&#x0D;&#x0A;copy *.def dynamic_linktmp.def &gt;nul&#x0D;&#x0A;copy ..\dynamic_link_header.def+dynamic_linktmp.def  ..\dynamic_link.def &gt;nul&#x0D;&#x0A;del *.def &gt;nul&#x0D;&#x0A;cd .. &gt;nul&#x0D;&#x0A;"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalOptions="/fixed:no"\r
+                               AdditionalDependencies="LibScilab.lib dynamic_link_f.lib"\r
+                               OutputFile="../../../../bin/$(ProjectName).dll"\r
+                               LinkIncremental="1"\r
+                               ModuleDefinitionFile="dynamic_link.def"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="2"\r
+                               ImportLibrary="../../../../bin/$(ProjectName).lib"\r
+                               TargetMachine="1"\r
+                               CLRUnmanagedCodeCheck="true"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="2"\r
+                       CharacterSet="2"\r
+                       WholeProgramOptimization="0"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               InlineFunctionExpansion="1"\r
+                               FavorSizeOrSpeed="1"\r
+                               WholeProgramOptimization="false"\r
+                               AdditionalIncludeDirectories="../../includes;../../src/c;../../../../libs/MALLOC/includes;../../../../libs/dynamiclibrary/includes;../../../output_stream/includes;../../../localization/includes;../../../core/includes;../../../../libs/hashtable;../../../../libs/intl"\r
+                               PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;WITH_TK;FORDLL;WIN32;NDEBUG;_WINDOWS;_USRDLL;DYNAMIC_LINK_EXPORTS"\r
+                               StringPooling="true"\r
+                               RuntimeLibrary="2"\r
+                               EnableEnhancedInstructionSet="1"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="false"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                               Description="Make dependencies"\r
+                               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;lib /DEF:&quot;$(InputDir)dynamic_link_f_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)dynamic_link_f.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 dynamic_link.dll %%f &gt;nul&#x0D;&#x0A;copy *.def dynamic_linktmp.def &gt;nul&#x0D;&#x0A;copy ..\dynamic_link_header.def+dynamic_linktmp.def  ..\dynamic_link.def &gt;nul&#x0D;&#x0A;del *.def &gt;nul&#x0D;&#x0A;cd .. &gt;nul&#x0D;&#x0A;"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="LibScilab.lib dynamic_link_f.lib"\r
+                               OutputFile="../../../../bin/$(ProjectName).dll"\r
+                               LinkIncremental="1"\r
+                               ModuleDefinitionFile="dynamic_link.def"\r
+                               GenerateDebugInformation="false"\r
+                               SubSystem="2"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               LinkTimeCodeGeneration="0"\r
+                               ImportLibrary="../../../../bin/$(ProjectName).lib"\r
+                               TargetMachine="1"\r
+                               CLRUnmanagedCodeCheck="true"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"\r
+                       >\r
+                       <File\r
+                               RelativePath=".\AddFunctionInTable.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\addinter.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\DllmainIncremental_link.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\dynamic_link.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\sci_gateway\c\gw_dynamic_link.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\sci_gateway\c\sci_addinter.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\sci_gateway\c\sci_c_link.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\sci_gateway\c\sci_call.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\sci_gateway\c\sci_getdynlibext.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\sci_gateway\c\sci_link.c"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\sci_gateway\c\sci_ulink.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\..\includes\AddFunctionInTable.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\includes\addinter.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath=".\dynamic_link.h"\r
+                               >\r
+                       </File>\r
+                       <File\r
+                               RelativePath="..\..\includes\gw_dynamic_link.h"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="localization"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\..\locales\en_US\messages.pot"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <File\r
+                       RelativePath="..\..\dynamic_link.iss"\r
+                       >\r
+               </File>\r
+               <File\r
+                       RelativePath=".\dynamic_link_f_Import.def"\r
+                       >\r
+               </File>\r
+               <File\r
+                       RelativePath="..\..\sci_gateway\dynamic_link_gateway.xml"\r
+                       >\r
+               </File>\r
+               <File\r
+                       RelativePath=".\LibScilab_Import.def"\r
+                       >\r
+               </File>\r
+               <File\r
+                       RelativePath="..\..\Makefile.am"\r
+                       >\r
+               </File>\r
+               <File\r
+                       RelativePath="..\..\version.xml"\r
+                       >\r
+               </File>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/scilab/modules/dynamic_link/src/c/dynamic_link_f_Import.def b/scilab/modules/dynamic_link/src/c/dynamic_link_f_Import.def
new file mode 100644 (file)
index 0000000..20d2805
--- /dev/null
@@ -0,0 +1,9 @@
+LIBRARY   dynamic_link_f.dll\r
+\r
+\r
+EXPORTS\r
+; --------------------------------------- \r
+; dynamic_link_f\r
+; --------------------------------------- \r
+sciislink_\r
+intfort_
\ No newline at end of file
diff --git a/scilab/modules/dynamic_link/src/c/dynamic_link_header.def b/scilab/modules/dynamic_link/src/c/dynamic_link_header.def
new file mode 100644 (file)
index 0000000..eee4050
--- /dev/null
@@ -0,0 +1,7 @@
+LIBRARY   dynamic_link.dll\r
+\r
+\r
+EXPORTS\r
+; --------------------------------------- \r
+; dynamic_link\r
+; --------------------------------------- \r
diff --git a/scilab/modules/dynamic_link/src/fortran/LibScilab_Import.def b/scilab/modules/dynamic_link/src/fortran/LibScilab_Import.def
new file mode 100644 (file)
index 0000000..00e8af1
--- /dev/null
@@ -0,0 +1,45 @@
+       LIBRARY    Libscilab.dll\r
+\r
+\r
+EXPORTS\r
+;\r
+;core\r
+;\r
+stack_\r
+cha1_\r
+com_\r
+vstk_\r
+ref2val_\r
+checkrhs_\r
+getsmat_\r
+getwsmat\r
+gettype_\r
+getscalar_\r
+objvide_\r
+getwsmat_\r
+\r
+recu_\r
+iop_\r
+adre_\r
+intersci_\r
+iset_\r
+setinterf_\r
+checkval_\r
+bufstore_\r
+interf1_\r
+getmat_\r
+cvname_\r
+getrhsvar_\r
+cs2st_\r
+icopy_\r
+createvar_\r
+interf_\r
+cremat_\r
+unsfdcopy_\r
+stacki2d_\r
+stackr2d_\r
+cresmat2_\r
+stackc2i_\r
+copyobj_\r
+crebmat_\r
+checklhs_\r
diff --git a/scilab/modules/dynamic_link/src/fortran/dynamic_link_f.vfproj b/scilab/modules/dynamic_link/src/fortran/dynamic_link_f.vfproj
new file mode 100644 (file)
index 0000000..ebb2e2c
--- /dev/null
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8"?>\r
+<VisualStudioProject ProjectType="typeDynamicLibrary" ProjectCreator="Intel Fortran" Keyword="Dll" Version="9.10" ProjectIdGuid="{9BC28602-73B4-4FBB-9583-478D2F047CA4}">\r
+       <Platforms>\r
+               <Platform Name="Win32"/></Platforms>\r
+       <Configurations>\r
+               <Configuration Name="Debug|Win32" DeleteExtensionsOnClean="*.obj;*.mod;*.pdb;*.asm;*.map;*.dyn;*.dpi;*.tmp;*.log;*.ilk;*.dll;$(TargetPath)" ConfigurationType="typeDynamicLibrary">\r
+                               <Tool Name="VFMidlTool" SuppressStartupBanner="true" HeaderFileName="$(InputName).h" TypeLibraryName="$(IntDir)/$(InputName).tlb"/>\r
+                               <Tool Name="VFPreBuildEventTool" 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\r
+lib /DEF:&quot;$(InputDir)output_stream_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scioutput_stream.lib&quot; 1&gt;NUL 2&gt;NUL\r
+lib /DEF:&quot;$(InputDir)string_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)string.lib&quot; 1&gt;NUL 2&gt;NUL" Description="Build Dependencies"/>\r
+                               <Tool Name="VFPostBuildEventTool"/>\r
+                               <Tool Name="VFFortranCompilerTool" AdditionalOptions="/dll" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" OptimizeForProcessor="procOptimizePentiumProThruIII" AdditionalIncludeDirectories="../../../core/includes" PreprocessorDefinitions="WIN32;FORDLL" AlternateParameterSyntax="false" F77RuntimeCompatibility="true" FPS4Libs="false" CallingConvention="callConventionCRef" ExternalNameUnderscore="true" ModulePath="$(INTDIR)/" ObjectFile="$(INTDIR)/" RuntimeLibrary="rtMultiThreadedDebugDLL" DisableDefaultLibSearch="true" CompileOnly="true"/>\r
+                               <Tool Name="VFCustomBuildTool"/>\r
+                               <Tool Name="VFLinkerTool" AdditionalOptions="/DLL libcmtd.lib /DLL ifconsol.lib /DLL libifport.lib /DLL libirc.lib /DLL libifcoremdd.lib /DLL libmmdd.lib" OutputFile="$(SolutionDir)bin\dynamic_link_f.dll" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" ModuleDefinitionFile="dynamic_link_f.def" GenerateDebugInformation="true" ProgramDatabaseFile="$(OUTDIR)/dynamic_link_f.pdb" SubSystem="subSystemWindows" ImportLibrary="$(SolutionDir)bin\dynamic_link_f.lib" LinkDLL="true" AdditionalDependencies="LibScilab.lib scioutput_stream.lib string.lib"/>\r
+                               <Tool Name="VFPreLinkEventTool" CommandLine="cd $(IntDir)\r
+for %%f in (*.obj) do  ..\..\..\..\..\bin\dumpexts -o %%~nf.def -n dynamic_link_f.dll %%f &gt;nul\r
+copy *.def dynamic_link_f.def &gt;nul\r
+copy dynamic_link_f.def ..\dynamic_link_f.vcdef &gt;nul\r
+del *.def &gt;nul\r
+cd ..\r
+copy dynamic_link_f_header.def+dynamic_link_f.vcdef dynamic_link_f.def &gt;nul" Description="Build dynamic_link_f.def"/>\r
+                               <Tool Name="VFResourceCompilerTool" ResourceOutputFileName="$(IntDir)/$(InputName).res"/></Configuration>\r
+               <Configuration Name="Release|Win32" DeleteExtensionsOnClean="*.obj;*.mod;*.pdb;*.asm;*.map;*.dyn;*.dpi;*.tmp;*.log;*.ilk;*.dll;$(TargetPath)" ConfigurationType="typeDynamicLibrary">\r
+                               <Tool Name="VFMidlTool" SuppressStartupBanner="true" HeaderFileName="$(InputName).h" TypeLibraryName="$(IntDir)/$(InputName).tlb"/>\r
+                               <Tool Name="VFPreBuildEventTool" 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\r
+lib /DEF:&quot;$(InputDir)output_stream_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scioutput_stream.lib&quot; 1&gt;NUL 2&gt;NUL\r
+lib /DEF:&quot;$(InputDir)string_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)string.lib&quot; 1&gt;NUL 2&gt;NUL" Description="Build Dependencies"/>\r
+                               <Tool Name="VFPostBuildEventTool"/>\r
+                               <Tool Name="VFFortranCompilerTool" AdditionalOptions="/dll" SuppressStartupBanner="true" OptimizeForProcessor="procOptimizePentiumProThruIII" UseProcessorExtensions="codeForStreamingSIMD" RequireProcessorExtensions="codeExclusivelyStreamingSIMD" AdditionalIncludeDirectories="../../../core/includes" PreprocessorDefinitions="WIN32;FORDLL" AlternateParameterSyntax="false" F77RuntimeCompatibility="true" FPS4Libs="false" CallingConvention="callConventionCRef" ExternalNameUnderscore="true" ModulePath="$(INTDIR)/" ObjectFile="$(INTDIR)/" RuntimeLibrary="rtMultiThreadedDLL" DisableDefaultLibSearch="true" CompileOnly="true"/>\r
+                               <Tool Name="VFCustomBuildTool"/>\r
+                               <Tool Name="VFLinkerTool" SwitchesHaveChanged="true" AdditionalOptions="/DLL libcmt.lib /DLL ifconsol.lib /DLL libifport.lib /DLL libirc.lib /DLL libifcoremd.lib /DLL libmmd.lib /DLL dynamic_link.lib" OutputFile="$(SolutionDir)bin\dynamic_link_f.dll" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" ModuleDefinitionFile="dynamic_link_f.def" SubSystem="subSystemWindows" ImportLibrary="$(SolutionDir)bin\dynamic_link_f.lib" LinkDLL="true" AdditionalDependencies="LibScilab.lib scioutput_stream.lib string.lib"/>\r
+                               <Tool Name="VFPreLinkEventTool" CommandLine="cd $(IntDir)\r
+for %%f in (*.obj) do  ..\..\..\..\..\bin\dumpexts -o %%~nf.def -n dynamic_link_f.dll %%f &gt;nul\r
+copy *.def dynamic_link_f.def &gt;nul\r
+copy dynamic_link_f.def ..\dynamic_link_f.vcdef &gt;nul\r
+del *.def &gt;nul\r
+cd ..\r
+copy dynamic_link_f_header.def+dynamic_link_f.vcdef dynamic_link_f.def &gt;nul" Description="Build dynamic_link_f.def"/>\r
+                               <Tool Name="VFResourceCompilerTool" ResourceOutputFileName="$(IntDir)/$(InputName).res"/></Configuration></Configurations>\r
+       <Files>\r
+               <Filter Name="Source Files" Filter="f90;for;f;fpp;ftn;def;odl;idl">\r
+               <File RelativePath="..\..\sci_gateway\fortran\sci_fort.f"/></Filter>\r
+               <Filter Name="Header Files" Filter="fi;fd"/>\r
+               <Filter Name="Resource Files" Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"/>\r
+               <File RelativePath="..\..\Makefile.am"/>\r
+               <File RelativePath="..\..\sci_gateway\dynamic_link_gateway.xml"/>\r
+               <File RelativePath=".\LibScilab_Import.def"/>\r
+               <File RelativePath=".\output_stream_Import.def"/></Files>\r
+       <Globals/></VisualStudioProject>\r
diff --git a/scilab/modules/dynamic_link/src/fortran/dynamic_link_f2c.vcproj b/scilab/modules/dynamic_link/src/fortran/dynamic_link_f2c.vcproj
new file mode 100644 (file)
index 0000000..a203b96
--- /dev/null
@@ -0,0 +1,281 @@
+<?xml version="1.0" encoding="Windows-1252"?>\r
+<VisualStudioProject\r
+       ProjectType="Visual C++"\r
+       Version="8.00"\r
+       Name="dynamic_link_f2c"\r
+       ProjectGUID="{9BC28602-73B4-4FBB-9583-478D2F047CA4}"\r
+       RootNamespace="dynamic_link_f2c"\r
+       Keyword="Win32Proj"\r
+       >\r
+       <Platforms>\r
+               <Platform\r
+                       Name="Win32"\r
+               />\r
+       </Platforms>\r
+       <ToolFiles>\r
+               <ToolFile\r
+                       RelativePath="..\..\..\..\Visual-Studio-settings\f2c.rules"\r
+               />\r
+       </ToolFiles>\r
+       <Configurations>\r
+               <Configuration\r
+                       Name="Debug|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="2"\r
+                       CharacterSet="1"\r
+                       >\r
+                       <Tool\r
+                               Name="f2c rule"\r
+                               ExecutionBucket="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                               Description="Build Dependencies"\r
+                               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;lib /DEF:&quot;$(InputDir)output_stream_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scioutput_stream.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)string_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)string.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;"\r
+                               ExecutionBucket="2"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                               ExecutionBucket="4"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                               ExecutionBucket="5"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               ExecutionBucket="6"\r
+                               Optimization="0"\r
+                               AdditionalIncludeDirectories="../../../../libs/f2c"\r
+                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;RANDLIB_F2C_EXPORTS;FORDLL"\r
+                               MinimalRebuild="true"\r
+                               BasicRuntimeChecks="0"\r
+                               RuntimeLibrary="3"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="true"\r
+                               DebugInformationFormat="3"\r
+                               CompileAs="1"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                               ExecutionBucket="7"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                               ExecutionBucket="8"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                               Description="Build dynamic_link_f.def"\r
+                               CommandLine="cd $(IntDir)&#x0D;&#x0A;for %%f in (*.obj) do  ..\..\..\..\..\bin\dumpexts -o %%~nf.def -n dynamic_link_f.dll %%f &gt;nul&#x0D;&#x0A;copy *.def dynamic_link_f.def &gt;nul&#x0D;&#x0A;copy dynamic_link_f.def ..\dynamic_link_f.vcdef &gt;nul&#x0D;&#x0A;del *.def &gt;nul&#x0D;&#x0A;cd ..&#x0D;&#x0A;copy dynamic_link_f_header.def+dynamic_link_f.vcdef dynamic_link_f.def &gt;nul&#x0D;&#x0A;"\r
+                               ExecutionBucket="9"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               ExecutionBucket="10"\r
+                               AdditionalOptions="/fixed:no"\r
+                               AdditionalDependencies="LibScilab.lib scioutput_stream.lib string.lib"\r
+                               OutputFile="$(SolutionDir)bin\dynamic_link_f.dll"\r
+                               LinkIncremental="2"\r
+                               ModuleDefinitionFile="dynamic_link_f.def"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="2"\r
+                               TargetMachine="1"\r
+                               CLRUnmanagedCodeCheck="true"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                               ExecutionBucket="11"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                               ExecutionBucket="12"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                               ExecutionBucket="13"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                               ExecutionBucket="14"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                               ExecutionBucket="15"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                               ExecutionBucket="16"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                               ExecutionBucket="17"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+               </Configuration>\r
+               <Configuration\r
+                       Name="Release|Win32"\r
+                       OutputDirectory="$(SolutionDir)$(ConfigurationName)"\r
+                       IntermediateDirectory="$(ConfigurationName)"\r
+                       ConfigurationType="2"\r
+                       CharacterSet="1"\r
+                       WholeProgramOptimization="1"\r
+                       >\r
+                       <Tool\r
+                               Name="VCPreBuildEventTool"\r
+                               Description="Build Dependencies"\r
+                               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;lib /DEF:&quot;$(InputDir)output_stream_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)scioutput_stream.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;lib /DEF:&quot;$(InputDir)string_Import.def&quot; /SUBSYSTEM:WINDOWS /MACHINE:X86 /OUT:&quot;$(InputDir)string.lib&quot; 1&gt;NUL 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCustomBuildTool"\r
+                       />\r
+                       <Tool\r
+                               Name="f2c rule"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXMLDataGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebServiceProxyGeneratorTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCMIDLTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCCLCompilerTool"\r
+                               WholeProgramOptimization="false"\r
+                               AdditionalIncludeDirectories="../../../../libs/f2c"\r
+                               PreprocessorDefinitions="WIN32;NDEBUG;_WINDOWS;_USRDLL;RANDLIB_F2C_EXPORTS;FORDLL"\r
+                               RuntimeLibrary="2"\r
+                               EnableEnhancedInstructionSet="1"\r
+                               UsePrecompiledHeader="0"\r
+                               WarningLevel="3"\r
+                               Detect64BitPortabilityProblems="false"\r
+                               DebugInformationFormat="3"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManagedResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCResourceCompilerTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPreLinkEventTool"\r
+                               Description="Build dynamic_link_f.def"\r
+                               CommandLine="cd $(IntDir)&#x0D;&#x0A;for %%f in (*.obj) do  ..\..\..\..\..\bin\dumpexts -o %%~nf.def -n dynamic_link_f.dll %%f &gt;nul&#x0D;&#x0A;copy *.def dynamic_link_f.def &gt;nul&#x0D;&#x0A;copy dynamic_link_f.def ..\dynamic_link_f.vcdef &gt;nul&#x0D;&#x0A;del *.def &gt;nul&#x0D;&#x0A;cd ..&#x0D;&#x0A;copy dynamic_link_f_header.def+dynamic_link_f.vcdef dynamic_link_f.def &gt;nul&#x0D;&#x0A;"\r
+                       />\r
+                       <Tool\r
+                               Name="VCLinkerTool"\r
+                               AdditionalDependencies="LibScilab.lib scioutput_stream.lib string.lib"\r
+                               OutputFile="$(SolutionDir)bin\dynamic_link_f.dll"\r
+                               LinkIncremental="1"\r
+                               ModuleDefinitionFile="dynamic_link_f.def"\r
+                               GenerateDebugInformation="true"\r
+                               SubSystem="2"\r
+                               OptimizeReferences="2"\r
+                               EnableCOMDATFolding="2"\r
+                               LinkTimeCodeGeneration="0"\r
+                               TargetMachine="1"\r
+                               CLRUnmanagedCodeCheck="true"\r
+                       />\r
+                       <Tool\r
+                               Name="VCALinkTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCManifestTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCXDCMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCBscMakeTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCFxCopTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCAppVerifierTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCWebDeploymentTool"\r
+                       />\r
+                       <Tool\r
+                               Name="VCPostBuildEventTool"\r
+                       />\r
+               </Configuration>\r
+       </Configurations>\r
+       <References>\r
+       </References>\r
+       <Files>\r
+               <Filter\r
+                       Name="Source Files"\r
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"\r
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\..\sci_gateway\fortran\sci_fort.c"\r
+                               >\r
+                       </File>\r
+               </Filter>\r
+               <Filter\r
+                       Name="Header Files"\r
+                       Filter="h;hpp;hxx;hm;inl;inc;xsd"\r
+                       UniqueIdentifier="{93995380-89BD-4b04-88EB-625FBE52EBFB}"\r
+                       >\r
+               </Filter>\r
+               <Filter\r
+                       Name="Resource Files"\r
+                       Filter="rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav"\r
+                       UniqueIdentifier="{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}"\r
+                       >\r
+               </Filter>\r
+               <Filter\r
+                       Name="Fortran files"\r
+                       >\r
+                       <File\r
+                               RelativePath="..\..\sci_gateway\fortran\sci_fort.f"\r
+                               >\r
+                               <FileConfiguration\r
+                                       Name="Debug|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="f2c rule"\r
+                                               CommandLine="&quot;$(SolutionDir)bin\f2c.exe&quot; -I..\..\..\core\includes -I..\..\..\..\core\includes &quot;$(InputDir)$(InputFileName)&quot; 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;"\r
+                                       />\r
+                               </FileConfiguration>\r
+                               <FileConfiguration\r
+                                       Name="Release|Win32"\r
+                                       >\r
+                                       <Tool\r
+                                               Name="f2c rule"\r
+                                               CommandLine="&quot;$(SolutionDir)bin\f2c.exe&quot; -I..\..\..\core\includes -I..\..\..\..\core\includes &quot;$(InputDir)$(InputFileName)&quot; 2&gt;NUL&#x0D;&#x0A;&#x0D;&#x0A;"\r
+                                       />\r
+                               </FileConfiguration>\r
+                       </File>\r
+               </Filter>\r
+               <File\r
+                       RelativePath="..\..\sci_gateway\dynamic_link_gateway.xml"\r
+                       >\r
+               </File>\r
+               <File\r
+                       RelativePath="..\..\..\..\bin\libf2c.lib"\r
+                       >\r
+               </File>\r
+               <File\r
+                       RelativePath="..\..\Makefile.am"\r
+                       >\r
+               </File>\r
+       </Files>\r
+       <Globals>\r
+       </Globals>\r
+</VisualStudioProject>\r
diff --git a/scilab/modules/dynamic_link/src/fortran/dynamic_link_f_header.def b/scilab/modules/dynamic_link/src/fortran/dynamic_link_f_header.def
new file mode 100644 (file)
index 0000000..bd10f61
--- /dev/null
@@ -0,0 +1,7 @@
+LIBRARY    dynamic_link_f.dll\r
+\r
+\r
+EXPORTS\r
+; --------------------------------------- \r
+; dynamic_link_f\r
+; --------------------------------------- \r
diff --git a/scilab/modules/dynamic_link/src/fortran/output_stream_Import.def b/scilab/modules/dynamic_link/src/fortran/output_stream_Import.def
new file mode 100644 (file)
index 0000000..586a3c7
--- /dev/null
@@ -0,0 +1,8 @@
+       LIBRARY    scioutput_stream.dll\r
+\r
+\r
+EXPORTS\r
+;\r
+;output_stream\r
+;\r
+error_\r
diff --git a/scilab/modules/dynamic_link/src/fortran/string_Import.def b/scilab/modules/dynamic_link/src/fortran/string_Import.def
new file mode 100644 (file)
index 0000000..cd04e2d
--- /dev/null
@@ -0,0 +1,8 @@
+       LIBRARY    string.dll\r
+\r
+\r
+EXPORTS\r
+;\r
+;string\r
+;\r
+cvstr_\r
diff --git a/scilab/modules/dynamic_link/src/scripts/Makedll.incl b/scilab/modules/dynamic_link/src/scripts/Makedll.incl
new file mode 100644 (file)
index 0000000..d95bed1
--- /dev/null
@@ -0,0 +1,28 @@
+#--- see examples/addinter-tutorial-so ----------\r
+\r
+DUMPEXTS="$(SCIDIR1)\bin\dumpexts"\r
+SCIIMPLIB="$(SCIDIR)/bin/LibScilab.lib"\r
+\r
+all :: $(LIBRARY).dll\r
+\r
+$(LIBRARY).dll: $(OBJS)\r
+       @echo Creation of dll $(LIBRARY).dll and import lib from ...\r
+       @echo $(OBJS)\r
+       @$(DUMPEXTS) -o "$*.def" "$*.dll" $**\r
+       @$(LINKER) $(LINKER_FLAGS) $(OBJS) $(OTHERLIBS) $(SCIIMPLIB) $(XLIBSBIN) $(TERMCAPLIB) $(EXTRA_LDFLAGS) /nologo /dll /out:"$*.dll" /implib:"$*.lib" /def:"$*.def" \r
+\r
+clean  ::\r
+       -del *.obj\r
+       -del $(LIBRARY)_gateway.c\r
+       -del $(LIBRARY).def\r
+       -del $(LIBRARY).dll\r
+       -del $(LIBRARY).exp\r
+       -del $(LIBRARY).lib\r
+\r
+distclean::    clean\r
+\r
+tests  : $(LIBRARY).dll $(LIBRARY).tst\r
+       @"$(SCIDIR1)\bin\scilex.exe" -nwni  -e scitest('$(LIBRARY).tst',%t);quit;\r
+\r
+#      @"$(SCIDIR1)\bin\scilex.exe" -f $(LIBRARY).tst \r
+\r
diff --git a/scilab/modules/dynamic_link/src/scripts/Makefile.am b/scilab/modules/dynamic_link/src/scripts/Makefile.am
new file mode 100644 (file)
index 0000000..3fef829
--- /dev/null
@@ -0,0 +1,16 @@
+##########\r
+### Sylvestre Ledru <sylvestre.ledru@inria.fr>\r
+### INRIA - Scilab 2006\r
+##########\r
+\r
+# The name of the library is not important but must remains the same\r
+pkglib_LTLIBRARIES = libsciexternal.la\r
+\r
+# Fake sources in order to make believe to the autotool that we are going\r
+# to compile some C/C++, fortran sources.\r
+# Thanks to this, automake will generate compilation mydatadirs for \r
+# these 3 languages.\r
+# Don't change name or order \r
+libsciexternal_la_SOURCES = foo.c foo2.f foo3.cxx\r
+\r
+\r
diff --git a/scilab/modules/dynamic_link/src/scripts/Makefile.in b/scilab/modules/dynamic_link/src/scripts/Makefile.in
new file mode 100644 (file)
index 0000000..bbcca92
--- /dev/null
@@ -0,0 +1,642 @@
+# Makefile.in generated by automake 1.10 from Makefile.am.\r
+# @configure_input@\r
+\r
+# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,\r
+# 2003, 2004, 2005, 2006  Free Software Foundation, Inc.\r
+# This Makefile.in is free software; the Free Software Foundation\r
+# gives unlimited permission to copy and/or distribute it,\r
+# with or without modifications, as long as this notice is preserved.\r
+\r
+# This program is distributed in the hope that it will be useful,\r
+# but WITHOUT ANY WARRANTY, to the extent permitted by law; without\r
+# even the implied warranty of MERCHANTABILITY or FITNESS FOR A\r
+# PARTICULAR PURPOSE.\r
+\r
+@SET_MAKE@\r
+\r
+##########\r
+### Sylvestre Ledru <sylvestre.ledru@inria.fr>\r
+### INRIA - Scilab 2006\r
+##########\r
+\r
+VPATH = @srcdir@\r
+pkgdatadir = $(datadir)/@PACKAGE@\r
+pkglibdir = $(libdir)/@PACKAGE@\r
+pkgincludedir = $(includedir)/@PACKAGE@\r
+am__cd = CDPATH="$${ZSH_VERSION+.}$(PATH_SEPARATOR)" && cd\r
+install_sh_DATA = $(install_sh) -c -m 644\r
+install_sh_PROGRAM = $(install_sh) -c\r
+install_sh_SCRIPT = $(install_sh) -c\r
+INSTALL_HEADER = $(INSTALL_DATA)\r
+transform = $(program_transform_name)\r
+NORMAL_INSTALL = :\r
+PRE_INSTALL = :\r
+POST_INSTALL = :\r
+NORMAL_UNINSTALL = :\r
+PRE_UNINSTALL = :\r
+POST_UNINSTALL = :\r
+build_triplet = @build@\r
+host_triplet = @host@\r
+subdir = .\r
+DIST_COMMON = $(am__configure_deps) $(srcdir)/Makefile.am \\r
+       $(srcdir)/Makefile.in $(top_srcdir)/configure config.guess \\r
+       config.sub depcomp install-sh ltmain.sh missing\r
+ACLOCAL_M4 = $(top_srcdir)/aclocal.m4\r
+am__aclocal_m4_deps = $(top_srcdir)/configure.ac\r
+am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \\r
+       $(ACLOCAL_M4)\r
+am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \\r
+ configure.lineno config.status.lineno\r
+mkinstalldirs = $(install_sh) -d\r
+CONFIG_CLEAN_FILES =\r
+am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;\r
+am__vpath_adj = case $$p in \\r
+    $(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \\r
+    *) f=$$p;; \\r
+  esac;\r
+am__strip_dir = `echo $$p | sed -e 's|^.*/||'`;\r
+am__installdirs = "$(DESTDIR)$(pkglibdir)"\r
+pkglibLTLIBRARIES_INSTALL = $(INSTALL)\r
+LTLIBRARIES = $(pkglib_LTLIBRARIES)\r
+libsciexternal_la_LIBADD =\r
+am_libsciexternal_la_OBJECTS = foo.lo foo2.lo foo3.lo\r
+libsciexternal_la_OBJECTS = $(am_libsciexternal_la_OBJECTS)\r
+DEFAULT_INCLUDES = -I.@am__isrc@\r
+depcomp = $(SHELL) $(top_srcdir)/depcomp\r
+am__depfiles_maybe = depfiles\r
+COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \\r
+       $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\r
+LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\r
+       --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\r
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)\r
+CCLD = $(CC)\r
+LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\r
+       --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \\r
+       $(LDFLAGS) -o $@\r
+CXXCOMPILE = $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\r
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)\r
+LTCXXCOMPILE = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\r
+       --mode=compile $(CXX) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \\r
+       $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)\r
+CXXLD = $(CXX)\r
+CXXLINK = $(LIBTOOL) --tag=CXX $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\r
+       --mode=link $(CXXLD) $(AM_CXXFLAGS) $(CXXFLAGS) $(AM_LDFLAGS) \\r
+       $(LDFLAGS) -o $@\r
+F77COMPILE = $(F77) $(AM_FFLAGS) $(FFLAGS)\r
+LTF77COMPILE = $(LIBTOOL) --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\r
+       --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS)\r
+F77LD = $(F77)\r
+F77LINK = $(LIBTOOL) --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \\r
+       --mode=link $(F77LD) $(AM_FFLAGS) $(FFLAGS) $(AM_LDFLAGS) \\r
+       $(LDFLAGS) -o $@\r
+SOURCES = $(libsciexternal_la_SOURCES)\r
+DIST_SOURCES = $(libsciexternal_la_SOURCES)\r
+ETAGS = etags\r
+CTAGS = ctags\r
+DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)\r
+distdir = $(PACKAGE)-$(VERSION)\r
+top_distdir = $(distdir)\r
+am__remove_distdir = \\r
+  { test ! -d $(distdir) \\r
+    || { find $(distdir) -type d ! -perm -200 -exec chmod u+w {} ';' \\r
+         && rm -fr $(distdir); }; }\r
+DIST_ARCHIVES = $(distdir).tar.gz\r
+GZIP_ENV = --best\r
+distuninstallcheck_listfiles = find . -type f -print\r
+distcleancheck_listfiles = find . -type f -print\r
+ACLOCAL = @ACLOCAL@\r
+AMTAR = @AMTAR@\r
+AR = @AR@\r
+AUTOCONF = @AUTOCONF@\r
+AUTOHEADER = @AUTOHEADER@\r
+AUTOMAKE = @AUTOMAKE@\r
+AWK = @AWK@\r
+CC = @CC@\r
+CCDEPMODE = @CCDEPMODE@\r
+CFLAGS = @CFLAGS@\r
+CPP = @CPP@\r
+CPPFLAGS = @CPPFLAGS@\r
+CXX = @CXX@\r
+CXXCPP = @CXXCPP@\r
+CXXDEPMODE = @CXXDEPMODE@\r
+CXXFLAGS = @CXXFLAGS@\r
+CYGPATH_W = @CYGPATH_W@\r
+DEFS = @DEFS@\r
+DEPDIR = @DEPDIR@\r
+ECHO = @ECHO@\r
+ECHO_C = @ECHO_C@\r
+ECHO_N = @ECHO_N@\r
+ECHO_T = @ECHO_T@\r
+EGREP = @EGREP@\r
+EXEEXT = @EXEEXT@\r
+F77 = @F77@\r
+FFLAGS = @FFLAGS@\r
+GREP = @GREP@\r
+INSTALL = @INSTALL@\r
+INSTALL_DATA = @INSTALL_DATA@\r
+INSTALL_PROGRAM = @INSTALL_PROGRAM@\r
+INSTALL_SCRIPT = @INSTALL_SCRIPT@\r
+INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@\r
+LDFLAGS = @LDFLAGS@\r
+LIBOBJS = @LIBOBJS@\r
+LIBS = @LIBS@\r
+LIBTOOL = @LIBTOOL@\r
+LN_S = @LN_S@\r
+LTLIBOBJS = @LTLIBOBJS@\r
+MAINT = @MAINT@\r
+MAKEINFO = @MAKEINFO@\r
+MKDIR_P = @MKDIR_P@\r
+OBJEXT = @OBJEXT@\r
+PACKAGE = @PACKAGE@\r
+PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@\r
+PACKAGE_NAME = @PACKAGE_NAME@\r
+PACKAGE_STRING = @PACKAGE_STRING@\r
+PACKAGE_TARNAME = @PACKAGE_TARNAME@\r
+PACKAGE_VERSION = @PACKAGE_VERSION@\r
+PATH_SEPARATOR = @PATH_SEPARATOR@\r
+RANLIB = @RANLIB@\r
+SET_MAKE = @SET_MAKE@\r
+SHELL = @SHELL@\r
+STRIP = @STRIP@\r
+VERSION = @VERSION@\r
+abs_builddir = @abs_builddir@\r
+abs_srcdir = @abs_srcdir@\r
+abs_top_builddir = @abs_top_builddir@\r
+abs_top_srcdir = @abs_top_srcdir@\r
+ac_ct_CC = @ac_ct_CC@\r
+ac_ct_CXX = @ac_ct_CXX@\r
+ac_ct_F77 = @ac_ct_F77@\r
+am__include = @am__include@\r
+am__leading_dot = @am__leading_dot@\r
+am__quote = @am__quote@\r
+am__tar = @am__tar@\r
+am__untar = @am__untar@\r
+bindir = @bindir@\r
+build = @build@\r
+build_alias = @build_alias@\r
+build_cpu = @build_cpu@\r
+build_os = @build_os@\r
+build_vendor = @build_vendor@\r
+builddir = @builddir@\r
+datadir = @datadir@\r
+datarootdir = @datarootdir@\r
+docdir = @docdir@\r
+dvidir = @dvidir@\r
+exec_prefix = @exec_prefix@\r
+host = @host@\r
+host_alias = @host_alias@\r
+host_cpu = @host_cpu@\r
+host_os = @host_os@\r
+host_vendor = @host_vendor@\r
+htmldir = @htmldir@\r
+includedir = @includedir@\r
+infodir = @infodir@\r
+install_sh = @install_sh@\r
+libdir = @libdir@\r
+libexecdir = @libexecdir@\r
+localedir = @localedir@\r
+localstatedir = @localstatedir@\r
+mandir = @mandir@\r
+mkdir_p = @mkdir_p@\r
+oldincludedir = @oldincludedir@\r
+pdfdir = @pdfdir@\r
+prefix = @prefix@\r
+program_transform_name = @program_transform_name@\r
+psdir = @psdir@\r
+sbindir = @sbindir@\r
+sharedstatedir = @sharedstatedir@\r
+srcdir = @srcdir@\r
+sysconfdir = @sysconfdir@\r
+target_alias = @target_alias@\r
+top_builddir = @top_builddir@\r
+top_srcdir = @top_srcdir@\r
+\r
+# The name of the library is not important but must remains the same\r
+pkglib_LTLIBRARIES = libsciexternal.la\r
+# Fake sources in order to make believe to the autotool that we are going\r
+# to compile some C/C++, fortran sources.\r
+# Don't change name or order \r
+libsciexternal_la_SOURCES = foo.c foo2.f foo3.cxx\r
+all: all-am\r
+\r
+.SUFFIXES:\r
+.SUFFIXES: .c .cxx .f .lo .o .obj\r
+am--refresh:\r
+       @:\r
+$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am  $(am__configure_deps)\r
+       @for dep in $?; do \\r
+         case '$(am__configure_deps)' in \\r
+           *$$dep*) \\r
+             echo ' cd $(srcdir) && $(AUTOMAKE) --foreign '; \\r
+             cd $(srcdir) && $(AUTOMAKE) --foreign  \\r
+               && exit 0; \\r
+             exit 1;; \\r
+         esac; \\r
+       done; \\r
+       echo ' cd $(top_srcdir) && $(AUTOMAKE) --foreign  Makefile'; \\r
+       cd $(top_srcdir) && \\r
+         $(AUTOMAKE) --foreign  Makefile\r
+.PRECIOUS: Makefile\r
+Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status\r
+       @case '$?' in \\r
+         *config.status*) \\r
+           echo ' $(SHELL) ./config.status'; \\r
+           $(SHELL) ./config.status;; \\r
+         *) \\r
+           echo ' cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe)'; \\r
+           cd $(top_builddir) && $(SHELL) ./config.status $@ $(am__depfiles_maybe);; \\r
+       esac;\r
+\r
+$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)\r
+       $(SHELL) ./config.status --recheck\r
+\r
+$(top_srcdir)/configure: @MAINTAINER_MODE_TRUE@ $(am__configure_deps)\r
+       cd $(srcdir) && $(AUTOCONF)\r
+$(ACLOCAL_M4): @MAINTAINER_MODE_TRUE@ $(am__aclocal_m4_deps)\r
+       cd $(srcdir) && $(ACLOCAL) $(ACLOCAL_AMFLAGS)\r
+install-pkglibLTLIBRARIES: $(pkglib_LTLIBRARIES)\r
+       @$(NORMAL_INSTALL)\r
+       test -z "$(pkglibdir)" || $(MKDIR_P) "$(DESTDIR)$(pkglibdir)"\r
+       @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \\r
+         if test -f $$p; then \\r
+           f=$(am__strip_dir) \\r
+           echo " $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) '$$p' '$(DESTDIR)$(pkglibdir)/$$f'"; \\r
+           $(LIBTOOL) --mode=install $(pkglibLTLIBRARIES_INSTALL) $(INSTALL_STRIP_FLAG) "$$p" "$(DESTDIR)$(pkglibdir)/$$f"; \\r
+         else :; fi; \\r
+       done\r
+\r
+uninstall-pkglibLTLIBRARIES:\r
+       @$(NORMAL_UNINSTALL)\r
+       @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \\r
+         p=$(am__strip_dir) \\r
+         echo " $(LIBTOOL) --mode=uninstall rm -f '$(DESTDIR)$(pkglibdir)/$$p'"; \\r
+         $(LIBTOOL) --mode=uninstall rm -f "$(DESTDIR)$(pkglibdir)/$$p"; \\r
+       done\r
+\r
+clean-pkglibLTLIBRARIES:\r
+       -test -z "$(pkglib_LTLIBRARIES)" || rm -f $(pkglib_LTLIBRARIES)\r
+       @list='$(pkglib_LTLIBRARIES)'; for p in $$list; do \\r
+         dir="`echo $$p | sed -e 's|/[^/]*$$||'`"; \\r
+         test "$$dir" != "$$p" || dir=.; \\r
+         echo "rm -f \"$${dir}/so_locations\""; \\r
+         rm -f "$${dir}/so_locations"; \\r
+       done\r
+libsciexternal.la: $(libsciexternal_la_OBJECTS) $(libsciexternal_la_DEPENDENCIES) \r
+       $(CXXLINK) -rpath $(pkglibdir) $(libsciexternal_la_OBJECTS) $(libsciexternal_la_LIBADD) $(LIBS)\r
+\r
+mostlyclean-compile:\r
+       -rm -f *.$(OBJEXT)\r
+\r
+distclean-compile:\r
+       -rm -f *.tab.c\r
+\r
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/foo.Plo@am__quote@\r
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/foo3.Plo@am__quote@\r
+\r
+.c.o:\r
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<\r
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po\r
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\r
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\r
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<\r
+\r
+.c.obj:\r
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`\r
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po\r
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\r
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\r
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`\r
+\r
+.c.lo:\r
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<\r
+@am__fastdepCC_TRUE@   mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo\r
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@\r
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@\r
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<\r
+\r
+.cxx.o:\r
+@am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<\r
+@am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po\r
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\r
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@\r
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ $<\r
+\r
+.cxx.obj:\r
+@am__fastdepCXX_TRUE@  $(CXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`\r
+@am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po\r
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=no @AMDEPBACKSLASH@\r
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@\r
+@am__fastdepCXX_FALSE@ $(CXXCOMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\r
+\r
+.cxx.lo:\r
+@am__fastdepCXX_TRUE@  $(LTCXXCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<\r
+@am__fastdepCXX_TRUE@  mv -f $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo\r
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@\r
+@AMDEP_TRUE@@am__fastdepCXX_FALSE@     DEPDIR=$(DEPDIR) $(CXXDEPMODE) $(depcomp) @AMDEPBACKSLASH@\r
+@am__fastdepCXX_FALSE@ $(LTCXXCOMPILE) -c -o $@ $<\r
+\r
+.f.o:\r
+       $(F77COMPILE) -c -o $@ $<\r
+\r
+.f.obj:\r
+       $(F77COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`\r
+\r
+.f.lo:\r
+       $(LTF77COMPILE) -c -o $@ $<\r
+\r
+mostlyclean-libtool:\r
+       -rm -f *.lo\r
+\r
+clean-libtool:\r
+       -rm -rf .libs _libs\r
+\r
+distclean-libtool:\r
+       -rm -f libtool\r
+\r
+ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)\r
+       list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \\r
+       unique=`for i in $$list; do \\r
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \\r
+         done | \\r
+         $(AWK) '    { files[$$0] = 1; } \\r
+              END { for (i in files) print i; }'`; \\r
+       mkid -fID $$unique\r
+tags: TAGS\r
+\r
+TAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \\r
+               $(TAGS_FILES) $(LISP)\r
+       tags=; \\r
+       here=`pwd`; \\r
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \\r
+       unique=`for i in $$list; do \\r
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \\r
+         done | \\r
+         $(AWK) '    { files[$$0] = 1; } \\r
+              END { for (i in files) print i; }'`; \\r
+       if test -z "$(ETAGS_ARGS)$$tags$$unique"; then :; else \\r
+         test -n "$$unique" || unique=$$empty_fix; \\r
+         $(ETAGS) $(ETAGSFLAGS) $(AM_ETAGSFLAGS) $(ETAGS_ARGS) \\r
+           $$tags $$unique; \\r
+       fi\r
+ctags: CTAGS\r
+CTAGS:  $(HEADERS) $(SOURCES)  $(TAGS_DEPENDENCIES) \\r
+               $(TAGS_FILES) $(LISP)\r
+       tags=; \\r
+       here=`pwd`; \\r
+       list='$(SOURCES) $(HEADERS)  $(LISP) $(TAGS_FILES)'; \\r
+       unique=`for i in $$list; do \\r
+           if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \\r
+         done | \\r
+         $(AWK) '    { files[$$0] = 1; } \\r
+              END { for (i in files) print i; }'`; \\r
+       test -z "$(CTAGS_ARGS)$$tags$$unique" \\r
+         || $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \\r
+            $$tags $$unique\r
+\r
+GTAGS:\r
+       here=`$(am__cd) $(top_builddir) && pwd` \\r
+         && cd $(top_srcdir) \\r
+         && gtags -i $(GTAGS_ARGS) $$here\r
+\r
+distclean-tags:\r
+       -rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags\r
+\r
+distdir: $(DISTFILES)\r
+       $(am__remove_distdir)\r
+       test -d $(distdir) || mkdir $(distdir)\r
+       @srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \\r
+       topsrcdirstrip=`echo "$(top_srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \\r
+       list='$(DISTFILES)'; \\r
+         dist_files=`for file in $$list; do echo $$file; done | \\r
+         sed -e "s|^$$srcdirstrip/||;t" \\r
+             -e "s|^$$topsrcdirstrip/|$(top_builddir)/|;t"`; \\r
+       case $$dist_files in \\r
+         */*) $(MKDIR_P) `echo "$$dist_files" | \\r
+                          sed '/\//!d;s|^|$(distdir)/|;s,/[^/]*$$,,' | \\r
+                          sort -u` ;; \\r
+       esac; \\r
+       for file in $$dist_files; do \\r
+         if test -f $$file || test -d $$file; then d=.; else d=$(srcdir); fi; \\r
+         if test -d $$d/$$file; then \\r
+           dir=`echo "/$$file" | sed -e 's,/[^/]*$$,,'`; \\r
+           if test -d $(srcdir)/$$file && test $$d != $(srcdir); then \\r
+             cp -pR $(srcdir)/$$file $(distdir)$$dir || exit 1; \\r
+           fi; \\r
+           cp -pR $$d/$$file $(distdir)$$dir || exit 1; \\r
+         else \\r
+           test -f $(distdir)/$$file \\r
+           || cp -p $$d/$$file $(distdir)/$$file \\r
+           || exit 1; \\r
+         fi; \\r
+       done\r
+       -find $(distdir) -type d ! -perm -777 -exec chmod a+rwx {} \; -o \\r
+         ! -type d ! -perm -444 -links 1 -exec chmod a+r {} \; -o \\r
+         ! -type d ! -perm -400 -exec chmod a+r {} \; -o \\r
+         ! -type d ! -perm -444 -exec $(install_sh) -c -m a+r {} {} \; \\r
+       || chmod -R a+r $(distdir)\r
+dist-gzip: distdir\r
+       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz\r
+       $(am__remove_distdir)\r
+\r
+dist-bzip2: distdir\r
+       tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2\r
+       $(am__remove_distdir)\r
+\r
+dist-tarZ: distdir\r
+       tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z\r
+       $(am__remove_distdir)\r
+\r
+dist-shar: distdir\r
+       shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz\r
+       $(am__remove_distdir)\r
+\r
+dist-zip: distdir\r
+       -rm -f $(distdir).zip\r
+       zip -rq $(distdir).zip $(distdir)\r
+       $(am__remove_distdir)\r
+\r
+dist dist-all: distdir\r
+       tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz\r
+       $(am__remove_distdir)\r
+\r
+# This target untars the dist file and tries a VPATH configuration.  Then\r
+# it guarantees that the distribution is self-contained by making another\r
+# tarfile.\r
+distcheck: dist\r
+       case '$(DIST_ARCHIVES)' in \\r
+       *.tar.gz*) \\r
+         GZIP=$(GZIP_ENV) gunzip -c $(distdir).tar.gz | $(am__untar) ;;\\r
+       *.tar.bz2*) \\r
+         bunzip2 -c $(distdir).tar.bz2 | $(am__untar) ;;\\r
+       *.tar.Z*) \\r
+         uncompress -c $(distdir).tar.Z | $(am__untar) ;;\\r
+       *.shar.gz*) \\r
+         GZIP=$(GZIP_ENV) gunzip -c $(distdir).shar.gz | unshar ;;\\r
+       *.zip*) \\r
+         unzip $(distdir).zip ;;\\r
+       esac\r
+       chmod -R a-w $(distdir); chmod a+w $(distdir)\r
+       mkdir $(distdir)/_build\r
+       mkdir $(distdir)/_inst\r
+       chmod a-w $(distdir)\r
+       dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \\r
+         && dc_destdir="$${TMPDIR-/tmp}/am-dc-$$$$/" \\r
+         && cd $(distdir)/_build \\r
+         && ../configure --srcdir=.. --prefix="$$dc_install_base" \\r
+           $(DISTCHECK_CONFIGURE_FLAGS) \\r
+         && $(MAKE) $(AM_MAKEFLAGS) \\r
+         && $(MAKE) $(AM_MAKEFLAGS) dvi \\r
+         && $(MAKE) $(AM_MAKEFLAGS) check \\r
+         && $(MAKE) $(AM_MAKEFLAGS) install \\r
+         && $(MAKE) $(AM_MAKEFLAGS) installcheck \\r
+         && $(MAKE) $(AM_MAKEFLAGS) uninstall \\r
+         && $(MAKE) $(AM_MAKEFLAGS) distuninstallcheck_dir="$$dc_install_base" \\r
+               distuninstallcheck \\r
+         && chmod -R a-w "$$dc_install_base" \\r
+         && ({ \\r
+              (cd ../.. && umask 077 && mkdir "$$dc_destdir") \\r
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" install \\r
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" uninstall \\r
+              && $(MAKE) $(AM_MAKEFLAGS) DESTDIR="$$dc_destdir" \\r
+                   distuninstallcheck_dir="$$dc_destdir" distuninstallcheck; \\r
+             } || { rm -rf "$$dc_destdir"; exit 1; }) \\r
+         && rm -rf "$$dc_destdir" \\r
+         && $(MAKE) $(AM_MAKEFLAGS) dist \\r
+         && rm -rf $(DIST_ARCHIVES) \\r
+         && $(MAKE) $(AM_MAKEFLAGS) distcleancheck\r
+       $(am__remove_distdir)\r
+       @(echo "$(distdir) archives ready for distribution: "; \\r
+         list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \\r
+         sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'\r
+distuninstallcheck:\r
+       @cd $(distuninstallcheck_dir) \\r
+       && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \\r
+          || { echo "ERROR: files left after uninstall:" ; \\r
+               if test -n "$(DESTDIR)"; then \\r
+                 echo "  (check DESTDIR support)"; \\r
+               fi ; \\r
+               $(distuninstallcheck_listfiles) ; \\r
+               exit 1; } >&2\r
+distcleancheck: distclean\r
+       @if test '$(srcdir)' = . ; then \\r
+         echo "ERROR: distcleancheck can only run from a VPATH build" ; \\r
+         exit 1 ; \\r
+       fi\r
+       @test `$(distcleancheck_listfiles) | wc -l` -eq 0 \\r
+         || { echo "ERROR: files left in build directory after distclean:" ; \\r
+              $(distcleancheck_listfiles) ; \\r
+              exit 1; } >&2\r
+check-am: all-am\r
+check: check-am\r
+all-am: Makefile $(LTLIBRARIES)\r
+installdirs:\r
+       for dir in "$(DESTDIR)$(pkglibdir)"; do \\r
+         test -z "$$dir" || $(MKDIR_P) "$$dir"; \\r
+       done\r
+install: install-am\r
+install-exec: install-exec-am\r
+install-data: install-data-am\r
+uninstall: uninstall-am\r
+\r
+install-am: all-am\r
+       @$(MAKE) $(AM_MAKEFLAGS) install-exec-am install-data-am\r
+\r
+installcheck: installcheck-am\r
+install-strip:\r
+       $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \\r
+         install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \\r
+         `test -z '$(STRIP)' || \\r
+           echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install\r
+mostlyclean-generic:\r
+\r
+clean-generic:\r
+\r
+distclean-generic:\r
+       -test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)\r
+\r
+maintainer-clean-generic:\r
+       @echo "This command is intended for maintainers to use"\r
+       @echo "it deletes files that may require special tools to rebuild."\r
+clean: clean-am\r
+\r
+clean-am: clean-generic clean-libtool clean-pkglibLTLIBRARIES \\r
+       mostlyclean-am\r
+\r
+distclean: distclean-am\r
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)\r
+       -rm -rf ./$(DEPDIR)\r
+       -rm -f Makefile\r
+distclean-am: clean-am distclean-compile distclean-generic \\r
+       distclean-libtool distclean-tags\r
+\r
+dvi: dvi-am\r
+\r
+dvi-am:\r
+\r
+html: html-am\r
+\r
+info: info-am\r
+\r
+info-am:\r
+\r
+install-data-am:\r
+\r
+install-dvi: install-dvi-am\r
+\r
+install-exec-am: install-pkglibLTLIBRARIES\r
+\r
+install-html: install-html-am\r
+\r
+install-info: install-info-am\r
+\r
+install-man:\r
+\r
+install-pdf: install-pdf-am\r
+\r
+install-ps: install-ps-am\r
+\r
+installcheck-am:\r
+\r
+maintainer-clean: maintainer-clean-am\r
+       -rm -f $(am__CONFIG_DISTCLEAN_FILES)\r
+       -rm -rf $(top_srcdir)/autom4te.cache\r
+       -rm -rf ./$(DEPDIR)\r
+       -rm -f Makefile\r
+maintainer-clean-am: distclean-am maintainer-clean-generic\r
+\r
+mostlyclean: mostlyclean-am\r
+\r
+mostlyclean-am: mostlyclean-compile mostlyclean-generic \\r
+       mostlyclean-libtool\r
+\r
+pdf: pdf-am\r
+\r
+pdf-am:\r
+\r
+ps: ps-am\r
+\r
+ps-am:\r
+\r
+uninstall-am: uninstall-pkglibLTLIBRARIES\r
+\r
+.MAKE: install-am install-strip\r
+\r