* Create a java core library with the main scilab java class 88/1788/8
Sylvestre Ledru [Thu, 2 Sep 2010 15:47:37 +0000 (17:47 +0200)]
org.scilab.modules.core.Scilab
* Change the build order. JVM is built earlier and core is built only once
* GuiManagement.getSCIHOME moved from the console module to the commons one
(with the JNI code)
+ update of the usage of it

Change-Id: I738f05ebba000da2671d29c1ec96672478eb4553

30 files changed:
scilab/Scilab.sln
scilab/Scilab_f2c.sln
scilab/build.incl.xml
scilab/etc/classpath.xml.in
scilab/etc/classpath.xml.vc
scilab/modules/Makefile.am
scilab/modules/Makefile.in
scilab/modules/commons/Makefile.am
scilab/modules/commons/Makefile.in
scilab/modules/commons/commons.iss
scilab/modules/commons/src/c/LibScilab_Import.def
scilab/modules/commons/src/c/commons.vcproj
scilab/modules/commons/src/java/org/scilab/modules/commons/ScilabCommons.java [new file with mode: 0644]
scilab/modules/commons/src/java/org/scilab/modules/commons/ScilabCommonsJNI.java [new file with mode: 0644]
scilab/modules/commons/src/java/org/scilab/modules/commons/ScilabConstants.java [moved from scilab/modules/jvm/src/java/org/scilab/modules/jvm/utils/ScilabConstants.java with 91% similarity]
scilab/modules/commons/src/jni/ScilabCommons.i [new file with mode: 0644]
scilab/modules/commons/src/jni/ScilabCommons_wrap.c [new file with mode: 0644]
scilab/modules/console/src/java/org/scilab/modules/console/GuiManagement.java
scilab/modules/console/src/java/org/scilab/modules/console/GuiManagementJNI.java
scilab/modules/console/src/jni/GuiManagement.i
scilab/modules/console/src/jni/GuiManagement_wrap.c
scilab/modules/core/build.xml [new file with mode: 0644]
scilab/modules/core/core.iss
scilab/modules/core/src/java/core-JAVA.vcproj [new file with mode: 0644]
scilab/modules/core/src/java/org/scilab/modules/core/Scilab.java [moved from scilab/modules/jvm/src/java/org/scilab/modules/jvm/Scilab.java with 99% similarity]
scilab/modules/gui/src/java/org/scilab/modules/gui/utils/ConfigManager.java
scilab/modules/jvm/src/c/createMainScilabObject.c
scilab/modules/scinotes/src/java/org/scilab/modules/scinotes/utils/ConfigSciNotesManager.java
scilab/scilab-lib.properties.in
scilab/scilab-lib.properties.vc

index 9eb241c..5d275d4 100644 (file)
@@ -1290,6 +1290,19 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "output_stream-Ant", "module
                {E9783492-017E-4811-9CC7-6B71856F847C} = {E9783492-017E-4811-9CC7-6B71856F847C}
        EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core-Ant", "modules\core\src\java\core-JAVA.vcproj", "{78D8B862-964A-4D0E-93D2-CA8A25BA1207}"
+       ProjectSection(ProjectDependencies) = postProject
+               {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43} = {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43}
+               {E9783492-017E-4811-9CC7-6B71856F847C} = {E9783492-017E-4811-9CC7-6B71856F847C}
+               {F01C26E3-E409-4E74-BA84-C7C4A71A7FDC} = {F01C26E3-E409-4E74-BA84-C7C4A71A7FDC}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "commons", "modules\commons\src\c\commons.vcproj", "{ECA09A1E-6D12-4A47-92E1-A671C181DF77}"
+       ProjectSection(ProjectDependencies) = postProject
+               {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4} = {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}
+               {6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E} = {6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E}
+       EndProjectSection
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Win32 = Debug|Win32
@@ -2494,6 +2507,22 @@ Global
                {F3943691-FF61-48B4-9CA4-10E9D1F600A6}.Release|Win32.Build.0 = Release|Win32
                {F3943691-FF61-48B4-9CA4-10E9D1F600A6}.Release|x64.ActiveCfg = Release|x64
                {F3943691-FF61-48B4-9CA4-10E9D1F600A6}.Release|x64.Build.0 = Release|x64
+               {78D8B862-964A-4D0E-93D2-CA8A25BA1207}.Debug|Win32.ActiveCfg = Debug|Win32
+               {78D8B862-964A-4D0E-93D2-CA8A25BA1207}.Debug|Win32.Build.0 = Debug|Win32
+               {78D8B862-964A-4D0E-93D2-CA8A25BA1207}.Debug|x64.ActiveCfg = Debug|x64
+               {78D8B862-964A-4D0E-93D2-CA8A25BA1207}.Debug|x64.Build.0 = Debug|x64
+               {78D8B862-964A-4D0E-93D2-CA8A25BA1207}.Release|Win32.ActiveCfg = Release|Win32
+               {78D8B862-964A-4D0E-93D2-CA8A25BA1207}.Release|Win32.Build.0 = Release|Win32
+               {78D8B862-964A-4D0E-93D2-CA8A25BA1207}.Release|x64.ActiveCfg = Release|x64
+               {78D8B862-964A-4D0E-93D2-CA8A25BA1207}.Release|x64.Build.0 = Release|x64
+               {ECA09A1E-6D12-4A47-92E1-A671C181DF77}.Debug|Win32.ActiveCfg = Debug|Win32
+               {ECA09A1E-6D12-4A47-92E1-A671C181DF77}.Debug|Win32.Build.0 = Debug|Win32
+               {ECA09A1E-6D12-4A47-92E1-A671C181DF77}.Debug|x64.ActiveCfg = Debug|x64
+               {ECA09A1E-6D12-4A47-92E1-A671C181DF77}.Debug|x64.Build.0 = Debug|x64
+               {ECA09A1E-6D12-4A47-92E1-A671C181DF77}.Release|Win32.ActiveCfg = Release|Win32
+               {ECA09A1E-6D12-4A47-92E1-A671C181DF77}.Release|Win32.Build.0 = Release|Win32
+               {ECA09A1E-6D12-4A47-92E1-A671C181DF77}.Release|x64.ActiveCfg = Release|x64
+               {ECA09A1E-6D12-4A47-92E1-A671C181DF77}.Release|x64.Build.0 = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index 1c79aa5..cd984ca 100644 (file)
@@ -1192,17 +1192,6 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "parameters", "modules\param
                {A5911CD7-F8E8-440C-A23E-4843A0636F3A} = {A5911CD7-F8E8-440C-A23E-4843A0636F3A}
        EndProjectSection
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "parallel", "modules\parallel\src\c\parallel.vcproj", "{56A2E2F3-26CF-45D5-BE7A-534C39CD7003}"
-       ProjectSection(ProjectDependencies) = postProject
-               {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4} = {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}
-               {8028F371-6A94-4A26-8804-6E7F05F1D1AA} = {8028F371-6A94-4A26-8804-6E7F05F1D1AA}
-               {EAB6C580-22B3-4359-BA1D-DD7499A96163} = {EAB6C580-22B3-4359-BA1D-DD7499A96163}
-               {A09E8584-0713-48A5-97BA-ACED0F3728F8} = {A09E8584-0713-48A5-97BA-ACED0F3728F8}
-               {6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E} = {6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E}
-               {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0} = {43C5BAB1-1DCA-4743-A183-77E0D42FE7D0}
-               {A5911CD7-F8E8-440C-A23E-4843A0636F3A} = {A5911CD7-F8E8-440C-A23E-4843A0636F3A}
-       EndProjectSection
-EndProject
 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "graph-java-tests", "modules\graph\tests\java\graph-JAVA-tests.vcproj", "{AB7EBA0D-1B00-4B1B-BB00-62AB38E2309A}"
        ProjectSection(ProjectDependencies) = postProject
                {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43} = {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43}
