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