Merge remote-tracking branch 'origin/master' into YaSp
[scilab.git] / scilab / Makefile.am
index 8c79abe..be09efa 100644 (file)
@@ -27,7 +27,7 @@ AM_CXXFLAGS = $(SCI_CXXFLAGS)
 AM_FFLAGS   = $(SCI_FFLAGS)
 AM_LDFLAGS  = $(SCI_LDFLAGS)
 
-changelogs = CHANGES CHANGES_5.1.X CHANGES_5.2.X CHANGES_5.3.X CHANGES_5.4.X  CHANGES_5.5.X
+changelogs = CHANGES CHANGES_5.1.X CHANGES_5.2.X CHANGES_5.3.X CHANGES_5.4.X CHANGES_5.5.X CHANGES_6.0.X
 
 bin_PROGRAMS           = scilab-bin scilab-cli-bin
 
@@ -38,29 +38,58 @@ if IS_MACOSX
 bin_SCRIPTS            += bin/checkmacosx.applescript
 endif
 
-scilab_bin_LDFLAGS     = $(AM_LDFLAGS)
-scilab_cli_bin_LDFLAGS  = $(AM_LDFLAGS)
+scilab_bin_LDFLAGS         = $(AM_LDFLAGS) $(OPENMPI_LIBS)
+scilab_cli_bin_LDFLAGS  = $(AM_LDFLAGS) $(OPENMPI_LIBS)
+
+if USE_STATIC_SYSTEM_LIB
+scilab_bin_LDFLAGS += -static-libstdc++ -static-libgcc
+# -static-libgfortran
+scilab_cli_bin_LDFLAGS += -static-libstdc++ -static-libgcc
+#-static-libgfortran
+else
+# Clang (for example) needs an explicit reference to the lib
+scilab_bin_LDFLAGS += -lstdc++
+# -static-libgfortran
+scilab_cli_bin_LDFLAGS += -lstdc++
+#-static-libgfortran
+endif
+
 
 if IS_MACOSX
 scilab_bin_LDFLAGS             += -framework Cocoa
 endif
 
-scilab_bin_CPPFLAGS = -I$(top_srcdir)/modules/io/includes/ \
-                               -I$(top_srcdir)/modules/console/includes/ \
-                               -I$(top_srcdir)/modules/localization/includes/ \
-                               $(AM_CPPFLAGS)
+scilab_bin_CPPFLAGS = \
+    -I$(top_srcdir)/modules/ast/includes/ast/ \
+    -I$(top_srcdir)/modules/ast/includes/exps/ \
+    -I$(top_srcdir)/modules/ast/includes/operations/ \
+    -I$(top_srcdir)/modules/ast/includes/parse/ \
+    -I$(top_srcdir)/modules/ast/includes/symbol/ \
+    -I$(top_srcdir)/modules/ast/includes/system_env/ \
+    -I$(top_srcdir)/modules/ast/includes/types/ \
+    -I$(top_srcdir)/modules/ast/includes/analysis/ \
+    -I$(top_srcdir)/modules/console/includes/ \
+    -I$(top_srcdir)/modules/output_stream/includes/ \
+    -I$(top_srcdir)/modules/functions_manager/includes/ \
+    -I$(top_srcdir)/modules/elementary_functions/includes/ \
+    -I$(top_srcdir)/modules/fileio/includes/ \
+    -I$(top_srcdir)/modules/string/includes/ \
+    -I$(top_srcdir)/modules/history_manager/includes/ \
+    -I$(top_srcdir)/modules/threads/includes/ \
+    -I$(top_srcdir)/modules/api_scilab/includes/ \
+    -I$(top_srcdir)/modules/localization/includes/ \
+    -I$(top_srcdir)/modules/core/src/c/ \
+    -I$(top_srcdir)/modules/dynamic_link/includes/ \
+    $(EIGEN_CPPFLAGS) \
+    $(AM_CPPFLAGS)
+
 # --no-undefined --relax
 
 # Localization dep already exists because of the `exportLocaleToSystem' symbol
 # (causing issues on some platform)
 COMMON_LIBS = $(LTLIBINTL)
 