@@ -1290,6 +1279,19 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "output_stream-Ant", "module
                {E9783492-017E-4811-9CC7-6B71856F847C} = {E9783492-017E-4811-9CC7-6B71856F847C}
        EndProjectSection
 EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "core-Ant", "modules\core\src\java\core-JAVA.vcproj", "{78D8B862-964A-4D0E-93D2-CA8A25BA1207}"
+       ProjectSection(ProjectDependencies) = postProject
+               {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43} = {FBA3BC3F-8A2C-4D47-A50D-EB808BE42F43}
+               {E9783492-017E-4811-9CC7-6B71856F847C} = {E9783492-017E-4811-9CC7-6B71856F847C}
+               {F01C26E3-E409-4E74-BA84-C7C4A71A7FDC} = {F01C26E3-E409-4E74-BA84-C7C4A71A7FDC}
+       EndProjectSection
+EndProject
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "commons", "modules\commons\src\c\commons.vcproj", "{ECA09A1E-6D12-4A47-92E1-A671C181DF77}"
+       ProjectSection(ProjectDependencies) = postProject
+               {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4} = {DD8A0506-8D31-4CF8-856A-C10ECE9C13A4}
+               {6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E} = {6A84AD8C-BA18-4A3F-9C72-EC3DF0939E9E}
+       EndProjectSection
+EndProject
 Global
        GlobalSection(SolutionConfigurationPlatforms) = preSolution
                Debug|Win32 = Debug|Win32
@@ -2402,14 +2404,6 @@ Global
                {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Release|Win32.Build.0 = Release|Win32
                {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Release|x64.ActiveCfg = Release|x64
                {A09E8584-0713-48A5-97BA-ACED0F3728F8}.Release|x64.Build.0 = Release|x64
-               {56A2E2F3-26CF-45D5-BE7A-534C39CD7003}.Debug|Win32.ActiveCfg = Debug|Win32
-               {56A2E2F3-26CF-45D5-BE7A-534C39CD7003}.Debug|Win32.Build.0 = Debug|Win32
-               {56A2E2F3-26CF-45D5-BE7A-534C39CD7003}.Debug|x64.ActiveCfg = Debug|x64
-               {56A2E2F3-26CF-45D5-BE7A-534C39CD7003}.Debug|x64.Build.0 = Debug|x64
-               {56A2E2F3-26CF-45D5-BE7A-534C39CD7003}.Release|Win32.ActiveCfg = Release|Win32
-               {56A2E2F3-26CF-45D5-BE7A-534C39CD7003}.Release|Win32.Build.0 = Release|Win32
-               {56A2E2F3-26CF-45D5-BE7A-534C39CD7003}.Release|x64.ActiveCfg = Release|x64
-               {56A2E2F3-26CF-45D5-BE7A-534C39CD7003}.Release|x64.Build.0 = Release|x64
                {AB7EBA0D-1B00-4B1B-BB00-62AB38E2309A}.Debug|Win32.ActiveCfg = Debug|Win32
                {AB7EBA0D-1B00-4B1B-BB00-62AB38E2309A}.Debug|x64.ActiveCfg = Debug|x64
                {AB7EBA0D-1B00-4B1B-BB00-62AB38E2309A}.Release|Win32.ActiveCfg = Release|Win32
@@ -2494,6 +2488,22 @@ Global
                {F3943691-FF61-48B4-9CA4-10E9D1F600A6}.Release|Win32.Build.0 = Release|Win32
                {F3943691-FF61-48B4-9CA4-10E9D1F600A6}.Release|x64.ActiveCfg = Release|x64
                {F3943691-FF61-48B4-9CA4-10E9D1F600A6}.Release|x64.Build.0 = Release|x64
+               {78D8B862-964A-4D0E-93D2-CA8A25BA1207}.Debug|Win32.ActiveCfg = Debug|Win32
+               {78D8B862-964A-4D0E-93D2-CA8A25BA1207}.Debug|Win32.Build.0 = Debug|Win32
+               {78D8B862-964A-4D0E-93D2-CA8A25BA1207}.Debug|x64.ActiveCfg = Debug|x64
+               {78D8B862-964A-4D0E-93D2-CA8A25BA1207}.Debug|x64.Build.0 = Debug|x64
+               {78D8B862-964A-4D0E-93D2-CA8A25BA1207}.Release|Win32.ActiveCfg = Release|Win32
+               {78D8B862-964A-4D0E-93D2-CA8A25BA1207}.Release|Win32.Build.0 = Release|Win32
+               {78D8B862-964A-4D0E-93D2-CA8A25BA1207}.Release|x64.ActiveCfg = Release|x64
+               {78D8B862-964A-4D0E-93D2-CA8A25BA1207}.Release|x64.Build.0 = Release|x64
+               {ECA09A1E-6D12-4A47-92E1-A671C181DF77}.Debug|Win32.ActiveCfg = Debug|Win32
+               {ECA09A1E-6D12-4A47-92E1-A671C181DF77}.Debug|Win32.Build.0 = Debug|Win32
+               {ECA09A1E-6D12-4A47-92E1-A671C181DF77}.Debug|x64.ActiveCfg = Debug|x64
+               {ECA09A1E-6D12-4A47-92E1-A671C181DF77}.Debug|x64.Build.0 = Debug|x64
+               {ECA09A1E-6D12-4A47-92E1-A671C181DF77}.Release|Win32.ActiveCfg = Release|Win32
+               {ECA09A1E-6D12-4A47-92E1-A671C181DF77}.Release|Win32.Build.0 = Release|Win32
+               {ECA09A1E-6D12-4A47-92E1-A671C181DF77}.Release|x64.ActiveCfg = Release|x64
+               {ECA09A1E-6D12-4A47-92E1-A671C181DF77}.Release|x64.Build.0 = Release|x64
        EndGlobalSection
        GlobalSection(SolutionProperties) = preSolution
                HideSolutionNode = FALSE
index 4c9c103..d975ea7 100644 (file)
@@ -81,6 +81,7 @@
                <pathelement location="${library.jvm.dir}/${library.jvm.name}"/>
                <pathelement location="${library.renderer.dir}/${library.renderer.name}"/>
                <pathelement location="${library.graphic_export.dir}/${library.graphic_export.name}"/>
+               <pathelement location="${library.core.dir}/${library.core.name}"/>
                
                <pathelement location="${commons-logging.jar}"/>
                
index 81fde51..761264e 100644 (file)
@@ -154,6 +154,8 @@ The option is "disableUnderMode" and can be:
 
 <path value="$SCILAB/modules/graphic_export/jar/org.scilab.modules.graphic_export.jar"/>
 
+<path value="$SCILAB/modules/core/jar/org.scilab.modules.core.jar"/>
+
 <!-- scinotes module -->
 <path value="$SCILAB/modules/scinotes/jar/org.scilab.modules.scinotes.jar" load="onUse">
        <load on="SciNotes"/>
index 86366c8..70d3572 100644 (file)
@@ -157,6 +157,7 @@ The option is "disableUnderMode" and can be:
 <path value="$SCILAB/modules/renderer/jar/org.scilab.modules.renderer.jar"/>
 
 <path value="$SCILAB/modules/graphic_export/jar/org.scilab.modules.graphic_export.jar"/>
+<path value="$SCILAB/modules/core/jar/org.scilab.modules.core.jar"/>
 
 <!-- scinotes module -->
 <path value="$SCILAB/modules/scinotes/jar/org.scilab.modules.scinotes.jar" load="onUse">
index f2ed570..62affce 100644 (file)
@@ -14,9 +14,8 @@
 
 # core is the main module of Scilab. All the compilation deps has been removed
 # since it already linked almost the whole world
-SUBDIRS = core
 
-SUBDIRS += \
+SUBDIRS = \
 output_stream \
 arnoldi \
 elementary_functions \
@@ -29,6 +28,7 @@ spreadsheet \
 tclsci \
 localization \
 commons \
+jvm \
 action_binding \
 renderer \
 shell \
@@ -36,7 +36,6 @@ completion \
 console \
 graphic_export \
 gui \
-jvm \
 graphics \
 optimization \
 symbolic \
index eaf4e06..0fedd06 100644 (file)
@@ -29,6 +29,9 @@
 
 # The order DOES matter !!!
 
+# core is the main module of Scilab. All the compilation deps has been removed
+# since it already linked almost the whole world
+
 VPATH = @srcdir@
 pkgdatadir = $(datadir)/@PACKAGE@
 pkgincludedir = $(includedir)/@PACKAGE@
@@ -151,14 +154,14 @@ AM_RECURSIVE_TARGETS = $(RECURSIVE_TARGETS:-recursive=) \
        distdir
 ETAGS = etags
 CTAGS = ctags
-DIST_SUBDIRS = core output_stream arnoldi elementary_functions string \
+DIST_SUBDIRS = output_stream arnoldi elementary_functions string \
        api_scilab dynamic_link fileio history_manager spreadsheet \
-       tclsci localization commons action_binding renderer shell \
-       completion console graphic_export gui jvm graphics \
-       optimization symbolic randlib statistics special_functions \
-       interpolation linear_algebra integer data_structures mexlib \
+       tclsci localization commons jvm action_binding renderer shell \
+       completion console graphic_export gui graphics optimization \
+       symbolic randlib statistics special_functions interpolation \
+       linear_algebra integer data_structures mexlib \
        differential_equations cacsd polynomials boolean double pvm io \
-       intersci signal_processing call_scilab sound time sparse \
+       intersci signal_processing core call_scilab sound time sparse \
        windows_tools functions overloading maple2scilab m2sci texmacs \
        development_tools compatibility_functions helptools fftw \
        umfpack demo_tools genetic_algorithms simulated_annealing \
@@ -435,15 +438,12 @@ target_alias = @target_alias@
 top_build_prefix = @top_build_prefix@
 top_builddir = @top_builddir@
 top_srcdir = @top_srcdir@
-
-# core is the main module of Scilab. All the compilation deps has been removed
-# since it already linked almost the whole world
-SUBDIRS = core output_stream arnoldi elementary_functions string \
-       api_scilab dynamic_link fileio history_manager spreadsheet \
-       tclsci localization commons action_binding renderer shell \
-       completion console graphic_export gui jvm graphics \
-       optimization symbolic randlib statistics special_functions \
-       interpolation linear_algebra integer data_structures mexlib \
+SUBDIRS = output_stream arnoldi elementary_functions string api_scilab \
+       dynamic_link fileio history_manager spreadsheet tclsci \
+       localization commons jvm action_binding renderer shell \
+       completion console graphic_export gui graphics optimization \
+       symbolic randlib statistics special_functions interpolation \
+       linear_algebra integer data_structures mexlib \
        differential_equations cacsd polynomials boolean double pvm io \
        intersci signal_processing core call_scilab interpolation \
        sound time randlib sparse windows_tools functions overloading \
index fbb213a..c4fe0f2 100644 (file)
@@ -28,7 +28,7 @@ include $(top_srcdir)/Makefile.incl.am
 
 COMMONS_JNI_SOURCES = 
 
-COMMONS_C_SOURCES = 
+COMMONS_C_SOURCES =  src/jni/ScilabCommons_wrap.c
 
 COMMONS_CPP_SOURCES =
 
@@ -45,7 +45,7 @@ GATEWAY_C_SOURCES =
 
 GATEWAY_CPP_SOURCES = 
 
-libscicommons_la_CFLAGS= 
+libscicommons_la_CFLAGS= $(JAVA_JNI_INCLUDE)
 
 
 libscicommons_la_CPPFLAGS = 
@@ -79,8 +79,7 @@ if SWIG
 BUILT_SOURCES=swig
 endif
 
-libscicommons_la_LIBADD = $(top_builddir)/modules/core/libscicore.la \
-$(top_builddir)/libs/MALLOC/libscimalloc.la \
+libscicommons_la_LIBADD = $(top_builddir)/libs/MALLOC/libscimalloc.la \
 $(top_builddir)/modules/output_stream/libscioutput_stream.la
 
 
index 4433962..463661d 100644 (file)
@@ -127,11 +127,11 @@ libscicommons_disable_la_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) \
        $(libscicommons_disable_la_CFLAGS) $(CFLAGS) \
        $(libscicommons_disable_la_LDFLAGS) $(LDFLAGS) -o $@
 libscicommons_la_DEPENDENCIES =  \
-       $(top_builddir)/modules/core/libscicore.la \
        $(top_builddir)/libs/MALLOC/libscimalloc.la \
        $(top_builddir)/modules/output_stream/libscioutput_stream.la
-am__objects_2 = empty.lo
-am_libscicommons_la_OBJECTS = $(am__objects_1) $(am__objects_2) \
+am__objects_2 = libscicommons_la-ScilabCommons_wrap.lo
+am__objects_3 = empty.lo
+am_libscicommons_la_OBJECTS = $(am__objects_2) $(am__objects_3) \
        $(am__objects_1) $(am__objects_1) $(am__objects_1) \
        $(am__objects_1)
 libscicommons_la_OBJECTS = $(am_libscicommons_la_OBJECTS)
@@ -140,13 +140,9 @@ libscicommons_la_LINK = $(LIBTOOL) --tag=F77 $(AM_LIBTOOLFLAGS) \
        $(libscicommons_la_LDFLAGS) $(LDFLAGS) -o $@
 @GUI_TRUE@am_libscicommons_la_rpath = -rpath $(pkglibdir)
 DEFAULT_INCLUDES = -I.@am__isrc@ -I$(top_builddir)/modules/core/includes
-F77COMPILE = $(F77) $(AM_FFLAGS) $(FFLAGS)
-LTF77COMPILE = $(LIBTOOL) --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-       --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS)
-F77LD = $(F77)
-F77LINK = $(LIBTOOL) --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
-       --mode=link $(F77LD) $(AM_FFLAGS) $(FFLAGS) $(AM_LDFLAGS) \
-       $(LDFLAGS) -o $@
+depcomp = $(SHELL) $(top_srcdir)/config/depcomp
+am__depfiles_maybe = depfiles
+am__mv = mv -f
 COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
        $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
 LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
