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