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