@@ -156,6 +152,13 @@ CCLD = $(CC)
 LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
        --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
        $(LDFLAGS) -o $@
+F77COMPILE = $(F77) $(AM_FFLAGS) $(FFLAGS)
+LTF77COMPILE = $(LIBTOOL) --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=compile $(F77) $(AM_FFLAGS) $(FFLAGS)
+F77LD = $(F77)
+F77LINK = $(LIBTOOL) --tag=F77 $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
+       --mode=link $(F77LD) $(AM_FFLAGS) $(FFLAGS) $(AM_LDFLAGS) \
+       $(LDFLAGS) -o $@
 SOURCES = $(libscicommons_disable_la_SOURCES) \
        $(libscicommons_la_SOURCES)
 DIST_SOURCES = $(libscicommons_disable_la_SOURCES) \
@@ -486,7 +489,7 @@ HELP_CHAPTERDIR = help/
 HELP_CHAPTERFILE = addchapter.sce
 HELP_CHAPTERLANG = en_US fr_FR pt_BR
 COMMONS_JNI_SOURCES = 
-COMMONS_C_SOURCES = 
+COMMONS_C_SOURCES = src/jni/ScilabCommons_wrap.c
 COMMONS_CPP_SOURCES = 
 COMMONS_FORTRAN_SOURCES = src/fortran/empty.f
 GIWS_WRAPPERS = 
@@ -494,7 +497,7 @@ GIWS_WRAPPERS =
 @SWIG_TRUE@BUILT_SOURCES = swig
 GATEWAY_C_SOURCES = 
 GATEWAY_CPP_SOURCES = 
