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