* Bug 16679 fixed: get_function_path('acosh') yielded an error
[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=1
46 SCILAB_VERSION_MAINTENANCE=1
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 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])])
1273
1274 # Provided by <regex.h>
1275 AC_CHECK_FUNCS([regcomp])
1276
1277 # Provided by stdlib.h
1278 AC_CHECK_FUNCS([atexit] [putenv] [setenv])
1279
1280 # Provided by String.h
1281 AC_CHECK_FUNCS([bzero] [memmove] [memset] [strcasecmp] [strerror] [strchr] [strdup] [strpbrk] [strrchr] [strstr] [strtol])
1282
1283 # Provided by select.h
1284 AC_CHECK_FUNCS([select])
1285
1286 # Provided by pwd.h
1287 AC_CHECK_FUNCS([endpwent])
1288
1289 # Provided by netdb.h
1290 AC_CHECK_FUNCS([gethostbyaddr] [gethostbyname] [gethostname])
1291
1292 # Provided by time.h
1293 AC_CHECK_FUNCS([gettimeofday] [nanosleep])
1294
1295 # Provided by ctype.h
1296 AC_CHECK_FUNCS([isascii])
1297
1298 # Provided by wctype.h
1299 AC_CHECK_FUNCS([iswprint])
1300
1301 # Provided by types.h
1302 AC_CHECK_FUNCS([mkdir])
1303
1304 # Provided by mman.h
1305 AC_CHECK_FUNCS([munmap])
1306
1307 # Provided by signal.h
1308 AC_CHECK_FUNCS([strsignal])
1309
1310
1311 # Check of the libm (lib math). Macro provided by libtool.
1312 save_LDFLAGS="$LDFLAGS"
1313 LT_LIB_M()
1314
1315 # Provided by math.h
1316
1317 LDFLAGS="$LDFLAGS $LIBM"
1318 AC_CHECK_FUNCS([pow] [sqrt] [finite] [floor] [exp10] [erf] [erfc] [isnan])
1319
1320 ### If isinf exists or not (used to not be the case under Solaris)
1321 ### See bug #4164
1322 AC_DEFINE([HAVE_ISINF],[1],[Have isinf function or macro equivalent])
1323 AC_CHECK_FUNC([isinf],,[
1324         AC_DEFINE([isinf(x)],[(!finite(x) && x==x)],[Provide a macro to do isinf])
1325 ])
1326 LIBS="$LIBS $LIBM"
1327 LDFLAGS="$save_LDFLAGS"
1328
1329 # Provided by regex.h
1330 AC_CHECK_FUNCS([re_comp])
1331
1332 # Provided by socket.h
1333 AC_CHECK_FUNCS([socket])
1334
1335 # Provided by utsname.h
1336 AC_CHECK_FUNCS([uname])
1337
1338 # Provided by wtloop.c
1339 AC_CHECK_FUNCS([setlocale])
1340
1341 # Function memcmp used in modules/fileio/src/c/xls.c
1342 AC_FUNC_MEMCMP
1343
1344 # function stat used in modules/core/src/c/link_std.c
1345 AC_FUNC_STAT
1346
1347 # function strtod used in modules/core/src/c/getval.c
1348 AC_FUNC_STRTOD
1349
1350 ########################
1351 ## test for header files
1352 ########################
1353
1354 AC_CHECK_HEADERS([limits.h values.h])
1355
1356 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])
1357
1358 # check header dirent
1359 AC_HEADER_DIRENT
1360
1361 # static struct timeval defined or not | used in modules/core/src/c/timer.c
1362 AC_HEADER_TIME
1363
1364 # check if the specific header is available or not | used in modules/core/src/c/link_SYSV.c
1365 AC_HEADER_SYS_WAIT
1366
1367
1368 #######################
1369 ## Test for structures ##
1370 #######################
1371 AC_CHECK_MEMBERS([struct stat.st_blksize])
1372 AC_CHECK_MEMBERS([struct stat.st_rdev])
1373
1374
1375 #######################
1376 ## MISC Test
1377 #######################
1378
1379 # gettext.  See http://www.gnu.org/software/hello/manual/gettext/AM_005fGNU_005fGETTEXT.html
1380 AM_GNU_GETTEXT([external])
1381 AM_GNU_GETTEXT_VERSION([0.16])
1382
1383 # function closedir used in modules/metanet/src/c/files.c
1384 AC_FUNC_CLOSEDIR_VOID
1385
1386 # Signals used in modules/core/src/c/realmain.c
1387 AC_TYPE_SIGNAL
1388
1389 # struct tm used in modules/core/src/c/history.c
1390 AC_STRUCT_TM
1391
1392 # st_blocks in the struct in modules/io/sci_gateway/c/intfilestat.c
1393 AC_STRUCT_ST_BLOCKS
1394
1395
1396 ##################
1397 ## termcap library
1398 ##################
1399
1400 # some systems may have a system curses implementation as well as ncurses
1401 # installed.  We need to be consistent in making sure we get the correct
1402 # library to go with the correct header and also provide a way for the user
1403 # to have some control over which is picked when both are available.
1404 #
1405 # For now, just check for -lcurses and then -lncurses.  The user control
1406 # may need to be revisited
1407
1408 TERMCAP_LIB=no
1409
1410 # Various observations:
1411 #
1412 #  ncurses
1413 #    - installs ncurses.h and possibly curses.h as a link to ncurses.h
1414 #    - installs -lncurses.
1415 #    - need to include term.h for tgetent() but tgetent() is in -lncurses.a
1416 #
1417 # curses as found in NetBSD-4 and NetBSD-5
1418 #    - installs curses.h
1419 #    - need to include termcap.h and link with -ltermcap for tgetent()
1420 #
1421
1422 AC_CHECK_LIB([curses],[main])
1423 if test $ac_cv_lib_curses_main = no ; then
1424     AC_CHECK_LIB([ncurses],[main])
1425 fi
1426
1427 # make sure we have what we need for tgetent
1428 AC_SEARCH_LIBS([tgetent],[termcap])
1429
1430 AC_CHECK_HEADERS([ncurses.h curses.h])
1431
1432 if test "x$ac_cv_lib_curses_main" = "xyes" -o "x$ac_cv_lib_ncurses_main" = "xyes" ; then
1433   AC_DEFINE([HAVE_TERMCAP],[],[Have Term Cap])
1434 else
1435  AC_MSG_ERROR([No termcap library detected. Please install ncurses dev library (or termcap library)])
1436 fi
1437
1438 ##################
1439 ## other libraries
1440 ##################
1441
1442 AC_CHECK_LIB(dl, dlopen)
1443
1444 AC_SEARCH_LIBS([pthread_join],[pthread])
1445
1446 #################
1447 ## FFTW
1448 #################
1449
1450 AC_ARG_WITH(fftw,
1451     AS_HELP_STRING([--without-fftw],[Disable the interface to the FFTW 3 library]))
1452
1453 FFTW_ENABLE=no
1454 if test "$with_fftw" != no; then
1455    AC_FFTW()
1456    FFTW_ENABLE=yes
1457 fi
1458
1459 AC_SUBST(FFTW_ENABLE)
1460 AM_CONDITIONAL(FFTW, test "$with_fftw" != no)
1461
1462
1463 #################
1464 ## EIGEN
1465 #################
1466
1467 AC_EIGEN()
1468
1469
1470 #################
1471 ## MPI
1472 #################
1473
1474 # Disable by default the build of MPI:
1475 # * It is hard to package
1476 # * People are administrating cluster know about rebuilding packages
1477 # * They use their own MPI library
1478 AC_ARG_WITH(mpi,
1479     AS_HELP_STRING([--with-mpi],[compile with MPI library]))
1480
1481 MPI_ENABLE=no
1482 if test "$with_mpi" == yes; then
1483    AC_OPENMPI()
1484    # We will have to detect other implementation of OpenMPI
1485    MPI_ENABLE=yes
1486 fi
1487 AC_SUBST(MPI_ENABLE)
1488
1489 AM_CONDITIONAL(MPI, test "$with_mpi" == yes)
1490
1491 #################
1492 ## OpenMP
1493 #################
1494
1495 AC_ARG_WITH(openmp,
1496     AS_HELP_STRING([--without-openmp],[Disable the usage of OpenMP (parallelization of some algoritms)]))
1497
1498 OPENMP_ENABLE=no
1499 if test "$with_openmp" != no; then
1500 #   AC_OPENMP
1501     OPENMP_CFLAGS="-fopenmp"
1502     OPENMP_CXXFLAGS="-fopenmp"
1503     OPENMP_LIBS="-lgomp"
1504
1505     AC_CHECK_HEADERS([omp.h], [],
1506      [AC_MSG_ERROR([Could not find omp.h])])
1507
1508     OPENMP_ENABLE=yes
1509 fi
1510 AC_SUBST(OPENMP_ENABLE)
1511 AC_SUBST(OPENMP_CFLAGS)
1512 AC_SUBST(OPENMP_CXXFLAGS)
1513 AC_SUBST(OPENMP_LIBS)
1514
1515 AM_CONDITIONAL(OPENMP, test "$with_openmp" != no)
1516
1517
1518 #######################
1519 ## Test for libxml
1520 #######################
1521
1522 AC_LIBXML2()
1523
1524 #######################
1525 ## Test for gettext
1526 #######################
1527
1528 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"
1529 ALL_LINGUAS_DOC="en_US fr_FR pt_BR ja_JP ru_RU"
1530
1531 AC_ARG_ENABLE(build-localization,
1532         AS_HELP_STRING([--disable-build-localization],[Disable the localization build])
1533         )
1534 BUILD_LOCALIZATION_ENABLE=no
1535
1536 if test "$enable_build_localization" != no; then
1537
1538    AC_SUBST(ALL_LINGUAS)
1539    AC_SUBST(ALL_LINGUAS_DOC)
1540    AC_CHECK_FUNCS([bind_textdomain_codeset])
1541
1542    AC_PATH_PROG(MSGCAT, msgcat, no)
1543 #   AC_PATH_PROG(MSGFMT, msgfmt, no)
1544 #   AC_PATH_PROG(XGETTEXT, xgettext, no)
1545
1546    if test x$MSGFMT = xno; then
1547       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 ])
1548       fi
1549     if test x$MSGCAT = xno; then
1550       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 ])
1551     fi
1552     BUILD_LOCALIZATION_ENABLE=yes
1553 fi
1554 AM_CONDITIONAL(GENERATE_LOCALIZATION_FILES, test "$BUILD_LOCALIZATION_ENABLE" = yes)
1555
1556 #######################
1557 ## Test for blas/Atlas and lapack
1558 #######################
1559 AC_MSG_CHECKING([if BLAS, ATLAS or MKL is available])
1560 echo ""
1561 ACX_BLAS(
1562         [AC_MSG_RESULT([$BLAS_TYPE found])]
1563         ,
1564         AC_MSG_ERROR([Impossible to find a BLAS compatible library (see BLAS or ATLAS).])
1565         )
1566
1567 AC_MSG_CHECKING([if LAPACK is available])
1568 echo ""
1569 ACX_LAPACK(
1570         [AC_MSG_RESULT([$LAPACK_TYPE found])],
1571         AC_MSG_ERROR([Impossible to find the LAPACK library.])
1572         )
1573
1574
1575 AC_ARG_WITH(arpack-ng,
1576     AS_HELP_STRING([--without-arpack-ng],[Disable the interface to ARPACK-NG]))
1577
1578 ARPACK_NG=no
1579 if test "$with_arpack_ng" != no; then
1580    ARPACK_NG=yes
1581    AC_MSG_CHECKING([if ARPACK-NG is available])
1582 echo ""
1583 ACX_ARPACK(
1584         [AC_MSG_RESULT([ARPACK-NG library found])],
1585         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/ ).])
1586         )
1587
1588 CHECK_ARPACK_OK(
1589 [AC_MSG_RESULT([Working ARPACK-NG library found (probably ARPACK-NG or a patched version of ARPACK)])],
1590 [AC_MSG_ERROR([ARPACK library found, but seems not to work properly. Please make sure you are using arpack-ng])
1591 ])
1592 else
1593    AC_MSG_CHECKING([Skip ARPACK-NG detection])
1594 fi
1595
1596 AM_CONDITIONAL(ARPACK_NG, test "$ARPACK_NG" != "no")
1597
1598
1599 #################
1600 ## UMFPACK
1601 #################
1602
1603 AC_ARG_WITH(umfpack,
1604     AS_HELP_STRING([--without-umfpack],[Disable the interface to the UMFPACK library]))
1605
1606 UMFPACK_ENABLE=no
1607 if test "$with_umfpack" != no; then
1608    AC_UMFPACK([$BLAS_LIBS])
1609    UMFPACK_ENABLE=yes
1610 fi
1611
1612 AC_SUBST(UMFPACK_ENABLE)
1613 AM_CONDITIONAL(UMFPACK, test "$with_umfpack" != no)
1614
1615 #######################
1616 ## Test for PCRE
1617 #######################
1618
1619 AC_PCRE()
1620
1621 #######################
1622 ## Test for CURL
1623 #######################
1624
1625 AC_CURL()
1626
1627 #################
1628 ## Tcl/Tk library
1629 #################
1630
1631 WITH_TKSCI=no
1632 if test "$with_tk" != no; then
1633    if test "$MACOSX" = "1"; then
1634       AC_MSG_ERROR([Due to technical constraints, Tcl/Tk must be disabled under Mac OS X (--without-tk)])
1635    fi
1636
1637     # check user arguments
1638     USER_TCL_LIB_PATH=""
1639     USER_TCL_INC_PATH=""
1640     AC_ARG_WITH(tcl-library,
1641         AS_HELP_STRING([--with-tcl-library=DIR],[Set the path to the TCL library]),
1642         [  USER_TCL_LIB_PATH=$withval
1643     ])
1644     AC_ARG_WITH(tcl-include,
1645         AS_HELP_STRING([--with-tcl-include=DIR],[Set the path to the TCL headers]),
1646         [  USER_TCL_INC_PATH=$withval
1647     ])
1648
1649     USER_TK_LIB_PATH=$USER_TCL_LIB_PATH
1650     USER_TK_INC_PATH=$USER_TCL_INC_PATH
1651
1652     AC_ARG_WITH(tk-library,
1653         AS_HELP_STRING([--with-tk-library=DIR],[Set the path to the TK library]),
1654         [  USER_TK_LIB_PATH=$withval
1655     ])
1656
1657     AC_ARG_WITH(tk-include,
1658         AS_HELP_STRING([--with-tk-include=DIR],[Set the path to the TK headers]),
1659         [  USER_TK_INC_PATH=$withval
1660     ])
1661
1662 ###########################
1663 ########## X11 checks
1664 ###########################
1665         ## This check is mandatory since tk needs Xlib headers and libs
1666         AC_PATH_XTRA
1667         ##
1668
1669     saved_cflags="$CFLAGS"
1670     saved_ldflags="$LDFLAGS"
1671     saved_cppflags="$CXXFLAGS"
1672
1673     AC_CHECK_LIB([dl], [main], [TCLTK_LIBS=" -ldl"])
1674     AC_CHECK_TCLTK
1675
1676     # set variables
1677     if test "$WITH_TKSCI" = yes; then
1678         AC_DEFINE([WITH_TK], [], [With TK])
1679     else
1680         AC_MSG_ERROR([TCL/TK not found. Use --without-tk or specify the librairies and include paths manually])
1681     fi
1682
1683     AC_SUBST(TCLTK_LIBS)
1684     AC_SUBST(TCL_INC_PATH)
1685     AC_SUBST(TK_INC_PATH)
1686
1687 fi
1688 AC_SUBST(WITH_TKSCI)
1689 AM_CONDITIONAL(TCLTK, test "$WITH_TKSCI" = yes)
1690
1691 #################
1692 ## MATIO LIBRARY (MAT File I/O Library)
1693 #################
1694
1695
1696 AC_ARG_WITH(matio,
1697     AS_HELP_STRING([--without-matio],[Disable the interface to Matio (MAT File I/O library)]))
1698
1699 AC_ARG_WITH(matio_include,
1700         AS_HELP_STRING([--with-matio-include=DIR],[Set the path to the MATIO headers]),
1701         [with_matio_include="-I$withval"], [])
1702
1703 AC_ARG_WITH(matio_library,
1704         AS_HELP_STRING([--with-matio-library=DIR],[Set the path to the MATIO libraries]),
1705         [with_matio_library="-L$withval"], [])
1706
1707 MATIO_ENABLE=no
1708
1709 if test "$with_matio" != no; then
1710    if test -n "$with_matio_include" -o -n "$with_matio_library" ; then
1711       MATIO_CFLAGS="$with_matio_include"
1712       MATIO_LIBS="$with_matio_library -lm -lz -lmatio -lhdf5"
1713    else
1714       if $WITH_DEVTOOLS; then # Scilab thirdparties
1715          MATIO_CFLAGS="-I$DEVTOOLS_INCDIR"
1716          MATIO_LIBS="-L$DEVTOOLS_LIBDIR -lm -lz -lmatio -lhdf5"
1717       else
1718          PKG_CHECK_MODULES(MATIO, [matio >= 1.5.0])
1719       fi
1720    fi
1721
1722    save_CFLAGS="$CFLAGS"
1723    save_LIBS="$LIBS"
1724
1725    CFLAGS="$CFLAGS $MATIO_CFLAGS"
1726    LIBS="$LIBS $MATIO_LIBS"
1727
1728    AC_CHECK_HEADERS([matio.h], [],
1729      [AC_MSG_ERROR([Invalid MATIO_CFLAGS returned by pkg-config. Try to define MATIO_CFLAGS.])])
1730    AC_CHECK_LIB([matio], [Mat_Open], [],
1731      [AC_MSG_ERROR([Invalid MATIO_LIBS returned by pkg-config. Try to define MATIO_LIBS.])])
1732
1733    LIBS="$save_LIBS"
1734    CFLAGS="$save_CFLAGS"
1735
1736    AC_DEFINE([WITH_MATIO], [], [With the MATIO library])
1737    MATIO_ENABLE=yes
1738
1739    AC_SUBST(MATIO_LIBS)
1740    AC_SUBST(MATIO_CFLAGS)
1741 fi
1742
1743
1744 AC_SUBST(MATIO_ENABLE)
1745 AM_CONDITIONAL(MATIO, test "$with_matio" != no)
1746
1747
1748 #############################
1749 ## Documentation management #
1750 #############################
1751
1752 HELP_ENABLE=yes
1753
1754 AC_ARG_ENABLE(build-help,
1755         AS_HELP_STRING([--disable-build-help],[Disable the help build])
1756         )
1757
1758 if test "$enable_build_help" != no; then
1759     AC_DOCBOOK()
1760 else
1761     HELP_ENABLE=no
1762 fi
1763
1764 if test "$JAVA_ENABLE" = no; then
1765     HELP_ENABLE=no
1766 fi
1767
1768 AC_SUBST(HELP_ENABLE)
1769
1770 AM_CONDITIONAL(BUILD_HELP, test $HELP_ENABLE = yes)
1771
1772 ## Install XML help files ###
1773
1774 AC_ARG_WITH(install-help-xml,
1775         AS_HELP_STRING([--with-install-help-xml],[make install will install XML files])
1776         )
1777 HELP_INSTALL_ENABLE=no
1778 if test "$with_install_help_xml" != no -a "$with_install_help_xml" != ""; then
1779    HELP_INSTALL_ENABLE=yes
1780 fi
1781 AM_CONDITIONAL(INSTALL_HELP_XML, test "$HELP_INSTALL_ENABLE" != "")
1782
1783 ## Doxygen help generation
1784 AC_ARG_ENABLE(build-doxygen,
1785     AS_HELP_STRING([--enable-build-doxygen],[Generate doxygen C/C++ documentation]))
1786
1787 DOXYGEN_ENABLE=yes
1788 if test "$enable_build_doxygen" != no -a "$enable_build_doxygen" != ""; then
1789     AC_DOXYGEN()
1790 else
1791     DOXYGEN_ENABLE=no
1792 fi
1793 AM_CONDITIONAL(DOXYGEN, test $DOXYGEN_ENABLE = yes)
1794
1795 ## Valgrind specific code
1796 PKG_CHECK_EXISTS([valgrind], [PKG_CHECK_MODULES([VALGRIND], [valgrind], [AC_DEFINE([VALGRIND_ENABLE], [], [Enable valgrind specific tweaks])])], [])
1797
1798 ##############################################################
1799 ## Javasci module
1800 ##############################################################
1801
1802 JAVASCI_ENABLE=yes
1803
1804 if test "$JAVA_ENABLE" = no -o "$JAVASCI" = no; then
1805    JAVASCI_ENABLE=no
1806 fi
1807
1808 AC_SUBST(JAVASCI_ENABLE)
1809
1810
1811 ##############################################################
1812 ## Enable test at compilation time
1813 ##############################################################
1814
1815 COMPILATION_TESTS=no
1816 if test "$enable_compilation_tests" != no -a "$enable_compilation_tests" != ""; then
1817    COMPILATION_TESTS=yes
1818 fi
1819
1820 if test COMPILATION_TESTS=yes -a "$JUNIT4" == ""; then
1821    AC_MSG_WARN([--enable-compilation-tests deactivated: Could not find Junit4"])
1822    COMPILATION_TESTS=no
1823 fi
1824
1825 AM_CONDITIONAL(COMPILATION_TESTS, test "$COMPILATION_TESTS" != "no")
1826
1827 ##############################################################
1828 ## Enable the global force link
1829 ##############################################################
1830
1831 AC_ARG_ENABLE(force-full-link,
1832     AS_HELP_STRING([--enable-force-full-link],[Forces the explicit link between libscilab and some "on-the-fly" loaded libraries. NOT USE IN PRODUCTION.]))
1833
1834 FORCE_FULL_LINK="no"
1835 if test "$enable_force_full_link" == "yes"; then
1836     FORCE_FULL_LINK="yes"
1837 fi
1838
1839 AM_CONDITIONAL(FORCE_LINK, test "$FORCE_FULL_LINK" == "yes")
1840
1841 ##############################################################
1842 ## demo_tools module
1843 ##############################################################
1844
1845 DEMOTOOLS_ENABLE=yes
1846
1847 if test "$GUI_ENABLE" = no; then
1848    DEMOTOOLS_ENABLE=no
1849 fi
1850
1851 AC_SUBST(DEMOTOOLS_ENABLE)
1852
1853 ##############################################################
1854 ## graphics/renderer/graphic_export module
1855 ##############################################################
1856
1857 GRAPHICS_ENABLE=yes
1858
1859 if test "$GUI_ENABLE" = no; then
1860    GRAPHICS_ENABLE=no
1861 fi
1862
1863 AC_SUBST(GRAPHICS_ENABLE)
1864
1865 #########################
1866 ## libtool
1867 #########################
1868
1869 LT_PREREQ([2.2.7])
1870 LT_INIT([shared dlopen disable-static])
1871
1872 # Avoid to link all the dep from others libraries (*.la included by LIBADD)
1873 link_all_deplibs=no
1874
1875 # Check to see if building shared libraries
1876 libtool_build_shared_libs=no
1877 if test "$enable_shared" = "yes"; then
1878   libtool_build_shared_libs=yes
1879 fi
1880
1881 # Check to see if building static libraries
1882 libtool_build_static_libs=no
1883 if test "$enable_static" = "yes"; then
1884   libtool_build_static_libs=yes
1885 fi
1886
1887 # AM_CONDITIONAL(ENABLE_STATIC, test "$libtool_build_static_libs" = yes)
1888 # Fake to disable the static build
1889 AM_CONDITIONAL(ENABLE_STATIC, test "$libtool_build_static_libs" = xxxx)
1890
1891 AC_C_CONST()
1892 AC_C_INLINE()
1893
1894 AC_BACKTRACE()
1895
1896 ##########
1897 ##### Code quality
1898 ##########
1899 AC_PATH_PROG(SPLINT, splint, no)
1900
1901 ##########
1902 ##### Detect ccache and use it by default if available
1903 ##########
1904
1905 AC_ARG_ENABLE(ccache,
1906         AS_HELP_STRING([--disable-ccache],[Disable the use of ccache])
1907         )
1908 AC_PATH_PROG(CCACHE, ccache)
1909 if test x"$CCACHE" != x -a "$enable_ccache" != no; then
1910   CC="$CCACHE $CC"
1911   CXX="$CCACHE $CXX"
1912 fi
1913
1914 #######################
1915 ###### Creation of the header file (machine.h)
1916 #######################
1917
1918 AC_DEFINE_UNQUOTED([PATH_SEPARATOR], ["$PATH_SEPARATOR"],
1919 [The default path separator character.])
1920
1921 AH_TOP([#ifndef MACHINE_H
1922 #define MACHINE_H
1923 /* This file defines global element configuration of the build host */
1924 ])
1925
1926 AH_BOTTOM([
1927
1928 #ifdef DIR_SEPARATOR
1929        #undef DIR_SEPARATOR
1930 #endif
1931 #define DIR_SEPARATOR "/"
1932
1933 #ifdef DIR_SEPARATORW
1934            #undef DIR_SEPARATORW
1935 #endif
1936 #define DIR_SEPARATORW L"/"
1937
1938 #define bsiz 4096
1939
1940 #endif /* MACHINE_H  */
1941 ])
1942
1943 # Define the standard extension of a dynamic library
1944 AC_DEFINE_UNQUOTED([SHARED_LIB_EXT],["$shrext_cmds"],[Extension of a shared library])
1945 AC_DEFINE_UNQUOTED([SHARED_LIB_EXTW],[L"$shrext_cmds"],[Extension of a shared library ( wide string )])
1946
1947
1948
1949 #################
1950 ## Update the years in the various part of the code.
1951 #################
1952
1953 if test ! -f modules/core/src/cpp/banner.cpp; then
1954    AC_MSG_ERROR([Could not find the Scilab banner file.])
1955 fi
1956
1957 CURRENT_YEAR=`date "+%Y"`
1958 DETECTED_YEAR=`grep "Copyright (c) 2017-" modules/core/src/cpp/banner.cpp|sed -e "s/.*Copyright (c) 2017-\([[0-9]]*\).*/\1/g"`
1959
1960 if test "$CURRENT_YEAR" != "$DETECTED_YEAR"; then
1961    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
1962    sed -i -e "s| 2017-$DETECTED_YEAR ESI Group| 2017-$CURRENT_YEAR ESI Group|g" etc/Info.plist.in
1963    sed -i -e "s|VALUE \"LegalCopyright\", \"Copyright (C) $DETECTED_YEAR|VALUE \"LegalCopyright\", \"Copyright (C) $CURRENT_YEAR|" $(find . -iname '*.rc')
1964    AC_MSG_WARN([New year ($CURRENT_YEAR) detected. Copyright files updated. Please commit them ASAP.])
1965 fi
1966
1967
1968 #########
1969 ## Check extra CC / CXX compiler flags to ease runtime behaviors
1970 #########
1971 AC_CHECK_STDCPP_STATIC()
1972 AC_CHECK_ADDRESS_SANTIZER()
1973
1974 #################
1975 ## stop on warning
1976 #################
1977
1978 # Stop to compile scilab when a warning is found ...
1979 # This stuff is at the end of the configure.ac because it causes some
1980 # problem with AC_COMPILE (the -Werror is added to the test)
1981 #
1982 if test "$enable_stop_on_warning" = yes; then
1983     WARNING_CFLAGS="-Werror=implicit-function-declaration -Werror=declaration-after-statement "
1984     WARNING_CXXFLAGS="-Werror=implicit-function-declaration "
1985 fi
1986
1987 # SCI_*FLAGS contains all defaults values detected on configure
1988 SCI_CFLAGS=$(echo                                             \
1989              $LARGEFILE_CFLAGS                                \
1990              $CODECOVERAGE_CFLAGS                             \
1991              $DEBUG_CFLAGS                                    \
1992              $ARCH_CFLAGS                                     \
1993              $COMPILER_CFLAGS                                 \
1994              $SCILIBS_CFLAGS                                  \
1995              $SSE_CFLAGS                                      \
1996              $BACKTRACE_CFLAGS                                \
1997              $WARNING_CFLAGS                                  )
1998 SCI_CXXFLAGS=$(echo                                           \
1999                $STDCXX_CXXFLAGS                               \
2000                $LARGEFILE_CXXFLAGS                            \
2001                $CODECOVERAGE_CXXFLAGS                         \
2002                $DEBUG_CXXFLAGS                                \
2003                $ARCH_CXXFLAGS                                 \
2004                $COMPILER_CXXFLAGS                             \
2005                $SCILIBS_CXXFLAGS                              \
2006                $SSE_CXXFLAGS                                  \
2007                $BACKTRACE_CXXFLAGS                            \
2008                $WARNING_CXXFLAGS                              )
2009 SCI_FFLAGS=$(echo                                             \
2010              $LARGEFILE_FFLAGS                                \
2011              $CODECOVERAGE_FFLAGS                             \
2012              $DEBUG_FFLAGS                                    \
2013              $ARCH_FFLAGS                                     \
2014              $COMPILER_FFLAGS                                 \
2015              $SCILIBS_FFLAGS                                  \
2016              $SSE_FFLAGS                                      \
2017              $BACKTRACE_FFLAGS                                \
2018              $WARNING_FFLAGS                                  )
2019 SCI_LDFLAGS=$(echo                                            \
2020               $LARGEFILE_LDFLAGS                              \
2021               $CODECOVERAGE_LDFLAGS                           \
2022               $DEBUG_LDFLAGS                                  \
2023               $ARCH_LDFLAGS                                   \
2024               $COMPILER_LDFLAGS                               \
2025               $SCILIBS_LDFLAGS                                \
2026               $SSE_LDFLAGS                                    \
2027               $BACKTRACE_LDFLAGS                              \
2028               $WARNING_LDFLAGS                                )
2029 AC_SUBST(SCI_CFLAGS)
2030 AC_SUBST(SCI_CXXFLAGS)
2031 AC_SUBST(SCI_FFLAGS)
2032 AC_SUBST(SCI_LDFLAGS)
2033
2034 AC_CONFIG_FILES([
2035 contrib/Makefile
2036 desktop/images/icons/Makefile
2037 desktop/Makefile
2038 modules/threads/Makefile
2039 modules/ast/Makefile
2040 modules/functions_manager/Makefile
2041 modules/helptools/Makefile
2042 modules/data_structures/Makefile
2043 modules/differential_equations/Makefile
2044 modules/optimization/Makefile
2045 modules/elementary_functions/Makefile
2046 modules/special_functions/Makefile
2047 modules/io/Makefile
2048 modules/completion/Makefile
2049 modules/history_manager/Makefile
2050 modules/jvm/Makefile
2051 modules/commons/Makefile
2052 modules/sound/Makefile
2053 modules/statistics/Makefile
2054 modules/mexlib/Makefile
2055 modules/sparse/Makefile
2056 modules/linear_algebra/Makefile
2057 modules/polynomials/Makefile
2058 modules/signal_processing/Makefile
2059 modules/arnoldi/Makefile
2060 modules/interpolation/Makefile
2061 modules/localization/Makefile
2062 modules/cacsd/Makefile
2063 modules/boolean/Makefile
2064 modules/integer/Makefile
2065 modules/fileio/Makefile
2066 modules/spreadsheet/Makefile
2067 modules/string/Makefile
2068 modules/time/Makefile
2069 modules/graphics/Makefile
2070 modules/graphic_export/Makefile
2071 modules/graphic_objects/Makefile
2072 modules/renderer/Makefile
2073 modules/action_binding/Makefile
2074 modules/gui/Makefile
2075 modules/mpi/Makefile
2076 modules/randlib/Makefile
2077 modules/tclsci/Makefile
2078 modules/windows_tools/Makefile
2079 modules/core/Makefile
2080 modules/prebuildjava/Makefile
2081 modules/api_scilab/Makefile
2082 modules/call_scilab/Makefile
2083 modules/types/Makefile
2084 modules/hdf5/Makefile
2085 modules/fftw/Makefile
2086 modules/umfpack/Makefile
2087 modules/scicos/Makefile
2088 modules/scicos_blocks/Makefile
2089 modules/functions/Makefile
2090 modules/dynamic_link/Makefile
2091 modules/overloading/Makefile
2092 modules/javasci/Makefile
2093 modules/m2sci/Makefile
2094 modules/development_tools/Makefile
2095 modules/output_stream/Makefile
2096 modules/console/Makefile
2097 modules/demo_tools/Makefile
2098 modules/parameters/Makefile
2099 modules/matio/Makefile
2100 modules/atoms/Makefile
2101 modules/xcos/Makefile
2102 modules/scinotes/Makefile
2103 modules/ui_data/Makefile
2104 modules/graph/Makefile
2105 modules/parallel/Makefile
2106 modules/modules_manager/Makefile
2107 modules/history_browser/Makefile
2108 modules/preferences/Makefile
2109 modules/xml/Makefile
2110 modules/external_objects/Makefile
2111 modules/external_objects_java/Makefile
2112 modules/slint/Makefile
2113 modules/coverage/Makefile
2114 modules/webtools/Makefile
2115 modules/Makefile
2116 Makefile
2117 scilab.pc
2118 etc/modules.xml
2119 etc/classpath.xml
2120 etc/Info.plist
2121 etc/logging.properties
2122 scilab.properties
2123 scilab-lib.properties
2124 scilab-lib-doc.properties
2125 modules/helptools/etc/SciDocConf.xml
2126 modules/core/includes/version.h
2127 modules/atoms/etc/repositories
2128 modules/atoms/tests/unit_tests/repositories.orig
2129 ])
2130
2131 # Detection of the module for the future version of Scilab 6
2132 # ie we detect module which ends with _yasp
2133
2134 if test "$enable_yasp" = yes; then
2135    AC_CONFIG_FILES([
2136    modules/development_tools/src/fake/Makefile
2137   ])
2138 fi
2139
2140 # This script is used by Xcos in order to regenerate the function/block list
2141 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])
2142
2143 AC_OUTPUT
2144
2145 # To distribution packager, you can uncomment this stuff is you want to
2146 # disable the rpath issue
2147 # However, you will have to set all the LD_LIBRARY_PATH to .libs/ directory
2148 # since scilab is compiling macros and help into the source tree (ie before
2149 # the "make install")
2150 # You should consider using chrpath:
2151 # http://directory.fsf.org/project/chrpath/
2152 # to remove it before the make install
2153
2154 #case ${host} in
2155 #  *-pc-linux-gnu)
2156 #    AC_MSG_RESULT([Fixing libtool for -rpath problems.])
2157 #    sed < libtool > libtool-2 \
2158 #    's/^hardcode_libdir_flag_spec.*$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/'
2159 #    mv libtool-2 libtool
2160 #    chmod 755 libtool
2161 #  ;;
2162 #esac
2163 #
2164
2165 echo ""
2166
2167 echo "Scilab is configured as follows. Please verify that this configuration"
2168 echo "matches your expectations."
2169 echo ""
2170 echo "Host system type : $host"
2171 echo ""
2172 echo "                  Option                        Value"
2173 echo "-------------------------------------------------------------------------"
2174 echo "Shared libraries.......      --enable-shared=$libtool_build_shared_libs"
2175 echo "Static libraries.......      --enable-static=$libtool_build_static_libs"
2176 echo "GNU ld.................      --with-gnu-ld=$with_gnu_ld"
2177 echo "Enable debug ..........      --enable-debug=$enable_debug"
2178 echo "Enable debug C.........      --enable-debug-C=$enable_debug_C"
2179 echo "Enable debug C++.......      --enable-debug-CXX=$enable_debug_CXX"
2180 echo "Enable debug Java......      --enable-debug-java=$enable_debug_java"
2181 echo "Enable debug Fortran...      --enable-debug-fortran=$enable_debug_fortran"
2182 echo "Enable stop on warning.      --enable-stop-on-warning=$enable_stop_on_warning"
2183
2184 echo ""
2185 echo "Compiler Configuration:"
2186 echo "  Intel (--with-intelcompilers) .... =        $with_intelcompilers"
2187 echo "  GNU gcc (--with-gcc) ............. =        $with_gcc"
2188 echo "  GNU Fortran 95 (--with-gfortran) . =        $with_gfortran"
2189 echo ""
2190 echo "Options:"
2191 echo "  Do not use TCL/TK (--without-tk) ................. = $with_tk"
2192 echo "  TCL include (--with-tcl-include) ................. = $USER_TCL_INC_PATH"
2193 echo "  TCL library (--with-tcl-library) ................. = $USER_TCL_LIB_PATH"
2194 echo "  TK include (--with-tk-include) ................... = $USER_TK_INC_PATH"
2195 echo "  TK library (--with-tk-library) ................... = $USER_TK_LIB_PATH"
2196 echo "  Install XML Help (--with-install-help-xml) ....... = $with_install_help_xml"
2197 echo "  Compilation tests (--enable-compilation-tests) ... = $COMPILATION_TESTS"
2198 echo "  Make the package relocatable (--enable-relocatable)= $RELOCATABLE"
2199 echo "  Use FFTW (--without-fftw) ........................ = $with_fftw"
2200 echo "  Use MATIO (--without-matio) ...................... = $with_matio"
2201 echo ""
2202 echo "  Compile with Scilab thirdparties ................. = $WITH_DEVTOOLS"
2203
2204 echo ""
2205 if test "$with_gui" = no; then
2206    echo "Not using Xcos because of the option --without-gui"
2207 else
2208 if test $XCOS_ENABLE = yes; then
2209    echo "Xcos enable"
2210    echo "Build modelica compiler (--without-modelica) ....... = $with_modelica"
2211    echo ""
2212    if test "$with_modelica" != no -a "$OCAMLC" != no -a "$OCAMLOPT" != no; then
2213      echo "Ocaml Configuration (for Modelica compiler):"
2214      echo "  OCAMLC ............. = $OCAMLC"
2215      echo "  OCAMLOPT ........... = $OCAMLOPT"
2216      echo "  OCAMLDEP ........... = $OCAMLDEP"
2217    else
2218      echo "Will not build Modelica compiler"
2219    fi
2220 else
2221    echo "Not using Xcos"
2222 fi
2223 fi
2224
2225 echo ""
2226 if test "$enable_code_coverage" = yes;  then
2227    echo "Code coverage configuration:"
2228    echo "  LCOV .............. = $LCOV"
2229    echo "  GENHTML ........... = $GENHTML"
2230 else
2231    echo "Not using code coverage"
2232 fi
2233
2234 echo ""
2235 if test $OPENMP_ENABLE = yes; then
2236    echo "OpenMP Configuration:"
2237    echo "OpenMP CFLAGS ...... = $OPENMP_CFLAGS"
2238    echo "OpenMP CXXFLAGS .... = $OPENMP_CXXFLAGS"
2239    echo "OpenMP LIBS ........ = $OPENMP_LIBS"
2240    echo "OpenMP LDFLAGS ..... = $OPENMP_LDFLAGS"
2241 else
2242    echo "Not using OpenMP"
2243 fi
2244
2245 echo ""
2246 if test $FFTW_ENABLE = yes;  then
2247    echo "FFTW Configuration:"
2248    echo "  FFTW LIBS .......... = $FFTW3_LIB"
2249    echo "  FFTW CFLAGS ........ = $FFTW3_CFLAGS"
2250 else
2251    echo "Not using FFTW"
2252 fi
2253
2254 echo ""
2255 echo "Eigen3 Configuration:"
2256 echo "  EIGEN CPPFLAGS ...... = $EIGEN_CPPFLAGS"
2257
2258 echo ""
2259 if test $MATIO_ENABLE = yes;  then
2260    echo "MATIO Configuration:"
2261    echo "  MATIO LIBS .......... = $MATIO_LIBS"
2262    echo "  MATIO CFLAGS ........ = $MATIO_CFLAGS"
2263 else
2264    echo "Not using MATIO"
2265 fi
2266
2267 echo ""
2268 if test $UMFPACK_ENABLE = yes;  then
2269    echo "UMFPACK Configuration:"
2270    echo "  UMFPACK LIBS ....... = $UMFPACK_LIB"
2271    echo "  UMFPACK CFLAGS ..... = $UMFPACK_CFLAGS"
2272    if test $SUITESPARSE = yes; then
2273       echo "  UMFPACK SUITESPARSE  = Yes"
2274    else
2275       echo "  UMFPACK SUITESPARSE  = No"
2276    fi
2277 else
2278    echo "Not using UMFPACK"
2279 fi
2280
2281
2282 echo ""
2283 echo "BLAS/LAPACK/ATLAS Configuration:"
2284 echo "  BLAS LIBS ............. = $BLAS_LIBS"
2285 echo "  BLAS TYPE ............. = $BLAS_TYPE"
2286 echo "  LAPACK LIBS ........... = $LAPACK_LIBS"
2287 echo "  LAPACK TYPE ........... = $LAPACK_TYPE"
2288 echo "  ARPACK LIBS ........... = $ARPACK_LIBS"
2289 echo ""
2290
2291
2292 if test "$with_mpi" == yes; then
2293    echo "OpenMPI Configuration:"
2294    echo "OpenMPI LIBS ........... = $OPENMPI_LIBS"
2295    echo "OpenMPI C Compiler ..... = $OPENMPI_CC"
2296    echo "OpenMPI C++ Compiler ... = $OPENMPI_CXX"
2297    echo "OpenMPI F77 Compiler ... = $MPIF77"
2298 else
2299    echo "Not using MPI"
2300 fi
2301
2302 echo ""
2303 if test $BUILD_LOCALIZATION_ENABLE != no; then
2304    echo "Gettext/localization configuration:"
2305    echo "  xgettext ............... = $XGETTEXT"
2306    echo "  msgfmt  ................ = $MSGFMT"
2307    echo "  msgfmt_opts ............ = $MSGFMT_OPTS"
2308    echo "  msgcat  ................ = $MSGCAT"
2309 else
2310    echo "Won't generate localization files"
2311 fi
2312
2313 echo ""
2314 if test $HELP_ENABLE = yes; then
2315    echo "Documentation building configuration:"
2316    echo "  Docbook XSL path ....... = $DOCBOOK_ROOT"
2317    echo "  Saxon XSLT ............. = $SAXON"
2318    echo "  XML commons external ... = $XML_APIS_EXT"
2319 else
2320    echo "No documentation generated"
2321 fi
2322
2323 echo ""
2324 echo "Java Configuration:"
2325 if test ! -z "$JAVAC"; then
2326 echo "  JAVA_HOME ........... = $JAVA_HOME"
2327 echo "  JAVAC ............... = $JAVAC"
2328 echo "  JAVA_CLASSPATH ...... = $JAVA_CLASSPATH"
2329 echo "  JAVA_VERSION ........ = $JAVA_VERSION"
2330 echo "  JAVAC_FLAGS ......... = $JAVAC_FLAGS"
2331 echo "  JAVA_JNI_INCLUDE .... = $JAVA_JNI_INCLUDE"
2332 echo "  JAVA_JNI_LIBS ....... = $JAVA_JNI_LIBS"
2333 echo "  JAVA_JNI_LIBS_PRELOAD = $JAVA_JNI_LIBS_PRELOAD"
2334 echo "  JAVA ................ = $JAVA"
2335 echo "  JAVADOC ............. = $JAVADOC"
2336 echo "  JAR ................. = $JAR"
2337 echo "  ANT ................. = $ANT"
2338 else
2339 echo "  JAVA disabled"
2340 fi
2341
2342
2343 echo ""
2344 echo "Java dependencies:"
2345 if test ! -z "$JAVAC"; then
2346 echo "  Flexdock ............ = $FLEXDOCK"
2347 echo "  JOGL 2............... = $JOGL2"
2348 echo "  JOGL 2 LIBS (JNI) ... = $JOGL2_LIBS"
2349 echo "  Gluegen 2 ........... = $GLUEGEN2_RT"
2350 echo "  Gluegen 2 LIBS (JNI)  = $GLUEGEN2_RT_LIBS"
2351 echo "  Jeuclid (MathML) .... = $JEUCLID_CORE"
2352 echo "  Jhall  .............. = $JHALL"
2353 echo "  Jrosetta (API) ...... = $JROSETTA_API"
2354 echo "  Jrosetta (Engine) ... = $JROSETTA_ENGINE"
2355 echo "  Commons Logging ..... = $COMMONS_LOGGING"
2356 echo "  JGraph X ............ = $JGRAPHX"
2357 echo "  SciRenderer ......... = $SCIRENDERER"
2358 echo "  JLaTeXMath .......... = $JLATEXMATH"
2359 echo "  ECJ ................. = $ECJ"
2360 fi
2361
2362 echo ""
2363 if test ! -z "$JAVAC"; then
2364 echo "Documentation, graphic export:"
2365 echo "  FOP (XML => PDF) .... = $FOP"
2366 echo "  JLaTeXMath Fop ...... = $JLATEXMATH_FOP"
2367 echo "  Batik (SVG) ......... = $BATIK"
2368 echo "  Avalon Framework .... = $AVALON_FRAMEWORK"
2369 echo "  Commons I/O ......... = $COMMONS_IO"
2370 echo "  XML graphics commons  = $XMLGRAPHICS_COMMONS"
2371 fi
2372
2373
2374 echo ""
2375 echo "Code quality (optional):"
2376 echo "  Checkstyle .......... = $CHECKSTYLE"
2377 echo "  Commons-beanutils ... = $COMMONS_BEANUTILS"
2378 echo "  Antlr ............... = $ANTLR"
2379 echo "  Junit4 .............. = $JUNIT4"
2380 echo "  Hamcrest ............ = $HAMCREST"
2381 echo "  Cobertura ........... = $COBERTURA"
2382 echo "  splint .............. = $SPLINT"
2383
2384 echo ""
2385 echo "TCL/TK configuration:"
2386 echo "  TK_INC_PATH ........ = $TK_INC_PATH"
2387 echo "  TCL_INC_PATH ....... = $TCL_INC_PATH"
2388 echo "  TCLTK_LIBS ......... = $TCLTK_LIBS"
2389 echo "  TCL_SERIAL_VERSION . = $TCL_SERIAL_VERSION"
2390 echo "  TK_SERIAL_VERSION .. = $TK_SERIAL_VERSION"
2391
2392 echo ""
2393 echo "XML configuration:"
2394 echo "  XML_FLAGS .......... = $XML_FLAGS"
2395 echo "  XML_LIBS ........... = $XML_LIBS"
2396 echo "  XML_VERSION ........ = $XML_VERSION"
2397
2398 echo ""
2399 echo "HDF5 configuration:"
2400 echo "  HDF5 CFLAGS ......... = $HDF5_CFLAGS"
2401 echo "  HDF5 LIBS ........... = $HDF5_LIBS"
2402
2403 echo ""
2404 echo "PCRE configuration:"
2405 echo "  PCRE_CFLAGS ........ = $PCRE_CFLAGS"
2406 echo "  PCRE_LIBS .......... = $PCRE_LIBS"
2407 echo "  PCRE_VERSION ....... = $PCRE_VERSION"
2408
2409 echo ""
2410 echo "Regenerate Scilab's parser"
2411 if test "$enable_build_parser" != no; then
2412 echo "  YACC ............... = $YACC"
2413 echo "  LEX ................ = $LEX"
2414 echo "  YFLAGS ............. = $YFLAGS"
2415 else
2416 echo "  Regenerate parser disabled (will use embedded sources)"
2417 fi
2418
2419 echo ""
2420 echo "CURL configuration:"
2421 echo "  CURL_CFLAGS ........ = $CURL_CFLAGS"
2422 echo "  CURL_LIBS .......... = $CURL_LIBS"
2423 echo "  CURL_VERSION ....... = $CURL_VERSION"
2424
2425 echo ""
2426 echo "SWIG Configuration:"
2427 if test ! -z "$SWIG_BIN"; then
2428 echo "  SWIG_BIN ........... = $SWIG_BIN"
2429 echo "  SWIG_JAVA .......... = $SWIG_JAVA"
2430 else
2431 echo "  SWIG generation disabled"
2432 fi
2433
2434 echo ""
2435 echo "GIWS Configuration:"
2436 if test ! -z "$GIWS_BIN"; then
2437 echo "  GIWS_BIN ........... = $GIWS_BIN"
2438 else
2439 echo "  GIWS generation disabled"
2440 fi
2441
2442 echo ""
2443 echo "Valgrind configuration:"
2444 echo "  VALGRIND_CFLAGS .... = $VALGRIND_CFLAGS"
2445 echo "  VALGRIND_LIBS ...... = $VALGRIND_LIBS"
2446 echo ""
2447
2448 echo ""
2449 echo "Libtool config:"
2450 echo "  objext .............. = $objext"
2451 echo "  libext (static) ..... = $libext"
2452 echo "  shrext_cmds ......... = $shrext_cmds"
2453 echo "  exeext .............. = $exeext"
2454
2455 echo ""
2456
2457 echo "Compilation paths:"
2458 echo "  srcdir .............. = $SCI_SRCDIR"
2459 echo "  srcdir_full ......... = $SCI_SRCDIR_FULL"
2460 echo "  builddir ............ = $SCI_BUILDDIR"
2461 if test "$SCI_SRCDIR_FULL" != "$SCI_BUILDDIR"; then
2462 echo "  VPATH build ......... = Activated"
2463 fi
2464
2465 echo ""
2466 echo "Platform information:"
2467 echo "  host ........... = $host"
2468 echo "  host_cpu ....... = $host_cpu"
2469 echo "  host_vendor .... = $host_vendor"
2470 echo "  host_os ... .... = $host_os"
2471 echo "  hostname ....... = $ac_hostname"
2472 echo "  CPU 64 bits .... = $IS_64_BITS_CPU"
2473 if test -n "$MAC_DETECTED_ARCH"; then
2474 echo "  Mac OS X arch .. = $MAC_DETECTED_ARCH"
2475 echo "  Mac OS X version = $macosx_version"
2476 fi
2477
2478 echo ""
2479 echo "Options used to compile and link:"
2480 echo "  prefix ......... = $prefix"
2481 echo "  localedir ...... = $localedir"
2482 echo "  VERSION ........ = $PACKAGE_VERSION"
2483 echo "  CC ............. = $CC"
2484 echo "  CFLAGS ......... = $CFLAGS"
2485 echo "  SCI_CFLAGS ..... = $SCI_CFLAGS"
2486 echo "  DEFS ........... = $DEFS"
2487 echo "  LD ............. = $LD"
2488 echo "  LDFLAGS ........ = $LDFLAGS"
2489 echo "  SCI_LDFLAGS .... = $SCI_LDFLAGS"
2490 echo "  LIBS ........... = $LIBS"
2491 echo "  CXX ............ = $CXX"
2492 echo "  CXXFLAGS ....... = $CXXFLAGS"
2493 echo "  SCI_CXXFLAGS ... = $SCI_CXXFLAGS"
2494 echo "  F77 ............ = $F77"
2495 echo "  FFLAGS ......... = $FFLAGS"
2496 echo "  SCI_FFLAGS ..... = $SCI_FFLAGS"
2497 echo "  F77_LDFLAGS .... = $F77_LDFLAGS"
2498 echo "  FLIBS...... .... = $FLIBS"
2499 echo "  TERMCAP_LIB .... = $TERMCAP_LIB"
2500 echo ""