# HG changeset patch # User John W. Eaton # Date 1251306940 14400 # Node ID d3fccc4c4b9ea4876bd96f34d615a021670dc087 # Parent 0a4eb56c56760a34c47292cc0714702f8c7b097a use OCTAVE_CHECK_LIBRARY to check for ARPACK diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2009-08-26 John W. Eaton + + * aclocal.m4 (OCTAVE_CHECK_LIBRARY): Allow empty list of header files. + * configure.in: Use OCTAVE_CHECK_LIBRARY to check for arpack. + * octave-bug.in, octave-bug.cc.in: Substitute ARPACK_CPPFLAGS and + ARPACK_LDFLAGS. + * Makeconf.in (ARPACK_CPPFLAGS, ARPACK_LDFLAGS): New variables. + (do-subst-config-vals): Substitute them. + 2009-08-26 Benjamin Lindner * mkoctfile.cc.in: Fix typo. diff --git a/Makeconf.in b/Makeconf.in --- a/Makeconf.in +++ b/Makeconf.in @@ -292,7 +292,11 @@ QRUPDATE_LIBS = @QRUPDATE_LIBS@ READLINE_LIBS = @READLINE_LIBS@ TERM_LIBS = @TERM_LIBS@ + +ARPACK_CPPFLAGS = @ARPACK_CPPFLAGS@ +ARPACK_LDFLAGS = @ARPACK_LDFLAGS@ ARPACK_LIBS = @ARPACK_LIBS@ + DL_LIBS = @DL_LIBS@ LIBS = @LIBS@ @@ -556,6 +560,8 @@ -e "s|%OCTAVE_CONF_AMD_LIBS%|\"${AMD_LIBS}\"|" \ -e "s|%OCTAVE_CONF_AR%|\"${AR}\"|" \ -e "s|%OCTAVE_CONF_ARFLAGS%|\"${ARFLAGS}\"|" \ + -e "s|%OCTAVE_CONF_ARPACK_CPPFLAGS%|\"${ARPACK_CPPFLAGS}\"|" \ + -e "s|%OCTAVE_CONF_ARPACK_LDFLAGS%|\"${ARPACK_LDFLAGS}\"|" \ -e "s|%OCTAVE_CONF_ARPACK_LIBS%|\"${ARPACK_LIBS}\"|" \ -e "s|%OCTAVE_CONF_BLAS_LIBS%|\"${BLAS_LIBS}\"|" \ -e "s|%OCTAVE_CONF_CAMD_CPPFLAGS%|\"${CAMD_CPPFLAGS}\"|" \ diff --git a/aclocal.m4 b/aclocal.m4 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -469,7 +469,10 @@ octave_check_library_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$m4_toupper([$1])_CPPFLAGS $CPPFLAGS" m4_ifnblank([$6], [AC_LANG_PUSH($6)]) - AC_CHECK_HEADERS($4, [ + octave_$1_check_for_lib=false + m4_ifblank([$4], [octave_$1_check_for_lib=true], + [AC_CHECK_HEADERS($4, [octave_$1_check_for_lib=true; break])]) + if $octave_$1_check_for_lib; then octave_check_library_save_LDFLAGS="$LDFLAGS" LDFLAGS="$m4_toupper([$1])_LDFLAGS $LDFLAGS" octave_check_library_save_LIBS="$LIBS" @@ -487,7 +490,8 @@ [TEXINFO_]m4_toupper([$1])="@set [HAVE_]m4_toupper([$1])"], [$8]) fi LIBS="$octave_check_library_save_LIBS" - LDFLAGS="$octave_check_library_save_LDFLAGS"]) + LDFLAGS="$octave_check_library_save_LDFLAGS" + fi m4_ifnblank([$6], [AC_LANG_POP($6)]) CPPFLAGS="$octave_check_library_save_CPPFLAGS" fi diff --git a/configure.in b/configure.in --- a/configure.in +++ b/configure.in @@ -936,26 +936,13 @@ AC_SUBST(TEXINFO_UMFPACK) -ARPACK_LIBS= -AC_SUBST(ARPACK_LIBS) - -AC_ARG_WITH(arpack, - [AS_HELP_STRING([--without-arpack], - [don't use ARPACK library, disable some sparse functionality])], - with_arpack=$withval, with_arpack=yes) - -warn_arpack="arpack not found. This will result in a lack of the eigs function." -if test "$with_arpack" = yes; then - with_arpack=no - AC_CHECK_LIB(arpack, F77_FUNC(dseupd,DSEUPD), [ARPACK_LIBS="-larpack"; with_arpack=yes], , $LAPACK_LIBS $FLIBS) - if test "$with_arpack" = yes; then - AC_DEFINE(HAVE_ARPACK, 1, [Define if the ARPACK library is used.]) - warn_arpack= - fi -fi -if test -n "$warn_arpack"; then - AC_MSG_WARN($warn_arpack) -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]) ### Handle shared library options. diff --git a/octave-bug.cc.in b/octave-bug.cc.in --- a/octave-bug.cc.in +++ b/octave-bug.cc.in @@ -104,6 +104,8 @@ vars["AMD_CPPFLAGS"] = %OCTAVE_CONF_AMD_CPPFLAGS%; vars["AMD_LDFLAGS"] = %OCTAVE_CONF_AMD_LDFLAGS%; vars["AMD_LIBS"] = %OCTAVE_CONF_AMD_LIBS%; + vars["ARPACK_CPPFLAGS"] = %OCTAVE_CONF_ARPACK_CPPFLAGS%; + vars["ARPACK_LDFLAGS"] = %OCTAVE_CONF_ARPACK_LDFLAGS%; vars["ARPACK_LIBS"] = %OCTAVE_CONF_ARPACK_LIBS%; vars["BLAS_LIBS"] = %OCTAVE_CONF_BLAS_LIBS%; vars["CAMD_CPPFLAGS"] = %OCTAVE_CONF_CAMD_CPPFLAGS%; diff --git a/octave-bug.in b/octave-bug.in --- a/octave-bug.in +++ b/octave-bug.in @@ -56,6 +56,8 @@ AMD_CPPFLAGS=%AMD_CPPFLAGS% AMD_LDFLAGS=%AMD_LDFLAGS% AMD_LIBS=%AMD_LIBS% +ARPACK_CPPFLAGS=%ARPACK_CPPFLAGS% +ARPACK_LDFLAGS=%ARPACK_LDFLAGS% ARPACK_LIBS=%ARPACK_LIBS% BLAS_LIBS=%BLAS_LIBS% CAMD_CPPFLAGS=%CAMD_CPPFLAGS% diff --git a/src/ChangeLog b/src/ChangeLog --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2009-08-26 John W. Eaton + + * oct-conf.h.in: New defines for ARPACK_CPPFLAGS and ARPACK_LDFLAGS. + * toplev.cc (octave_config_info): Include them in the list. + 2009-08-26 John W. Eaton * Makefile.in (OCTAVE_LIBS, OCTINTERP_LINK_DEPS): diff --git a/src/oct-conf.h.in b/src/oct-conf.h.in --- a/src/oct-conf.h.in +++ b/src/oct-conf.h.in @@ -61,6 +61,14 @@ #define OCTAVE_CONF_AR %OCTAVE_CONF_AR% #endif +#ifndef OCTAVE_CONF_ARPACK_CPPFLAGS +#define OCTAVE_CONF_ARPACK_CPPFLAGS %OCTAVE_CONF_ARPACK_CPPFLAGS% +#endif + +#ifndef OCTAVE_CONF_ARPACK_LDFLAGS +#define OCTAVE_CONF_ARPACK_LDFLAGS %OCTAVE_CONF_ARPACK_LDFLAGS% +#endif + #ifndef OCTAVE_CONF_ARPACK_LIBS #define OCTAVE_CONF_ARPACK_LIBS %OCTAVE_CONF_ARPACK_LIBS% #endif diff --git a/src/toplev.cc b/src/toplev.cc --- a/src/toplev.cc +++ b/src/toplev.cc @@ -1200,6 +1200,8 @@ { false, "AMD_LIBS", OCTAVE_CONF_AMD_LIBS }, { false, "AR", OCTAVE_CONF_AR }, { false, "ARFLAGS", OCTAVE_CONF_ARFLAGS }, + { false, "ARPACK_CPPFLAGS", OCTAVE_CONF_ARPACK_CPPFLAGS }, + { false, "ARPACK_LDFLAGS", OCTAVE_CONF_ARPACK_LDFLAGS }, { false, "ARPACK_LIBS", OCTAVE_CONF_ARPACK_LIBS }, { false, "BLAS_LIBS", OCTAVE_CONF_BLAS_LIBS }, { false, "CARBON_LIBS", OCTAVE_CONF_CARBON_LIBS },