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