Automatic detection of Eigen in Scilab prerequirements 80/15780/1
Vincent COUVERT [Fri, 9 Jan 2015 13:51:01 +0000 (14:51 +0100)]
Change-Id: Ied1485c2750939b0b90bb0b0695435c00db346af

scilab/configure
scilab/m4/eigen.m4

index 7291b4e..c0eb09d 100755 (executable)
@@ -23326,8 +23326,8 @@ fi
 save_CPPFLAGS="$CPPFLAGS"
 
 if test "x$with_eigen_include" != "xyes"; then
-       CPPFLAGS="-I$with_eigen_include"
-       ac_fn_cxx_check_header_mongrel "$LINENO" "Eigen/Sparse" "ac_cv_header_Eigen_Sparse" "$ac_includes_default"
+    CPPFLAGS="-I$with_eigen_include"
+    ac_fn_cxx_check_header_mongrel "$LINENO" "Eigen/Sparse" "ac_cv_header_Eigen_Sparse" "$ac_includes_default"
 if test "x$ac_cv_header_Eigen_Sparse" = xyes; then :
   EIGEN_CPPFLAGS="$CPPFLAGS"
 else
 
     PATH_TO_EIGEN=$with_eigen_include
 else
-       ac_fn_cxx_check_header_mongrel "$LINENO" "Eigen/Sparse" "ac_cv_header_Eigen_Sparse" "$ac_includes_default"
+    if $WITH_DEVTOOLS; then # Scilab thirparties
+        CPPFLAGS="-I$DEVTOOLS_INCDIR"
+        ac_fn_cxx_check_header_mongrel "$LINENO" "Eigen/Sparse" "ac_cv_header_Eigen_Sparse" "$ac_includes_default"
+if test "x$ac_cv_header_Eigen_Sparse" = xyes; then :
+  EIGEN_CPPFLAGS="$CPPFLAGS"
+else
+  as_fn_error $? "Cannot find headers (Eigen/Sparse) of the library EIGEN in $with_eigen_include. Please install the dev package (Debian : libeigen3-dev)" "$LINENO" 5
+
+fi
+
+
+        PATH_TO_EIGEN=$DEVTOOLS_INCDIR
+    else
+        ac_fn_cxx_check_header_mongrel "$LINENO" "Eigen/Sparse" "ac_cv_header_Eigen_Sparse" "$ac_includes_default"
 if test "x$ac_cv_header_Eigen_Sparse" = xyes; then :
   EIGEN_CPPFLAGS=""
 else
          $as_unset ac_cv_header_Eigen_Sparse
-                CPPFLAGS="-I/usr/include/eigen3/"
-                ac_fn_cxx_check_header_mongrel "$LINENO" "Eigen/Sparse" "ac_cv_header_Eigen_Sparse" "$ac_includes_default"
+                    CPPFLAGS="-I/usr/include/eigen3/"
+                    ac_fn_cxx_check_header_mongrel "$LINENO" "Eigen/Sparse" "ac_cv_header_Eigen_Sparse" "$ac_includes_default"
 if test "x$ac_cv_header_Eigen_Sparse" = xyes; then :
   EIGEN_CPPFLAGS=$CPPFLAGS
 else
@@ -23357,7 +23370,8 @@ fi
 fi
 
 
-    PATH_TO_EIGEN="/usr/include/eigen3/"
+        PATH_TO_EIGEN="/usr/include/eigen3/"
+    fi
 fi
 CPPFLAGS="$save_CPPFLAGS"
 
@@ -23368,7 +23382,7 @@ CHK_EIGEN_MINOR=0
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if Eigen is version $CHK_EIGEN_WORLD.$CHK_EIGEN_MAJOR.$CHK_EIGEN_MINOR or later" >&5
 $as_echo_n "checking if Eigen is version $CHK_EIGEN_WORLD.$CHK_EIGEN_MAJOR.$CHK_EIGEN_MINOR or later... " >&6; }
 cat > conftest.$ac_ext <<EOF
-#line 23371 "configure"
+#line 23385 "configure"
 #include "confdefs.h"
 
 #include "$PATH_TO_EIGEN/Eigen/Sparse"
@@ -27959,7 +27973,7 @@ CPPFLAGS="$CPPFLAGS -I$CHK_TCL_INCLUDE_PATH"
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking if tcl is version $CHK_TCL_MAJOR.$CHK_TCL_MINOR or later" >&5
 $as_echo_n "checking if tcl is version $CHK_TCL_MAJOR.$CHK_TCL_MINOR or later... " >&6; }
 cat > conftest.$ac_ext <<EOF
-#line 27962 "configure"
+#line 27976 "configure"
 #include "confdefs.h"
 
 #include "$CHK_TCL_INCLUDE_PATH/$CHK_TCL_INC_NAME"
@@ -28270,7 +28284,7 @@ CPPFLAGS="$CPPFLAGS $TCL_INC_PATH -I$CHK_TK_INCLUDE_PATH $X_CFLAGS"
 $as_echo_n "checking if tk is version $CHK_TK_MAJOR.$CHK_TK_MINOR or later... " >&6; }
 
 cat > conftest.$ac_ext <<EOF
