Commit bea0ab45 authored by Ralf Müller's avatar Ralf Müller
Browse files

clean up CDI/CDO autoconf macros

parent 4bea3372
......@@ -188,7 +188,8 @@ CFLAGS="$CFLAGS ${OPENMP_CFLAGS}"
CXXFLAGS="$CXXFLAGS ${OPENMP_CFLAGS}"
# ----------------------------------------------------------------------
# Add configure options
ACX_OPTIONS
ACX_CDO_OPTIONS
ACX_CDI_OPTIONS
# configure code from valgrind
......
AC_DEFUN([ACX_OPTIONS],
AC_DEFUN([ACX_CDO_OPTIONS],
[
# ----------------------------------------------------------------------
# Checks for multithreaded compiling + linking
......@@ -32,37 +32,6 @@ AC_SUBST([ENABLE_THREADS])
AC_SUBST([THREADS_INCLUDE])
AC_SUBST([THREADS_LIBS])
# ----------------------------------------------------------------------
# Compile application with SZLIB library, needed for GRIB1 linking
SZLIB_INCLUDE=''
SZLIB_LIBS=''
AC_ARG_WITH([szlib],
[AS_HELP_STRING([--with-szlib=<yes|no|directory> (default=no)],[location of szlib library, optional for GRIB1 compression])],
[AS_CASE(["$with_szlib"],
[no],[AC_MSG_CHECKING([for szlib library])
AC_MSG_RESULT([suppressed])],
[yes],[AC_CHECK_HEADERS(szlib.h)
AC_SEARCH_LIBS([SZ_BufftoBuffCompress],
[sz],
[AC_DEFINE([HAVE_LIBSZ],[1],[Define to 1 for SZIP support])],
[AC_MSG_ERROR([Could not link to szlib])])
SZLIB_LIBS=" -lsz"],
[*],[SZLIB_ROOT=$with_szlib
AS_IF([test -d "$SZLIB_ROOT"],
[LDFLAGS="-L$SZLIB_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$SZLIB_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS(szlib.h)
AC_SEARCH_LIBS([SZ_BufftoBuffCompress],
[sz],
[AC_DEFINE([HAVE_LIBSZ],[1],[Define to 1 for SZIP support])],
[AC_MSG_ERROR([Could not link to szlib])])
SZLIB_LIBS=" -L$SZLIB_ROOT/lib -lsz"
SZLIB_INCLUDE=" -I$SZLIB_ROOT/include"],
[AC_MSG_NOTICE([$SZLIB_ROOT is not a directory! SZLIB suppressed])])])],
[AC_MSG_CHECKING([for szlib library])
AC_MSG_RESULT([suppressed])])
AC_SUBST([SZLIB_INCLUDE])
AC_SUBST([SZLIB_LIBS])
# ----------------------------------------------------------------------
# Link application with HDF5 library, required for netcdf4
HDF5_ROOT=''
HDF5_INCLUDE=''
......@@ -110,99 +79,7 @@ AC_ARG_WITH([hdf5],
AC_SUBST([HDF5_ROOT])
AC_SUBST([HDF5_INCLUDE])
AC_SUBST([HDF5_LIBS])
# ----------------------------------------------------------------------
# Compile application with netcdf
NETCDF_ROOT=''
NETCDF_INCLUDE=''
NETCDF_LIBS=''
ENABLE_NETCDF=no
ENABLE_NC2=no
ENABLE_NC4=no
ENABLE_NC4HDF5=no
AC_ARG_WITH([netcdf],
[AS_HELP_STRING([--with-netcdf=<yes|no|directory> (default=no)],[location of NetCDF library (lib and include subdirs)])],
[AS_CASE(["$with_netcdf"],
[no],[AC_MSG_CHECKING([for NetCDF library])
AC_MSG_RESULT([suppressed])],
[yes],[AC_CHECK_HEADERS([netcdf.h])
AC_SEARCH_LIBS([nc_open],
[netcdf],
[AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NetCDF support])
ENABLE_NETCDF=yes],
[AC_MSG_ERROR([Could not link to NetCDF library])])
NETCDF_LIBS=" -lnetcdf"
AC_CHECK_PROG(NC_CONFIG,nc-config,nc-config)
AS_IF([test "x$NC_CONFIG" != "x"],
[AC_MSG_CHECKING([netcdf's OpenDAP support])
AS_IF([test "x$($NC_CONFIG --has-dap)" = "xyes"],
[AC_DEFINE([HAVE_LIBNC_DAP],[1],[Define to 1 for NetCDF OpenDAP])
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])]
[AC_MSG_CHECKING([netcdf's nc2 support])
AS_IF([test "x$($NC_CONFIG --has-nc2)" = "xyes"],
[AC_DEFINE([HAVE_NETCDF2],[1],[Define to 1 for NetCDF2 support])
ENABLE_NC2=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])
AC_MSG_CHECKING([netcdf's nc4 support])
AS_IF([test "x$($NC_CONFIG --has-nc4)" = "xyes"],
[AC_DEFINE([HAVE_NETCDF4],[1],[Define to 1 for NetCDF4 support])
ENABLE_NC4=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])
AC_MSG_CHECKING([netcdf's nc4/hdf5 support])
AS_IF([test "x$($NC_CONFIG --has-hdf5)" = "xyes"],
[AC_DEFINE([HAVE_NC4HDF5],[1],[Define to 1 for NetCDF4/HDF5 support])
ENABLE_NC4HDF5=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])]) ],
[AS_ECHO([Could not find nc-config! go on with default configuration])])],
[*],[AS_IF([test -d "$with_netcdf"],
[NETCDF_ROOT=$with_netcdf
LDFLAGS="-L$NETCDF_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$NETCDF_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS([netcdf.h])
AC_SEARCH_LIBS([nc_open],
[netcdf],
[AC_DEFINE([HAVE_LIBNETCDF],[1],[Define to 1 for NetCDF support])
ENABLE_NETCDF=yes],
[AC_MSG_ERROR([Could not link to NetCDF library])])
NETCDF_LIBS=" -L$NETCDF_ROOT/lib -lnetcdf"
NETCDF_INCLUDE=" -I$NETCDF_ROOT/include"
AC_MSG_CHECKING([nc-config script])
AC_CHECK_PROG(NC_CONFIG,nc-config,[$NETCDF_ROOT/bin/nc-config],,["$NETCDF_ROOT/bin"])
AS_IF([test "x$NC_CONFIG" != "x"],
[AC_MSG_CHECKING([netcdf's OpenDAP support])
AS_IF([test "x$($NC_CONFIG --has-dap)" = "xyes"],
[AC_DEFINE([HAVE_LIBNC_DAP],[1],[Define to 1 for NetCDF OpenDAP])
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])]
[AC_MSG_CHECKING([netcdf's nc2 support])
AS_IF([test "x$($NC_CONFIG --has-nc2)" = "xyes"],
[AC_DEFINE([HAVE_NETCDF2],[1],[Define to 1 for NetCDF2 support])
ENABLE_NC2=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])
AC_MSG_CHECKING([netcdf's nc4 support])
AS_IF([test "x$($NC_CONFIG --has-nc4)" = "xyes"],
[AC_DEFINE([HAVE_NETCDF4],[1],[Define to 1 for NetCDF4 support])
ENABLE_NC4=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])])
AC_MSG_CHECKING([netcdf's nc4/hdf5 support])
AS_IF([test "x$($NC_CONFIG --has-hdf5)" = "xyes"],
[AC_DEFINE([HAVE_NC4HDF5],[1],[Define to 1 for NetCDF4/HDF5 support])
ENABLE_NC4HDF5=yes
AC_MSG_RESULT([yes])],[AC_MSG_RESULT([no])]) ],
[AC_MSG_RESULT([Could not find nc-config! go on with default configuration])])],
[AC_MSG_NOTICE([$with_netcdf is not a directory! NetCDF suppressed])])])],
[AC_MSG_CHECKING([for NetCDF library])
AC_MSG_RESULT([suppressed])])
AS_IF([test "x$ENABLE_NC4HDF5" = "xyes"],
[AC_SEARCH_LIBS([H5TS_mutex_lock], [netcdf],
[AC_DEFINE([HAVE_NC4HDF5_THREADSAFE],[1],[Define to 1 for NetCDF4/HDF5 threadsafe support])],,[-lhdf5])])
AC_SUBST([ENABLE_NETCDF])
AC_SUBST([ENABLE_NC2])
AC_SUBST([ENABLE_NC4])
AC_SUBST([ENABLE_NC4HDF5])
AC_SUBST([NETCDF_ROOT])
AC_SUBST([NETCDF_INCLUDE])
AC_SUBST([NETCDF_LIBS])
# ----------------------------------------------------------------------
# Link application with UDUNITS2 library
AC_ARG_WITH([udunits2],
......@@ -266,134 +143,6 @@ AC_ARG_WITH([cmor],
AC_MSG_RESULT([suppressed])])
AC_SUBST([CMOR_LIBS])
# ----------------------------------------------------------------------
# Compile application with ECCODES library (for GRIB2 support)
ECCODES_INCLUDE=''
ECCODES_LIBS=''
ENABLE_GRIBAPI=no
AC_ARG_WITH([eccodes],
[AS_HELP_STRING([--with-eccodes=<yes|no|directory> (default=no)],[location of ECCODES library (lib and include subdirs)])],
[AS_CASE(["$with_eccodes"],
[no],[AC_MSG_CHECKING([for ECCODES library])
AC_MSG_RESULT([suppressed])],
[yes],[AC_CHECK_HEADERS([grib_api.h])
AC_SEARCH_LIBS([grib_get_message],
[eccodes],
[AC_DEFINE([HAVE_LIBGRIB_API],[1],[ECCODES library is present if defined to 1])
ENABLE_GRIBAPI=yes],
[AC_MSG_ERROR([Could not link to eccodes library])])],
[*],[ECCODES_ROOT=$with_eccodes
AS_IF([test -d "$ECCODES_ROOT"],
[LDFLAGS="-L$ECCODES_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$ECCODES_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS([grib_api.h])
AC_SEARCH_LIBS([grib_get_message],
[eccodes],
[AC_DEFINE([HAVE_LIBGRIB_API],[1],[ECCODES library is present if defined to 1])
ENABLE_GRIBAPI=yes],
[AC_MSG_ERROR([Could not link to eccodes library])])
ECCODES_LIBS=" -L$ECCODES_ROOT/lib -leccodes"
ECCODES_INCLUDE=" -I$ECCODES_ROOT/include"],
[AC_MSG_ERROR([$ECCODES_ROOT is not a directory! ECCODES suppressed])])])],
[AC_MSG_CHECKING([for the ECCODES library])
AC_MSG_RESULT([suppressed])])
AC_SUBST([ECCODES_INCLUDE])
AC_SUBST([ECCODES_LIBS])
#AC_SUBST([ENABLE_GRIBAPI])
# ----------------------------------------------------------------------
# Compile application with GRIB_API library (for GRIB2 support)
GRIB_API_INCLUDE=''
GRIB_API_LIBS=''
#ENABLE_GRIBAPI=no
AC_ARG_WITH([grib_api],
[AS_HELP_STRING([--with-grib_api=<yes|no|directory> (default=no)],[location of GRIB_API library (lib and include subdirs)])],
[AS_CASE(["$with_grib_api"],
[no],[AC_MSG_CHECKING([for GRIB_API library])
AC_MSG_RESULT([suppressed])],
[yes],[AC_CHECK_HEADERS([grib_api.h])
AC_SEARCH_LIBS([grib_get_message],
[grib_api],
[AC_DEFINE([HAVE_LIBGRIB_API],[1],[GRIB_API library is present if defined to 1])
ENABLE_GRIBAPI=yes],
[AC_MSG_ERROR([Could not link to grib_api library])])],
[*],[GRIB_API_ROOT=$with_grib_api
AS_IF([test -d "$GRIB_API_ROOT"],
[LDFLAGS="-L$GRIB_API_ROOT/lib $LDFLAGS"
CPPFLAGS="-I$GRIB_API_ROOT/include $CPPFLAGS"
AC_CHECK_HEADERS([grib_api.h])
AC_SEARCH_LIBS([grib_get_message],
[grib_api],
[AC_DEFINE([HAVE_LIBGRIB_API],[1],[GRIB_API library is present if defined to 1])
ENABLE_GRIBAPI=yes],
[AC_MSG_ERROR([Could not link to grib_api library])])
GRIB_API_LIBS=" -L$GRIB_API_ROOT/lib -lgrib_api"
GRIB_API_INCLUDE=" -I$GRIB_API_ROOT/include"],
[AC_MSG_ERROR([$GRIB_API_ROOT is not a directory! GRIB_API suppressed])])])],
[AC_MSG_CHECKING([for the GRIB_API library])
AC_MSG_RESULT([suppressed])])
AC_SUBST([GRIB_API_INCLUDE])
AC_SUBST([GRIB_API_LIBS])
AC_SUBST([ENABLE_GRIBAPI])
# ----------------------------------------------------------------------
# Enable GRIB support
AC_MSG_CHECKING([for GRIB support])
AC_ARG_ENABLE([grib],
[AS_HELP_STRING([--enable-grib],[GRIB support [default=yes]])],
[AS_IF([test "x$enable_grib" != 'xno'],
[AC_DEFINE(HAVE_LIBGRIB, [1], [Define to 1 for GRIB support])
enable_grib=yes])],
[AC_DEFINE(HAVE_LIBGRIB, [1], [Define to 1 for GRIB support])
enable_grib=yes])
AC_MSG_RESULT([$enable_grib])
AC_SUBST([ENABLE_GRIB],[$enable_grib])
# ----------------------------------------------------------------------
# Compile interface with internal CGRIBEX library
AC_MSG_CHECKING([for CGRIBEX support])
AC_ARG_ENABLE([cgribex],
[AC_HELP_STRING([--enable-cgribex],[Use the CGRIBEX library [default=yes]])],
[AS_IF([test "x$enable_cgribex" != 'xno'],
[AC_DEFINE(HAVE_LIBCGRIBEX,[1],[Define to 1 for GRIB1 decoding/encoding with cgribex])
enable_cgribex=yes])],
[AC_DEFINE(HAVE_LIBCGRIBEX,[1],[Define to 1 for GRIB1 decoding/encoding with cgribex])
enable_cgribex=yes])
AC_MSG_RESULT([$enable_cgribex])
AC_SUBST([ENABLE_CGRIBEX],[$enable_cgribex])
# ----------------------------------------------------------------------
# Compile interface with internal SERVICE library
AC_MSG_CHECKING([for SERVICE support])
AC_ARG_ENABLE([service],
[AC_HELP_STRING([--enable-service],[Use the service library [default=yes]])],
[AS_IF([test "x$enable_service" != 'xno'],
[AC_DEFINE(HAVE_LIBSERVICE,[1],[Define to 1 for SERVICE interface])
enable_service=yes])],
[AC_DEFINE(HAVE_LIBSERVICE,[1],[Define to 1 for SERVICE interface])
enable_service=yes])
AC_MSG_RESULT([$enable_service])
AC_SUBST([ENABLE_SERVICE],[$enable_service])
# ----------------------------------------------------------------------
# Compile interface with internal EXTRA library
AC_MSG_CHECKING([for EXTRA support])
AC_ARG_ENABLE([extra],
[AC_HELP_STRING([--enable-extra],[Use the extra library [default=yes]])],
[AS_IF([test "x$enable_extra" != 'xno'],
[AC_DEFINE(HAVE_LIBEXTRA,[1],[Define to 1 for EXTRA interface])
enable_extra=yes])],
[AC_DEFINE(HAVE_LIBEXTRA,[1],[Define to 1 for EXTRA interface])
enable_extra=yes])
AC_MSG_RESULT([$enable_extra])
AC_SUBST([ENABLE_EXTRA],[$enable_extra])
# ----------------------------------------------------------------------
# Compile interface with internal IEG library
AC_MSG_CHECKING([for IEG support])
AC_ARG_ENABLE([ieg],
[AC_HELP_STRING([--enable-ieg],[Use the ieg library [default=yes]])],
[AS_IF([test "x$enable_ieg" != 'xno'],
[AC_DEFINE(HAVE_LIBIEG,[1],[Define to 1 for IEG interface])
enable_ieg=yes])],
[AC_DEFINE(HAVE_LIBIEG,[1],[Define to 1 for IEG interface])
enable_ieg=yes])
AC_MSG_RESULT([$enable_ieg])
AC_SUBST([ENABLE_IEG],[$enable_ieg])
# ----------------------------------------------------------------------
# Compile with fftw support
AC_MSG_CHECKING([for FFTW3 support])
AC_ARG_WITH([fftw3],
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment