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