-libscicommons_la_CFLAGS = 
+libscicommons_la_CFLAGS = $(JAVA_JNI_INCLUDE)
 libscicommons_la_CPPFLAGS = 
 
 # Without the commons module 
@@ -512,8 +515,7 @@ INCLUDE_FLAGS = $(libscicommons_la_CFLAGS)
 
 #### SWIG Declaration ####
 SWIG_WRAPPERS = 
-libscicommons_la_LIBADD = $(top_builddir)/modules/core/libscicore.la \
-$(top_builddir)/libs/MALLOC/libscimalloc.la \
+libscicommons_la_LIBADD = $(top_builddir)/libs/MALLOC/libscimalloc.la \
 $(top_builddir)/modules/output_stream/libscioutput_stream.la
 
 
@@ -525,7 +527,7 @@ all: $(BUILT_SOURCES)
        $(MAKE) $(AM_MAKEFLAGS) all-am
 
 .SUFFIXES:
-.SUFFIXES: .sci .bin .f .lo .o .obj
+.SUFFIXES: .sci .bin .c .f .lo .o .obj
 $(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/Makefile.incl.am $(am__configure_deps)
        @for dep in $?; do \
          case '$(am__configure_deps)' in \
@@ -598,6 +600,36 @@ mostlyclean-compile:
 distclean-compile:
        -rm -f *.tab.c
 
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/libscicommons_la-ScilabCommons_wrap.Plo@am__quote@
+
+.c.o:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c $<
+
+.c.obj:
+@am__fastdepCC_TRUE@   $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(COMPILE) -c `$(CYGPATH_W) '$<'`
+
+.c.lo:
+@am__fastdepCC_TRUE@   $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LTCOMPILE) -c -o $@ $<
+
+libscicommons_la-ScilabCommons_wrap.lo: src/jni/ScilabCommons_wrap.c
+@am__fastdepCC_TRUE@   $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicommons_la_CPPFLAGS) $(CPPFLAGS) $(libscicommons_la_CFLAGS) $(CFLAGS) -MT libscicommons_la-ScilabCommons_wrap.lo -MD -MP -MF $(DEPDIR)/libscicommons_la-ScilabCommons_wrap.Tpo -c -o libscicommons_la-ScilabCommons_wrap.lo `test -f 'src/jni/ScilabCommons_wrap.c' || echo '$(srcdir)/'`src/jni/ScilabCommons_wrap.c
+@am__fastdepCC_TRUE@   $(am__mv) $(DEPDIR)/libscicommons_la-ScilabCommons_wrap.Tpo $(DEPDIR)/libscicommons_la-ScilabCommons_wrap.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      source='src/jni/ScilabCommons_wrap.c' object='libscicommons_la-ScilabCommons_wrap.lo' libtool=yes @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@      DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@  $(LIBTOOL)  --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(libscicommons_la_CPPFLAGS) $(CPPFLAGS) $(libscicommons_la_CFLAGS) $(CFLAGS) -c -o libscicommons_la-ScilabCommons_wrap.lo `test -f 'src/jni/ScilabCommons_wrap.c' || echo '$(srcdir)/'`src/jni/ScilabCommons_wrap.c
+
 .f.o:
        $(F77COMPILE) -c -o $@ $<
 
@@ -800,6 +832,7 @@ clean-am: clean-generic clean-libtool clean-local \
        clean-pkglibLTLIBRARIES mostlyclean-am
 
 distclean: distclean-am
+       -rm -rf ./$(DEPDIR)
        -rm -f Makefile
 distclean-am: clean-am distclean-compile distclean-generic \
        distclean-local distclean-tags
@@ -847,6 +880,7 @@ install-ps-am:
 installcheck-am:
 
 maintainer-clean: maintainer-clean-am
+       -rm -rf ./$(DEPDIR)
        -rm -f Makefile
 maintainer-clean-am: distclean-am maintainer-clean-generic
 
index 9d14e73..7cc7359 100644 (file)
@@ -17,7 +17,9 @@
 ;
 #define COMMONS "commons"
 ;
