9f5517452175144e6cb56953d95786d10ae58cb2
[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.0],[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     AC_HELP_STRING([--without-mpi],[compile with MPI library]))
1114
1115 MPI_ENABLE=no
1116 if test "$with_mpi" != no; then
1117    AC_OPENMPI()
1118    # We will have to detect other implementation of OpenMPI
1119    MPI_ENABLE=yes
1120 fi
1121 AC_SUBST(MPI_ENABLE)
1122
1123 AM_CONDITIONAL(MPI, test "$with_mpi" = yes)
1124
1125 #################
1126 ## PVM
1127 #################
1128
1129 AC_ARG_WITH(pvm,
1130     AC_HELP_STRING([--without-pvm],[Disable the interface to the PVM library]))
1131
1132 PVM_ENABLE=no
1133 if test "$with_pvm" != no; then
1134    AC_PVM()     
1135    PVM_ENABLE=yes
1136 fi
1137 AC_SUBST(PVM_ENABLE)
1138
1139 AM_CONDITIONAL(PVM, test "$with_pvm" != no)
1140
1141 #######################
1142 ## Test for libxml
1143 #######################
1144
1145 AC_LIBXML2()
1146
1147 #######################
1148 ## Test for gettext
1149 #######################
1150
1151 ALL_LINGUAS="en_US fr_FR zh_CN zh_TW ru_RU ca_ES de_DE es_ES pt_BR ja_JP it_IT"
1152
1153 AC_ARG_ENABLE(build-localization,
1154                 AC_HELP_STRING([--disable-build-localization],[Disable the localization build])
1155                 )
1156 BUILD_LOCALIZATION_ENABLE=no
1157
1158 if test "$enable_build_localization" != no; then
1159
1160    AC_SUBST(ALL_LINGUAS)
1161    AC_CHECK_FUNCS([bind_textdomain_codeset])
1162
1163    AC_PATH_PROG(MSGCAT, msgcat, no)
1164 #   AC_PATH_PROG(MSGFMT, msgfmt, no)
1165 #   AC_PATH_PROG(XGETTEXT, xgettext, no)
1166
1167    if test x$MSGFMT = xno; then
1168           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 ])
1169           fi
1170         if test x$MSGCAT = xno; then
1171           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 ])
1172         fi
1173         BUILD_LOCALIZATION_ENABLE=yes
1174 fi
1175 AM_CONDITIONAL(GENERATE_LOCALIZATION_FILES, test "$BUILD_LOCALIZATION_ENABLE" = yes)
1176
1177 #######################
1178 ## Test for blas/Atlas and lapack
1179 #######################
1180 AC_MSG_CHECKING([if BLAS, ATLAS or MKL is available])
1181 echo ""
1182 ACX_BLAS(
1183                 [AC_MSG_RESULT([$BLAS_TYPE found])]
1184                 ,
1185                 AC_MSG_ERROR([Impossible to find a BLAS compatible library (see BLAS or ATLAS).])
1186                 )
1187
1188 AC_MSG_CHECKING([if LAPACK is available])
1189 echo ""
1190 ACX_LAPACK(
1191                 [AC_MSG_RESULT([$LAPACK_TYPE found])],
1192                 AC_MSG_ERROR([Impossible to find the LAPACK library.])
1193                 )
1194
1195 #################
1196 ## UMFPACK
1197 #################
1198
1199 AC_ARG_WITH(umfpack,
1200     AC_HELP_STRING([--without-umfpack],[Disable the interface to the UMFPACK library]))
1201
1202 UMFPACK_ENABLE=no
1203 if test "$with_umfpack" != no; then
1204    AC_UMFPACK([$BLAS_LIBS])
1205    UMFPACK_ENABLE=yes
1206 fi
1207
1208 AC_SUBST(UMFPACK_ENABLE)
1209 AM_CONDITIONAL(UMFPACK, test "$with_umfpack" != no)
1210
1211 #######################
1212 ## Test for PCRE
1213 #######################
1214
1215 AC_PCRE()
1216
1217 #################
1218 ## Tcl/Tk library
1219 #################
1220
1221 WITH_TKSCI=no
1222 if test "$with_tk" != no; then
1223    if test "$MACOSX" = "1"; then
1224       AC_MSG_ERROR([Due to technical constraints, Tcl/Tk must be disabled under Mac OS X (--without-tk)])
1225    fi
1226    
1227         # check user arguments
1228         USER_TCL_LIB_PATH=""
1229         USER_TCL_INC_PATH=""
1230         AC_ARG_WITH(tcl-library,
1231                 AC_HELP_STRING([--with-tcl-library=DIR],[Set the path to the TCL library]),
1232                 [  USER_TCL_LIB_PATH=$withval
1233         ])
1234         AC_ARG_WITH(tcl-include,
1235                 AC_HELP_STRING([--with-tcl-include=DIR],[Set the path to the TCL headers]),
1236                 [  USER_TCL_INC_PATH=$withval
1237         ])
1238
1239         USER_TK_LIB_PATH=$USER_TCL_LIB_PATH
1240         USER_TK_INC_PATH=$USER_TCL_INC_PATH
1241
1242         AC_ARG_WITH(tk-library,
1243                 AC_HELP_STRING([--with-tk-library=DIR],[Set the path to the TK library]),
1244                 [  USER_TK_LIB_PATH=$withval
1245         ])
1246
1247         AC_ARG_WITH(tk-include,
1248                 AC_HELP_STRING([--with-tk-include=DIR],[Set the path to the TK headers]),
1249                 [  USER_TK_INC_PATH=$withval
1250         ])
1251
1252 ###########################
1253 ########## X11 checks
1254 ###########################      
1255                 ## This check is mandatory since tk needs Xlib headers and libs
1256                 AC_PATH_XTRA
1257                 ##
1258
1259         saved_cflags="$CFLAGS"
1260         saved_ldflags="$LDFLAGS"
1261         saved_cppflags="$CPPFLAGS"
1262
1263         AC_CHECK_LIB([dl], [main], [TCLTK_LIBS=" -ldl"])
1264         AC_CHECK_TCLTK
1265
1266         # set variables
1267         if test "$WITH_TKSCI" = yes; then
1268                 AC_DEFINE([WITH_TK], [], [With TK])
1269         else
1270                 AC_MSG_ERROR([TCL/TK not found. Use --without-tk or specify the librairies and include paths manually])
1271         fi
1272
1273         AC_SUBST(TCLTK_LIBS)
1274         AC_SUBST(TCL_INC_PATH)
1275         AC_SUBST(TK_INC_PATH)
1276
1277 fi
1278 AC_SUBST(WITH_TKSCI)
1279 AM_CONDITIONAL(TCLTK, test "$WITH_TKSCI" = yes)
1280
1281 #################
1282 ## MATIO LIBRARY (MAT File I/O Library)
1283 #################
1284
1285
1286 AC_ARG_WITH(matio,
1287     AC_HELP_STRING([--without-matio],[Disable the interface to Matio (MAT File I/O library)]))
1288
1289 AC_ARG_WITH(matio_include,
1290                 AC_HELP_STRING([--with-matio-include=DIR],[Set the path to the MATIO headers]),
1291                 [with_matio_include="-I$withval"], [])
1292
1293 AC_ARG_WITH(matio_library,
1294                 AC_HELP_STRING([--with-matio-library=DIR],[Set the path to the MATIO libraries]),
1295                 [with_matio_library="-L$withval"], [])
1296
1297 MATIO_ENABLE=no
1298
1299 if test "$with_matio" != no; then
1300    if test -n "$with_matio_include" -o -n "$with_matio_library" ; then
1301       MATIO_CFLAGS="$with_matio_include"
1302       MATIO_LIBS="$with_matio_library -lm -lz -lmatio"
1303    else
1304       PKG_CHECK_MODULES(MATIO, [matio >= 1.3.3])
1305    fi
1306    
1307    save_CFLAGS="$CFLAGS"
1308    save_LIBS="$LIBS"
1309
1310    CFLAGS="$CFLAGS $MATIO_CFLAGS"
1311    LIBS="$LIBS $MATIO_LIBS"
1312    
1313    AC_CHECK_HEADERS([matio.h matioConfig.h], [],
1314      [AC_MSG_ERROR([Invalid MATIO_CFLAGS returned by pkg-config. Try to define MATIO_CFLAGS.])])
1315    AC_CHECK_LIB([matio], [Mat_Open], [],
1316      [AC_MSG_ERROR([Invalid MATIO_LIBS returned by pkg-config. Try to define MATIO_LIBS.])])
1317    
1318    LIBS="$save_LIBS"
1319    CFLAGS="$save_CFLAGS"
1320    
1321    AC_DEFINE([WITH_MATIO], [], [With the MATIO library])
1322    MATIO_ENABLE=yes
1323 fi
1324
1325
1326 AC_SUBST(MATIO_ENABLE)
1327 AM_CONDITIONAL(MATIO, test "$with_matio" != no)
1328
1329 #############################
1330 ## Documentation management #
1331 #############################
1332
1333 HELP_ENABLE=yes
1334
1335 AC_ARG_ENABLE(build-help,
1336                 AC_HELP_STRING([--disable-build-help],[Disable the help build])
1337                 )
1338
1339 if test "$enable_build_help" != no; then
1340     AC_DOCBOOK()
1341 else
1342     HELP_ENABLE=no
1343 fi
1344
1345 if test "$JAVA_ENABLE" = no; then
1346     HELP_ENABLE=no
1347 fi
1348
1349 AC_SUBST(HELP_ENABLE)
1350
1351 AM_CONDITIONAL(BUILD_HELP, test $HELP_ENABLE = yes)
1352
1353 ##¬†Install XML help files ###
1354
1355 AC_ARG_WITH(install-help-xml,
1356                 AC_HELP_STRING([--with-install-help-xml],[make install will install XML files])
1357                 )
1358 HELP_INSTALL_ENABLE=no
1359 if test "$with_install_help_xml" != no -a "$with_install_help_xml" != ""; then
1360    HELP_INSTALL_ENABLE=yes
1361 fi 
1362 AM_CONDITIONAL(INSTALL_HELP_XML, test "$HELP_INSTALL_ENABLE" != "")
1363
1364 ##############################################################
1365 ## Javasci module
1366 ##############################################################
1367
1368 JAVASCI_ENABLE=yes
1369
1370 if test "$JAVA_ENABLE" = no -o "$JAVASCI" = no; then
1371    JAVASCI_ENABLE=no
1372 fi
1373
1374 AC_SUBST(JAVASCI_ENABLE)
1375
1376 ##############################################################
1377 ## demo_tools module
1378 ##############################################################
1379
1380 DEMOTOOLS_ENABLE=yes
1381
1382 if test "$GUI_ENABLE" = no; then
1383    DEMOTOOLS_ENABLE=yes
1384 fi
1385
1386 AC_SUBST(DEMOTOOLS_ENABLE)
1387
1388 ##############################################################
1389 ## graphics/renderer/graphic_export module
1390 ##############################################################
1391
1392 GRAPHICS_ENABLE=yes
1393
1394 if test "$GUI_ENABLE" = no; then
1395    GRAPHICS_ENABLE=no
1396 fi
1397
1398 AC_SUBST(GRAPHICS_ENABLE)
1399
1400 #########################
1401 ## libtool
1402 #########################
1403
1404 AM_DISABLE_STATIC
1405 AC_PROG_LIBTOOL([shared dlopen])
1406 AM_PROG_LIBTOOL
1407
1408
1409 # Avoid to link all the dep from others libraries (*.la included by LIBADD)
1410 link_all_deplibs=no
1411
1412 # Check to see if building shared libraries
1413 libtool_build_shared_libs=no
1414 if test "$enable_shared" = "yes"; then
1415   libtool_build_shared_libs=yes
1416 fi
1417
1418 # Check to see if building static libraries
1419 libtool_build_static_libs=no
1420 if test "$enable_static" = "yes"; then
1421   libtool_build_static_libs=yes
1422 fi
1423
1424 # AM_CONDITIONAL(ENABLE_STATIC, test "$libtool_build_static_libs" = yes)
1425 # Fake to disable the static build
1426 AM_CONDITIONAL(ENABLE_STATIC, test "$libtool_build_static_libs" = xxxx)
1427
1428 AC_C_CONST()
1429 AC_C_INLINE()
1430
1431
1432 ########## 
1433 ##### Code quality
1434 ##########
1435 AC_PATH_PROG(SPLINT, splint, no)
1436
1437 #######################
1438 ###### Creation of the header file (machine.h)
1439 #######################
1440
1441 AC_DEFINE_UNQUOTED([PATH_SEPARATOR], ["$PATH_SEPARATOR"],
1442 [The default path separator character.])
1443
1444 AH_TOP([#ifndef MACHINE_H
1445 #define MACHINE_H
1446 /* This file defines global element configuration of the build host */
1447 ])
1448
1449 AH_BOTTOM([
1450
1451 #ifdef DIR_SEPARATOR
1452            #undef DIR_SEPARATOR
1453 #endif
1454 #define DIR_SEPARATOR "/"
1455
1456 #endif /* MACHINE_H  */
1457 ])
1458
1459 # Define the standard extension of a dynamic library
1460 AC_DEFINE_UNQUOTED([SHARED_LIB_EXT],["$shrext_cmds"],[Extension of a shared library])
1461
1462 #################
1463 ## stop on warning
1464 #################
1465
1466 # Stop to compile scilab when a warning is found ...
1467 # This stuff is at the end of the configure.ac because it causes some
1468 # problem with AC_COMPILE (the -Werror is added to the test)
1469 #
1470 dnl @TODO : -O0 is only to bypass Stack shit... Must be removed.
1471 if test "$enable_stop_on_warning" = yes; then
1472    CFLAGS="$CFLAGS -Werror -O0"
1473    CXXFLAGS="$CXXFLAGS -Werror -O0"
1474 fi
1475
1476 AC_CONFIG_FILES([
1477 libs/MALLOC/Makefile
1478 libs/dynamiclibrary/Makefile
1479 libs/doublylinkedlist/Makefile
1480 libs/hashtable/Makefile
1481 libs/libst/Makefile
1482 contrib/Makefile
1483 modules/helptools/Makefile
1484 modules/helptools/macros/xmlfiletohtml.sci
1485 modules/data_structures/Makefile
1486 modules/differential_equations/Makefile
1487 modules/optimization/Makefile
1488 modules/elementary_functions/Makefile
1489 modules/special_functions/Makefile
1490 modules/io/Makefile
1491 modules/shell/Makefile
1492 modules/completion/Makefile
1493 modules/history_manager/Makefile
1494 modules/jvm/Makefile
1495 modules/sound/Makefile
1496 modules/statistics/Makefile
1497 modules/mexlib/Makefile
1498 modules/sparse/Makefile
1499 modules/linear_algebra/Makefile
1500 modules/polynomials/Makefile
1501 modules/symbolic/Makefile
1502 modules/signal_processing/Makefile
1503 modules/arnoldi/Makefile
1504 modules/interpolation/Makefile
1505 modules/intersci/Makefile
1506 modules/localization/Makefile
1507 modules/cacsd/Makefile
1508 modules/boolean/Makefile
1509 modules/integer/Makefile
1510 modules/double/Makefile
1511 modules/fileio/Makefile
1512 modules/spreadsheet/Makefile
1513 modules/string/Makefile
1514 modules/time/Makefile
1515 modules/graphics/Makefile
1516 modules/graphic_export/Makefile
1517 modules/renderer/Makefile
1518 modules/action_binding/Makefile
1519 modules/gui/Makefile
1520 modules/pvm/Makefile
1521 modules/mpi/Makefile
1522 modules/randlib/Makefile
1523 modules/tclsci/Makefile
1524 modules/windows_tools/Makefile
1525 modules/core/Makefile
1526 modules/api_scilab/Makefile
1527 modules/call_scilab/Makefile
1528 modules/hdf5/Makefile
1529 modules/fftw/Makefile
1530 modules/umfpack/Makefile
1531 modules/scicos/Makefile
1532 modules/scicos_blocks/Makefile
1533 modules/functions/Makefile
1534 modules/dynamic_link/Makefile
1535 modules/overloading/Makefile
1536 modules/javasci/Makefile
1537 modules/maple2scilab/Makefile
1538 modules/m2sci/Makefile
1539 modules/compatibility_functions/Makefile
1540 modules/texmacs/Makefile
1541 modules/development_tools/Makefile
1542 modules/output_stream/Makefile
1543 modules/console/Makefile
1544 modules/demo_tools/Makefile
1545 modules/genetic_algorithms/Makefile
1546 modules/simulated_annealing/Makefile
1547 modules/parameters/Makefile
1548 modules/matio/Makefile
1549 modules/atoms/Makefile
1550 modules/xcos/Makefile
1551 modules/xpad/Makefile
1552 modules/Makefile
1553 libs/Makefile
1554 Makefile
1555 scilab.pc
1556 etc/modules.xml
1557 etc/classpath.xml
1558 etc/jvm_options.xml
1559 scilab-lib.properties
1560 scilab-lib-doc.properties
1561 ])
1562
1563 # Detection of the module for the future version of Scilab 6
1564 # ie we detect module which ends with _yasp
1565
1566 if test "$enable_yasp" = yes; then
1567    AC_CONFIG_FILES([
1568    modules/development_tools/src/fake/Makefile
1569   ])
1570 fi
1571
1572 # This script is used by Scicos in order to regenerate the function/block list
1573 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])
1574
1575
1576 #MAN_FR MAN_ENG
1577
1578 #for top_builddir in . .. ../.. $ac_auxdir $ac_auxdir/..; do
1579 #  test -f $top_builddir/configure && break
1580 #done
1581
1582
1583 #if test "$with_mpi" = yes; then
1584 #AC_CONFIG_FILES([modules/mpi/Makefile])
1585 #fi
1586
1587 # Generate stack.h
1588 if test "$IS_64_BITS_CPU" = true -o "$MACOSX" = "1"; then
1589    stack_h_cpp_flags=-DUSE_DYNAMIC_STACK
1590 else
1591    stack_h_cpp_flags=
1592 fi
1593
1594 AC_CONFIG_COMMANDS([modules/core/includes/stack.h],
1595   [if ! $CPP $stack_h_cpp_flags - < $srcdir/modules/core/includes/stack.h.in |\
1596               $GREP -v '^#' > $srcdir/modules/core/includes/stack.h ; then
1597      AC_MSG_ERROR([stack.h generation failed])
1598    fi],
1599   [CPP="$CPP"
1600    GREP="$GREP"
1601    stack_h_cpp_flags="$stack_h_cpp_flags"
1602   ])
1603
1604 AC_OUTPUT
1605
1606 # To distribution packager, you can uncomment this stuff is you want to 
1607 # disable the rpath issue
1608 # However, you will have to set all the LD_LIBRARY_PATH to .libs/ directory
1609 # since scilab is compiling macros and help into the source tree (ie before
1610 # the "make install")
1611 # You should consider using chrpath:
1612 # http://directory.fsf.org/project/chrpath/
1613 # to remove it before the make install
1614
1615 #case ${host} in
1616 #  *-pc-linux-gnu)
1617 #    AC_MSG_RESULT([Fixing libtool for -rpath problems.])
1618 #    sed < libtool > libtool-2 \
1619 #    's/^hardcode_libdir_flag_spec.*$/hardcode_libdir_flag_spec=" -D__LIBTOOL_IS_A_FOOL__ "/'
1620 #    mv libtool-2 libtool
1621 #    chmod 755 libtool
1622 #  ;;
1623 #esac
1624 #
1625
1626 echo ""
1627
1628 echo "Scilab is configured as follows. Please verify that this configuration"
1629 echo "matches your expectations."
1630 echo ""
1631 echo "Host system type : $host"
1632 echo ""
1633 echo "                  Option                        Value"
1634 echo "-------------------------------------------------------------------------"
1635 echo "Shared libraries.......      --enable-shared=$libtool_build_shared_libs   $libtool_build_shared_libs"
1636 echo "Static libraries.......      --enable-static=$libtool_build_static_libs   $libtool_build_static_libs"
1637 echo "GNU ld.................      --with-gnu-ld=$with_gnu_ld           $lt_cv_prog_gnu_ld"
1638 echo "Enable debug ..........      --enable-debug=$enable_debug $enable_debug"
1639 echo "Enable debug C.........      --enable-debug-C=$enable_debug_C     $enable_debug_C"
1640 echo "Enable debug C++.......      --enable-debug-CXX=$enable_debug_CXX $enable_debug_CXX"
1641 echo "Enable debug Java......      --enable-debug-java=$enable_debug_java       $enable_debug_java"
1642 echo "Enable debug Fortran...      --enable-debug-fortran=$enable_debug_fortran $enable_debug_fortran"
1643 echo "Enable stop on warning.      --enable-stop-on-warning=$enable_stop_on_warning     $enable_stop_on_warning"
1644
1645 echo ""
1646 echo "Compiler Configuration:"
1647 echo "  Intel (--with-intelcompilers) .... =            $with_intelcompilers"
1648 echo "  GNU gcc (--with-gcc) ............. =            $with_gcc"
1649 echo "  GNU Fortran 77 (--with-g77) ...... =            $with_g77"
1650 echo "  GNU Fortran 95 (--with-gfortran) . =            $with_gfortran"
1651 echo ""
1652 echo "Options:"
1653 echo "  Use PVM (--without-pvm) .......................... = $with_pvm"
1654 echo "  PVM include (--with-pvm-include) ................. = $PVMINCLUDE"
1655 echo "  PVM library (--with-pvm-library) ................. = $PVMLIBDIR"
1656 echo "  Compile with Ocaml (--without-ocaml) ............. = $with_ocaml"
1657 echo "  Do not use TCL/TK (--without-tk) ................. = $with_tk"
1658 echo "  TCL include (--with-tcl-include) ................. = $USER_TCL_INC_PATH"
1659 echo "  TCL library (--with-tcl-library) ................. = $USER_TCL_LIB_PATH"
1660 echo "  TK include (--with-tk-include) ................... = $USER_TK_INC_PATH"
1661 echo "  TK library (--with-tk-library) ................... = $USER_TK_LIB_PATH"
1662 echo "  Install XML Help (--with-install-help-xml) ....... = $with_install_help_xml"
1663 echo "  Make the package relocatable (--enable-relocatable)= $RELOCATABLE"
1664 echo "  Use FFTW (--without-fftw) ........................ = $with_fftw"
1665 echo "  Use MATIO (--without-matio) ...................... = $with_matio"
1666
1667 echo ""
1668 if test "$with_gui" = no; then
1669    echo "Not using Scicos because of the option --without-gui"
1670 else
1671 if test $SCICOS_ENABLE = yes; then
1672    echo "Scicos enable"
1673    echo ""
1674 if test "$with_ocaml" != no -a "$OCAMLC" != no -a "$OCAMLOPT" != no; then
1675    echo "Ocaml Configuration (for Modelica compiler):"
1676    echo "  OCAMLC ............. = $OCAMLC"
1677    echo "  OCAMLOPT ........... = $OCAMLOPT"
1678    echo "  OCAMLDEP ........... = $OCAMLDEP"
1679 else
1680         echo "Will not build Modelica compiler"
1681 fi
1682 else 
1683    echo "Not using Scicos"
1684 fi
1685 fi
1686
1687 echo ""
1688 if test $PVM_ENABLE = yes; then
1689    echo "PVM Configuration:"
1690    echo "  PVM Architecture ... = $PVM_ARCH"
1691    echo "  PVM INCLUDE ........ = $PVM_INCLUDE"
1692    echo "  PVM LIBS ........... = $PVM_LIB"
1693 else
1694    echo "Not using PVM"
1695 fi
1696
1697 echo ""
1698 if test $FFTW_ENABLE = yes;  then
1699    echo "FFTW Configuration:"
1700    echo "  FFTW LIBS .......... = $FFTW3_LIB"
1701    echo "  FFTW CFLAGS ........ = $FFTW3_CFLAGS"
1702 else
1703    echo "Not using FFTW"
1704 fi
1705
1706 echo ""
1707 if test $MATIO_ENABLE = yes;  then
1708    echo "MATIO Configuration:"
1709    echo "  MATIO LIBS .......... = $MATIO_LIBS"
1710    echo "  MATIO CFLAGS ........ = $MATIO_CFLAGS"
1711 else
1712    echo "Not using MATIO"
1713 fi
1714
1715 echo ""
1716 if test $UMFPACK_ENABLE = yes;  then
1717    echo "UMFPACK Configuration:"
1718    echo "  UMFPACK LIBS ....... = $UMFPACK_LIB"
1719    echo "  UMFPACK CFLAGS ..... = $UMFPACK_CFLAGS"
1720    if test $SUITESPARSE = yes; then
1721       echo "  UMFPACK SUITESPARSE  = Yes"
1722    else
1723       echo "  UMFPACK SUITESPARSE  = No"
1724    fi
1725 else
1726    echo "Not using UMFPACK"
1727 fi
1728
1729
1730 echo ""
1731 echo "BLAS/LAPACK/ATLAS Configuration:"
1732 echo "  BLAS LIBS ............. = $BLAS_LIBS"
1733 echo "  BLAS TYPE ............. = $BLAS_TYPE"
1734 echo "  LAPACK LIBS ........... = $LAPACK_LIBS"
1735 echo "  LAPACK TYPE ........... = $LAPACK_TYPE"
1736
1737 echo ""
1738
1739 #if test "$with_mpi" = yes; then
1740 #   echo "MPI Configuration:"
1741 #   echo "  MPI LIBS ........... = $MPILIBS"
1742 #   echo "  MPI C Compiler ..... = $MPICC"
1743 #   echo "  MPI C++ Compiler ... = $MPICXX"
1744 #   echo "  MPI F77 Compiler ... = $MPIF77"
1745 #else
1746 #   echo "Not using MPI"
1747 #fi
1748
1749 if test "$with_openmpi" != "no"; then
1750    echo "OpenMPI Configuration:"
1751    echo "OpenMPI LIBS ........... = $OPENMPI_LIBS"
1752    echo "OpenMPI C Compiler ..... = $OPENMPI_CC"
1753    echo "OpenMPI F77 Compiler ... = $MPIF77"
1754 else
1755    echo "Not using MPI"
1756 fi
1757
1758 echo ""
1759 if test $BUILD_LOCALIZATION_ENABLE != no; then
1760    echo "Gettext/localization configuration:"
1761    echo "  xgettext ............... = $XGETTEXT"
1762    echo "  msgfmt  ................ = $MSGFMT"
1763    echo "  msgfmt_opts ............ = $MSGFMT_OPTS"
1764    echo "  msgcat  ................ = $MSGCAT"
1765 else
1766    echo "Won't generate localization files"
1767 fi
1768
1769 echo ""
1770 if test $HELP_ENABLE = yes; then
1771    echo "Documentation building configuration:"
1772    echo "  Docbook XSL path ....... = $DOCBOOK_ROOT"
1773    echo "  Batik (SVG) ............ = $BATIK"
1774    echo "  Saxon XSLT ............. = $SAXON"
1775    echo "  FOP (XML => PDF) ....... = $FOP"
1776    echo "  Jeuclid (MathML) ....... = $JEUCLID_CORE"
1777    echo "  Commons I/O ............ = $COMMONS_IO"
1778    echo "  XML graphics commons ... = $XMLGRAPHICS_COMMONS"
1779    echo "  XML commons external ... = $XML_APIS_EXT"
1780 else
1781    echo "No documentation generated"
1782 fi
1783
1784 echo ""
1785 echo "Java Configuration:"
1786 if test ! -z "$JAVAC"; then
1787 echo "  JAVA_HOME ........... = $JAVA_HOME"
1788 echo "  JAVAC ............... = $JAVAC"
1789 echo "  JAVA_CLASSPATH ...... = $JAVA_CLASSPATH"
1790 echo "  JAVA_VERSION ........ = $JAVA_VERSION"
1791 echo "  JAVAC_FLAGS ......... = $JAVAC_FLAGS"
1792 echo "  JAVA_JNI_INCLUDE .... = $JAVA_JNI_INCLUDE"
1793 echo "  JAVA_JNI_LIBS ....... = $JAVA_JNI_LIBS"
1794 echo "  JAVA_JNI_LIBS_PRELOAD = $JAVA_JNI_LIBS_PRELOAD"
1795 echo "  JAVA ................ = $JAVA"
1796 echo "  JAR ................. = $JAR"
1797 echo "  ANT ................. = $ANT"
1798 else
1799 echo "  JAVA disabled"
1800 fi
1801
1802
1803 echo ""
1804 echo "Java dependencies:"
1805 if test ! -z "$JAVAC"; then
1806 echo "  Flexdock ............ = $FLEXDOCK"
1807 echo "  JOGL ................ = $JOGL"
1808 echo "  JOGL LIBS (JNI) ..... = $JOGL_LIBS"
1809 echo "  Gluegen ............. = $GLUEGEN_RT"
1810 echo "  Gluegen LIBS (JNI) .. = $GLUEGEN_RT_LIBS"
1811 echo "  Jhall  .............. = $JHALL"
1812 echo "  Jrosetta (API) ...... = $JROSETTA_API"
1813 echo "  Jrosetta (Engine) ... = $JROSETTA_ENGINE"
1814 echo "  Commons Logging ..... = $COMMONS_LOGGING"
1815 echo "  JGraph X ............ = $JGRAPHX"
1816 fi
1817
1818 echo ""
1819 echo "Code quality (optional):"
1820 echo "  Checkstyle .......... = $CHECKSTYLE"
1821 echo "  Commons-beanutils ... = $COMMONS_BEANUTILS"
1822 echo "  Antlr ............... = $ANTLR"
1823 echo "  splint .............. = $SPLINT"
1824
1825 echo "" 
1826 echo "TCL/TK configuration:"
1827 echo "  TK_INC_PATH ........ = $TK_INC_PATH"
1828 echo "  TCL_INC_PATH ....... = $TCL_INC_PATH"
1829 echo "  TCLTK_LIBS ......... = $TCLTK_LIBS"
1830 echo "  TCL_SERIAL_VERSION . = $TCL_SERIAL_VERSION"
1831 echo "  TK_SERIAL_VERSION .. = $TK_SERIAL_VERSION"
1832
1833 echo "" 
1834 echo "XML configuration:"
1835 echo "  XML_FLAGS .......... = $XML_FLAGS"
1836 echo "  XML_LIBS ........... = $XML_LIBS"
1837 echo "  XML_VERSION ........ = $XML_VERSION"
1838
1839 echo "" 
1840 if test $HDF5_ENABLE = yes;  then
1841    echo "HDF5 configuration:"
1842    echo "  HDF5 CFLAGS ......... = $HDF5_CFLAGS"
1843    echo "  HDF5 LIBS ........... = $HDF5_LIBS"
1844    echo "  HDF5 Java ........... = $JHDF5"
1845    echo "  JHDF5 LIBS (JNI) .... = $JHDF5_LIBS"
1846 else
1847    echo "Not using HDF5"
1848 fi
1849
1850 echo "" 
1851 echo "PCRE configuration:"
1852 echo "  PCRE_CFLAGS ........ = $PCRE_CFLAGS"
1853 echo "  PCRE_LIBS .......... = $PCRE_LIBS"
1854 echo "  PCRE_VERSION ....... = $PCRE_VERSION"
1855
1856
1857 echo ""
1858 echo "SWIG Configuration:"
1859 if test ! -z "$SWIG_BIN"; then
1860 echo "  SWIG_BIN ........... = $SWIG_BIN"
1861 echo "  SWIG_JAVA .......... = $SWIG_JAVA"
1862 else
1863 echo "  SWIG generation disabled"
1864 fi
1865
1866 echo ""
1867 echo "GIWS Configuration:"
1868 if test ! -z "$GIWS_BIN"; then
1869 echo "  GIWS_BIN ........... = $GIWS_BIN"
1870 else
1871 echo "  GIWS generation disabled"
1872 fi
1873
1874 echo ""
1875 echo "Libtool config:"
1876 echo "  objext .............. = $objext"
1877 echo "  libext (static) ..... = $libext"
1878 echo "  shrext_cmds ......... = $shrext_cmds"
1879 echo "  exeext .............. = $exeext"
1880
1881 echo ""
1882
1883 echo "Compilation paths:"
1884 echo "  srcdir .............. = $SCI_SRCDIR"
1885 echo "  srcdir_full ......... = $SCI_SRCDIR_FULL"
1886 echo "  builddir ............ = $SCI_BUILDDIR"
1887 if test "$SCI_SRCDIR_FULL" != "$SCI_BUILDDIR"; then
1888 echo "  VPATH build ......... = Activated"
1889 fi
1890
1891 echo "" 
1892 echo "Platform informations:"
1893 echo "  host ........... = $host"
1894 echo "  host_cpu ....... = $host_cpu"
1895 echo "  host_vendor .... = $host_vendor"
1896 echo "  host_os ... .... = $host_os"
1897 echo "  hostname ....... = $ac_hostname"
1898 echo "  CPU 64 bits .... = $IS_64_BITS_CPU"
1899
1900 echo ""
1901 echo "Options used to compile and link:"
1902 echo "  prefix ......... = $prefix"
1903 echo "  localedir ...... = $localedir"
1904 echo "  VERSION ........ = $PACKAGE_VERSION"
1905 echo "  CC ............. = $CC"
1906 echo "  CFLAGS ......... = $CFLAGS"
1907 echo "  PCFLAGS ........ = $PCFLAGS"
1908 echo "  DEFS ........... = $DEFS"
1909 echo "  LD ............. = $LD"
1910 echo "  LDFLAGS ........ = $LDFLAGS"
1911 echo "  LIBS ........... = $LIBS"
1912 echo "  CXX ............ = $CXX"
1913 echo "  CXXFLAGS ....... = $CXXFLAGS"
1914 echo "  F77 ............ = $F77"
1915 echo "  FFLAGS ......... = $FFLAGS"
1916 echo "  F77_LDFLAGS .... = $F77_LDFLAGS"
1917 echo "  TERMCAP_LIB .... = $TERMCAP_LIB"
1918 echo ""