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