-Source: modules\{#COMMONS}\jar\org.scilab.modules.{#COMMONS}.jar;DestDir: {app}\modules\{#COMMONS}\jar; Components: {#COMPN_SCILAB}
+Source: modules\{#COMMONS}\jar\org.scilab.modules.{#COMMONS}.jar;DestDir: {app}\modules\{#COMMONS}\jar; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE}
+;
+Source: bin\sci{#COMMONS}.dll; DestDir: {app}\bin; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE}
 ;
 Source: modules\{#COMMONS}\VERSION.xml; DestDir: {app}\modules\{#COMMONS}; Components: {#COMPN_SCILAB}
 Source: modules\{#COMMONS}\readme.txt; DestDir: {app}\modules\{#COMMONS}; Components: {#COMPN_SCILAB}
index d9f918d..aa9faad 100644 (file)
@@ -45,7 +45,7 @@
                                Name="VCCLCompilerTool"
                                AdditionalOptions=""
                                Optimization="0"
-                               AdditionalIncludeDirectories=".;../../includes;../../../../libs/MALLOC/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../commons/includes;../../../api_scilab/includes"
+                               AdditionalIncludeDirectories=".;../../includes;../../../../libs/MALLOC/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../commons/includes;../../../api_scilab/includes;../../../../java/jdk/include;../../../../java/jdk/include/win32"
                                PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;COMMONS_EXPORTS"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="0"
@@ -69,7 +69,7 @@
                        <Tool
                                Name="VCLinkerTool"
                                AdditionalDependencies="LibScilab.lib commons_f.lib"
-                               OutputFile="$(SolutionDir)bin\$(ProjectName).dll"
+                               OutputFile="$(SolutionDir)bin\sci$(ProjectName).dll"
                                LinkIncremental="1"
                                ModuleDefinitionFile=""
                                GenerateDebugInformation="true"
                        <Tool
                                Name="VCCLCompilerTool"
                                Optimization="0"
-                               AdditionalIncludeDirectories=".;../../includes;../../../../libs/MALLOC/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../commons/includes;../../../api_scilab/includes"
+                               AdditionalIncludeDirectories=".;../../includes;../../../../libs/MALLOC/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../commons/includes;../../../api_scilab/includes;../../../../java/jdk/include;../../../../java/jdk/include/win32"
                                PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;_DEBUG;_WINDOWS;_USRDLL;COMMONS_EXPORTS"
                                MinimalRebuild="true"
                                BasicRuntimeChecks="0"
                        <Tool
                                Name="VCLinkerTool"
                                AdditionalDependencies="LibScilab.lib commons_f.lib"
-                               OutputFile="$(SolutionDir)bin\$(ProjectName).dll"
+                               OutputFile="$(SolutionDir)bin\sci$(ProjectName).dll"
                                LinkIncremental="1"
                                ModuleDefinitionFile=""
                                GenerateDebugInformation="true"
                                InlineFunctionExpansion="1"
                                FavorSizeOrSpeed="1"
                                WholeProgramOptimization="false"
-                               AdditionalIncludeDirectories=".;../../includes;../../../../libs/MALLOC/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../commons/includes;../../../api_scilab/includes"
+                               AdditionalIncludeDirectories=".;../../includes;../../../../libs/MALLOC/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../commons/includes;../../../api_scilab/includes;../../../../java/jdk/include;../../../../java/jdk/include/win32"
                                PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;COMMONS_EXPORTS"
                                StringPooling="true"
                                RuntimeLibrary="2"
                        <Tool
                                Name="VCLinkerTool"
                                AdditionalDependencies="LibScilab.lib commons_f.lib"
-                               OutputFile="$(SolutionDir)bin\$(ProjectName).dll"
+                               OutputFile="$(SolutionDir)bin\sci$(ProjectName).dll"
                                LinkIncremental="1"
                                ModuleDefinitionFile=""
                                GenerateDebugInformation="false"
                                InlineFunctionExpansion="1"
                                FavorSizeOrSpeed="1"
                                WholeProgramOptimization="false"
-                               AdditionalIncludeDirectories=".;../../includes;../../../../libs/MALLOC/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../commons/includes;../../../api_scilab/includes"
+                               AdditionalIncludeDirectories=".;../../includes;../../../../libs/MALLOC/includes;../../../core/includes;../../../output_stream/includes;../../../dynamic_link/includes;../../../dynamic_link/src/c;../../../localization/includes;../../../core/src/c;../../../../libs/intl;../../../commons/includes;../../../api_scilab/includes;../../../../java/jdk/include;../../../../java/jdk/include/win32"
                                PreprocessorDefinitions="_CRT_SECURE_NO_DEPRECATE;FORDLL;NDEBUG;_WINDOWS;_USRDLL;COMMONS_EXPORTS"
                                StringPooling="true"
                                RuntimeLibrary="2"
                        <Tool
                                Name="VCLinkerTool"
                                AdditionalDependencies="LibScilab.lib commons_f.lib"
-                               OutputFile="$(SolutionDir)bin\$(ProjectName).dll"
+                               OutputFile="$(SolutionDir)bin\sci$(ProjectName).dll"
                                LinkIncremental="1"
                                ModuleDefinitionFile=""
                                GenerateDebugInformation="false"
                                RelativePath=".\DllmainCommons.c"
                                >
                        </File>
+                       <File
+                               RelativePath="..\jni\ScilabCommons_wrap.c"
+                               >
+                       </File>
                </Filter>
                <Filter
                        Name="Header Files"
                        </File>
                </Filter>
                <File
-                       RelativePath="..\..\..\..\bin\blasplus.lib"
-                       >
-               </File>
-               <File
                        RelativePath="..\..\commons.iss"
                        >
                </File>
                        >
                </File>
                <File
-                       RelativePath="..\..\..\..\bin\lapack.lib"
-                       >
-               </File>
-               <File
                        RelativePath="..\..\Makefile.am"
                        >
                </File>
diff --git a/scilab/modules/commons/src/java/org/scilab/modules/commons/ScilabCommons.java b/scilab/modules/commons/src/java/org/scilab/modules/commons/ScilabCommons.java
new file mode 100644 (file)
index 0000000..9e140e4
--- /dev/null
@@ -0,0 +1,34 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.40
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+package org.scilab.modules.commons;
+
+
+ /** 
+   * Some commons values from Scilab engine to Java
+   * @author Sylvestre LEDRU
+   * @copyright DIGITEO 2010
+   */
+public class ScilabCommons {
+
+ /**
+   * Constructor
+   */
+ protected ScilabCommons() {
+    throw new UnsupportedOperationException();
+ }
+  
+ /**
+   * Get SCIHOME variable from Scilab
+   * @return SCIHOME value
+   */
+public static String getSCIHOME() {
+    return ScilabCommonsJNI.getSCIHOME();
+  }
+
+}
diff --git a/scilab/modules/commons/src/java/org/scilab/modules/commons/ScilabCommonsJNI.java b/scilab/modules/commons/src/java/org/scilab/modules/commons/ScilabCommonsJNI.java
new file mode 100644 (file)
index 0000000..b7b4b4c
--- /dev/null
@@ -0,0 +1,48 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.40
+ *
+ * Do not make changes to this file unless you know what you are doing--modify
+ * the SWIG interface file instead.
+ * ----------------------------------------------------------------------------- */
+
+package org.scilab.modules.commons;
+
+
+/* It is generated code. Disable checkstyle */
+//CHECKSTYLE:OFF
+ /** 
+   * Some commons values from Scilab engine to Java
+   * @author Sylvestre LEDRU
+   * @copyright DIGITEO 2010
+   */
+public class ScilabCommonsJNI {
+
+  /**
+    * Constructor
+    */
+  protected ScilabCommonsJNI() {
+    throw new UnsupportedOperationException();
+  }
+
+  static {
+    try {
+        System.loadLibrary("scicommons");
+    } catch (SecurityException e) {
+        System.err.println("A security manager exists and does not allow the loading of the specified dynamic library.");
+        System.err.println(e.getLocalizedMessage());
+        System.exit(-1);
+    } catch (UnsatisfiedLinkError e)    {
+           System.err.println("The native library scicommons does not exist or cannot be found.");
+        if (System.getenv("CONTINUE_ON_JNI_ERROR") == null) {
+           System.err.println(e.getLocalizedMessage());
+           System.err.println("Current java.library.path is : "+System.getProperty("java.library.path"));
+           System.exit(-1);
+        }else{
+           System.err.println("Continuing anyway because of CONTINUE_ON_JNI_ERROR");
+        }
+    }
+  }
+
+  public final static native String getSCIHOME();
+}
@@ -15,7 +15,7 @@ package org.scilab.modules.jvm.utils;
 
 import java.io.File;
 
-import org.scilab.modules.console.GuiManagement;
+import org.scilab.modules.commons.ScilabCommons;
 
 /**
  * Define all the constants used on a Scilab
@@ -37,7 +37,7 @@ public class ScilabConstants {
     /**
      * The SCI configuration directory (Scilab home directory)
      */
-    public static final File SCIHOME = new File(GuiManagement.getSCIHOME());
+    public static final File SCIHOME = new File(ScilabCommons.getSCIHOME());
     
     /** Escape double quote symbol */
     public static final char QUOTE = '\"';
diff --git a/scilab/modules/commons/src/jni/ScilabCommons.i b/scilab/modules/commons/src/jni/ScilabCommons.i
new file mode 100644 (file)
index 0000000..3901c4a
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) INRIA - 2010 - Sylvestre Ledru
+ * 
+ * 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
+ *
+ */
+
+
+/* ScilabCommons.i */
+/** 
+ * Windows: swig -java -package org.scilab.modules.commons -outdir ../java/org/scilab/modules/commons/ ScilabCommons.i 
+ * Other: Use the option --enable-build-swig to the configure
+*/
+%module ScilabCommons
+%{
+#include "../../../core/includes/SCIHOME.h"
+%}
+
+/* JavaDoc for ScilabCommonsJNI class */
+%pragma(java) jniclassclassmodifiers=%{
+/* It is generated code. Disable checkstyle */
+//CHECKSTYLE:OFF
+ /** 
+   * Some commons values from Scilab engine to Java
+   * @author Sylvestre LEDRU
+   * @copyright DIGITEO 2010
+   */
+public class%}
+
+/* Constructor for ScilabCommonsJNI class */
+%pragma(java) jniclasscode="
+  /**
+    * Constructor
+    */
+  protected ScilabCommonsJNI() {
+    throw new UnsupportedOperationException();
+  }";
+  
+/* static load of library */
+%pragma(java) jniclasscode=%{
+  static {
+    try {
+        System.loadLibrary("scicommons");
+    } catch (SecurityException e) {
+        System.err.println("A security manager exists and does not allow the loading of the specified dynamic library.");
+        System.err.println(e.getLocalizedMessage());
+        System.exit(-1);
+    } catch (UnsatisfiedLinkError e)    {
+           System.err.println("The native library scicommons does not exist or cannot be found.");
+        if (System.getenv("CONTINUE_ON_JNI_ERROR") == null) {
+           System.err.println(e.getLocalizedMessage());
+           System.err.println("Current java.library.path is : "+System.getProperty("java.library.path"));
+           System.exit(-1);
+        }else{
+           System.err.println("Continuing anyway because of CONTINUE_ON_JNI_ERROR");
+        }
+    }
+  }
+%}
+
+
+/* JavaDoc for ScilabCommons class */
+%pragma(java) moduleclassmodifiers="
+ /** 
+   * Some commons values from Scilab engine to Java
+   * @author Sylvestre LEDRU
+   * @copyright DIGITEO 2010
+   */
+public class";
+
+/* Constructor for ScilabCommons class */
+%pragma(java) modulecode="
+ /**
+   * Constructor
+   */
+ protected ScilabCommons() {
+    throw new UnsupportedOperationException();
+ }";
+
+/* JavaDoc */
+%javamethodmodifiers getSCIHOME() "
+ /**
+   * Get SCIHOME variable from Scilab
+   * @return SCIHOME value
+   */
+public";
+char* getSCIHOME();
diff --git a/scilab/modules/commons/src/jni/ScilabCommons_wrap.c b/scilab/modules/commons/src/jni/ScilabCommons_wrap.c
new file mode 100644 (file)
index 0000000..980786a
--- /dev/null
@@ -0,0 +1,212 @@
+/* ----------------------------------------------------------------------------
+ * This file was automatically generated by SWIG (http://www.swig.org).
+ * Version 1.3.40
+ * 
+ * This file is not intended to be easily readable and contains a number of 
+ * coding conventions designed to improve portability and efficiency. Do not make
+ * changes to this file unless you know what you are doing--modify the SWIG 
+ * interface file instead. 
+ * ----------------------------------------------------------------------------- */
+
+#define SWIGJAVA
+
+/* -----------------------------------------------------------------------------
+ *  This section contains generic SWIG labels for method/variable
+ *  declarations/attributes, and other compiler dependent labels.
+ * ----------------------------------------------------------------------------- */
+
+/* template workaround for compilers that cannot correctly implement the C++ standard */
+#ifndef SWIGTEMPLATEDISAMBIGUATOR
+# if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# elif defined(__HP_aCC)
+/* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
+/* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
+#  define SWIGTEMPLATEDISAMBIGUATOR template
+# else
+#  define SWIGTEMPLATEDISAMBIGUATOR
+# endif
+#endif
+
+/* inline attribute */
+#ifndef SWIGINLINE
+# if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
+#   define SWIGINLINE inline
+# else
+#   define SWIGINLINE
+# endif
+#endif
+
+/* attribute recognised by some compilers to avoid 'unused' warnings */
+#ifndef SWIGUNUSED
+# if defined(__GNUC__)
+#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+#     define SWIGUNUSED __attribute__ ((__unused__)) 
+#   else
+#     define SWIGUNUSED
+#   endif
+# elif defined(__ICC)
+#   define SWIGUNUSED __attribute__ ((__unused__)) 
+# else
+#   define SWIGUNUSED 
+# endif
+#endif
+
+#ifndef SWIG_MSC_UNSUPPRESS_4505
+# if defined(_MSC_VER)
+#   pragma warning(disable : 4505) /* unreferenced local function has been removed */
+# endif 
+#endif
+
+#ifndef SWIGUNUSEDPARM
+# ifdef __cplusplus
+#   define SWIGUNUSEDPARM(p)
+# else
+#   define SWIGUNUSEDPARM(p) p SWIGUNUSED 
+# endif
+#endif
+
+/* internal SWIG method */
+#ifndef SWIGINTERN
+# define SWIGINTERN static SWIGUNUSED
+#endif
+
+/* internal inline SWIG method */
+#ifndef SWIGINTERNINLINE
+# define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
+#endif
+
+/* exporting methods */
+#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
+#  ifndef GCC_HASCLASSVISIBILITY
+#    define GCC_HASCLASSVISIBILITY
+#  endif
+#endif
+
+#ifndef SWIGEXPORT
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   if defined(STATIC_LINKED)
+#     define SWIGEXPORT
+#   else
+#     define SWIGEXPORT __declspec(dllexport)
+#   endif
+# else
+#   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
+#     define SWIGEXPORT __attribute__ ((visibility("default")))
+#   else
+#     define SWIGEXPORT
+#   endif
+# endif
+#endif
+
+/* calling conventions for Windows */
+#ifndef SWIGSTDCALL
+# if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
+#   define SWIGSTDCALL __stdcall
+# else
+#   define SWIGSTDCALL
+# endif 
+#endif
+
+/* Deal with Microsoft's attempt at deprecating C standard runtime functions */
+#if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE
+#endif
+
+/* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
+#if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
+# define _SCL_SECURE_NO_DEPRECATE
+#endif
+
+
+
+/* Fix for jlong on some versions of gcc on Windows */
+#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
+  typedef long long __int64;
+#endif
+
+/* Fix for jlong on 64-bit x86 Solaris */
+#if defined(__x86_64)
+# ifdef _LP64
+#   undef _LP64
+# endif
+#endif
+
+#include <jni.h>
+#include <stdlib.h>
+#include <string.h>
+
+
+/* Support for throwing Java exceptions */
+typedef enum {
+  SWIG_JavaOutOfMemoryError = 1, 
+  SWIG_JavaIOException, 
+  SWIG_JavaRuntimeException, 
+  SWIG_JavaIndexOutOfBoundsException,
+  SWIG_JavaArithmeticException,
+  SWIG_JavaIllegalArgumentException,
+  SWIG_JavaNullPointerException,
+  SWIG_JavaDirectorPureVirtual,
+  SWIG_JavaUnknownError
+} SWIG_JavaExceptionCodes;
+
+typedef struct {
+  SWIG_JavaExceptionCodes code;
+  const char *java_exception;
+} SWIG_JavaExceptions_t;
+
+
+static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionCodes code, const char *msg) {
+  jclass excep;
+  static const SWIG_JavaExceptions_t java_exceptions[] = {
+    { SWIG_JavaOutOfMemoryError, "java/lang/OutOfMemoryError" },
+    { SWIG_JavaIOException, "java/io/IOException" },
+    { SWIG_JavaRuntimeException, "java/lang/RuntimeException" },
+    { SWIG_JavaIndexOutOfBoundsException, "java/lang/IndexOutOfBoundsException" },
+    { SWIG_JavaArithmeticException, "java/lang/ArithmeticException" },
+    { SWIG_JavaIllegalArgumentException, "java/lang/IllegalArgumentException" },
+    { SWIG_JavaNullPointerException, "java/lang/NullPointerException" },
+    { SWIG_JavaDirectorPureVirtual, "java/lang/RuntimeException" },
+    { SWIG_JavaUnknownError,  "java/lang/UnknownError" },
+    { (SWIG_JavaExceptionCodes)0,  "java/lang/UnknownError" }
+  };
+  const SWIG_JavaExceptions_t *except_ptr = java_exceptions;
+
+  while (except_ptr->code != code && except_ptr->code)
+    except_ptr++;
+
+  (*jenv)->ExceptionClear(jenv);
+  excep = (*jenv)->FindClass(jenv, except_ptr->java_exception);
+  if (excep)
+    (*jenv)->ThrowNew(jenv, excep, msg);
+}
+
+
+/* Contract support */
+
+#define SWIG_contract_assert(nullreturn, expr, msg) if (!(expr)) {SWIG_JavaThrowException(jenv, SWIG_JavaIllegalArgumentException, msg); return nullreturn; } else
+
+
+#include "../../../core/includes/SCIHOME.h"
+
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+SWIGEXPORT jstring JNICALL Java_org_scilab_modules_commons_ScilabCommonsJNI_getSCIHOME(JNIEnv *jenv, jclass jcls) {
+  jstring jresult = 0 ;
+  char *result = 0 ;
+  
+  (void)jenv;
+  (void)jcls;
+  result = (char *)getSCIHOME();
+  if (result) jresult = (*jenv)->NewStringUTF(jenv, (const char *)result);
+  return jresult;
+}
+
+
+#ifdef __cplusplus
+}
+#endif
+
index 46fa7d8..01b7035 100644 (file)
@@ -32,13 +32,4 @@ public class GuiManagement {
     GuiManagementJNI.setScilabLines(nbRows, nbCols);
   }
 
-  
- /**
-   * Get SCIHOME variable from Scilab
-   * @return SCIHOME value
-   */
-public static String getSCIHOME() {
-    return GuiManagementJNI.getSCIHOME();
-  }
-
 }
index dbf00b7..155939c 100644 (file)
@@ -45,5 +45,4 @@ public class GuiManagementJNI {
   }
 
   public final static native void setScilabLines(int jarg1, int jarg2);
-  public final static native String getSCIHOME();
 }
