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