bug 6863 + bug 6866 + cleaning
Allan CORNET [Wed, 7 Apr 2010 11:43:52 +0000 (13:43 +0200)]
21 files changed:
scilab/etc/scilab.start
scilab/modules/core/Makefile.am
scilab/modules/core/core.iss
scilab/modules/core/help/en_US/getversion.xml
scilab/modules/core/help/pt_BR/getversion.xml
scilab/modules/core/includes/getversion.h [new file with mode: 0644]
scilab/modules/core/includes/gw_core.h
scilab/modules/core/includes/inisci-c.h
scilab/modules/core/macros/with_atlas.sci
scilab/modules/core/macros/with_tk.sci
scilab/modules/core/sci_gateway/c/gw_core.c
scilab/modules/core/sci_gateway/c/sci_getversion.c
scilab/modules/core/src/c/core.vcproj
scilab/modules/core/src/c/dynamic_tclsci.c
scilab/modules/core/src/c/dynamic_tclsci.h
scilab/modules/core/src/c/getstaticDebugInfo_Windows.c
scilab/modules/core/src/c/getversion.c [new file with mode: 0644]
scilab/modules/core/src/c/inisci-c.c
scilab/modules/core/src/c/terme.c
scilab/modules/core/src/fortran/inisci.f
scilab/modules/dynamic_link/macros/ilib_gen_Make.sci

index de21a90..5c2e852 100644 (file)
@@ -50,6 +50,7 @@ ieee(0);
 %F = %f;
 MSDOS = (getos() == 'Windows');
 %pvm = with_module('pvm');
+%tk = (with_module('tclsci') & getscilabmode() <> 'NWNI');
 // Set LANGUAGE  ======================================================
 // used mainly for on-line help
 args = sciargs();
index 021c63d..d1ce123 100644 (file)
@@ -84,6 +84,7 @@ src/c/inittypenames.c \
 src/c/funcprot.c \
 src/c/eqid.c \
 src/c/exitCodeValue.c \
+src/c/getversion.c \
 src/c/dynamic_tclsci.c
 
 CORE_CPP_SOURCES = src/cpp/hashtable_core.cpp
@@ -367,6 +368,7 @@ includes/stack3.h \
 includes/stackinfo.h \
 includes/stackTypeVariable.h \
 includes/version.h \
+includes/getversion.h \
 includes/warningmode.h
 
 include $(top_srcdir)/Makefile.incl.am
