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