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