index e0c21f2..e192ccd 100644 (file)
@@ -47,6 +47,7 @@ Source: modules\{#CORE}\includes\stackinfo.h; DestDir: {app}\modules\{#CORE}\inc
 Source: modules\{#CORE}\includes\stackTypeVariable.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB}
 Source: modules\{#CORE}\includes\version.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB}
 Source: modules\{#CORE}\includes\warningmode.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB}
+Source: modules\{#CORE}\includes\getversion.h; DestDir: {app}\modules\{#CORE}\includes; Components: {#COMPN_SCILAB}
 ;
 Source: modules\{#CORE}\macros\buildmacros.sce; DestDir: {app}\modules\{#CORE}\macros; Components: {#COMPN_SCILAB}
 Source: modules\{#CORE}\macros\buildmacros.bat; DestDir: {app}\modules\{#CORE}\macros; Components: {#COMPN_SCILAB}
index baf2f2b..d2003f3 100644 (file)
   <refsynopsisdiv>
     <title>Calling Sequence</title>
 
-    <synopsis>version=getversion()
-[version,opts]=getversion()
-ver=getversion('scilab')
-versioninfo=getversion('scilab','string_info')
-ver=getversion('&lt;module&gt;')
-versioninfo=getversion('&lt;module&gt;','string_info')</synopsis>
+    <synopsis>version = getversion()
+[version, opts] = getversion()
+version_numbers = getversion('scilab')
+versioninfo = getversion('scilab', 'string_info')
+version_numbers = getversion('&lt;module&gt;')
+versioninfo = getversion('&lt;module&gt;','string_info')</synopsis>
   </refsynopsisdiv>
 
   <refsection>
@@ -49,7 +49,7 @@ versioninfo=getversion('&lt;module&gt;','string_info')</synopsis>
       </varlistentry>
 
       <varlistentry>
-        <term>ver</term>
+        <term>version_numbers</term>
 
         <listitem>
           <para>a integer vector</para>
@@ -68,8 +68,8 @@ versioninfo=getversion('&lt;module&gt;','string_info')</synopsis>
         <term>opts</term>
 
         <listitem>
-          <para>a vector of string with seven entries
-          :<literal>[compiler, pvm, tk, modelicac, release_mode, release_date, release_time]</literal></para>
+          <para>a vector of string 
+          :<literal>[compiler, architecture,[ pvm, tk, modelicac, atlas,] release_mode, release_date, release_time]</literal></para>
         </listitem>
       </varlistentry>
     </variablelist>
@@ -80,7 +80,14 @@ versioninfo=getversion('&lt;module&gt;','string_info')</synopsis>
 
     <para>return in <literal>version</literal> the Scilab version name and in
     <literal>opts</literal> build options which can be used to determine if
-    scilab has been build with pvm, tk or modelicac and give release date and time.</para>
+    scilab has been build with pvm, tk , atlas or modelicac and give release date and time.</para>
+    <para> [ pvm, tk, modelicac, atlas,] are optional. </para>
+    <para> compiler: returns compiler used to build scilab ('GCC', 'VC++', 'PGI', 'ICC', 'SUN', 'UKN' unknown)</para>
+    <para> archicteture: 'x86' or 'x64'.</para>
+    <para> pvm: 'pvm' if pvm is enabled.</para>
+    <para> tk: 'tk' if tcl/tk is enabled.</para>
+    <para> modelicac: 'modelicac' if modelica compiler is ditributed with scilab/xcos.</para>
+    <para> atlas: 'atlas' if scilab was built with atlas (or MKL).</para>
   </refsection>
 
   <refsection>
@@ -88,11 +95,23 @@ versioninfo=getversion('&lt;module&gt;','string_info')</synopsis>
 
     <programlisting role="example"><![CDATA[ 
 getversion()
-[version,opts]=getversion()
-ver=getversion('scilab')
-verstr=getversion('scilab','string_info')
-ver=getversion('overloading')
-verstr=getversion('overloading','string_info')
+
+[version, opts] = getversion()
+COMPILER = opts(1)
+ARCH = opts(2)
+or(opt == 'modelicac')
+or(opt == 'pvm')
+or(opt == 'tk')
+or(opt == 'atlas')
+RELEASE_MODE = opts($-2)
+RELEASE_DATE = opts($-1)
+RELEASE_TIME = opts($)
+
+version = getversion('scilab')
+versionstr = getversion('scilab','string_info')
+version = getversion('overloading')
+versionstr = getversion('overloading','string_info')
+
  ]]></programlisting>
   </refsection>
 
index 87f241a..6a9ad8e 100644 (file)
@@ -68,8 +68,8 @@ versioninfo=getversion('&lt;module&gt;','string_info')</synopsis>
         <term>opts</term>
 
         <listitem>
-          <para>um vetor de strings de 7 entradas:
-          <literal>[compiler, pvm, tk, modelicac, release_mode, release_date, release_time]</literal></para>
+          <para>um vetor de strings:
+          <literal>[compiler, architecture, [pvm, tk, modelicac, atlas,] release_mode, release_date, release_time]</literal></para>
         </listitem>
       </varlistentry>
     </variablelist>
@@ -89,11 +89,23 @@ versioninfo=getversion('&lt;module&gt;','string_info')</synopsis>
 
     <programlisting role="example"><![CDATA[ 
 getversion()
-[version,opts]=getversion()
-ver=getversion('scilab')
-verstr=getversion('scilab','string_info')
-ver=getversion('overloading')
-verstr=getversion('overloading','string_info')
+
+[version, opts] = getversion()
+COMPILER = opts(1)
+ARCH = opts(2)
+or(opt == 'modelicac')
+or(opt == 'pvm')
+or(opt == 'tk')
+or(opt == 'atlas')
+RELEASE_MODE = opts($-2)
+RELEASE_DATE = opts($-1)
+RELEASE_TIME = opts($)
+
+version = getversion('scilab')
+versionstr = getversion('scilab','string_info')
+version = getversion('overloading')
+versionstr = getversion('overloading','string_info')
+
  ]]></programlisting>
   </refsection>
 
diff --git a/scilab/modules/core/includes/getversion.h b/scilab/modules/core/includes/getversion.h
new file mode 100644 (file)
index 0000000..723fb8a
--- /dev/null
@@ -0,0 +1,117 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2010 - DIGITEO - Allan CORNET
+* 
+* This file must be used under the terms of the CeCILL.
+* This source file is licensed as described in the file COPYING, which
+* you should have received as part of this distribution.  The terms
+* are also available at    
+* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+*
+*/
+/*--------------------------------------------------------------------------*/
+#ifndef __GETVERSION_H__
+#define __GETVERSION_H__
+
+#include "BOOL.h"
+
+/**
+* get Scilab Version as a int array
+* @param[out] size of returned array
+* @return int array ver
+* ver[0] Major version
+* ver[1] Minor version
+* ver[2] Maintenance version
+* ver[3] timestamp
+*/
+int *getScilabVersion(int *sizeArrayReturned);
+
+/**
+* get Scilab version as a string
+* @return scilab version
+*/
+char *getScilabVersionAsString(void);
+
+/**
+* get module version as a int array
+* @param[in] module name
+* @param[out] size of returned array
+* @return int array ver
+* ver[0] Major version
+* ver[1] Minor version
+* ver[2] Maintenance version
+* ver[3] timestamp
+*/
+int* getModuleVersion(char *modulename, int *sizeArrayReturned);
+
+/**
+* get module version as a string
+* @param[in] module name
+* @return scilab version
+*/
+char *getModuleVersionInfoAsString(char *modulename);
+
+/**
+* get options used for this version
+* @param[out]
+* @return char ** with options used
+*/
+char **getScilabVersionOptions(int *sizeArrayReturned);
+
+/**
+* get release mode
+* @return 'release' or 'debug'
+*/
+char *getReleaseMode(void);
+
+/**
+* get release date
+* @return date of version
+*/
+char *getReleaseDate(void);
+
+/**
+* get release time
+* @return time of version
+*/
+char *getReleaseTime(void);
+
+/**
+* get compiler used to build scilab
+* @return 'VC++', 'ICC', 'GCC'
+*/
+char *getCompilerUsedToBuildScilab(void);
+
+/**
+* get Compiler Architecture
+* @return 'x86' or 'x64'
+*/
+char *getCompilerArchitecture(void);
+
+/**
+* with atlas ?
+* @return TRUE or FALSE
+*/
+BOOL with_atlas(void);
+
+/**
+* with pvm ?
+* @return TRUE or FALSE
+*/
+BOOL with_pvm(void);
+
+/**
+* with modelica compiler ?
+* @return TRUE or FALSE
+*/
+BOOL with_modelica_compiler(void);
+
+/**
+* with tcl/tk ?
+* @return TRUE or FALSE
+*/
+BOOL with_tk(void);
+
+#endif /* __GETVERSION_H__ */
+/*--------------------------------------------------------------------------*/
+
index 4273e60..d7f2a3d 100644 (file)
@@ -57,7 +57,7 @@ int C2F(sci_isglobal)(char *fname,unsigned long fname_len);
 int C2F(sci_gstacksize)(char *fname,unsigned long fname_len);
 int C2F(sci_intppty)(char *fname,unsigned long fname_len);
 int C2F(sci_lasterror)(char *fname,unsigned long fname_len);
-int C2F(sci_getversion)(char *fname,unsigned long fname_len);
+int sci_getversion(char *fname,unsigned long fname_len);
 int C2F(sci_macr2tree)(char *fname,unsigned long fname_len);
 int C2F(sci_getos)(char *fname,unsigned long fname_len);
 int C2F(sci_banner)(char *fname,unsigned long fname_len);
index 31729de..fe8f756 100644 (file)
 
 /** 
  * TODO : comment
- * @param rep
- * @return 
- */
-int C2F(withscicos)(int *rep);
-
-/** 
- * TODO : comment
- * @param rep
- * @return 
- */
-int C2F(withmodelicac)(int *rep);
-
-/** 
- * TODO : comment
- * @param rep
- * @return 
- */
-int C2F(withjavasci)(int *rep);
-
-/** 
- * TODO : comment
- * @param rep
- * @return 
- */
-int C2F(withmsdos)(int *rep);
-
-/** 
- * TODO : comment
- * @param buf
- * @param nbuf
- * @param lbuf
- * @return 
- */
-int C2F(getcomp)(char *buf,int *nbuf,long int lbuf);
-
-
-/** 
- * TODO : comment
- * @return 
- */
-int ExistJavaSciUnix(void);
-
-/** 
- * TODO : comment
- * @return 
- */
-BOOL ExistModelicac(void);
-
-/** 
- * TODO : comment
- * @return 
- */
-BOOL ExistScicos(void);
-
-/** 
- * TODO : comment
- * @return 
- */
-BOOL ExistJavaSciWin(void);
-
-/** 
- * TODO : comment
  * @return 
  */
 int SetSci(void);
index 74dd454..ca8b791 100644 (file)
@@ -7,7 +7,7 @@
 // are also available at    
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
-function r=with_atlas()
-  [v,opt]=getversion()
-  r=or(opt=='atlas')
+function r = with_atlas()
+  [v, opt] = getversion();
+  r = or(opt == 'atlas');
 endfunction
index fcaad97..458aad5 100644 (file)
@@ -7,7 +7,6 @@
 // are also available at    
 // http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 
-function r=with_tk()
-  [v,opt]=getversion()
-  r=or(opt=='tk')
+function r = with_tk()
+  r = (with_module('tclsci') & getscilabmode() <> 'NWNI');
 endfunction
index abba3c7..9ad9d64 100644 (file)
@@ -60,7 +60,7 @@ static gw_generic_table Tab[]=
 {C2F(sci_gstacksize),"gstacksize"},
 {C2F(sci_intppty),"intppty"},
 {C2F(sci_lasterror),"lasterror"},
-{C2F(sci_getversion),"getversion"},
+{sci_getversion,"getversion"},
 {C2F(sci_macr2tree),"macr2tree"},
 {C2F(sci_getos),"getos"},
 {C2F(sci_banner),"banner"},
index 8047e27..01b0e53 100644 (file)
@@ -2,6 +2,7 @@
  * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
  * Copyright (C) 2006 - INRIA - Allan CORNET
  * Copyright (C) 2008 - INRIA - Bruno JOFRET
+ * Copyright (C) 2010 - DIGITEO - Allan CORNET
  *
  * This file must be used under the terms of the CeCILL.
  * This source file is licensed as described in the file COPYING, which
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  */
+/*--------------------------------------------------------------------------*/
 #include <string.h>
-#include <stdio.h>
+#include "api_scilab.h"
 #include "gw_core.h"
 #include "stack-c.h"
-#include "version.h"
+#include "getversion.h"
 #include "MALLOC.h"
-#include "with_module.h"
-#include "loadversion.h"
-#include "inisci-c.h"
-#include "Scierror.h"
-#include "dynamic_tclsci.h"
 #include "localization.h"
-#ifdef _MSC_VER
-#include "strdup_windows.h"
-#endif
-/*--------------------------------------------------------------------------*/
-static int getversion_no_rhs(void);
-static int getversion_one_rhs(void);
-static int getversion_two_rhs(void);
+#include "Scierror.h"
+#include "with_module.h"
+#include "freeArrayOfString.h"
 /*--------------------------------------------------------------------------*/
 #define VERSION_STRING "string_info"
 /*--------------------------------------------------------------------------*/
-int C2F(sci_getversion)(char *fname,unsigned long fname_len)
+static int getversion_no_rhs(char *fname);
+static int getversion_one_rhs(char *fname);
+static int getversion_two_rhs(char *fname);
+/*--------------------------------------------------------------------------*/
+int sci_getversion(char *fname, unsigned long fname_len)
 {
-       Rhs=Max(0,Rhs);
+       Rhs = Max(0,Rhs);
 
        CheckRhs(0,2);
-       CheckLhs(1,2);
-
-       if ( Rhs == 0 )
+       
+       if (Rhs == 0)
        {
-               getversion_no_rhs();
+               CheckLhs(1,2);
+               getversion_no_rhs(fname);
        }
-       else if ( Rhs == 1)
+       else if (Rhs == 1)
        {
-               getversion_one_rhs();
+               CheckLhs(1,1);
+               getversion_one_rhs(fname);
        }
        else /* Rhs == 2 */
        {
-               getversion_two_rhs();
+               CheckLhs(1,1);
+               getversion_two_rhs(fname);
        }
        return 0;
 }
 /*--------------------------------------------------------------------------*/
-static int getversion_no_rhs(void)
+int getversion_no_rhs(char *fname)
 {
-       static char Version[]=SCI_VERSION;
-       static int n1,m1;
-       char *v = Version ;
-
-       n1=1;
-       CreateVarFromPtr( Rhs+1,STRING_DATATYPE,(m1=(int)strlen(Version), &m1),&n1,&v);
-       LhsVar(1) = Rhs+1;
-       if (Lhs==2)
+       char *version = getScilabVersionAsString();
+       if (version)
        {
-               static char *Str[12];
-               static int irep,nbuf;
-               char tk[]="tk";
-               char pvm[]="pvm";
-               char modelicac[]="modelicac";
-
-               #ifdef WITH_ATLAS
-               char atlas[]="atlas";
-               #endif
-
-               #ifdef NDEBUG
-               char releasemode[]="release";
-               #else
-               char debugmode[]="debug";
-               #endif
-
-               #ifdef __TIME__
-                       char TimeBuild[]=__TIME__;
-               #endif
-
-               #ifdef __DATE__
-                       char DateBuild[]=__DATE__;
-               #endif
-
-
-               n1=0;
-
-               C2F(getcomp)( C2F(cha1).buf,&nbuf,128);
-               Str[n1]=C2F(cha1).buf;
-               n1++;
-
-
-               if (with_module("pvm"))
-               {
-                       Str[n1] = pvm;
-                       n1++;
-               }
-
-
-               if (withtk())
-               {
-                       Str[n1]=tk;
-                       n1++;
-               }
+               createSingleString(pvApiCtx, Rhs + 1, version);
+               LhsVar(1) = Rhs + 1;
+               FREE(version);
+               version = NULL;
+       }
+       else
+       {
+               Scierror(999,_("%s: Memory allocation error.\n"), fname);
+               return 0;
+       }
 
-               C2F(withmodelicac)(&irep);
-               if (irep)
-               {
-                       Str[n1]=modelicac;
-                       n1++;
-               }
+       if (Lhs == 2)
+       {
+               int sizeOptions = 0;
+               char **ScilabOptions = getScilabVersionOptions(&sizeOptions);
 
-               #ifdef WITH_ATLAS
+               if (ScilabOptions)
                {
-                       Str[n1]=atlas;
-                       n1++;
-               }
-               #endif
+                       SciErr sciErr;
+                       int m = 1;
+                       int n = sizeOptions;
+                       sciErr = createMatrixOfString(pvApiCtx, Rhs + 2, m, n, ScilabOptions);
+                       freeArrayOfString(ScilabOptions, sizeOptions);
 
-               #ifdef _MSC_VER
-                       #ifdef _DEBUG
-                       {
-                       Str[n1]=debugmode;
-                       n1++;
-                       }
-                       #else
-                       {
-                               Str[n1]=releasemode;
-                               n1++;
-                       }
-                       #endif
-               #else
-                       #ifdef NDEBUG
+                       if(sciErr.iErr)
                        {
-                               Str[n1]=releasemode;
-                               n1++;
-                       }
-                       #else
-                       {
-                               Str[n1]=debugmode;
-                               n1++;
+                               printError(&sciErr, 0);
+                               return 0;
                        }
-                       #endif
-               #endif
 
-               #ifdef __TIME__
-               {
-                       Str[n1]=DateBuild;
-                       n1++;
+                       LhsVar(2) = Rhs + 2;
                }
-               #endif
-
-               #ifdef __DATE__
+               else
                {
-                       Str[n1]=TimeBuild;
-                       n1++;
+                       Scierror(999,_("%s: Memory allocation error.\n"), fname);
+                       return 0;
                }
-               #endif
-
-               m1=1;
-               CreateVarFromPtr(Rhs+ 2,MATRIX_OF_STRING_DATATYPE, &m1, &n1, Str);
-               LhsVar(2) = Rhs+2;
        }
+       
        C2F(putlhsvar)();
 
        return 0;
 }
 /*--------------------------------------------------------------------------*/
-static int getversion_one_rhs(void)
+int getversion_one_rhs(char *fname)
 {
-       if (Lhs == 2)
+       SciErr sciErr;
+       int *piAddressVarOne = NULL;
+
+       sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddressVarOne);
+       if(sciErr.iErr)
        {
-               Scierror(78,_("%s: Wrong number of output arguments: %d expected.\n"),"getversion",1);
+               printError(&sciErr, 0);
                return 0;
        }
 
-       if (GetType(1) == sci_strings)
+       if (isStringType(pvApiCtx, piAddressVarOne))
        {
-               static int l1,n1,m1;
-               char *Param=NULL;
-               int *VERSIONMATRIX=NULL;
-
-               GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1);
-               Param=cstk(l1);
+               char *modulename = NULL;
 
-               VERSIONMATRIX=(int *)MALLOC( (4)*sizeof(int) );
-
-               if (strcmp(Param,"scilab") == 0)
+               if (!isScalar(pvApiCtx, piAddressVarOne))
                {
-                       VERSIONMATRIX[0]=(int)SCI_VERSION_MAJOR;
-                       VERSIONMATRIX[1]=(int)SCI_VERSION_MINOR;
-                       VERSIONMATRIX[2]=(int)SCI_VERSION_MAINTENANCE;
-                       VERSIONMATRIX[3]=(int)SCI_VERSION_TIMESTAMP;
+                       Scierror(999,_("%s: Wrong size for input argument #%d: String expected.\n"), fname, 1);
+                       return 0;
                }
-               else if (with_module(Param))
+
+               if (getAllocatedSingleString(pvApiCtx, piAddressVarOne, &modulename) == 0)
                {
-                       char versionstring[1024];
+                       if (modulename)
+                       {
+                               if ( with_module(modulename) || (strcmp(modulename, "scilab") == 0) )
+                               {
+                                       int versionSize = 0;
+                                       int *version = getModuleVersion(modulename, &versionSize);
+
+                                       if (version)
+                                       {
+                                               int m = 1;
+                                               int n = versionSize;
+
+                                               freeAllocatedSingleString(modulename);
+                                               modulename = NULL;
+
+                                               sciErr = createMatrixOfDouble(pvApiCtx, Rhs + 1, m, n, (double*)version);
+                                               FREE(version);
+                                               version = NULL;
+
+                                               if(sciErr.iErr)
+                                               {
+                                                       printError(&sciErr, 0);
+                                                       return 0;
+                                               }
+
+                                               LhsVar(1) = Rhs + 1;
+                                               C2F(putlhsvar)();
+                                       }
+                                       else
+                                       {
+                                               Scierror(999,_("%s: Wrong file version.xml %s.\n"), fname, modulename);
+
+                                               freeAllocatedSingleString(modulename);
+                                               modulename = NULL;
+
+                                               return 0;
+                                       }
+                               }
+                               else
+                               {
+                                       Scierror(999,_("%s: Wrong module name %s.\n"), fname , modulename);
 
-                       int version_module_major=0;
-                       int version_module_minor=0;
-                       int version_module_maintenance=0;
-                       int version_module_revision=0;
+                                       freeAllocatedSingleString(modulename);
+                                       modulename = NULL;
 
-                       if (getversionmodule(Param,&version_module_major,&version_module_minor,&version_module_maintenance,versionstring,&version_module_revision))
-                       {
-                               VERSIONMATRIX[0]=version_module_major;
-                               VERSIONMATRIX[1]=version_module_minor;
-                               VERSIONMATRIX[2]=version_module_maintenance;
-                               VERSIONMATRIX[3]=version_module_revision;
+                                       return 0;
+                               }
+                               freeAllocatedSingleString(modulename);
+                               modulename = NULL;
                        }
                        else
                        {
-                               Scierror(999,_("%s: Wrong file VERSION %s.\n"),"getversion",Param);
+                               Scierror(999,_("%s: Memory allocation error.\n"), fname);
                                return 0;
                        }
                }
                else
                {
-                       Scierror(999,_("%s: Wrong module name %s.\n"),"getversion",Param);
+                       Scierror(999,_("%s: Memory allocation error.\n"), fname);
                        return 0;
                }
-               m1=1;
-               n1=4;
-               CreateVarFromPtr(Rhs+1,MATRIX_OF_INTEGER_DATATYPE, &m1, &n1 ,&VERSIONMATRIX);
-               LhsVar(1)=Rhs+1;
-               PutLhsVar();
-               if (VERSIONMATRIX){     FREE(VERSIONMATRIX); VERSIONMATRIX=NULL;}
        }
        else
        {
-               Scierror(999,_("%s: Wrong type for input argument #%d: String expected.\n"), "getversion",1);
+               Scierror(999,_("%s: Wrong type for input argument #%d: String expected.\n"), fname, 1);
                return 0;
        }
        return 0;
 }
 /*--------------------------------------------------------------------------*/
-static int getversion_two_rhs(void)
+int getversion_two_rhs(char *fname)
 {
-       if (Lhs == 2)
+       SciErr sciErr;
+       int *piAddressVarOne = NULL;
+       int *piAddressVarTwo = NULL;
+
+       sciErr = getVarAddressFromPosition(pvApiCtx, 1, &piAddressVarOne);
+       if(sciErr.iErr)
        {
-               Scierror(78,_("%s: Wrong number of output arguments: %d expected.\n"),"getversion",2);
+               printError(&sciErr, 0);
                return 0;
        }
 
-       if ( (GetType(1) == sci_strings) && (GetType(2) == sci_strings) )
+       sciErr = getVarAddressFromPosition(pvApiCtx, 2, &piAddressVarTwo);
+       if(sciErr.iErr)
        {
-               static int l2,n2,m2;
-               char *ParamRhs2=NULL;
+               printError(&sciErr, 0);
+               return 0;
+       }
 
-               GetRhsVar(2,STRING_DATATYPE,&m2,&n2,&l2);
-               ParamRhs2=cstk(l2);
+       if (isStringType(pvApiCtx, piAddressVarOne) && isStringType(pvApiCtx, piAddressVarTwo))
+       {
+               char *modulename = NULL;
+               char *optionname = NULL;
 
-               if (strcmp(ParamRhs2,VERSION_STRING)==0)
+               if (!isScalar(pvApiCtx, piAddressVarOne))
                {
-                       static int l1,n1,m1;
-                       char *ParamRhs1=NULL;
-
-                       GetRhsVar(1,STRING_DATATYPE,&m1,&n1,&l1);
-                       ParamRhs1=cstk(l1);
-
-                       if (strcmp(ParamRhs1,"scilab") == 0)
-                       {
-                               char *output=NULL ;
-                               output = strdup(SCI_VERSION_STRING);
+                       Scierror(999,_("%s: Wrong size for input argument #%d: String expected.\n"), fname, 1);
+                       return 0;
+               }
 
-                               n1=1;
-                               CreateVarFromPtr(Rhs+ 1,STRING_DATATYPE,(m1=(int)strlen(output), &m1),&n1,&output);
-                               if (output) {FREE(output);output=NULL;}
+               if (!isScalar(pvApiCtx, piAddressVarTwo))
+               {
+                       Scierror(999,_("%s: Wrong size for input argument #%d: String expected.\n"), fname, 2);
+                       return 0;
+               }
 
-                               LhsVar(1) = Rhs+1;
-                               C2F(putlhsvar)();
-                               return 0;
-                       }
-                       else if (with_module(ParamRhs1))
+               if ( (getAllocatedSingleString(pvApiCtx, piAddressVarOne, &modulename) == 0) &&
+                       (getAllocatedSingleString(pvApiCtx, piAddressVarTwo, &optionname) == 0) )
+               {
+                       if ( (modulename) && (optionname) )
                        {
-                               #define LineMax 1024
-                               char versionstring[LineMax];
-
-                               int version_module_major=0;
-                               int version_module_minor=0;
-                               int version_module_maintenance=0;
-                               int version_module_revision=0;
-
-                               if (getversionmodule(ParamRhs1,&version_module_major,&version_module_minor,&version_module_maintenance,versionstring,&version_module_revision))
+                               if ( with_module(modulename) || (strcmp(modulename, "scilab") == 0) )
                                {
-                                       char *output = NULL ;
-                                       output = strdup(versionstring);
-
-                                       n1=1;
-                                       CreateVarFromPtr(Rhs+ 1,STRING_DATATYPE,(m1=(int)strlen(output), &m1),&n1,&output);
-                                       if (output) {FREE(output);output=NULL;}
-
-                                       LhsVar(1) = Rhs+1;
-                                       C2F(putlhsvar)();
-                                       return 0;
+                                       if ( strcmp(optionname, VERSION_STRING) == 0)
+                                       {
+                                               char *versionInfo = getModuleVersionInfoAsString(modulename);
+
+                                               if (versionInfo)
+                                               {
+                                                       createSingleString(pvApiCtx, Rhs + 1, versionInfo);
+                                                       
+                                                       FREE(versionInfo);
+                                                       versionInfo = NULL;
+
+                                                       LhsVar(1) = Rhs + 1;
+                                                       C2F(putlhsvar)();
+                                               }
+                                               else
+                                               {
+                                                       Scierror(999,_("%s: Wrong file version.xml %s.\n"), fname, modulename);
+
+                                                       freeAllocatedSingleString(modulename);
+                                                       modulename = NULL;
+                                                       freeAllocatedSingleString(optionname);
+                                                       optionname = NULL;
+
+                                                       return 0;
+                                               }
+                                       }
+                                       else
+                                       {
+                                               freeAllocatedSingleString(modulename);
+                                               modulename = NULL;
+                                               freeAllocatedSingleString(optionname);
+                                               optionname = NULL;
+
+                                               Scierror(999,_("%s: Wrong value for input argument #%d: '%s' expected.\n"), fname, 2, VERSION_STRING);
+                                               return 0;
+                                       }
                                }
                                else
                                {
-                                       Scierror(999,_("%s: Wrong file VERSION in %s.\n"),"getversion",ParamRhs1);
+                                       Scierror(999,_("%s: Wrong module name %s.\n"), fname , modulename);
+
+                                       freeAllocatedSingleString(modulename);
+                                       modulename = NULL;
+                                       freeAllocatedSingleString(optionname);
+                                       optionname = NULL;
+
                                        return 0;
                                }
                        }
                        else
                        {
-                               Scierror(999,_("%s: Wrong module name %s.\n"),"getversion",ParamRhs1);
+                               Scierror(999,_("%s: Memory allocation error.\n"), fname);
                                return 0;
                        }
                }
                else
                {
-                       Scierror(999,_("%s: Wrong value for input argument #%d: '%s' expected.\n"),"getversion",2,VERSION_STRING);
+                       Scierror(999,_("%s: Memory allocation error.\n"), fname);
                        return 0;
                }
        }
        else
        {
-               Scierror(999,_("%s: Wrong type for input arguments #%d and #%d: Strings expected.\n"),"getversion",1,2);
+               Scierror(999,_("%s: Wrong type for input arguments #%d and #%d: Strings expected.\n"), fname, 1, 2);
                return 0;
        }
+
+       return 0;
 }
 /*--------------------------------------------------------------------------*/
index 4d9b49a..5468318 100644 (file)
                                >
                        </File>
                        <File
+                               RelativePath=".\getversion.c"
+                               >
+                       </File>
+                       <File
                                RelativePath=".\GetXmlFileEncoding.c"
                                >
                        </File>
                                >
                        </File>
                        <File
+                               RelativePath="..\..\includes\getversion.h"
+                               >
+                       </File>
+                       <File
                                RelativePath="..\..\includes\GetXmlFileEncoding.h"
                                >
                        </File>
index 280dc72..e1c61d1 100644 (file)
@@ -71,14 +71,3 @@ BOOL dynamic_TerminateTclTk(void)
        return FALSE;
 }
 /*--------------------------------------------------------------------------*/
-int C2F(withtk)(int *rep)
-{
-       *rep = (int)withtk();
-       return 0;
-}
-/*--------------------------------------------------------------------------*/
-BOOL withtk(void)
-{
-       return with_module(TCLSCI_MODULE_NAME) && (getScilabMode() != SCILAB_NWNI);
-}
-/*--------------------------------------------------------------------------*/
index 441950c..f8ab47a 100644 (file)
@@ -33,18 +33,5 @@ int dynamic_setenvtcl(char *string, char *value);
 */
 BOOL dynamic_TerminateTclTk(void);
 
-/** 
-* check if it is with TCL/TK
-* @param rep 1 (WITH) or 0 (WITHOUT)
-* @return 0
-*/
-int C2F(withtk)(int *rep);
-
-/** 
-* check if it is with TCL/TK
-* @return TRUE or FALSE
-*/
-BOOL withtk(void);
-
 #endif /* __DYNAMIC_TCLSCI_H__ */
 /*--------------------------------------------------------------------------*/
index 00f8c30..6f2d7e6 100644 (file)
@@ -22,6 +22,7 @@
 #include "getstaticDebugInfo_Windows.h"
 #include "localization.h"
 #include "version.h"
+#include "getversion.h"
 #include "dynamic_tclsci.h"
 #include "..\..\..\..\libs\pcre\pcre.h"
 /*--------------------------------------------------------------------------*/
@@ -98,7 +99,7 @@ char **getStaticDebugInfo_Windows(int *sizeArray)
                outputDynamicList = appendStringStaticDebugInfo(outputDynamicList,&nb_info,str_info);
        }
 
-       if ( withtk() )
+       if ( with_tk() )
        {
                str_info = (char*)MALLOC(sizeof(char)*BUFFER_LEN);
                if (str_info)
diff --git a/scilab/modules/core/src/c/getversion.c b/scilab/modules/core/src/c/getversion.c
new file mode 100644 (file)
index 0000000..e85c24c
--- /dev/null
@@ -0,0 +1,342 @@
+/*
+* Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+* Copyright (C) 2010 - DIGITEO - Allan CORNET
+* 
+* This file must be used under the terms of the CeCILL.
+* This source file is licensed as described in the file COPYING, which
+* you should have received as part of this distribution.  The terms
+* are also available at    
+* http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
+*
+*/
+/*--------------------------------------------------------------------------*/
+#include <string.h>
+#include "getversion.h"
+#include "version.h"
+#include "scilabmode.h"
+#include "scilabDefaults.h"
+#ifdef _MSC_VER
+#include "strdup_windows.h"
+#endif
+#include "with_module.h"
+#include "loadversion.h"
+#include "MALLOC.h"
+#include "../../../io/includes/getenvc.h"
+/*--------------------------------------------------------------------------*/
+#define TCLSCI_MODULE_NAME "tclsci"
+#define PVM_MODULE_NAME "pvm"
+#define PVM_OPTION_STRING "pvm"
+#define TCLTK_OPTION_STRING "tk"
+#define ATLAS_OPTION_STRING "atlas"
+#define MODELICAC_OPTION_STRING "modelicac"
+#define X86_STRING "x86"
+#define X64_STRING "x64"
+#define ICC_STRING "ICC"
+#define VC_STRING "VC++"
+#define GCC_STRING "GCC"
+#define PGI_STRING "PGI"
+#define SUN_STRING "SUN"
+#define UNKNOW_STRING "UKN"
+#define RELEASE_STRING "release"
+#define DEBUG_STRING "debug"
+#define DEFAULT_VERSION_ARRAY_SIZE 4
+#define SCILAB_STRING "scilab"
+/*--------------------------------------------------------------------------*/
+int *getScilabVersion(int *sizeArrayReturned)
+{
+       int *returnedArray = (int *)MALLOC(sizeof(int) * DEFAULT_VERSION_ARRAY_SIZE);
+       *sizeArrayReturned = 0;
+       if (returnedArray)
+       {
+               returnedArray[0] = (int)SCI_VERSION_MAJOR;
+               returnedArray[1] = (int)SCI_VERSION_MINOR;
+               returnedArray[2] = (int)SCI_VERSION_MAINTENANCE;
+               returnedArray[3] = (int)SCI_VERSION_TIMESTAMP;
+
+               *sizeArrayReturned = DEFAULT_VERSION_ARRAY_SIZE;
+       }
+       return returnedArray;
+}
+/*--------------------------------------------------------------------------*/
+char *getScilabVersionAsString(void)
+{
+       return strdup(SCI_VERSION_STRING);
+}
+/*--------------------------------------------------------------------------*/
+int* getModuleVersion(char *modulename, int *sizeArrayReturned)
+{
+       int *returnedArray = NULL;
+
+       if (modulename)
+       {
+               if (strcmp(modulename, SCILAB_STRING) == 0)
+               {
+                       returnedArray = getScilabVersion(sizeArrayReturned);
+                       return returnedArray;
+               }
+       }
+
+       if (with_module(modulename))
+       {
+               #define LineMax 1024
+               char versionstring[LineMax];
+               int version_module_major = 0;
+               int version_module_minor = 0;
+               int version_module_maintenance = 0;
+               int version_module_revision = 0;
+
+               if (getversionmodule(modulename, &version_module_major, &version_module_minor,
+                       &version_module_maintenance, versionstring, 
+                       &version_module_revision))
+               {
+                       returnedArray = (int *)MALLOC(sizeof(int) * DEFAULT_VERSION_ARRAY_SIZE);
+                       if (returnedArray)
+                       {
+                               returnedArray[0] = version_module_major;
+                               returnedArray[1] = version_module_minor;
+                               returnedArray[2] = version_module_maintenance;
+                               returnedArray[3] = version_module_revision;
+                               *sizeArrayReturned = DEFAULT_VERSION_ARRAY_SIZE;
+                       }
+                       else
+                       {
+                               *sizeArrayReturned = 0;
+                       }
+               }
+       }
+       else
+       {
+               *sizeArrayReturned = 0;
+       }
+       return returnedArray;
+}
+/*--------------------------------------------------------------------------*/
+char *getModuleVersionInfoAsString(char *modulename)
+{
+       char *infoString = NULL;
+
+       if (modulename)
+       {
+               if (strcmp(modulename, SCILAB_STRING) == 0)
+               {
+                       infoString = getScilabVersionAsString();
+                       return infoString;
+               }
+       }
+
+       if (with_module(modulename))
+       {
+               #define LineMax 1024
+               char versionstring[LineMax];
+               int version_module_major = 0;
+               int version_module_minor = 0;
+               int version_module_maintenance = 0;
+               int version_module_revision = 0;
+               if (getversionmodule(modulename, &version_module_major, &version_module_minor,
+                       &version_module_maintenance, versionstring, 
+                       &version_module_revision))
+               {
+                       infoString = strdup(versionstring);
+               }
+       }
+       return infoString;
+}
+/*--------------------------------------------------------------------------*/
+char **getScilabVersionOptions(int *sizeArrayReturned)
+{
+       char **options = NULL;
+       int nbOptions = 2;
+       *sizeArrayReturned = 0;
+
+       options = (char**)MALLOC(sizeof(char*) * nbOptions);
+       if (options)
+       {
+               options[0] = getCompilerUsedToBuildScilab();
+               options[1] = getCompilerArchitecture();
+
+               if (with_pvm())
+               {
+                       options = REALLOC(options, sizeof(char*) * (nbOptions + 1));
+                       if (options)
+                       {
+                               options[nbOptions] = strdup(PVM_OPTION_STRING);
+                               nbOptions++;
+                       }
+                       else
+                       {
+                               return NULL;
+                       }
+               }
+
+               if (with_tk())
+               {
+                       options = REALLOC(options, sizeof(char*) * (nbOptions + 1));
+                       if (options)
+                       {
+                               options[nbOptions] = strdup(TCLTK_OPTION_STRING);
+                               nbOptions++;
+                       }
+                       else
+                       {
+                               return NULL;
+                       }
+               }
+
+               if (with_modelica_compiler())
+               {
+                       options = REALLOC(options, sizeof(char*) * (nbOptions + 1));
+                       if (options)
+                       {
+                               options[nbOptions] = strdup(MODELICAC_OPTION_STRING);
+                               nbOptions++;
+                       }
+                       else
+                       {
+                               return NULL;
+                       }
+               }
+
+               if (with_atlas())
+               {
+                       options = REALLOC(options, sizeof(char*) * (nbOptions + 1));
+                       if (options)
+                       {
+                               options[nbOptions] = strdup(ATLAS_OPTION_STRING);
+                               nbOptions++;
+                       }
+                       else
+                       {
+                               return NULL;
+                       }
+               }
+
+               options = REALLOC(options, sizeof(char*) * (nbOptions + 1));
+               if (options)
+               {
+                       options[nbOptions] = getReleaseMode();
+                       nbOptions++;
+               }
+               else
+               {
+                       return NULL;
+               }
+
+               options = REALLOC(options, sizeof(char*) * (nbOptions + 1));
+               if (options)
+               {
+                       options[nbOptions] = getReleaseDate();
+                       nbOptions++;
+               }
+               else
+               {
+                       return NULL;
+               }
+
+               options = REALLOC(options, sizeof(char*) * (nbOptions + 1));
+               if (options)
+               {
+                       options[nbOptions] = getReleaseTime();
+                       nbOptions++;
+               }
+               else
+               {
+                       return NULL;
+               }
+
+               *sizeArrayReturned = nbOptions;
+       }
+       return options;
+}
+/*--------------------------------------------------------------------------*/
+char *getReleaseMode(void)
+{
+       #ifdef NDEBUG
+       return strdup(RELEASE_STRING);
+       #else
+       return strdup(DEBUG_STRING);
+       #endif
+}
+/*--------------------------------------------------------------------------*/
+char *getReleaseDate(void)
+{
+       return strdup(__DATE__);
+}
+/*--------------------------------------------------------------------------*/
+char *getReleaseTime(void)
+{
+       return strdup(__TIME__);
+}
+/*--------------------------------------------------------------------------*/
+char *getCompilerUsedToBuildScilab(void)
+{
+       #ifdef __INTEL_COMPILER
+               return strdup(ICC_STRING);
+       #else
+               #ifdef _MSC_VER
+                       return strdup(VC_STRING);
+               #else
+                       #ifdef __GNUC__
+                               return strdup(GCC_STRING);
+                       #else
+                               #ifdef __PGI
+                                       return strdup(PGI_STRING);
+                               #else
+                                       #if defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+                                               return strdup(SUN_STRING);
+                                       #else
+                                               return strdup(UNKNOW_STRING);
+                                       #endif
+                               #endif
+                       #endif
+               #endif
+       #endif
+}
+/*--------------------------------------------------------------------------*/
+char *getCompilerArchitecture(void)
+{
+       #ifdef _MSC_VER
+               #ifdef _WIN64
+                       return strdup(X64_STRING);
+               #else
+                       return strdup(X86_STRING);
+               #endif
+       #else
+               #ifdef _LP64
+                       return strdup(X64_STRING);
+               #else
+                       return strdup(X86_STRING);
+               #endif
+       #endif
+}
+/*--------------------------------------------------------------------------*/
+BOOL with_pvm(void)
+{
+       return with_module(PVM_MODULE_NAME);
+}
+/*--------------------------------------------------------------------------*/
+BOOL with_modelica_compiler(void)
+{
+       char *fullpathModelicac = searchEnv(ModelicacName, "PATH");
+       if (fullpathModelicac)
+       {
+               FREE(fullpathModelicac);
+               fullpathModelicac = NULL;
+               return TRUE;
+       }
+       return FALSE;
+}
+/*--------------------------------------------------------------------------*/
+BOOL with_tk(void)
+{
+       return with_module(TCLSCI_MODULE_NAME) && (getScilabMode() != SCILAB_NWNI);
+}
+/*--------------------------------------------------------------------------*/
+BOOL with_atlas(void)
+{
+       #ifdef WITH_ATLAS
+               return TRUE;
+       #else
+               return FALSE;
+       #endif
+}
+/*--------------------------------------------------------------------------*/
index fbcff7e..9bbe59c 100644 (file)
 #include "PATH_MAX.h"
 #include "scilabDefaults.h"
 /*--------------------------------------------------------------------------*/
-int C2F(withmodelicac)(int *rep)
-{
-       if (ExistModelicac())
-       {
-               *rep =1;
-       }
-       else
-       {
-               *rep =0; 
-       }
-  return 0;
-}
-/*--------------------------------------------------------------------------*/
-int C2F(withmsdos)(int *rep)
-{
-#ifdef _MSC_VER
-       *rep =1;
-#else
-       *rep =0; 
-#endif
-       return 0;
-}
-/*--------------------------------------------------------------------------*/
-int C2F(getcomp)(char *buf,int *nbuf,long int lbuf)
-{
-  int ierr,iflag=0,l1buf=lbuf;
-  C2F(getenvc)(&ierr,"COMPILER",buf,&l1buf,&iflag);
-  if ( ierr== 1) strncpy(buf,"NO",lbuf);
-  *nbuf = (int)strlen(buf);
-  return 0;
-}
-/*--------------------------------------------------------------------------*/
 /**
  * Set the SCI path and initialize the scilab environement path
  *
@@ -175,18 +143,6 @@ int C2F(gettmpdir)(char *buf,int *nbuf,long int lbuf)
        return 0;
 }
 /*--------------------------------------------------------------------------*/
-BOOL ExistModelicac(void)
-{
-       char *fullpathModelicac = searchEnv( ModelicacName,"PATH");
-       if (fullpathModelicac)
-       {
-               FREE(fullpathModelicac);
-               fullpathModelicac = NULL;
-               return TRUE;
-       }
-       return FALSE;
-}
-/*--------------------------------------------------------------------------*/
 int C2F(withgui)(int *rep)
 { 
        *rep = (getScilabMode() != SCILAB_NWNI); 
index a56080a..7a34d72 100644 (file)
@@ -9,10 +9,12 @@
  * http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
  *
  */
+#include <stdio.h>
 #include "terme.h"
 #include "stack-def.h"
 #include "stack-c.h"
 #include "Scierror.h"
+#include "basout.h"
 /*--------------------------------------------------------------------------*/ 
 extern int C2F(getsym)();
 /*--------------------------------------------------------------------------*/ 
index 77f16c8..850e603 100644 (file)
@@ -189,27 +189,25 @@ c     get default global stackize from c
       gbot=isizt
       lstk(gbot)=lstk(gtop+1)+vsizg-1
 c
-c     15 is the number of predefined variables 
-c     16 - 1 blank not include
-      bot=isiz-15
-      bbot=bot
-      bot0=bot
+c     13 is the number of predefined variables 
+c     14 - 1 blank not include
+      bot = isiz - 13
+      bbot = bot
+      bot0 = bot
 c     memory requested for predefined variables 
 c     mxn bmat -> size : sadr(2+m*n+2)
 c     $        -> size : sadr(10-1) + 2 
 c     mxn mat  -> size : sadr(3)+m*n*(it+1)
 c     string   -> size : sadr(6+nchar)+1
-c     4 strings
-c     5 booleans
-      call getcomp(bufcomp,nbcomp)
+c     3 strings
+c     4 booleans
       call getsci(bufsci,nbsci)
       call getscihome(bufscihome,nbscihome)
       call gettmpdir(buftmp,nbtmpdir)
       lpvar = (sadr(10-1) + 2) 
-     $     + 5*sadr(5) 
-     $     + 4*(sadr(3)+1)
+     $     + 4*sadr(5) 
+     $     + 3*(sadr(3)+1)
      $     + 2*(sadr(3)+2)
-     $     + 1*(sadr(6+nbcomp)+1)
      $     + 1*(sadr(6+nbsci)+1)
      $     + 1*(sadr(6+nbscihome)+1)
      $     + 1*(sadr(6+nbtmpdir)+1)
@@ -217,12 +215,6 @@ c     5 booleans
       l=vsizr-lpvar
       k=bot
       lstk(k)=lstk(1)-1+l
-C     . COMPILER
-      vname = ' '
-      vname(1:8) =  "COMPILER"
-      call cvname(idloc,vname,0)
-      call cresmatvar(idloc,k,bufcomp,nbcomp)
-      k=k+1
 c     . SCI
       vname = ' '
       vname(1:3) =  "SCI"
@@ -248,13 +240,6 @@ c     . %gui
       call cvname(idloc,vname,0)
       call crebmatvar(idloc,k,1,1,irep)
       k=k+1
-c     . %tk
-      vname = ' ' 
-      vname(1:3) = "%tk"
-      call withtk(irep)
-      call cvname(idloc,vname,0)
-      call crebmatvar(idloc,k,1,1,irep)
-      k=k+1
 c     . %fftw 
       vname = ' '
       vname(1:5) = "%fftw"
index 4f9f091..ec8649c 100644 (file)
@@ -50,7 +50,7 @@ function Makename=ilib_gen_Make(name,tables,files,libs,makename,with_gateway,ldf
        tables(it)=table;
   end
       
-  comp_target = COMPILER;
+
   if with_lcc() == %T then
     if isdef('makename') then
       if (makename == []) | (makename == '') then
@@ -59,26 +59,19 @@ function Makename=ilib_gen_Make(name,tables,files,libs,makename,with_gateway,ldf
     end
     Makename = makename + '.lcc';
     ilib_gen_Make_lcc(name,tables,files,libs,Makename,with_gateway,ldflags,cflags,fflags)
-  else if getenv('WIN32','NO')=='OK' then
-    if isdef('makename') then
-      if (makename == []) | (makename == '') then
-        makename = 'makelib';
+  else 
+    if getos() == 'Windows' then
+      if isdef('makename') then
+        if (makename == []) | (makename == '') then
+          makename = 'makelib';
+        end
       end
-    end
-    select comp_target
-     case 'VC++'   then Makename = makename + '.mak';
+      Makename = makename + '.mak';
       ilib_gen_Make_win32(name,tables,files,libs,Makename,with_gateway,ldflags,cflags,fflags)
-     case 'gcc' then 
-      Makename = makename; 
-      ilib_gen_Make_unix(name,files,libs,Makename,with_gateway,ldflags,cflags,fflags,cc,tables)
     else
-       Makename = makename;
-       ilib_gen_Make_win32(name,tables,files,libs,Makename,with_gateway,ldflags,cflags,fflags)
+      Makename = makename;
+      ilib_gen_Make_unix(name,files,libs,name,ldflags,cflags,fflags,cc,tables)
     end
-  else
-     Makename = makename;
-     ilib_gen_Make_unix(name,files,libs,name,ldflags,cflags,fflags,cc,tables)
-  end
   end
 endfunction