index 82b12e4..57cc934 100644 (file)
@@ -1,3 +1,16 @@
+/*
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) INRIA - 2007 - Vincent Couvert
+ * 
+ * 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
+ *
+ */
+
+
 /* GuiManagement.i */
 /** 
  * Windows: swig -java -package org.scilab.modules.console -outdir ../java/org/scilab/modules/console/ GuiManagement.i 
@@ -7,7 +20,6 @@
 %{
 #include "MALLOC.h"
 #include "../c/GuiManagement.h"
-#include "../../../core/includes/SCIHOME.h"
 %}
 
 %include "../../../jvm/src/jni/scilab_typemaps.i"
@@ -82,12 +94,3 @@ public class";
    */
 ";
 void setScilabLines(int nbRows, int nbCols);
-
-/* JavaDoc */
-%javamethodmodifiers getSCIHOME() "
- /**
-   * Get SCIHOME variable from Scilab
-   * @return SCIHOME value
-   */
-public";
-char* getSCIHOME();
\ No newline at end of file
index 9f11a66..d8a7f42 100644 (file)
@@ -189,7 +189,6 @@ static void SWIGUNUSED SWIG_JavaThrowException(JNIEnv *jenv, SWIG_JavaExceptionC
 
 #include "MALLOC.h"
 #include "../c/GuiManagement.h"
-#include "../../../core/includes/SCIHOME.h"
 
 
 #ifdef __cplusplus
@@ -208,25 +207,6 @@ SWIGEXPORT void JNICALL Java_org_scilab_modules_console_GuiManagementJNI_setScil
 }
 
 
