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