-#line 28273 "configure"
+#line 28287 "configure"
 #include "confdefs.h"
 
 #include "$CHK_TK_INCLUDE_PATH/$CHK_TK_INC_NAME"
@@ -28859,7 +28873,7 @@ $as_echo_n "checking saxon9he... " >&6; }
             export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 28862 "configure"
+// #line 28876 "configure"
 import java.util.regex.Pattern;
 
 import net.sf.saxon.Version;
@@ -28974,7 +28988,7 @@ $as_echo_n "checking saxon... " >&6; }
             export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 28977 "configure"
+// #line 28991 "configure"
 import java.util.regex.Pattern;
 
 import net.sf.saxon.Version;
@@ -29090,7 +29104,7 @@ $as_echo_n "checking saxon... " >&6; }
             export ac_java_classpath="$jar_resolved:$ac_java_classpath"
 
     cat << \EOF > conftest.java
-// #line 29093 "configure"
+// #line 29107 "configure"
 import java.util.regex.Pattern;
 
 import com.icl.saxon.Loader;
index 3e66f6d..44dd2cb 100644 (file)
@@ -1,11 +1,11 @@
 dnl
 dnl Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
 dnl Copyright (C) INRIA - 2008 - Sylvestre Ledru
-dnl 
+dnl
 dnl This file must be used under the terms of the CeCILL.
 dnl This source file is licensed as described in the file COPYING, which
 dnl you should have received as part of this distribution.  The terms
-dnl are also available at    
+dnl are also available at
 dnl http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
 dnl
 dnl AC_EIGEN
@@ -16,32 +16,41 @@ AC_DEFUN([AC_EIGEN], [
 AC_LANG_PUSH([C++])
 
 AC_ARG_WITH(eigen_include,
-               AC_HELP_STRING([--with-eigen-include=DIR],[Set the path to the EIGEN headers]),
-               [with_eigen_include=$withval],
-               [with_eigen_include='yes']
-               )
+        AC_HELP_STRING([--with-eigen-include=DIR],[Set the path to the EIGEN headers]),
+        [with_eigen_include=$withval],
+        [with_eigen_include='yes']
+        )
 
 
 save_CPPFLAGS="$CPPFLAGS"
 
 if test "x$with_eigen_include" != "xyes"; then
-       CPPFLAGS="-I$with_eigen_include"
-       AC_CHECK_HEADER([Eigen/Sparse],
-               [EIGEN_CPPFLAGS="$CPPFLAGS"],
-               [AC_MSG_ERROR([Cannot find headers (Eigen/Sparse) of the library EIGEN in $with_eigen_include. Please install the dev package (Debian : libeigen3-dev)])]
-       )
+    CPPFLAGS="-I$with_eigen_include"
+    AC_CHECK_HEADER([Eigen/Sparse],
+        [EIGEN_CPPFLAGS="$CPPFLAGS"],
+        [AC_MSG_ERROR([Cannot find headers (Eigen/Sparse) of the library EIGEN in $with_eigen_include. Please install the dev package (Debian : libeigen3-dev)])]
+    )
     PATH_TO_EIGEN=$with_eigen_include
 else
-       AC_CHECK_HEADER([Eigen/Sparse],
-               [EIGEN_CPPFLAGS=""],
-               [       $as_unset ac_cv_header_Eigen_Sparse 
-                CPPFLAGS="-I/usr/include/eigen3/"
-                AC_CHECK_HEADER([Eigen/Sparse],
-                                [EIGEN_CPPFLAGS=$CPPFLAGS],
-                                AC_MSG_ERROR([Cannot find headers (Eigen/Sparse) of the library eigen. Please install the dev package (Debian : libeigen3-dev)])
-                )
-         ])
-    PATH_TO_EIGEN="/usr/include/eigen3/"
+    if $WITH_DEVTOOLS; then # Scilab thirparties
+        CPPFLAGS="-I$DEVTOOLS_INCDIR"
+        AC_CHECK_HEADER([Eigen/Sparse],
+            [EIGEN_CPPFLAGS="$CPPFLAGS"],
+            [AC_MSG_ERROR([Cannot find headers (Eigen/Sparse) of the library EIGEN in $with_eigen_include. Please install the dev package (Debian : libeigen3-dev)])]
+        )
+        PATH_TO_EIGEN=$DEVTOOLS_INCDIR
+    else
+        AC_CHECK_HEADER([Eigen/Sparse],
+            [EIGEN_CPPFLAGS=""],
+            [       $as_unset ac_cv_header_Eigen_Sparse
+                    CPPFLAGS="-I/usr/include/eigen3/"
+                    AC_CHECK_HEADER([Eigen/Sparse],
+                                    [EIGEN_CPPFLAGS=$CPPFLAGS],
+                                    AC_MSG_ERROR([Cannot find headers (Eigen/Sparse) of the library eigen. Please install the dev package (Debian : libeigen3-dev)])
+                    )
+             ])
+        PATH_TO_EIGEN="/usr/include/eigen3/"
+    fi
 fi
 CPPFLAGS="$save_CPPFLAGS"