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