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