-SWIGEXPORT jstring JNICALL Java_org_scilab_modules_console_GuiManagementJNI_getSCIHOME(JNIEnv *jenv, jclass jcls) {
-  jstring jresult = 0 ;
-  char *result = 0 ;
-  
-  (void)jenv;
-  (void)jcls;
-  result = (char *)getSCIHOME();
-  {
-    if (result != NULL)
-    {
-      jresult = (*jenv)->NewStringUTF(jenv, (const char *)result);
-      FREE(result);
-      result = NULL;
-    }       
-  }
-  return jresult;
-}
-
-
 #ifdef __cplusplus
 }
 #endif
diff --git a/scilab/modules/core/build.xml b/scilab/modules/core/build.xml
new file mode 100644 (file)
index 0000000..f3e83f0
--- /dev/null
@@ -0,0 +1,23 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
+ * Copyright (C) 2010 - DIGITEO - Sylvestre LEDRU
+ * 
+ * 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
+ *
+ -->
+
+<project name="core" default="jar">
+  <import file="../../build.incl.xml"/>
+
+  <property name="library.name" value="${library.core.name}" />
+
+  <description>
+       Build the core Scilab module
+  </description>
+
+</project>
index 216676c..84d25bd 100644 (file)
@@ -18,6 +18,8 @@
 ;
 #define CORE "core"
 ;
