a6f310c2c6508b9a657415dffe2437639e96da0f
[scilab.git] / scilab / configure.ac
1 #
2 # Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 # Copyright (C) INRIA - 2006-2008 - Sylvestre Ledru
4 # Copyright (C) DIGITEO - 2009-2011 - Sylvestre Ledru
5 # Copyright (C) DIGITEO - 2009 - Pierre MARECHAL <pierre.marechal@scilab.org>
6 # Copyright (C) Scilab Enterprises - 2014 - Clement DAVID <clement.david@scilab-enterprises.com>
7 # Copyright (C) ESI Group - 2018 - Clement DAVID <clement.david@scilab-enterprises.com>
8 #
9 # Copyright (C) 2012 - 2016 - Scilab Enterprises
10 #
11 # This file is hereby licensed under the terms of the GNU GPL v2.0,
12 # pursuant to article 5.3.4 of the CeCILL v.2.1.
13 # This file was originally licensed under the terms of the CeCILL v2.1,
14 # and continues to be available under such terms.
15 # For more information, see the COPYING file which you should have received
16 # along with this program.
17 #
18
19 dnl Process this file with autoconf to produce a configure script.
20
21
22 AC_REVISION($Revision$)dnl
23 AC_INIT([Scilab],[6],[http://bugzilla.scilab.org/])
24 AC_PREREQ(2.69)
25 AC_CONFIG_MACRO_DIR([m4])
26
27 SCI_BUILDDIR="`pwd`"
28 SCI_SRCDIR="$srcdir"
29 SCI_SRCDIR_FULL="`cd $SCI_SRCDIR && pwd`"
30
31 if test -d "$SCI_SRCDIR_FULL/usr"; then
32     WITH_DEVTOOLS=true
33     DEVTOOLS_BINDIR="$SCI_SRCDIR_FULL/usr/bin"
34     DEVTOOLS_INCDIR="$SCI_SRCDIR_FULL/usr/include"
35     DEVTOOLS_LIBDIR="$SCI_SRCDIR_FULL/usr/lib"
36     export LD_LIBRARY_PATH="$DEVTOOLS_LIBDIR:$LD_LIBRARY_PATH"
37 else
38     WITH_DEVTOOLS=false
39     DEVTOOLS_BINDIR=
40     DEVTOOLS_INCDIR=
41     DEVTOOLS_LIBDIR=
42 fi
43
44 SCILAB_VERSION_MAJOR=6
45 SCILAB_VERSION_MINOR=2
46 SCILAB_VERSION_MAINTENANCE=0
47 AC_SUBST(SCILAB_VERSION_MAJOR)
48 AC_SUBST(SCILAB_VERSION_MINOR)
49 AC_SUBST(SCILAB_VERSION_MAINTENANCE)
50
51
52 SCILAB_LIBRARY_VERSION=$SCILAB_VERSION_MAJOR:$SCILAB_VERSION_MINOR:$SCILAB_VERSION_MAINTENANCE
53 AC_SUBST(SCILAB_LIBRARY_VERSION)
54
55 SCILAB_BINARY_VERSION=$SCILAB_VERSION_MAJOR.$SCILAB_VERSION_MINOR.$SCILAB_VERSION_MAINTENANCE
56 AC_SUBST(SCILAB_BINARY_VERSION)
57
58 #shared library versioning
59 #GENERIC_LIBRARY_VERSION=1:2:0
60 #                       | | |
61 #                +------+ | +---+
62 #                |        |     |
63 #             current:revision:age
64 #                |        |     |
65 #                |        |     +- increment if interfaces have been added
66 #                |        |        set to zero if interfaces have been removed
67 #                                  or changed
68 #                |        +- increment if source code has changed
69 #                |           set to zero if current is incremented
70 #                +- increment if interfaces have been added, removed or changed
71
72 # Check if we have a space in the path to the source tree
73 SPACE_IN_PATH=`echo "$SCI_SRCDIR_FULL"|grep " " > /dev/null; echo $?`
74 if test "$SPACE_IN_PATH" = "0"; then
75    AC_MSG_WARN([=====================================])
76    AC_MSG_WARN([Configure thinks that there is a space in the path to the source. This may cause problem with libtool and some other things...])
77    AC_MSG_WARN([=====================================])
78    sleep 180
79 fi
80
81 AC_CONFIG_AUX_DIR(config)
82 AC_CONFIG_HEADERS([modules/core/includes/machine.h])
83
84 AC_PROG_LN_S
85 AM_PROG_AR
86
87 AC_CUSTOM_LARGE_FILE
88
89 # In order to be able to change the scilab directory
90 # See http://wiki.debian.org/RpathIssue
91 AC_RELOCATABLE
92 AC_RELOCATABLE_LIBRARY
93 AC_LIB_RPATH
94
95 # If configure detect that timestamp changed,
96 # it tries to rebuild configure & makefile which can be a painmaker
97 # if the version is different
98 AM_MAINTAINER_MODE
99
100 AM_INIT_AUTOMAKE([-Wall foreign serial-tests subdir-objects]) # Not using -Werror because we override {C,F}FLAGS in order to disable optimisation
101
102 AC_CANONICAL_HOST
103
104 #################################
105 ## all the --with-* argument help
106 #################################
107
108
109 AC_ARG_ENABLE(debug,
110    AS_HELP_STRING([--enable-debug],[Do not optimize and print warning messages (C/C++/Fortran/Java code)]))
111
112 AC_ARG_ENABLE(debug-C,
113    AS_HELP_STRING([--enable-debug-C],[Do not optimize and print warning messages (C code)]))
114
115 AC_ARG_ENABLE(debug-CXX,
116    AS_HELP_STRING([--enable-debug-CXX],[Do not optimize and print warning messages (C++ code)]))
117
118 AC_ARG_ENABLE(debug-java,
119    AS_HELP_STRING([--enable-debug-java],[Print warning messages and line numbers (Java code)]))
120
121 AC_ARG_ENABLE(debug-fortran,
122    AS_HELP_STRING([--enable-debug-fortran],[Do not optimize and print warning messages (Fortran code)]))
123
124 AC_ARG_ENABLE(debug-linker,
125    AS_HELP_STRING([--enable-debug-linker],[Print warning messages from the linker (ld)]))
126
127 AC_ARG_ENABLE(code-coverage,
128    AS_HELP_STRING([--enable-code-coverage],[Enable code coverage]))
129
130 AC_ARG_ENABLE(stop-on-warning,
131    AS_HELP_STRING([--enable-stop-on-warning],[Stop the compilation on the first warning found in the C/C++ code]))
132
133 AC_ARG_WITH(gcc,
134     AS_HELP_STRING([--with-gcc],[Use gcc C compiler ]))
135
136 AC_ARG_WITH(gfortran,
137     AS_HELP_STRING([--with-gfortran],[Use gfortran, GNU Fortran 95 compiler]))
138
139 AC_ARG_WITH(intelcompilers,
140     AS_HELP_STRING([--with-intelcompilers],[Use Intel C (icc) and Fortran (ifort) proprietary compilers (GNU/Linux only) ]))
141
142 AC_ARG_WITH(tk,
143     AS_HELP_STRING([--without-tk],[Disable the interface to Tcl/Tk ]))
144
145 AC_ARG_WITH(javasci,
146     AS_HELP_STRING([--without-javasci],[Disable the Java/Scilab interface (javasci)]))
147
148 AC_ARG_ENABLE(compilation-tests,
149     AS_HELP_STRING([--enable-compilation-tests],[Enable unitary tests and checks at compilation time]))
150
151 AC_ARG_WITH(gui,
152     AS_HELP_STRING([--without-gui],[Disable the Scilab Graphical User Interface (GUI). Intended for embedded/clustering/grid Scilab ]))
153
154 AC_ARG_ENABLE(build-swig,
155     AS_HELP_STRING([--enable-build-swig=path],[Regenerate Java => C and Scilab => C wrappers produced by Swig]))
156
157
158 AC_ARG_ENABLE(build-giws,
159     AS_HELP_STRING([--enable-build-giws],[Regenerate C/C++ => Java wrappers produced by Giws]))
160
161 AC_ARG_ENABLE(build-parser,
162     AS_HELP_STRING([--enable-build-parser],[Regenerate code for the parser (Lex & YACC)]))
163
164
165 ################################################
166 ########## compilator & misc programs detection
167 ################################################
168
169 AC_PROG_CPP
170 AC_PROG_GREP
171
172 ######
173 #### Mac OS X set of fink path with provided
174 ######
175
176 AC_ARG_WITH(fink_prefix,
177 AS_HELP_STRING([--with-fink-prefix],[Provide a fink prefix. Default: /sw/ ]))
178 # Need MacosX Version to specify some path.
179 case "$host_os" in
180      *Darwin* | *darwin*)
181                AC_GET_MACOSX_VERSION
182      ;;
183 esac
184
185 case "$host" in
186     *darwin*)
187         if test -n "$with_fink_prefix"; then
188             # If with-fink-prefix is provided, use the provided path to make sure that we will
189             # use it to detect dependencies (for example, gfortran is not provided in xcode.
190             # Therefor, we use the one in fink)
191             FINK_PREFIX="$with_fink_prefix/"
192
193             # Exec the init script of fink to make sure that the env is set
194             if test -f $with_fink_prefix/bin/init.sh; then
195                 echo "source $with_fink_prefix/bin/init.sh executed to set the env"
196                 source $with_fink_prefix/bin/init.sh
197             else
198                 AC_MSG_WARN([Could not find the fink init.sh script: $with_fink_prefix/bin/init.sh])
199             fi
200         else
201             FINK_PREFIX="/sw/"
202         fi
203
204         #Append to the default flags on Apple machines
205         CPPFLAGS="$CPPFLAGS -I$FINK_PREFIX/include/"
206         LDFLAGS="$LDFLAGS -L$FINK_PREFIX/lib/"
207         ;;
208 esac
209
210 AC_ARG_WITH(min_macosx_version,
211 AS_HELP_STRING([--with-min-macosx-version],[Force compilers to generate binaries compatible with MacOSX minimal version.]))
212 case "$host" in
213     *darwin*)
214     if test -n "$with_min_macosx_version"; then
215        MIN_MACOSX_VERSION=$with_min_macosx_version
216        #Append to the default flags on Apple machines
217        ARCH_CFLAGS="-mmacosx-version-min=$MIN_MACOSX_VERSION"
218        ARCH_CXXFLAGS="-mmacosx-version-min=$MIN_MACOSX_VERSION"
219        ARCH_FFLAGS="-mmacosx-version-min=$MIN_MACOSX_VERSION"
220        ARCH_LDFLAGS="-mmacosx-version-min=$MIN_MACOSX_VERSION"
221        # We need this to be passed to all linker commands
222        LDFLAGS="$LDFLAGS -mmacosx-version-min=$MIN_MACOSX_VERSION"
223     fi
224 ;;
225 esac
226
227
228 #####################################################
229 ## Look for pkg-config
230 #####################################################
231 PKG_PROG_PKG_CONFIG
232
233 #####################################################
234 ## check if options are correct (or not)
235 #####################################################
236
237 if test "$with_intelcompilers" = yes -a "$with_gcc" = yes; then
238     AC_MSG_ERROR([Conflicting options : you specified two compiler series])
239 fi
240
241 ######## fortran ########
242
243 if test "$with_gfortran" = yes; then
244    : ${FFLAGS=""}
245    AC_PROG_F77(gfortran)
246    if test -z "$F77"; then
247      AC_MSG_ERROR([You asked me to use gfortran but i haven't been able to find it])
248     fi
249 fi
250
251 if test "$with_intelcompilers" = yes; then
252    : ${FFLAGS=""}
253    AC_PROG_F77(ifc ifort)
254    if test -z "$F77"; then
255      AC_MSG_ERROR([You asked me to use ifc (intel fortran compiler) but i haven't been able to find it])
256     fi
257 fi
258
259 if test -z "$F77"; then
260 ## No Fortran compiler specified... Prefer gfortran and intel compilers
261    : ${FFLAGS=""}
262    AC_PROG_F77([gfortran ifc ifort])
263    if test -z "$F77"; then
264         # Best effort to find a compiler (might be g77)
265    : ${FFLAGS=""}
266     AC_PROG_F77
267    fi
268 fi
269
270
271 # case statements were introduced in fortran 90 so we can use that
272 # as a test to see if our compiler is fortran 90 compatible.
273 f90compatible=false
274 if test -z "$F77"; then
275   AC_MSG_ERROR([No fortran compiler found. Cannot compile scilab without a fortran compiler])
276 fi
277
278 AC_MSG_CHECKING([if $F77 is a fortran 90 compatible compiler])
279  f90compatible=false
280 AC_LANG_PUSH([Fortran 77])
281 AC_COMPILE_IFELSE([
282       PROGRAM hello
283         do 50 i = 1, 5
284            select case ( i )
285               case (1)
286                  print*, "case is 1, i is ", i
287               case ( 2 : 3 )
288                  print*, "case is 2 to 3, i is ", i
289               case default
290                  print*, "default case, i is ", i
291               end select
292  50           continue
293       END
294     ],
295     [AC_MSG_RESULT([yes])
296      AC_DEFINE([G95_FORTRAN],[],[uses G95 fortran])
297      f90compatible=true
298     ],
299     [AC_MSG_RESULT([no])]
300 )
301 AC_LANG_POP([Fortran 77])
302
303 ############ C ###############
304
305
306 if test "$with_gcc" = yes; then
307    : ${CFLAGS=""}
308    AC_PROG_CC(gcc)
309    if test -z "$CC"; then
310      AC_MSG_ERROR([You asked me to use gcc but i haven't been able to find it])
311     fi
312 fi
313
314 if test "$with_intelcompilers" = yes; then
315    : ${CFLAGS=""}
316    AC_PROG_CC(icc ecc)
317    if test -z "$CC"; then
318      AC_MSG_ERROR([You asked me to use icc (intel C compiler) but I haven't been able to find it])
319     fi
320 fi
321
322 if test -z "$CC"; then
323 # No C compiler specified... We rely on Autoconf to find the best
324    : ${CFLAGS=""}
325    AC_PROG_CC
326 fi
327
328 if test -z "$CC"; then
329   AC_MSG_ERROR([No C Compiler found. Cannot compile Scilab without a C compiler])
330 fi
331
332 AC_CHECK_SIZEOF([int])
333 AC_CHECK_SIZEOF([long])
334
335 ### C++ ###
336 : ${CXXFLAGS=""}
337 AC_PROG_CXX
338 # we can't just do something like
339 # AC_CHECK_PROG(cxx_present, $CXX, "yes", "no")
340 # because if the user has specified the full path of the desired C++ compiler then AC_CHECK_PROG
341 # will fail.  If AC_PROG_CXX fails to find a c++ compiler it will set CXX=g++ so just run AC_CHECK_PROG
342 # in this special case
343 case $CXX in
344     g++)
345         AC_CHECK_PROG([cxx_present], [$CXX], [yes], [no])
346         if test "x$cxx_present" != "xyes"; then
347             AC_MSG_ERROR([No C++ compiler found. Cannot compile scilab without a C++ compiler])
348         fi
349         ;;
350 esac
351
352 # for "subdir-objects"
353
354 AM_PROG_CC_C_O
355 AC_PROG_F77_C_O
356
357
358 if test "$enable_debug" = yes; then
359    enable_debug_fortran=yes
360    enable_debug_C=yes
361    enable_debug_CXX=yes
362    enable_debug_java=yes
363 else
364    enable_debug=no
365 fi
366
367 if test "$enable_debug_fortran" = yes; then
368    FFLAGS="`echo "$FFLAGS"| sed -e 's|-O[0-9+]|-O0|'`"
369 else
370    enable_debug_fortran=no
371 fi
372
373 if test "$enable_debug_C" = yes; then
374    CFLAGS="`echo "$CFLAGS"| sed -e 's|-O[0-9+]|-O0|'`"
375 else
376    enable_debug_C=no
377 fi
378
379 if test "$enable_debug_CXX" = yes; then
380    CXXFLAGS="`echo "$CXXFLAGS"| sed -e 's|-O[0-9+]|-O0|'`"
381 else
382    enable_debug_CXX=no
383 fi
384
385 if test "$enable_debug_java" = yes; then
386    LOGGING_LEVEL="INFO"
387 else
388    LOGGING_LEVEL="SEVERE"
389 fi
390 AC_SUBST(LOGGING_LEVEL)
391
392 if test "x${prefix}" = "xNONE"; then
393   prefix="${ac_default_prefix}"
394 fi
395
396 ###############################
397 ## get the version
398 ###############################
399
400 SCIVERSION=`cat $SCI_SRCDIR/Version.incl | sed -e "s/SCIVERSION=//" `
401
402 #############################################
403 ## Compilers and options according to machine
404 #############################################
405
406 ######################
407 ######## Set compilation options for intel C/Fortran compilers
408 ######################
409
410 if test "$with_intelcompilers" = yes; then
411    SCI_INTEL_COMPILER()
412 fi
413
414 ########### FORTRAN ######################
415
416
417 ######################
418 ######## With gfortran ...
419 ######################
420 if test -n "$F77"; then
421    case "$F77" in
422      gfortran*)
423         ## With GNU Compiler enable the code coverage
424         if test "$enable_code_coverage" = yes; then
425             CODECOVERAGE_FFLAGS="-fprofile-arcs -ftest-coverage"
426         fi
427      ;;
428      g77*)
429         AC_MSG_ERROR([g77 is no longer supported. Please consider switching to gfortran])
430      ;;
431    esac
432
433    if test "$enable_debug_fortran" = yes; then
434     AC_LANG_PUSH([Fortran 77])
435     for flag in -g -Wall -Wsurprising; do
436         case " ${FFLAGS} " in
437             *\ ${flag}\ *)
438                 # flag is already present
439                 ;;
440
441             *)
442                 AC_MSG_CHECKING([if the Fortran compiler accepts ${flag}])
443                 ac_save_FFLAGS="$FFLAGS"
444                 FFLAGS="$FFLAGS ${flag}"
445                 AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
446                     [AC_MSG_RESULT([yes])
447                      DEBUG_FFLAGS="${flag}"
448                     ],
449                     [AC_MSG_RESULT([no])]
450                 )
451                 ;;
452         esac
453     done
454     AC_LANG_POP([Fortran 77])
455    else
456       DEBUG_FFLAGS="-DNDEBUG -g1 -O2"
457    fi
458       case "$host" in
459          x86_64-*-linux*)
460             ARCH_FFLAGS="-m64 -fPIC"
461                     ;;
462         # Dec Alpha OSF 4
463         alpha*-dec-osf4.*)
464           ARCH_FFLAGS="-fpe3"
465         ;;
466         alpha*-dec-osf*)
467             ARCH_FFLAGS="-fpe3 -switch nosqrt_recip"
468         ;;
469         rs6000-*-*)
470             ARCH_FFLAGS="-qcharlen=4096"
471             ;;
472         mips-*-ultrix*)
473             ARCH_FFLAGS="-O0 -fpe1"
474         ;;
475           *-*-hpux9.*)
476             ARCH_FFLAGS="+Obb1200 +E4 -Dhpux"
477         ;;
478           *-*-hpux10.*)
479             if test "$enable_debug_fortran" = yes; then
480                 ARCH_FFLAGS="+E4 +Z +DAportable -Dhpux"
481             else
482                 ARCH_FFLAGS="+O2 +E4 +Z +DAportable -Dhpux"
483             fi
484 #            ARCH_LDFLAGS="-Wl,+vnocompatwarnings,-E /usr/lib/libdld.sl"
485
486             ;;
487           *-*-hpux11.*)
488            if test "$enable_debug_fortran" = yes; then
489               ARCH_FFLAGS=" +Z +DAportable -Dhpux"
490              else
491               ARCH_FFLAGS="+O2 +Z +DAportable -Dhpux"
492            fi
493            ARCH_LDFLAGS="-ldld -lnsl -lU77 -lm"
494
495      ;;
496       esac
497
498 fi
499
500 #########################
501 # setting parameters according to system types
502 #########################
503
504 case "$host" in
505     *-*-hpux9.*|*-*-hpux10.*|*-*-hpux11.*)
506         HPUX=1
507     ;;
508     sparc-*)
509         SPARC=1
510     ;;
511     mips-sgi-irix*)
512       MIPS_SGI_IRIX=1
513     ;;
514      *-*-solaris*)
515      SOLARIS=1
516      ;;
517     *darwin*)
518       MACOSX=1
519     ;;
520 esac
521
522 AM_CONDITIONAL(IS_MACOSX, test -n "$MACOSX")
523 AM_CONDITIONAL(IS_HPUX, test -n "$HPUX")
524 AM_CONDITIONAL(IS_SPARC, test -n "$SPARC")
525 AM_CONDITIONAL(IS_SOLARIS, test -n "$SOLARIS")
526 AM_CONDITIONAL(IS_MIPS_SGI_IRIX, test -n "$MIPS_SGI_IRIX")
527
528
529
530 ############
531 ## C++
532 ############
533
534
535 if test -z "$CXX"; then
536   AC_MSG_ERROR([No C++ compiler found. Cannot compile scilab without a C++ compiler])
537 fi
538
539 case "$CXX" in
540     g++-* | g++ | ccache*g++ | ccache*g++-* )
541         ## With GNU C++ Compiler
542
543         # enable the code coverage
544         if test "$enable_code_coverage" = yes; then
545             CODECOVERAGE_CXXFLAGS="-fprofile-arcs -ftest-coverage"
546         fi
547
548         if test "$enable_debug_CXX" = yes; then
549             DEBUG_CXXFLAGS="-Wall -Wextra -O0 -g3"
550             case "$host" in
551                 *-linux-gnu )
552                     # Only doing that under Linux
553                     DEBUG_CXXFLAGS="$DEBUG_CXXFLAGS -fdiagnostics-show-option -Werror=format-security"
554                 ;;
555             esac
556         else
557             DEBUG_CXXFLAGS="-DNDEBUG -g1 -O2"
558         fi
559         COMPILER_CXXFLAGS="$COMPILER_CXXFLAGS -fno-stack-protector " # bug 3131
560     ;;
561
562 esac
563
564 #### 64 bits detection
565 IS_64_BITS_CPU=false
566 case "$host" in
567          x86_64-*-linux-gnu | x86_64-linux-gnu | ia64-*-linux-gnu | alpha-*-linux-gnu | alpha-*-netbsd* | x86_64-*-netbsd* | sparc64-*-netbsd*)
568                 IS_64_BITS_CPU=true
569     ;;
570 esac
571
572 ##########"
573
574 case "$CC" in
575      gcc-* | gcc | ccache*gcc | ccache*gcc-* )
576    ## With GNU Compiler
577
578    # enable the code coverage
579    if test "$enable_code_coverage" = yes; then
580     CODECOVERAGE_CFLAGS="-fprofile-arcs -ftest-coverage"
581    fi
582
583    if test "$enable_debug_C" = yes; then
584       DEBUG_CFLAGS="-Wall -Wextra -O0 -g3"
585       # used to be -O0
586       case "$host" in
587       *-linux-gnu )
588       # Only doing that under Linux
589         if test "$enable_debug_linker" = yes; then
590             LDFLAGS="$LDFLAGS -Wl,--warn-common,-x"
591         fi
592           DEBUG_CFLAGS="$DEBUG_CFLAGS -fdiagnostics-show-option -Werror=format-security"
593           ;;
594           esac
595    else
596       DEBUG_CFLAGS="-DNDEBUG -g1 -O2"
597    fi
598
599    COMPILER_CFLAGS="$COMPILER_CFLAGS -fno-stack-protector " # bug 3131
600    # Explictly disable the as needed. It was disable by default but Ubuntu
601    # activated it by default since release 11.04. See bug #8961.
602    # Once all cyclic dependencies have been dropped, this line could be removed.
603    # Check if linker supports --as-needed and --no-as-needed options
604    if $LD --help 2>/dev/null | grep no-as-needed > /dev/null; then
605       LDFLAGS="$LDFLAGS -Wl,--no-as-needed"
606    fi
607
608
609    case "$host" in
610      x86_64-*-linux-gnu | x86_64-linux-gnu)
611         ARCH_CFLAGS="-m64"
612     ;;
613      alpha-*-linux-gnu)
614         ARCH_CFLAGS="-mieee-with-inexact"
615         ARCH_LDFLAGS="-mieee-with-inexact"
616     ;;
617      powerpc-*-linux-gnu)
618         ARCH_CFLAGS="-D_GNU_SOURCE"
619     ;;
620      *-*-solaris*)
621         ARCH_CFLAGS="-DSVR4 -DSYSV -Dsolaris"
622     ;;
623    *-*-freebsd*)
624      ARCH_CFLAGS="-Dfreebsd"
625      ARCH_LDFLAGS="-lm"
626      ;;
627
628   alpha-*-netbsd*)
629     ARCH_CFLAGS="-Dnetbsd -mieee"
630     ARCH_FFLAGS="-Dnetbsd -mieee"
631     ;;
632
633   *-*-netbsd*)
634     ARCH_CFLAGS="-Dnetbsd"
635     ;;
636
637   *-*-darwin*)
638     # Flag no more added since :
639     #  - No more supported in recent gcc versions (> 4.6)
640     #  - only needed when compiling with flag -mmacosx-min-version=10.5
641     #ARCH_CFLAGS="$ARCH_CFLAGS -no_compact_linkedit"
642     #ARCH_CXXFLAGS="$ARCH_CXXFLAGS -no_compact_linkedit"
643     #ARCH_LDFLAGS="$ARCH_LDFLAGS -no_compact_linkedit"
644     # We need this to be passed to all linker commands
645     #LDFLAGS="$LDFLAGS -no_compact_linkedit"
646
647     case "$F77" in
648          gfortran-*|gfortran)
649              # Extract from gfortran -v the version it has been built for
650                MAC_DETECTED_ARCH="`$F77 -v 2>&1|grep "Target:"|sed -e "s/Target: \([[a-z0-9A-Z_]]*\).*/\1/g"`"
651          ;;
652          *)
653         AC_MSG_WARN([gfortran not used. Could not detect the architecture. Switch to the default case: x86_64])
654         MAC_DETECTED_ARCH="x86_64"
655          ;;
656     esac
657     CC="$CC -arch $MAC_DETECTED_ARCH"
658     CXX="$CXX -arch $MAC_DETECTED_ARCH"
659     ;;
660 esac
661 ;; # end of the gcc case on the $CC
662    *)
663
664         ## CC compiler (not GCC)
665         if test "$enable_debug_C" != yes; then
666              ARCH_CFLAGS="-DNDEBUG"
667         fi
668
669 case "$host" in
670 # Dec Alpha OSF 4
671   alpha*-dec-osf4.*)
672       ARCH_CFLAGS="-std -ieee_with_inexact"
673       ARCH_LDFLAGS="-ieee_with_inexact"
674       ;;
675   alpha*-dec-osf*)
676       ARCH_CFLAGS="-ieee_with_inexact"
677       ARCH_LDFLAGS="-ieee_with_inexact"
678       ;;
679   rs6000-*-*) # IBM AIX RS 6000 (NO LONGER SUPPORTED)
680     ARCH_CFLAGS="-Daix -DSYSV"
681   ;;
682   mips-sgi-irix*) # SGI
683     ARCH_CFLAGS="-DSYSV -DSVR4"
684   ;;
685   *-*-hpux9.*)
686     ARCH_CFLAGS="-DSYSV -Dhpux"
687   ;;
688   *-*-hpux10.*) # HP 10
689     if test "$enable_debug_C" = yes; then
690       ARCH_CFLAGS="-DSYSV -Dhpux"
691     else
692       ARCH_CFLAGS="-DSYSV -Dhpux +Z +DAportable"
693     fi
694   ;;
695
696   *-*-hpux11.*) # HP 11
697     ARCH_CFLAGS="-DSYSV -Dhpux -Dhppa +Z +DAportable"
698   ;;
699   *-*-solaris*) # SUN SOLARIS
700     ARCH_CFLAGS="-DSVR4 -DSYSV -Dsolaris -I/usr/local/include/"
701     ARCH_LDFLAGS="-L/usr/local/lib/"
702   ;;
703 esac
704 ;; # end of not a gcc compiler
705 esac
706
707
708 # enable the code coverage
709 if test "$enable_code_coverage" = yes; then
710    AC_PATH_PROG(LCOV, lcov)
711    if test -z "$LCOV" ; then
712         AC_MSG_ERROR([Cannot find lcov. Please install it (package lcov under Debian) or remove the option --enable-code-coverage])
713    fi
714    AC_PATH_PROG(GENHTML, genhtml)
715    if test -z "$GENHTML" ; then
716         AC_MSG_ERROR([Cannot find genhtml. Please install it (package lcov under Debian) or remove the option --enable-code-coverage])
717    fi
718    CODECOVERAGE_LDFLAGS="-coverage -lgcov"
719 fi
720 AM_CONDITIONAL(CODE_COVERAGE, test "$enable_code_coverage" = yes)
721 AM_CONDITIONAL(ENABLE_DEBUG, test "$enable_debug" = yes)
722
723 # flag for possible compilations in configure
724 SCILIBS_CFLAGS=''
725 SCILIBS_CXXFLAGS=''
726 SCILIBS_FFLAGS=''
727
728 if test $IS_64_BITS_CPU = true -o "$MACOSX" = "1"; then
729    if test $f90compatible = false; then
730       AC_MSG_ERROR([64 bits support needs a fortran 90 compiler (try --with-gfortran).])
731    fi
732 fi
733
734 AM_CONDITIONAL(IS_64_BITS_CPU, test $IS_64_BITS_CPU = true)
735
736 # check if the compiler supports c++17
737 saved_cppflags="$CXXFLAGS"
738 CXXFLAGS=""
739 AX_CXX_COMPILE_STDCXX(17, noext, mandatory)
740 STDCXX_CXXFLAGS="$CXXFLAGS"
741 CXXFLAGS="$saved_cppflags"
742
743 ################
744 ## SSE
745 ## By default, for x86 CPU, enable the SSE2.
746 ## Note that it is already the case with 64 bits CPU
747 ## (these extensions are enabled by default by gcc)
748 ################
749
750 case "$host" in
751      i*86-linux-gnu|i*86-*-linux-gnu)
752         SSE_CFLAGS="-msse2"
753         SSE_FFLAGS="-msse2"
754         SSE_CXXFLAGS="-msse2"
755      ;;
756 esac
757
758 #######################
759 ## test for underscores (name mangling issues between C and fortran)
760 #######################
761 AC_CHECK_UNDERSCORE_FORTRAN()
762
763 ###############################
764 ### Regenerate the parser files
765 ### Flex & Yacc
766 ###############################
767
768 if test "$enable_build_parser" = yes; then
769
770    AC_PROG_LEX
771    if test -z "$LEX" -o "$LEX" = ":"; then
772           AC_MSG_ERROR([No implementation of Lex (flex, lex) detected. Please install it (package flex)])
773    fi
774
775    AC_PROG_YACC
776    if test -z "$YACC"; then
777           AC_MSG_ERROR([No implementation of Yacc (bison, yacc) detected. Please install it (package bison)])
778   fi
779 # Actually, AC_PROG_YACC is lying. It sometimes put yacc into $YACC even it
780 # hasn't been able to find it.
781 #  AC_CHECK_PROG(YACC_PRESENT, $YACC, AC_MSG_ERROR([No implementation of Yacc (bison, yacc) detected. Please install it (package bison)]) )
782
783    AC_CHECK_PROG(yacc_present, $YACC, "yes","no")
784    if test "x$yacc_present" != "xyes"; then
785       AC_MSG_ERROR([No implementation of Yacc (bison, yacc) detected. Please install it (package bison)])
786    fi
787
788 fi
789 AM_CONDITIONAL(BUILD_PARSER, test "$enable_build_parser" = yes)
790
791 #################
792 ## HDF5
793 #################
794
795 AC_HDF5()
796 # The Java detection is done after in this file.
797
798
799 #################
800 ## scirenderer
801 #################
802
803 AC_ARG_WITH(external-scirenderer,
804     AS_HELP_STRING([--with-external-scirenderer],[Disable the usage of the internal copy of scirenderer. Intended for packaging of Scilab]))
805
806 AM_CONDITIONAL(EXTERNAL_SCIRENDERER, test "$with_external_scirenderer" = yes)
807
808
809 #################
810 ## XCOS
811 #################
812
813 AC_ARG_WITH(xcos,
814     AS_HELP_STRING([--without-xcos], [Disable Xcos]))
815
816 AC_ARG_WITH(modelica,
817     AS_HELP_STRING([--without-modelica],[Disable the OCaml module (modelica)]))
818
819
820 if test "$with_gui" = no; then
821    AC_MSG_WARN([GUI is disabled. Disabling then Xcos GUI])
822 fi
823
824 XCOS_ENABLE=no
825
826 if test "$with_xcos" != no; then
827    AC_DEFINE([WITH_XCOS], [], [with XCos])
828
829    save_LIBS="$LIBS"
830
831    AC_CHECK_LIB([rt], [clock_gettime],
832               [RT_LIB="-lrt";
833               AC_DEFINE([HAVE_CLOCK_GETTIME], [1],[Whether clock_gettime is available]) ],
834         [AC_MSG_WARN([librt: library missing (Cannot find symbol clock_gettime). Check if librt is installed (it is usually provided by the libc) and if the version is correct])]
835    )
836    LIBS="$save_LIBS"
837    AC_SUBST(RT_LIB)
838
839
840 #################
841 ## ocaml which only called when using Xcos
842 #################
843
844    if test "$with_modelica" != no; then
845       AC_CHECK_PROG_OCAML()
846    fi
847    XCOS_ENABLE=yes
848
849 fi
850
851 AC_SUBST(XCOS_ENABLE)
852
853 AM_CONDITIONAL(OCAML, test "$with_modelica" != no -a "$OCAMLC" != no -a "$OCAMLOPT" != no)
854 AM_CONDITIONAL(XCOS, test "$XCOS_ENABLE" != no)
855
856 ###########################
857 ## test for JAVA compiler
858 ###########################
859 if test "$with_javasci" != no -o "$with_gui" != no -o "$enable_build_help" != no; then
860
861      # See if --with-jdk command line argument is given
862      # Try to detect the installed JVM, this could be controlled
863      # by the above --with options
864      AC_JAVA_WITH_JDK
865      if test "$with_jdk" != no; then
866
867      AC_JAVA_DETECT_JVM
868      case "$ac_java_jvm_version" in
869         1.9)
870         ;;
871         1.8)
872         ;;
873         *)
874             AC_MSG_ERROR([Wrong version of Java. Expected at least 1.8. Found $ac_java_jvm_version])
875         ;;
876      esac
877
878    if test "$ac_java_jvm_name" = "jdk"; then
879         JAVA_HOME=$ac_java_jvm_dir
880         JAVA_VERSION=$ac_java_jvm_version
881 #     AC_JAVA_TOOLS
882
883         AC_JAVA_JNI_INCLUDE
884         JAVA_JNI_INCLUDE=$ac_java_jvm_jni_include_flags
885
886         case "$host_os" in
887              *Darwin* | *darwin*)
888                # Mac OS X does not link against the lib but uses -framework
889                JAVA_JNI_LIBS="-framework JavaVM"
890              ;;
891              *)
892                AC_JAVA_JNI_LIBS
893                JAVA_JNI_LIBS=$ac_java_jvm_jni_lib_flags
894                JAVA_JNI_LIBS_PRELOAD=$ac_java_jvm_ld_preload
895              ;;
896         esac
897
898         AC_JAVA_CLASSPATH
899         JAVA_CLASSPATH=$ac_java_classpath
900         AC_JAVA_TOOLS
901         AC_JAVA_ANT
902
903         case "$host_os" in
904              *Darwin* | *darwin*)
905                   JAVA_HOME=""
906              ;;
907         esac
908
909
910         if test "$with_gui" != no; then
911
912                 if test "$with_xcos" != no; then
913                    # jgraphx
914                    AC_JAVA_CHECK_JAR([jgraphx],[com.mxgraph.view.mxGraph],[Diagram design],[],[VERSION],[2.0.0.1])
915                    JGRAPHX=$PACKAGE_JAR_FILE
916                    AC_SUBST(JGRAPHX)
917                 fi
918
919                 if test "$with_external_scirenderer" = yes; then
920                    # scirenderer
921                    AC_JAVA_CHECK_JAR([scirenderer],[org.scilab.forge.scirenderer.PackageInfo],[Scilab Renderer],[],[VERSION],[1.1.0])
922                    SCIRENDERER=$PACKAGE_JAR_FILE
923                    SCIRENDERER_CP=$PACKAGE_JAR_FILE
924                  else
925                    echo "Use external version of scirenderer"
926                    # Use the scirenderer in Scilab sources
927                    SCIRENDERER="\${modules.dir}/scirenderer/\${build.jar.dir}/scirenderer.jar"
928                    SCIRENDERER_CP="\$SCILAB/modules/scirenderer/jar/scirenderer.jar"
929                 fi
930                 AC_SUBST(SCIRENDERER)
931                 AC_SUBST(SCIRENDERER_CP)
932
933                # Docking system
934                 AC_JAVA_CHECK_JAR([flexdock],[org.flexdock.util.Utilities],[Scilab Gui],[],[VERSION],[1.2.4])
935                 FLEXDOCK=$PACKAGE_JAR_FILE
936                 AC_SUBST(FLEXDOCK)
937
938                 # Swing look&feel implementations
939                 AC_JAVA_CHECK_JAR([looks],[com.jgoodies.looks.common.MenuItemRenderer],[Scilab Gui - Look and feel],"yes")
940                 LOOKS=$PACKAGE_JAR_FILE
941
942                 # Named differently under ArchLinux or Fedora
943                 if test -z "$LOOKS"; then
944                     AC_JAVA_CHECK_JAR([jgoodies-looks],[com.jgoodies.looks.common.MenuItemRenderer],[Scilab Gui - Look and feel])
945                     LOOKS=$PACKAGE_JAR_FILE
946                 fi
947                 AC_SUBST(LOOKS)
948
949                 #  Skin Look and Feel
950                 AC_JAVA_CHECK_JAR([skinlf],[com.l2fprod.util.AccessUtils],[Scilab Gui - Skin Look and Feel])
951                 SKINLF=$PACKAGE_JAR_FILE
952                 AC_SUBST(SKINLF)
953
954                 # JOGL 2
955                 AC_JAVA_CHECK_JAR([jogl2],[javax.media.opengl.glu.GLUnurbs],[Scilab 3D rendering - Version 2.0], [], [], [2.2])
956                 JOGL2=$PACKAGE_JAR_FILE
957                 AC_SUBST(JOGL2)
958
959                 if test "$MACOSX" = 1; then
960                    echo "Check of the presence of libjogl.jnilib and libjogl_awt.jnilib disabled under Mac OS X"
961                 else
962                    LDFLAGS_save=$LDFLAGS
963                    # Provide known paths where distribs/OS can store JNI libs
964                    LDFLAGS="$LDFLAGS -L/usr/lib/jni -L/usr/lib64/jni"                   # Debian
965                    LDFLAGS="$LDFLAGS -L/usr/lib/java -L/usr/lib64/java"                 # jpackage.org
966                    LDFLAGS="$LDFLAGS -L/usr/lib/jogl2 -L/usr/lib64/jogl2"               # RedHat
967                    LDFLAGS="$LDFLAGS -L$SCI_SRCDIR/thirdparty -L$SCI_SRCDIR/lib/thirdparty -L$SCI_SRCDIR/bin"        # Scilab thirdparties
968                    AC_CHECK_LIB([jogl_desktop], [glTexParameterf], [JOGL2_LIBS="-ljogl_desktop"],[AC_MSG_WARN([Could not link against -ljogl_desktop. Will try against -ljogl_desktop -lGL])])
969                    if test -z "$JOGL2_LIBS"; then # The previous test failed add more options to the LDFLAGS
970                        # the space after "jogl" in the following line is on
971                        # purpose to disable the cache
972                           AC_CHECK_LIB([jogl_desktop ], [glTexParameterf],
973                        [JOGL2_LIBS="-ljogl_desktop -lGL"],
974                        [AC_MSG_ERROR(["libjogl: Library
975 missing (Cannot find symbol glTexParameterf). Check if libjogl - C/Java (JNI)
976 interface for JOGL2 - or libGL (OpenGL library) are installed and if the version is correct. Note that you might have to update etc/librarypath.xml to provide the actual path to the JNI libraries."])],
977                        [-lGL])
978                    fi
979
980                    LDFLAGS=$LDFLAGS_save
981                 fi
982
983                 # JoGL Native <=> Java connector
984                 AC_JAVA_CHECK_JAR([gluegen2-rt],[jogamp.common.os.MachineDescriptionRuntime],[Scilab 3D rendering])
985                 GLUEGEN2_RT=$PACKAGE_JAR_FILE
986                 AC_SUBST(GLUEGEN2_RT)
987
988                 if test "$MACOSX" = 1; then
989                    echo "Check of the presence of libgluegen-rt.jnilib disabled under Mac OS X"
990                 else
991                    LDFLAGS_save=$LDFLAGS
992                    # Provide known paths where distribs/OS can store JNI libs
993                    LDFLAGS="$LDFLAGS -L/usr/lib/jni -L/usr/lib64/jni"                   # Debian
994                    LDFLAGS="$LDFLAGS -L/usr/lib/java -L/usr/lib64/java"                 # jpackage.org
995                    LDFLAGS="$LDFLAGS -L/usr/lib/gluegen2 -L/usr/lib64/gluegen2"         # RedHat
996                    LDFLAGS="$LDFLAGS -L$SCI_SRCDIR/thirdparty -L$SCI_SRCDIR/lib/thirdparty -L$SCI_SRCDIR/bin"        # Scilab thirdparties
997                    symbol="Java_jogamp_common_jvm_JVMUtil_initialize"
998                    AC_CHECK_LIB([gluegen2-rt], [$symbol], [GLUEGEN2_RT_LIBS="-lgluegen2-rt"],
999                    [AC_MSG_ERROR([libgluegen2-rt: Library missing (Cannot find symbol $symbol). Check if libgluegen-rt - C/Java (JNI) interface for GLUEGEN2 - is installed and if the version is correct. Note that you might have to update etc/librarypath.xml to provide the actual path to the JNI libraries.])],
1000                    [-ldl])
1001                    LDFLAGS=$LDFLAGS_save
1002                 fi
1003
1004                 # Jhall
1005                 AC_JAVA_CHECK_JAR([jhall],[javax.help.JHelp],[Scilab Help Browser],"yes")
1006                 # Named differently under Mandriva or Fedora
1007                 if test -z "$PACKAGE_JAR_FILE"; then
1008                     AC_JAVA_CHECK_JAR([javahelp2],[javax.help.JHelp],[Scilab Help Browser])
1009                 fi
1010                 JHALL=$PACKAGE_JAR_FILE
1011                 AC_SUBST(JHALL)
1012
1013                 # Lucene Apache - core
1014                 AC_JAVA_CHECK_JAR([lucene-core],[org.apache.lucene.LucenePackage],[Lucene])
1015                 LUCENE=$PACKAGE_JAR_FILE
1016                 AC_SUBST(LUCENE)
1017
1018                 # Lucene Apache - analyzers-common
1019                 AC_JAVA_CHECK_JAR([lucene-analyzers-common],[org.apache.lucene.analysis.standard.StandardAnalyzer],[Lucene StandardAnalyzer])
1020                 LUCENE_ANALYZER=$PACKAGE_JAR_FILE
1021                 AC_SUBST(LUCENE_ANALYZER)
1022
1023                 # Lucene Apache - lucene-queryparser
1024                 AC_JAVA_CHECK_JAR([lucene-queryparser],[org.apache.lucene.queryparser.classic.QueryParser],[Lucene QueryParser])
1025                 LUCENE_PARSER=$PACKAGE_JAR_FILE
1026                 AC_SUBST(LUCENE_PARSER)
1027
1028                 # Console API
1029                 AC_JAVA_CHECK_JAR([jrosetta-API],[com.artenum.rosetta.interfaces.core.ConsoleConfiguration],[JRosetta : Console API Artenum / Scilab],"yes")
1030                 if test -z "$PACKAGE_JAR_FILE"; then
1031                     AC_JAVA_CHECK_JAR([jrosetta-api],[com.artenum.rosetta.interfaces.core.ConsoleConfiguration],[JRosetta : Console API Artenum / Scilab])
1032                 fi
1033                 JROSETTA_API=$PACKAGE_JAR_FILE
1034                 AC_SUBST(JROSETTA_API)
1035
1036                 # Console Core
1037                 AC_JAVA_CHECK_JAR([jrosetta-engine],[com.artenum.rosetta.util.ConfigurationBuilder],[JRosetta : Console Core Artenum / Scilab],[],[getVersion],[1.0.4])
1038                 JROSETTA_ENGINE=$PACKAGE_JAR_FILE
1039                 AC_SUBST(JROSETTA_ENGINE)
1040
1041
1042                 # MathML rendering solution
1043                 # Used in both graphic & help
1044                 AC_JAVA_CHECK_JAR([jeuclid-core],[net.sourceforge.jeuclid.LayoutContext],[MathML rendering solution (at least version 3.1.X)])
1045                 JEUCLID_CORE=$PACKAGE_JAR_FILE
1046                 AC_SUBST(JEUCLID_CORE)
1047
1048
1049                 ################ Mandatory for graphic_export features #####
1050                 # XML to PDF/other Translator
1051                 AC_JAVA_CHECK_JAR([fop],[org.apache.fop.pdf.PDFInfo],[XML to PDF Translator (fop)])
1052                 FOP=$PACKAGE_JAR_FILE
1053                 AC_SUBST(FOP)
1054
1055                 AC_ARG_WITH(emf, [AS_HELP_STRING([--without-emf],
1056                     [disable support for EMF (Windows Metafile) export])])
1057                 if test "x$with_emf" != xno; then
1058                     # Freehep Graphics2D
1059                     AC_JAVA_CHECK_JAR([freehep-graphics2d],[org.freehep.graphics2d.VectorGraphics],[Freehep Graphics2D])
1060                     FREEHEP_GRAPHICS2D=$PACKAGE_JAR_FILE
1061                     AC_SUBST(FREEHEP_GRAPHICS2D)
1062
1063                     # Freehep GraphicsIO
1064                     AC_JAVA_CHECK_JAR([freehep-graphicsio],[org.freehep.graphicsio.VectorGraphicsIO],[Freehep GraphicsIO])
1065                     FREEHEP_GRAPHICSIO=$PACKAGE_JAR_FILE
1066                     AC_SUBST(FREEHEP_GRAPHICSIO)
1067
1068                     # Freehep GraphicsIO EMF
1069                     AC_JAVA_CHECK_JAR([freehep-graphicsio-emf],[org.freehep.graphicsio.emf.EMFGraphics2D],[Freehep GraphicsIO EMF])
1070                     FREEHEP_GRAPHICSIO_EMF=$PACKAGE_JAR_FILE
1071                     AC_SUBST(FREEHEP_GRAPHICSIO_EMF)
1072
1073                     # Freehep IO
1074                     AC_JAVA_CHECK_JAR([freehep-io],[org.freehep.util.io.XMLSequence],[Freehep IO])
1075                     FREEHEP_IO=$PACKAGE_JAR_FILE
1076                     AC_SUBST(FREEHEP_IO)
1077
1078                     # Freehep Util
1079                     AC_JAVA_CHECK_JAR([freehep-util],[org.freehep.util.StringUtilities],[Freehep Util])
1080                     FREEHEP_UTIL=$PACKAGE_JAR_FILE
1081                     AC_SUBST(FREEHEP_UTIL)
1082                 fi
1083
1084                 # xml.apache.org SVG Library (under mandriva for example)
1085                 AC_JAVA_CHECK_JAR([batik-all],[org.apache.batik.Version],
1086                                   [Apache SVG Library],"yes",[getVersion],[1.8])
1087                 BATIK=$PACKAGE_JAR_FILE
1088
1089                 if test -z "$BATIK"; then
1090                    # Other other distribs
1091                    AC_JAVA_CHECK_JAR([batik],[org.apache.batik.Version],
1092                                      [Apache SVG Library],[],[getVersion],[1.8])
1093                    BATIK=$PACKAGE_JAR_FILE
1094                 fi
1095                 AC_SUBST(BATIK)
1096
1097                 # Commons I/O library
1098                 AC_JAVA_CHECK_JAR([commons-io],[org.apache.commons.io.output.CountingOutputStream],[Commons I/O library])
1099                 COMMONS_IO=$PACKAGE_JAR_FILE
1100                 AC_SUBST(COMMONS_IO)
1101
1102                 # XML graphics common
1103                 AC_JAVA_CHECK_JAR([xmlgraphics-commons],[org.apache.xmlgraphics.util.Service],[Commons graphics library])
1104                 XMLGRAPHICS_COMMONS=$PACKAGE_JAR_FILE
1105                 AC_SUBST(XMLGRAPHICS_COMMONS)
1106
1107                 # Avalon Framework (PDF)
1108                 AC_JAVA_CHECK_JAR([avalon-framework],[org.apache.avalon.framework.configuration.ConfigurationException],[Common framework for Java server application])
1109                 AVALON_FRAMEWORK=$PACKAGE_JAR_FILE
1110                 AC_SUBST(AVALON_FRAMEWORK)
1111
1112                 # XML API EXT (conversion of a SVG => PNG)
1113                 AC_JAVA_CHECK_JAR([xml-apis-ext],[org.w3c.dom.svg.SVGDocument],[XML Commons external code],"yes")
1114                 XML_APIS_EXT=$PACKAGE_JAR_FILE
1115
1116                 if test -z "$XML_APIS_EXT"; then
1117                     # Other other distribs (Ex: Fedora/Redhat)
1118                     AC_JAVA_CHECK_JAR([xml-commons-apis-ext],[org.w3c.dom.svg.SVGDocument],[XML Commons external code])
1119                     XML_APIS_EXT=$PACKAGE_JAR_FILE
1120                 fi
1121                 AC_SUBST(XML_APIS_EXT)
1122
1123                 ################ END Mandatory for graphic_export features #####
1124
1125
1126                 # Logging (flexdock dep)
1127                 AC_JAVA_CHECK_JAR([commons-logging],[org.apache.commons.logging.LogFactory],[Apache logging])
1128                 COMMONS_LOGGING=$PACKAGE_JAR_FILE
1129                 AC_SUBST(COMMONS_LOGGING)
1130
1131                 # JLaTeXMath
1132                 AC_JAVA_CHECK_JAR([jlatexmath],[org.scilab.forge.jlatexmath.TeXFormula],[LaTex Rendering],[],[VERSION],[1.0.3])
1133                 JLATEXMATH=$PACKAGE_JAR_FILE
1134                 AC_SUBST(JLATEXMATH)
1135
1136                 # JLaTeXMath FOP
1137                 AC_JAVA_CHECK_JAR([jlatexmath-fop],[org.scilab.forge.jlatexmath.fop.JLaTeXMathObj],[LaTex Rendering - FOP plugin])
1138                 JLATEXMATH_FOP=$PACKAGE_JAR_FILE
1139                 AC_SUBST(JLATEXMATH_FOP)
1140
1141                 AC_DEFINE([WITH_GUI],[],[With the JAVA stuff (GUI, Console, JOGL...)])
1142
1143         fi
1144
1145         # Checkstyle (code checking)
1146         AC_JAVA_CHECK_JAR([checkstyle],[com.puppycrawl.tools.checkstyle.CheckStyleTask],[Checkstyle - code checking],"yes")
1147         CHECKSTYLE=$PACKAGE_JAR_FILE
1148         AC_SUBST(CHECKSTYLE)
1149
1150         # Commons beanutils (dependency of checkstyle)
1151         AC_JAVA_CHECK_JAR([commons-beanutils],[org.apache.commons.beanutils.Converter],[Bean utility],"yes")
1152         COMMONS_BEANUTILS=$PACKAGE_JAR_FILE
1153         AC_SUBST(COMMONS_BEANUTILS)
1154
1155         # antlr (dependency of checkstyle)
1156         AC_JAVA_CHECK_JAR([antlr],[antlr.TokenStreamException],[language tool for constructing recognizers],"yes")
1157         ANTLR=$PACKAGE_JAR_FILE
1158         AC_SUBST(ANTLR)
1159
1160         # Junit 4 (java unitary test)
1161         AC_JAVA_CHECK_JAR([junit4],[org.junit.Assert],[Junit4 - Unit tests],"yes")
1162         if test -z "$PACKAGE_JAR_FILE"; then
1163                 AC_JAVA_CHECK_JAR([junit],[org.junit.Assert],[Junit4 -
1164 Unit tests],"yes")
1165         fi
1166         JUNIT4=$PACKAGE_JAR_FILE
1167         AC_SUBST(JUNIT4)
1168
1169         # hamcrest (junit4 dependency)
1170         AC_JAVA_CHECK_JAR([hamcrest-all],[org.hamcrest.core.IsNull],[Hamcrest- library matchers],"yes")
1171         if test -z "$PACKAGE_JAR_FILE"; then
1172             AC_JAVA_CHECK_JAR([hamcrest/all],[org.hamcrest.core.IsNull],[Hamcrest- library matchers],"yes")
1173         fi
1174         HAMCREST=$PACKAGE_JAR_FILE
1175         AC_SUBST(HAMCREST)
1176
1177         # Cobertura (java code coverage)
1178         AC_JAVA_CHECK_JAR([cobertura],[net.sourceforge.cobertura.merge.Main],[cobertura - Java code coverage],"yes")
1179         COBERTURA=$PACKAGE_JAR_FILE
1180         AC_SUBST(COBERTURA)
1181
1182         # ASM (a dependency of Cobertura)
1183         AC_JAVA_CHECK_JAR([asm3],[org.objectweb.asm.Type],[Java bytecode manipulation (dep of cobertura)],"yes")
1184         if test -z "$ASM3"; then
1185                 AC_JAVA_CHECK_JAR([asm],[org.objectweb.asm.Type],[Java bytecode manipulation (dep of cobertura)],"yes")
1186         fi
1187         ASM3=$PACKAGE_JAR_FILE
1188         AC_SUBST(ASM3)
1189
1190         AC_JAVA_CHECK_JAR([ecj],[org.eclipse.jdt.core.compiler.batch.BatchCompiler],[Eclipse Java compiler],"yes")
1191         ECJ=$PACKAGE_JAR_FILE
1192         if test -z "$ECJ"; then
1193            ECJ='$SCILAB/thirdparty/ecj.jar'
1194         fi
1195         AC_SUBST(ECJ)
1196
1197     else
1198         AC_MSG_WARN([Sun javac not found: I will not build the java interface])
1199         if test "$ac_java_jvm_name" != ""; then
1200             AC_MSG_WARN([We do not support $ac_java_jvm_name yet])
1201         fi
1202     fi
1203     AC_SUBST(JAVA_JNI_INCLUDE)
1204     AC_SUBST(JAVA_JNI_LIBS)
1205     AC_SUBST(JAVA_HOME)
1206
1207
1208     if test "$enable_debug_java" = yes; then
1209         JAVAC_DEBUG="on"
1210     else
1211         JAVAC_DEBUG="off"
1212     fi
1213     AC_SUBST(JAVAC_DEBUG)
1214
1215     if test "$enable_build_swig" != no -a "$enable_build_swig" != ""; then
1216         SWIG_PROG()
1217         SWIG_ENABLE_JAVA()
1218         SWIG_ENABLE_SCILAB()
1219         AC_SUBST(SWIG_BIN)
1220         AC_SUBST(SWIG_JAVA)
1221         AC_SUBST(SWIG_SCILAB)
1222
1223     fi
1224
1225     # Giws is the equivalent of Swig developed by the Scilab team
1226     # in order to provide a wrapper to Java from C/C++
1227     if test "$enable_build_giws" != no -a "$enable_build_giws" != ""; then
1228         AC_GIWS([1.3.0])
1229     fi
1230
1231     fi # "$with_jdk" != no;
1232 fi
1233
1234 JAVA_ENABLE=yes
1235 if test -z "$JAVAC"; then
1236     JAVA_ENABLE=no
1237 fi
1238
1239 AC_SUBST(JAVA_ENABLE)
1240
1241 # Xcos is not checked here because gui=no disables it
1242 AM_CONDITIONAL(NEED_JAVA, [test "$with_jdk" != no -a \( "$with_javasci" != no -o "$with_gui" != no -o "$enable_build_help" != no \)])
1243 AM_CONDITIONAL(GUI, [test "$with_jdk" != no -a "$with_gui" != no])
1244 AM_CONDITIONAL(JAVASCI, [test "$with_jdk" != no -a "$with_javasci" != no])
1245 AM_CONDITIONAL(SWIG, [test "$with_jdk" != no -a "$enable_build_swig" != no -a "$enable_build_swig" != ""])
1246 AM_CONDITIONAL(GIWS, [test "$with_jdk" != no -a "$enable_build_giws" != no -a "$enable_build_giws" != ""])
1247
1248 ##############################################################
1249 ## GUI module
1250 ##############################################################
1251
1252 GUI_ENABLE=no
1253
1254 if test "$JAVA_ENABLE" != no; then
1255    GUI_ENABLE=yes
1256 fi
1257
1258 if test "$with_gui" != no; then
1259    GUI_ENABLE=yes
1260 fi
1261
1262 AC_SUBST(GUI_ENABLE)
1263
1264 ##############################################################
1265 ## test for functions in standard C library and C math library
1266 ##############################################################
1267
1268 # Provided by unistd.h
1269 AC_CHECK_FUNCS([dup2] [getcwd] [getpagesize] [getpass])
1270 AC_CHECK_FUNCS([rmdir])
1271
1272 # Provided by <regex.h>
1273 AC_CHECK_FUNCS([regcomp])
1274
1275 # Provided by stdlib.h
1276 AC_CHECK_FUNCS([atexit] [putenv] [setenv])
1277
1278 # Provided by String.h
1279 AC_CHECK_FUNCS([bzero] [memmove] [memset] [strcasecmp] [strerror] [strchr] [strdup] [strpbrk] [strrchr] [strstr] [strtol])
1280
1281 # Provided by select.h
1282 AC_CHECK_FUNCS([select])
1283
1284 # Provided by pwd.h
1285 AC_CHECK_FUNCS([endpwent])
1286
1287 # Provided by netdb.h
1288 AC_CHECK_FUNCS([gethostbyaddr] [gethostbyname] [gethostname])
1289
1290 # Provided by time.h
1291 AC_CHECK_FUNCS([gettimeofday] [nanosleep])
1292
1293 # Provided by ctype.h
1294 AC_CHECK_FUNCS([isascii])
1295
1296 # Provided by wctype.h
1297 AC_CHECK_FUNCS([iswprint])
1298
1299 # Provided by types.h
1300 AC_CHECK_FUNCS([mkdir])
1301
1302 # Provided by mman.h
1303 AC_CHECK_FUNCS([munmap])
1304
1305 # Provided by signal.h
1306 AC_CHECK_FUNCS([strsignal])
1307
1308
1309 # Check of the libm (lib math). Macro provided by libtool.
1310 save_LDFLAGS="$LDFLAGS"
1311 LT_LIB_M()
1312
1313 # Provided by math.h
1314
1315 LDFLAGS="$LDFLAGS $LIBM"
1316 AC_CHECK_FUNCS([pow] [sqrt] [finite] [floor] [exp10] [erf] [erfc] [isnan])
1317
1318 ### If isinf exists or not (used to not be the case under Solaris)
1319 ### See bug #4164
1320 AC_DEFINE([HAVE_ISINF],[1],[Have isinf function or macro equivalent])
1321 AC_CHECK_FUNC([isinf],,[
1322         AC_DEFINE([isinf(x)],[(!finite(x) && x==x)],[Provide a macro to do isinf])
1323 ])
1324 LIBS="$LIBS $LIBM"
1325 LDFLAGS="$save_LDFLAGS"
1326
1327 # Provided by regex.h
1328 AC_CHECK_FUNCS([re_comp])
1329
1330 # Provided by socket.h
1331 AC_CHECK_FUNCS([socket])
1332
1333 # Provided by utsname.h
1334 AC_CHECK_FUNCS([uname])
1335
1336 # Provided by wtloop.c
1337 AC_CHECK_FUNCS([setlocale])
1338
1339 # Function memcmp used in modules/fileio/src/c/xls.c
1340 AC_FUNC_MEMCMP
1341
1342 # function stat used in modules/core/src/c/link_std.c
1343 AC_FUNC_STAT
1344
1345 # function strtod used in modules/core/src/c/getval.c
1346 AC_FUNC_STRTOD
1347
1348 ########################
1349 ## test for header files
1350 ########################
1351
1352 AC_CHECK_HEADERS([limits.h values.h])
1353
1354 AC_CHECK_HEADERS([fcntl.h float.h libintl.h locale.h malloc.h netdb.h netinet/in.h nlist.h sgtty.h stddef.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h sys/timeb.h sys/utsname.h syslog.h term.h termcap.h termio.h termios.h wchar.h wctype.h time.h])
1355
1356 # check header dirent
1357 AC_HEADER_DIRENT
1358
1359 # static struct timeval defined or not | used in modules/core/src/c/timer.c
1360 AC_HEADER_TIME
1361
1362 # check if the specific header is available or not | used in modules/core/src/c/link_SYSV.c
1363 AC_HEADER_SYS_WAIT
1364
1365
1366 #######################
1367 ## Test for structures ##
1368 #######################
1369 AC_CHECK_MEMBERS([struct stat.st_blksize])
1370 AC_CHECK_MEMBERS([struct stat.st_rdev])
1371
1372
1373 #######################
1374 ## MISC Test
1375 #######################
1376
1377 # gettext.  See http://www.gnu.org/software/hello/manual/gettext/AM_005fGNU_005fGETTEXT.html
1378 AM_GNU_GETTEXT([external])
1379 AM_GNU_GETTEXT_VERSION([0.16])
1380
1381 # function closedir used in modules/metanet/src/c/files.c
1382 AC_FUNC_CLOSEDIR_VOID
1383
1384 # Signals used in modules/core/src/c/realmain.c
1385 AC_TYPE_SIGNAL
1386
1387 # struct tm used in modules/core/src/c/history.c
1388 AC_STRUCT_TM
1389
1390 # st_blocks in the struct in modules/io/sci_gateway/c/intfilestat.c
1391 AC_STRUCT_ST_BLOCKS
1392
1393
1394 ##################
1395 ## termcap library
1396 ##################
1397
1398 # some systems may have a system curses implementation as well as ncurses
1399 # installed.  We need to be consistent in making sure we get the correct
1400 # library to go with the correct header and also provide a way for the user
1401 # to have some control over which is picked when both are available.
1402 #
1403 # For now, just check for -lcurses and then -lncurses.  The user control
1404 # may need to be revisited
1405
1406 TERMCAP_LIB=no
1407
1408 # Various observations:
1409 #
1410 #  ncurses
1411 #    - installs ncurses.h and possibly curses.h as a link to ncurses.h
1412 #    - installs -lncurses.
1413 #    - need to include term.h for tgetent() but tgetent() is in -lncurses.a
1414 #
1415 # curses as found in NetBSD-4 and NetBSD-5
1416 #    - installs curses.h
1417 #    - need to include termcap.h and link with -ltermcap for tgetent()
1418 #
1419
1420 AC_CHECK_LIB([curses],[main])
1421 if test $ac_cv_lib_curses_main = no ; then
1422     AC_CHECK_LIB([ncurses],[main])
1423 fi
1424
1425 # make sure we have what we need for tgetent
1426 AC_SEARCH_LIBS([tgetent],[termcap])
1427
1428 AC_CHECK_HEADERS([ncurses.h curses.h])
1429
1430 if test "x$ac_cv_lib_curses_main" = "xyes" -o "x$ac_cv_lib_ncurses_main" = "xyes" ; then
1431   AC_DEFINE([HAVE_TERMCAP],[],[Have Term Cap])
1432 else
1433  AC_MSG_ERROR([No termcap library detected. Please install ncurses dev library (or termcap library)])
1434 fi
1435
1436 ##################
1437 ## other libraries
1438 ##################
1439
1440 AC_CHECK_LIB(dl, dlopen)
1441
1442 AC_SEARCH_LIBS([pthread_join],[pthread])
1443
1444 #################
1445 ## FFTW
1446 #################
1447
1448 AC_ARG_WITH(fftw,
1449     AS_HELP_STRING([--without-fftw],[Disable the interface to the FFTW 3 library]))
1450
1451 FFTW_ENABLE=no
1452 if test "$with_fftw" != no; then
1453    AC_FFTW()
1454    FFTW_ENABLE=yes
1455 fi
1456
1457 AC_SUBST(FFTW_ENABLE)
1458 AM_CONDITIONAL(FFTW, test "$with_fftw" != no)
1459
1460
1461 #################
1462 ## EIGEN
1463 #################
1464
1465 AC_EIGEN()
1466
1467
1468 #################
1469 ## MPI
1470 #################
1471
1472 # Disable by default the build of MPI:
1473 # * It is hard to package
1474 # * People are administrating cluster know about rebuilding packages
1475 # * They use their own MPI library
1476 AC_ARG_WITH(mpi,
1477     AS_HELP_STRING([--with-mpi],[compile with MPI library]))
1478
1479 MPI_ENABLE=no
1480 if test "$with_mpi" == yes; then
1481    AC_OPENMPI()
1482    # We will have to detect other implementation of OpenMPI
1483    MPI_ENABLE=yes
1484 fi
1485 AC_SUBST(MPI_ENABLE)
1486
1487 AM_CONDITIONAL(MPI, test "$with_mpi" == yes)
1488
1489 #################
1490 ## OpenMP
1491 #################
1492
1493 AC_ARG_WITH(openmp,
1494     AS_HELP_STRING([--without-openmp],[Disable the usage of OpenMP (parallelization of some algoritms)]))
1495
1496 OPENMP_ENABLE=no
1497 if test "$with_openmp" != no; then
1498 #   AC_OPENMP
1499     OPENMP_CFLAGS="-fopenmp"
1500     OPENMP_CXXFLAGS="-fopenmp"
1501     OPENMP_LIBS="-lgomp"
1502
1503     AC_CHECK_HEADERS([omp.h], [],
1504      [AC_MSG_ERROR([Could not find omp.h])])
1505
1506     OPENMP_ENABLE=yes
1507 fi
1508 AC_SUBST(OPENMP_ENABLE)
1509 AC_SUBST(OPENMP_CFLAGS)
1510 AC_SUBST(OPENMP_CXXFLAGS)
1511 AC_SUBST(OPENMP_LIBS)
1512
1513 AM_CONDITIONAL(OPENMP, test "$with_openmp" != no)
1514
1515
1516 #######################
1517 ## Test for libxml
1518 #######################
1519
1520 AC_LIBXML2()
1521
1522 #######################
1523 ## Test for gettext
1524 #######################
1525
1526 ALL_LINGUAS="en_US fr_FR zh_CN zh_TW ru_RU ca_ES de_DE es_ES pt_BR ja_JP it_IT uk_UA pl_PL cs_CZ"
1527 ALL_LINGUAS_DOC="en_US fr_FR pt_BR ja_JP ru_RU"
1528
1529 AC_ARG_ENABLE(build-localization,
1530         AS_HELP_STRING([--disable-build-localization],[Disable the localization build])
1531         )
1532 BUILD_LOCALIZATION_ENABLE=no
1533
1534 if test "$enable_build_localization" != no; then
1535
1536    AC_SUBST(ALL_LINGUAS)
1537    AC_SUBST(ALL_LINGUAS_DOC)
1538    AC_CHECK_FUNCS([bind_textdomain_codeset])
1539
1540    AC_PATH_PROG(MSGCAT, msgcat, no)
1541 #   AC_PATH_PROG(MSGFMT, msgfmt, no)
1542 #   AC_PATH_PROG(XGETTEXT, xgettext, no)
1543
1544    if test x$MSGFMT = xno; then
1545       AC_MSG_ERROR([The msgfmt command is required to build Scilab.  If it is installed on your system, ensure that it is in your path.  If it is not, install GNU gettext to continue or use the option --disable-build-localization ])
1546       fi
1547     if test x$MSGCAT = xno; then
1548       AC_MSG_ERROR([The msgcat command is required to build Scilab.  If it is installed on your system, ensure that it is in your path.  If it is not, install GNU gettext to continue or use the option --disable-build-localization ])
1549     fi
1550     BUILD_LOCALIZATION_ENABLE=yes
1551 fi
1552 AM_CONDITIONAL(GENERATE_LOCALIZATION_FILES, test "$BUILD_LOCALIZATION_ENABLE" = yes)
1553
1554 #######################
1555 ## Test for blas/Atlas and lapack
1556 #######################
1557 AC_MSG_CHECKING([if BLAS, ATLAS or MKL is available])
1558 echo ""
1559 ACX_BLAS(
1560         [AC_MSG_RESULT([$BLAS_TYPE found])]
1561         ,
1562         AC_MSG_ERROR([Impossible to find a BLAS compatible library (see BLAS or ATLAS).])
1563         )
1564
1565 AC_MSG_CHECKING([if LAPACK is available])
1566 echo ""
1567 ACX_LAPACK(
1568         [AC_MSG_RESULT([$LAPACK_TYPE found])],
1569         AC_MSG_ERROR([Impossible to find the LAPACK library.])
1570         )
1571
1572
1573 AC_ARG_WITH(arpack-ng,
1574     AS_HELP_STRING([--without-arpack-ng],[Disable the interface to ARPACK-NG]))
1575
1576 ARPACK_NG=no
1577 if test "$with_arpack_ng" != no; then
1578    ARPACK_NG=yes
1579    AC_MSG_CHECKING([if ARPACK-NG is available])
1580 echo ""
1581 ACX_ARPACK(
1582         [AC_MSG_RESULT([ARPACK-NG library found])],
1583         AC_MSG_ERROR([Impossible to find the ARPACK library. Please note that arpack was bundled with version prior to 5.4.0 and Scilab requires arpack-ng ( http://forge.scilab.org/index.php/p/arpack-ng/ ).])
1584         )
1585
1586 CHECK_ARPACK_OK(
1587 [AC_MSG_RESULT([Working ARPACK-NG library found (probably ARPACK-NG or a patched version of ARPACK)])],
1588 [AC_MSG_ERROR([ARPACK library found, but seems not to work properly. Please make sure you are using arpack-ng])
1589 ])
1590 else
1591    AC_MSG_CHECKING([Skip ARPACK-NG detection])
1592 fi
1593
1594 AM_CONDITIONAL(ARPACK_NG, test "$ARPACK_NG" != "no")
1595
1596
1597 #################
1598 ## UMFPACK
1599 #################
1600
1601 AC_ARG_WITH(umfpack,
1602     AS_HELP_STRING([--without-umfpack],[Disable the interface to the UMFPACK library]))
1603
1604 UMFPACK_ENABLE=no
1605 if test "$with_umfpack" != no; then
1606    AC_UMFPACK([$BLAS_LIBS])
1607    UMFPACK_ENABLE=yes
1608 fi
1609
1610 AC_SUBST(UMFPACK_ENABLE)
1611 AM_CONDITIONAL(UMFPACK, test "$with_umfpack" != no)
1612
1613 #######################
1614 ## Test for PCRE
1615 #######################
1616
1617 AC_PCRE()
1618
1619 #######################
1620 ## Test for CURL
1621 #######################
1622
1623 AC_CURL()
1624
1625 #################
1626 ## Tcl/Tk library
1627 #################
1628
1629 WITH_TKSCI=no
1630 if test "$with_tk" != no; then
1631    if test "$MACOSX" = "1"; then
1632       AC_MSG_ERROR([Due to technical constraints, Tcl/Tk must be disabled under Mac OS X (--without-tk)])
1633    fi
1634
1635     # check user arguments
1636     USER_TCL_LIB_PATH=""
1637     USER_TCL_INC_PATH=""
1638     AC_ARG_WITH(tcl-library,
1639         AS_HELP_STRING([--with-tcl-library=DIR],[Set the path to the TCL library]),
1640         [  USER_TCL_LIB_PATH=$withval
1641     ])
1642     AC_ARG_WITH(tcl-include,
1643         AS_HELP_STRING([--with-tcl-include=DIR],[Set the path to the TCL headers]),
1644         [  USER_TCL_INC_PATH=$withval
1645     ])
1646
1647     USER_TK_LIB_PATH=$USER_TCL_LIB_PATH
1648     USER_TK_INC_PATH=$USER_TCL_INC_PATH
1649
1650     AC_ARG_WITH(tk-library,
1651         AS_HELP_STRING([--with-tk-library=DIR],[Set the path to the TK library]),
1652         [  USER_TK_LIB_PATH=$withval
1653     ])
1654
1655     AC_ARG_WITH(tk-include,
1656         AS_HELP_STRING([--with-tk-include=DIR],[Set the path to the TK headers]),
1657         [  USER_TK_INC_PATH=$withval
1658     ])
1659
1660 ###########################
1661 ########## X11 checks
1662 ###########################
1663         ## This check is mandatory since tk needs Xlib headers and libs
1664         AC_PATH_XTRA
1665         ##
1666
1667     saved_cflags="$CFLAGS"
1668     saved_ldflags="$LDFLAGS"
1669     saved_cppflags="$CXXFLAGS"
1670
1671     AC_CHECK_LIB([dl], [main], [TCLTK_LIBS=" -ldl"])
1672     AC_CHECK_TCLTK
1673
1674     # set variables
1675     if test "$WITH_TKSCI" = yes; then
1676         AC_DEFINE([WITH_TK], [], [With TK])
1677     else
1678         AC_MSG_ERROR([TCL/TK not found. Use --without-tk or specify the librairies and include paths manually])
1679     fi
1680
1681     AC_SUBST(TCLTK_LIBS)
1682     AC_SUBST(TCL_INC_PATH)
1683     AC_SUBST(TK_INC_PATH)
1684
1685 fi
1686 AC_SUBST(WITH_TKSCI)
1687 AM_CONDITIONAL(TCLTK, test "$WITH_TKSCI" = yes)
1688
1689 #################
1690 ## MATIO LIBRARY (MAT File I/O Library)
1691 #################
1692
1693
1694 AC_ARG_WITH(matio,
1695     AS_HELP_STRING([--without-matio],[Disable the interface to Matio (MAT File I/O library)]))
1696
1697 AC_ARG_WITH(matio_include,
1698         AS_HELP_STRING([--with-matio-include=DIR],[Set the path to the MATIO headers]),
1699         [with_matio_include="-I$withval"], [])
1700
1701 AC_ARG_WITH(matio_library,
1702         AS_HELP_STRING([--with-matio-library=DIR],[Set the path to the MATIO libraries]),
1703         [with_matio_library="-L$withval"], [])
1704
1705 MATIO_ENABLE=no
1706
1707 if test "$with_matio" != no; then
1708    if test -n "$with_matio_include" -o -n "$with_matio_library" ; then
1709       MATIO_CFLAGS="$with_matio_include"
1710       MATIO_LIBS="$with_matio_library -lm -lz -lmatio -lhdf5"
1711    else
1712       if $WITH_DEVTOOLS; then # Scilab thirdparties
1713          MATIO_CFLAGS="-I$DEVTOOLS_INCDIR"
1714          MATIO_LIBS="-L$DEVTOOLS_LIBDIR -lm -lz -lmatio -lhdf5"
1715       else
1716          PKG_CHECK_MODULES(MATIO, [matio >= 1.5.0])
1717       fi
1718    fi
1719
1720    save_CFLAGS="$CFLAGS"
1721    save_LIBS="$LIBS"
1722
1723    CFLAGS="$CFLAGS $MATIO_CFLAGS"
1724    LIBS="$LIBS $MATIO_LIBS"
1725
1726    AC_CHECK_HEADERS([matio.h], [],
1727      [AC_MSG_ERROR([Invalid MATIO_CFLAGS returned by pkg-config. Try to define MATIO_CFLAGS.])])
1728    AC_CHECK_LIB([matio], [Mat_Open], [],
1729      [AC_MSG_ERROR([Invalid MATIO_LIBS returned by pkg-config. Try to define MATIO_LIBS.])])
1730
1731    LIBS="$save_LIBS"
1732    CFLAGS="$save_CFLAGS"
1733
1734    AC_DEFINE([WITH_MATIO], [], [With the MATIO library])
1735    MATIO_ENABLE=yes
1736
1737    AC_SUBST(MATIO_LIBS)
1738    AC_SUBST(MATIO_CFLAGS)
1739 fi
1740
1741
1742 AC_SUBST(MATIO_ENABLE)
1743 AM_CONDITIONAL(MATIO, test "$with_matio" != no)
1744
1745
1746 #############################
1747 ## Documentation management #
1748 #############################
1749
1750 HELP_ENABLE=yes
1751
1752 AC_ARG_ENABLE(build-help,
1753         AS_HELP_STRING([--disable-build-help],[Disable the help build])
1754         )
1755
1756 if test "$enable_build_help" != no; then
1757     AC_DOCBOOK()
1758 else
1759     HELP_ENABLE=no
1760 fi
1761
1762 if test "$JAVA_ENABLE" = no; then
1763     HELP_ENABLE=no
1764 fi
1765
1766 AC_SUBST(HELP_ENABLE)
1767
1768 AM_CONDITIONAL(BUILD_HELP, test $HELP_ENABLE = yes)
1769
1770 ## Install XML help files ###
1771
1772 AC_ARG_WITH(install-help-xml,
1773         AS_HELP_STRING([--with-install-help-xml],[make install will install XML files])
1774         )
1775 HELP_INSTALL_ENABLE=no
1776 if test "$with_install_help_xml" != no -a "$with_install_help_xml" != ""; then
1777    HELP_INSTALL_ENABLE=yes
1778 fi
1779 AM_CONDITIONAL(INSTALL_HELP_XML, test "$HELP_INSTALL_ENABLE" != "")
1780
1781 ## Doxygen help generation
1782 AC_ARG_ENABLE(build-doxygen,
1783     AS_HELP_STRING([--enable-build-doxygen],[Generate doxygen C/C++ documentation]))
1784
1785 DOXYGEN_ENABLE=yes
1786 if test "$enable_build_doxygen" != no -a "$enable_build_doxygen" != ""; then
1787     AC_DOXYGEN()
1788 else
1789     DOXYGEN_ENABLE=no
1790 fi
1791 AM_CONDITIONAL(DOXYGEN, test $DOXYGEN_ENABLE = yes)
1792
1793 ## Valgrind specific code
1794 PKG_CHECK_EXISTS([valgrind], [PKG_CHECK_MODULES([VALGRIND], [valgrind], [AC_DEFINE([VALGRIND_ENABLE], [], [Enable valgrind specific tweaks])])], [])
1795
1796 ##############################################################
1797 ## Javasci module
1798 ##############################################################
1799
1800 JAVASCI_ENABLE=yes
1801
1802 if test "$JAVA_ENABLE" = no -o "$JAVASCI" = no; then
1803    JAVASCI_ENABLE=no
1804 fi
1805
1806 AC_SUBST(JAVASCI_ENABLE)
1807
1808
1809 ##############################################################
1810 ## Enable test at compilation time
1811 ##############################################################
1812
1813 COMPILATION_TESTS=no
1814 if test "$enable_compilation_tests" != no -a "$enable_compilation_tests" != ""; then
1815    COMPILATION_TESTS=yes
1816 fi
1817
1818 if test COMPILATION_TESTS=yes -a "$JUNIT4" == ""; then
1819    AC_MSG_WARN([--enable-compilation-tests deactivated: Could not find Junit4"])
1820    COMPILATION_TESTS=no
1821 fi
1822
1823 AM_CONDITIONAL(COMPILATION_TESTS, test "$COMPILATION_TESTS" != "no")
1824
1825 ##############################################################
1826 ## Enable the global force link
1827 ##############################################################
1828
1829 AC_ARG_ENABLE(force-full-link,
1830     AS_HELP_STRING([--enable-force-full-link],[Forces the explicit link between libscilab and some "on-the-fly" loaded libraries. NOT USE IN PRODUCTION.]))
1831
1832 FORCE_FULL_LINK="no"
1833 if test "$enable_force_full_link" == "yes"; then
1834     FORCE_FULL_LINK="yes"
1835 fi
1836
1837 AM_CONDITIONAL(FORCE_LINK, test "$FORCE_FULL_LINK" == "yes")
1838
1839 ##############################################################
1840 ## demo_tools module
1841 ##############################################################
1842
1843 DEMOTOOLS_ENABLE=yes
1844
1845 if test "$GUI_ENABLE" = no; then
1846    DEMOTOOLS_ENABLE=no
1847 fi
1848
1849 AC_SUBST(DEMOTOOLS_ENABLE)
1850
1851 ##############################################################
1852 ## graphics/renderer/graphic_export module
1853 ##############################################################
1854
1855 GRAPHICS_ENABLE=yes
1856
1857 if test "$GUI_ENABLE" = no; then
1858    GRAPHICS_ENABLE=no
1859 fi
1860
1861 AC_SUBST(GRAPHICS_ENABLE)
1862
1863 #########################
1864 ## libtool
1865 #########################
1866
1867 LT_PREREQ([2.2.7])
1868 LT_INIT([shared dlopen disable-static])
1869
1870 # Avoid to link all the dep from others libraries (*.la included by LIBADD)
1871 link_all_deplibs=no
1872
1873 # Check to see if building shared libraries
1874 libtool_build_shared_libs=no
1875 if test "$enable_shared" = "yes"; then
1876   libtool_build_shared_libs=yes
1877 fi
1878
1879 # Check to see if building static libraries
1880 libtool_build_static_libs=no
1881 if test "$enable_static" = "yes"; then
1882   libtool_build_static_libs=yes
1883 fi
1884
1885 # AM_CONDITIONAL(ENABLE_STATIC, test "$libtool_build_static_libs" = yes)
1886 # Fake to disable the static build
1887 AM_CONDITIONAL(ENABLE_STATIC, test "$libtool_build_static_libs" = xxxx)
1888
1889 AC_C_CONST()
1890 AC_C_INLINE()
1891
1892 AC_BACKTRACE()
1893
1894 ##########
1895 ##### Code quality
1896 ##########
1897 AC_PATH_PROG(SPLINT, splint, no)
1898
1899 ##########
1900 ##### Detect ccache and use it by default if available
1901 ##########
1902
1903 AC_ARG_ENABLE(ccache,
1904         AS_HELP_STRING([--disable-ccache],[Disable the use of ccache])
1905         )
1906 AC_PATH_PROG(CCACHE, ccache)
1907 if test x"$CCACHE" != x -a "$enable_ccache" != no; then
1908   CC="$CCACHE $CC"
1909   CXX="$CCACHE $CXX"
1910 fi
1911
1912 #######################
1913 ###### Creation of the header file (machine.h)
1914 #######################
1915
1916 AC_DEFINE_UNQUOTED([PATH_SEPARATOR], ["$PATH_SEPARATOR"],
1917 [The default path separator character.])
1918
1919 AH_TOP([#ifndef MACHINE_H
1920 #define MACHINE_H
1921 /* This file defines global element configuration of the build host */
1922 ])
1923
1924 AH_BOTTOM([
1925
1926 #ifdef DIR_SEPARATOR
1927        #undef DIR_SEPARATOR
1928 #endif
1929 #define DIR_SEPARATOR "/"
1930
1931 #ifdef DIR_SEPARATORW
1932            #undef DIR_SEPARATORW
1933 #endif
1934 #define DIR_SEPARATORW L"/"
1935
1936 #define bsiz 4096
1937
1938 #endif /* MACHINE_H  */
1939 ])
1940
1941 # Define the standard extension of a dynamic library
1942 AC_DEFINE_UNQUOTED([SHARED_LIB_EXT],["$shrext_cmds"],[Extension of a shared library])
1943 AC_DEFINE_UNQUOTED([SHARED_LIB_EXTW],[L"$shrext_cmds"],[Extension of a shared library ( wide string )])
1944
1945
1946
1947 #################
1948 ## Update the years in the various part of the code.
1949 #################
1950
1951 if test ! -f modules/core/src/cpp/banner.cpp; then
1952    AC_MSG_ERROR([Could not find the Scilab banner file.])
1953 fi
1954
1955 CURRENT_YEAR=`date "+%Y"`
1956 DETECTED_YEAR=`grep "Copyright (c) 2017-" modules/core/src/cpp/banner.cpp|sed -e "s/.*Copyright (c) 2017-\([[0-9]]*\).*/\1/g"`
1957
1958 if test "$CURRENT_YEAR" != "$DETECTED_YEAR"; then
1959    sed -i -e "s| 2017-$DETECTED_YEAR | 2017-$CURRENT_YEAR |g" modules/core/src/cpp/banner.cpp modules/windows_tools/src/c/scilab_windows/console.c
1960    sed -i -e "s| 2017-$DETECTED_YEAR ESI Group| 2017-$CURRENT_YEAR ESI Group|g" etc/Info.plist.in
1961    sed -i -e "s|VALUE \"LegalCopyright\", \"Copyright (C) $DETECTED_YEAR|VALUE \"LegalCopyright\", \"Copyright (C) $CURRENT_YEAR|" $(find . -iname '*.rc')
1962    AC_MSG_WARN([New year ($CURRENT_YEAR) detected. Copyright files updated. Please commit them ASAP.])
1963 fi
1964
1965
1966 #########
1967 ## Check extra CC / CXX compiler flags to ease runtime behaviors
1968 #########
1969 AC_CHECK_STDCPP_STATIC()
1970 AC_CHECK_ADDRESS_SANTIZER()
1971
1972 #################
1973 ## stop on warning
1974 #################
1975
1976 # Stop to compile scilab when a warning is found ...
1977 # This stuff is at the end of the configure.ac because it causes some
1978 # problem with AC_COMPILE (the -Werror is added to the test)
1979 #
1980 if test "$enable_stop_on_warning" = yes; then
1981     WARNING_CFLAGS="-Werror=implicit-function-declaration -Werror=declaration-after-statement "
1982     WARNING_CXXFLAGS="-Werror=implicit-function-declaration "
1983 fi
1984
1985 # SCI_*FLAGS contains all defaults values detected on configure
1986 SCI_CFLAGS=$(echo                                             \
1987              $LARGEFILE_CFLAGS                                \
1988              $CODECOVERAGE_CFLAGS                             \
1989              $DEBUG_CFLAGS                                    \
1990              $ARCH_CFLAGS                                     \
1991              $COMPILER_CFLAGS                                 \
1992              $SCILIBS_CFLAGS                                  \
1993              $SSE_CFLAGS                                      \
1994              $BACKTRACE_CFLAGS                                \
1995              $WARNING_CFLAGS                                  )
1996 SCI_CXXFLAGS=$(echo                                           \
1997                $STDCXX_CXXFLAGS                               \
1998                $LARGEFILE_CXXFLAGS                            \
1999                $CODECOVERAGE_CXXFLAGS                         \
2000                $DEBUG_CXXFLAGS                                \
2001                $ARCH_CXXFLAGS                                 \
2002                $COMPILER_CXXFLAGS                             \
2003                $SCILIBS_CXXFLAGS                              \
2004                $SSE_CXXFLAGS                                  \
2005                $BACKTRACE_CXXFLAGS                            \
2006                $WARNING_CXXFLAGS                              )
2007 SCI_FFLAGS=$(echo                                             \
2008              $LARGEFILE_FFLAGS                                \
2009              $CODECOVERAGE_FFLAGS                             \
2010              $DEBUG_FFLAGS                                    \
2011              $ARCH_FFLAGS                                     \
2012              $COMPILER_FFLAGS                                 \
2013              $SCILIBS_FFLAGS                                  \
2014              $SSE_FFLAGS                                      \
2015              $BACKTRACE_FFLAGS                                \
2016              $WARNING_FFLAGS                                  )
2017 SCI_LDFLAGS=$(echo                                            \
2018               $LARGEFILE_LDFLAGS                              \
2019               $CODECOVERAGE_LDFLAGS                           \
2020               $DEBUG_LDFLAGS                                  \
2021               $ARCH_LDFLAGS                                   \
2022               $COMPILER_LDFLAGS                               \
2023               $SCILIBS_LDFLAGS                                \
2024               $SSE_LDFLAGS                                    \
2025               $BACKTRACE_LDFLAGS                              \
2026               $WARNING_LDFLAGS                                )
2027 AC_SUBST(SCI_CFLAGS)
2028 AC_SUBST(SCI_CXXFLAGS)
2029 AC_SUBST(SCI_FFLAGS)
2030 AC_SUBST(SCI_LDFLAGS)
2031
2032 AC_CONFIG_FILES([
2033 contrib/Makefile
2034 desktop/images/icons/Makefile
2035 desktop/Makefile
2036 modules/threads/Makefile
2037 modules/ast/Makefile
2038 modules/functions_manager/Makefile
2039 modules/helptools/Makefile
2040 modules/data_structures/Makefile
2041 modules/differential_equations/Makefile
2042 modules/optimization/Makefile
2043 modules/elementary_functions/Makefile
2044 modules/special_functions/Makefile
2045 modules/io/Makefile
2046 modules/completion/Makefile
2047 modules/history_manager/Makefile
2048 modules/jvm/Makefile
2049 modules/commons/Makefile
2050 modules/sound/Makefile
2051 modules/statistics/Makefile
2052 modules/mexlib/Makefile
2053 modules/sparse/Makefile
2054 modules/linear_algebra/Makefile
2055 modules/polynomials/Makefile
2056 modules/signal_processing/Makefile
2057 modules/arnoldi/Makefile
2058 modules/interpolation/Makefile
2059 modules/localization/Makefile
2060 modules/cacsd/Makefile
2061 modules/boolean/Makefile
2062 modules/integer/Makefile
2063 modules/fileio/Makefile
2064 modules/spreadsheet/Makefile
2065 modules/string/Makefile
2066 modules/time/Makefile
2067 modules/graphics/Makefile
2068 modules/graphic_export/Makefile
2069 modules/graphic_objects/Makefile
2070 modules/renderer/Makefile
2071 modules/action_binding/Makefile
2072 modules/gui/Makefile
2073 modules/mpi/Makefile
2074 modules/randlib/Makefile
2075 modules/tclsci/Makefile
2076 modules/windows_tools/Makefile
2077 modules/core/Makefile
2078 modules/prebuildjava/Makefile
2079 modules/api_scilab/Makefile
2080 modules/call_scilab/Makefile
2081 modules/types/Makefile
2082 modules/hdf5/Makefile
2083 modules/fftw/Makefile
2084 modules/umfpack/Makefile
2085 modules/scicos/Makefile
2086 modules/scicos_blocks/Makefile
2087 modules/functions/Makefile
2088 modules/dynamic_link/Makefile
2089 modules/overloading/Makefile
2090 modules/javasci/Makefile
2091 modules/m2sci/Makefile
2092 modules/development_tools/Makefile
2093 modules/output_stream/Makefile
2094 modules/console/Makefile
2095 modules/demo_tools/Makefile
2096 modules/parameters/Makefile
2097 modules/matio/Makefile
2098 modules/atoms/Makefile
2099 modules/xcos/Makefile
2100 modules/scinotes/Makefile
2101 modules/ui_data/Makefile
2102 modules/graph/Makefile
2103 modules/parallel/Makefile
2104 modules/modules_manager/Makefile
2105 modules/history_browser/Makefile
2106 modules/preferences/Makefile
2107 modules/xml/Makefile
2108 modules/external_objects/Makefile
2109 modules/external_objects_java/Makefile
2110 modules/slint/Makefile
2111 modules/coverage/Makefile
2112 modules/webtools/Makefile
2113 modules/Makefile
2114 Makefile
2115 scilab.pc
2116 etc/modules.xml
2117 etc/classpath.xml
2118 etc/Info.plist
2119 etc/logging.properties
2120 scilab.properties
2121 scilab-lib.properties
2122 scilab-lib-doc.properties
2123 modules/helptools/etc/SciDocConf.xml
2124 modules/core/includes/version.h
2125 modules/atoms/etc/repositories
2126 modules/atoms/tests/unit_tests/repositories.orig
2127 ])
2128
2129 # This script is used by Xcos in order to regenerate the function/block list
2130 AC_CONFIG_COMMANDS_POST([chmod +x $SCI_SRCDIR_FULL/modules/scicos_blocks/src/scripts/GenBlocks.sh $SCI_SRCDIR_FULL/modules/dynamic_link/src/scripts/scicompile.sh $SCI_SRCDIR_FULL/modules/dynamic_link/src/scripts/compilerDetection.sh $SCI_SRCDIR_FULL/modules/dynamic_link/src/scripts/configure])
2131
2132 AC_OUTPUT
2133
2134 # To distribution packager, you can uncomment this stuff is you want to
2135 # disable the rpath issue
2136 # However, you will have to set all the LD_LIBRARY_PATH to .libs/ directory
2137 # since scilab is compiling macros and help into the source tree (ie before
2138 # the "make install")
2139 # You should consider using chrpath:
2140 # http://directory.fsf.org/project/chrpath/
2141 # to remove it before the make install
2142
2143 #case ${host} in
2144 #  *-pc-linux-gnu)
2145 #    AC_MSG_RESULT([Fixing libtool for -rpath problems.])
2146 #    sed < libtool > libtool-2 \
2147 #    's/^hardcode_libdir_flag_spec.*$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/'
2148 #    mv libtool-2 libtool
2149 #    chmod 755 libtool
2150 #  ;;
2151 #esac
2152 #
2153
2154 echo ""
2155
2156 echo "Scilab is configured as follows. Please verify that this configuration"
2157 echo "matches your expectations."
2158 echo ""
2159 echo "Host system type : $host"
2160 echo ""
2161 echo "                  Option                        Value"
2162 echo "-------------------------------------------------------------------------"
2163 echo "Shared libraries.......      --enable-shared=$libtool_build_shared_libs"
2164 echo "Static libraries.......      --enable-static=$libtool_build_static_libs"
2165 echo "GNU ld.................      --with-gnu-ld=$with_gnu_ld"
2166 echo "Enable debug ..........      --enable-debug=$enable_debug"
2167 echo "Enable debug C.........      --enable-debug-C=$enable_debug_C"
2168 echo "Enable debug C++.......      --enable-debug-CXX=$enable_debug_CXX"
2169 echo "Enable debug Java......      --enable-debug-java=$enable_debug_java"
2170 echo "Enable debug Fortran...      --enable-debug-fortran=$enable_debug_fortran"
2171 echo "Enable stop on warning.      --enable-stop-on-warning=$enable_stop_on_warning"
2172
2173 echo ""
2174 echo "Compiler Configuration:"
2175 echo "  Intel (--with-intelcompilers) .... =        $with_intelcompilers"
2176 echo "  GNU gcc (--with-gcc) ............. =        $with_gcc"
2177 echo "  GNU Fortran 95 (--with-gfortran) . =        $with_gfortran"
2178 echo ""
2179 echo "Options:"
2180 echo "  Do not use TCL/TK (--without-tk) ................. = $with_tk"
2181 echo "  TCL include (--with-tcl-include) ................. = $USER_TCL_INC_PATH"
2182 echo "  TCL library (--with-tcl-library) ................. = $USER_TCL_LIB_PATH"
2183 echo "  TK include (--with-tk-include) ................... = $USER_TK_INC_PATH"
2184 echo "  TK library (--with-tk-library) ................... = $USER_TK_LIB_PATH"
2185 echo "  Install XML Help (--with-install-help-xml) ....... = $with_install_help_xml"
2186 echo "  Compilation tests (--enable-compilation-tests) ... = $COMPILATION_TESTS"
2187 echo "  Make the package relocatable (--enable-relocatable)= $RELOCATABLE"
2188 echo "  Use FFTW (--without-fftw) ........................ = $with_fftw"
2189 echo "  Use MATIO (--without-matio) ...................... = $with_matio"
2190 echo ""
2191 echo "  Compile with Scilab thirdparties ................. = $WITH_DEVTOOLS"
2192
2193 echo ""
2194 if test "$with_gui" = no; then
2195    echo "Not using Xcos because of the option --without-gui"
2196 else
2197 if test $XCOS_ENABLE = yes; then
2198    echo "Xcos enable"
2199    echo "Build modelica compiler (--without-modelica) ....... = $with_modelica"
2200    echo ""
2201    if test "$with_modelica" != no -a "$OCAMLC" != no -a "$OCAMLOPT" != no; then
2202      echo "Ocaml Configuration (for Modelica compiler):"
2203      echo "  OCAMLC ............. = $OCAMLC"
2204      echo "  OCAMLCFLAGS ........ = $OCAMLCFLAGS"
2205      echo "  OCAMLOPT ........... = $OCAMLOPT"
2206      echo "  OCAMLOPTFLAGS ...... = $OCAMLOPTFLAGS"
2207      echo "  OCAMLDEP ........... = $OCAMLDEP"
2208    else
2209      echo "Will not build Modelica compiler"
2210    fi
2211 else
2212    echo "Not using Xcos"
2213 fi
2214 fi
2215
2216 echo ""
2217 if test "$enable_code_coverage" = yes;  then
2218    echo "Code coverage configuration:"
2219    echo "  LCOV .............. = $LCOV"
2220    echo "  GENHTML ........... = $GENHTML"
2221 else
2222    echo "Not using code coverage"
2223 fi
2224
2225 echo ""
2226 if test $OPENMP_ENABLE = yes; then
2227    echo "OpenMP Configuration:"
2228    echo "OpenMP CFLAGS ...... = $OPENMP_CFLAGS"
2229    echo "OpenMP CXXFLAGS .... = $OPENMP_CXXFLAGS"
2230    echo "OpenMP LIBS ........ = $OPENMP_LIBS"
2231    echo "OpenMP LDFLAGS ..... = $OPENMP_LDFLAGS"
2232 else
2233    echo "Not using OpenMP"
2234 fi
2235
2236 echo ""
2237 if test $FFTW_ENABLE = yes;  then
2238    echo "FFTW Configuration:"
2239    echo "  FFTW LIBS .......... = $FFTW3_LIB"
2240    echo "  FFTW CFLAGS ........ = $FFTW3_CFLAGS"
2241 else
2242    echo "Not using FFTW"
2243 fi
2244
2245 echo ""
2246 echo "Eigen3 Configuration:"
2247 echo "  EIGEN CPPFLAGS ...... = $EIGEN_CPPFLAGS"
2248
2249 echo ""
2250 if test $MATIO_ENABLE = yes;  then
2251    echo "MATIO Configuration:"
2252    echo "  MATIO LIBS .......... = $MATIO_LIBS"
2253    echo "  MATIO CFLAGS ........ = $MATIO_CFLAGS"
2254 else
2255    echo "Not using MATIO"
2256 fi
2257
2258 echo ""
2259 if test $UMFPACK_ENABLE = yes;  then
2260    echo "UMFPACK Configuration:"
2261    echo "  UMFPACK LIBS ....... = $UMFPACK_LIB"
2262    echo "  UMFPACK CFLAGS ..... = $UMFPACK_CFLAGS"
2263    if test $SUITESPARSE = yes; then
2264       echo "  UMFPACK SUITESPARSE  = Yes"
2265    else
2266       echo "  UMFPACK SUITESPARSE  = No"
2267    fi
2268 else
2269    echo "Not using UMFPACK"
2270 fi
2271
2272
2273 echo ""
2274 echo "BLAS/LAPACK/ATLAS Configuration:"
2275 echo "  BLAS LIBS ............. = $BLAS_LIBS"
2276 echo "  BLAS TYPE ............. = $BLAS_TYPE"
2277 echo "  LAPACK LIBS ........... = $LAPACK_LIBS"
2278 echo "  LAPACK TYPE ........... = $LAPACK_TYPE"
2279 echo "  ARPACK LIBS ........... = $ARPACK_LIBS"
2280 echo ""
2281
2282
2283 if test "$with_mpi" == yes; then
2284    echo "OpenMPI Configuration:"
2285    echo "OpenMPI LIBS ........... = $OPENMPI_LIBS"
2286    echo "OpenMPI C Compiler ..... = $OPENMPI_CC"
2287    echo "OpenMPI C++ Compiler ... = $OPENMPI_CXX"
2288    echo "OpenMPI F77 Compiler ... = $MPIF77"
2289 else
2290    echo "Not using MPI"
2291 fi
2292
2293 echo ""
2294 if test $BUILD_LOCALIZATION_ENABLE != no; then
2295    echo "Gettext/localization configuration:"
2296    echo "  xgettext ............... = $XGETTEXT"
2297    echo "  msgfmt  ................ = $MSGFMT"
2298    echo "  msgfmt_opts ............ = $MSGFMT_OPTS"
2299    echo "  msgcat  ................ = $MSGCAT"
2300 else
2301    echo "Won't generate localization files"
2302 fi
2303
2304 echo ""
2305 if test $HELP_ENABLE = yes; then
2306    echo "Documentation building configuration:"
2307    echo "  Docbook XSL path ....... = $DOCBOOK_ROOT"
2308    echo "  Saxon XSLT ............. = $SAXON"
2309    echo "  XML commons external ... = $XML_APIS_EXT"
2310 else
2311    echo "No documentation generated"
2312 fi
2313
2314 echo ""
2315 echo "Java Configuration:"
2316 if test ! -z "$JAVAC"; then
2317 echo "  JAVA_HOME ........... = $JAVA_HOME"
2318 echo "  JAVAC ............... = $JAVAC"
2319 echo "  JAVA_CLASSPATH ...... = $JAVA_CLASSPATH"
2320 echo "  JAVA_VERSION ........ = $JAVA_VERSION"
2321 echo "  JAVAC_FLAGS ......... = $JAVAC_FLAGS"
2322 echo "  JAVA_JNI_INCLUDE .... = $JAVA_JNI_INCLUDE"
2323 echo "  JAVA_JNI_LIBS ....... = $JAVA_JNI_LIBS"
2324 echo "  JAVA_JNI_LIBS_PRELOAD = $JAVA_JNI_LIBS_PRELOAD"
2325 echo "  JAVA ................ = $JAVA"
2326 echo "  JAVADOC ............. = $JAVADOC"
2327 echo "  JAR ................. = $JAR"
2328 echo "  ANT ................. = $ANT"
2329 else
2330 echo "  JAVA disabled"
2331 fi
2332
2333
2334 echo ""
2335 echo "Java dependencies:"
2336 if test ! -z "$JAVAC"; then
2337 echo "  Flexdock ............ = $FLEXDOCK"
2338 echo "  JOGL 2............... = $JOGL2"
2339 echo "  JOGL 2 LIBS (JNI) ... = $JOGL2_LIBS"
2340 echo "  Gluegen 2 ........... = $GLUEGEN2_RT"
2341 echo "  Gluegen 2 LIBS (JNI)  = $GLUEGEN2_RT_LIBS"
2342 echo "  Jeuclid (MathML) .... = $JEUCLID_CORE"
2343 echo "  Jhall  .............. = $JHALL"
2344 echo "  Jrosetta (API) ...... = $JROSETTA_API"
2345 echo "  Jrosetta (Engine) ... = $JROSETTA_ENGINE"
2346 echo "  Commons Logging ..... = $COMMONS_LOGGING"
2347 echo "  JGraph X ............ = $JGRAPHX"
2348 echo "  SciRenderer ......... = $SCIRENDERER"
2349 echo "  JLaTeXMath .......... = $JLATEXMATH"
2350 echo "  ECJ ................. = $ECJ"
2351 fi
2352
2353 echo ""
2354 if test ! -z "$JAVAC"; then
2355 echo "Documentation, graphic export:"
2356 echo "  FOP (XML => PDF) .... = $FOP"
2357 echo "  JLaTeXMath Fop ...... = $JLATEXMATH_FOP"
2358 echo "  Batik (SVG) ......... = $BATIK"
2359 echo "  Avalon Framework .... = $AVALON_FRAMEWORK"
2360 echo "  Commons I/O ......... = $COMMONS_IO"
2361 echo "  XML graphics commons  = $XMLGRAPHICS_COMMONS"
2362 fi
2363
2364
2365 echo ""
2366 echo "Code quality (optional):"
2367 echo "  Checkstyle .......... = $CHECKSTYLE"
2368 echo "  Commons-beanutils ... = $COMMONS_BEANUTILS"
2369 echo "  Antlr ............... = $ANTLR"
2370 echo "  Junit4 .............. = $JUNIT4"
2371 echo "  Hamcrest ............ = $HAMCREST"
2372 echo "  Cobertura ........... = $COBERTURA"
2373 echo "  splint .............. = $SPLINT"
2374
2375 echo ""
2376 echo "TCL/TK configuration:"
2377 echo "  TK_INC_PATH ........ = $TK_INC_PATH"
2378 echo "  TCL_INC_PATH ....... = $TCL_INC_PATH"
2379 echo "  TCLTK_LIBS ......... = $TCLTK_LIBS"
2380 echo "  TCL_SERIAL_VERSION . = $TCL_SERIAL_VERSION"
2381 echo "  TK_SERIAL_VERSION .. = $TK_SERIAL_VERSION"
2382
2383 echo ""
2384 echo "XML configuration:"
2385 echo "  XML_FLAGS .......... = $XML_FLAGS"
2386 echo "  XML_LIBS ........... = $XML_LIBS"
2387 echo "  XML_VERSION ........ = $XML_VERSION"
2388
2389 echo ""
2390 echo "HDF5 configuration:"
2391 echo "  HDF5 CFLAGS ......... = $HDF5_CFLAGS"
2392 echo "  HDF5 LIBS ........... = $HDF5_LIBS"
2393
2394 echo ""
2395 echo "PCRE configuration:"
2396 echo "  PCRE_CFLAGS ........ = $PCRE_CFLAGS"
2397 echo "  PCRE_LIBS .......... = $PCRE_LIBS"
2398 echo "  PCRE_VERSION ....... = $PCRE_VERSION"
2399
2400 echo ""
2401 echo "Regenerate Scilab's parser"
2402 if test "$enable_build_parser" != no; then
2403 echo "  YACC ............... = $YACC"
2404 echo "  LEX ................ = $LEX"
2405 echo "  YFLAGS ............. = $YFLAGS"
2406 else
2407 echo "  Regenerate parser disabled (will use embedded sources)"
2408 fi
2409
2410 echo ""
2411 echo "CURL configuration:"
2412 echo "  CURL_CFLAGS ........ = $CURL_CFLAGS"
2413 echo "  CURL_LIBS .......... = $CURL_LIBS"
2414 echo "  CURL_VERSION ....... = $CURL_VERSION"
2415
2416 echo ""
2417 echo "SWIG Configuration:"
2418 if test ! -z "$SWIG_BIN"; then
2419 echo "  SWIG_BIN ........... = $SWIG_BIN"
2420 echo "  SWIG_JAVA .......... = $SWIG_JAVA"
2421 else
2422 echo "  SWIG generation disabled"
2423 fi
2424
2425 echo ""
2426 echo "GIWS Configuration:"
2427 if test ! -z "$GIWS_BIN"; then
2428 echo "  GIWS_BIN ........... = $GIWS_BIN"
2429 else
2430 echo "  GIWS generation disabled"
2431 fi
2432
2433 echo ""
2434 echo "Valgrind configuration:"
2435 echo "  VALGRIND_CFLAGS .... = $VALGRIND_CFLAGS"
2436 echo "  VALGRIND_LIBS ...... = $VALGRIND_LIBS"
2437 echo ""
2438
2439 echo ""
2440 echo "Libtool config:"
2441 echo "  objext .............. = $objext"
2442 echo "  libext (static) ..... = $libext"
2443 echo "  shrext_cmds ......... = $shrext_cmds"
2444 echo "  exeext .............. = $exeext"
2445
2446 echo ""
2447
2448 echo "Compilation paths:"
2449 echo "  srcdir .............. = $SCI_SRCDIR"
2450 echo "  srcdir_full ......... = $SCI_SRCDIR_FULL"
2451 echo "  builddir ............ = $SCI_BUILDDIR"
2452 if test "$SCI_SRCDIR_FULL" != "$SCI_BUILDDIR"; then
2453 echo "  VPATH build ......... = Activated"
2454 fi
2455
2456 echo ""
2457 echo "Platform information:"
2458 echo "  host ........... = $host"
2459 echo "  host_cpu ....... = $host_cpu"
2460 echo "  host_vendor .... = $host_vendor"
2461 echo "  host_os ... .... = $host_os"
2462 echo "  hostname ....... = $ac_hostname"
2463 echo "  CPU 64 bits .... = $IS_64_BITS_CPU"
2464 if test -n "$MAC_DETECTED_ARCH"; then
2465 echo "  Mac OS X arch .. = $MAC_DETECTED_ARCH"
2466 echo "  Mac OS X version = $macosx_version"
2467 fi
2468
2469 echo ""
2470 echo "Options used to compile and link:"
2471 echo "  prefix ......... = $prefix"
2472 echo "  localedir ...... = $localedir"
2473 echo "  VERSION ........ = $PACKAGE_VERSION"
2474 echo "  CC ............. = $CC"
2475 echo "  CFLAGS ......... = $CFLAGS"
2476 echo "  SCI_CFLAGS ..... = $SCI_CFLAGS"
2477 echo "  DEFS ........... = $DEFS"
2478 echo "  LD ............. = $LD"
2479 echo "  LDFLAGS ........ = $LDFLAGS"
2480 echo "  SCI_LDFLAGS .... = $SCI_LDFLAGS"
2481 echo "  LIBS ........... = $LIBS"
2482 echo "  CXX ............ = $CXX"
2483 echo "  CXXFLAGS ....... = $CXXFLAGS"
2484 echo "  SCI_CXXFLAGS ... = $SCI_CXXFLAGS"
2485 echo "  F77 ............ = $F77"
2486 echo "  FFLAGS ......... = $FFLAGS"
2487 echo "  SCI_FFLAGS ..... = $SCI_FFLAGS"
2488 echo "  F77_LDFLAGS .... = $F77_LDFLAGS"
2489 echo "  FLIBS...... .... = $FLIBS"
2490 echo "  TERMCAP_LIB .... = $TERMCAP_LIB"
2491 echo ""