# HG changeset patch # User John W. Eaton # Date 1253036919 14400 # Node ID 4531741e523623eede3686700b876689057413ad # Parent 080e11f1b0c1cc9291eb0f6c5743afa91cc77fea configure tweaks diff -r 080e11f1b0c1 -r 4531741e5236 ChangeLog --- a/ChangeLog Tue Sep 15 17:17:13 2009 +0200 +++ b/ChangeLog Tue Sep 15 13:48:39 2009 -0400 @@ -1,3 +1,18 @@ +2009-09-15 John W. Eaton + + * configure.ac: Rename from configure.in. + (AC_CONFIG_FILES): Add m4/Makefile to the list. + * acx_blas.m4, acx_lapack.m4, acx_blas_f77_func.m4, + acx_pthread.m4: Move to m4 subdirectory. + * m4/Makefile.in: New file. + * octMakefile.in (M4_FILES): Adjust for new m4 subdirectory. + Rename all instances of configure.in to configure.ac. + (CONF_DISTSUBDIRS, DISTSUBDIRS): Add m4 to the lists. + + * configure.in: Substitute ac_config_headers. + * octMakefile.in (CONFIG_FILES): Include @ac_config_headers@ in + the list. From Thorsten Meyer . + 2009-09-04 John W. Eaton * Makeconf.in (SPARSE_CPPFLAGS, SPARSE_LDFLAGS, FFTW_CPPFLAGS, diff -r 080e11f1b0c1 -r 4531741e5236 aclocal.m4 --- a/aclocal.m4 Tue Sep 15 17:17:13 2009 +0200 +++ b/aclocal.m4 Tue Sep 15 13:48:39 2009 -0400 @@ -1741,5 +1741,11 @@ fi[]dnl ])# PKG_CHECK_MODULES -############################################################################## -############################################################################## +dnl +dnl External macros. +dnl + +m4_include([m4/acx_pthread.m4]) +m4_include([m4/acx_blas.m4]) +m4_include([m4/acx_blas_f77_func.m4]) +m4_include([m4/acx_lapack.m4]) diff -r 080e11f1b0c1 -r 4531741e5236 acx_blas.m4 --- a/acx_blas.m4 Tue Sep 15 17:17:13 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,169 +0,0 @@ -dnl @synopsis ACX_BLAS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -dnl -dnl This macro looks for a library that implements the BLAS -dnl linear-algebra interface (see http://www.netlib.org/blas/). -dnl On success, it sets the BLAS_LIBS output variable to -dnl hold the requisite library linkages. -dnl -dnl To link with BLAS, you should link with: -dnl -dnl $BLAS_LIBS $LIBS $FLIBS -dnl -dnl in that order. FLIBS is the output variable of the -dnl AC_F77_LIBRARY_LDFLAGS macro (called if necessary by ACX_BLAS), -dnl and is sometimes necessary in order to link with F77 libraries. -dnl Users will also need to use AC_F77_DUMMY_MAIN (see the autoconf -dnl manual), for the same reason. -dnl -dnl Many libraries are searched for, from ATLAS to CXML to ESSL. -dnl The user may also use --with-blas= in order to use some -dnl specific BLAS library . In order to link successfully, -dnl however, be aware that you will probably need to use the same -dnl Fortran compiler (which can be set via the F77 env. var.) as -dnl was used to compile the BLAS library. -dnl -dnl ACTION-IF-FOUND is a list of shell commands to run if a BLAS -dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands -dnl to run it if it is not found. If ACTION-IF-FOUND is not specified, -dnl the default action will define HAVE_BLAS. -dnl -dnl This macro requires autoconf 2.50 or later. -dnl -dnl @version $Id: acx_blas.m4,v 1.2 2001/12/13 01:03:06 simons Exp $ -dnl @author Steven G. Johnson -dnl -AC_DEFUN([ACX_BLAS], [ -AC_PREREQ(2.50) -AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) -acx_blas_ok=no - -AC_ARG_WITH(blas, - [AS_HELP_STRING([--with-blas=], [use BLAS library ])]) -case $with_blas in - yes | "") ;; - no) acx_blas_ok=disable ;; - -* | */* | *.a | *.so | *.so.* | *.o) BLAS_LIBS="$with_blas" ;; - *) BLAS_LIBS="-l$with_blas" ;; -esac - -# Get fortran linker names of BLAS functions to check for. -if $have_fortran_compiler; then - AC_F77_FUNC(sgemm) - AC_F77_FUNC(dgemm) -elif $have_f2c; then - sgemm=sgemm_ - dgemm=dgemm_ -fi - -acx_blas_save_LIBS="$LIBS" -LIBS="$LIBS $FLIBS" - -# First, check BLAS_LIBS environment variable -if test $acx_blas_ok = no; then -if test "x$BLAS_LIBS" != x; then - save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" - AC_MSG_CHECKING([for $sgemm in $BLAS_LIBS]) - AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], - [acx_blas_ok=yes], [BLAS_LIBS=""]) - AC_MSG_RESULT($acx_blas_ok) - LIBS="$save_LIBS" -fi -fi - -# BLAS linked to by default? (happens on some supercomputers) -if test $acx_blas_ok = no; then - save_LIBS="$LIBS"; LIBS="$LIBS" - AC_CHECK_FUNC($sgemm, [acx_blas_ok=yes]) - LIBS="$save_LIBS" -fi - -# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) -if test $acx_blas_ok = no; then - AC_CHECK_LIB(atlas, ATL_xerbla, - [AC_CHECK_LIB(f77blas, $sgemm, - [AC_CHECK_LIB(cblas, cblas_dgemm, - [acx_blas_ok=yes - BLAS_LIBS="-lcblas -lf77blas -latlas"], - [], [-lf77blas -latlas])], - [], [-latlas])]) -fi - -# BLAS in Apple vecLib framework? (Mac OS X) -if test $acx_blas_ok = no; then - vlib_flags="-Wl,-framework -Wl,vecLib" - save_LIBS="$LIBS"; LIBS="$vlib_flags $LIBS" - AC_MSG_CHECKING([for $sgemm in $vlib_flags]) - AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], - [acx_blas_ok=yes; BLAS_LIBS="$vlib_flags"], - [BLAS_LIBS=""]) - AC_MSG_RESULT($acx_blas_ok) - LIBS="$save_LIBS" -fi - -# BLAS in PhiPACK libraries? (requires generic BLAS lib, too) -if test $acx_blas_ok = no; then - AC_CHECK_LIB(blas, $sgemm, - [AC_CHECK_LIB(dgemm, $dgemm, - [AC_CHECK_LIB(sgemm, $sgemm, - [acx_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"], - [], [-lblas])], - [], [-lblas])]) -fi - -# BLAS in Alpha CXML library? -if test $acx_blas_ok = no; then - AC_CHECK_LIB(cxml, $sgemm, [acx_blas_ok=yes;BLAS_LIBS="-lcxml"]) -fi - -# BLAS in Alpha DXML library? (now called CXML, see above) -if test $acx_blas_ok = no; then - AC_CHECK_LIB(dxml, $sgemm, [acx_blas_ok=yes;BLAS_LIBS="-ldxml"]) -fi - -# BLAS in Sun Performance library? -if test $acx_blas_ok = no; then - if test "x$GCC" != xyes; then # only works with Sun CC - AC_CHECK_LIB(sunmath, acosp, - [AC_CHECK_LIB(sunperf, $sgemm, - [BLAS_LIBS="-lsunperf -lsunmath" - acx_blas_ok=yes],[],[-lsunmath])]) - fi -fi - -# BLAS in SCSL library? (SGI/Cray Scientific Library) -if test $acx_blas_ok = no; then - AC_CHECK_LIB(scs, $sgemm, [acx_blas_ok=yes; BLAS_LIBS="-lscs"]) -fi - -# BLAS in SGIMATH library? -if test $acx_blas_ok = no; then - AC_CHECK_LIB(complib.sgimath, $sgemm, - [acx_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"]) -fi - -# BLAS in IBM ESSL library? (requires generic BLAS lib, too) -if test $acx_blas_ok = no; then - AC_CHECK_LIB(blas, $sgemm, - [AC_CHECK_LIB(essl, $sgemm, - [acx_blas_ok=yes; BLAS_LIBS="-lessl -lblas"], - [], [-lblas $FLIBS])]) -fi - -# Generic BLAS library? -if test $acx_blas_ok = no; then - AC_CHECK_LIB(blas, $sgemm, [acx_blas_ok=yes; BLAS_LIBS="-lblas"]) -fi - -AC_SUBST(BLAS_LIBS) - -LIBS="$acx_blas_save_LIBS" - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$acx_blas_ok" = xyes; then - ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1]) - : -else - acx_blas_ok=no - $2 -fi -])dnl ACX_BLAS diff -r 080e11f1b0c1 -r 4531741e5236 acx_blas_f77_func.m4 --- a/acx_blas_f77_func.m4 Tue Sep 15 17:17:13 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,205 +0,0 @@ -# =========================================================================== -# http://autoconf-archive.cryp.to/acx_blas_f77_func.html -# =========================================================================== -# -# SYNOPSIS -# -# ACX_BLAS_F77_FUNC([ACTION-IF-PASS[, ACTION-IF-FAIL[, ACTION-IF-CROSS-COMPILING]]) -# ACX_BLAS_WITH_F77_FUNC([ACTION-IF-FOUND-AND-PASS[, ACTION-IF-NOT-FOUND-OR-FAIL]]) -# -# DESCRIPTION -# -# These macros are intended as a supplement to the ACX_BLAS macro, to -# verify that BLAS functions are properly callable from Fortran. This is -# necessary, for example, if you want to build the LAPACK library on top -# of the BLAS. -# -# ACX_BLAS_F77_FUNC uses the defined BLAS_LIBS and Fortran environment to -# check for compatibility, and takes a specific action in case of success, -# resp. failure, resp. cross-compilation. -# -# ACX_BLAS_WITH_F77_FUNC is a drop-in replacement wrapper for ACX_BLAS -# that calls ACX_BLAS_F77_FUNC after detecting a BLAS library and rejects -# it on failure (i.e. pretends that no library was found). -# -# LAST MODIFICATION -# -# 2008-06-18 -# -# COPYLEFT -# -# Copyright (c) 2008 Jaroslav Hajek -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Macro Archive. When you make and -# distribute a modified version of the Autoconf Macro, you may extend this -# special exception to the GPL to apply to your modified version as well. - -AC_DEFUN([ACX_BLAS_F77_FUNC], [ -AC_PREREQ(2.50) -AC_REQUIRE([ACX_BLAS]) - -# F77 call-compatibility checks -if test "$cross_compiling" = yes ; then - ifelse($3, ,$1,$3) -elif test x"$acx_blas_ok" = xyes; then - save_acx_blas_f77_func_LIBS="$LIBS" - LIBS="$BLAS_LIBS $LIBS" - AC_LANG_PUSH(Fortran 77) -# LSAME check (LOGICAL return values) - AC_MSG_CHECKING([whether LSAME is called correctly from Fortran]) - AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ - logical lsame,w - external lsame - character c1,c2 - c1 = 'A' - c2 = 'B' - w = lsame(c1,c2) - if (w) stop 1 - w = lsame(c1,c1) - if (.not. w) stop 1 - ]]),[acx_blas_lsame_fcall_ok=yes], - [acx_blas_lsame_fcall_ok=no]) - AC_MSG_RESULT([$acx_blas_lsame_fcall_ok]) -# ISAMAX check (INTEGER return values) - AC_MSG_CHECKING([whether ISAMAX is called correctly from Fortran]) - AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ - integer isamax,i - external isamax - real a(2) - a(1) = 1e0 - a(2) = -2e0 - i = isamax(2,a,1) - if (i.ne.2) stop 1 - ]]),[acx_blas_isamax_fcall_ok=yes], - [acx_blas_isamax_fcall_ok=no]) - AC_MSG_RESULT([$acx_blas_isamax_fcall_ok]) -# SDOT check (REAL return values) - AC_MSG_CHECKING([whether SDOT is called correctly from Fortran]) - AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ - real sdot,a(1),b(1),w - external sdot - a(1) = 1e0 - b(1) = 2e0 - w = sdot(1,a,1,b,1) - if (w .ne. a(1)*b(1)) stop 1 - ]]),[acx_blas_sdot_fcall_ok=yes], - [acx_blas_sdot_fcall_ok=no]) - AC_MSG_RESULT([$acx_blas_sdot_fcall_ok]) -# DDOT check (DOUBLE return values) - AC_MSG_CHECKING([whether DDOT is called correctly from Fortran]) - AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ - double precision ddot,a(1),b(1),w - external ddot - a(1) = 1d0 - b(1) = 2d0 - w = ddot(1,a,1,b,1) - if (w .ne. a(1)*b(1)) stop 1 - ]]),[acx_blas_ddot_fcall_ok=yes], - [acx_blas_ddot_fcall_ok=no]) - AC_MSG_RESULT([$acx_blas_ddot_fcall_ok]) -# CDOTU check (COMPLEX return values) - AC_MSG_CHECKING([whether CDOTU is called correctly from Fortran]) - AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ - complex cdotu,a(1),b(1),w - external cdotu - a(1) = cmplx(1e0,1e0) - b(1) = cmplx(1e0,2e0) - w = cdotu(1,a,1,b,1) - if (w .ne. a(1)*b(1)) stop 1 - ]]),[acx_blas_cdotu_fcall_ok=yes], - [acx_blas_cdotu_fcall_ok=no]) - AC_MSG_RESULT([$acx_blas_cdotu_fcall_ok]) -# ZDOTU check (DOUBLE COMPLEX return values) - AC_MSG_CHECKING([whether ZDOTU is called correctly from Fortran]) - AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ - double complex zdotu,a(1),b(1),w - external zdotu - a(1) = dcmplx(1d0,1d0) - b(1) = dcmplx(1d0,2d0) - w = zdotu(1,a,1,b,1) - if (w .ne. a(1)*b(1)) stop 1 - ]]),[acx_blas_zdotu_fcall_ok=yes], - [acx_blas_zdotu_fcall_ok=no]) - AC_MSG_RESULT([$acx_blas_zdotu_fcall_ok]) -# Check for correct integer size -# FIXME: this may fail with things like -ftrapping-math. - AC_MSG_CHECKING([whether the integer size is correct]) - AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ - integer n,nn(3) - real s,a(1),b(1),sdot - a(1) = 1.0 - b(1) = 1.0 -c Generate -2**33 + 1, if possible - n = 2 - n = -4 * (n ** 30) - n = n + 1 - if (n >= 0) goto 1 -c This means we're on 64-bit integers. Check whether the BLAS is, too. - s = sdot(n,a,1,b,1) - if (s .ne. 0.0) stop 1 - 1 continue -c We may be on 32-bit integers, and the BLAS on 64 bits. This is almost bound -c to have already failed, but just in case, we'll check. - nn(1) = -1 - nn(2) = 1 - nn(3) = -1 - s = sdot(nn(2),a,1,b,1) - if (s .ne. 1.0) stop 1 - ]]),[acx_blas_integer_size_ok=yes], - [acx_blas_integer_size_ok=no]) - AC_MSG_RESULT([$acx_blas_integer_size_ok]) - - AC_LANG_POP(Fortran 77) - -# if any of the tests failed, reject the BLAS library - if test $acx_blas_lsame_fcall_ok = yes \ - -a $acx_blas_sdot_fcall_ok = yes \ - -a $acx_blas_ddot_fcall_ok = yes \ - -a $acx_blas_cdotu_fcall_ok = yes \ - -a $acx_blas_zdotu_fcall_ok = yes \ - -a $acx_blas_integer_size_ok = yes; then - acx_blas_f77_func_ok=yes; - $1 - else - acx_blas_f77_func_ok=no; - $2 - fi - LIBS="$save_acx_blas_f77_func_LIBS" -fi - -])dnl ACX_BLAS_F77_FUNC - -AC_DEFUN([ACX_BLAS_WITH_F77_FUNC], [ -AC_PREREQ(2.50) -ACX_BLAS([# disable special action], []) -if test x$acx_blas_ok = xyes ; then - ACX_BLAS_F77_FUNC( - [ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1])], - [acx_blas_ok=no; BLAS_LIBS=]) -fi -if test x$acx_blas_ok = xno ; then - $2 -fi -])dnl ACX_BLAS_WITH_F77_FUNC diff -r 080e11f1b0c1 -r 4531741e5236 acx_lapack.m4 --- a/acx_lapack.m4 Tue Sep 15 17:17:13 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,132 +0,0 @@ -# =========================================================================== -# http://autoconf-archive.cryp.to/acx_lapack.html -# =========================================================================== -# -# SYNOPSIS -# -# ACX_LAPACK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# This macro looks for a library that implements the LAPACK linear-algebra -# interface (see http://www.netlib.org/lapack/). On success, it sets the -# LAPACK_LIBS output variable to hold the requisite library linkages. -# -# To link with LAPACK, you should link with: -# -# $LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS -# -# in that order. BLAS_LIBS is the output variable of the ACX_BLAS macro, -# called automatically. FLIBS is the output variable of the -# AC_F77_LIBRARY_LDFLAGS macro (called if necessary by ACX_BLAS), and is -# sometimes necessary in order to link with F77 libraries. Users will also -# need to use AC_F77_DUMMY_MAIN (see the autoconf manual), for the same -# reason. -# -# The user may also use --with-lapack= in order to use some specific -# LAPACK library . In order to link successfully, however, be aware -# that you will probably need to use the same Fortran compiler (which can -# be set via the F77 env. var.) as was used to compile the LAPACK and BLAS -# libraries. -# -# ACTION-IF-FOUND is a list of shell commands to run if a LAPACK library -# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it -# is not found. If ACTION-IF-FOUND is not specified, the default action -# will define HAVE_LAPACK. -# -# LAST MODIFICATION -# -# 2008-06-29 -# -# COPYLEFT -# -# Copyright (c) 2008 Steven G. Johnson -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Macro Archive. When you make and -# distribute a modified version of the Autoconf Macro, you may extend this -# special exception to the GPL to apply to your modified version as well. - -AC_DEFUN([ACX_LAPACK], [ -AC_REQUIRE([ACX_BLAS]) -acx_lapack_ok=no - -AC_ARG_WITH(lapack, - [AC_HELP_STRING([--with-lapack=], [use LAPACK library ])]) -case $with_lapack in - yes | "") ;; - no) acx_lapack_ok=disable ;; - -* | */* | *.a | *.so | *.so.* | *.o) LAPACK_LIBS="$with_lapack" ;; - *) LAPACK_LIBS="-l$with_lapack" ;; -esac - -# Get fortran linker name of LAPACK function to check for. -AC_F77_FUNC(cheev) - -# We cannot use LAPACK if BLAS is not found -if test "x$acx_blas_ok" != xyes; then - acx_lapack_ok=noblas - LAPACK_LIBS="" -fi - -# First, check LAPACK_LIBS environment variable -if test "x$LAPACK_LIBS" != x; then - save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS" - AC_MSG_CHECKING([for $cheev in $LAPACK_LIBS]) - AC_TRY_LINK_FUNC($cheev, [acx_lapack_ok=yes], [LAPACK_LIBS=""]) - AC_MSG_RESULT($acx_lapack_ok) - LIBS="$save_LIBS" - if test $acx_lapack_ok = no; then - LAPACK_LIBS="" - fi -fi - -# LAPACK linked to by default? (is sometimes included in BLAS lib) -if test $acx_lapack_ok = no; then - save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS" - AC_CHECK_FUNC($cheev, [acx_lapack_ok=yes]) - LIBS="$save_LIBS" -fi - -# Generic LAPACK library? -for lapack in lapack lapack_rs6k; do - if test $acx_lapack_ok = no; then - save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" - AC_CHECK_LIB($lapack, $cheev, - [acx_lapack_ok=yes; LAPACK_LIBS="-l$lapack"], [], [$FLIBS]) - LIBS="$save_LIBS" - fi -done - -AC_SUBST(LAPACK_LIBS) - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$acx_lapack_ok" = xyes; then - ifelse([$1],,AC_DEFINE(HAVE_LAPACK,1,[Define if you have LAPACK library.]),[$1]) - : -else - acx_lapack_ok=no - $2 -fi -])dnl ACX_LAPACK diff -r 080e11f1b0c1 -r 4531741e5236 acx_pthread.m4 --- a/acx_pthread.m4 Tue Sep 15 17:17:13 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,271 +0,0 @@ -# =========================================================================== -# http://www.nongnu.org/autoconf-archive/acx_pthread.html -# =========================================================================== -# -# SYNOPSIS -# -# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) -# -# DESCRIPTION -# -# This macro figures out how to build C programs using POSIX threads. It -# sets the PTHREAD_LIBS output variable to the threads library and linker -# flags, and the PTHREAD_CFLAGS output variable to any special C compiler -# flags that are needed. (The user can also force certain compiler -# flags/libs to be tested by setting these environment variables.) -# -# Also sets PTHREAD_CC to any special C compiler that is needed for -# multi-threaded programs (defaults to the value of CC otherwise). (This -# is necessary on AIX to use the special cc_r compiler alias.) -# -# NOTE: You are assumed to not only compile your program with these flags, -# but also link it with them as well. e.g. you should link with -# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS -# -# If you are only building threads programs, you may wish to use these -# variables in your default LIBS, CFLAGS, and CC: -# -# LIBS="$PTHREAD_LIBS $LIBS" -# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" -# CC="$PTHREAD_CC" -# -# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant -# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name -# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). -# -# ACTION-IF-FOUND is a list of shell commands to run if a threads library -# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it -# is not found. If ACTION-IF-FOUND is not specified, the default action -# will define HAVE_PTHREAD. -# -# Please let the authors know if this macro fails on any platform, or if -# you have any other suggestions or comments. This macro was based on work -# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help -# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by -# Alejandro Forero Cuervo to the autoconf macro repository. We are also -# grateful for the helpful feedback of numerous users. -# -# LICENSE -# -# Copyright (c) 2008 Steven G. Johnson -# -# This program is free software: you can redistribute it and/or modify it -# under the terms of the GNU General Public License as published by the -# Free Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# This program is distributed in the hope that it will be useful, but -# WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General -# Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program. If not, see . -# -# As a special exception, the respective Autoconf Macro's copyright owner -# gives unlimited permission to copy, distribute and modify the configure -# scripts that are the output of Autoconf when processing the Macro. You -# need not follow the terms of the GNU General Public License when using -# or distributing such scripts, even though portions of the text of the -# Macro appear in them. The GNU General Public License (GPL) does govern -# all other use of the material that constitutes the Autoconf Macro. -# -# This special exception to the GPL applies to versions of the Autoconf -# Macro released by the Autoconf Archive. When you make and distribute a -# modified version of the Autoconf Macro, you may extend this special -# exception to the GPL to apply to your modified version as well. - -AC_DEFUN([ACX_PTHREAD], [ -AC_REQUIRE([AC_CANONICAL_HOST]) -AC_LANG_SAVE -AC_LANG_C -acx_pthread_ok=no - -# We used to check for pthread.h first, but this fails if pthread.h -# requires special compiler flags (e.g. on True64 or Sequent). -# It gets checked for in the link test anyway. - -# First of all, check if the user has set any of the PTHREAD_LIBS, -# etcetera environment variables, and if threads linking works using -# them: -if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) - AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) - AC_MSG_RESULT($acx_pthread_ok) - if test x"$acx_pthread_ok" = xno; then - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" - fi - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" -fi - -# We must check for the threads library under a number of different -# names; the ordering is very important because some systems -# (e.g. DEC) have both -lpthread and -lpthreads, where one of the -# libraries is broken (non-POSIX). - -# Create a list of thread flags to try. Items starting with a "-" are -# C compiler flags, and other items are library names, except for "none" -# which indicates that we try without any flags at all, and "pthread-config" -# which is a program returning the flags for the Pth emulation library. - -acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" - -# The ordering *is* (sometimes) important. Some notes on the -# individual items follow: - -# pthreads: AIX (must check this before -lpthread) -# none: in case threads are in libc; should be tried before -Kthread and -# other compiler flags to prevent continual compiler warnings -# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) -# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) -# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) -# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) -# -pthreads: Solaris/gcc -# -mthreads: Mingw32/gcc, Lynx/gcc -# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it -# doesn't hurt to check since this sometimes defines pthreads too; -# also defines -D_REENTRANT) -# ... -mt is also the pthreads flag for HP/aCC -# pthread: Linux, etcetera -# --thread-safe: KAI C++ -# pthread-config: use pthread-config program (for GNU Pth library) - -case "${host_cpu}-${host_os}" in - *solaris*) - - # On Solaris (at least, for some versions), libc contains stubbed - # (non-functional) versions of the pthreads routines, so link-based - # tests will erroneously succeed. (We need to link with -pthreads/-mt/ - # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather - # a function called by this macro, so we could check for that, but - # who knows whether they'll stub that too in a future libc.) So, - # we'll just look for -pthreads and -lpthread first: - - acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" - ;; -esac - -if test x"$acx_pthread_ok" = xno; then -for flag in $acx_pthread_flags; do - - case $flag in - none) - AC_MSG_CHECKING([whether pthreads work without any flags]) - ;; - - -*) - AC_MSG_CHECKING([whether pthreads work with $flag]) - PTHREAD_CFLAGS="$flag" - ;; - - pthread-config) - AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) - if test x"$acx_pthread_config" = xno; then continue; fi - PTHREAD_CFLAGS="`pthread-config --cflags`" - PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" - ;; - - *) - AC_MSG_CHECKING([for the pthreads library -l$flag]) - PTHREAD_LIBS="-l$flag" - ;; - esac - - save_LIBS="$LIBS" - save_CFLAGS="$CFLAGS" - LIBS="$PTHREAD_LIBS $LIBS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - - # Check for various functions. We must include pthread.h, - # since some functions may be macros. (On the Sequent, we - # need a special flag -Kthread to make this header compile.) - # We check for pthread_join because it is in -lpthread on IRIX - # while pthread_create is in libc. We check for pthread_attr_init - # due to DEC craziness with -lpthreads. We check for - # pthread_cleanup_push because it is one of the few pthread - # functions on Solaris that doesn't have a non-functional libc stub. - # We try pthread_create on general principles. - AC_TRY_LINK([#include ], - [pthread_t th; pthread_join(th, 0); - pthread_attr_init(0); pthread_cleanup_push(0, 0); - pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], - [acx_pthread_ok=yes]) - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - - AC_MSG_RESULT($acx_pthread_ok) - if test "x$acx_pthread_ok" = xyes; then - break; - fi - - PTHREAD_LIBS="" - PTHREAD_CFLAGS="" -done -fi - -# Various other checks: -if test "x$acx_pthread_ok" = xyes; then - save_LIBS="$LIBS" - LIBS="$PTHREAD_LIBS $LIBS" - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS $PTHREAD_CFLAGS" - - # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. - AC_MSG_CHECKING([for joinable pthread attribute]) - attr_name=unknown - for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do - AC_TRY_LINK([#include ], [int attr=$attr; return attr;], - [attr_name=$attr; break]) - done - AC_MSG_RESULT($attr_name) - if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then - AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, - [Define to necessary symbol if this constant - uses a non-standard name on your system.]) - fi - - AC_MSG_CHECKING([if more special flags are required for pthreads]) - flag=no - case "${host_cpu}-${host_os}" in - *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; - *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; - esac - AC_MSG_RESULT(${flag}) - if test "x$flag" != xno; then - PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" - fi - - LIBS="$save_LIBS" - CFLAGS="$save_CFLAGS" - - # More AIX lossage: must compile with xlc_r or cc_r - if test x"$GCC" != xyes; then - AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) - else - PTHREAD_CC=$CC - fi -else - PTHREAD_CC="$CC" -fi - -AC_SUBST(PTHREAD_LIBS) -AC_SUBST(PTHREAD_CFLAGS) -AC_SUBST(PTHREAD_CC) - -# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: -if test x"$acx_pthread_ok" = xyes; then - ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) - : -else - acx_pthread_ok=no - $2 -fi -AC_LANG_RESTORE -])dnl ACX_PTHREAD diff -r 080e11f1b0c1 -r 4531741e5236 autogen.sh --- a/autogen.sh Tue Sep 15 17:17:13 2009 +0200 +++ b/autogen.sh Tue Sep 15 13:48:39 2009 -0400 @@ -22,7 +22,7 @@ exit 1 } -for i in `find . -name configure.in -print`; do ( +for i in `find . -name configure.ac -print`; do ( dir=`dirname $i` cd $dir pwd diff -r 080e11f1b0c1 -r 4531741e5236 configure.ac --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/configure.ac Tue Sep 15 13:48:39 2009 -0400 @@ -0,0 +1,2408 @@ +dnl configure.in +dnl +dnl Process this file with autoconf to produce a configure script. +dnl +dnl Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +dnl 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, +dnl 2009 John W. Eaton +### +### This file is part of Octave. +### +### Octave is free software; you can redistribute it and/or modify it +### under the terms of the GNU General Public License as published by the +### Free Software Foundation; either version 3 of the License, or (at +### your option) any later version. +### +### Octave is distributed in the hope that it will be useful, but WITHOUT +### ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +### FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +### for more details. +### +### You should have received a copy of the GNU General Public License +### along with Octave; see the file COPYING. If not, see +### . + +### Preserve CFLAGS and CXXFLAGS from the environment before doing +### anything else because we don't know which macros might call +### AC_PROG_CC or AC_PROG_CXX. + +EXTERN_CFLAGS="$CFLAGS" +EXTERN_CXXFLAGS="$CXXFLAGS" + +AC_INIT +AC_REVISION($Revision: 1.603 $) +AC_PREREQ(2.60) +AC_CONFIG_SRCDIR([src/octave.cc]) +AC_CONFIG_HEADER(config.h) + +OCTAVE_HOST_TYPE + +AC_DEFINE(OCTAVE_SOURCE, 1, [Define if this is Octave.]) + +dnl FIXME -- we should probably only generate this file if it is missing. +### Produce unistd.h for MSVC target, this simplifies changes in +### Octave source tree and avoid problems with lex-generated code. +case "$canonical_host_type" in + *-*-msdosmsvc) + AC_MSG_NOTICE([Generating replacement for for MSVC]) + cat << \EOF > unistd.h +/* File generated by configure script. */ +#include +#include +#include +EOF + CPPFLAGS="-I. $CPPFLAGS" + ;; +esac + +AC_USE_SYSTEM_EXTENSIONS + +### Path separator. +sepchar=: +AC_ARG_WITH(sepchar, + [AS_HELP_STRING([--with-sepchar=], + [use as the path separation character])]) +case $with_sepchar in + yes | "") + case "$canonical_host_type" in + *-*-mingw* | *-*-msdosmsvc) + sepchar=';' + ;; + esac + ;; + no) + AC_MSG_ERROR([You are required to define a path separation character]) + ;; + *) + sepchar=$with_sepchar + ;; +esac +AC_SUBST(sepchar) +AC_DEFINE_UNQUOTED(SEPCHAR, ['$sepchar'], [Define this to be the path separator for your system, as a character constant.]) +AC_DEFINE_UNQUOTED(SEPCHAR_STR, ["$sepchar"], [Define this to the path separator, as a string.]) + +### some defaults + +OCTAVE_SET_DEFAULT(man1dir, '$(mandir)/man1') +OCTAVE_SET_DEFAULT(man1ext, '.1') +OCTAVE_SET_DEFAULT(doc_cache_file, '$(octetcdir)/doc-cache') +OCTAVE_SET_DEFAULT(infofile, '$(infodir)/octave.info') +OCTAVE_SET_DEFAULT(octincludedir, '$(includedir)/octave-$(version)') +OCTAVE_SET_DEFAULT(fcnfiledir, '$(datadir)/octave/$(version)/m') +OCTAVE_SET_DEFAULT(localfcnfiledir, '$(datadir)/octave/site/m') +OCTAVE_SET_DEFAULT(localapifcnfiledir, + '$(datadir)/octave/site/$(api_version)/m') +OCTAVE_SET_DEFAULT(localverfcnfiledir, '$(datadir)/octave/$(version)/site/m') +OCTAVE_SET_DEFAULT(octetcdir, '$(datadir)/octave/$(version)/etc') +OCTAVE_SET_DEFAULT(octlibdir, '$(libdir)/octave-$(version)') +OCTAVE_SET_DEFAULT(archlibdir, + '$(libexecdir)/octave/$(version)/exec/$(canonical_host_type)') +OCTAVE_SET_DEFAULT(localarchlibdir, + '$(libexecdir)/octave/site/exec/$(canonical_host_type)') +OCTAVE_SET_DEFAULT(localapiarchlibdir, + '$(libexecdir)/octave/$(api_version)/site/exec/$(canonical_host_type)') +OCTAVE_SET_DEFAULT(localverarchlibdir, + '$(libexecdir)/octave/$(version)/site/exec/$(canonical_host_type)') +OCTAVE_SET_DEFAULT(octfiledir, + '$(libexecdir)/octave/$(version)/oct/$(canonical_host_type)') +OCTAVE_SET_DEFAULT(localoctfiledir, + '$(libexecdir)/octave/site/oct/$(canonical_host_type)') +OCTAVE_SET_DEFAULT(localapioctfiledir, + '$(libexecdir)/octave/site/oct/$(api_version)/$(canonical_host_type)') +OCTAVE_SET_DEFAULT(localveroctfiledir, + '$(libexecdir)/octave/$(version)/site/oct/$(canonical_host_type)') +OCTAVE_SET_DEFAULT(imagedir, '$(datadir)/octave/$(version)/imagelib') + +### Find pkg-config executable (sets $PKG_CONFIG) + +PKG_PROG_PKG_CONFIG + +### Make configure args available for other uses. + +config_opts=$ac_configure_args +AC_SUBST(config_opts) + +### Make it possible to have Octave's array and matrix classes do bounds +### checking on element references. This slows some operations down a +### bit, so it is turned off by default. + +BOUNDS_CHECKING=false +AC_ARG_ENABLE(bounds-check, + [AS_HELP_STRING([--enable-bounds-check], + [bounds checking for indexing in internal array classes (default is no)])], + [if test "$enableval" = yes; then BOUNDS_CHECKING=true; fi], []) +if $BOUNDS_CHECKING; then + AC_DEFINE(BOUNDS_CHECKING, 1, [Define to use internal bounds checking.]) +fi + +### If possible, use a 64-bit integer type for array dimensions and indexing. + +USE_64_BIT_IDX_T=false +OCTAVE_IDX_TYPE=int +AC_ARG_ENABLE(64, + [AS_HELP_STRING([--enable-64], + [(EXPERIMENTAL) use 64-bit integers for array dimensions and indexing])], + [if test "$enableval" = yes; then USE_64_BIT_IDX_T=true; fi], []) +if $USE_64_BIT_IDX_T; then + AC_CHECK_SIZEOF(void *) + AC_CHECK_SIZEOF(int) + AC_CHECK_SIZEOF(long) + if test $ac_cv_sizeof_void_p -eq 8; then + if test $ac_cv_sizeof_int -eq 8; then + OCTAVE_IDX_TYPE=int + elif test $ac_cv_sizeof_long -eq 8; then + OCTAVE_IDX_TYPE=long + AC_DEFINE(IDX_TYPE_LONG, 1, [Define to 1 if octave index type is long]) + else + warn_64_bit="no suitable type found for octave_idx_type so disabling 64-bit features" + AC_MSG_WARN($warn_64_bit) + USE_64_BIT_IDX_T=false + fi + else + warn_64_bit="pointers are not 64-bits wide so disabling 64-bit features" + AC_MSG_WARN($warn_64_bit) + USE_64_BIT_IDX_T=false + fi +fi +AC_SUBST(OCTAVE_IDX_TYPE) +if $USE_64_BIT_IDX_T; then + AC_DEFINE(USE_64_BIT_IDX_T, 1, [Define if using 64-bit integers for array dimensions and indexing]) +fi +AC_SUBST(USE_64_BIT_IDX_T) + +### It seems that there are some broken inline assembly functions in +### the GNU libc. Since I'm not sure how to test whether we are using +### GNU libc, just disable them for all platforms. + +AC_MSG_NOTICE([defining __NO_MATH_INLINES avoids buggy GNU libc exp function]) +AC_DEFINE(__NO_MATH_INLINES, 1, [Define if your version of GNU libc has buggy inline assembly code for math functions like exp.]) + +### See which C++ compiler to use (we expect to find g++). + +AC_PROG_CXX +AC_PROG_CXXCPP + +### Do special things for g++. + +gxx_version=`$CXX -v 2>&1 | grep "^.*g.. version" | \ + sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//' -e 's/ .*//'` + +case "$gxx_version" in + 1.* | 2.[[0123456789]].* | 3.[[01234]].*) + AC_MSG_ERROR([g++ version $gxx_version will probably fail to compile Octave] +) + ;; +esac + +CXX_VERSION= +if test -n "$gxx_version"; then + CXX_VERSION="$gxx_version" +fi +AC_SUBST(CXX_VERSION) + +OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL +OCTAVE_CXX_ISO_COMPLIANT_LIBRARY +OCTAVE_CXX_BROKEN_REINTERPRET_CAST + +### See which C compiler to use (we expect to find gcc). + +AC_PROG_CC +AC_PROG_CPP +AC_PROG_GCC_TRADITIONAL + +### Do special things for gcc. + +gcc_version=`$CC -v 2>&1 | grep "^.*gcc version" | \ + sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//'` +case "$gcc_version" in + 2.*) + if test -z "$LDFLAGS"; then + LDFLAGS="-g" + AC_MSG_NOTICE([defining LDFLAGS to be $LDFLAGS]) + fi + ;; + 1.*) + warn_gcc_version="gcc version $gcc_version is likely to cause problems" + AC_MSG_WARN($warn_gcc_version) + ;; +esac + +CC_VERSION= +if test -n "$gcc_version"; then + CC_VERSION="$gcc_version" +fi +AC_SUBST(CC_VERSION) + +### The flag to create dependency varies depending on the compier. + +# Assume GCC. +INCLUDE_DEPS=true +DEPEND_FLAGS="-M" +DEPEND_EXTRA_SED_PATTERN="" +if test "$GCC" = yes; then + true +else + case "$canonical_host_type" in + sparc-sun-solaris2* | i386-pc-solaris2*) + DEPEND_FLAGS="-xM1" + DEPEND_EXTRA_SED_PATTERN="-e '/\/opt\/SUNWspro/d'" + ;; + *-*-msdosmsvc) + ;; + *) + INCLUDE_DEPS=false + ;; + esac +fi +AC_SUBST(INCLUDE_DEPS) +AC_SUBST(DEPEND_FLAGS) +AC_SUBST(DEPEND_EXTRA_SED_PATTERN) + +ACX_PTHREAD + +AC_PATH_X +if test "$have_x"; then + AC_DEFINE(HAVE_X_WINDOWS, 1, [Define if you have X11]) + + if test "$x_includes" != "NONE"; then + X11_INCFLAGS="$x_includes" + fi + AC_SUBST(X11_INCFLAGS) + + if test -z $x_libraries; then + AC_CHECK_LIB(X11, XrmInitialize, [X11_LIBS=-lX11], [X11_LIBS=]) + elif test $x_libraries != "NONE"; then + AC_CHECK_LIB(X11, XrmInitialize, + [X11_LIBS="-L$x_libraries -lX11"], [X11_LIBS=], "-L$x_libraries") + fi + AC_SUBST(X11_LIBS) +fi + +### On MacOSX system the Carbon framework is used to determine ScreenSize +OCTAVE_HAVE_FRAMEWORK(Carbon, [#include ], [CGMainDisplayID ()], + [have_framework_carbon="yes"], [have_framework_carbon="no"]) +if test $have_framework_carbon = "yes"; then + AC_DEFINE(HAVE_FRAMEWORK_CARBON, 1, [Define if framework CARBON is available.]) + CARBON_LIBS="-Wl,-framework -Wl,Carbon" + AC_MSG_NOTICE([adding -Wl,-framework -Wl,Carbon to CARBON_LIBS]) + AC_SUBST(CARBON_LIBS) +fi + +### When compiling math for x87, problems may arise in some code comparing +### floating-point intermediate results. +### Generally, it helps to store the result in a local volatile variable, +### but it also degrades performance. +### Thus, we provide a FLOAT_TRUNCATE macro that may be defined to "volatile" +### when compiling for x87 target, or left empty for modern SSE math, that +### doesn't suffer from this problem at all. +AC_ARG_ENABLE(float-truncate, + [AS_HELP_STRING([--enable-float-truncate], + [enables truncating intermediate FP results.])], + [if test "$enableval" = yes; then ac_float_truncate=volatile; + else ac_float_truncate=; fi], + ac_float_truncate=) + +AC_DEFINE_UNQUOTED(FLOAT_TRUNCATE, $ac_float_truncate, + [Define to volatile if you need truncating intermediate FP results]) + +### On Intel systems with gcc, we may need to compile with -mieee-fp +### and -ffloat-store to get full support for IEEE floating point. +### +### On Alpha/OSF systems, we need -mieee. + +ieee_fp_flag= +case "$canonical_host_type" in + ## Keep this pattern first, so that it is preferred over the + ## following pattern for x86. + *-*-msdosmsvc) + CXXFLAGS="$CXXFLAGS -EHs -MD" + CFLAGS="$CFLAGS -MD" + ;; + i[[3456789]]86-*-*) + if test "$GCC" = yes; then + OCTAVE_CC_FLAG(-mieee-fp, [ + ieee_fp_flag=-mieee-fp + XTRA_CFLAGS="$XTRA_CFLAGS -mieee-fp" + AC_MSG_NOTICE([adding -mieee-fp to XTRA_CFLAGS])]) + +### OCTAVE_CC_FLAG(-ffloat-store, [ +### float_store_flag=-ffloat-store +### XTRA_CFLAGS="$XTRA_CFLAGS -ffloat-store" +### AC_MSG_RESULT([adding -ffloat-store to XTRA_CFLAGS])]) + fi + if test "$GXX" = yes; then + OCTAVE_CXX_FLAG(-mieee-fp, [ + ieee_fp_flag=-mieee-fp + XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mieee-fp" + AC_MSG_NOTICE([adding -mieee-fp to XTRA_CXXFLAGS])]) + +### OCTAVE_CXX_FLAG(-ffloat-store, [ +### float_store_flag=-ffloat-store +### XTRA_CXXFLAGS="$XTRA_CXXFLAGS -ffloat-store" +### AC_MSG_RESULT([adding -ffloat-store to XTRA_CXXFLAGS])]) + fi + ;; + alpha*-*-*) + if test "$GCC" = yes; then + OCTAVE_CC_FLAG(-mieee, [ + ieee_fp_flag=-mieee + XTRA_CFLAGS="$XTRA_CFLAGS -mieee" + AC_MSG_NOTICE([adding -mieee to XTRA_CFLAGS])]) + else + OCTAVE_CC_FLAG(-ieee, [ + ieee_fp_flag=-ieee + XTRA_CFLAGS="$XTRA_CFLAGS -ieee" + AC_MSG_NOTICE([adding -ieee to XTRA_CFLAGS])]) + fi + if test "$GXX" = yes; then + OCTAVE_CXX_FLAG(-mieee, [ + ieee_fp_flag=-mieee + XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mieee" + AC_MSG_NOTICE([adding -mieee to XTRA_CXXFLAGS])]) + else + OCTAVE_CXX_FLAG(-ieee, [ + ieee_fp_flag=-ieee + XTRA_CXXFLAGS="$XTRA_CXXFLAGS -ieee" + AC_MSG_NOTICE([adding -ieee to XTRA_CXXFLAGS])]) + fi + ;; + *ibm-aix4*) + OCTAVE_CC_FLAG(-mminimal-toc, [ + XTRA_CFLAGS="$XTRA_CFLAGS -mminimal-toc"]) + + OCTAVE_CXX_FLAG(-mminimal-toc, [ + XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mminimal-toc"]) + ;; +esac + +AC_SUBST(XTRA_CFLAGS) +AC_SUBST(XTRA_CXXFLAGS) + +### Use -static if compiling on Alpha OSF/1 1.3 systems. + +case "$canonical_host_type" in + alpha*-dec-osf1.3) + LD_STATIC_FLAG=-static + ;; +esac +if test -n "$LD_STATIC_FLAG"; then + AC_MSG_NOTICE([defining LD_STATIC_FLAG to be $LD_STATIC_FLAG]) +fi +AC_SUBST(LD_STATIC_FLAG) + +### Defaults for cross compiling. BUILD_CC and BUILD_CXX are +### the compilers that we use for building tools on the build system. +### For now, we assume that the only cross compiling we can do is +### with gcc on a Unixy system, but the dedicated hacker can override these. + +if test "$cross_compiling" = yes; then + BUILD_CC="gcc" + BUILD_CFLAGS="-O2 -g" + BUILD_CXX="g++" + BUILD_CXXFLAGS="-O2 -g" + BUILD_LDFLAGS="" + BUILD_EXEEXT="" +else + BUILD_CC='$(CC)' + BUILD_CFLAGS='$(CFLAGS)' + BUILD_CXX='$(CXX)' + BUILD_CXXFLAGS='$(CXXFLAGS)' + BUILD_LDFLAGS='$(LDFLAGS)' + case "$canonical_host_type" in + sparc-sun-solaris2*) + if test "$GCC" != yes; then + ## The Sun C++ compiler never seems to complete compiling + ## gendoc.cc unless we reduce the optimization level... + BUILD_CXXFLAGS="-g -O1" + fi + ;; + esac + BUILD_EXEEXT='$(EXEEXT)' +fi + +AC_ARG_VAR(BUILD_CC, [build system C compiler (used if cross compiling)]) +AC_ARG_VAR(BUILD_CFLAGS, [build system C compiler flags (used if cross compiling)]) +AC_ARG_VAR(BUILD_CXX, [build system C++ compiler (used if cross compiling)]) +AC_ARG_VAR(BUILD_CXXFLAGS, [build system C++ compiler flags (used if cross compiling)]) +AC_ARG_VAR(BUILD_LDFLAGS, [build system C++ compiler link flags (used if cross compiling)]) +AC_ARG_VAR(BUILD_EXEEXT, [build system executable extension (used if cross compiling)]) + +dnl This is bogus. We shouldn't have to explicitly add libc too! +dnl Keep this check before the check for the Fortran compiler, +dnl in case -lm is needed to compile Fortran programs. + +### Look for math library. If found, this will add -lm to LIBS. + +case "$canonical_host_type" in + *-*-nextstep*) + ;; + *-*-linux*) + AC_CHECK_LIB(m, sin, , , -lc) + ;; + *) + AC_CHECK_LIB(m, sin) + ;; +esac + +## Default FFLAGS is -O. +if test "x$FFLAGS" = x; then + FFLAGS="-O" +fi + +## the F77 variable, if set, overrides AC_PROG_F77 automatically +AC_PROG_F77 +AC_F77_LIBRARY_LDFLAGS +AC_F77_DUMMY_MAIN +AC_F77_WRAPPERS + +F77_TOLOWER=true +F77_APPEND_UNDERSCORE=true +F77_APPEND_EXTRA_UNDERSCORE=true + +case "$ac_cv_f77_mangling" in + "upper case") F77_TOLOWER=false ;; +esac +case "$ac_cv_f77_mangling" in + "no underscore") F77_APPEND_UNDERSCORE=false ;; +esac +case "$ac_cv_f77_mangling" in + "no extra underscore") F77_APPEND_EXTRA_UNDERSCORE=false ;; +esac + +case "$canonical_host_type" in + i[[3456789]]86-*-*) + if test "$ac_cv_f77_compiler_gnu" = yes; then + OCTAVE_F77_FLAG(-mieee-fp) +### OCTAVE_F77_FLAG(-ffloat-store) + fi + ;; + alpha*-*-*) + if test "$ac_cv_f77_compiler_gnu" = yes; then + OCTAVE_F77_FLAG(-mieee) + else + OCTAVE_F77_FLAG(-ieee) + OCTAVE_F77_FLAG(-fpe1) + fi + ;; + powerpc-apple-machten*) + FFLAGS= + ;; +esac + +if test -n "$FFLAGS"; then + AC_MSG_NOTICE([defining FFLAGS to be $FFLAGS]) +fi + +AC_SUBST(F77_TOLOWER) +AC_SUBST(F77_APPEND_UNDERSCORE) +AC_SUBST(F77_APPEND_EXTRA_UNDERSCORE) + +if test -z "$F77"; then + AC_MSG_ERROR([in order to build octave, you must have a compatible Fortran compiler or wrapper script for f2c that functions as a Fortran compiler installed and in your path. See the file INSTALL for more information.]) +fi + +OCTAVE_CHECK_FORTRAN_INTEGER_SIZE +if test "x$octave_cv_fortran_integer_size" = xno; then + if $USE_64_BIT_IDX_T; then + case "$F77" in + gfortran) + case "$FFLAGS" in + *-fdefault-integer-8*) + ;; + *) + AC_MSG_NOTICE([adding -fdefault-integer-8 to FFLAGS]) + FFLAGS="-fdefault-integer-8 $FFLAGS" + ## Invalidate the cache and try again. + $as_unset octave_cv_fortran_integer_size + ;; + esac + ;; + esac + if test -z "$octave_cv_fortran_integer_size"; then + OCTAVE_CHECK_FORTRAN_INTEGER_SIZE + fi + if test "x$octave_cv_fortran_integer_size" = xno; then + AC_MSG_ERROR([in order to build octave with 64-bit indexing support your Fortran compiler must have a default integer size of 8 bytes. See the file INSTALL for more information.]) + fi + else + AC_MSG_ERROR([your Fortran compiler must have default integers that are the same size as octave_idx_type ($OCTAVE_IDX_TYPE). See the file INSTALL for more information.]) + fi +fi + +FC=$F77 +AC_SUBST(FC) + +OCTAVE_F77_FLAG(-ffloat-store, [ +AC_MSG_RESULT([setting F77_FLOAT_STORE_FLAG to -ffloat-store]) +F77_FLOAT_STORE_FLAG=-ffloat-store +AC_SUBST(F77_FLOAT_STORE_FLAG) +]) + +OCTAVE_IEEE754_DATA_FORMAT + +### Check for the QHull library + +OCTAVE_CHECK_LIBRARY(qhull, QHull, + [Qhull library not found -- this will result in loss of functionality of some geometry functions.], + [qhull/qhull_a.h], [qh_qhull], [], [], + [warn_qhull= + OCTAVE_CHECK_QHULL_VERSION + OCTAVE_CHECK_QHULL_OK([TEXINFO_QHULL="@set HAVE_QHULL" + AC_DEFINE(HAVE_QHULL, 1, [Define if QHull is available.])], [ + warn_qhull="Qhull library found, but seems not to work properly -- this will result in loss of functionality of some geometry functions. Please try recompiling the library with -fno-strict-aliasing."])]) + +### Check for pcre/regex library. + +## check for pcre-config, and if so, set CPPFLAGS appropriately +AC_CHECK_PROG(WITH_PCRE_CONFIG, pcre-config, yes, no) +if test $WITH_PCRE_CONFIG = yes ; then + CPPFLAGS="$CPPFLAGS $(pcre-config --cflags)" +fi + +## NB: no need to do separate check for pcre.h header -- checking macros is good enough +AC_CACHE_CHECK([whether pcre.h defines the macros we need], [ac_cv_pcre_h_macros_present], [ + AC_EGREP_CPP([PCRE_HAS_MACROS_WE_NEED], [ +#include +#if defined (PCRE_INFO_NAMECOUNT) \ + && defined (PCRE_INFO_NAMEENTRYSIZE) \ + && defined (PCRE_INFO_NAMETABLE) +PCRE_HAS_MACROS_WE_NEED +#endif], ac_cv_pcre_h_macros_present=yes, ac_cv_pcre_h_macros_present=no)]) +WITH_PCRE="$ac_cv_pcre_h_macros_present" + +REGEX_LIBS= + +using_pcre=no +using_regex=no + +if test "$WITH_PCRE" = yes; then + if test "$WITH_PCRE_CONFIG" = yes; then + REGEX_LIBS=$(pcre-config --libs) + else + REGEX_LIBS=-lpcre + fi + save_LIBS="$LIBS" + LIBS="$REGEX_LIBS $LIBS" + AC_CHECK_FUNCS(pcre_compile, [using_pcre=yes + AC_DEFINE(HAVE_PCRE, 1, [Define if PCRE library is available.])], [ + REGEX_LIBS= + warn_pcre="PCRE library not found. This will result in some loss of functionality for the regular expression matching functions." + AC_MSG_WARN($warn_pcre)]) + LIBS="$save_LIBS" +else + warn_pcre="PCRE library not found. This will result in some loss of functionality for the regular expression matching functions." + AC_MSG_WARN($warn_pcre) +fi + +AC_CHECK_FUNCS(regexec, [using_regex=yes], [ + AC_CHECK_LIB(regex, regexec, [using_regex=yes + REGEX_LIBS="-lregex $REGEX_LIBS"], [ + warn_regex="regular expression functions not found. The regular expression matching functions will be disabled." + AC_MSG_WARN($warn_regex)])]) + +if test "$using_regex" = yes; then + AC_DEFINE(HAVE_REGEX, 1, [Define if regex library is available.]) +fi + +AC_SUBST(REGEX_LIBS) + +### Check for ZLIB library. + +OCTAVE_CHECK_LIBRARY(z, ZLIB, + [ZLIB library not found. Octave will not be able to save or load compressed data files or HDF5 files.], + [zlib.h], [gzclearerr]) + +### Check for HDF5 library. + +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$Z_CPPFLAGS $CPPFLAGS" +save_LIBS="$LIBS" +LIBS="$Z_LDFLAGS $Z_LIBS $LIBS" +OCTAVE_CHECK_LIBRARY(hdf5, HDF5, + [HDF5 library not found. Octave will not be able to save or load HDF5 data files.], + [hdf5.h], [H5Gget_num_objs], [], [], + [warn_hdf5= + OCTAVE_HDF5_HAS_REQUIRED_API + if test $octave_hdf5_ok = yes; then + TEXINFO_HDF5="@set HAVE_HDF5" + AC_DEFINE(HAVE_HDF5, 1, [Define if HDF5 is available.]) + AC_DEFINE(HAVE_H5GGET_NUM_OBJS, 1, [Define if HDF5 has H5Gget_num_objs.]) + case "$canonical_host_type" in + *-*-msdosmsvc) + OCTAVE_HDF5_DLL + ;; + esac + fi]) +CPPFLAGS="$save_CPPFLAGS" +LIBS="$save_LIBS" + + +# Subdirectory of libcruft to build if fftw is not found: + +FFT_DIR="fftpack" +AC_SUBST(FFT_DIR) + +# Checks for FFTW header and library. + +OCTAVE_CHECK_LIBRARY(fftw3, FFTW3, + [FFTW3 library not found. The slower FFTPACK library will be used instead.], + [fftw3.h], [fftw_plan_dft_1d]) + +OCTAVE_CHECK_LIBRARY(fftw3f, FFTW3F, + [FFTW3F library not found. The slower FFTPACK library will be used instead.], + [fftw3.h], [fftwf_plan_dft_1d]) + +if test -n "$FFTW3_LIBS" && test -n "$FFTW3F_LIBS"; then + FFT_DIR= +fi + +# Checks for GLPK header and library. + +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$Z_CPPFLAGS $CPPFLAGS" +save_LIBS="$LIBS" +LIBS="$Z_LDFLAGS $Z_LIBS $LIBS" +OCTAVE_CHECK_LIBRARY(glpk, GLPK, + [GLPK library not found. The glpk function for solving linear programs will be disabled.], + [glpk/glpk.h glpk.h], [_glp_lpx_simplex]) +LIBS="$save_LIBS" +CPPFLAGS="$save_CPPFLAGS" + +# Checks for CURL header and library. + +save_CPPFLAGS="$CPPFLAGS" +CPPFLAGS="$Z_CPPFLAGS $CPPFLAGS" +save_LIBS="$LIBS" +LIBS="$Z_LDFLAGS $Z_LIBS $LIBS" +OCTAVE_CHECK_LIBRARY(curl, cURL, + [cURL library not found. The urlread and urlwrite functions will be disabled.], + [curl/curl.h], [curl_easy_escape]) +LIBS="$save_LIBS" +CPPFLAGS="$save_CPPFLAGS" + +### GraphicsMagick++ + +warn_magick="GraphicsMagick++ library not found. The imread function for reading image files will not be fully functional." + +MAGICK_CPPFLAGS= +MAGICK_LDFLAGS= +MAGICK_LIBS= + +PKG_CHECK_EXISTS([GraphicsMagick++], [ + ## Make sure we only get -I, -L and -l flags. Some GraphicsMagick++ + ## packages adds extra flags that are useful when building + ## GraphicsMagick++ extentions. These extra flags break the Octave build. + MAGICK_LDFLAGS=`$PKG_CONFIG --libs-only-L GraphicsMagick++` + MAGICK_LIBS=`$PKG_CONFIG --libs-only-l GraphicsMagick++` + MAGICK_CPPFLAGS=`$PKG_CONFIG --cflags-only-I GraphicsMagick++` + + warn_magick="GraphicsMagick++ library fails tests. The imread function for reading image files will not be fully functional." + + save_CPPFLAGS="$CPPFLAGS" + save_LIBS="$LIBS" + CPPFLAGS="$MAGICK_CPPFLAGS $CPPFLAGS" + LIBS="$MAGICK_LDFLAGS $MAGICK_LIBS $LIBS" + AC_LANG_PUSH(C++) + AC_CHECK_HEADER([Magick++.h], [ + AC_MSG_CHECKING([for Magick::ColorRGB in Magick++.h]) + AC_TRY_LINK([#include ], [Magick::ColorRGB c;], [ + AC_MSG_RESULT(yes) + warn_magick= + ], [ + AC_MSG_RESULT(no) + ]) + ]) + AC_LANG_POP(C++) + CPPFLAGS="$save_CPPFLAGS" + LIBS="$save_LIBS" +]) + +if test -z "$warn_magick"; then + AC_DEFINE(HAVE_MAGICK, 1, [Define if GraphicsMagick++ is available.]) +else + MAGICK_CPPFLAGS= + MAGICK_LDFLAGS= + MAGICK_LIBS= +fi +AC_SUBST(MAGICK_CPPFLAGS) +AC_SUBST(MAGICK_LDFLAGS) +AC_SUBST(MAGICK_LIBS) + +# --------------------------------------------------------------------- + +## libraries needed for graphics + +warn_freetype="" +warn_ftgl="" + +OCTAVE_OPENGL +if test -n "$OPENGL_LIBS"; then + AC_DEFINE(HAVE_OPENGL, 1, [Define if OpenGL is available]) + +## ftgl (needs freetype 2) + AC_CHECK_FT2([9.0.3],[AC_DEFINE(HAVE_FREETYPE, 1, [Define to 1 if you have Freetype library.])], + [warn_freetype="FreeType library not found. Native renderer will not have on-screen text"]) + if test -z "$warn_freetype"; then + AC_LANG_PUSH(C++) + save_LIBS="$LIBS" + save_CXXFLAGS="$CXXFLAGS" + save_CPPFLAGS="$CPPFLAGS" + LIBS="$LIBS $FT2_LIBS $OPENGL_LIBS" + CXXFLAGS="$CXXFLAGS $FT2_CFLAGS" + CPPFLAGS="$CPPFLAGS $FT2_CFLAGS" + has_ftgl_h=yes + AC_CHECK_HEADERS([FTGL/ftgl.h ftgl.h], break, [ + AC_CHECK_HEADERS([FTGL/FTGL.h FTGL.h], [ + AC_DEFINE(HAVE_FTGL_UPPERCASE, 1, [Define to 1 if you have FTGL.h or FTGL/FTGL.h]) + break + ], has_ftgl_h=no)]) + if test "$has_ftgl_h" = yes; then + AC_MSG_CHECKING([for FTGLTextureFont in -lftgl]) + LIBS="$save_LIBS -lftgl $FT2_LIBS $OPENGL_LIBS" + AC_TRY_LINK([ +#ifdef HAVE_FTGL_FTGL_H +#ifdef HAVE_FTGL_UPPERCASE +#include +#else +#include +#endif +#include +#elif HAVE_FTGL_H +#ifdef HAVE_FTGL_UPPERCASE +#include +#else +#include +#endif +#include +#endif], [ +FTGLTextureFont font("");], [ + OPENGL_LIBS="-lftgl $FT2_LIBS $OPENGL_LIBS" + LIBS="$save_LIBS" + CPPFLAGS="$save_CPPFLAGS" + AC_DEFINE(HAVE_FTGL, 1, [Define to 1 if FTGL is present]) + AC_MSG_RESULT(yes) + XTRA_CXXFLAGS="$XTRA_CXXFLAGS $FT2_CFLAGS"], [ + AC_MSG_RESULT(no) + warn_ftgl="FTGL library not found. Native renderer will not have on-screen text" + ]) + LIBS="$save_LIBS" + CXXFLAGS="$save_CXXFLAGS" + CPPFLAGS="$save_CPPFLAGS" + else + warn_ftgl="FTGL headers not found. Native renderer will not have on-screen text" + fi + AC_LANG_POP(C++) + fi +fi + +# fontconfig library + +warn_fontconfig="" +if test -z "$warn_freetype"; then + PKG_CHECK_MODULES(FONTCONFIG,[fontconfig],[ + have_fontconfig=yes + OPENGL_LIBS="$FONTCONFIG_LIBS $OPENGL_LIBS" + XTRA_CXXFLAGS="$XTRA_CXXFLAGS $FONTCONFIG_CFLAGS" + AC_DEFINE(HAVE_FONTCONFIG, 1, [Define to 1 if fontconfig is present])],[ + have_fontconfig=no + warn_fontconfig="Fontconfig not found. Native text rendering will use hard-coded font instead."]) +fi + +GRAPHICS_LIBS= +GRAPHICS_CFLAGS= + +## fltk (www.fltk.org) +AC_ARG_WITH(fltk-prefix, + [ --with-fltk-prefix=PFX Prefix where FLTK is installed (optional)], + fltk_prefix="$withval", + fltk_prefix="") +AC_ARG_WITH(fltk-exec-prefix, + [ --with-fltk-exec-prefix=PFX Exec prefix where FLTK is installed (optional)], + fltk_exec_prefix="$withval", + fltk_exec_prefix="") + +if test -n "$fltk_exec_prefix"; then + fltk_args="$fltk_args --exec-prefix=$fltk_exec_prefix" + if test "x${FLTK_CONFIG+set}" != xset ; then + FLTK_CONFIG="$fltk_exec_prefix/bin/fltk-config" + fi +fi + +if test -n "$fltk_prefix"; then + fltk_args="$fltk_args --prefix=$fltk_prefix" + if test x${FLTK_CONFIG+set} != xset ; then + FLTK_CONFIG="$fltk_prefix/bin/fltk-config" + fi +fi + +AC_PATH_PROG(FLTK_CONFIG, fltk-config, no) + +warn_fltk_config="" +warn_fltk_opengl="" + +if test "$FLTK_CONFIG" = "no" ; then + warn_fltk_config="FLTK config script not found. Native graphics will be disabled." +else + FLTK_CFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --cflags`" + FLTK_LDFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --ldflags`" + + AC_MSG_CHECKING(for OpenGL support in FLTK) + cat > conftest.cc < + int nothing=0; +EOF + $CXX $CXXFLAGS $FLTK_CFLAGS -c conftest.cc || \ + warn_fltk_opengl="FLTK does not have OpenGL support. Native graphics will be disabled." + + if test -z "$warn_fltk_opengl"; then + AC_MSG_RESULT(yes) + AC_DEFINE(HAVE_FLTK, 1, [Define if FLTK is available]) + GRAPHICS_CFLAGS="$FLTK_CFLAGS" + GRAPHICS_LIBS="$FLTK_LDFLAGS" + else + AC_MSG_RESULT(no) + fi +fi + +AC_SUBST(GRAPHICS_CFLAGS) +AC_SUBST(GRAPHICS_LIBS) + +# ---------------------------------------------------------------------- + +OCTAVE_PROG_AR + +AC_PROG_RANLIB + +XTRA_CRUFT_SH_LDFLAGS= +case "$canonical_host_type" in + *-*-msdosmsvc) + FLIBS="$FLIBS -lkernel32" + XTRA_CRUFT_SH_LDFLAGS="-Wl,-def:cruft.def" + ;; +esac +AC_SUBST(XTRA_CRUFT_SH_LDFLAGS) + +### Checks for BLAS and LAPACK libraries: +# (Build subdirectories of libcruft if they aren't found on the system.) +ACX_BLAS_WITH_F77_FUNC([], [BLAS_DIR="blas"]) +ACX_LAPACK([BLAS_LIBS="$LAPACK_LIBS $BLAS_LIBS"], [LAPACK_DIR="lapack"]) +AC_SUBST(BLAS_DIR) +AC_SUBST(LAPACK_DIR) + +if test "x$acx_blas_f77_func_ok" = "xno"; then + warn_blas_f77_incompatible="A BLAS library was detected but found incompatible with your Fortran 77 compiler. The reference BLAS implementation will be used. To improve performance, consider using a different Fortran compiler or a switch like -ff2c to make your Fortran compiler use a calling convention compatible with the way your BLAS library was compiled, or use a different BLAS library." + AC_MSG_WARN($warn_blas_f77_incompatible) +fi + +# Check for the qrupdate library + +save_LIBS="$LIBS" +LIBS="$BLAS_LIBS $FLIBS $LIBS" +OCTAVE_CHECK_LIBRARY(qrupdate, qrupdate, + [qrupdate not found. The QR & Cholesky updating functions will be slow.], + [], + [F77_FUNC(sqr1up,SQR1UP)], + [], [don't use qrupdate, disable QR & Cholesky updating functions]) +LIBS="$save_LIBS" + +# Check for AMD library + +OCTAVE_CHECK_LIBRARY(amd, AMD, + [AMD library not found. This will result in some lack of functionality for sparse matrices.], + [suitesparse/amd.h ufsparse/amd.h amd/amd.h amd.h], + [amd_postorder], + [], [don't use AMD library, disable some sparse functionality]) + +# Check for CAMD library + +OCTAVE_CHECK_LIBRARY(camd, CAMD, + [CAMD library not found. This will result in some lack of functionality for sparse matrices.], + [suitesparse/camd.h ufsparse/camd.h amd/camd.h camd.h], + [camd_postorder], + [], [don't use CAMD library, disable some sparse functionality]) + +# Check for COLAMD library + +OCTAVE_CHECK_LIBRARY(colamd, COLAMD, + [COLAMD library not found. This will result in some lack of functionality for sparse matrices.], + [suitesparse/colamd.h ufsparse/colamd.h amd/colamd.h colamd.h], + [colamd], + [], [don't use COLAMD library, disable some sparse functionality]) + +# Check for CCOLAMD library + +OCTAVE_CHECK_LIBRARY(ccolamd, CCOLAMD, + [CCOLAMD library not found. This will result in some lack of functionality for sparse matrices.], + [suitesparse/ccolamd.h ufsparse/ccolamd.h amd/ccolamd.h ccolamd.h], + [ccolamd], + [], [don't use CCOLAMD library, disable some sparse functionality]) + +# Check for CHOLMOD library. If your cholmod library requires cblas, +# then you will need to configure with --with-cholmod="-lcholmod -lcblas". + +save_LIBS="$LIBS" +LIBS="$BLAS_LIBS $FLIBS $LIBS" +OCTAVE_CHECK_LIBRARY(cholmod, CHOLMOD, + [CHOLMOD library not found. This will result in some lack of functionality for sparse matrices.], + [suitesparse/cholmod.h ufsparse/cholmod.h cholmod/cholmod.h cholmod.h], + [cholmod_start], + [], [don't use CHOLMOD library, disable some sparse functionality]) +LIBS="$save_LIBS" + +# Check for CXSparse library + +OCTAVE_CHECK_LIBRARY(cxsparse, CXSparse, + [CXSparse library not found. This will result in some lack of functionality for sparse matrices.], + [suitesparse/cs.h ufsparse/cs.h amd/cs.h cs.h], + [cs_di_sqr], + [C++], [don't use CXSparse library, disable some sparse functionality]) + +# Check for UMFPACK library. + +save_LIBS="$LIBS" +LIBS="$AMD_LDFLAGS $AMD_LIBS $BLAS_LIBS $FLIBS $LIBS" +OCTAVE_CHECK_LIBRARY(umfpack, UMFPACK, + [UMFPACK not found. This will result in some lack of functionality for sparse matrices.], + [suitesparse/umfpack.h ufsparse/umfpack.h umfpack/umfpack.h umfpack.h], + [umfpack_zi_get_determinant], + [], [don't use UMFPACK, disable some sparse functionality]) +LIBS="$save_LIBS" + +if test -z "$UMFPACK_LIBS"; then + ## Invalidate the cache and try again with -lcblas. + $as_unset ac_cv_lib_umfpack_umfpack_zi_get_determinant + save_LIBS="$LIBS" + LIBS="-lcblas $AMD_LDFLAGS $AMD_LIBS $BLAS_LIBS $FLIBS $LIBS" + OCTAVE_CHECK_LIBRARY(umfpack, UMFPACK, + [UMFPACK not found. This will result in some lack of functionality for sparse matrices.], + [suitesparse/umfpack.h ufsparse/umfpack.h umfpack/umfpack.h umfpack.h], + [umfpack_zi_get_determinant], + [], [don't use UMFPACK, disable some sparse functionality]) + if test -n "$UMFPACK_LIBS"; then + UMFPACK_LIBS="$UMFPACK_LIBS -lcblas" + fi + LIBS="$save_LIBS" +fi + +if test -n "$UMFPACK_LIBS"; then + save_LIBS="$LIBS"; + LIBS="$UMFPACK_LIBS $AMD_LIBS $BLAS_LIBS $FLIBS $LIBS" + OCTAVE_UMFPACK_SEPERATE_SPLIT + LIBS="$save_LIBS" +fi + +save_LIBS="$LIBS" +LIBS="$LAPACK_LIBS $BLAS_LIBS $FLIBS $LIBS" +OCTAVE_CHECK_LIBRARY(arpack, ARPACK, + [arpack not found. The eigs function will be disabled.], + [], + [F77_FUNC(dseupd,DSEUPD)], + [], [don't use the ARPACK library, disable eigs function]) +LIBS="$save_LIBS" + +### Handle shared library options. + +### Enable creation of static libraries. + +AC_ARG_ENABLE(static, + [AS_HELP_STRING([--enable-static], [create static libraries])], + [if test "$enableval" = no; then STATIC_LIBS=false; + else STATIC_LIBS=true; fi], + STATIC_LIBS=false) +AC_SUBST(STATIC_LIBS) + +### Enable creation of shared libraries. Currently only works with +### gcc on some systems. + +AC_ARG_ENABLE(shared, + [AS_HELP_STRING([--enable-shared], + [create shared libraries (not all systems)])], + [if test "$enableval" = no; then SHARED_LIBS=false; + else SHARED_LIBS=true; fi], + SHARED_LIBS=true) +AC_SUBST(SHARED_LIBS) + +### Enable dynamic linking. --enable-shared implies this, so +### --enable-dl is only need if you are only building static libraries +### and want to try dynamic linking too (works on some systems, for +### example, OS X and Windows). + +AC_ARG_ENABLE(dl, + [AS_HELP_STRING([--enable-dl], + [create shared libraries (not all systems)])], + [if test "$enableval" = no; then ENABLE_DYNAMIC_LINKING=false; + else ENABLE_DYNAMIC_LINKING=true; fi], + ENABLE_DYNAMIC_LINKING=true) + +if $STATIC_LIBS || $SHARED_LIBS; then + true +else + AC_MSG_ERROR([You can't disable building static AND shared libraries!]) +fi + +AC_ARG_ENABLE(rpath, + [AS_HELP_STRING([--enable-rpath], + [override the default link options for rpath; e.g., --enable-rpath='-rpath $(octlibdir)'])], + [ if test "$enableval" = no; then use_rpath=false; + else + use_rpath=true + if test "$enableval" = yes; then true; + else enable_rpath_arg="$enableval"; fi + fi], [use_rpath=true]) + +CPICFLAG=-fPIC +CXXPICFLAG=-fPIC +FPICFLAG=-fPIC +SHLEXT=so +SHLLIB='$(SHLEXT)' +SHLBIN= +SHLEXT_VER='$(SHLEXT).$(version)' +SHLLIB_VER='$(SHLLIB).$(version)' +SHLBIN_VER='$(SHLBIN).$(version)' +SHLLINKEXT= +LIBPRE=lib +SHLPRE=lib +SHLLIBPRE=lib +SHLBINPRE=lib +SH_LD='$(CXX)' +SH_LDFLAGS=-shared +DL_LD='$(SH_LD)' +DL_LDFLAGS='$(SH_LDFLAGS)' +MKOCTFILE_DL_LDFLAGS='$(DL_LDFLAGS)' +SONAME_FLAGS= +RLD_FLAG= +NO_OCT_FILE_STRIP=false +TEMPLATE_AR='$(AR)' +TEMPLATE_ARFLAGS="$ARFLAGS" +CRUFT_DLL_DEFS= +OCTAVE_DLL_DEFS= +OCTINTERP_DLL_DEFS= +OCTGRAPHICS_DLL_DEFS= +library_path_var=LD_LIBRARY_PATH +ldpreloadsep=" " +SCRIPTS_EXE_SUFFIX= +case "$canonical_host_type" in + *-*-386bsd* | *-*-netbsd*) + SH_LD=ld + SH_LDFLAGS=-Bshareable + ;; + *-*-openbsd*) + SH_LDFLAGS='-shared -fPIC' + ;; + *-*-freebsd*) + SH_LDFLAGS="-shared -Wl,-x" + RLD_FLAG='-Wl,-rpath -Wl,$(octlibdir)' + ;; + alpha*-dec-osf*) + CPICFLAG= + CXXPICFLAG= + FPICFLAG= + SH_LDFLAGS="-shared -Wl,-expect_unresolved -Wl,'*'" + RLD_FLAG='-Wl,-rpath -Wl,$(octlibdir)' + ;; + *-*-darwin*) + DL_LDFLAGS='-bundle -bundle_loader $(TOPDIR)/src/octave $(LDFLAGS)' + MKOCTFILE_DL_LDFLAGS='-bundle -bundle_loader $$BINDIR/octave-$$OCTAVE_VERSION$$EXEEXT' + SH_LDFLAGS='-dynamiclib -single_module $(LDFLAGS)' + case "$canonical_host_type" in + powerpc-*) + CXXPICFLAG= + CPICFLAG= + FPICFLAG= + ;; + esac + SHLEXT=dylib + SHLLIB='$(SHLEXT)' + SHLEXT_VER='$(version).$(SHLEXT)' + SHLLIB_VER='$(version).$(SHLLIB)' + NO_OCT_FILE_STRIP=true + SONAME_FLAGS='-install_name $(octlibdir)/$@' + library_path_var=DYLD_LIBRARY_PATH + ;; + *-*-cygwin*) + CPICFLAG= + CXXPICFLAG= + FPICFLAG= + LIBPRE=lib + SHLPRE=cyg + SHLBINPRE=cyg + SHLEXT=dll + SHLLIB=dll.a + SHLBIN=dll + DL_LDFLAGS="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc" + SH_LDFLAGS="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-auto-image-base" + SONAME_FLAGS='-Wl,--out-implib=$(patsubst $(SHLPRE)%,$(LIBPRE)%,$@).a' + ldpreloadsep=":" + ;; + *-*-mingw*) + CPICFLAG= + CXXPICFLAG= + FPICFLAG= + SHLEXT=dll + SHLLIB=dll.a + SHLBIN=dll + DL_LDFLAGS="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc" + SH_LDFLAGS="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-auto-image-base" + SONAME_FLAGS='-Wl,--out-implib=$@.a' + library_path_var=PATH + SCRIPTS_EXE_SUFFIX='$(EXEEXT)' + ;; + + *-*-msdosmsvc) + DL_LDFLAGS="-shared" + CPICFLAG= + CXXPICFLAG= + FPICFLAG= + SHLEXT=dll + SHLLIB=lib + SHLBIN=dll + LIBPRE= + SHLPRE= + SHLLIBPRE= + SHLBINPRE= + SH_LDFLAGS="-shared" + if test -n "`echo $CFLAGS | grep -e '-g'`" -o -n "`echo $CXXFLAGS | grep -e '-g'`"; then + DL_LDFLAGS="$DL_LDFLAGS -g" + SH_LDFLAGS="$SH_LDFLAGS -g" + fi + NO_OCT_FILE_STRIP=true + library_path_var=PATH + NO_OCT_FILE_STRIP=true + ## Extra compilation flags. + CRUFT_DLL_DEFS="-DCRUFT_DLL" + OCTAVE_DLL_DEFS="-DOCTAVE_DLL" + OCTINTERP_DLL_DEFS="-DOCTINTERP_DLL" + OCTGRAPHICS_DLL_DEFS="-DOCTGRAPHICS_DLL" + SCRIPTS_EXE_SUFFIX='$(EXEEXT)' + ;; + *-*-linux* | *-*-gnu*) + MKOCTFILE_DL_LDFLAGS="-shared -Wl,-Bsymbolic" + SONAME_FLAGS='-Wl,-soname -Wl,$@' + RLD_FLAG='-Wl,-rpath -Wl,$(octlibdir)' + ;; + i[[3456]]86-*-sco3.2v5*) + SONAME_FLAGS='-Wl,-h -Wl,$@' + RLD_FLAG= + SH_LDFLAGS=-G + ;; + rs6000-ibm-aix* | powerpc-ibm-aix*) + CPICFLAG= + CXXPICFLAG= + FPICFLAG= + library_path_var=LIBPATH + ;; + hppa*-hp-hpux*) + if test "$ac_cv_f77_compiler_gnu" = yes; then + FPICFLAG=-fPIC + else + FPICFLAG=+Z + fi + SHLEXT=sl + SH_LDFLAGS="-shared -fPIC" + RLD_FLAG='-Wl,+b -Wl,$(octlibdir)' + library_path_var=SHLIB_PATH + ;; + ia64*-hp-hpux*) + if test "$ac_cv_f77_compiler_gnu" = yes; then + FPICFLAG=-fPIC + else + FPICFLAG=+Z + fi + SH_LDFLAGS="-shared -fPIC" + RLD_FLAG='-Wl,+b -Wl,$(octlibdir)' + ;; + *-sgi-*) + CPICFLAG= + CXXPICFLAG= + FPICFLAG= + RLD_FLAG='-rpath $(octlibdir)' + ;; + sparc-sun-sunos4*) + if test "$ac_cv_f77_compiler_gnu" = yes; then + FPICFLAG=-fPIC + else + FPICFLAG=-PIC + fi + SH_LD=ld + SH_LDFLAGS="-assert nodefinitions" + RLD_FLAG='-L$(octlibdir)' + ;; + sparc-sun-solaris2* | i386-pc-solaris2*) + if test "$ac_cv_f77_compiler_gnu" = yes; then + FPICFLAG=-fPIC + else + FPICFLAG=-KPIC + fi + if test "$GCC" = yes; then + CPICFLAG=-fPIC + else + CPICFLAG=-KPIC + fi + if test "$GXX" = yes; then + CXXPICFLAG=-fPIC + SH_LDFLAGS=-shared + else + CXXPICFLAG=-KPIC + SH_LDFLAGS=-G + fi + RLD_FLAG='-R $(octlibdir)' + ## Template closures in archive libraries need a different mechanism. + if test "$GXX" = yes; then + true + else + TEMPLATE_AR='$(CXX)' + TEMPLATE_ARFLAGS="-xar -o" + fi + ;; +esac + +if $use_rpath; then + if test -n "$enable_rpath_arg"; then + RLD_FLAG="$enable_rpath_arg" + fi +else + RLD_FLAG="" +fi + +AC_MSG_NOTICE([defining FPICFLAG to be $FPICFLAG]) +AC_MSG_NOTICE([defining CPICFLAG to be $CPICFLAG]) +AC_MSG_NOTICE([defining CXXPICFLAG to be $CXXPICFLAG]) +AC_MSG_NOTICE([defining SHLEXT to be $SHLEXT]) +AC_MSG_NOTICE([defining SHLLIB to be $SHLLIB]) +AC_MSG_NOTICE([defining SHLBIN to be $SHLBIN]) +AC_MSG_NOTICE([defining SHLEXT_VER to be $SHLEXT_VER]) +AC_MSG_NOTICE([defining SHLLIB_VER to be $SHLLIB_VER]) +AC_MSG_NOTICE([defining SHLBIN_VER to be $SHLBIN_VER]) +AC_MSG_NOTICE([defining SHLLINKEXT to be $SHLLINKEXT]) +AC_MSG_NOTICE([defining LIBPRE to be $LIBPRE]) +AC_MSG_NOTICE([defining SHLPRE to be $SHLPRE]) +AC_MSG_NOTICE([defining SHLLIBPRE to be $SHLLIBPRE]) +AC_MSG_NOTICE([defining SHLBINPRE to be $SHLBINPRE]) +AC_MSG_NOTICE([defining SH_LD to be $SH_LD]) +AC_MSG_NOTICE([defining SH_LDFLAGS to be $SH_LDFLAGS]) +AC_MSG_NOTICE([defining DL_LD to be $DL_LD]) +AC_MSG_NOTICE([defining DL_LDFLAGS to be $DL_LDFLAGS]) +AC_MSG_NOTICE([defining MKOCTFILE_DL_LDFLAGS to be $MKOCTFILE_DL_LDFLAGS]) +AC_MSG_NOTICE([defining SONAME_FLAGS to be $SONAME_FLAGS]) +AC_MSG_NOTICE([defining NO_OCT_FILE_STRIP to be $NO_OCT_FILE_STRIP]) +AC_MSG_NOTICE([defining RLD_FLAG to be $RLD_FLAG]) +AC_MSG_NOTICE([defining TEMPLATE_AR to be $TEMPLATE_AR]) +AC_MSG_NOTICE([defining TEMPLATE_ARFLAGS to be $TEMPLATE_ARFLAGS]) +AC_MSG_NOTICE([defining CRUFT_DLL_DEFS to be $CRUFT_DLL_DEFS]) +AC_MSG_NOTICE([defining OCTAVE_DLL_DEFS to be $OCTAVE_DLL_DEFS]) +AC_MSG_NOTICE([defining OCTINTERP_DLL_DEFS to be $OCTINTERP_DLL_DEFS]) +AC_MSG_NOTICE([defining OCTGRAPHICS_DLL_DEFS to be $OCTGRAPHICS_DLL_DEFS]) +AC_MSG_NOTICE([defining library_path_var to be $library_path_var]) +AC_SUBST(FPICFLAG) +AC_SUBST(CPICFLAG) +AC_SUBST(CXXPICFLAG) +AC_SUBST(SHLEXT) +AC_SUBST(SHLLIB) +AC_SUBST(SHLBIN) +AC_SUBST(SHLEXT_VER) +AC_SUBST(SHLLIB_VER) +AC_SUBST(SHLBIN_VER) +AC_SUBST(SHLLINKEXT) +AC_SUBST(LIBPRE) +AC_SUBST(SHLPRE) +AC_SUBST(SHLLIBPRE) +AC_SUBST(SHLBINPRE) +AC_SUBST(SH_LD) +AC_SUBST(SH_LDFLAGS) +AC_SUBST(DL_LD) +AC_SUBST(DL_LDFLAGS) +AC_SUBST(MKOCTFILE_DL_LDFLAGS) +AC_SUBST(SONAME_FLAGS) +AC_SUBST(NO_OCT_FILE_STRIP) +AC_SUBST(RLD_FLAG) +AC_SUBST(TEMPLATE_AR) +AC_SUBST(TEMPLATE_ARFLAGS) +AC_SUBST(CRUFT_DLL_DEFS) +AC_SUBST(OCTAVE_DLL_DEFS) +AC_SUBST(OCTINTERP_DLL_DEFS) +AC_SUBST(OCTGRAPHICS_DLL_DEFS) +AC_SUBST(library_path_var) +AC_SUBST(ldpreloadsep) +AC_SUBST(SCRIPTS_EXE_SUFFIX) + +### special checks for odd OS specific things. +### +### I am told that on some SCO systems, the only place to find some +### functions like gethostname and gettimeofday is in libsocket. + +AC_CHECK_FUNCS(gethostname, [], [AC_CHECK_LIB(socket, gethostname)]) +AC_CHECK_FUNCS(getpwnam, [], [AC_CHECK_LIB(sun, getpwnam)]) + +case "$canonical_host_type" in + *-*-cygwin*) + AC_CHECK_LIB(wsock32, gethostname) + LIBS="$LIBS -lwsock32" + ;; + *-*-msdosmsvc* | *-*-mingw*) + LIBS="$LIBS -lgdi32 -lws2_32 -luser32 -lkernel32" + ;; +esac + +### Type stuff. + +AC_TYPE_MODE_T +AC_TYPE_OFF_T +AC_TYPE_PID_T +AC_TYPE_SIZE_T +AC_TYPE_UID_T +AC_CHECK_TYPES([dev_t, ino_t, nlink_t, nlink_t]) +AC_CHECK_TYPES([long long int, unsigned long long int]) +AC_CHECK_TYPES([sigset_t, sig_atomic_t], , , [ +#if defined (HAVE_SYS_TYPES_H) +#include +#endif +#include ]) + +### How big are ints and how are they oriented? These could probably +### be eliminated in favor of run-time checks. + +AC_CHECK_SIZEOF(short) +AC_CHECK_SIZEOF(int) +AC_CHECK_SIZEOF(long) +AC_CHECK_SIZEOF(long long) + +### Does the C compiler handle alloca() and const correctly? + +AC_FUNC_ALLOCA +AC_C_CONST + +### See if we should use placement delete. + +OCTAVE_PLACEMENT_DELETE + +### See if we can auto allocate variable sized arrays. + +OCTAVE_DYNAMIC_AUTO_ARRAYS + +### See if we can use fast integer arithmetics + +OCTAVE_FAST_INT_OPS + +### Check for long double type (for 64-bit integers) + +AC_CHECK_SIZEOF(long double) + +### Checks for header files. + +AC_HEADER_STDC +AC_HEADER_DIRENT +AC_HEADER_TIME +AC_HEADER_SYS_WAIT + +### C headers + +AC_CHECK_HEADERS(assert.h curses.h direct.h dlfcn.h fcntl.h float.h \ + floatingpoint.h grp.h ieeefp.h inttypes.h limits.h locale.h memory.h nan.h \ + ncurses.h poll.h pthread.h pwd.h stdint.h stdlib.h string.h sunmath.h sys/ioctl.h \ + sys/param.h sys/poll.h sys/resource.h sys/select.h sys/stat.h \ + sys/time.h sys/times.h sys/types.h sys/utsname.h sys/utime.h termcap.h \ + unistd.h utime.h varargs.h) + +### C++ headers + +AC_LANG_PUSH(C++) +AC_CHECK_HEADERS(sstream) +AC_LANG_POP(C++) + +have_termios_h=no +AC_CHECK_HEADERS(termios.h, have_termios_h=yes) +AC_CHECK_HEADERS(termio.h, have_termio_h=yes, have_termio_h=no) +AC_CHECK_HEADERS(sgtty.h, have_sgtty_h=yes, have_sgtty_h=no) +AC_CHECK_HEADERS(glob.h, have_glob_h=yes, have_glob_h=no) +AC_CHECK_HEADERS(fnmatch.h, have_fnmatch_h=yes, have_fnmatch_h=no) +AC_CHECK_HEADERS(conio.h, have_conio_h=yes, have_conio_h=no) + +### I'm told that termios.h is broken on NeXT systems. + +case "$canonical_host_type" in + *-*-nextstep*) + if test "$have_termios_h" = yes; then + AC_MSG_WARN([Ignoring termios.h on NeXT systems.]) + have_termios_h=no + fi + ;; +esac + +if test "$have_termios_h" = yes \ + || test "$have_termio_h" = yes \ + || test "$have_sgtty_h" = yes; then + true +else + AC_MSG_WARN([I couldn't find termios.h, termio.h, or sgtty.h!]) +fi + +LIBGLOB= +AC_SUBST(LIBGLOB) +if test "$have_fnmatch_h" = yes && test "$have_glob_h" = yes; then + AC_CHECK_FUNCS(fnmatch, have_fnmatch=yes, [ + AC_CHECK_LIB(glob, fnmatch, [have_fnmatch=yes; LIBGLOB=-lglob], + have_fnmatch=no)]) + AC_CHECK_FUNCS(glob, have_glob=yes, [ + AC_CHECK_LIB(glob, glob, [have_glob=yes; LIBGLOB=-lglob], + have_glob=no)]) + + if test "$have_fnmatch" != yes || test "$have_glob" != yes; then + AC_MSG_ERROR([You are required to have fnmatch and glob]) + fi +else + AC_MSG_ERROR([You are required to have fnmatch.h and glob.h]) +fi + +### Checks for functions and variables. + +AC_CHECK_FUNCS(atexit basename bcopy bzero canonicalize_file_name \ + chmod dup2 endgrent endpwent execvp expm1 expm1f fcntl fork fstat getcwd \ + getegid geteuid getgid getgrent getgrgid getgrnam getpgrp getpid \ + getppid getpwent getpwuid gettimeofday getuid getwd _kbhit kill \ + lgamma lgammaf lgamma_r lgammaf_r link localtime_r log1p log1pf lstat \ + memmove mkdir mkfifo mkstemp on_exit pipe poll putenv raise readlink \ + realpath rename resolvepath rindex rmdir roundl select setgrent setlocale \ + setpwent setvbuf sigaction siglongjmp sigpending sigprocmask sigsuspend \ + snprintf stat strcasecmp strdup strerror stricmp strncasecmp \ + strnicmp strptime strsignal symlink tempnam tgammaf trunc umask \ + uname unlink usleep utime vfprintf vsprintf vsnprintf waitpid \ + _chmod _snprintf x_utime _utime32) + +AC_LANG_PUSH(C++) +AC_CHECK_DECLS([exp2, round, tgamma], [], [], [[#include ]]) +AC_CHECK_FUNCS([exp2 round tgamma]) +AH_VERBATIM([Z_FUNCS_AND_DECLS], [ +#if defined (__cplusplus) +extern "C" { +#endif +#if HAVE_EXP2 && ! HAVE_DECL_EXP2 +double exp2 (double ); +#endif +#if HAVE_ROUND && ! HAVE_DECL_ROUND +double round (double); +#endif +#if HAVE_TGAMMA && ! HAVE_DECL_TGAMMA +double tgamma (double); +#endif +#if defined (__cplusplus) +} +#endif +]) +AC_LANG_POP(C++) + +case "$canonical_host_type" in + *-*-mingw*) + ## MinGW does not provide a mkstemp function. However, it provides + ## the mkstemps function in libiberty. + AC_MSG_CHECKING(for mkstemps in libiberty) + save_LIBS="$LIBS" + LIBS="-liberty $LIBS" + AC_LINK_IFELSE([ + AC_LANG_PROGRAM([[int mkstemps (char *pattern, int suffix_len);]], + [[mkstemps ("XXXXXX", 0);]] + )], + [AC_MSG_RESULT(yes) + HAVE_MKSTEMPS=yes + AC_DEFINE(HAVE_MKSTEMPS, 1, [Define if mkstemps is available in libiberty.]) + ], + [AC_MSG_RESULT(no) + HAVE_MKSTEMPS=no + LIBS="$save_LIBS" + ]) + ;; +esac + +case "$canonical_host_type" in + *-*-msdosmsvc | *-*-mingw*) + ## The %T and %e format specifiers for strftime are not implemented + ## so use our version. We could use an actual configure test + ## for this. + ;; + *) + AC_CHECK_FUNCS(strftime) + ;; +esac + +OCTAVE_HAVE_C99_VSNPRINTF +OCTAVE_STRPTIME_BROKEN +OCTAVE_SMART_PUTENV + +case "$canonical_host_type" in + *-*-msdosmsvc | *-*-mingw*) + AC_MSG_CHECKING([for required _WIN32_WINNT]) + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[ +#include +#if _WIN32_WINNT < 0x0403 +#error "Wrong version" +#endif]], []), + AC_MSG_RESULT([none]), [ + AC_DEFINE(_WIN32_WINNT, 0x0403, [Define to 0x0403 to access InitializeCriticalSectionAndSpinCount]) + AC_MSG_RESULT([0x0403])]) + AC_MSG_CHECKING([whether _USE_MATH_DEFINES needs to be defined]) + AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include ]], +[[int x = M_LN2;]]), + AC_MSG_RESULT([no]), [ + AC_DEFINE(_USE_MATH_DEFINES, 1, [Define if your system needs it to define math constants like M_LN2]) + AC_MSG_RESULT([yes])]) + ;; +esac + +### Dynamic linking is now enabled only if we are building shared +### libs and some API for dynamic linking is detected. + +LD_CXX='$(CXX)' +RDYNAMIC_FLAG= +DL_API_MSG="" +dlopen_api=false +shl_load_api=false +loadlibrary_api=false +dyld_api=false + +if $SHARED_LIBS || $ENABLE_DYNAMIC_LINKING; then + + ## Check for dyld first since OS X can have a non-standard libdl + + save_LIBS="$LIBS" + AC_CHECK_HEADER(mach-o/dyld.h) + if test "$ac_cv_header_mach_o_dyld_h" = yes; then + dyld_api=true + else + AC_CHECK_LIB(dld, shl_load, [DL_LIBS=-ldld; LIBS="$LIBS $DL_LIBS"]) + AC_CHECK_FUNCS(shl_load shl_findsym) + if test "$ac_cv_func_shl_load" = yes \ + && test "$ac_cv_func_shl_findsym" = yes; then + shl_load_api=true + else + AC_CHECK_LIB(wsock32, LoadLibrary, [ + DL_LIBS=-lwsock32; LIBS="$LIBS $DL_LIBS"]) + AC_CHECK_FUNCS(LoadLibrary) + if test "$ac_cv_func_loadlibrary" = yes; then + loadlibrary_api=true + else + AC_CHECK_LIB(dl, dlopen, [DL_LIBS=-ldl; LIBS="$LIBS $DL_LIBS"]) + AC_CHECK_FUNCS(dlopen dlsym dlerror dlclose) + if test "$ac_cv_func_dlclose" = yes \ + && test "$ac_cv_func_dlerror" = yes \ + && test "$ac_cv_func_dlopen" = yes \ + && test "$ac_cv_func_dlsym" = yes; then + dlopen_api=true + else + case "$canonical_host_type" in + i[[3456]]86-*-sco3.2v5*) + LD_CXX='LD_RUN_PATH=$LD_RUN_PATH:$(octlibdir) $(CXX)' + dlopen_api=true + ;; + esac + fi + fi + fi + fi + LIBS="$save_LIBS" + AC_SUBST(DL_LIBS) + + ## autoconf test for LoadLibrary appears broken. Bypass for cygwin/mingw + if $dlopen_api || $shl_load_api || $loadlibrary_api || $dyld_api; then + true + else + case "$canonical_host_type" in + *-*-cygwin* | *-*-mingw* | *-*-msdosmsvc) + loadlibrary_api=true; + ;; + esac + fi + + if $dlopen_api; then + DL_API_MSG="(dlopen)" + AC_DEFINE(HAVE_DLOPEN_API, 1, [Define if your system has dlopen, dlsym, dlerror, and dlclose for dynamic linking]) + OCTAVE_CXX_FLAG(-rdynamic, [RDYNAMIC_FLAG=-rdynamic]) + elif $shl_load_api; then + DL_API_MSG="(shl_load)" + AC_DEFINE(HAVE_SHL_LOAD_API, 1, [Define if your system has shl_load and shl_findsym for dynamic linking]) + elif $loadlibrary_api; then + DL_API_MSG="(LoadLibrary)" + AC_DEFINE(HAVE_LOADLIBRARY_API, 1, [Define if your system has LoadLibrary for dynamic linking]) + elif $dyld_api; then + DL_API_MSG="(dyld)" + AC_DEFINE(HAVE_DYLD_API, 1, [Define if your system has dyld for dynamic linking]) + fi + + if $dlopen_api || $shl_load_api || $loadlibrary_api || $dyld_api; then + ENABLE_DYNAMIC_LINKING=true + AC_DEFINE(ENABLE_DYNAMIC_LINKING, 1, [Define if using dynamic linking]) + fi +fi + +if $SHARED_LIBS; then + LIBOCTINTERP=-loctinterp$SHLLINKEXT + LIBOCTAVE=-loctave$SHLLINKEXT + LIBCRUFT=-lcruft$SHLLINKEXT +else + LIBOCTINTERP='$(TOPDIR)/src/liboctinterp.$(LIBEXT)' + LIBOCTAVE='$(TOPDIR)/liboctave/liboctave.$(LIBEXT)' + LIBCRUFT='$(TOPDIR)/libcruft/libcruft.$(LIBEXT)' +fi + +AC_SUBST(LD_CXX) +AC_SUBST(RDYNAMIC_FLAG) +AC_SUBST(ENABLE_DYNAMIC_LINKING) +AC_SUBST(LIBOCTINTERP) +AC_SUBST(LIBOCTAVE) +AC_SUBST(LIBCRUFT) + +### There is more than one possible prototype for gettimeofday. See +### which one (if any) appears in sys/time.h. These tests are from +### Emacs 19. + +AC_MSG_CHECKING(for struct timeval) +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef TIME_WITH_SYS_TIME +#include +#include +#else +#ifdef HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif]], [[static struct timeval x; x.tv_sec = x.tv_usec;]])], + [AC_MSG_RESULT(yes) + HAVE_TIMEVAL=yes + AC_DEFINE(HAVE_TIMEVAL, 1, [Define if struct timeval is defined.])], + [AC_MSG_RESULT(no) + HAVE_TIMEVAL=no]) + +if test "x$HAVE_TIMEVAL" = xyes; then +AC_MSG_CHECKING(whether gettimeofday can't accept two arguments) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef TIME_WITH_SYS_TIME +#include +#include +#else +#ifdef HAVE_SYS_TIME_H +#include +#else +#include +#endif +#endif]], [[struct timeval time; + struct timezone dummy; + gettimeofday (&time, &dummy);]])], + [AC_MSG_RESULT(no)], + [AC_MSG_RESULT(yes) + AC_DEFINE(GETTIMEOFDAY_NO_TZ, 1, + [Define if your system has a single-arg prototype for gettimeofday.])]) +fi + +dnl Maybe defines the IEEE functions we need. + +OCTAVE_CMATH_FUNC(isnan) +OCTAVE_CMATH_FUNC(isinf) +OCTAVE_CMATH_FUNC(isfinite) + +dnl Would like to get rid of this cruft, and just have +dnl +dnl AC_CHECK_FUNCS(finite isnan isinf) +dnl +dnl instead, but that used to fail on some systems... +dnl +dnl Also just using AC_CHECK_FUNCS doesn't seem to work to find isinf +dnl and isnan on Linux systems, so we use AC_CHECK_FUNC, and if that +dnl fails, we try again by including math.h and invoking the function +dnl with an argument. + +### I am told that Inf and NaN don't work on m68k HP sytems, and that +### on SCO systems, isnan and isinf don't work, but they can be +### replaced by something that does. + +case "$canonical_host_type" in + m68k-hp-hpux*) + ;; + *-*-sco*) + AC_MSG_NOTICE([defining SCO to be 1]) + AC_DEFINE(SCO, 1, [Define if using an SCO system.]) + AC_MSG_NOTICE([forcing HAVE_ISINF for SCO]) + AC_DEFINE(HAVE_ISINF, 1, [Define if you have isinf().]) + AC_MSG_NOTICE([forcing HAVE_ISNAN for SCO]) + AC_DEFINE(HAVE_ISNAN, 1, [Define if you have isnan().]) + ;; + *) + AC_CHECK_FUNCS(finite isnan isinf copysign signbit) + AC_CHECK_FUNCS(_finite _isnan _copysign) + AC_CHECK_DECLS(signbit, , , [#include ]) + ;; +esac + +### Check for nonstandard but common math functions that we need. + +AC_CHECK_FUNCS(acosh acoshf asinh asinhf atanh atanhf erf erff erfc erfcf exp2f log2 log2f) +AC_CHECK_FUNCS(hypotf _hypotf) + +### Checks for OS specific cruft. + +AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct stat.st_rdev]) + +AC_STRUCT_TM +AC_STRUCT_TIMEZONE +AC_FUNC_CLOSEDIR_VOID + +AC_CHECK_MEMBERS(struct group.gr_passwd) + +# mkdir takes a single argument on some systems. +OCTAVE_MKDIR_TAKES_ONE_ARG + +octave_found_termlib=no +for termlib in ncurses curses termcap terminfo termlib; do + AC_CHECK_LIB(${termlib}, tputs, [ + TERM_LIBS="-l${termlib}" + octave_found_termlib=yes + break]) +done + +if test "$octave_found_termlib" = no; then + warn_termlibs="I couldn't find -ltermcap, -lterminfo, -lncurses, -lcurses, o\ +r -ltermlib!" + AC_MSG_WARN($warn_termlibs) +fi +AC_SUBST(TERM_LIBS) + +OCTAVE_ENABLE_READLINE + +AC_MSG_CHECKING([for struct exception in math.h]) +AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], + [[struct exception *x; x->type; x->name;]])], + [AC_MSG_RESULT(yes) + AC_DEFINE(EXCEPTION_IN_MATH, 1, + [Define if your math.h declares struct exception for matherr().])], + [AC_MSG_RESULT(no)]) + +### Signal stuff. + +AC_TYPE_SIGNAL +AC_CHECK_DECLS([sys_siglist], [], [], +[#include +/* NetBSD declares sys_siglist in unistd.h. */ +#if HAVE_UNISTD_H +# include +#endif +]) +OCTAVE_SIGNAL_CHECK +OCTAVE_REINSTALL_SIGHANDLERS +if test "$ac_cv_type_signal" = "void"; then + AC_DEFINE(RETSIGTYPE_IS_VOID, 1, [Define if this if RETSIGTYPE is defined to be void. Needed because preprocessor comparisons to void fail on some systems.]) +fi + +### A system dependent kluge or two. + +AC_CHECK_FUNCS(getrusage times) +case "$canonical_host_type" in + *-*-cygwin*) + AC_DEFINE(RUSAGE_TIMES_ONLY, 1, [Define if your struct rusage only has time information.]) + ;; +esac + +### Checks for other programs used for building, testing, installing, +### and running Octave. + +AC_PROG_AWK +OCTAVE_PROG_FIND +OCTAVE_PROG_SED +OCTAVE_PROG_PERL +OCTAVE_PROG_PYTHON + +OCTAVE_PROG_FLEX +OCTAVE_PROG_BISON + +AC_PROG_LN_S + +AC_PROG_INSTALL +INSTALL_SCRIPT='${INSTALL}' +AC_SUBST(INSTALL_SCRIPT) + +OCTAVE_PROG_DESKTOP_FILE_INSTALL + +OCTAVE_PROG_GNUPLOT +OCTAVE_PROG_PAGER +OCTAVE_PROG_GPERF + +OCTAVE_PROG_GHOSTSCRIPT +OCTAVE_PROG_MAKEINFO +OCTAVE_PROG_TEXI2DVI +OCTAVE_PROG_TEXI2PDF + +### Even though we include config.h, we need to have the preprocessor +### defines available in a variable for the octave-bug script. Use +### UGLY_DEFS for that. + +AC_OUTPUT_MAKE_DEFS + +### We have to insert extra levels of backslash quoting here so that +### the right thing ends up in oct-conf.h. +UGLY_DEFS=`echo $DEFS | $SED 's,\\",\\\\\\\\\\\\\\\\\\",g'` +AC_MSG_NOTICE([defining UGLY_DEFS to be $UGLY_DEFS]) +AC_SUBST(UGLY_DEFS) + +### Maybe add -Wall, -W, and -Wshadow to compiler flags now that we're +### done feature testing. + +try_extra_warning_flags=true +AC_ARG_ENABLE(extra-warning-flags, + [AS_HELP_STRING([--enable-extra-warning-flags], + [add -Wall, -W, -Wshadow, and -Wold-style-cast options to CFLAGS and CXXFLAGS (on by default, but only if the compiler appears to accept them)])], + [if test "$enableval" = no; then + try_extra_warning_flags=false + fi], []) + +if $try_extra_warning_flags; then + OCTAVE_CC_FLAG(-Wall, [ + WARN_CFLAGS="$WARN_CFLAGS -Wall"; + AC_MSG_RESULT([adding -Wall to WARN_CFLAGS])]) + OCTAVE_CC_FLAG(-W, [ + WARN_CFLAGS="$WARN_CFLAGS -W"; + AC_MSG_RESULT([adding -W to WARN_CFLAGS])]) + OCTAVE_CC_FLAG(-Wshadow, [ + WARN_CFLAGS="$WARN_CFLAGS -Wshadow"; + AC_MSG_RESULT([adding -Wshadow to WARN_CFLAGS])]) + OCTAVE_CC_FLAG(-Wformat, [ + WARN_CFLAGS="$WARN_CFLAGS -Wformat"; + AC_MSG_RESULT([adding -Wformat to WARN_CFLAGS])]) + + OCTAVE_CXX_FLAG(-Wall, [ + WARN_CXXFLAGS="$WARN_CXXFLAGS -Wall"; + AC_MSG_RESULT([adding -Wall to WARN_CXXFLAGS])]) + OCTAVE_CXX_FLAG(-W, [ + WARN_CXXFLAGS="$WARN_CXXFLAGS -W"; + AC_MSG_RESULT([adding -W to WARN_CXXFLAGS])]) + OCTAVE_CXX_FLAG(-Wshadow, [ + WARN_CXXFLAGS="$WARN_CXXFLAGS -Wshadow"; + AC_MSG_RESULT([adding -Wshadow to WARN_CXXFLAGS])]) + OCTAVE_CXX_FLAG(-Wold-style-cast, [ + WARN_CXXFLAGS="$WARN_CXXFLAGS -Wold-style-cast"; + AC_MSG_RESULT([adding -Wold-style-cast to WARN_CXXFLAGS])]) + OCTAVE_CXX_FLAG(-Wformat, [ + WARN_CXXFLAGS="$WARN_CXXFLAGS -Wformat"; + AC_MSG_RESULT([adding -Wformat to WARN_CXXFLAGS])]) +fi + +GCC_STRICT_FLAGS="-Wcast-align -Wcast-qual -Wconversion -Wmissing-prototypes \ + -Wpointer-arith -Wstrict-prototypes -Wwrite-strings" + +GXX_STRICT_FLAGS="-Wcast-align -Wcast-qual -Wconversion -Wpointer-arith \ + -Wwrite-strings -Weffc++" + +try_strict_warning_flags=false + +AC_ARG_ENABLE(strict-warning-flags, + [AS_HELP_STRING([--enable-strict-warning-flags], + [add extra strict warning options to CFLAGS and CXXFLAGS (off by default)])], + [if test "$enableval" = yes; then + try_strict_warning_flags=true + fi], []) + +if $try_strict_warning_flags; then + for flag in $GCC_STRICT_FLAGS; do + OCTAVE_CC_FLAG($flag, [ + WARN_CFLAGS="$WARN_CFLAGS $flag"; + AC_MSG_RESULT([adding $flag to WARN_CFLAGS])]) + done + for flag in $GXX_STRICT_FLAGS; do + OCTAVE_CXX_FLAG($flag, [ + WARN_CXXFLAGS="$WARN_CXXFLAGS $flag"; + AC_MSG_RESULT([adding $flag to WARN_CXXFLAGS])]) + done +fi + +AC_SUBST(WARN_CFLAGS) +AC_SUBST(WARN_CXXFLAGS) + +### Run configure in subdirectories. + +export CC +export CXX +export F77 + +AC_CONFIG_SUBDIRS(scripts) + +### Some things to add to the bottom of config.h. + +AH_BOTTOM([ +#if defined (__GNUC__) +#define GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__)) +#define GCC_ATTR_NORETURN __attribute__ ((__noreturn__)) +#define GCC_ATTR_UNUSED __attribute__ ((__unused__)) +#else +#define GCC_ATTR_DEPRECATED +#define GCC_ATTR_NORETURN +#define GCC_ATTR_UNUSED +#endif + +#define X_CAST(T, E) (T) (E) + +#if defined (CXX_BROKEN_REINTERPRET_CAST) +#define FCN_PTR_CAST(T, E) (T) (E) +#else +#define FCN_PTR_CAST(T, E) reinterpret_cast (E) +#endif + +#if !defined(HAVE_DEV_T) +typedef short dev_t; +#endif + +#if !defined(HAVE_INO_T) +typedef unsigned long ino_t; +#endif + +#if !defined(HAVE_NLINK_T) +typedef short nlink_t; +#endif + +#if !defined(HAVE_SIGSET_T) +typedef int sigset_t; +#endif + +#if !defined(HAVE_SIG_ATOMIC_T) +typedef int sig_atomic_t; +#endif + +#if defined (_MSC_VER) +#define __WIN32__ +#define WIN32 +/* missing parameters in macros */ +#pragma warning (disable: 4003) +/* missing implementations in template instantiation */ +#pragma warning (disable: 4996) +/* deprecated function names (FIXME?) */ +#pragma warning (disable: 4661) +#endif + +#if defined (__WIN32__) && ! defined (__CYGWIN__) +#define OCTAVE_HAVE_WINDOWS_FILESYSTEM 1 +#elif defined (__CYGWIN__) +#define OCTAVE_HAVE_WINDOWS_FILESYSTEM 1 +#define OCTAVE_HAVE_POSIX_FILESYSTEM 1 +#else +#define OCTAVE_HAVE_POSIX_FILESYSTEM 1 +#endif + +/* Define if we expect to have , Sleep, etc. */ +#if defined (__WIN32__) && ! defined (__CYGWIN__) +#define OCTAVE_USE_WINDOWS_API 1 +#endif + +#if defined (__APPLE__) && defined (__MACH__) +#define OCTAVE_USE_OS_X_API 1 +#endif + +/* sigsetjmp is a macro, not a function. */ +#if defined (sigsetjmp) && defined (HAVE_SIGLONGJMP) +#define OCTAVE_HAVE_SIG_JUMP +#endif + +#if defined (__DECCXX) +#define __USE_STD_IOSTREAM +#endif + +#if defined (_UNICOS) +#define F77_USES_CRAY_CALLING_CONVENTION +#endif + +#if 0 +#define F77_USES_VISUAL_FORTRAN_CALLING_CONVENTION +#endif + +#ifdef USE_64_BIT_IDX_T +#define SIZEOF_OCTAVE_IDX_TYPE 8 +#else +#define SIZEOF_OCTAVE_IDX_TYPE SIZEOF_INT +#endif + +// To be able to use long doubles for 64-bit mixed arithmetics, we need them at +// least 80 bits wide and we need roundl declared in math.h. +// FIXME -- maybe substitute this by a more precise check in the future. +#if (SIZEOF_LONG_DOUBLE >= 10) && defined (HAVE_ROUNDL) +#define OCTAVE_INT_USE_LONG_DOUBLE +#endif + +#define OCTAVE_EMPTY_CPP_ARG + +// Octave is currently unable to use FFTW unless both float +// and double versions are both available. +#if defined (HAVE_FFTW3) && defined (HAVE_FFTW3F) +#define HAVE_FFTW +#endif + +// Backward compatibility. +#if defined (HAVE_Z) +#define HAVE_ZLIB +#endif + +#include "oct-dlldefs.h" +#include "oct-types.h" +]) + +### Do the substitutions in all the Makefiles. + +AC_CONFIG_COMMANDS([Makefile], [if test "$ac_srcdir" != "."; then + cp $srcdir/Makefile . +fi]) + +AC_SUBST(ac_config_files) +AC_SUBST(ac_config_headers) + +AC_CONFIG_FILES([octMakefile Makeconf m4/Makefile test/Makefile + doc/Makefile doc/faq/Makefile doc/interpreter/Makefile + doc/liboctave/Makefile doc/refcard/Makefile emacs/Makefile + examples/Makefile examples/@polynomial/Makefile + examples/@FIRfilter/Makefile liboctave/Makefile + liboctave/oct-types.h src/Makefile src/mxarray.h libcruft/Makefile + libcruft/Makerules libcruft/amos/Makefile libcruft/blas/Makefile + libcruft/daspk/Makefile libcruft/dasrt/Makefile + libcruft/dassl/Makefile libcruft/fftpack/Makefile + libcruft/lapack/Makefile + libcruft/misc/Makefile libcruft/odepack/Makefile + libcruft/ordered-qz/Makefile libcruft/quadpack/Makefile + libcruft/ranlib/Makefile libcruft/slatec-fn/Makefile + libcruft/slatec-err/Makefile libcruft/villad/Makefile + libcruft/blas-xtra/Makefile libcruft/lapack-xtra/Makefile]) + +AC_OUTPUT + +### Print a summary so that important information isn't missed. + +AC_MSG_NOTICE([ + +Octave is now configured for $canonical_host_type + + Source directory: $srcdir + Installation prefix: $prefix + C compiler: $CC $XTRA_CFLAGS $WARN_CFLAGS $CFLAGS + C++ compiler: $CXX $XTRA_CXXFLAGS $WARN_CXXFLAGS $CXXFLAGS + Fortran compiler: $F77 $FFLAGS + Fortran libraries: $FLIBS + Glob libraries: $LIBGLOB + Lex libraries: $LEXLIB + LIBS: $LIBS + + AMD CPPFLAGS: $AMD_CPPFLAGS + AMD LDFLAGS: $AMD_LDFLAGS + AMD libraries: $AMD_LIBS + ARPACK libraries: $ARPACK_LIBS + BLAS libraries: $BLAS_LIBS + CAMD CPPFLAGS: $CAMD_CPPFLAGS + CAMD LDFLAGS: $CAMD_LDFLAGS + CAMD libraries: $CAMD_LIBS + CARBON libraries: $CARBON_LIBS + CCOLAMD CPPFLAGS: $CCOLAMD_CPPFLAGS + CCOLAMD LDFLAGS: $CCOLAMD_LDFLAGS + CCOLAMD libraries: $CCOLAMD_LIBS + CHOLMOD CPPFLAGS: $CHOLMOD_CPPFLAGS + CHOLMOD LDFLAGS: $CHOLMOD_LDFLAGS + CHOLMOD libraries: $CHOLMOD_LIBS + COLAMD CPPFLAGS: $COLAMD_CPPFLAGS + COLAMD LDFLAGS: $COLAMD_LDFLAGS + COLAMD libraries: $COLAMD_LIBS + CURL CPPFLAGS: $CURL_CPPFLAGS + CURL LDFLAGS: $CURL_LDFLAGS + CURL libraries: $CURL_LIBS + CXSPARSE CPPFLAGS: $CXSPARSE_CPPFLAGS + CXSPARSE LDFLAGS: $CXSPARSE_LDFLAGS + CXSPARSE libraries: $CXSPARSE_LIBS + DL libraries: $DL_LIBS + FFTW3 CPPFLAGS: $FFTW3_CPPFLAGS + FFTW3 LDFLAGS: $FFTW3_LDFLAGS + FFTW3 libraries: $FFTW3_LIBS + FFTW3F CPPFLAGS: $FFTW3F_CPPFLAGS + FFTW3F LDFLAGS: $FFTW3F_LDFLAGS + FFTW3F libraries: $FFTW3F_LIBS + FLTK backend libs: $GRAPHICS_LIBS + GLPK CPPFLAGS: $GLPK_CPPFLAGS + GLPK LDFLAGS: $GLPK_LDFLAGS + GLPK libraries: $GLPK_LIBS + GraphicsMagick++ + CPPFLAGS: $MAGICK_CPPFLAGS + LDFLAGS: $MAGICK_LDFLAGS + libraries: $MAGICK_LIBS + HDF5 CPPFLAGS: $HDF5_CPPFLAGS + HDF5 LDFLAGS: $HDF5_LDFLAGS + HDF5 libraries: $HDF5_LIBS + OPENGL libraries: $OPENGL_LIBS + PTHREAD flags: $PTHREAD_CFLAGS + PTHREAD libraries: $PTHREAD_LIBS + QHULL CPPFLAGS: $QHULL_CPPFLAGS + QHULL LDFLAGS: $QHULL_LDFLAGS + QHULL libraries: $QHULL_LIBS + QRUPDATE libraries: $QRUPDATE_LIBS + READLINE libraries: $READLINE_LIBS + REGEX libraries: $REGEX_LIBS + TERM libraries: $TERM_LIBS + UMFPACK libraries: $UMFPACK_LIBS + X11 include flags: $X11_INCFLAGS + X11 libraries: $X11_LIBS + Z CPPFLAGS: $Z_CPPFLAGS + Z LDFLAGS: $Z_LDFLAGS + Z libraries: $Z_LIBS + + Default pager: $DEFAULT_PAGER + gnuplot: $GNUPLOT + + Do internal array bounds checking: $BOUNDS_CHECKING + Build static libraries: $STATIC_LIBS + Build shared libraries: $SHARED_LIBS + Dynamic Linking: $ENABLE_DYNAMIC_LINKING $DL_API_MSG + Include support for GNU readline: $USE_READLINE + 64-bit array dims and indexing: $USE_64_BIT_IDX_T +]) + +warn_msg_printed=false + +if $ENABLE_DYNAMIC_LINKING; then + if $SHARED_LIBS; then + true + else + AC_MSG_WARN([You used --enable-dl but not --enable-shared.]) + AC_MSG_WARN([Are you sure that is what you want to do?]) + warn_msg_printed=true + fi +fi + +if test -n "$gxx_only"; then + AC_MSG_WARN($gxx_only) + warn_msg_printed=true +fi + +if test -n "$warn_gcc_version"; then + AC_MSG_WARN($warn_gcc_version) + warn_msg_printed=true +fi + +if test -n "$warn_gcc_only"; then + AC_MSG_WARN($warn_gcc_only) + warn_msg_printed=true +fi + +if test -n "$warn_readline"; then + AC_MSG_WARN($warn_readline) + warn_msg_printed=true +fi + +if test -n "$warn_termlibs"; then + AC_MSG_WARN($warn_termlibs) + warn_msg_printed=true +fi + +if test -n "$warn_gperf"; then + AC_MSG_WARN($warn_gperf) + warn_msg_printed=true +fi + +if test -n "$warn_flex"; then + AC_MSG_WARN($warn_flex) + warn_msg_printed=true +fi + +if test -n "$warn_bison"; then + AC_MSG_WARN($warn_bison) + warn_msg_printed=true +fi + +if test -n "$warn_less"; then + AC_MSG_WARN($warn_less) + warn_msg_printed=true +fi + +if test -n "$warn_blas_f77_incompatible"; then + AC_MSG_WARN($warn_blas_f77_incompatible) + warn_msg_printed=true +fi + +if test -n "$warn_umfpack"; then + AC_MSG_WARN($warn_umfpack) + warn_msg_printed=true +fi + +if test -n "$warn_qrupdate"; then + AC_MSG_WARN($warn_qrupdate) + warn_msg_printed=true +fi + +if test -n "$warn_amd"; then + AC_MSG_WARN($warn_amd) + warn_msg_printed=true +fi + +if test -n "$warn_colamd"; then + AC_MSG_WARN($warn_colamd) + warn_msg_printed=true +fi + +if test -n "$warn_ccolamd"; then + AC_MSG_WARN($warn_ccolamd) + warn_msg_printed=true +fi + +if test -n "$warn_cholmod"; then + AC_MSG_WARN($warn_cholmod) + warn_msg_printed=true +fi + +if test -n "$warn_cxsparse"; then + AC_MSG_WARN($warn_cxsparse) + warn_msg_printed=true +fi + +if test -n "$warn_arpack"; then + AC_MSG_WARN($warn_arpack) + warn_msg_printed=true +fi + +if test -n "$warn_curl"; then + AC_MSG_WARN($warn_curl) + warn_msg_printed=true +fi + +if test -n "$warn_fftw"; then + AC_MSG_WARN($warn_fftw) + warn_msg_printed=true +fi + +if test -n "$warn_glpk"; then + AC_MSG_WARN($warn_glpk) + warn_msg_printed=true +fi + +if test -n "$warn_magick"; then + AC_MSG_WARN($warn_magick) + warn_msg_printed=true +fi + +if test -n "$warn_hdf5"; then + AC_MSG_WARN($warn_hdf5) + warn_msg_printed=true +fi + +if test -n "$warn_regex"; then + AC_MSG_WARN($warn_regex) + warn_msg_printed=true +fi + +if test -n "$warn_pcre"; then + AC_MSG_WARN($warn_pcre) + warn_msg_printed=true +fi + +if test -n "$warn_qhull"; then + AC_MSG_WARN($warn_qhull) + warn_msg_printed=true +fi + +if test -n "$warn_zlib"; then + AC_MSG_WARN($warn_zlib) + warn_msg_printed=true +fi + +if test -n "$warn_ghostscript"; then + AC_MSG_WARN($warn_ghostscript) + warn_msg_printed=true +fi + +if test -n "$warn_makeinfo"; then + AC_MSG_WARN($warn_makeinfo) + warn_msg_printed=true +fi + +if test -n "$warn_texi2dvi"; then + AC_MSG_WARN($warn_texi2dvi) + warn_msg_printed=true +fi + +if test -n "$warn_texi2pdf"; then + AC_MSG_WARN($warn_texi2pdf) + warn_msg_printed=true +fi + +if test -n "$warn_64_bit"; then + AC_MSG_WARN($warn_64_bit) + warn_msg_printed=true +fi + +if test -n "$warn_gnuplot"; then + + ## If you change this text, be sure to also change the corresponding + ## set of warnings above. + + AC_MSG_WARN([]) + AC_MSG_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot]) + AC_MSG_WARN([installed, but you won't be able to use any of Octave's]) + AC_MSG_WARN([plotting commands without it.]) + AC_MSG_WARN([]) + AC_MSG_WARN([If gnuplot is installed but it isn't in your path, you can]) + AC_MSG_WARN([tell Octave where to find it by typing the command]) + AC_MSG_WARN([]) + AC_MSG_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"]) + AC_MSG_WARN([]) + AC_MSG_WARN([at the Octave prompt.]) + AC_MSG_WARN([]) + warn_msg_printed=true +fi + +if $USE_64_BIT_IDX_T; then + AC_MSG_WARN([]) + AC_MSG_WARN([You used the EXPERIMENTAL --enable-64 option.]) + AC_MSG_WARN([Are you sure that is what you want to do?]) + AC_MSG_WARN([]) + AC_MSG_WARN([You must ensure that the Fortran compiler generates]) + AC_MSG_WARN([code with 8 byte signed INTEGER values, and that your]) + AC_MSG_WARN([BLAS and LAPACK libraries are compiled to use 8 byte]) + AC_MSG_WARN([signed integers for array indexing.]) + AC_MSG_WARN([]) + warn_msg_printed=true +fi + +native_graphics=true +if test -n "$warn_freetype"; then + AC_MSG_WARN("$warn_freetype") + native_graphics=false + warn_msg_printed=true +fi + +if test -n "$warn_fontconfig"; then + AC_MSG_WARN("$warn_fontconfig") + native_graphics=false + warn_msg_printed=true +fi + +if test -n "$warn_ftgl"; then + AC_MSG_WARN("$warn_ftgl") + native_graphics=false + warn_msg_printed=true +fi + +if test -n "$warn_fltk_config"; then + AC_MSG_WARN("$warn_fltk_config") + native_graphics=false + warn_msg_printed=true +fi + +if test -n "$warn_fltk_opengl"; then + AC_MSG_WARN("$warn_fltk_opengl") + native_graphics=false + warn_msg_printed=true +fi + +if $native_graphics; then + true; +else + AC_MSG_WARN([]) + AC_MSG_WARN([I didn't find the necessary libraries to compile native]) + AC_MSG_WARN([graphics. It isn't necessary to have native graphics]) + AC_MSG_WARN([but you will have to use gnuplot or you won't be able]) + AC_MSG_WARN([to use any of Octave's plotting commands]) + AC_MSG_WARN([]) + warn_msg_printed=true +fi + +if $warn_msg_printed; then + AC_MSG_NOTICE([ + +NOTE: libraries may be skipped if a library is not found OR + if the library on your system is missing required features. +]) +fi + +### End of configure. diff -r 080e11f1b0c1 -r 4531741e5236 configure.in --- a/configure.in Tue Sep 15 17:17:13 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,2411 +0,0 @@ -dnl configure.in -dnl -dnl Process this file with autoconf to produce a configure script. -dnl -dnl Copyright (C) 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -dnl 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, -dnl 2009 John W. Eaton -### -### This file is part of Octave. -### -### Octave is free software; you can redistribute it and/or modify it -### under the terms of the GNU General Public License as published by the -### Free Software Foundation; either version 3 of the License, or (at -### your option) any later version. -### -### Octave is distributed in the hope that it will be useful, but WITHOUT -### ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -### FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -### for more details. -### -### You should have received a copy of the GNU General Public License -### along with Octave; see the file COPYING. If not, see -### . - -### Preserve CFLAGS and CXXFLAGS from the environment before doing -### anything else because we don't know which macros might call -### AC_PROG_CC or AC_PROG_CXX. - -EXTERN_CFLAGS="$CFLAGS" -EXTERN_CXXFLAGS="$CXXFLAGS" - -AC_INIT -AC_REVISION($Revision: 1.603 $) -AC_PREREQ(2.60) -AC_CONFIG_SRCDIR([src/octave.cc]) -AC_CONFIG_HEADER(config.h) - -OCTAVE_HOST_TYPE - -AC_DEFINE(OCTAVE_SOURCE, 1, [Define if this is Octave.]) - -dnl FIXME -- we should probably only generate this file if it is missing. -### Produce unistd.h for MSVC target, this simplifies changes in -### Octave source tree and avoid problems with lex-generated code. -case "$canonical_host_type" in - *-*-msdosmsvc) - AC_MSG_NOTICE([Generating replacement for for MSVC]) - cat << \EOF > unistd.h -/* File generated by configure script. */ -#include -#include -#include -EOF - CPPFLAGS="-I. $CPPFLAGS" - ;; -esac - -AC_USE_SYSTEM_EXTENSIONS - -### Path separator. -sepchar=: -AC_ARG_WITH(sepchar, - [AS_HELP_STRING([--with-sepchar=], - [use as the path separation character])]) -case $with_sepchar in - yes | "") - case "$canonical_host_type" in - *-*-mingw* | *-*-msdosmsvc) - sepchar=';' - ;; - esac - ;; - no) - AC_MSG_ERROR([You are required to define a path separation character]) - ;; - *) - sepchar=$with_sepchar - ;; -esac -AC_SUBST(sepchar) -AC_DEFINE_UNQUOTED(SEPCHAR, ['$sepchar'], [Define this to be the path separator for your system, as a character constant.]) -AC_DEFINE_UNQUOTED(SEPCHAR_STR, ["$sepchar"], [Define this to the path separator, as a string.]) - -### some defaults - -OCTAVE_SET_DEFAULT(man1dir, '$(mandir)/man1') -OCTAVE_SET_DEFAULT(man1ext, '.1') -OCTAVE_SET_DEFAULT(doc_cache_file, '$(octetcdir)/doc-cache') -OCTAVE_SET_DEFAULT(infofile, '$(infodir)/octave.info') -OCTAVE_SET_DEFAULT(octincludedir, '$(includedir)/octave-$(version)') -OCTAVE_SET_DEFAULT(fcnfiledir, '$(datadir)/octave/$(version)/m') -OCTAVE_SET_DEFAULT(localfcnfiledir, '$(datadir)/octave/site/m') -OCTAVE_SET_DEFAULT(localapifcnfiledir, - '$(datadir)/octave/site/$(api_version)/m') -OCTAVE_SET_DEFAULT(localverfcnfiledir, '$(datadir)/octave/$(version)/site/m') -OCTAVE_SET_DEFAULT(octetcdir, '$(datadir)/octave/$(version)/etc') -OCTAVE_SET_DEFAULT(octlibdir, '$(libdir)/octave-$(version)') -OCTAVE_SET_DEFAULT(archlibdir, - '$(libexecdir)/octave/$(version)/exec/$(canonical_host_type)') -OCTAVE_SET_DEFAULT(localarchlibdir, - '$(libexecdir)/octave/site/exec/$(canonical_host_type)') -OCTAVE_SET_DEFAULT(localapiarchlibdir, - '$(libexecdir)/octave/$(api_version)/site/exec/$(canonical_host_type)') -OCTAVE_SET_DEFAULT(localverarchlibdir, - '$(libexecdir)/octave/$(version)/site/exec/$(canonical_host_type)') -OCTAVE_SET_DEFAULT(octfiledir, - '$(libexecdir)/octave/$(version)/oct/$(canonical_host_type)') -OCTAVE_SET_DEFAULT(localoctfiledir, - '$(libexecdir)/octave/site/oct/$(canonical_host_type)') -OCTAVE_SET_DEFAULT(localapioctfiledir, - '$(libexecdir)/octave/site/oct/$(api_version)/$(canonical_host_type)') -OCTAVE_SET_DEFAULT(localveroctfiledir, - '$(libexecdir)/octave/$(version)/site/oct/$(canonical_host_type)') -OCTAVE_SET_DEFAULT(imagedir, '$(datadir)/octave/$(version)/imagelib') - -### Find pkg-config executable (sets $PKG_CONFIG) - -PKG_PROG_PKG_CONFIG - -### Make configure args available for other uses. - -config_opts=$ac_configure_args -AC_SUBST(config_opts) - -### Make it possible to have Octave's array and matrix classes do bounds -### checking on element references. This slows some operations down a -### bit, so it is turned off by default. - -BOUNDS_CHECKING=false -AC_ARG_ENABLE(bounds-check, - [AS_HELP_STRING([--enable-bounds-check], - [bounds checking for indexing in internal array classes (default is no)])], - [if test "$enableval" = yes; then BOUNDS_CHECKING=true; fi], []) -if $BOUNDS_CHECKING; then - AC_DEFINE(BOUNDS_CHECKING, 1, [Define to use internal bounds checking.]) -fi - -### If possible, use a 64-bit integer type for array dimensions and indexing. - -USE_64_BIT_IDX_T=false -OCTAVE_IDX_TYPE=int -AC_ARG_ENABLE(64, - [AS_HELP_STRING([--enable-64], - [(EXPERIMENTAL) use 64-bit integers for array dimensions and indexing])], - [if test "$enableval" = yes; then USE_64_BIT_IDX_T=true; fi], []) -if $USE_64_BIT_IDX_T; then - AC_CHECK_SIZEOF(void *) - AC_CHECK_SIZEOF(int) - AC_CHECK_SIZEOF(long) - if test $ac_cv_sizeof_void_p -eq 8; then - if test $ac_cv_sizeof_int -eq 8; then - OCTAVE_IDX_TYPE=int - elif test $ac_cv_sizeof_long -eq 8; then - OCTAVE_IDX_TYPE=long - AC_DEFINE(IDX_TYPE_LONG, 1, [Define to 1 if octave index type is long]) - else - warn_64_bit="no suitable type found for octave_idx_type so disabling 64-bit features" - AC_MSG_WARN($warn_64_bit) - USE_64_BIT_IDX_T=false - fi - else - warn_64_bit="pointers are not 64-bits wide so disabling 64-bit features" - AC_MSG_WARN($warn_64_bit) - USE_64_BIT_IDX_T=false - fi -fi -AC_SUBST(OCTAVE_IDX_TYPE) -if $USE_64_BIT_IDX_T; then - AC_DEFINE(USE_64_BIT_IDX_T, 1, [Define if using 64-bit integers for array dimensions and indexing]) -fi -AC_SUBST(USE_64_BIT_IDX_T) - -### It seems that there are some broken inline assembly functions in -### the GNU libc. Since I'm not sure how to test whether we are using -### GNU libc, just disable them for all platforms. - -AC_MSG_NOTICE([defining __NO_MATH_INLINES avoids buggy GNU libc exp function]) -AC_DEFINE(__NO_MATH_INLINES, 1, [Define if your version of GNU libc has buggy inline assembly code for math functions like exp.]) - -### See which C++ compiler to use (we expect to find g++). - -AC_PROG_CXX -AC_PROG_CXXCPP - -### Do special things for g++. - -gxx_version=`$CXX -v 2>&1 | grep "^.*g.. version" | \ - sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//' -e 's/ .*//'` - -case "$gxx_version" in - 1.* | 2.[[0123456789]].* | 3.[[01234]].*) - AC_MSG_ERROR([g++ version $gxx_version will probably fail to compile Octave] -) - ;; -esac - -CXX_VERSION= -if test -n "$gxx_version"; then - CXX_VERSION="$gxx_version" -fi -AC_SUBST(CXX_VERSION) - -OCTAVE_CXX_NEW_FRIEND_TEMPLATE_DECL -OCTAVE_CXX_ISO_COMPLIANT_LIBRARY -OCTAVE_CXX_BROKEN_REINTERPRET_CAST - -### See which C compiler to use (we expect to find gcc). - -AC_PROG_CC -AC_PROG_CPP -AC_PROG_GCC_TRADITIONAL - -### Do special things for gcc. - -gcc_version=`$CC -v 2>&1 | grep "^.*gcc version" | \ - sed -e 's/^.*g.. version *//' -e 's/cygnus-//' -e 's/egcs-//'` -case "$gcc_version" in - 2.*) - if test -z "$LDFLAGS"; then - LDFLAGS="-g" - AC_MSG_NOTICE([defining LDFLAGS to be $LDFLAGS]) - fi - ;; - 1.*) - warn_gcc_version="gcc version $gcc_version is likely to cause problems" - AC_MSG_WARN($warn_gcc_version) - ;; -esac - -CC_VERSION= -if test -n "$gcc_version"; then - CC_VERSION="$gcc_version" -fi -AC_SUBST(CC_VERSION) - -### The flag to create dependency varies depending on the compier. - -# Assume GCC. -INCLUDE_DEPS=true -DEPEND_FLAGS="-M" -DEPEND_EXTRA_SED_PATTERN="" -if test "$GCC" = yes; then - true -else - case "$canonical_host_type" in - sparc-sun-solaris2* | i386-pc-solaris2*) - DEPEND_FLAGS="-xM1" - DEPEND_EXTRA_SED_PATTERN="-e '/\/opt\/SUNWspro/d'" - ;; - *-*-msdosmsvc) - ;; - *) - INCLUDE_DEPS=false - ;; - esac -fi -AC_SUBST(INCLUDE_DEPS) -AC_SUBST(DEPEND_FLAGS) -AC_SUBST(DEPEND_EXTRA_SED_PATTERN) - -sinclude(acx_pthread.m4) -ACX_PTHREAD - -AC_PATH_X -if test "$have_x"; then - AC_DEFINE(HAVE_X_WINDOWS, 1, [Define if you have X11]) - - if test "$x_includes" != "NONE"; then - X11_INCFLAGS="$x_includes" - fi - AC_SUBST(X11_INCFLAGS) - - if test -z $x_libraries; then - AC_CHECK_LIB(X11, XrmInitialize, [X11_LIBS=-lX11], [X11_LIBS=]) - elif test $x_libraries != "NONE"; then - AC_CHECK_LIB(X11, XrmInitialize, - [X11_LIBS="-L$x_libraries -lX11"], [X11_LIBS=], "-L$x_libraries") - fi - AC_SUBST(X11_LIBS) -fi - -### On MacOSX system the Carbon framework is used to determine ScreenSize -OCTAVE_HAVE_FRAMEWORK(Carbon, [#include ], [CGMainDisplayID ()], - [have_framework_carbon="yes"], [have_framework_carbon="no"]) -if test $have_framework_carbon = "yes"; then - AC_DEFINE(HAVE_FRAMEWORK_CARBON, 1, [Define if framework CARBON is available.]) - CARBON_LIBS="-Wl,-framework -Wl,Carbon" - AC_MSG_NOTICE([adding -Wl,-framework -Wl,Carbon to CARBON_LIBS]) - AC_SUBST(CARBON_LIBS) -fi - -### When compiling math for x87, problems may arise in some code comparing -### floating-point intermediate results. -### Generally, it helps to store the result in a local volatile variable, -### but it also degrades performance. -### Thus, we provide a FLOAT_TRUNCATE macro that may be defined to "volatile" -### when compiling for x87 target, or left empty for modern SSE math, that -### doesn't suffer from this problem at all. -AC_ARG_ENABLE(float-truncate, - [AS_HELP_STRING([--enable-float-truncate], - [enables truncating intermediate FP results.])], - [if test "$enableval" = yes; then ac_float_truncate=volatile; - else ac_float_truncate=; fi], - ac_float_truncate=) - -AC_DEFINE_UNQUOTED(FLOAT_TRUNCATE, $ac_float_truncate, - [Define to volatile if you need truncating intermediate FP results]) - -### On Intel systems with gcc, we may need to compile with -mieee-fp -### and -ffloat-store to get full support for IEEE floating point. -### -### On Alpha/OSF systems, we need -mieee. - -ieee_fp_flag= -case "$canonical_host_type" in - ## Keep this pattern first, so that it is preferred over the - ## following pattern for x86. - *-*-msdosmsvc) - CXXFLAGS="$CXXFLAGS -EHs -MD" - CFLAGS="$CFLAGS -MD" - ;; - i[[3456789]]86-*-*) - if test "$GCC" = yes; then - OCTAVE_CC_FLAG(-mieee-fp, [ - ieee_fp_flag=-mieee-fp - XTRA_CFLAGS="$XTRA_CFLAGS -mieee-fp" - AC_MSG_NOTICE([adding -mieee-fp to XTRA_CFLAGS])]) - -### OCTAVE_CC_FLAG(-ffloat-store, [ -### float_store_flag=-ffloat-store -### XTRA_CFLAGS="$XTRA_CFLAGS -ffloat-store" -### AC_MSG_RESULT([adding -ffloat-store to XTRA_CFLAGS])]) - fi - if test "$GXX" = yes; then - OCTAVE_CXX_FLAG(-mieee-fp, [ - ieee_fp_flag=-mieee-fp - XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mieee-fp" - AC_MSG_NOTICE([adding -mieee-fp to XTRA_CXXFLAGS])]) - -### OCTAVE_CXX_FLAG(-ffloat-store, [ -### float_store_flag=-ffloat-store -### XTRA_CXXFLAGS="$XTRA_CXXFLAGS -ffloat-store" -### AC_MSG_RESULT([adding -ffloat-store to XTRA_CXXFLAGS])]) - fi - ;; - alpha*-*-*) - if test "$GCC" = yes; then - OCTAVE_CC_FLAG(-mieee, [ - ieee_fp_flag=-mieee - XTRA_CFLAGS="$XTRA_CFLAGS -mieee" - AC_MSG_NOTICE([adding -mieee to XTRA_CFLAGS])]) - else - OCTAVE_CC_FLAG(-ieee, [ - ieee_fp_flag=-ieee - XTRA_CFLAGS="$XTRA_CFLAGS -ieee" - AC_MSG_NOTICE([adding -ieee to XTRA_CFLAGS])]) - fi - if test "$GXX" = yes; then - OCTAVE_CXX_FLAG(-mieee, [ - ieee_fp_flag=-mieee - XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mieee" - AC_MSG_NOTICE([adding -mieee to XTRA_CXXFLAGS])]) - else - OCTAVE_CXX_FLAG(-ieee, [ - ieee_fp_flag=-ieee - XTRA_CXXFLAGS="$XTRA_CXXFLAGS -ieee" - AC_MSG_NOTICE([adding -ieee to XTRA_CXXFLAGS])]) - fi - ;; - *ibm-aix4*) - OCTAVE_CC_FLAG(-mminimal-toc, [ - XTRA_CFLAGS="$XTRA_CFLAGS -mminimal-toc"]) - - OCTAVE_CXX_FLAG(-mminimal-toc, [ - XTRA_CXXFLAGS="$XTRA_CXXFLAGS -mminimal-toc"]) - ;; -esac - -AC_SUBST(XTRA_CFLAGS) -AC_SUBST(XTRA_CXXFLAGS) - -### Use -static if compiling on Alpha OSF/1 1.3 systems. - -case "$canonical_host_type" in - alpha*-dec-osf1.3) - LD_STATIC_FLAG=-static - ;; -esac -if test -n "$LD_STATIC_FLAG"; then - AC_MSG_NOTICE([defining LD_STATIC_FLAG to be $LD_STATIC_FLAG]) -fi -AC_SUBST(LD_STATIC_FLAG) - -### Defaults for cross compiling. BUILD_CC and BUILD_CXX are -### the compilers that we use for building tools on the build system. -### For now, we assume that the only cross compiling we can do is -### with gcc on a Unixy system, but the dedicated hacker can override these. - -if test "$cross_compiling" = yes; then - BUILD_CC="gcc" - BUILD_CFLAGS="-O2 -g" - BUILD_CXX="g++" - BUILD_CXXFLAGS="-O2 -g" - BUILD_LDFLAGS="" - BUILD_EXEEXT="" -else - BUILD_CC='$(CC)' - BUILD_CFLAGS='$(CFLAGS)' - BUILD_CXX='$(CXX)' - BUILD_CXXFLAGS='$(CXXFLAGS)' - BUILD_LDFLAGS='$(LDFLAGS)' - case "$canonical_host_type" in - sparc-sun-solaris2*) - if test "$GCC" != yes; then - ## The Sun C++ compiler never seems to complete compiling - ## gendoc.cc unless we reduce the optimization level... - BUILD_CXXFLAGS="-g -O1" - fi - ;; - esac - BUILD_EXEEXT='$(EXEEXT)' -fi - -AC_ARG_VAR(BUILD_CC, [build system C compiler (used if cross compiling)]) -AC_ARG_VAR(BUILD_CFLAGS, [build system C compiler flags (used if cross compiling)]) -AC_ARG_VAR(BUILD_CXX, [build system C++ compiler (used if cross compiling)]) -AC_ARG_VAR(BUILD_CXXFLAGS, [build system C++ compiler flags (used if cross compiling)]) -AC_ARG_VAR(BUILD_LDFLAGS, [build system C++ compiler link flags (used if cross compiling)]) -AC_ARG_VAR(BUILD_EXEEXT, [build system executable extension (used if cross compiling)]) - -dnl This is bogus. We shouldn't have to explicitly add libc too! -dnl Keep this check before the check for the Fortran compiler, -dnl in case -lm is needed to compile Fortran programs. - -### Look for math library. If found, this will add -lm to LIBS. - -case "$canonical_host_type" in - *-*-nextstep*) - ;; - *-*-linux*) - AC_CHECK_LIB(m, sin, , , -lc) - ;; - *) - AC_CHECK_LIB(m, sin) - ;; -esac - -## Default FFLAGS is -O. -if test "x$FFLAGS" = x; then - FFLAGS="-O" -fi - -## the F77 variable, if set, overrides AC_PROG_F77 automatically -AC_PROG_F77 -AC_F77_LIBRARY_LDFLAGS -AC_F77_DUMMY_MAIN -AC_F77_WRAPPERS - -F77_TOLOWER=true -F77_APPEND_UNDERSCORE=true -F77_APPEND_EXTRA_UNDERSCORE=true - -case "$ac_cv_f77_mangling" in - "upper case") F77_TOLOWER=false ;; -esac -case "$ac_cv_f77_mangling" in - "no underscore") F77_APPEND_UNDERSCORE=false ;; -esac -case "$ac_cv_f77_mangling" in - "no extra underscore") F77_APPEND_EXTRA_UNDERSCORE=false ;; -esac - -case "$canonical_host_type" in - i[[3456789]]86-*-*) - if test "$ac_cv_f77_compiler_gnu" = yes; then - OCTAVE_F77_FLAG(-mieee-fp) -### OCTAVE_F77_FLAG(-ffloat-store) - fi - ;; - alpha*-*-*) - if test "$ac_cv_f77_compiler_gnu" = yes; then - OCTAVE_F77_FLAG(-mieee) - else - OCTAVE_F77_FLAG(-ieee) - OCTAVE_F77_FLAG(-fpe1) - fi - ;; - powerpc-apple-machten*) - FFLAGS= - ;; -esac - -if test -n "$FFLAGS"; then - AC_MSG_NOTICE([defining FFLAGS to be $FFLAGS]) -fi - -AC_SUBST(F77_TOLOWER) -AC_SUBST(F77_APPEND_UNDERSCORE) -AC_SUBST(F77_APPEND_EXTRA_UNDERSCORE) - -if test -z "$F77"; then - AC_MSG_ERROR([in order to build octave, you must have a compatible Fortran compiler or wrapper script for f2c that functions as a Fortran compiler installed and in your path. See the file INSTALL for more information.]) -fi - -OCTAVE_CHECK_FORTRAN_INTEGER_SIZE -if test "x$octave_cv_fortran_integer_size" = xno; then - if $USE_64_BIT_IDX_T; then - case "$F77" in - gfortran) - case "$FFLAGS" in - *-fdefault-integer-8*) - ;; - *) - AC_MSG_NOTICE([adding -fdefault-integer-8 to FFLAGS]) - FFLAGS="-fdefault-integer-8 $FFLAGS" - ## Invalidate the cache and try again. - $as_unset octave_cv_fortran_integer_size - ;; - esac - ;; - esac - if test -z "$octave_cv_fortran_integer_size"; then - OCTAVE_CHECK_FORTRAN_INTEGER_SIZE - fi - if test "x$octave_cv_fortran_integer_size" = xno; then - AC_MSG_ERROR([in order to build octave with 64-bit indexing support your Fortran compiler must have a default integer size of 8 bytes. See the file INSTALL for more information.]) - fi - else - AC_MSG_ERROR([your Fortran compiler must have default integers that are the same size as octave_idx_type ($OCTAVE_IDX_TYPE). See the file INSTALL for more information.]) - fi -fi - -FC=$F77 -AC_SUBST(FC) - -OCTAVE_F77_FLAG(-ffloat-store, [ -AC_MSG_RESULT([setting F77_FLOAT_STORE_FLAG to -ffloat-store]) -F77_FLOAT_STORE_FLAG=-ffloat-store -AC_SUBST(F77_FLOAT_STORE_FLAG) -]) - -OCTAVE_IEEE754_DATA_FORMAT - -### Check for the QHull library - -OCTAVE_CHECK_LIBRARY(qhull, QHull, - [Qhull library not found -- this will result in loss of functionality of some geometry functions.], - [qhull/qhull_a.h], [qh_qhull], [], [], - [warn_qhull= - OCTAVE_CHECK_QHULL_VERSION - OCTAVE_CHECK_QHULL_OK([TEXINFO_QHULL="@set HAVE_QHULL" - AC_DEFINE(HAVE_QHULL, 1, [Define if QHull is available.])], [ - warn_qhull="Qhull library found, but seems not to work properly -- this will result in loss of functionality of some geometry functions. Please try recompiling the library with -fno-strict-aliasing."])]) - -### Check for pcre/regex library. - -## check for pcre-config, and if so, set CPPFLAGS appropriately -AC_CHECK_PROG(WITH_PCRE_CONFIG, pcre-config, yes, no) -if test $WITH_PCRE_CONFIG = yes ; then - CPPFLAGS="$CPPFLAGS $(pcre-config --cflags)" -fi - -## NB: no need to do separate check for pcre.h header -- checking macros is good enough -AC_CACHE_CHECK([whether pcre.h defines the macros we need], [ac_cv_pcre_h_macros_present], [ - AC_EGREP_CPP([PCRE_HAS_MACROS_WE_NEED], [ -#include -#if defined (PCRE_INFO_NAMECOUNT) \ - && defined (PCRE_INFO_NAMEENTRYSIZE) \ - && defined (PCRE_INFO_NAMETABLE) -PCRE_HAS_MACROS_WE_NEED -#endif], ac_cv_pcre_h_macros_present=yes, ac_cv_pcre_h_macros_present=no)]) -WITH_PCRE="$ac_cv_pcre_h_macros_present" - -REGEX_LIBS= - -using_pcre=no -using_regex=no - -if test "$WITH_PCRE" = yes; then - if test "$WITH_PCRE_CONFIG" = yes; then - REGEX_LIBS=$(pcre-config --libs) - else - REGEX_LIBS=-lpcre - fi - save_LIBS="$LIBS" - LIBS="$REGEX_LIBS $LIBS" - AC_CHECK_FUNCS(pcre_compile, [using_pcre=yes - AC_DEFINE(HAVE_PCRE, 1, [Define if PCRE library is available.])], [ - REGEX_LIBS= - warn_pcre="PCRE library not found. This will result in some loss of functionality for the regular expression matching functions." - AC_MSG_WARN($warn_pcre)]) - LIBS="$save_LIBS" -else - warn_pcre="PCRE library not found. This will result in some loss of functionality for the regular expression matching functions." - AC_MSG_WARN($warn_pcre) -fi - -AC_CHECK_FUNCS(regexec, [using_regex=yes], [ - AC_CHECK_LIB(regex, regexec, [using_regex=yes - REGEX_LIBS="-lregex $REGEX_LIBS"], [ - warn_regex="regular expression functions not found. The regular expression matching functions will be disabled." - AC_MSG_WARN($warn_regex)])]) - -if test "$using_regex" = yes; then - AC_DEFINE(HAVE_REGEX, 1, [Define if regex library is available.]) -fi - -AC_SUBST(REGEX_LIBS) - -### Check for ZLIB library. - -OCTAVE_CHECK_LIBRARY(z, ZLIB, - [ZLIB library not found. Octave will not be able to save or load compressed data files or HDF5 files.], - [zlib.h], [gzclearerr]) - -### Check for HDF5 library. - -save_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="$Z_CPPFLAGS $CPPFLAGS" -save_LIBS="$LIBS" -LIBS="$Z_LDFLAGS $Z_LIBS $LIBS" -OCTAVE_CHECK_LIBRARY(hdf5, HDF5, - [HDF5 library not found. Octave will not be able to save or load HDF5 data files.], - [hdf5.h], [H5Gget_num_objs], [], [], - [warn_hdf5= - OCTAVE_HDF5_HAS_REQUIRED_API - if test $octave_hdf5_ok = yes; then - TEXINFO_HDF5="@set HAVE_HDF5" - AC_DEFINE(HAVE_HDF5, 1, [Define if HDF5 is available.]) - AC_DEFINE(HAVE_H5GGET_NUM_OBJS, 1, [Define if HDF5 has H5Gget_num_objs.]) - case "$canonical_host_type" in - *-*-msdosmsvc) - OCTAVE_HDF5_DLL - ;; - esac - fi]) -CPPFLAGS="$save_CPPFLAGS" -LIBS="$save_LIBS" - - -# Subdirectory of libcruft to build if fftw is not found: - -FFT_DIR="fftpack" -AC_SUBST(FFT_DIR) - -# Checks for FFTW header and library. - -OCTAVE_CHECK_LIBRARY(fftw3, FFTW3, - [FFTW3 library not found. The slower FFTPACK library will be used instead.], - [fftw3.h], [fftw_plan_dft_1d]) - -OCTAVE_CHECK_LIBRARY(fftw3f, FFTW3F, - [FFTW3F library not found. The slower FFTPACK library will be used instead.], - [fftw3.h], [fftwf_plan_dft_1d]) - -if test -n "$FFTW3_LIBS" && test -n "$FFTW3F_LIBS"; then - FFT_DIR= -fi - -# Checks for GLPK header and library. - -save_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="$Z_CPPFLAGS $CPPFLAGS" -save_LIBS="$LIBS" -LIBS="$Z_LDFLAGS $Z_LIBS $LIBS" -OCTAVE_CHECK_LIBRARY(glpk, GLPK, - [GLPK library not found. The glpk function for solving linear programs will be disabled.], - [glpk/glpk.h glpk.h], [_glp_lpx_simplex]) -LIBS="$save_LIBS" -CPPFLAGS="$save_CPPFLAGS" - -# Checks for CURL header and library. - -save_CPPFLAGS="$CPPFLAGS" -CPPFLAGS="$Z_CPPFLAGS $CPPFLAGS" -save_LIBS="$LIBS" -LIBS="$Z_LDFLAGS $Z_LIBS $LIBS" -OCTAVE_CHECK_LIBRARY(curl, cURL, - [cURL library not found. The urlread and urlwrite functions will be disabled.], - [curl/curl.h], [curl_easy_escape]) -LIBS="$save_LIBS" -CPPFLAGS="$save_CPPFLAGS" - -### GraphicsMagick++ - -warn_magick="GraphicsMagick++ library not found. The imread function for reading image files will not be fully functional." - -MAGICK_CPPFLAGS= -MAGICK_LDFLAGS= -MAGICK_LIBS= - -PKG_CHECK_EXISTS([GraphicsMagick++], [ - ## Make sure we only get -I, -L and -l flags. Some GraphicsMagick++ - ## packages adds extra flags that are useful when building - ## GraphicsMagick++ extentions. These extra flags break the Octave build. - MAGICK_LDFLAGS=`$PKG_CONFIG --libs-only-L GraphicsMagick++` - MAGICK_LIBS=`$PKG_CONFIG --libs-only-l GraphicsMagick++` - MAGICK_CPPFLAGS=`$PKG_CONFIG --cflags-only-I GraphicsMagick++` - - warn_magick="GraphicsMagick++ library fails tests. The imread function for reading image files will not be fully functional." - - save_CPPFLAGS="$CPPFLAGS" - save_LIBS="$LIBS" - CPPFLAGS="$MAGICK_CPPFLAGS $CPPFLAGS" - LIBS="$MAGICK_LDFLAGS $MAGICK_LIBS $LIBS" - AC_LANG_PUSH(C++) - AC_CHECK_HEADER([Magick++.h], [ - AC_MSG_CHECKING([for Magick::ColorRGB in Magick++.h]) - AC_TRY_LINK([#include ], [Magick::ColorRGB c;], [ - AC_MSG_RESULT(yes) - warn_magick= - ], [ - AC_MSG_RESULT(no) - ]) - ]) - AC_LANG_POP(C++) - CPPFLAGS="$save_CPPFLAGS" - LIBS="$save_LIBS" -]) - -if test -z "$warn_magick"; then - AC_DEFINE(HAVE_MAGICK, 1, [Define if GraphicsMagick++ is available.]) -else - MAGICK_CPPFLAGS= - MAGICK_LDFLAGS= - MAGICK_LIBS= -fi -AC_SUBST(MAGICK_CPPFLAGS) -AC_SUBST(MAGICK_LDFLAGS) -AC_SUBST(MAGICK_LIBS) - -# --------------------------------------------------------------------- - -## libraries needed for graphics - -warn_freetype="" -warn_ftgl="" - -OCTAVE_OPENGL -if test -n "$OPENGL_LIBS"; then - AC_DEFINE(HAVE_OPENGL, 1, [Define if OpenGL is available]) - -## ftgl (needs freetype 2) - AC_CHECK_FT2([9.0.3],[AC_DEFINE(HAVE_FREETYPE, 1, [Define to 1 if you have Freetype library.])], - [warn_freetype="FreeType library not found. Native renderer will not have on-screen text"]) - if test -z "$warn_freetype"; then - AC_LANG_PUSH(C++) - save_LIBS="$LIBS" - save_CXXFLAGS="$CXXFLAGS" - save_CPPFLAGS="$CPPFLAGS" - LIBS="$LIBS $FT2_LIBS $OPENGL_LIBS" - CXXFLAGS="$CXXFLAGS $FT2_CFLAGS" - CPPFLAGS="$CPPFLAGS $FT2_CFLAGS" - has_ftgl_h=yes - AC_CHECK_HEADERS([FTGL/ftgl.h ftgl.h], break, [ - AC_CHECK_HEADERS([FTGL/FTGL.h FTGL.h], [ - AC_DEFINE(HAVE_FTGL_UPPERCASE, 1, [Define to 1 if you have FTGL.h or FTGL/FTGL.h]) - break - ], has_ftgl_h=no)]) - if test "$has_ftgl_h" = yes; then - AC_MSG_CHECKING([for FTGLTextureFont in -lftgl]) - LIBS="$save_LIBS -lftgl $FT2_LIBS $OPENGL_LIBS" - AC_TRY_LINK([ -#ifdef HAVE_FTGL_FTGL_H -#ifdef HAVE_FTGL_UPPERCASE -#include -#else -#include -#endif -#include -#elif HAVE_FTGL_H -#ifdef HAVE_FTGL_UPPERCASE -#include -#else -#include -#endif -#include -#endif], [ -FTGLTextureFont font("");], [ - OPENGL_LIBS="-lftgl $FT2_LIBS $OPENGL_LIBS" - LIBS="$save_LIBS" - CPPFLAGS="$save_CPPFLAGS" - AC_DEFINE(HAVE_FTGL, 1, [Define to 1 if FTGL is present]) - AC_MSG_RESULT(yes) - XTRA_CXXFLAGS="$XTRA_CXXFLAGS $FT2_CFLAGS"], [ - AC_MSG_RESULT(no) - warn_ftgl="FTGL library not found. Native renderer will not have on-screen text" - ]) - LIBS="$save_LIBS" - CXXFLAGS="$save_CXXFLAGS" - CPPFLAGS="$save_CPPFLAGS" - else - warn_ftgl="FTGL headers not found. Native renderer will not have on-screen text" - fi - AC_LANG_POP(C++) - fi -fi - -# fontconfig library - -warn_fontconfig="" -if test -z "$warn_freetype"; then - PKG_CHECK_MODULES(FONTCONFIG,[fontconfig],[ - have_fontconfig=yes - OPENGL_LIBS="$FONTCONFIG_LIBS $OPENGL_LIBS" - XTRA_CXXFLAGS="$XTRA_CXXFLAGS $FONTCONFIG_CFLAGS" - AC_DEFINE(HAVE_FONTCONFIG, 1, [Define to 1 if fontconfig is present])],[ - have_fontconfig=no - warn_fontconfig="Fontconfig not found. Native text rendering will use hard-coded font instead."]) -fi - -GRAPHICS_LIBS= -GRAPHICS_CFLAGS= - -## fltk (www.fltk.org) -AC_ARG_WITH(fltk-prefix, - [ --with-fltk-prefix=PFX Prefix where FLTK is installed (optional)], - fltk_prefix="$withval", - fltk_prefix="") -AC_ARG_WITH(fltk-exec-prefix, - [ --with-fltk-exec-prefix=PFX Exec prefix where FLTK is installed (optional)], - fltk_exec_prefix="$withval", - fltk_exec_prefix="") - -if test -n "$fltk_exec_prefix"; then - fltk_args="$fltk_args --exec-prefix=$fltk_exec_prefix" - if test "x${FLTK_CONFIG+set}" != xset ; then - FLTK_CONFIG="$fltk_exec_prefix/bin/fltk-config" - fi -fi - -if test -n "$fltk_prefix"; then - fltk_args="$fltk_args --prefix=$fltk_prefix" - if test x${FLTK_CONFIG+set} != xset ; then - FLTK_CONFIG="$fltk_prefix/bin/fltk-config" - fi -fi - -AC_PATH_PROG(FLTK_CONFIG, fltk-config, no) - -warn_fltk_config="" -warn_fltk_opengl="" - -if test "$FLTK_CONFIG" = "no" ; then - warn_fltk_config="FLTK config script not found. Native graphics will be disabled." -else - FLTK_CFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --cflags`" - FLTK_LDFLAGS="`$FLTK_CONFIG $fltkconf_args --use-gl --ldflags`" - - AC_MSG_CHECKING(for OpenGL support in FLTK) - cat > conftest.cc < - int nothing=0; -EOF - $CXX $CXXFLAGS $FLTK_CFLAGS -c conftest.cc || \ - warn_fltk_opengl="FLTK does not have OpenGL support. Native graphics will be disabled." - - if test -z "$warn_fltk_opengl"; then - AC_MSG_RESULT(yes) - AC_DEFINE(HAVE_FLTK, 1, [Define if FLTK is available]) - GRAPHICS_CFLAGS="$FLTK_CFLAGS" - GRAPHICS_LIBS="$FLTK_LDFLAGS" - else - AC_MSG_RESULT(no) - fi -fi - -AC_SUBST(GRAPHICS_CFLAGS) -AC_SUBST(GRAPHICS_LIBS) - -# ---------------------------------------------------------------------- - -OCTAVE_PROG_AR - -AC_PROG_RANLIB - -XTRA_CRUFT_SH_LDFLAGS= -case "$canonical_host_type" in - *-*-msdosmsvc) - FLIBS="$FLIBS -lkernel32" - XTRA_CRUFT_SH_LDFLAGS="-Wl,-def:cruft.def" - ;; -esac -AC_SUBST(XTRA_CRUFT_SH_LDFLAGS) - -### Checks for BLAS and LAPACK libraries: -# (Build subdirectories of libcruft if they aren't found on the system.) -sinclude(acx_blas.m4) -sinclude(acx_blas_f77_func.m4) -sinclude(acx_lapack.m4) -ACX_BLAS_WITH_F77_FUNC([], [BLAS_DIR="blas"]) -ACX_LAPACK([BLAS_LIBS="$LAPACK_LIBS $BLAS_LIBS"], [LAPACK_DIR="lapack"]) -AC_SUBST(BLAS_DIR) -AC_SUBST(LAPACK_DIR) - -if test "x$acx_blas_f77_func_ok" = "xno"; then - warn_blas_f77_incompatible="A BLAS library was detected but found incompatible with your Fortran 77 compiler. The reference BLAS implementation will be used. To improve performance, consider using a different Fortran compiler or a switch like -ff2c to make your Fortran compiler use a calling convention compatible with the way your BLAS library was compiled, or use a different BLAS library." - AC_MSG_WARN($warn_blas_f77_incompatible) -fi - -# Check for the qrupdate library - -save_LIBS="$LIBS" -LIBS="$BLAS_LIBS $FLIBS $LIBS" -OCTAVE_CHECK_LIBRARY(qrupdate, qrupdate, - [qrupdate not found. The QR & Cholesky updating functions will be slow.], - [], - [F77_FUNC(sqr1up,SQR1UP)], - [], [don't use qrupdate, disable QR & Cholesky updating functions]) -LIBS="$save_LIBS" - -# Check for AMD library - -OCTAVE_CHECK_LIBRARY(amd, AMD, - [AMD library not found. This will result in some lack of functionality for sparse matrices.], - [suitesparse/amd.h ufsparse/amd.h amd/amd.h amd.h], - [amd_postorder], - [], [don't use AMD library, disable some sparse functionality]) - -# Check for CAMD library - -OCTAVE_CHECK_LIBRARY(camd, CAMD, - [CAMD library not found. This will result in some lack of functionality for sparse matrices.], - [suitesparse/camd.h ufsparse/camd.h amd/camd.h camd.h], - [camd_postorder], - [], [don't use CAMD library, disable some sparse functionality]) - -# Check for COLAMD library - -OCTAVE_CHECK_LIBRARY(colamd, COLAMD, - [COLAMD library not found. This will result in some lack of functionality for sparse matrices.], - [suitesparse/colamd.h ufsparse/colamd.h amd/colamd.h colamd.h], - [colamd], - [], [don't use COLAMD library, disable some sparse functionality]) - -# Check for CCOLAMD library - -OCTAVE_CHECK_LIBRARY(ccolamd, CCOLAMD, - [CCOLAMD library not found. This will result in some lack of functionality for sparse matrices.], - [suitesparse/ccolamd.h ufsparse/ccolamd.h amd/ccolamd.h ccolamd.h], - [ccolamd], - [], [don't use CCOLAMD library, disable some sparse functionality]) - -# Check for CHOLMOD library. If your cholmod library requires cblas, -# then you will need to configure with --with-cholmod="-lcholmod -lcblas". - -save_LIBS="$LIBS" -LIBS="$BLAS_LIBS $FLIBS $LIBS" -OCTAVE_CHECK_LIBRARY(cholmod, CHOLMOD, - [CHOLMOD library not found. This will result in some lack of functionality for sparse matrices.], - [suitesparse/cholmod.h ufsparse/cholmod.h cholmod/cholmod.h cholmod.h], - [cholmod_start], - [], [don't use CHOLMOD library, disable some sparse functionality]) -LIBS="$save_LIBS" - -# Check for CXSparse library - -OCTAVE_CHECK_LIBRARY(cxsparse, CXSparse, - [CXSparse library not found. This will result in some lack of functionality for sparse matrices.], - [suitesparse/cs.h ufsparse/cs.h amd/cs.h cs.h], - [cs_di_sqr], - [C++], [don't use CXSparse library, disable some sparse functionality]) - -# Check for UMFPACK library. - -save_LIBS="$LIBS" -LIBS="$AMD_LDFLAGS $AMD_LIBS $BLAS_LIBS $FLIBS $LIBS" -OCTAVE_CHECK_LIBRARY(umfpack, UMFPACK, - [UMFPACK not found. This will result in some lack of functionality for sparse matrices.], - [suitesparse/umfpack.h ufsparse/umfpack.h umfpack/umfpack.h umfpack.h], - [umfpack_zi_get_determinant], - [], [don't use UMFPACK, disable some sparse functionality]) -LIBS="$save_LIBS" - -if test -z "$UMFPACK_LIBS"; then - ## Invalidate the cache and try again with -lcblas. - $as_unset ac_cv_lib_umfpack_umfpack_zi_get_determinant - save_LIBS="$LIBS" - LIBS="-lcblas $AMD_LDFLAGS $AMD_LIBS $BLAS_LIBS $FLIBS $LIBS" - OCTAVE_CHECK_LIBRARY(umfpack, UMFPACK, - [UMFPACK not found. This will result in some lack of functionality for sparse matrices.], - [suitesparse/umfpack.h ufsparse/umfpack.h umfpack/umfpack.h umfpack.h], - [umfpack_zi_get_determinant], - [], [don't use UMFPACK, disable some sparse functionality]) - if test -n "$UMFPACK_LIBS"; then - UMFPACK_LIBS="$UMFPACK_LIBS -lcblas" - fi - LIBS="$save_LIBS" -fi - -if test -n "$UMFPACK_LIBS"; then - save_LIBS="$LIBS"; - LIBS="$UMFPACK_LIBS $AMD_LIBS $BLAS_LIBS $FLIBS $LIBS" - OCTAVE_UMFPACK_SEPERATE_SPLIT - LIBS="$save_LIBS" -fi - -save_LIBS="$LIBS" -LIBS="$LAPACK_LIBS $BLAS_LIBS $FLIBS $LIBS" -OCTAVE_CHECK_LIBRARY(arpack, ARPACK, - [arpack not found. The eigs function will be disabled.], - [], - [F77_FUNC(dseupd,DSEUPD)], - [], [don't use the ARPACK library, disable eigs function]) -LIBS="$save_LIBS" - -### Handle shared library options. - -### Enable creation of static libraries. - -AC_ARG_ENABLE(static, - [AS_HELP_STRING([--enable-static], [create static libraries])], - [if test "$enableval" = no; then STATIC_LIBS=false; - else STATIC_LIBS=true; fi], - STATIC_LIBS=false) -AC_SUBST(STATIC_LIBS) - -### Enable creation of shared libraries. Currently only works with -### gcc on some systems. - -AC_ARG_ENABLE(shared, - [AS_HELP_STRING([--enable-shared], - [create shared libraries (not all systems)])], - [if test "$enableval" = no; then SHARED_LIBS=false; - else SHARED_LIBS=true; fi], - SHARED_LIBS=true) -AC_SUBST(SHARED_LIBS) - -### Enable dynamic linking. --enable-shared implies this, so -### --enable-dl is only need if you are only building static libraries -### and want to try dynamic linking too (works on some systems, for -### example, OS X and Windows). - -AC_ARG_ENABLE(dl, - [AS_HELP_STRING([--enable-dl], - [create shared libraries (not all systems)])], - [if test "$enableval" = no; then ENABLE_DYNAMIC_LINKING=false; - else ENABLE_DYNAMIC_LINKING=true; fi], - ENABLE_DYNAMIC_LINKING=true) - -if $STATIC_LIBS || $SHARED_LIBS; then - true -else - AC_MSG_ERROR([You can't disable building static AND shared libraries!]) -fi - -AC_ARG_ENABLE(rpath, - [AS_HELP_STRING([--enable-rpath], - [override the default link options for rpath; e.g., --enable-rpath='-rpath $(octlibdir)'])], - [ if test "$enableval" = no; then use_rpath=false; - else - use_rpath=true - if test "$enableval" = yes; then true; - else enable_rpath_arg="$enableval"; fi - fi], [use_rpath=true]) - -CPICFLAG=-fPIC -CXXPICFLAG=-fPIC -FPICFLAG=-fPIC -SHLEXT=so -SHLLIB='$(SHLEXT)' -SHLBIN= -SHLEXT_VER='$(SHLEXT).$(version)' -SHLLIB_VER='$(SHLLIB).$(version)' -SHLBIN_VER='$(SHLBIN).$(version)' -SHLLINKEXT= -LIBPRE=lib -SHLPRE=lib -SHLLIBPRE=lib -SHLBINPRE=lib -SH_LD='$(CXX)' -SH_LDFLAGS=-shared -DL_LD='$(SH_LD)' -DL_LDFLAGS='$(SH_LDFLAGS)' -MKOCTFILE_DL_LDFLAGS='$(DL_LDFLAGS)' -SONAME_FLAGS= -RLD_FLAG= -NO_OCT_FILE_STRIP=false -TEMPLATE_AR='$(AR)' -TEMPLATE_ARFLAGS="$ARFLAGS" -CRUFT_DLL_DEFS= -OCTAVE_DLL_DEFS= -OCTINTERP_DLL_DEFS= -OCTGRAPHICS_DLL_DEFS= -library_path_var=LD_LIBRARY_PATH -ldpreloadsep=" " -SCRIPTS_EXE_SUFFIX= -case "$canonical_host_type" in - *-*-386bsd* | *-*-netbsd*) - SH_LD=ld - SH_LDFLAGS=-Bshareable - ;; - *-*-openbsd*) - SH_LDFLAGS='-shared -fPIC' - ;; - *-*-freebsd*) - SH_LDFLAGS="-shared -Wl,-x" - RLD_FLAG='-Wl,-rpath -Wl,$(octlibdir)' - ;; - alpha*-dec-osf*) - CPICFLAG= - CXXPICFLAG= - FPICFLAG= - SH_LDFLAGS="-shared -Wl,-expect_unresolved -Wl,'*'" - RLD_FLAG='-Wl,-rpath -Wl,$(octlibdir)' - ;; - *-*-darwin*) - DL_LDFLAGS='-bundle -bundle_loader $(TOPDIR)/src/octave $(LDFLAGS)' - MKOCTFILE_DL_LDFLAGS='-bundle -bundle_loader $$BINDIR/octave-$$OCTAVE_VERSION$$EXEEXT' - SH_LDFLAGS='-dynamiclib -single_module $(LDFLAGS)' - case "$canonical_host_type" in - powerpc-*) - CXXPICFLAG= - CPICFLAG= - FPICFLAG= - ;; - esac - SHLEXT=dylib - SHLLIB='$(SHLEXT)' - SHLEXT_VER='$(version).$(SHLEXT)' - SHLLIB_VER='$(version).$(SHLLIB)' - NO_OCT_FILE_STRIP=true - SONAME_FLAGS='-install_name $(octlibdir)/$@' - library_path_var=DYLD_LIBRARY_PATH - ;; - *-*-cygwin*) - CPICFLAG= - CXXPICFLAG= - FPICFLAG= - LIBPRE=lib - SHLPRE=cyg - SHLBINPRE=cyg - SHLEXT=dll - SHLLIB=dll.a - SHLBIN=dll - DL_LDFLAGS="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc" - SH_LDFLAGS="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-auto-image-base" - SONAME_FLAGS='-Wl,--out-implib=$(patsubst $(SHLPRE)%,$(LIBPRE)%,$@).a' - ldpreloadsep=":" - ;; - *-*-mingw*) - CPICFLAG= - CXXPICFLAG= - FPICFLAG= - SHLEXT=dll - SHLLIB=dll.a - SHLBIN=dll - DL_LDFLAGS="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-runtime-pseudo-reloc" - SH_LDFLAGS="-shared -Wl,--export-all-symbols -Wl,--enable-auto-import -Wl,--enable-auto-image-base" - SONAME_FLAGS='-Wl,--out-implib=$@.a' - library_path_var=PATH - SCRIPTS_EXE_SUFFIX='$(EXEEXT)' - ;; - - *-*-msdosmsvc) - DL_LDFLAGS="-shared" - CPICFLAG= - CXXPICFLAG= - FPICFLAG= - SHLEXT=dll - SHLLIB=lib - SHLBIN=dll - LIBPRE= - SHLPRE= - SHLLIBPRE= - SHLBINPRE= - SH_LDFLAGS="-shared" - if test -n "`echo $CFLAGS | grep -e '-g'`" -o -n "`echo $CXXFLAGS | grep -e '-g'`"; then - DL_LDFLAGS="$DL_LDFLAGS -g" - SH_LDFLAGS="$SH_LDFLAGS -g" - fi - NO_OCT_FILE_STRIP=true - library_path_var=PATH - NO_OCT_FILE_STRIP=true - ## Extra compilation flags. - CRUFT_DLL_DEFS="-DCRUFT_DLL" - OCTAVE_DLL_DEFS="-DOCTAVE_DLL" - OCTINTERP_DLL_DEFS="-DOCTINTERP_DLL" - OCTGRAPHICS_DLL_DEFS="-DOCTGRAPHICS_DLL" - SCRIPTS_EXE_SUFFIX='$(EXEEXT)' - ;; - *-*-linux* | *-*-gnu*) - MKOCTFILE_DL_LDFLAGS="-shared -Wl,-Bsymbolic" - SONAME_FLAGS='-Wl,-soname -Wl,$@' - RLD_FLAG='-Wl,-rpath -Wl,$(octlibdir)' - ;; - i[[3456]]86-*-sco3.2v5*) - SONAME_FLAGS='-Wl,-h -Wl,$@' - RLD_FLAG= - SH_LDFLAGS=-G - ;; - rs6000-ibm-aix* | powerpc-ibm-aix*) - CPICFLAG= - CXXPICFLAG= - FPICFLAG= - library_path_var=LIBPATH - ;; - hppa*-hp-hpux*) - if test "$ac_cv_f77_compiler_gnu" = yes; then - FPICFLAG=-fPIC - else - FPICFLAG=+Z - fi - SHLEXT=sl - SH_LDFLAGS="-shared -fPIC" - RLD_FLAG='-Wl,+b -Wl,$(octlibdir)' - library_path_var=SHLIB_PATH - ;; - ia64*-hp-hpux*) - if test "$ac_cv_f77_compiler_gnu" = yes; then - FPICFLAG=-fPIC - else - FPICFLAG=+Z - fi - SH_LDFLAGS="-shared -fPIC" - RLD_FLAG='-Wl,+b -Wl,$(octlibdir)' - ;; - *-sgi-*) - CPICFLAG= - CXXPICFLAG= - FPICFLAG= - RLD_FLAG='-rpath $(octlibdir)' - ;; - sparc-sun-sunos4*) - if test "$ac_cv_f77_compiler_gnu" = yes; then - FPICFLAG=-fPIC - else - FPICFLAG=-PIC - fi - SH_LD=ld - SH_LDFLAGS="-assert nodefinitions" - RLD_FLAG='-L$(octlibdir)' - ;; - sparc-sun-solaris2* | i386-pc-solaris2*) - if test "$ac_cv_f77_compiler_gnu" = yes; then - FPICFLAG=-fPIC - else - FPICFLAG=-KPIC - fi - if test "$GCC" = yes; then - CPICFLAG=-fPIC - else - CPICFLAG=-KPIC - fi - if test "$GXX" = yes; then - CXXPICFLAG=-fPIC - SH_LDFLAGS=-shared - else - CXXPICFLAG=-KPIC - SH_LDFLAGS=-G - fi - RLD_FLAG='-R $(octlibdir)' - ## Template closures in archive libraries need a different mechanism. - if test "$GXX" = yes; then - true - else - TEMPLATE_AR='$(CXX)' - TEMPLATE_ARFLAGS="-xar -o" - fi - ;; -esac - -if $use_rpath; then - if test -n "$enable_rpath_arg"; then - RLD_FLAG="$enable_rpath_arg" - fi -else - RLD_FLAG="" -fi - -AC_MSG_NOTICE([defining FPICFLAG to be $FPICFLAG]) -AC_MSG_NOTICE([defining CPICFLAG to be $CPICFLAG]) -AC_MSG_NOTICE([defining CXXPICFLAG to be $CXXPICFLAG]) -AC_MSG_NOTICE([defining SHLEXT to be $SHLEXT]) -AC_MSG_NOTICE([defining SHLLIB to be $SHLLIB]) -AC_MSG_NOTICE([defining SHLBIN to be $SHLBIN]) -AC_MSG_NOTICE([defining SHLEXT_VER to be $SHLEXT_VER]) -AC_MSG_NOTICE([defining SHLLIB_VER to be $SHLLIB_VER]) -AC_MSG_NOTICE([defining SHLBIN_VER to be $SHLBIN_VER]) -AC_MSG_NOTICE([defining SHLLINKEXT to be $SHLLINKEXT]) -AC_MSG_NOTICE([defining LIBPRE to be $LIBPRE]) -AC_MSG_NOTICE([defining SHLPRE to be $SHLPRE]) -AC_MSG_NOTICE([defining SHLLIBPRE to be $SHLLIBPRE]) -AC_MSG_NOTICE([defining SHLBINPRE to be $SHLBINPRE]) -AC_MSG_NOTICE([defining SH_LD to be $SH_LD]) -AC_MSG_NOTICE([defining SH_LDFLAGS to be $SH_LDFLAGS]) -AC_MSG_NOTICE([defining DL_LD to be $DL_LD]) -AC_MSG_NOTICE([defining DL_LDFLAGS to be $DL_LDFLAGS]) -AC_MSG_NOTICE([defining MKOCTFILE_DL_LDFLAGS to be $MKOCTFILE_DL_LDFLAGS]) -AC_MSG_NOTICE([defining SONAME_FLAGS to be $SONAME_FLAGS]) -AC_MSG_NOTICE([defining NO_OCT_FILE_STRIP to be $NO_OCT_FILE_STRIP]) -AC_MSG_NOTICE([defining RLD_FLAG to be $RLD_FLAG]) -AC_MSG_NOTICE([defining TEMPLATE_AR to be $TEMPLATE_AR]) -AC_MSG_NOTICE([defining TEMPLATE_ARFLAGS to be $TEMPLATE_ARFLAGS]) -AC_MSG_NOTICE([defining CRUFT_DLL_DEFS to be $CRUFT_DLL_DEFS]) -AC_MSG_NOTICE([defining OCTAVE_DLL_DEFS to be $OCTAVE_DLL_DEFS]) -AC_MSG_NOTICE([defining OCTINTERP_DLL_DEFS to be $OCTINTERP_DLL_DEFS]) -AC_MSG_NOTICE([defining OCTGRAPHICS_DLL_DEFS to be $OCTGRAPHICS_DLL_DEFS]) -AC_MSG_NOTICE([defining library_path_var to be $library_path_var]) -AC_SUBST(FPICFLAG) -AC_SUBST(CPICFLAG) -AC_SUBST(CXXPICFLAG) -AC_SUBST(SHLEXT) -AC_SUBST(SHLLIB) -AC_SUBST(SHLBIN) -AC_SUBST(SHLEXT_VER) -AC_SUBST(SHLLIB_VER) -AC_SUBST(SHLBIN_VER) -AC_SUBST(SHLLINKEXT) -AC_SUBST(LIBPRE) -AC_SUBST(SHLPRE) -AC_SUBST(SHLLIBPRE) -AC_SUBST(SHLBINPRE) -AC_SUBST(SH_LD) -AC_SUBST(SH_LDFLAGS) -AC_SUBST(DL_LD) -AC_SUBST(DL_LDFLAGS) -AC_SUBST(MKOCTFILE_DL_LDFLAGS) -AC_SUBST(SONAME_FLAGS) -AC_SUBST(NO_OCT_FILE_STRIP) -AC_SUBST(RLD_FLAG) -AC_SUBST(TEMPLATE_AR) -AC_SUBST(TEMPLATE_ARFLAGS) -AC_SUBST(CRUFT_DLL_DEFS) -AC_SUBST(OCTAVE_DLL_DEFS) -AC_SUBST(OCTINTERP_DLL_DEFS) -AC_SUBST(OCTGRAPHICS_DLL_DEFS) -AC_SUBST(library_path_var) -AC_SUBST(ldpreloadsep) -AC_SUBST(SCRIPTS_EXE_SUFFIX) - -### special checks for odd OS specific things. -### -### I am told that on some SCO systems, the only place to find some -### functions like gethostname and gettimeofday is in libsocket. - -AC_CHECK_FUNCS(gethostname, [], [AC_CHECK_LIB(socket, gethostname)]) -AC_CHECK_FUNCS(getpwnam, [], [AC_CHECK_LIB(sun, getpwnam)]) - -case "$canonical_host_type" in - *-*-cygwin*) - AC_CHECK_LIB(wsock32, gethostname) - LIBS="$LIBS -lwsock32" - ;; - *-*-msdosmsvc* | *-*-mingw*) - LIBS="$LIBS -lgdi32 -lws2_32 -luser32 -lkernel32" - ;; -esac - -### Type stuff. - -AC_TYPE_MODE_T -AC_TYPE_OFF_T -AC_TYPE_PID_T -AC_TYPE_SIZE_T -AC_TYPE_UID_T -AC_CHECK_TYPES([dev_t, ino_t, nlink_t, nlink_t]) -AC_CHECK_TYPES([long long int, unsigned long long int]) -AC_CHECK_TYPES([sigset_t, sig_atomic_t], , , [ -#if defined (HAVE_SYS_TYPES_H) -#include -#endif -#include ]) - -### How big are ints and how are they oriented? These could probably -### be eliminated in favor of run-time checks. - -AC_CHECK_SIZEOF(short) -AC_CHECK_SIZEOF(int) -AC_CHECK_SIZEOF(long) -AC_CHECK_SIZEOF(long long) - -### Does the C compiler handle alloca() and const correctly? - -AC_FUNC_ALLOCA -AC_C_CONST - -### See if we should use placement delete. - -OCTAVE_PLACEMENT_DELETE - -### See if we can auto allocate variable sized arrays. - -OCTAVE_DYNAMIC_AUTO_ARRAYS - -### See if we can use fast integer arithmetics - -OCTAVE_FAST_INT_OPS - -### Check for long double type (for 64-bit integers) - -AC_CHECK_SIZEOF(long double) - -### Checks for header files. - -AC_HEADER_STDC -AC_HEADER_DIRENT -AC_HEADER_TIME -AC_HEADER_SYS_WAIT - -### C headers - -AC_CHECK_HEADERS(assert.h curses.h direct.h dlfcn.h fcntl.h float.h \ - floatingpoint.h grp.h ieeefp.h inttypes.h limits.h locale.h memory.h nan.h \ - ncurses.h poll.h pthread.h pwd.h stdint.h stdlib.h string.h sunmath.h sys/ioctl.h \ - sys/param.h sys/poll.h sys/resource.h sys/select.h sys/stat.h \ - sys/time.h sys/times.h sys/types.h sys/utsname.h sys/utime.h termcap.h \ - unistd.h utime.h varargs.h) - -### C++ headers - -AC_LANG_PUSH(C++) -AC_CHECK_HEADERS(sstream) -AC_LANG_POP(C++) - -have_termios_h=no -AC_CHECK_HEADERS(termios.h, have_termios_h=yes) -AC_CHECK_HEADERS(termio.h, have_termio_h=yes, have_termio_h=no) -AC_CHECK_HEADERS(sgtty.h, have_sgtty_h=yes, have_sgtty_h=no) -AC_CHECK_HEADERS(glob.h, have_glob_h=yes, have_glob_h=no) -AC_CHECK_HEADERS(fnmatch.h, have_fnmatch_h=yes, have_fnmatch_h=no) -AC_CHECK_HEADERS(conio.h, have_conio_h=yes, have_conio_h=no) - -### I'm told that termios.h is broken on NeXT systems. - -case "$canonical_host_type" in - *-*-nextstep*) - if test "$have_termios_h" = yes; then - AC_MSG_WARN([Ignoring termios.h on NeXT systems.]) - have_termios_h=no - fi - ;; -esac - -if test "$have_termios_h" = yes \ - || test "$have_termio_h" = yes \ - || test "$have_sgtty_h" = yes; then - true -else - AC_MSG_WARN([I couldn't find termios.h, termio.h, or sgtty.h!]) -fi - -LIBGLOB= -AC_SUBST(LIBGLOB) -if test "$have_fnmatch_h" = yes && test "$have_glob_h" = yes; then - AC_CHECK_FUNCS(fnmatch, have_fnmatch=yes, [ - AC_CHECK_LIB(glob, fnmatch, [have_fnmatch=yes; LIBGLOB=-lglob], - have_fnmatch=no)]) - AC_CHECK_FUNCS(glob, have_glob=yes, [ - AC_CHECK_LIB(glob, glob, [have_glob=yes; LIBGLOB=-lglob], - have_glob=no)]) - - if test "$have_fnmatch" != yes || test "$have_glob" != yes; then - AC_MSG_ERROR([You are required to have fnmatch and glob]) - fi -else - AC_MSG_ERROR([You are required to have fnmatch.h and glob.h]) -fi - -### Checks for functions and variables. - -AC_CHECK_FUNCS(atexit basename bcopy bzero canonicalize_file_name \ - chmod dup2 endgrent endpwent execvp expm1 expm1f fcntl fork fstat getcwd \ - getegid geteuid getgid getgrent getgrgid getgrnam getpgrp getpid \ - getppid getpwent getpwuid gettimeofday getuid getwd _kbhit kill \ - lgamma lgammaf lgamma_r lgammaf_r link localtime_r log1p log1pf lstat \ - memmove mkdir mkfifo mkstemp on_exit pipe poll putenv raise readlink \ - realpath rename resolvepath rindex rmdir roundl select setgrent setlocale \ - setpwent setvbuf sigaction siglongjmp sigpending sigprocmask sigsuspend \ - snprintf stat strcasecmp strdup strerror stricmp strncasecmp \ - strnicmp strptime strsignal symlink tempnam tgammaf trunc umask \ - uname unlink usleep utime vfprintf vsprintf vsnprintf waitpid \ - _chmod _snprintf x_utime _utime32) - -AC_LANG_PUSH(C++) -AC_CHECK_DECLS([exp2, round, tgamma], [], [], [[#include ]]) -AC_CHECK_FUNCS([exp2 round tgamma]) -AH_VERBATIM([Z_FUNCS_AND_DECLS], [ -#if defined (__cplusplus) -extern "C" { -#endif -#if HAVE_EXP2 && ! HAVE_DECL_EXP2 -double exp2 (double ); -#endif -#if HAVE_ROUND && ! HAVE_DECL_ROUND -double round (double); -#endif -#if HAVE_TGAMMA && ! HAVE_DECL_TGAMMA -double tgamma (double); -#endif -#if defined (__cplusplus) -} -#endif -]) -AC_LANG_POP(C++) - -case "$canonical_host_type" in - *-*-mingw*) - ## MinGW does not provide a mkstemp function. However, it provides - ## the mkstemps function in libiberty. - AC_MSG_CHECKING(for mkstemps in libiberty) - save_LIBS="$LIBS" - LIBS="-liberty $LIBS" - AC_LINK_IFELSE([ - AC_LANG_PROGRAM([[int mkstemps (char *pattern, int suffix_len);]], - [[mkstemps ("XXXXXX", 0);]] - )], - [AC_MSG_RESULT(yes) - HAVE_MKSTEMPS=yes - AC_DEFINE(HAVE_MKSTEMPS, 1, [Define if mkstemps is available in libiberty.]) - ], - [AC_MSG_RESULT(no) - HAVE_MKSTEMPS=no - LIBS="$save_LIBS" - ]) - ;; -esac - -case "$canonical_host_type" in - *-*-msdosmsvc | *-*-mingw*) - ## The %T and %e format specifiers for strftime are not implemented - ## so use our version. We could use an actual configure test - ## for this. - ;; - *) - AC_CHECK_FUNCS(strftime) - ;; -esac - -OCTAVE_HAVE_C99_VSNPRINTF -OCTAVE_STRPTIME_BROKEN -OCTAVE_SMART_PUTENV - -case "$canonical_host_type" in - *-*-msdosmsvc | *-*-mingw*) - AC_MSG_CHECKING([for required _WIN32_WINNT]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[ -#include -#if _WIN32_WINNT < 0x0403 -#error "Wrong version" -#endif]], []), - AC_MSG_RESULT([none]), [ - AC_DEFINE(_WIN32_WINNT, 0x0403, [Define to 0x0403 to access InitializeCriticalSectionAndSpinCount]) - AC_MSG_RESULT([0x0403])]) - AC_MSG_CHECKING([whether _USE_MATH_DEFINES needs to be defined]) - AC_COMPILE_IFELSE(AC_LANG_PROGRAM([[#include ]], -[[int x = M_LN2;]]), - AC_MSG_RESULT([no]), [ - AC_DEFINE(_USE_MATH_DEFINES, 1, [Define if your system needs it to define math constants like M_LN2]) - AC_MSG_RESULT([yes])]) - ;; -esac - -### Dynamic linking is now enabled only if we are building shared -### libs and some API for dynamic linking is detected. - -LD_CXX='$(CXX)' -RDYNAMIC_FLAG= -DL_API_MSG="" -dlopen_api=false -shl_load_api=false -loadlibrary_api=false -dyld_api=false - -if $SHARED_LIBS || $ENABLE_DYNAMIC_LINKING; then - - ## Check for dyld first since OS X can have a non-standard libdl - - save_LIBS="$LIBS" - AC_CHECK_HEADER(mach-o/dyld.h) - if test "$ac_cv_header_mach_o_dyld_h" = yes; then - dyld_api=true - else - AC_CHECK_LIB(dld, shl_load, [DL_LIBS=-ldld; LIBS="$LIBS $DL_LIBS"]) - AC_CHECK_FUNCS(shl_load shl_findsym) - if test "$ac_cv_func_shl_load" = yes \ - && test "$ac_cv_func_shl_findsym" = yes; then - shl_load_api=true - else - AC_CHECK_LIB(wsock32, LoadLibrary, [ - DL_LIBS=-lwsock32; LIBS="$LIBS $DL_LIBS"]) - AC_CHECK_FUNCS(LoadLibrary) - if test "$ac_cv_func_loadlibrary" = yes; then - loadlibrary_api=true - else - AC_CHECK_LIB(dl, dlopen, [DL_LIBS=-ldl; LIBS="$LIBS $DL_LIBS"]) - AC_CHECK_FUNCS(dlopen dlsym dlerror dlclose) - if test "$ac_cv_func_dlclose" = yes \ - && test "$ac_cv_func_dlerror" = yes \ - && test "$ac_cv_func_dlopen" = yes \ - && test "$ac_cv_func_dlsym" = yes; then - dlopen_api=true - else - case "$canonical_host_type" in - i[[3456]]86-*-sco3.2v5*) - LD_CXX='LD_RUN_PATH=$LD_RUN_PATH:$(octlibdir) $(CXX)' - dlopen_api=true - ;; - esac - fi - fi - fi - fi - LIBS="$save_LIBS" - AC_SUBST(DL_LIBS) - - ## autoconf test for LoadLibrary appears broken. Bypass for cygwin/mingw - if $dlopen_api || $shl_load_api || $loadlibrary_api || $dyld_api; then - true - else - case "$canonical_host_type" in - *-*-cygwin* | *-*-mingw* | *-*-msdosmsvc) - loadlibrary_api=true; - ;; - esac - fi - - if $dlopen_api; then - DL_API_MSG="(dlopen)" - AC_DEFINE(HAVE_DLOPEN_API, 1, [Define if your system has dlopen, dlsym, dlerror, and dlclose for dynamic linking]) - OCTAVE_CXX_FLAG(-rdynamic, [RDYNAMIC_FLAG=-rdynamic]) - elif $shl_load_api; then - DL_API_MSG="(shl_load)" - AC_DEFINE(HAVE_SHL_LOAD_API, 1, [Define if your system has shl_load and shl_findsym for dynamic linking]) - elif $loadlibrary_api; then - DL_API_MSG="(LoadLibrary)" - AC_DEFINE(HAVE_LOADLIBRARY_API, 1, [Define if your system has LoadLibrary for dynamic linking]) - elif $dyld_api; then - DL_API_MSG="(dyld)" - AC_DEFINE(HAVE_DYLD_API, 1, [Define if your system has dyld for dynamic linking]) - fi - - if $dlopen_api || $shl_load_api || $loadlibrary_api || $dyld_api; then - ENABLE_DYNAMIC_LINKING=true - AC_DEFINE(ENABLE_DYNAMIC_LINKING, 1, [Define if using dynamic linking]) - fi -fi - -if $SHARED_LIBS; then - LIBOCTINTERP=-loctinterp$SHLLINKEXT - LIBOCTAVE=-loctave$SHLLINKEXT - LIBCRUFT=-lcruft$SHLLINKEXT -else - LIBOCTINTERP='$(TOPDIR)/src/liboctinterp.$(LIBEXT)' - LIBOCTAVE='$(TOPDIR)/liboctave/liboctave.$(LIBEXT)' - LIBCRUFT='$(TOPDIR)/libcruft/libcruft.$(LIBEXT)' -fi - -AC_SUBST(LD_CXX) -AC_SUBST(RDYNAMIC_FLAG) -AC_SUBST(ENABLE_DYNAMIC_LINKING) -AC_SUBST(LIBOCTINTERP) -AC_SUBST(LIBOCTAVE) -AC_SUBST(LIBCRUFT) - -### There is more than one possible prototype for gettimeofday. See -### which one (if any) appears in sys/time.h. These tests are from -### Emacs 19. - -AC_MSG_CHECKING(for struct timeval) -AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#ifdef TIME_WITH_SYS_TIME -#include -#include -#else -#ifdef HAVE_SYS_TIME_H -#include -#else -#include -#endif -#endif]], [[static struct timeval x; x.tv_sec = x.tv_usec;]])], - [AC_MSG_RESULT(yes) - HAVE_TIMEVAL=yes - AC_DEFINE(HAVE_TIMEVAL, 1, [Define if struct timeval is defined.])], - [AC_MSG_RESULT(no) - HAVE_TIMEVAL=no]) - -if test "x$HAVE_TIMEVAL" = xyes; then -AC_MSG_CHECKING(whether gettimeofday can't accept two arguments) -AC_LINK_IFELSE([AC_LANG_PROGRAM([[#ifdef TIME_WITH_SYS_TIME -#include -#include -#else -#ifdef HAVE_SYS_TIME_H -#include -#else -#include -#endif -#endif]], [[struct timeval time; - struct timezone dummy; - gettimeofday (&time, &dummy);]])], - [AC_MSG_RESULT(no)], - [AC_MSG_RESULT(yes) - AC_DEFINE(GETTIMEOFDAY_NO_TZ, 1, - [Define if your system has a single-arg prototype for gettimeofday.])]) -fi - -dnl Maybe defines the IEEE functions we need. - -OCTAVE_CMATH_FUNC(isnan) -OCTAVE_CMATH_FUNC(isinf) -OCTAVE_CMATH_FUNC(isfinite) - -dnl Would like to get rid of this cruft, and just have -dnl -dnl AC_CHECK_FUNCS(finite isnan isinf) -dnl -dnl instead, but that used to fail on some systems... -dnl -dnl Also just using AC_CHECK_FUNCS doesn't seem to work to find isinf -dnl and isnan on Linux systems, so we use AC_CHECK_FUNC, and if that -dnl fails, we try again by including math.h and invoking the function -dnl with an argument. - -### I am told that Inf and NaN don't work on m68k HP sytems, and that -### on SCO systems, isnan and isinf don't work, but they can be -### replaced by something that does. - -case "$canonical_host_type" in - m68k-hp-hpux*) - ;; - *-*-sco*) - AC_MSG_NOTICE([defining SCO to be 1]) - AC_DEFINE(SCO, 1, [Define if using an SCO system.]) - AC_MSG_NOTICE([forcing HAVE_ISINF for SCO]) - AC_DEFINE(HAVE_ISINF, 1, [Define if you have isinf().]) - AC_MSG_NOTICE([forcing HAVE_ISNAN for SCO]) - AC_DEFINE(HAVE_ISNAN, 1, [Define if you have isnan().]) - ;; - *) - AC_CHECK_FUNCS(finite isnan isinf copysign signbit) - AC_CHECK_FUNCS(_finite _isnan _copysign) - AC_CHECK_DECLS(signbit, , , [#include ]) - ;; -esac - -### Check for nonstandard but common math functions that we need. - -AC_CHECK_FUNCS(acosh acoshf asinh asinhf atanh atanhf erf erff erfc erfcf exp2f log2 log2f) -AC_CHECK_FUNCS(hypotf _hypotf) - -### Checks for OS specific cruft. - -AC_CHECK_MEMBERS([struct stat.st_blksize, struct stat.st_blocks, struct stat.st_rdev]) - -AC_STRUCT_TM -AC_STRUCT_TIMEZONE -AC_FUNC_CLOSEDIR_VOID - -AC_CHECK_MEMBERS(struct group.gr_passwd) - -# mkdir takes a single argument on some systems. -OCTAVE_MKDIR_TAKES_ONE_ARG - -octave_found_termlib=no -for termlib in ncurses curses termcap terminfo termlib; do - AC_CHECK_LIB(${termlib}, tputs, [ - TERM_LIBS="-l${termlib}" - octave_found_termlib=yes - break]) -done - -if test "$octave_found_termlib" = no; then - warn_termlibs="I couldn't find -ltermcap, -lterminfo, -lncurses, -lcurses, o\ -r -ltermlib!" - AC_MSG_WARN($warn_termlibs) -fi -AC_SUBST(TERM_LIBS) - -OCTAVE_ENABLE_READLINE - -AC_MSG_CHECKING([for struct exception in math.h]) -AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], - [[struct exception *x; x->type; x->name;]])], - [AC_MSG_RESULT(yes) - AC_DEFINE(EXCEPTION_IN_MATH, 1, - [Define if your math.h declares struct exception for matherr().])], - [AC_MSG_RESULT(no)]) - -### Signal stuff. - -AC_TYPE_SIGNAL -AC_CHECK_DECLS([sys_siglist], [], [], -[#include -/* NetBSD declares sys_siglist in unistd.h. */ -#if HAVE_UNISTD_H -# include -#endif -]) -OCTAVE_SIGNAL_CHECK -OCTAVE_REINSTALL_SIGHANDLERS -if test "$ac_cv_type_signal" = "void"; then - AC_DEFINE(RETSIGTYPE_IS_VOID, 1, [Define if this if RETSIGTYPE is defined to be void. Needed because preprocessor comparisons to void fail on some systems.]) -fi - -### A system dependent kluge or two. - -AC_CHECK_FUNCS(getrusage times) -case "$canonical_host_type" in - *-*-cygwin*) - AC_DEFINE(RUSAGE_TIMES_ONLY, 1, [Define if your struct rusage only has time information.]) - ;; -esac - -### Checks for other programs used for building, testing, installing, -### and running Octave. - -AC_PROG_AWK -OCTAVE_PROG_FIND -OCTAVE_PROG_SED -OCTAVE_PROG_PERL -OCTAVE_PROG_PYTHON - -OCTAVE_PROG_FLEX -OCTAVE_PROG_BISON - -AC_PROG_LN_S - -AC_PROG_INSTALL -INSTALL_SCRIPT='${INSTALL}' -AC_SUBST(INSTALL_SCRIPT) - -OCTAVE_PROG_DESKTOP_FILE_INSTALL - -OCTAVE_PROG_GNUPLOT -OCTAVE_PROG_PAGER -OCTAVE_PROG_GPERF - -OCTAVE_PROG_GHOSTSCRIPT -OCTAVE_PROG_MAKEINFO -OCTAVE_PROG_TEXI2DVI -OCTAVE_PROG_TEXI2PDF - -### Even though we include config.h, we need to have the preprocessor -### defines available in a variable for the octave-bug script. Use -### UGLY_DEFS for that. - -AC_OUTPUT_MAKE_DEFS - -### We have to insert extra levels of backslash quoting here so that -### the right thing ends up in oct-conf.h. -UGLY_DEFS=`echo $DEFS | $SED 's,\\",\\\\\\\\\\\\\\\\\\",g'` -AC_MSG_NOTICE([defining UGLY_DEFS to be $UGLY_DEFS]) -AC_SUBST(UGLY_DEFS) - -### Maybe add -Wall, -W, and -Wshadow to compiler flags now that we're -### done feature testing. - -try_extra_warning_flags=true -AC_ARG_ENABLE(extra-warning-flags, - [AS_HELP_STRING([--enable-extra-warning-flags], - [add -Wall, -W, -Wshadow, and -Wold-style-cast options to CFLAGS and CXXFLAGS (on by default, but only if the compiler appears to accept them)])], - [if test "$enableval" = no; then - try_extra_warning_flags=false - fi], []) - -if $try_extra_warning_flags; then - OCTAVE_CC_FLAG(-Wall, [ - WARN_CFLAGS="$WARN_CFLAGS -Wall"; - AC_MSG_RESULT([adding -Wall to WARN_CFLAGS])]) - OCTAVE_CC_FLAG(-W, [ - WARN_CFLAGS="$WARN_CFLAGS -W"; - AC_MSG_RESULT([adding -W to WARN_CFLAGS])]) - OCTAVE_CC_FLAG(-Wshadow, [ - WARN_CFLAGS="$WARN_CFLAGS -Wshadow"; - AC_MSG_RESULT([adding -Wshadow to WARN_CFLAGS])]) - OCTAVE_CC_FLAG(-Wformat, [ - WARN_CFLAGS="$WARN_CFLAGS -Wformat"; - AC_MSG_RESULT([adding -Wformat to WARN_CFLAGS])]) - - OCTAVE_CXX_FLAG(-Wall, [ - WARN_CXXFLAGS="$WARN_CXXFLAGS -Wall"; - AC_MSG_RESULT([adding -Wall to WARN_CXXFLAGS])]) - OCTAVE_CXX_FLAG(-W, [ - WARN_CXXFLAGS="$WARN_CXXFLAGS -W"; - AC_MSG_RESULT([adding -W to WARN_CXXFLAGS])]) - OCTAVE_CXX_FLAG(-Wshadow, [ - WARN_CXXFLAGS="$WARN_CXXFLAGS -Wshadow"; - AC_MSG_RESULT([adding -Wshadow to WARN_CXXFLAGS])]) - OCTAVE_CXX_FLAG(-Wold-style-cast, [ - WARN_CXXFLAGS="$WARN_CXXFLAGS -Wold-style-cast"; - AC_MSG_RESULT([adding -Wold-style-cast to WARN_CXXFLAGS])]) - OCTAVE_CXX_FLAG(-Wformat, [ - WARN_CXXFLAGS="$WARN_CXXFLAGS -Wformat"; - AC_MSG_RESULT([adding -Wformat to WARN_CXXFLAGS])]) -fi - -GCC_STRICT_FLAGS="-Wcast-align -Wcast-qual -Wconversion -Wmissing-prototypes \ - -Wpointer-arith -Wstrict-prototypes -Wwrite-strings" - -GXX_STRICT_FLAGS="-Wcast-align -Wcast-qual -Wconversion -Wpointer-arith \ - -Wwrite-strings -Weffc++" - -try_strict_warning_flags=false - -AC_ARG_ENABLE(strict-warning-flags, - [AS_HELP_STRING([--enable-strict-warning-flags], - [add extra strict warning options to CFLAGS and CXXFLAGS (off by default)])], - [if test "$enableval" = yes; then - try_strict_warning_flags=true - fi], []) - -if $try_strict_warning_flags; then - for flag in $GCC_STRICT_FLAGS; do - OCTAVE_CC_FLAG($flag, [ - WARN_CFLAGS="$WARN_CFLAGS $flag"; - AC_MSG_RESULT([adding $flag to WARN_CFLAGS])]) - done - for flag in $GXX_STRICT_FLAGS; do - OCTAVE_CXX_FLAG($flag, [ - WARN_CXXFLAGS="$WARN_CXXFLAGS $flag"; - AC_MSG_RESULT([adding $flag to WARN_CXXFLAGS])]) - done -fi - -AC_SUBST(WARN_CFLAGS) -AC_SUBST(WARN_CXXFLAGS) - -### Run configure in subdirectories. - -export CC -export CXX -export F77 - -AC_CONFIG_SUBDIRS(scripts) - -### Some things to add to the bottom of config.h. - -AH_BOTTOM([ -#if defined (__GNUC__) -#define GCC_ATTR_DEPRECATED __attribute__ ((__deprecated__)) -#define GCC_ATTR_NORETURN __attribute__ ((__noreturn__)) -#define GCC_ATTR_UNUSED __attribute__ ((__unused__)) -#else -#define GCC_ATTR_DEPRECATED -#define GCC_ATTR_NORETURN -#define GCC_ATTR_UNUSED -#endif - -#define X_CAST(T, E) (T) (E) - -#if defined (CXX_BROKEN_REINTERPRET_CAST) -#define FCN_PTR_CAST(T, E) (T) (E) -#else -#define FCN_PTR_CAST(T, E) reinterpret_cast (E) -#endif - -#if !defined(HAVE_DEV_T) -typedef short dev_t; -#endif - -#if !defined(HAVE_INO_T) -typedef unsigned long ino_t; -#endif - -#if !defined(HAVE_NLINK_T) -typedef short nlink_t; -#endif - -#if !defined(HAVE_SIGSET_T) -typedef int sigset_t; -#endif - -#if !defined(HAVE_SIG_ATOMIC_T) -typedef int sig_atomic_t; -#endif - -#if defined (_MSC_VER) -#define __WIN32__ -#define WIN32 -/* missing parameters in macros */ -#pragma warning (disable: 4003) -/* missing implementations in template instantiation */ -#pragma warning (disable: 4996) -/* deprecated function names (FIXME?) */ -#pragma warning (disable: 4661) -#endif - -#if defined (__WIN32__) && ! defined (__CYGWIN__) -#define OCTAVE_HAVE_WINDOWS_FILESYSTEM 1 -#elif defined (__CYGWIN__) -#define OCTAVE_HAVE_WINDOWS_FILESYSTEM 1 -#define OCTAVE_HAVE_POSIX_FILESYSTEM 1 -#else -#define OCTAVE_HAVE_POSIX_FILESYSTEM 1 -#endif - -/* Define if we expect to have , Sleep, etc. */ -#if defined (__WIN32__) && ! defined (__CYGWIN__) -#define OCTAVE_USE_WINDOWS_API 1 -#endif - -#if defined (__APPLE__) && defined (__MACH__) -#define OCTAVE_USE_OS_X_API 1 -#endif - -/* sigsetjmp is a macro, not a function. */ -#if defined (sigsetjmp) && defined (HAVE_SIGLONGJMP) -#define OCTAVE_HAVE_SIG_JUMP -#endif - -#if defined (__DECCXX) -#define __USE_STD_IOSTREAM -#endif - -#if defined (_UNICOS) -#define F77_USES_CRAY_CALLING_CONVENTION -#endif - -#if 0 -#define F77_USES_VISUAL_FORTRAN_CALLING_CONVENTION -#endif - -#ifdef USE_64_BIT_IDX_T -#define SIZEOF_OCTAVE_IDX_TYPE 8 -#else -#define SIZEOF_OCTAVE_IDX_TYPE SIZEOF_INT -#endif - -// To be able to use long doubles for 64-bit mixed arithmetics, we need them at -// least 80 bits wide and we need roundl declared in math.h. -// FIXME -- maybe substitute this by a more precise check in the future. -#if (SIZEOF_LONG_DOUBLE >= 10) && defined (HAVE_ROUNDL) -#define OCTAVE_INT_USE_LONG_DOUBLE -#endif - -#define OCTAVE_EMPTY_CPP_ARG - -// Octave is currently unable to use FFTW unless both float -// and double versions are both available. -#if defined (HAVE_FFTW3) && defined (HAVE_FFTW3F) -#define HAVE_FFTW -#endif - -// Backward compatibility. -#if defined (HAVE_Z) -#define HAVE_ZLIB -#endif - -#include "oct-dlldefs.h" -#include "oct-types.h" -]) - -### Do the substitutions in all the Makefiles. - -AC_CONFIG_COMMANDS([Makefile], [if test "$ac_srcdir" != "."; then - cp $srcdir/Makefile . -fi]) - -AC_SUBST(ac_config_files) - -AC_CONFIG_FILES([octMakefile Makeconf test/Makefile - doc/Makefile doc/faq/Makefile doc/interpreter/Makefile - doc/liboctave/Makefile doc/refcard/Makefile emacs/Makefile - examples/Makefile examples/@polynomial/Makefile - examples/@FIRfilter/Makefile liboctave/Makefile - liboctave/oct-types.h src/Makefile src/mxarray.h libcruft/Makefile - libcruft/Makerules libcruft/amos/Makefile libcruft/blas/Makefile - libcruft/daspk/Makefile libcruft/dasrt/Makefile - libcruft/dassl/Makefile libcruft/fftpack/Makefile - libcruft/lapack/Makefile - libcruft/misc/Makefile libcruft/odepack/Makefile - libcruft/ordered-qz/Makefile libcruft/quadpack/Makefile - libcruft/ranlib/Makefile libcruft/slatec-fn/Makefile - libcruft/slatec-err/Makefile libcruft/villad/Makefile - libcruft/blas-xtra/Makefile libcruft/lapack-xtra/Makefile]) - -AC_OUTPUT - -### Print a summary so that important information isn't missed. - -AC_MSG_NOTICE([ - -Octave is now configured for $canonical_host_type - - Source directory: $srcdir - Installation prefix: $prefix - C compiler: $CC $XTRA_CFLAGS $WARN_CFLAGS $CFLAGS - C++ compiler: $CXX $XTRA_CXXFLAGS $WARN_CXXFLAGS $CXXFLAGS - Fortran compiler: $F77 $FFLAGS - Fortran libraries: $FLIBS - Glob libraries: $LIBGLOB - Lex libraries: $LEXLIB - LIBS: $LIBS - - AMD CPPFLAGS: $AMD_CPPFLAGS - AMD LDFLAGS: $AMD_LDFLAGS - AMD libraries: $AMD_LIBS - ARPACK libraries: $ARPACK_LIBS - BLAS libraries: $BLAS_LIBS - CAMD CPPFLAGS: $CAMD_CPPFLAGS - CAMD LDFLAGS: $CAMD_LDFLAGS - CAMD libraries: $CAMD_LIBS - CARBON libraries: $CARBON_LIBS - CCOLAMD CPPFLAGS: $CCOLAMD_CPPFLAGS - CCOLAMD LDFLAGS: $CCOLAMD_LDFLAGS - CCOLAMD libraries: $CCOLAMD_LIBS - CHOLMOD CPPFLAGS: $CHOLMOD_CPPFLAGS - CHOLMOD LDFLAGS: $CHOLMOD_LDFLAGS - CHOLMOD libraries: $CHOLMOD_LIBS - COLAMD CPPFLAGS: $COLAMD_CPPFLAGS - COLAMD LDFLAGS: $COLAMD_LDFLAGS - COLAMD libraries: $COLAMD_LIBS - CURL CPPFLAGS: $CURL_CPPFLAGS - CURL LDFLAGS: $CURL_LDFLAGS - CURL libraries: $CURL_LIBS - CXSPARSE CPPFLAGS: $CXSPARSE_CPPFLAGS - CXSPARSE LDFLAGS: $CXSPARSE_LDFLAGS - CXSPARSE libraries: $CXSPARSE_LIBS - DL libraries: $DL_LIBS - FFTW3 CPPFLAGS: $FFTW3_CPPFLAGS - FFTW3 LDFLAGS: $FFTW3_LDFLAGS - FFTW3 libraries: $FFTW3_LIBS - FFTW3F CPPFLAGS: $FFTW3F_CPPFLAGS - FFTW3F LDFLAGS: $FFTW3F_LDFLAGS - FFTW3F libraries: $FFTW3F_LIBS - FLTK backend libs: $GRAPHICS_LIBS - GLPK CPPFLAGS: $GLPK_CPPFLAGS - GLPK LDFLAGS: $GLPK_LDFLAGS - GLPK libraries: $GLPK_LIBS - GraphicsMagick++ - CPPFLAGS: $MAGICK_CPPFLAGS - LDFLAGS: $MAGICK_LDFLAGS - libraries: $MAGICK_LIBS - HDF5 CPPFLAGS: $HDF5_CPPFLAGS - HDF5 LDFLAGS: $HDF5_LDFLAGS - HDF5 libraries: $HDF5_LIBS - OPENGL libraries: $OPENGL_LIBS - PTHREAD flags: $PTHREAD_CFLAGS - PTHREAD libraries: $PTHREAD_LIBS - QHULL CPPFLAGS: $QHULL_CPPFLAGS - QHULL LDFLAGS: $QHULL_LDFLAGS - QHULL libraries: $QHULL_LIBS - QRUPDATE libraries: $QRUPDATE_LIBS - READLINE libraries: $READLINE_LIBS - REGEX libraries: $REGEX_LIBS - TERM libraries: $TERM_LIBS - UMFPACK libraries: $UMFPACK_LIBS - X11 include flags: $X11_INCFLAGS - X11 libraries: $X11_LIBS - Z CPPFLAGS: $Z_CPPFLAGS - Z LDFLAGS: $Z_LDFLAGS - Z libraries: $Z_LIBS - - Default pager: $DEFAULT_PAGER - gnuplot: $GNUPLOT - - Do internal array bounds checking: $BOUNDS_CHECKING - Build static libraries: $STATIC_LIBS - Build shared libraries: $SHARED_LIBS - Dynamic Linking: $ENABLE_DYNAMIC_LINKING $DL_API_MSG - Include support for GNU readline: $USE_READLINE - 64-bit array dims and indexing: $USE_64_BIT_IDX_T -]) - -warn_msg_printed=false - -if $ENABLE_DYNAMIC_LINKING; then - if $SHARED_LIBS; then - true - else - AC_MSG_WARN([You used --enable-dl but not --enable-shared.]) - AC_MSG_WARN([Are you sure that is what you want to do?]) - warn_msg_printed=true - fi -fi - -if test -n "$gxx_only"; then - AC_MSG_WARN($gxx_only) - warn_msg_printed=true -fi - -if test -n "$warn_gcc_version"; then - AC_MSG_WARN($warn_gcc_version) - warn_msg_printed=true -fi - -if test -n "$warn_gcc_only"; then - AC_MSG_WARN($warn_gcc_only) - warn_msg_printed=true -fi - -if test -n "$warn_readline"; then - AC_MSG_WARN($warn_readline) - warn_msg_printed=true -fi - -if test -n "$warn_termlibs"; then - AC_MSG_WARN($warn_termlibs) - warn_msg_printed=true -fi - -if test -n "$warn_gperf"; then - AC_MSG_WARN($warn_gperf) - warn_msg_printed=true -fi - -if test -n "$warn_flex"; then - AC_MSG_WARN($warn_flex) - warn_msg_printed=true -fi - -if test -n "$warn_bison"; then - AC_MSG_WARN($warn_bison) - warn_msg_printed=true -fi - -if test -n "$warn_less"; then - AC_MSG_WARN($warn_less) - warn_msg_printed=true -fi - -if test -n "$warn_blas_f77_incompatible"; then - AC_MSG_WARN($warn_blas_f77_incompatible) - warn_msg_printed=true -fi - -if test -n "$warn_umfpack"; then - AC_MSG_WARN($warn_umfpack) - warn_msg_printed=true -fi - -if test -n "$warn_qrupdate"; then - AC_MSG_WARN($warn_qrupdate) - warn_msg_printed=true -fi - -if test -n "$warn_amd"; then - AC_MSG_WARN($warn_amd) - warn_msg_printed=true -fi - -if test -n "$warn_colamd"; then - AC_MSG_WARN($warn_colamd) - warn_msg_printed=true -fi - -if test -n "$warn_ccolamd"; then - AC_MSG_WARN($warn_ccolamd) - warn_msg_printed=true -fi - -if test -n "$warn_cholmod"; then - AC_MSG_WARN($warn_cholmod) - warn_msg_printed=true -fi - -if test -n "$warn_cxsparse"; then - AC_MSG_WARN($warn_cxsparse) - warn_msg_printed=true -fi - -if test -n "$warn_arpack"; then - AC_MSG_WARN($warn_arpack) - warn_msg_printed=true -fi - -if test -n "$warn_curl"; then - AC_MSG_WARN($warn_curl) - warn_msg_printed=true -fi - -if test -n "$warn_fftw"; then - AC_MSG_WARN($warn_fftw) - warn_msg_printed=true -fi - -if test -n "$warn_glpk"; then - AC_MSG_WARN($warn_glpk) - warn_msg_printed=true -fi - -if test -n "$warn_magick"; then - AC_MSG_WARN($warn_magick) - warn_msg_printed=true -fi - -if test -n "$warn_hdf5"; then - AC_MSG_WARN($warn_hdf5) - warn_msg_printed=true -fi - -if test -n "$warn_regex"; then - AC_MSG_WARN($warn_regex) - warn_msg_printed=true -fi - -if test -n "$warn_pcre"; then - AC_MSG_WARN($warn_pcre) - warn_msg_printed=true -fi - -if test -n "$warn_qhull"; then - AC_MSG_WARN($warn_qhull) - warn_msg_printed=true -fi - -if test -n "$warn_zlib"; then - AC_MSG_WARN($warn_zlib) - warn_msg_printed=true -fi - -if test -n "$warn_ghostscript"; then - AC_MSG_WARN($warn_ghostscript) - warn_msg_printed=true -fi - -if test -n "$warn_makeinfo"; then - AC_MSG_WARN($warn_makeinfo) - warn_msg_printed=true -fi - -if test -n "$warn_texi2dvi"; then - AC_MSG_WARN($warn_texi2dvi) - warn_msg_printed=true -fi - -if test -n "$warn_texi2pdf"; then - AC_MSG_WARN($warn_texi2pdf) - warn_msg_printed=true -fi - -if test -n "$warn_64_bit"; then - AC_MSG_WARN($warn_64_bit) - warn_msg_printed=true -fi - -if test -n "$warn_gnuplot"; then - - ## If you change this text, be sure to also change the corresponding - ## set of warnings above. - - AC_MSG_WARN([]) - AC_MSG_WARN([I didn't find gnuplot. It isn't necessary to have gnuplot]) - AC_MSG_WARN([installed, but you won't be able to use any of Octave's]) - AC_MSG_WARN([plotting commands without it.]) - AC_MSG_WARN([]) - AC_MSG_WARN([If gnuplot is installed but it isn't in your path, you can]) - AC_MSG_WARN([tell Octave where to find it by typing the command]) - AC_MSG_WARN([]) - AC_MSG_WARN([gnuplot_binary = "/full/path/to/gnuplot/binary"]) - AC_MSG_WARN([]) - AC_MSG_WARN([at the Octave prompt.]) - AC_MSG_WARN([]) - warn_msg_printed=true -fi - -if $USE_64_BIT_IDX_T; then - AC_MSG_WARN([]) - AC_MSG_WARN([You used the EXPERIMENTAL --enable-64 option.]) - AC_MSG_WARN([Are you sure that is what you want to do?]) - AC_MSG_WARN([]) - AC_MSG_WARN([You must ensure that the Fortran compiler generates]) - AC_MSG_WARN([code with 8 byte signed INTEGER values, and that your]) - AC_MSG_WARN([BLAS and LAPACK libraries are compiled to use 8 byte]) - AC_MSG_WARN([signed integers for array indexing.]) - AC_MSG_WARN([]) - warn_msg_printed=true -fi - -native_graphics=true -if test -n "$warn_freetype"; then - AC_MSG_WARN("$warn_freetype") - native_graphics=false - warn_msg_printed=true -fi - -if test -n "$warn_fontconfig"; then - AC_MSG_WARN("$warn_fontconfig") - native_graphics=false - warn_msg_printed=true -fi - -if test -n "$warn_ftgl"; then - AC_MSG_WARN("$warn_ftgl") - native_graphics=false - warn_msg_printed=true -fi - -if test -n "$warn_fltk_config"; then - AC_MSG_WARN("$warn_fltk_config") - native_graphics=false - warn_msg_printed=true -fi - -if test -n "$warn_fltk_opengl"; then - AC_MSG_WARN("$warn_fltk_opengl") - native_graphics=false - warn_msg_printed=true -fi - -if $native_graphics; then - true; -else - AC_MSG_WARN([]) - AC_MSG_WARN([I didn't find the necessary libraries to compile native]) - AC_MSG_WARN([graphics. It isn't necessary to have native graphics]) - AC_MSG_WARN([but you will have to use gnuplot or you won't be able]) - AC_MSG_WARN([to use any of Octave's plotting commands]) - AC_MSG_WARN([]) - warn_msg_printed=true -fi - -if $warn_msg_printed; then - AC_MSG_NOTICE([ - -NOTE: libraries may be skipped if a library is not found OR - if the library on your system is missing required features. -]) -fi - -### End of configure. diff -r 080e11f1b0c1 -r 4531741e5236 m4/Makefile.in --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m4/Makefile.in Tue Sep 15 13:48:39 2009 -0400 @@ -0,0 +1,62 @@ +# Makefile for octave's m4 directory +# +# Copyright (C) 2009 John W. Eaton +# +# This file is part of Octave. +# +# Octave is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation; either version 3 of the License, or (at +# your option) any later version. +# +# Octave is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with Octave; see the file COPYING. If not, see +# . + +TOPDIR = .. + +srcdir = @srcdir@ +top_srcdir = @top_srcdir@ +VPATH = @srcdir@ + +include $(TOPDIR)/Makeconf + +INSTALL = @INSTALL@ +INSTALL_PROGRAM = @INSTALL_PROGRAM@ +INSTALL_SCRIPT = @INSTALL_SCRIPT@ +INSTALL_DATA = @INSTALL_DATA@ + +M4_FILES = acx_blas.m4 acx_blas_f77_func.m4 acx_lapack.m4 acx_pthread.m4 + +DISTFILES = $(addprefix $(srcdir)/, Makefile.in $(M4_FILES)) + +all: +.PHONY: all + +install install-strip: +.PHONY: install install-strip + +uninstall: +.PHONY: uninstall + +tags TAGS: +.PHONY: tags TAGS + +clean mostlyclean: +.PHONY: clean mostlyclean + +distclean: + rm -f Makefile +.PHONY: distclean + +maintainer-clean: distclean +.PHONY: maintainer-clean + +conf-dist dist: + ln $(DISTFILES) ../`cat ../.fname`/m4 +.PHONY: conf-dist dist diff -r 080e11f1b0c1 -r 4531741e5236 m4/acx_blas.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m4/acx_blas.m4 Tue Sep 15 13:48:39 2009 -0400 @@ -0,0 +1,169 @@ +dnl @synopsis ACX_BLAS([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +dnl +dnl This macro looks for a library that implements the BLAS +dnl linear-algebra interface (see http://www.netlib.org/blas/). +dnl On success, it sets the BLAS_LIBS output variable to +dnl hold the requisite library linkages. +dnl +dnl To link with BLAS, you should link with: +dnl +dnl $BLAS_LIBS $LIBS $FLIBS +dnl +dnl in that order. FLIBS is the output variable of the +dnl AC_F77_LIBRARY_LDFLAGS macro (called if necessary by ACX_BLAS), +dnl and is sometimes necessary in order to link with F77 libraries. +dnl Users will also need to use AC_F77_DUMMY_MAIN (see the autoconf +dnl manual), for the same reason. +dnl +dnl Many libraries are searched for, from ATLAS to CXML to ESSL. +dnl The user may also use --with-blas= in order to use some +dnl specific BLAS library . In order to link successfully, +dnl however, be aware that you will probably need to use the same +dnl Fortran compiler (which can be set via the F77 env. var.) as +dnl was used to compile the BLAS library. +dnl +dnl ACTION-IF-FOUND is a list of shell commands to run if a BLAS +dnl library is found, and ACTION-IF-NOT-FOUND is a list of commands +dnl to run it if it is not found. If ACTION-IF-FOUND is not specified, +dnl the default action will define HAVE_BLAS. +dnl +dnl This macro requires autoconf 2.50 or later. +dnl +dnl @version $Id: acx_blas.m4,v 1.2 2001/12/13 01:03:06 simons Exp $ +dnl @author Steven G. Johnson +dnl +AC_DEFUN([ACX_BLAS], [ +AC_PREREQ(2.50) +AC_REQUIRE([AC_F77_LIBRARY_LDFLAGS]) +acx_blas_ok=no + +AC_ARG_WITH(blas, + [AS_HELP_STRING([--with-blas=], [use BLAS library ])]) +case $with_blas in + yes | "") ;; + no) acx_blas_ok=disable ;; + -* | */* | *.a | *.so | *.so.* | *.o) BLAS_LIBS="$with_blas" ;; + *) BLAS_LIBS="-l$with_blas" ;; +esac + +# Get fortran linker names of BLAS functions to check for. +if $have_fortran_compiler; then + AC_F77_FUNC(sgemm) + AC_F77_FUNC(dgemm) +elif $have_f2c; then + sgemm=sgemm_ + dgemm=dgemm_ +fi + +acx_blas_save_LIBS="$LIBS" +LIBS="$LIBS $FLIBS" + +# First, check BLAS_LIBS environment variable +if test $acx_blas_ok = no; then +if test "x$BLAS_LIBS" != x; then + save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" + AC_MSG_CHECKING([for $sgemm in $BLAS_LIBS]) + AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], + [acx_blas_ok=yes], [BLAS_LIBS=""]) + AC_MSG_RESULT($acx_blas_ok) + LIBS="$save_LIBS" +fi +fi + +# BLAS linked to by default? (happens on some supercomputers) +if test $acx_blas_ok = no; then + save_LIBS="$LIBS"; LIBS="$LIBS" + AC_CHECK_FUNC($sgemm, [acx_blas_ok=yes]) + LIBS="$save_LIBS" +fi + +# BLAS in ATLAS library? (http://math-atlas.sourceforge.net/) +if test $acx_blas_ok = no; then + AC_CHECK_LIB(atlas, ATL_xerbla, + [AC_CHECK_LIB(f77blas, $sgemm, + [AC_CHECK_LIB(cblas, cblas_dgemm, + [acx_blas_ok=yes + BLAS_LIBS="-lcblas -lf77blas -latlas"], + [], [-lf77blas -latlas])], + [], [-latlas])]) +fi + +# BLAS in Apple vecLib framework? (Mac OS X) +if test $acx_blas_ok = no; then + vlib_flags="-Wl,-framework -Wl,vecLib" + save_LIBS="$LIBS"; LIBS="$vlib_flags $LIBS" + AC_MSG_CHECKING([for $sgemm in $vlib_flags]) + AC_LINK_IFELSE([AC_LANG_CALL([], [$sgemm])], + [acx_blas_ok=yes; BLAS_LIBS="$vlib_flags"], + [BLAS_LIBS=""]) + AC_MSG_RESULT($acx_blas_ok) + LIBS="$save_LIBS" +fi + +# BLAS in PhiPACK libraries? (requires generic BLAS lib, too) +if test $acx_blas_ok = no; then + AC_CHECK_LIB(blas, $sgemm, + [AC_CHECK_LIB(dgemm, $dgemm, + [AC_CHECK_LIB(sgemm, $sgemm, + [acx_blas_ok=yes; BLAS_LIBS="-lsgemm -ldgemm -lblas"], + [], [-lblas])], + [], [-lblas])]) +fi + +# BLAS in Alpha CXML library? +if test $acx_blas_ok = no; then + AC_CHECK_LIB(cxml, $sgemm, [acx_blas_ok=yes;BLAS_LIBS="-lcxml"]) +fi + +# BLAS in Alpha DXML library? (now called CXML, see above) +if test $acx_blas_ok = no; then + AC_CHECK_LIB(dxml, $sgemm, [acx_blas_ok=yes;BLAS_LIBS="-ldxml"]) +fi + +# BLAS in Sun Performance library? +if test $acx_blas_ok = no; then + if test "x$GCC" != xyes; then # only works with Sun CC + AC_CHECK_LIB(sunmath, acosp, + [AC_CHECK_LIB(sunperf, $sgemm, + [BLAS_LIBS="-lsunperf -lsunmath" + acx_blas_ok=yes],[],[-lsunmath])]) + fi +fi + +# BLAS in SCSL library? (SGI/Cray Scientific Library) +if test $acx_blas_ok = no; then + AC_CHECK_LIB(scs, $sgemm, [acx_blas_ok=yes; BLAS_LIBS="-lscs"]) +fi + +# BLAS in SGIMATH library? +if test $acx_blas_ok = no; then + AC_CHECK_LIB(complib.sgimath, $sgemm, + [acx_blas_ok=yes; BLAS_LIBS="-lcomplib.sgimath"]) +fi + +# BLAS in IBM ESSL library? (requires generic BLAS lib, too) +if test $acx_blas_ok = no; then + AC_CHECK_LIB(blas, $sgemm, + [AC_CHECK_LIB(essl, $sgemm, + [acx_blas_ok=yes; BLAS_LIBS="-lessl -lblas"], + [], [-lblas $FLIBS])]) +fi + +# Generic BLAS library? +if test $acx_blas_ok = no; then + AC_CHECK_LIB(blas, $sgemm, [acx_blas_ok=yes; BLAS_LIBS="-lblas"]) +fi + +AC_SUBST(BLAS_LIBS) + +LIBS="$acx_blas_save_LIBS" + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$acx_blas_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1]) + : +else + acx_blas_ok=no + $2 +fi +])dnl ACX_BLAS diff -r 080e11f1b0c1 -r 4531741e5236 m4/acx_blas_f77_func.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m4/acx_blas_f77_func.m4 Tue Sep 15 13:48:39 2009 -0400 @@ -0,0 +1,205 @@ +# =========================================================================== +# http://autoconf-archive.cryp.to/acx_blas_f77_func.html +# =========================================================================== +# +# SYNOPSIS +# +# ACX_BLAS_F77_FUNC([ACTION-IF-PASS[, ACTION-IF-FAIL[, ACTION-IF-CROSS-COMPILING]]) +# ACX_BLAS_WITH_F77_FUNC([ACTION-IF-FOUND-AND-PASS[, ACTION-IF-NOT-FOUND-OR-FAIL]]) +# +# DESCRIPTION +# +# These macros are intended as a supplement to the ACX_BLAS macro, to +# verify that BLAS functions are properly callable from Fortran. This is +# necessary, for example, if you want to build the LAPACK library on top +# of the BLAS. +# +# ACX_BLAS_F77_FUNC uses the defined BLAS_LIBS and Fortran environment to +# check for compatibility, and takes a specific action in case of success, +# resp. failure, resp. cross-compilation. +# +# ACX_BLAS_WITH_F77_FUNC is a drop-in replacement wrapper for ACX_BLAS +# that calls ACX_BLAS_F77_FUNC after detecting a BLAS library and rejects +# it on failure (i.e. pretends that no library was found). +# +# LAST MODIFICATION +# +# 2008-06-18 +# +# COPYLEFT +# +# Copyright (c) 2008 Jaroslav Hajek +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Macro Archive. When you make and +# distribute a modified version of the Autoconf Macro, you may extend this +# special exception to the GPL to apply to your modified version as well. + +AC_DEFUN([ACX_BLAS_F77_FUNC], [ +AC_PREREQ(2.50) +AC_REQUIRE([ACX_BLAS]) + +# F77 call-compatibility checks +if test "$cross_compiling" = yes ; then + ifelse($3, ,$1,$3) +elif test x"$acx_blas_ok" = xyes; then + save_acx_blas_f77_func_LIBS="$LIBS" + LIBS="$BLAS_LIBS $LIBS" + AC_LANG_PUSH(Fortran 77) +# LSAME check (LOGICAL return values) + AC_MSG_CHECKING([whether LSAME is called correctly from Fortran]) + AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ + logical lsame,w + external lsame + character c1,c2 + c1 = 'A' + c2 = 'B' + w = lsame(c1,c2) + if (w) stop 1 + w = lsame(c1,c1) + if (.not. w) stop 1 + ]]),[acx_blas_lsame_fcall_ok=yes], + [acx_blas_lsame_fcall_ok=no]) + AC_MSG_RESULT([$acx_blas_lsame_fcall_ok]) +# ISAMAX check (INTEGER return values) + AC_MSG_CHECKING([whether ISAMAX is called correctly from Fortran]) + AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ + integer isamax,i + external isamax + real a(2) + a(1) = 1e0 + a(2) = -2e0 + i = isamax(2,a,1) + if (i.ne.2) stop 1 + ]]),[acx_blas_isamax_fcall_ok=yes], + [acx_blas_isamax_fcall_ok=no]) + AC_MSG_RESULT([$acx_blas_isamax_fcall_ok]) +# SDOT check (REAL return values) + AC_MSG_CHECKING([whether SDOT is called correctly from Fortran]) + AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ + real sdot,a(1),b(1),w + external sdot + a(1) = 1e0 + b(1) = 2e0 + w = sdot(1,a,1,b,1) + if (w .ne. a(1)*b(1)) stop 1 + ]]),[acx_blas_sdot_fcall_ok=yes], + [acx_blas_sdot_fcall_ok=no]) + AC_MSG_RESULT([$acx_blas_sdot_fcall_ok]) +# DDOT check (DOUBLE return values) + AC_MSG_CHECKING([whether DDOT is called correctly from Fortran]) + AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ + double precision ddot,a(1),b(1),w + external ddot + a(1) = 1d0 + b(1) = 2d0 + w = ddot(1,a,1,b,1) + if (w .ne. a(1)*b(1)) stop 1 + ]]),[acx_blas_ddot_fcall_ok=yes], + [acx_blas_ddot_fcall_ok=no]) + AC_MSG_RESULT([$acx_blas_ddot_fcall_ok]) +# CDOTU check (COMPLEX return values) + AC_MSG_CHECKING([whether CDOTU is called correctly from Fortran]) + AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ + complex cdotu,a(1),b(1),w + external cdotu + a(1) = cmplx(1e0,1e0) + b(1) = cmplx(1e0,2e0) + w = cdotu(1,a,1,b,1) + if (w .ne. a(1)*b(1)) stop 1 + ]]),[acx_blas_cdotu_fcall_ok=yes], + [acx_blas_cdotu_fcall_ok=no]) + AC_MSG_RESULT([$acx_blas_cdotu_fcall_ok]) +# ZDOTU check (DOUBLE COMPLEX return values) + AC_MSG_CHECKING([whether ZDOTU is called correctly from Fortran]) + AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ + double complex zdotu,a(1),b(1),w + external zdotu + a(1) = dcmplx(1d0,1d0) + b(1) = dcmplx(1d0,2d0) + w = zdotu(1,a,1,b,1) + if (w .ne. a(1)*b(1)) stop 1 + ]]),[acx_blas_zdotu_fcall_ok=yes], + [acx_blas_zdotu_fcall_ok=no]) + AC_MSG_RESULT([$acx_blas_zdotu_fcall_ok]) +# Check for correct integer size +# FIXME: this may fail with things like -ftrapping-math. + AC_MSG_CHECKING([whether the integer size is correct]) + AC_RUN_IFELSE(AC_LANG_PROGRAM(,[[ + integer n,nn(3) + real s,a(1),b(1),sdot + a(1) = 1.0 + b(1) = 1.0 +c Generate -2**33 + 1, if possible + n = 2 + n = -4 * (n ** 30) + n = n + 1 + if (n >= 0) goto 1 +c This means we're on 64-bit integers. Check whether the BLAS is, too. + s = sdot(n,a,1,b,1) + if (s .ne. 0.0) stop 1 + 1 continue +c We may be on 32-bit integers, and the BLAS on 64 bits. This is almost bound +c to have already failed, but just in case, we'll check. + nn(1) = -1 + nn(2) = 1 + nn(3) = -1 + s = sdot(nn(2),a,1,b,1) + if (s .ne. 1.0) stop 1 + ]]),[acx_blas_integer_size_ok=yes], + [acx_blas_integer_size_ok=no]) + AC_MSG_RESULT([$acx_blas_integer_size_ok]) + + AC_LANG_POP(Fortran 77) + +# if any of the tests failed, reject the BLAS library + if test $acx_blas_lsame_fcall_ok = yes \ + -a $acx_blas_sdot_fcall_ok = yes \ + -a $acx_blas_ddot_fcall_ok = yes \ + -a $acx_blas_cdotu_fcall_ok = yes \ + -a $acx_blas_zdotu_fcall_ok = yes \ + -a $acx_blas_integer_size_ok = yes; then + acx_blas_f77_func_ok=yes; + $1 + else + acx_blas_f77_func_ok=no; + $2 + fi + LIBS="$save_acx_blas_f77_func_LIBS" +fi + +])dnl ACX_BLAS_F77_FUNC + +AC_DEFUN([ACX_BLAS_WITH_F77_FUNC], [ +AC_PREREQ(2.50) +ACX_BLAS([# disable special action], []) +if test x$acx_blas_ok = xyes ; then + ACX_BLAS_F77_FUNC( + [ifelse([$1],,AC_DEFINE(HAVE_BLAS,1,[Define if you have a BLAS library.]),[$1])], + [acx_blas_ok=no; BLAS_LIBS=]) +fi +if test x$acx_blas_ok = xno ; then + $2 +fi +])dnl ACX_BLAS_WITH_F77_FUNC diff -r 080e11f1b0c1 -r 4531741e5236 m4/acx_lapack.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m4/acx_lapack.m4 Tue Sep 15 13:48:39 2009 -0400 @@ -0,0 +1,132 @@ +# =========================================================================== +# http://autoconf-archive.cryp.to/acx_lapack.html +# =========================================================================== +# +# SYNOPSIS +# +# ACX_LAPACK([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro looks for a library that implements the LAPACK linear-algebra +# interface (see http://www.netlib.org/lapack/). On success, it sets the +# LAPACK_LIBS output variable to hold the requisite library linkages. +# +# To link with LAPACK, you should link with: +# +# $LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS +# +# in that order. BLAS_LIBS is the output variable of the ACX_BLAS macro, +# called automatically. FLIBS is the output variable of the +# AC_F77_LIBRARY_LDFLAGS macro (called if necessary by ACX_BLAS), and is +# sometimes necessary in order to link with F77 libraries. Users will also +# need to use AC_F77_DUMMY_MAIN (see the autoconf manual), for the same +# reason. +# +# The user may also use --with-lapack= in order to use some specific +# LAPACK library . In order to link successfully, however, be aware +# that you will probably need to use the same Fortran compiler (which can +# be set via the F77 env. var.) as was used to compile the LAPACK and BLAS +# libraries. +# +# ACTION-IF-FOUND is a list of shell commands to run if a LAPACK library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_LAPACK. +# +# LAST MODIFICATION +# +# 2008-06-29 +# +# COPYLEFT +# +# Copyright (c) 2008 Steven G. Johnson +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Macro Archive. When you make and +# distribute a modified version of the Autoconf Macro, you may extend this +# special exception to the GPL to apply to your modified version as well. + +AC_DEFUN([ACX_LAPACK], [ +AC_REQUIRE([ACX_BLAS]) +acx_lapack_ok=no + +AC_ARG_WITH(lapack, + [AC_HELP_STRING([--with-lapack=], [use LAPACK library ])]) +case $with_lapack in + yes | "") ;; + no) acx_lapack_ok=disable ;; + -* | */* | *.a | *.so | *.so.* | *.o) LAPACK_LIBS="$with_lapack" ;; + *) LAPACK_LIBS="-l$with_lapack" ;; +esac + +# Get fortran linker name of LAPACK function to check for. +AC_F77_FUNC(cheev) + +# We cannot use LAPACK if BLAS is not found +if test "x$acx_blas_ok" != xyes; then + acx_lapack_ok=noblas + LAPACK_LIBS="" +fi + +# First, check LAPACK_LIBS environment variable +if test "x$LAPACK_LIBS" != x; then + save_LIBS="$LIBS"; LIBS="$LAPACK_LIBS $BLAS_LIBS $LIBS $FLIBS" + AC_MSG_CHECKING([for $cheev in $LAPACK_LIBS]) + AC_TRY_LINK_FUNC($cheev, [acx_lapack_ok=yes], [LAPACK_LIBS=""]) + AC_MSG_RESULT($acx_lapack_ok) + LIBS="$save_LIBS" + if test $acx_lapack_ok = no; then + LAPACK_LIBS="" + fi +fi + +# LAPACK linked to by default? (is sometimes included in BLAS lib) +if test $acx_lapack_ok = no; then + save_LIBS="$LIBS"; LIBS="$LIBS $BLAS_LIBS $FLIBS" + AC_CHECK_FUNC($cheev, [acx_lapack_ok=yes]) + LIBS="$save_LIBS" +fi + +# Generic LAPACK library? +for lapack in lapack lapack_rs6k; do + if test $acx_lapack_ok = no; then + save_LIBS="$LIBS"; LIBS="$BLAS_LIBS $LIBS" + AC_CHECK_LIB($lapack, $cheev, + [acx_lapack_ok=yes; LAPACK_LIBS="-l$lapack"], [], [$FLIBS]) + LIBS="$save_LIBS" + fi +done + +AC_SUBST(LAPACK_LIBS) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$acx_lapack_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_LAPACK,1,[Define if you have LAPACK library.]),[$1]) + : +else + acx_lapack_ok=no + $2 +fi +])dnl ACX_LAPACK diff -r 080e11f1b0c1 -r 4531741e5236 m4/acx_pthread.m4 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/m4/acx_pthread.m4 Tue Sep 15 13:48:39 2009 -0400 @@ -0,0 +1,271 @@ +# =========================================================================== +# http://www.nongnu.org/autoconf-archive/acx_pthread.html +# =========================================================================== +# +# SYNOPSIS +# +# ACX_PTHREAD([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]]) +# +# DESCRIPTION +# +# This macro figures out how to build C programs using POSIX threads. It +# sets the PTHREAD_LIBS output variable to the threads library and linker +# flags, and the PTHREAD_CFLAGS output variable to any special C compiler +# flags that are needed. (The user can also force certain compiler +# flags/libs to be tested by setting these environment variables.) +# +# Also sets PTHREAD_CC to any special C compiler that is needed for +# multi-threaded programs (defaults to the value of CC otherwise). (This +# is necessary on AIX to use the special cc_r compiler alias.) +# +# NOTE: You are assumed to not only compile your program with these flags, +# but also link it with them as well. e.g. you should link with +# $PTHREAD_CC $CFLAGS $PTHREAD_CFLAGS $LDFLAGS ... $PTHREAD_LIBS $LIBS +# +# If you are only building threads programs, you may wish to use these +# variables in your default LIBS, CFLAGS, and CC: +# +# LIBS="$PTHREAD_LIBS $LIBS" +# CFLAGS="$CFLAGS $PTHREAD_CFLAGS" +# CC="$PTHREAD_CC" +# +# In addition, if the PTHREAD_CREATE_JOINABLE thread-attribute constant +# has a nonstandard name, defines PTHREAD_CREATE_JOINABLE to that name +# (e.g. PTHREAD_CREATE_UNDETACHED on AIX). +# +# ACTION-IF-FOUND is a list of shell commands to run if a threads library +# is found, and ACTION-IF-NOT-FOUND is a list of commands to run it if it +# is not found. If ACTION-IF-FOUND is not specified, the default action +# will define HAVE_PTHREAD. +# +# Please let the authors know if this macro fails on any platform, or if +# you have any other suggestions or comments. This macro was based on work +# by SGJ on autoconf scripts for FFTW (http://www.fftw.org/) (with help +# from M. Frigo), as well as ac_pthread and hb_pthread macros posted by +# Alejandro Forero Cuervo to the autoconf macro repository. We are also +# grateful for the helpful feedback of numerous users. +# +# LICENSE +# +# Copyright (c) 2008 Steven G. Johnson +# +# This program is free software: you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by the +# Free Software Foundation, either version 3 of the License, or (at your +# option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General +# Public License for more details. +# +# You should have received a copy of the GNU General Public License along +# with this program. If not, see . +# +# As a special exception, the respective Autoconf Macro's copyright owner +# gives unlimited permission to copy, distribute and modify the configure +# scripts that are the output of Autoconf when processing the Macro. You +# need not follow the terms of the GNU General Public License when using +# or distributing such scripts, even though portions of the text of the +# Macro appear in them. The GNU General Public License (GPL) does govern +# all other use of the material that constitutes the Autoconf Macro. +# +# This special exception to the GPL applies to versions of the Autoconf +# Macro released by the Autoconf Archive. When you make and distribute a +# modified version of the Autoconf Macro, you may extend this special +# exception to the GPL to apply to your modified version as well. + +AC_DEFUN([ACX_PTHREAD], [ +AC_REQUIRE([AC_CANONICAL_HOST]) +AC_LANG_SAVE +AC_LANG_C +acx_pthread_ok=no + +# We used to check for pthread.h first, but this fails if pthread.h +# requires special compiler flags (e.g. on True64 or Sequent). +# It gets checked for in the link test anyway. + +# First of all, check if the user has set any of the PTHREAD_LIBS, +# etcetera environment variables, and if threads linking works using +# them: +if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) + AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) + AC_MSG_RESULT($acx_pthread_ok) + if test x"$acx_pthread_ok" = xno; then + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" + fi + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" +fi + +# We must check for the threads library under a number of different +# names; the ordering is very important because some systems +# (e.g. DEC) have both -lpthread and -lpthreads, where one of the +# libraries is broken (non-POSIX). + +# Create a list of thread flags to try. Items starting with a "-" are +# C compiler flags, and other items are library names, except for "none" +# which indicates that we try without any flags at all, and "pthread-config" +# which is a program returning the flags for the Pth emulation library. + +acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" + +# The ordering *is* (sometimes) important. Some notes on the +# individual items follow: + +# pthreads: AIX (must check this before -lpthread) +# none: in case threads are in libc; should be tried before -Kthread and +# other compiler flags to prevent continual compiler warnings +# -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) +# -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) +# lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) +# -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) +# -pthreads: Solaris/gcc +# -mthreads: Mingw32/gcc, Lynx/gcc +# -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it +# doesn't hurt to check since this sometimes defines pthreads too; +# also defines -D_REENTRANT) +# ... -mt is also the pthreads flag for HP/aCC +# pthread: Linux, etcetera +# --thread-safe: KAI C++ +# pthread-config: use pthread-config program (for GNU Pth library) + +case "${host_cpu}-${host_os}" in + *solaris*) + + # On Solaris (at least, for some versions), libc contains stubbed + # (non-functional) versions of the pthreads routines, so link-based + # tests will erroneously succeed. (We need to link with -pthreads/-mt/ + # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather + # a function called by this macro, so we could check for that, but + # who knows whether they'll stub that too in a future libc.) So, + # we'll just look for -pthreads and -lpthread first: + + acx_pthread_flags="-pthreads pthread -mt -pthread $acx_pthread_flags" + ;; +esac + +if test x"$acx_pthread_ok" = xno; then +for flag in $acx_pthread_flags; do + + case $flag in + none) + AC_MSG_CHECKING([whether pthreads work without any flags]) + ;; + + -*) + AC_MSG_CHECKING([whether pthreads work with $flag]) + PTHREAD_CFLAGS="$flag" + ;; + + pthread-config) + AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) + if test x"$acx_pthread_config" = xno; then continue; fi + PTHREAD_CFLAGS="`pthread-config --cflags`" + PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" + ;; + + *) + AC_MSG_CHECKING([for the pthreads library -l$flag]) + PTHREAD_LIBS="-l$flag" + ;; + esac + + save_LIBS="$LIBS" + save_CFLAGS="$CFLAGS" + LIBS="$PTHREAD_LIBS $LIBS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Check for various functions. We must include pthread.h, + # since some functions may be macros. (On the Sequent, we + # need a special flag -Kthread to make this header compile.) + # We check for pthread_join because it is in -lpthread on IRIX + # while pthread_create is in libc. We check for pthread_attr_init + # due to DEC craziness with -lpthreads. We check for + # pthread_cleanup_push because it is one of the few pthread + # functions on Solaris that doesn't have a non-functional libc stub. + # We try pthread_create on general principles. + AC_TRY_LINK([#include ], + [pthread_t th; pthread_join(th, 0); + pthread_attr_init(0); pthread_cleanup_push(0, 0); + pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], + [acx_pthread_ok=yes]) + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + AC_MSG_RESULT($acx_pthread_ok) + if test "x$acx_pthread_ok" = xyes; then + break; + fi + + PTHREAD_LIBS="" + PTHREAD_CFLAGS="" +done +fi + +# Various other checks: +if test "x$acx_pthread_ok" = xyes; then + save_LIBS="$LIBS" + LIBS="$PTHREAD_LIBS $LIBS" + save_CFLAGS="$CFLAGS" + CFLAGS="$CFLAGS $PTHREAD_CFLAGS" + + # Detect AIX lossage: JOINABLE attribute is called UNDETACHED. + AC_MSG_CHECKING([for joinable pthread attribute]) + attr_name=unknown + for attr in PTHREAD_CREATE_JOINABLE PTHREAD_CREATE_UNDETACHED; do + AC_TRY_LINK([#include ], [int attr=$attr; return attr;], + [attr_name=$attr; break]) + done + AC_MSG_RESULT($attr_name) + if test "$attr_name" != PTHREAD_CREATE_JOINABLE; then + AC_DEFINE_UNQUOTED(PTHREAD_CREATE_JOINABLE, $attr_name, + [Define to necessary symbol if this constant + uses a non-standard name on your system.]) + fi + + AC_MSG_CHECKING([if more special flags are required for pthreads]) + flag=no + case "${host_cpu}-${host_os}" in + *-aix* | *-freebsd* | *-darwin*) flag="-D_THREAD_SAFE";; + *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; + esac + AC_MSG_RESULT(${flag}) + if test "x$flag" != xno; then + PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" + fi + + LIBS="$save_LIBS" + CFLAGS="$save_CFLAGS" + + # More AIX lossage: must compile with xlc_r or cc_r + if test x"$GCC" != xyes; then + AC_CHECK_PROGS(PTHREAD_CC, xlc_r cc_r, ${CC}) + else + PTHREAD_CC=$CC + fi +else + PTHREAD_CC="$CC" +fi + +AC_SUBST(PTHREAD_LIBS) +AC_SUBST(PTHREAD_CFLAGS) +AC_SUBST(PTHREAD_CC) + +# Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: +if test x"$acx_pthread_ok" = xyes; then + ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) + : +else + acx_pthread_ok=no + $2 +fi +AC_LANG_RESTORE +])dnl ACX_PTHREAD diff -r 080e11f1b0c1 -r 4531741e5236 missing --- a/missing Tue Sep 15 17:17:13 2009 +0200 +++ b/missing Tue Sep 15 13:48:39 2009 -0400 @@ -1,7 +1,11 @@ #! /bin/sh # Common stub for a few missing GNU programs while installing. -# Copyright (C) 1996, 1997 Free Software Foundation, Inc. -# Franc,ois Pinard , 1996. + +scriptversion=2006-05-10.23 + +# Copyright (C) 1996, 1997, 1999, 2000, 2002, 2003, 2004, 2005, 2006 +# Free Software Foundation, Inc. +# Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -18,14 +22,46 @@ # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA # 02110-1301, USA. +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi -fail_missing=false +run=: +sed_output='s/.* --output[ =]\([^ ]*\).*/\1/p' +sed_minuso='s/.* -o \([^ ]*\).*/\1/p' + +# In the cases where this matters, `missing' is being run in the +# srcdir already. +if test -f configure.ac; then + configure_ac=configure.ac +else + configure_ac=configure.in +fi + +msg="missing on your system" -case "$1" in +case $1 in +--run) + # Try to run requested program, and just exit if it succeeds. + run= + shift + "$@" && exit 0 + # Exit code 63 means version mismatch. This often happens + # when the user try to use an ancient version of a tool on + # a file that requires a minimum version. In this case we + # we should proceed has if the program had been absent, or + # if --run hadn't been passed. + if test $? = 63; then + run=: + msg="probably too old" + fi + ;; -h|--h|--he|--hel|--help) echo "\ @@ -37,22 +73,29 @@ Options: -h, --help display this help and exit -v, --version output version information and exit + --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' + autom4te touch the output file, or create a stub one automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c - gperf + help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file - yacc create \`y.tab.[ch]', if possible, from existing .[ch]" + tar try tar, gnutar, gtar, then tar without non-portable flags + yacc create \`y.tab.[ch]', if possible, from existing .[ch] + +Send bug reports to ." + exit $? ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) - echo "missing - GNU libit 0.0" + echo "missing $scriptversion (GNU Automake)" + exit $? ;; -*) @@ -61,103 +104,264 @@ exit 1 ;; - aclocal) +esac + +# Now exit if we have it, but it failed. Also exit now if we +# don't have it and --version was passed (most likely to detect +# the program). +case $1 in + lex|yacc) + # Not GNU programs, they don't have --version. + ;; + + tar) + if test -n "$run"; then + echo 1>&2 "ERROR: \`tar' requires --run" + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + exit 1 + fi + ;; + + *) + if test -z "$run" && ($1 --version) > /dev/null 2>&1; then + # We have it, but it failed. + exit 1 + elif test "x$2" = "x--version" || test "x$2" = "x--help"; then + # Could not run --version or --help. This is probably someone + # running `$TOOL --version' or `$TOOL --help' to check whether + # $TOOL exists and not knowing $TOOL uses missing. + exit 1 + fi + ;; +esac + +# If it does not exist, or fails to run (possibly an outdated version), +# try to emulate it. +case $1 in + aclocal*) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acinclude.m4' or \`configure.in'. You might want +WARNING: \`$1' is $msg. You should only need it if + you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." - fail_missing=true + touch aclocal.m4 ;; autoconf) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`configure.in'. You might want to install the +WARNING: \`$1' is $msg. You should only need it if + you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." - fail_missing=true + touch configure ;; autoheader) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`acconfig.h' or \`configure.in'. You might want +WARNING: \`$1' is $msg. You should only need it if + you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." - fail_missing=true + files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` + test -z "$files" && files="config.h" + touch_files= + for f in $files; do + case $f in + *:*) touch_files="$touch_files "`echo "$f" | + sed -e 's/^[^:]*://' -e 's/:.*//'`;; + *) touch_files="$touch_files $f.in";; + esac + done + touch $touch_files ;; - automake) + automake*) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified \`Makefile.am', \`acinclude.m4' or \`configure.in'. +WARNING: \`$1' is $msg. You should only need it if + you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." - fail_missing=true + find . -type f -name Makefile.am -print | + sed 's/\.am$/.in/' | + while read f; do touch "$f"; done + ;; + + autom4te) + echo 1>&2 "\ +WARNING: \`$1' is needed, but is $msg. + You might have modified some files without having the + proper tools for further handling them. + You can get \`$1' as part of \`Autoconf' from any GNU + archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo "#! /bin/sh" + echo "# Created by GNU Automake missing as a replacement of" + echo "# $ $@" + echo "exit 0" + chmod +x $file + exit 1 + fi ;; bison|yacc) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' $msg. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." - fail_missing=true + rm -f y.tab.c y.tab.h + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.y) + SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.c + fi + SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" y.tab.h + fi + ;; + esac + fi + if test ! -f y.tab.h; then + echo >y.tab.h + fi + if test ! -f y.tab.c; then + echo 'main() { return 0; }' >y.tab.c + fi ;; lex|flex) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' is $msg. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." - fail_missing=true + rm -f lex.yy.c + if test $# -ne 1; then + eval LASTARG="\${$#}" + case $LASTARG in + *.l) + SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` + if test -f "$SRCFILE"; then + cp "$SRCFILE" lex.yy.c + fi + ;; + esac + fi + if test ! -f lex.yy.c; then + echo 'main() { return 0; }' >lex.yy.c + fi ;; - gperf) + help2man) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if - you modified a \`.gperf' file. You may need the \`gperf' package - in order for those modifications to take effect. You can get - \`gperf' from any GNU archive site." - fail_missing=true +WARNING: \`$1' is $msg. You should only need it if + you modified a dependency of a manual page. You may need the + \`Help2man' package in order for those modifications to take + effect. You can get \`Help2man' from any GNU archive site." + + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -f "$file"; then + touch $file + else + test -z "$file" || exec >$file + echo ".ab help2man is required to generate this page" + exit 1 + fi ;; makeinfo) echo 1>&2 "\ -WARNING: \`$1' is missing on your system. You should only need it if +WARNING: \`$1' is $msg. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." - fail_missing=true + # The file to touch is that specified with -o ... + file=`echo "$*" | sed -n "$sed_output"` + test -z "$file" && file=`echo "$*" | sed -n "$sed_minuso"` + if test -z "$file"; then + # ... or it is the one specified with @setfilename ... + infile=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` + file=`sed -n ' + /^@setfilename/{ + s/.* \([^ ]*\) *$/\1/ + p + q + }' $infile` + # ... or it is derived from the source name (dir/f.texi becomes f.info) + test -z "$file" && file=`echo "$infile" | sed 's,.*/,,;s,.[^.]*$,,'`.info + fi + # If the file does not exist, the user really needs makeinfo; + # let's fail without touching anything. + test -f $file || exit 1 + touch $file + ;; + + tar) + shift + + # We have already tried tar in the generic part. + # Look for gnutar/gtar before invocation to avoid ugly error + # messages. + if (gnutar --version > /dev/null 2>&1); then + gnutar "$@" && exit 0 + fi + if (gtar --version > /dev/null 2>&1); then + gtar "$@" && exit 0 + fi + firstarg="$1" + if shift; then + case $firstarg in + *o*) + firstarg=`echo "$firstarg" | sed s/o//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + case $firstarg in + *h*) + firstarg=`echo "$firstarg" | sed s/h//` + tar "$firstarg" "$@" && exit 0 + ;; + esac + fi + + echo 1>&2 "\ +WARNING: I can't seem to be able to run \`tar' with the given arguments. + You may want to install GNU tar or Free paxutils, or check the + command line arguments." + exit 1 ;; *) echo 1>&2 "\ -WARNING: \`$1' is needed, and you do not seem to have it handy on your - system. You might have modified some files without having the +WARNING: \`$1' is needed, and is $msg. + You might have modified some files without having the proper tools for further handling them. Check the \`README' file, - it often tells you about the needed prerequirements for installing + it often tells you about the needed prerequisites for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." - fail_missing=true + exit 1 ;; esac -if $fail_missing; then - echo 1>&2 "\ - - You may also need \`$1' if you obtained this package from the CVS - archive because files that can be automatically generated are not - considered source files and are not checked in to the CVS archive. +exit 0 - You may also need \`$1' if you ran make maintainer-clean and - removed files that can be automatically generated but that are - normally distributed as part of the package for convenience." - exit 1 -fi - -exit 0 +# Local variables: +# eval: (add-hook 'write-file-hooks 'time-stamp) +# time-stamp-start: "scriptversion=" +# time-stamp-format: "%:y-%02m-%02d.%02H" +# time-stamp-end: "$" +# End: diff -r 080e11f1b0c1 -r 4531741e5236 octMakefile.in --- a/octMakefile.in Tue Sep 15 17:17:13 2009 +0200 +++ b/octMakefile.in Tue Sep 15 13:48:39 2009 -0400 @@ -36,8 +36,7 @@ INSTALL_DATA = @INSTALL_DATA@ CONF_DISTFILES = Makefile octMakefile.in Makeconf.in \ - configure configure.in config.guess config.sub aclocal.m4 \ - acx_blas.m4 acx_lapack.m4 acx_blas_f77_func.m4 \ + configure configure.ac config.guess config.sub aclocal.m4 \ config.h.in install-sh autogen.sh BUILT_DISTFILES = BUGS INSTALL.OCTAVE @@ -57,10 +56,10 @@ INSTALL_SUBDIRS = libcruft liboctave src scripts doc examples # Subdirectories in which to run `make conf-dist'. -CONF_DISTSUBDIRS = src +CONF_DISTSUBDIRS = src m4 # Subdirectories in which to run `make dist'. -DISTSUBDIRS = $(sort $(SUBDIRS) test emacs) +DISTSUBDIRS = $(sort $(SUBDIRS) test emacs m4) # Subdirectories in which to run clean targets. CLEANSUBDIRS = $(DISTSUBDIRS) @@ -74,9 +73,7 @@ SHELL_SCRIPTS = octave-bug$(SCRIPTS_EXE_SUFFIX) octave-config$(SCRIPTS_EXE_SUFFIX) \ mkoctfile$(SCRIPTS_EXE_SUFFIX) run-octave -CONFIG_FILES = @ac_config_files@ - -M4_FILES = $(wildcard *.m4) +CONFIG_FILES = @ac_config_headers@ @ac_config_files@ all: $(SHELL_SCRIPTS) $(filter-out libcruft liboctave, $(SUBDIRS)) dist-info-files @echo "" @@ -100,7 +97,9 @@ config.status: configure ./config.status --recheck -configure: configure.in $(M4_FILES) +M4_FILES = $(wildcard m4/*.m4) + +configure: configure.ac $(M4_FILES) (cd $(top_srcdir); autoconf --force) (cd $(top_srcdir); autoheader --force) diff -r 080e11f1b0c1 -r 4531741e5236 scripts/ChangeLog --- a/scripts/ChangeLog Tue Sep 15 17:17:13 2009 +0200 +++ b/scripts/ChangeLog Tue Sep 15 13:48:39 2009 -0400 @@ -1,3 +1,9 @@ +2009-09-15 John W. Eaton + + * confiugre.ac: Rename from configure.in + * Makefile.in: Rename all instances of configure.in to + configure.ac. + 2009-09-11 Jaroslav Hajek * optimization/Makefile.in: Include __doglegm__.m. diff -r 080e11f1b0c1 -r 4531741e5236 scripts/Makefile.in --- a/scripts/Makefile.in Tue Sep 15 17:17:13 2009 +0200 +++ b/scripts/Makefile.in Tue Sep 15 13:48:39 2009 -0400 @@ -39,7 +39,7 @@ ALL_M_FILES := $(patsubst $(srcdir)/%, %, $(ALL_M_FILES1)) DISTFILES = $(addprefix $(srcdir)/, Makefile.in ChangeLog $(SOURCES) \ - configure.in configure mkinstalldirs mkdoc mkpkgadd gethelp.cc \ + configure.ac configure mkinstalldirs mkdoc mkpkgadd gethelp.cc \ skip-autoheader move-if-change) DOCSTRINGS SUBDIRS = audio deprecated elfun general geometry help image io \ @@ -66,7 +66,7 @@ config.status: configure ./config.status --recheck -configure: configure.in +configure: configure.ac if [ ! -f skip-autoconf ]; then autoconf --force; fi if [ ! -f skip-autoheader ]; then autoheader --force; fi diff -r 080e11f1b0c1 -r 4531741e5236 scripts/configure.ac --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/scripts/configure.ac Tue Sep 15 13:48:39 2009 -0400 @@ -0,0 +1,42 @@ +dnl configure.in +dnl +dnl Process this file with autoconf to produce a configure script. +dnl +dnl Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2005, 2006, 2007, +dnl 2008, 2009 John W. Eaton +### +### This file is part of Octave. +### +### Octave is free software; you can redistribute it and/or modify it +### under the terms of the GNU General Public License as published by the +### Free Software Foundation; either version 3 of the License, or (at +### your option) any later version. +### +### Octave is distributed in the hope that it will be useful, but WITHOUT +### ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +### FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +### for more details. +### +### You should have received a copy of the GNU General Public License +### along with Octave; see the file COPYING. If not, see +### . + +AC_INIT +AC_REVISION() +AC_PREREQ(2.52) +AC_CONFIG_SRCDIR([startup/inputrc]) + +AC_PROG_INSTALL + +AC_SUBST(ac_config_files) +AC_CONFIG_FILES([Makefile audio/Makefile deprecated/Makefile elfun/Makefile \ + general/Makefile geometry/Makefile help/Makefile image/Makefile \ + io/Makefile linear-algebra/Makefile miscellaneous/Makefile \ + optimization/Makefile path/Makefile pkg/Makefile plot/Makefile \ + polynomial/Makefile set/Makefile \ + signal/Makefile sparse/Makefile specfun/Makefile \ + special-matrix/Makefile startup/Makefile statistics/Makefile \ + statistics/base/Makefile statistics/distributions/Makefile \ + statistics/models/Makefile statistics/tests/Makefile \ + strings/Makefile time/Makefile testfun/Makefile]) +AC_OUTPUT diff -r 080e11f1b0c1 -r 4531741e5236 scripts/configure.in --- a/scripts/configure.in Tue Sep 15 17:17:13 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,42 +0,0 @@ -dnl configure.in -dnl -dnl Process this file with autoconf to produce a configure script. -dnl -dnl Copyright (C) 1995, 1996, 1997, 1998, 2000, 2002, 2005, 2006, 2007, -dnl 2008, 2009 John W. Eaton -### -### This file is part of Octave. -### -### Octave is free software; you can redistribute it and/or modify it -### under the terms of the GNU General Public License as published by the -### Free Software Foundation; either version 3 of the License, or (at -### your option) any later version. -### -### Octave is distributed in the hope that it will be useful, but WITHOUT -### ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or -### FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License -### for more details. -### -### You should have received a copy of the GNU General Public License -### along with Octave; see the file COPYING. If not, see -### . - -AC_INIT -AC_REVISION() -AC_PREREQ(2.52) -AC_CONFIG_SRCDIR([startup/inputrc]) - -AC_PROG_INSTALL - -AC_SUBST(ac_config_files) -AC_CONFIG_FILES([Makefile audio/Makefile deprecated/Makefile elfun/Makefile \ - general/Makefile geometry/Makefile help/Makefile image/Makefile \ - io/Makefile linear-algebra/Makefile miscellaneous/Makefile \ - optimization/Makefile path/Makefile pkg/Makefile plot/Makefile \ - polynomial/Makefile set/Makefile \ - signal/Makefile sparse/Makefile specfun/Makefile \ - special-matrix/Makefile startup/Makefile statistics/Makefile \ - statistics/base/Makefile statistics/distributions/Makefile \ - statistics/models/Makefile statistics/tests/Makefile \ - strings/Makefile time/Makefile testfun/Makefile]) -AC_OUTPUT