+Source: modules\{#CORE}\jar\org.scilab.modules.{#CORE}.jar;DestDir: {app}\modules\{#CORE}\jar; Components: {#COMPN_SCILAB} and {#COMPN_JVM_MODULE}
+;
 Source: modules\{#CORE}\VERSION.xml; DestDir: {app}\modules\{#CORE}; Components: {#COMPN_SCILAB}
 Source: modules\{#CORE}\readme.txt; DestDir: {app}\modules\{#CORE}; Components: {#COMPN_SCILAB}
 Source: modules\{#CORE}\license.txt; DestDir: {app}\modules\{#CORE}; Components: {#COMPN_SCILAB}
diff --git a/scilab/modules/core/src/java/core-JAVA.vcproj b/scilab/modules/core/src/java/core-JAVA.vcproj
new file mode 100644 (file)
index 0000000..6da8ff7
--- /dev/null
@@ -0,0 +1,123 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<VisualStudioProject
+       ProjectType="Visual C++"
+       Version="9,00"
+       Name="core-Ant"
+       ProjectGUID="{78D8B862-964A-4D0E-93D2-CA8A25BA1207}"
+       RootNamespace="core-Ant"
+       Keyword="MakeFileProj"
+       TargetFrameworkVersion="0"
+       >
+       <Platforms>
+               <Platform
+                       Name="Win32"
+               />
+               <Platform
+                       Name="x64"
+               />
+       </Platforms>
+       <ToolFiles>
+       </ToolFiles>
+       <Configurations>
+               <Configuration
+                       Name="Debug|Win32"
+                       OutputDirectory="$(SolutionDir)modules\core\jar"
+                       IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
+                       ConfigurationType="0"
+                       >
+                       <Tool
+                               Name="VCNMakeTool"
+                               BuildCommandLine="set JAVA_HOME=$(SolutionDir)\java\jdk&#x0D;&#x0A;set PATH=$(SolutionDir)\java\ant\bin;%PATH%;&#x0D;&#x0A;cd ..\..&#x0D;&#x0A;call ant&#x0D;&#x0A;&#x0D;&#x0A;"
+                               ReBuildCommandLine="set JAVA_HOME=$(SolutionDir)\java\jdk&#x0D;&#x0A;set PATH=$(SolutionDir)\java\ant\bin;%PATH%;&#x0D;&#x0A;cd ..\..&#x0D;&#x0A;call ant clean&#x0D;&#x0A;call ant&#x0D;&#x0A;"
+                               CleanCommandLine="set JAVA_HOME=$(SolutionDir)\java\jdk&#x0D;&#x0A;set PATH=$(SolutionDir)\java\ant\bin;%PATH%;&#x0D;&#x0A;cd ..\..&#x0D;&#x0A;call ant clean&#x0D;&#x0A;&#x0D;&#x0A;"
+                               Output=""
+                               PreprocessorDefinitions="WIN32;_DEBUG"
+                               IncludeSearchPath=""
+                               ForcedIncludes=""
+                               AssemblySearchPath=""
+                               ForcedUsingAssemblies=""
+                               CompileAsManaged=""
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Debug|x64"
+                       OutputDirectory="$(SolutionDir)modules\core\jar"
+                       IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
+                       ConfigurationType="0"
+                       >
+                       <Tool
+                               Name="VCNMakeTool"
+                               BuildCommandLine="set JAVA_HOME=$(SolutionDir)\java\jdk&#x0D;&#x0A;set PATH=$(SolutionDir)\java\ant\bin;%PATH%;&#x0D;&#x0A;cd ..\..&#x0D;&#x0A;call ant&#x0D;&#x0A;&#x0D;&#x0A;"
+                               ReBuildCommandLine="set JAVA_HOME=$(SolutionDir)\java\jdk&#x0D;&#x0A;set PATH=$(SolutionDir)\java\ant\bin;%PATH%;&#x0D;&#x0A;cd ..\..&#x0D;&#x0A;call ant clean&#x0D;&#x0A;call ant&#x0D;&#x0A;"
+                               CleanCommandLine="set JAVA_HOME=$(SolutionDir)\java\jdk&#x0D;&#x0A;set PATH=$(SolutionDir)\java\ant\bin;%PATH%;&#x0D;&#x0A;cd ..\..&#x0D;&#x0A;call ant clean&#x0D;&#x0A;&#x0D;&#x0A;"
+                               Output=""
+                               PreprocessorDefinitions="WIN32;_DEBUG"
+                               IncludeSearchPath=""
+                               ForcedIncludes=""
+                               AssemblySearchPath=""
+                               ForcedUsingAssemblies=""
+                               CompileAsManaged=""
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Release|Win32"
+                       OutputDirectory="$(SolutionDir)modules\core\jar"
+                       IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
+                       ConfigurationType="0"
+                       >
+                       <Tool
+                               Name="VCNMakeTool"
+                               BuildCommandLine="set JAVA_HOME=$(SolutionDir)\java\jdk&#x0D;&#x0A;set PATH=$(SolutionDir)\java\ant\bin;%PATH%;&#x0D;&#x0A;cd ..\..&#x0D;&#x0A;call ant&#x0D;&#x0A;&#x0D;&#x0A;"
+                               ReBuildCommandLine="set JAVA_HOME=$(SolutionDir)\java\jdk&#x0D;&#x0A;set PATH=$(SolutionDir)\java\ant\bin;%PATH%;&#x0D;&#x0A;cd ..\..&#x0D;&#x0A;call ant clean&#x0D;&#x0A;call ant&#x0D;&#x0A;"
+                               CleanCommandLine="set JAVA_HOME=$(SolutionDir)\java\jdk&#x0D;&#x0A;set PATH=$(SolutionDir)\java\ant\bin;%PATH%;&#x0D;&#x0A;cd ..\..&#x0D;&#x0A;call ant clean&#x0D;&#x0A;&#x0D;&#x0A;"
+                               Output=""
+                               PreprocessorDefinitions="WIN32;NDEBUG"
+                               IncludeSearchPath=""
+                               ForcedIncludes=""
+                               AssemblySearchPath=""
+                               ForcedUsingAssemblies=""
+                               CompileAsManaged=""
+                       />
+               </Configuration>
+               <Configuration
+                       Name="Release|x64"
+                       OutputDirectory="$(SolutionDir)modules\core\jar"
+                       IntermediateDirectory="$(ProjectDir)$(ConfigurationName)"
+                       ConfigurationType="0"
+                       >
+                       <Tool
+                               Name="VCNMakeTool"
+                               BuildCommandLine="set JAVA_HOME=$(SolutionDir)\java\jdk&#x0D;&#x0A;set PATH=$(SolutionDir)\java\ant\bin;%PATH%;&#x0D;&#x0A;cd ..\..&#x0D;&#x0A;call ant&#x0D;&#x0A;&#x0D;&#x0A;"
+                               ReBuildCommandLine="set JAVA_HOME=$(SolutionDir)\java\jdk&#x0D;&#x0A;set PATH=$(SolutionDir)\java\ant\bin;%PATH%;&#x0D;&#x0A;cd ..\..&#x0D;&#x0A;call ant clean&#x0D;&#x0A;call ant&#x0D;&#x0A;"
+                               CleanCommandLine="set JAVA_HOME=$(SolutionDir)\java\jdk&#x0D;&#x0A;set PATH=$(SolutionDir)\java\ant\bin;%PATH%;&#x0D;&#x0A;cd ..\..&#x0D;&#x0A;call ant clean&#x0D;&#x0A;&#x0D;&#x0A;"
+                               Output=""
+                               PreprocessorDefinitions="WIN32;NDEBUG"
+                               IncludeSearchPath=""
+                               ForcedIncludes=""
+                               AssemblySearchPath=""
+                               ForcedUsingAssemblies=""
+                               CompileAsManaged=""
+                       />
+               </Configuration>
+       </Configurations>
+       <References>
+       </References>
+       <Files>
+               <Filter
+                       Name="Source Files"
+                       Filter="cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx"
+                       UniqueIdentifier="{4FC737F1-C7A5-4376-A066-2A32D752A2FF}"
+                       >
+                       <File
+                               RelativePath=".\org\scilab\modules\core\Scilab.java"
+                               >
+                       </File>
+               </Filter>
+               <File
+                       RelativePath="..\..\..\build.xml"
+                       >
+               </File>
+       </Files>
+       <Globals>
+       </Globals>
+</VisualStudioProject>
index 4ad200b..38e8df2 100644 (file)
@@ -21,7 +21,7 @@ import java.io.FileNotFoundException;
 import java.io.FileOutputStream;
 import java.io.IOException;
 
-import org.scilab.modules.console.GuiManagement;
+import org.scilab.modules.commons.ScilabCommons;
 
 import javax.xml.parsers.DocumentBuilder;
 import javax.xml.parsers.DocumentBuilderFactory;
@@ -70,7 +70,7 @@ public final class ConfigManager {
        
        private static final String SCILAB_CONFIG_FILE = System.getenv("SCI") + "/modules/console/etc/configuration.xml";
        
-       private static final String USER_CONFIG_FILE = GuiManagement.getSCIHOME() + "/configuration.xml";
+       private static final String USER_CONFIG_FILE = ScilabCommons.getSCIHOME() + "/configuration.xml";
        
        private static final int DEFAULT_WIDTH = 650;
        private static final int DEFAULT_HEIGHT = 550;
index b0ac85f..e9349ca 100644 (file)
@@ -30,7 +30,7 @@ BOOL createMainScilabObject(void)
     if (currentENV)
     {
         jclass cls=NULL;
-        cls = (*currentENV)->FindClass(currentENV, "org/scilab/modules/jvm/Scilab");
+        cls = (*currentENV)->FindClass(currentENV, "org/scilab/modules/core/Scilab");
         bOK=catchIfJavaException(_("Could not access to the Main Scilab Class:\n"));
         if (cls)
         {
index 729d454..a2e92d9 100644 (file)
@@ -45,7 +45,7 @@ import javax.xml.transform.stream.StreamResult;
 
 import javax.swing.KeyStroke;
 
-import org.scilab.modules.console.GuiManagement;
+import org.scilab.modules.commons.ScilabCommons;
 import org.scilab.modules.gui.utils.Position;
 import org.scilab.modules.gui.utils.Size;
 
@@ -139,8 +139,8 @@ public final class ConfigSciNotesManager {
     private static final String SCINOTES_CONFIG_FILE = System.getenv(SCI) + "/modules/scinotes/etc/scinotesConfiguration.xml";
     private static final String SCINOTES_CONFIG_KEYS_FILE = System.getenv(SCI) + "/modules/scinotes/etc/keysConfiguration.xml";
 
-    private static final String USER_SCINOTES_CONFIG_FILE = GuiManagement.getSCIHOME() + "/scinotesConfiguration.xml";
-    private static final String USER_SCINOTES_CONFIG_KEYS_FILE = GuiManagement.getSCIHOME() + "/keysConfiguration.xml";
+    private static final String USER_SCINOTES_CONFIG_FILE = ScilabCommons.getSCIHOME() + "/scinotesConfiguration.xml";
+    private static final String USER_SCINOTES_CONFIG_KEYS_FILE = ScilabCommons.getSCIHOME() + "/keysConfiguration.xml";
 
     private static final int PLAIN = 0;
     private static final int BOLD =  1;
index ec74212..102b118 100644 (file)
@@ -72,6 +72,9 @@ library.renderer.name=org.scilab.modules.renderer.jar
 library.graphic_export.dir=${modules.dir}/graphic_export/${build.jar.dir}/
 library.graphic_export.name=org.scilab.modules.graphic_export.jar
 
+library.core.dir=${modules.dir}/core/${build.jar.dir}/
+library.core.name=org.scilab.modules.core.jar
+
 library.javasci.dir=${modules.dir}/javasci/${build.jar.dir}/
 library.javasci.name=javasci.jar
 
index f108958..5e18d5f 100644 (file)
@@ -68,6 +68,9 @@ library.renderer.name=org.scilab.modules.renderer.jar
 library.graphic_export.dir=${modules.dir}/renderer/${build.jar.dir}/
 library.graphic_export.name=org.scilab.modules.graphic_export.jar
 
+library.core.dir=${modules.dir}/core/${build.jar.dir}/
+library.core.name=org.scilab.modules.core.jar
+
 library.javasci.dir=${modules.dir}/javasci/${build.jar.dir}/
 library.javasci.name=javasci.jar