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