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