-scilab_bin_SOURCES     = modules/startup/src/c/mainscic.cpp
-
-# Match scilab -nwni (ie command line without graphics)
-scilab_cli_bin_SOURCES = modules/startup/src/c/mainscic.cpp
-scilab_cli_bin_CPPFLAGS = -DWITHOUT_GUI $(scilab_bin_CPPFLAGS)
-
+scilab_bin_SOURCES = modules/startup/src/cpp/scilab.cpp
 
 # the scilab-bin object file itself uses symbols from at least libscilab-cli.la,
 # libsciconsole-minimal.la and libscijvm-disable.la, so we have to link with these
@@ -82,12 +111,20 @@ scilab_bin_LDADD += \
                        $(top_builddir)/modules/jvm/libscijvm-disable.la
 endif
 
-scilab_cli_bin_LDADD   = \
-                       $(top_builddir)/modules/libscilab-cli.la \
-                       $(top_builddir)/modules/console/libsciconsole-minimal.la \
-                       $(top_builddir)/modules/jvm/libscijvm-disable.la \
-                       $(OPENMPI_LIBS) $(XML_LIBS) \
-                       $(COMMON_LIBS) $(FLIBS)
+# BLAS_LIBS & LAPACK_LIBS are explicitly linked at the end. Unlike Scilab 5 in which the binary
+# is in C, Scilab 6 main is in C++. For some reasons (ie, I don't know why), libtool places blas and
+# lapack at the beginning of the order of the link. This caused some issues with the overload of the
+# xerbla function
+scilab_bin_LDADD += $(top_builddir)/modules/libscilab.la $(BLAS_LIBS) $(LAPACK_LIBS) $(FLIBS)
+
+# Match scilab -nwni (ie command line without graphics)
+
+scilab_cli_bin_SOURCES = modules/startup/src/cpp/scilab.cpp
+
+scilab_cli_bin_CPPFLAGS = -DWITHOUT_GUI $(scilab_bin_CPPFLAGS)
+
+# See the comment about scilab_bin_LDADD (relative to BLAS_LIBS & LAPACK_LIBS)
+scilab_cli_bin_LDADD   = $(COMMON_LIBS) $(top_builddir)/modules/libscilab-cli.la $(BLAS_LIBS) $(LAPACK_LIBS) $(FLIBS)
 
 if MPI
 CXX = $(OPENMPI_CXX)
@@ -104,19 +141,6 @@ if NEED_JAVA
        scilab_bin_LDADD += $(JAVA_JNI_LIBS)
 endif
 
-if USE_STATIC_SYSTEM_LIB
-scilab_bin_LDFLAGS += -static-libstdc++ -static-libgcc
-# -static-libgfortran
-scilab_cli_bin_LDFLAGS += -static-libstdc++ -static-libgcc
-#-static-libgfortran
-else
-# Clang (for example) needs an explicit reference to the lib
-scilab_bin_LDADD += -lstdc++
-# -static-libgfortran
-scilab_cli_bin_LDADD += -lstdc++
-#-static-libgfortran
-endif
-
 if IS_SOLARIS
 # The binary itself needs this dep
        scilab_bin_LDADD += $(BLAS_LIBS)
@@ -161,6 +185,7 @@ $(top_srcdir)/CHANGES_5.2.X \
 $(top_srcdir)/CHANGES_5.3.X \
 $(top_srcdir)/CHANGES_5.4.X \
 $(top_srcdir)/CHANGES_5.5.X \
+$(top_srcdir)/CHANGES_6.0.X \
 $(top_srcdir)/ACKNOWLEDGEMENTS \
 $(top_srcdir)/COPYING \
 $(top_srcdir)/COPYING-BSD \