Mercurial > hg > octave-shane
changeset 9542:f5ec5dc66824
use OCTAVE_CHECK_LIBRARY to check for HDF5
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 18 Aug 2009 13:05:14 -0400 |
parents | afbdf01bcacc |
children | 1d51ab34b509 |
files | ChangeLog Makeconf.in aclocal.m4 configure.in octave-bug.cc.in octave-bug.in src/ChangeLog src/Makefile.in src/oct-conf.h.in src/toplev.cc |
diffstat | 10 files changed, 68 insertions(+), 45 deletions(-) [+] |
line wrap: on
line diff
--- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2009-08-18 John W. Eaton <jwe@octave.org> + + * Makeconf.in (ALL_CPPFLAGS): Add HDF5_CPPFLAGS to the list. + * aclocal.m4 (OCTAVE_HDF5_HAS_REQUIRED_API): + Set HAVE_HDF5 to false, not WITH_HDF5. + * configure.in: Use OCTAVE_CHECK_LIBRARY to check for HDF5 + library. Print HDF5_CPPFLAGS and HDF5_LDFLAGLS in the summary. + * octave-bug.in, octave-bug.cc.in, Makeconf.in: Substitute + HDF5_CPPFLAGS and HDF5_LDFLAGS. + 2009-08-18 John W. Eaton <jwe@octave.org> * acx_blas_f77_func.m4 (ACX_BLAS_F77_FUNC): Save and restore LIBS.
--- a/Makeconf.in +++ b/Makeconf.in @@ -228,6 +228,9 @@ LIBCRUFT = @LIBCRUFT@ FT2_LIBS = @FT2_LIBS@ + +HDF5_CPPFLAGS = @HDF5_CPPFLAGS@ +HDF5_LDFLAGS = @HDF5_LDFLAGS@ HDF5_LIBS = @HDF5_LIBS@ Z_CPPFLAGS = @Z_CPPFLAGS@ @@ -293,7 +296,7 @@ DL_LIBS = @DL_LIBS@ LIBS = @LIBS@ -ALL_CPPFLAGS = $(CPPFLAGS) $(Z_CPPFLAGS) +ALL_CPPFLAGS = $(CPPFLAGS) $(HDF5_CPPFLAGS) $(Z_CPPFLAGS) ## Use sort to remove duplicates. SPARSE_CPPFLAGS = \ @@ -610,6 +613,8 @@ -e "s|%OCTAVE_CONF_GLPK_LIBS%|\"${GLPK_LIBS}\"|" \ -e "s|%OCTAVE_CONF_GNUPLOT%|\"${GNUPLOT}\"|" \ -e "s|%OCTAVE_CONF_GRAPHICS_LIBS%|\"${GRAPHICS_LIBS}\"|" \ + -e "s|%OCTAVE_CONF_HDF5_CPPFLAGS%|\"${HDF5_CPPFLAGS}\"|" \ + -e "s|%OCTAVE_CONF_HDF5_LDFLAGS%|\"${HDF5_LDFLAGS}\"|" \ -e "s|%OCTAVE_CONF_HDF5_LIBS%|\"${HDF5_LIBS}\"|" \ -e "s|%OCTAVE_CONF_INCFLAGS%|\"${INCFLAGS}\"|" \ -e "s|%OCTAVE_CONF_INCLUDEDIR%|\"${includedir}\"|" \
--- a/aclocal.m4 +++ b/aclocal.m4 @@ -1012,7 +1012,7 @@ octave_cv_hdf5_has_required_api=yes], [ octave_cv_hdf5_has_required_api=no])]) if test "$octave_cv_hdf5_has_required_api" = "no"; then - WITH_HDF5=false + HAVE_HDF5=false warn_hdf5="HDF5 library does not provide the version 1.6 API. Octave will not be able to save or load HDF5 data files." AC_MSG_WARN($warn_hdf5) fi
--- a/configure.in +++ b/configure.in @@ -496,49 +496,30 @@ ### Check for HDF5 library. -if $WITH_Z; then - - WITH_HDF5=true - AC_ARG_WITH(hdf5, - [AS_HELP_STRING([--without-hdf5], [don't use HDF5])], - with_hdf5=$withval, with_hdf5=yes) - - hdf5_lib= - if test "$with_hdf5" = yes; then - hdf5_lib="hdf5" - elif test "$with_hdf5" != no; then - hdf5_lib="$with_hdf5" - fi +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 $HAVE_HDF5; then + 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" - HDF5_LIBS= - WITH_HDF5=false - if test -n "$hdf5_lib"; then - AC_CHECK_LIB($hdf5_lib, H5Pcreate, [ - AC_CHECK_HEADERS(hdf5.h, [ - WITH_HDF5=true - HDF5_LIBS="-l$hdf5_lib" - save_LIBS="$LIBS" - LIBS="$HDF5_LIBS $Z_LIBS $LIBS" - AC_CHECK_LIB($hdf5_lib, H5Gget_num_objs, [ - OCTAVE_HDF5_HAS_REQUIRED_API - if test $WITH_HDF5; then - AC_DEFINE(HAVE_HDF5, 1, [Define if HDF5 is available.]) - AC_DEFINE(HAVE_H5GGET_NUM_OBJS, 1, [Define if HDF5 has H5Gget_num_objs.]) - fi]) - LIBS="$save_LIBS"])]) - fi - if $WITH_HDF5; then - case "$canonical_host_type" in - *-*-msdosmsvc) - OCTAVE_HDF5_DLL - ;; - esac - fi -fi -AC_SUBST(HDF5_LIBS) +# Subdirectory of libcruft to build if fftw is not found: -# Subdirectories of libcruft to build if they aren't found on the system: FFT_DIR="fftpack" AC_SUBST(FFT_DIR) @@ -2080,6 +2061,8 @@ GLPK CPPFLAGS: $GLPK_CPPFLAGS GLPK LDFLAGS: $GLPK_LDFLAGS GLPK libraries: $GLPK_LIBS + HDF5 CPPFLAGS: $HDF5_CPPFLAGS + HDF5 LDFLAGS: $HDF5_LDFLAGS HDF5 libraries: $HDF5_LIBS OPENGL libraries: $OPENGL_LIBS PTHREAD flags: $PTHREAD_CFLAGS
--- a/octave-bug.cc.in +++ b/octave-bug.cc.in @@ -136,6 +136,8 @@ vars["GLPK_CPPFLAGS"] = %GLPK_CPPFLAGS%; vars["GLPK_LDFLAGS"] = %GLPK_LDFLAGS%; vars["GLPK_LIBS"] = %GLPK_LIBS%; + vars["HDF5_CPPFLAGS"] = %HDF5_CPPFLAGS%; + vars["HDF5_LDFLAGS"] = %HDF5_LDFLAGS%; vars["HDF5_LIBS"] = %HDF5_LIBS%; vars["OPENGL_LIBS"] = %OPENGL_LIBS%; vars["PTHREAD_CFLAGS"] = %PTHREAD_CFLAGS%; @@ -272,6 +274,8 @@ os << "GLPK_CPPFLAGS: " << vars["GLPK_CPPFLAGS"] << endl; os << "GLPK_LDFLAGS: " << vars["GLPK_LDFLAGS"] << endl; os << "GLPK_LIBS: " << vars["GLPK_LIBS"] << endl; + os << "HDF5_CPPFLAGS: " << vars["HDF5_CPPFLAGS"] << endl; + os << "HDF5_LDFLAGS: " << vars["HDF5_LDFLAGS"] << endl; os << "HDF5_LIBS: " << vars["HDF5_LIBS"] << endl; os << "OPENGL_LIBS: " << vars["OPENGL_LIBS"] << endl; os << "PTHREAD_CFLAGS: " << vars["PTHREAD_CFLAGS"] << endl;
--- a/octave-bug.in +++ b/octave-bug.in @@ -88,6 +88,8 @@ GLPK_CPPFLAGS=%GLPK_CPPFLAGS% GLPK_LDFLAGS=%GLPK_LDFLAGS% GLPK_LIBS=%GLPK_LIBS% +HDF5_CPPFLAGS=%HDF5_CPPFLAGS% +HDF5_LDFLAGS=%HDF5_LDFLAGS% HDF5_LIBS=%HDF5_LIBS% OPENGL_LIBS=%OPENGL_LIBS% PTHREAD_CFLAGS=%PTHREAD_CFLAGS% @@ -333,6 +335,8 @@ GLPK_CPPFLAGS: $GLPK_CPPFLAGS GLPK_LDFLAGS: $GLPK_LDFLAGS GLPK_LIBS: $GLPK_LIBS +HDF5_CPPFLAGS: $HDF5_CPPFLAGS +HDF5_LDFLAGS: $HDF5_LDFLAGS HDF5_LIBS: $HDF5_LIBS OPENGL_LIBS: $OPENGL_LIBS PTHREAD_CFLAGS: $PTHREAD_CFLAGS
--- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,10 @@ +2009-08-18 John W. Eaton <jwe@octave.org> + + * oct-conf.h.in: New #defines for HDF5_LDFLAGS and HDF5LDFLAGS. + * Makefile.in (OCTAVE_LIBS, OCTINTERP_LINK_DEPS): + Include them in the lists. + * toplev.cc (octave_config_info): Include them in the list. + 2009-08-17 John W. Eaton <jwe@octave.org> * oct-conf.h.in: New #defines for ZLIB_CPPFLAGS and ZLIB_LDFLAGS.
--- a/src/Makefile.in +++ b/src/Makefile.in @@ -292,7 +292,7 @@ $(FFTW_LDFLAGS) $(FFTW_LIBS) \ $(GRAPHICS_LDFLAGS) $(GRAPHICS_LIBS) \ $(FT2_LDFLAGS) $(FT2_LIBS) \ - $(HDF5_LIBS) $(Z_LDFLAGS) $(Z_LIBS) \ + $(HDF5_LDFLAGS) $(HDF5_LIBS) $(Z_LDFLAGS) $(Z_LIBS) \ $(OPENGL_LIBS) $(X11_LIBS) $(CARBON_LIBS) \ $(READLINE_LIBS) $(TERM_LIBS) \ $(LIBGLOB) \ @@ -316,7 +316,7 @@ $(MAGICK_LIBS) \ $(GRAPHICS_LDFLAGS) $(GRAPHICS_LIBS) \ $(FT2_LDFLAGS) $(FT2_LIBS) \ - $(HDF5_LIBS) $(Z_LDFLAGS) $(Z_LIBS) \ + $(HDF5_LDFLAGS) $(HDF5_LIBS) $(Z_LDFLAGS) $(Z_LIBS) \ $(OPENGL_LIBS) $(X11_LIBS) $(CARBON_LIBS) \ $(READLINE_LIBS) $(TERM_LIBS) \ $(LIBPLPLOT) $(LIBGLOB) \ @@ -326,7 +326,7 @@ OCTINTERP_LINK_DEPS = $(RLD_FLAG) -L../liboctave $(LIBOCTAVE) \ -L../libcruft $(LIBCRUFT) \ $(FFTW_LDFLAGS) $(FFTW_LIBS) \ - $(HDF5_LIBS) $(Z_LDFLAGS) $(Z_LIBS) \ + $(HDF5_LDFLAGS) $(HDF5_LIBS) $(Z_LDFLAGS) $(Z_LIBS) \ $(OPENGL_LIBS) $(X11_LIBS) $(CARBON_LIBS) \ $(READLINE_LIBS) \ $(LIBS)
--- a/src/oct-conf.h.in +++ b/src/oct-conf.h.in @@ -281,6 +281,14 @@ #define OCTAVE_CONF_GRAPHICS_LIBS %OCTAVE_CONF_GRAPHICS_LIBS% #endif +#ifndef OCTAVE_CONF_HDF5_CPPFLAGS +#define OCTAVE_CONF_HDF5_CPPFLAGS %OCTAVE_CONF_HDF5_CPPFLAGS% +#endif + +#ifndef OCTAVE_CONF_HDF5_LDFLAGS +#define OCTAVE_CONF_HDF5_LDFLAGS %OCTAVE_CONF_HDF5_LDFLAGS% +#endif + #ifndef OCTAVE_CONF_HDF5_LIBS #define OCTAVE_CONF_HDF5_LIBS %OCTAVE_CONF_HDF5_LIBS% #endif
--- a/src/toplev.cc +++ b/src/toplev.cc @@ -1256,6 +1256,8 @@ { false, "GLPK_LIBS", OCTAVE_CONF_GLPK_LIBS }, { false, "GNUPLOT", OCTAVE_CONF_GNUPLOT }, { false, "GRAPHICS_LIBS", OCTAVE_CONF_GRAPHICS_LIBS }, + { false, "HDF5_CPPFLAGS", OCTAVE_CONF_HDF5_CPPFLAGS }, + { false, "HDF5_LDFLAGS", OCTAVE_CONF_HDF5_LDFLAGS }, { false, "HDF5_LIBS", OCTAVE_CONF_HDF5_LIBS }, { false, "INCFLAGS", OCTAVE_CONF_INCFLAGS }, { false, "LDFLAGS", OCTAVE_CONF_LDFLAGS },