2016-09-01 05:38:59 +08:00
# -*- Autoconf -*-
2010-06-03 21:25:25 +08:00
## Process this file with autoconf to produce a configure script.
2012-03-17 04:20:15 +08:00
# This is part of Unidata's netCDF package. Copyright 2005-2012, see
2010-06-03 21:25:25 +08:00
# the COPYRIGHT file for more information.
2017-11-18 06:35:14 +08:00
# Ed Hartnett, Ward Fisher, Dennis Heimbigner
2010-06-03 21:25:25 +08:00
# Recall that ${VAR-exp} expands to $VAR if var is set (even to null),
2014-09-05 05:42:11 +08:00
# and to exp otherwise.
2010-06-03 21:25:25 +08:00
## This puts the cvs ID tag in the output configure script.
AC_REVISION([$Id: configure.ac,v 1.450 2010/05/28 19:42:47 dmh Exp $])
2014-09-05 05:42:11 +08:00
# Running autoconf on this file will trigger a warning if
2010-06-03 21:25:25 +08:00
# autoconf is not at least the specified version.
AC_PREREQ([2.59])
2014-09-05 05:42:11 +08:00
# Initialize with name, version, and support email address.
2018-03-16 01:29:32 +08:00
AC_INIT([netCDF], [4.6.2-development], [support-netcdf@unidata.ucar.edu])
2010-06-03 21:25:25 +08:00
2016-05-03 06:07:14 +08:00
##
# Prefer an empty CFLAGS variable instead of the default -g -O2.
# See:
# * http://www.gnu.org/savannah-checkouts/gnu/autoconf/manual/autoconf-2.69/html_node/C-Compiler.html#C-Compiler
##
: ${CFLAGS=""}
2014-09-11 06:50:45 +08:00
AC_SUBST([NC_VERSION_MAJOR]) NC_VERSION_MAJOR=4
2018-01-25 06:46:38 +08:00
AC_SUBST([NC_VERSION_MINOR]) NC_VERSION_MINOR=6
2018-03-16 01:29:32 +08:00
AC_SUBST([NC_VERSION_PATCH]) NC_VERSION_PATCH=2
2015-06-20 02:29:15 +08:00
AC_SUBST([NC_VERSION_NOTE]) NC_VERSION_NOTE="-development"
2014-05-31 03:36:35 +08:00
#####
# Set some variables used to generate a libnetcdf.settings file,
# pattered after the files generated by libhdf4, libhdf5.
#####
2010-06-03 21:25:25 +08:00
# Create the VERSION file, which contains the package version from
# AC_INIT.
2014-05-31 03:36:35 +08:00
echo AC_PACKAGE_VERSION>VERSION
2010-06-03 21:25:25 +08:00
AC_SUBST(PACKAGE_VERSION)
AC_MSG_NOTICE([netCDF AC_PACKAGE_VERSION])
# Keep libtool macros in an m4 directory.
AC_CONFIG_MACRO_DIR([m4])
2014-05-31 03:36:35 +08:00
# Configuration Date
2016-05-24 05:31:40 +08:00
if test "x$SOURCE_DATE_EPOCH" != "x" ; then
2016-05-24 05:24:32 +08:00
AC_SUBST([CONFIG_DATE]) CONFIG_DATE="`date -u -d "${SOURCE_DATE_EPOCH}"`"
2016-05-15 23:20:18 +08:00
else
AC_SUBST([CONFIG_DATE]) CONFIG_DATE="`date`"
fi
2014-05-31 03:36:35 +08:00
2010-06-03 21:25:25 +08:00
# Find out about the host we're building on.
AC_CANONICAL_HOST
# Find out about the target we're building for.
AC_CANONICAL_TARGET
AC_CONFIG_HEADERS([config.h])
2016-04-12 03:42:14 +08:00
##
# Some files need to exist in build directories
# that do not correspond to their source directory, or
# the test program makes an assumption about where files
# live. AC_CONFIG_LINKS provides a mechanism to link/copy files
# if an out-of-source build is happening.
##
AC_CONFIG_LINKS([nc_test4/ref_hdf5_compat1.nc:nc_test4/ref_hdf5_compat1.nc])
AC_CONFIG_LINKS([nc_test4/ref_hdf5_compat2.nc:nc_test4/ref_hdf5_compat2.nc])
AC_CONFIG_LINKS([nc_test4/ref_hdf5_compat3.nc:nc_test4/ref_hdf5_compat3.nc])
2018-03-05 18:45:18 +08:00
AC_CONFIG_LINKS([hdf4_test/ref_chunked.hdf4:hdf4_test/ref_chunked.hdf4])
AC_CONFIG_LINKS([hdf4_test/ref_contiguous.hdf4:hdf4_test/ref_contiguous.hdf4])
2017-06-01 23:02:31 +08:00
2016-06-02 05:20:36 +08:00
AM_INIT_AUTOMAKE([foreign dist-zip subdir-objects])
2013-09-25 05:23:27 +08:00
2012-03-17 04:20:15 +08:00
# Check for the existence of this file before proceeding.
2012-09-07 03:44:03 +08:00
AC_CONFIG_SRCDIR([include/netcdf.h])
2010-06-03 21:25:25 +08:00
AC_MSG_NOTICE([checking user options])
# Did the user specify a default minimum blocksize (NCIO_MINBLOCKSIZE) for posixio?
AC_MSG_CHECKING([whether a NCIO_MINBLOCKSIZE was specified])
AC_ARG_WITH([minblocksize],
[AS_HELP_STRING([--with-minblocksize=<integer>],
[Specify minimum I/O blocksize for netCDF classic and 64-bit offset format files.])],
[NCIO_MINBLOCKSIZE=$with_minblocksize], [NCIO_MINBLOCKSIZE=256])
AC_MSG_RESULT([$NCIO_MINBLOCKSIZE])
AC_DEFINE_UNQUOTED([NCIO_MINBLOCKSIZE], [$NCIO_MINBLOCKSIZE], [min blocksize for posixio.])
2018-03-29 03:54:05 +08:00
# Find valgrind, if available, and add targets for it.
AX_VALGRIND_DFLT([sgcheck], [off])
AX_VALGRIND_CHECK
2015-05-27 04:29:28 +08:00
###
# Doxygen and doxygen-related options.
###
2011-08-22 21:53:37 +08:00
AC_ARG_ENABLE([doxygen],
2012-05-19 04:31:50 +08:00
[AS_HELP_STRING([--enable-doxygen],
[Enable generation of documentation.])])
test "x$enable_doxygen" = xyes || enable_doxygen=no
2014-09-05 05:42:11 +08:00
AM_CONDITIONAL([BUILD_DOCS], [test "x$enable_doxygen" = xyes])
2011-08-22 21:53:37 +08:00
2015-05-27 04:29:28 +08:00
AC_ARG_ENABLE([doxygen-tasks],
[AS_HELP_STRING([--enable-doxygen-tasks],
[Enable Doxygen-generated test, todo and bug list documentation. Developers only.])])
test "x$enable_doxygen_tasks" = xyes || enable_doxygen_tasks=no
AM_CONDITIONAL([SHOW_DOXYGEN_TAG_LIST], [test "x$enable_doxygen_tasks" = xyes])
AC_SUBST([SHOW_DOXYGEN_TAG_LIST], [$enable_doxygen_tasks])
2015-08-18 02:19:51 +08:00
###
# Determine if we should build documentation
# configured for releases on the Unidata web server.
###
AC_ARG_ENABLE([doxygen-build-release-docs],
[AS_HELP_STRING([--enable-doxygen-build-release-docs],
[Build release documentation. This is of interest only to developers.])])
test "x$enable_doxygen_build_release_docs" = xyes || enable_doxygen_build_release_docs=no
AM_CONDITIONAL([DOXYGEN_BUILD_RELEASE_DOCS], [test "x$enable_doxygen_build_release_docs" = xyes])
if test $enable_doxygen_build_release_docs = yes; then
AC_SUBST([DOXYGEN_CSS_FILE], ["release.css"])
AC_SUBST([DOXYGEN_HEADER_FILE], ["release_header.html"])
AC_SUBST([DOXYGEN_SEARCHENGINE], ["NO"])
else
AC_SUBST([DOXYGEN_CSS_FILE], [])
AC_SUBST([DOXYGEN_HEADER_FILE], [])
AC_SUBST([DOXYGEN_SEARCHENGINE], ["YES"])
fi
2017-11-13 21:37:07 +08:00
AC_SUBST([DOXYGEN_SERVER_BASED_SEARCH], ["NO"])
2015-05-27 04:29:28 +08:00
AC_ARG_ENABLE([doxygen-pdf-output],
[AS_HELP_STRING([--enable-doxygen-pdf-output],
[Build netCDF library documentation in PDF format. Experimental.])])
AM_CONDITIONAL([NC_ENABLE_DOXYGEN_PDF_OUTPUT], [test "x$enable_doxygen_pdf_output" = xyes])
AC_SUBST([NC_ENABLE_DOXYGEN_PDF_OUTPUT], [$enable_doxygen_pdf_output])
2014-02-05 07:13:18 +08:00
AC_ARG_ENABLE([dot],
[AS_HELP_STRING([--enable-dot],
[Use dot (provided by graphviz) to generate charts and graphs in the doxygen-based documentation.])])
test "x$enable_dot" = xyes || enable_dot=no
2011-08-22 21:53:37 +08:00
AC_ARG_ENABLE([internal-docs],
[AS_HELP_STRING([--enable-internal-docs],
[Include documentation of library internals. This is of interest only to those developing the netCDF library.])])
2011-09-16 00:57:16 +08:00
test "x$enable_internal_docs" = xyes || enable_internal_docs=no
2014-09-05 05:42:11 +08:00
AC_SUBST([BUILD_INTERNAL_DOCS], [$enable_internal_docs])
2011-08-22 21:53:37 +08:00
2010-06-03 21:25:25 +08:00
AC_MSG_CHECKING([if fsync support is enabled])
AC_ARG_ENABLE([fsync],
2013-03-06 04:29:49 +08:00
[AS_HELP_STRING([--enable-fsync],
[enable fsync support])],
[],
[enable_fsync=no])
2010-06-03 21:25:25 +08:00
test "x$enable_fsync" = xno || enable_fsync=yes
AC_MSG_RESULT($enable_fsync)
if test "x$enable_fsync" = xyes ; then
AC_DEFINE([USE_FSYNC], [1], [if true, include experimental fsync code])
fi
2014-04-16 11:25:44 +08:00
# Temporary until JNA bug is fixed (which is probably never).
# See Jira NCF-298
2014-04-10 09:55:20 +08:00
AC_MSG_CHECKING([if jna bug workaround is enabledd])
AC_ARG_ENABLE([jna],
[AS_HELP_STRING([--enable-jna],
[enable jna bug workaround])],
[],
[enable_jna=no])
test "x$enable_jna" = xno || enable_jna=yes
AC_MSG_RESULT($enable_jna)
if test "x$enable_jna" = xyes ; then
AC_DEFINE([JNA], [1], [if true, include jna bug workaround code])
fi
2010-06-03 21:25:25 +08:00
# Does the user want to build netcdf-4?
2015-11-07 08:03:28 +08:00
AC_MSG_CHECKING([whether we should build netCDF-4])
AC_ARG_ENABLE([netcdf-4], [AS_HELP_STRING([--disable-netcdf-4],
[do not build with netcdf-4 (else HDF5 and zlib required)])])
2011-04-27 04:57:24 +08:00
test "x$enable_netcdf_4" = xno || enable_netcdf_4=yes
2010-06-03 21:25:25 +08:00
# Synonym
2015-11-07 08:03:28 +08:00
AC_ARG_ENABLE([netcdf4], [AS_HELP_STRING([--disable-netcdf4],
[(just a synonym for --disable-netcdf-4)])])
test "x$enable_netcdf4" = xno || enable_netcdf4=yesi
if test "x$enable_netcdf4" = xno ; then
enable_netcdf_4=no
2010-06-03 21:25:25 +08:00
fi
2015-11-07 08:03:28 +08:00
AC_MSG_RESULT([$enable_netcdf_4])
2010-06-03 21:25:25 +08:00
2013-06-11 05:48:11 +08:00
# Does the user require dynamic loading?
# This is only for those hdf5 installs that support it.
AC_MSG_CHECKING([do we require hdf5 dynamic-loading support])
AC_ARG_ENABLE([dynamic-loading], [AS_HELP_STRING([--enable-dynamic-loading],
[enable dynamic loading for use with supported hdf5 installs (libdl, HDF5 required)])])
2014-05-06 05:37:47 +08:00
test "x$enable_dynamic_loading" = xno || enable_dynamic_loading=yes
2013-06-11 05:48:11 +08:00
AC_MSG_RESULT([$enable_dynamic_loading])
2010-06-03 21:25:25 +08:00
# Does the user want to turn on HDF4 read ability?
2011-04-27 04:57:24 +08:00
AC_MSG_CHECKING([whether reading of HDF4 SD files is to be enabled])
2010-06-03 21:25:25 +08:00
AC_ARG_ENABLE([hdf4], [AS_HELP_STRING([--enable-hdf4],
[build netcdf-4 with HDF4 read capability (HDF4, HDF5 and zlib required)])])
test "x$enable_hdf4" = xyes || enable_hdf4=no
2018-02-09 02:35:27 +08:00
if test "x$enable_hdf4" = xyes -a "x$enable_netcdf_4" = xno; then
2018-02-27 03:56:10 +08:00
AC_MSG_ERROR([NetCDF-4 is required for HDF4 features])
2018-02-09 02:35:27 +08:00
fi
2010-06-03 21:25:25 +08:00
AC_MSG_RESULT($enable_hdf4)
# Does the user want to turn on extra HDF4 file tests?
AC_MSG_CHECKING([whether to fetch some sample HDF4 files from Unidata ftp site to test HDF4 reading (requires wget)])
AC_ARG_ENABLE([hdf4-file-tests], [AS_HELP_STRING([--enable-hdf4-file-tests],
[get some HDF4 files from Unidata ftp site and test that they can be read])])
test "x$enable_hdf4" = xyes -a "x$enable_hdf4_file_tests" = xyes || enable_hdf4_file_tests=no
if test "x$enable_hdf4_file_tests" = xyes; then
AC_DEFINE([USE_HDF4_FILE_TESTS], 1, [If true, use use wget to fetch some sample HDF4 data, and then test against it.])
fi
AC_MSG_RESULT($enable_hdf4_file_tests)
2014-11-19 06:33:16 +08:00
# Does the user want to try to install netcdf-fortran
# automatically?
AC_MSG_CHECKING([whether we should attempt to install netcdf-fortran (EXPERIMENTAL)])
2014-11-21 06:56:11 +08:00
AC_ARG_ENABLE([fortran], [AS_HELP_STRING([--enable-remote-fortran-bootstrap],
2014-11-19 06:33:16 +08:00
[Download and install netcdf-fortran (EXPERIMENTAL)])])
2014-11-21 06:56:11 +08:00
test "x$enable_remote_fortran_bootstrap" = xyes || enable_remote_fortran_bootstrap=no
AC_MSG_RESULT([$enable_remote_fortran_bootstrap])
2014-11-19 06:33:16 +08:00
2010-06-03 21:25:25 +08:00
# Does the user want to run extra example tests
AC_MSG_CHECKING([whether extra example tests should be run])
AC_ARG_ENABLE([extra-example-tests],
[AS_HELP_STRING([--enable-extra-example-tests],
[Run extra example tests; requires GNU sed. Ignored if \
netCDF-4 is not enabled.])])
test "x$enable_extra_example_tests" = xyes || enable_extra_example_tests=no
AC_MSG_RESULT($enable_extra_example_tests)
# Does the user want to run extra parallel tests when parallel netCDF-4 is built?
AC_MSG_CHECKING([whether parallel IO tests should be run])
AC_ARG_ENABLE([parallel-tests],
[AS_HELP_STRING([--enable-parallel-tests],
2018-02-27 08:08:26 +08:00
[Run extra parallel IO tests. Requires netCDF-4
with parallel I/O support.])])
2010-06-03 21:25:25 +08:00
test "x$enable_parallel_tests" = xyes || enable_parallel_tests=no
AC_MSG_RESULT($enable_parallel_tests)
# Did the user specify a default chunk size?
AC_MSG_CHECKING([whether a default chunk size in bytes was specified])
AC_ARG_WITH([default-chunk-size],
[AS_HELP_STRING([--with-default-chunk-size=<integer>],
[Specify default size of chunks in bytes.])],
2010-06-23 06:41:04 +08:00
[DEFAULT_CHUNK_SIZE=$with_default_chunk_size], [DEFAULT_CHUNK_SIZE=4194304])
2010-06-03 21:25:25 +08:00
AC_MSG_RESULT([$DEFAULT_CHUNK_SIZE])
AC_DEFINE_UNQUOTED([DEFAULT_CHUNK_SIZE], [$DEFAULT_CHUNK_SIZE], [default chunk size in bytes])
# Did the user specify a max per-var cache size?
AC_MSG_CHECKING([whether a maximum per-variable cache size for HDF5 was specified])
AC_ARG_WITH([max-default-cache-size],
[AS_HELP_STRING([--with-max-default-cache-size=<integer>],
[Specify maximum size (in bytes) for the default per-var chunk cache.])],
[MAX_DEFAULT_CACHE_SIZE=$with_max_default_cache_size], [MAX_DEFAULT_CACHE_SIZE=67108864])
AC_MSG_RESULT([$MAX_DEFAULT_CACHE_SIZE])
AC_DEFINE_UNQUOTED([MAX_DEFAULT_CACHE_SIZE], [$MAX_DEFAULT_CACHE_SIZE], [max size of the default per-var chunk cache.])
# Did the user specify a number of chunks in default per-var cache size?
AC_MSG_CHECKING([whether a number of chunks for the default per-variable cache was specified])
AC_ARG_WITH([default-chunks-in-cache],
[AS_HELP_STRING([--with-default-chunks-in-cache=<integer>],
[Specify the number of chunks to store in default per-variable cache.])],
[DEFAULT_CHUNKS_IN_CACHE=$with_default_chunks_in_cache], [DEFAULT_CHUNKS_IN_CACHE=10])
AC_MSG_RESULT([$DEFAULT_CHUNKS_IN_CACHE])
AC_DEFINE_UNQUOTED([DEFAULT_CHUNKS_IN_CACHE], [$DEFAULT_CHUNKS_IN_CACHE], [num chunks in default per-var chunk cache.])
# Did the user specify a default cache size?
AC_MSG_CHECKING([whether a default file cache size for HDF5 was specified])
AC_ARG_WITH([chunk-cache-size],
[AS_HELP_STRING([--with-chunk-cache-size=<integer>],
[Specify default file cache chunk size for HDF5 files in bytes.])],
[CHUNK_CACHE_SIZE=$with_chunk_cache_size], [CHUNK_CACHE_SIZE=4194304])
AC_MSG_RESULT([$CHUNK_CACHE_SIZE])
AC_DEFINE_UNQUOTED([CHUNK_CACHE_SIZE], [$CHUNK_CACHE_SIZE], [default file chunk cache size in bytes.])
# Did the user specify a default cache nelems?
AC_MSG_CHECKING([whether a default file cache maximum number of elements for HDF5 was specified])
AC_ARG_WITH([chunk-cache-nelems],
[AS_HELP_STRING([--with-chunk-cache-nelems=<integer>],
[Specify default maximum number of elements in the file chunk cache chunk for HDF5 files (should be prime number).])],
[CHUNK_CACHE_NELEMS=$with_chunk_cache_nelems], [CHUNK_CACHE_NELEMS=1009])
AC_MSG_RESULT([$CHUNK_CACHE_NELEMS])
AC_DEFINE_UNQUOTED([CHUNK_CACHE_NELEMS], [$CHUNK_CACHE_NELEMS], [default file chunk cache nelems.])
# Did the user specify a default cache preemption?
AC_MSG_CHECKING([whether a default cache preemption for HDF5 was specified])
AC_ARG_WITH([chunk-cache-preemption],
[AS_HELP_STRING([--with-chunk-cache-preemption=<float between 0 and 1 inclusive>],
[Specify default file chunk cache preemption policy for HDF5 files (a number between 0 and 1, inclusive).])],
[CHUNK_CACHE_PREEMPTION=$with_chunk_cache_preemption], [CHUNK_CACHE_PREEMPTION=0.75])
AC_MSG_RESULT([$CHUNK_CACHE_PREEMPTION])
AC_DEFINE_UNQUOTED([CHUNK_CACHE_PREEMPTION], [$CHUNK_CACHE_PREEMPTION], [default file chunk cache preemption policy.])
# Does the user want to enable netcdf-4 logging?
AC_MSG_CHECKING([whether netCDF-4 logging is enabled])
AC_ARG_ENABLE([logging],
[AS_HELP_STRING([--enable-logging],
[enable logging capability (only applies when netCDF-4 is built). \
This debugging features is only of interest to netCDF developers. \
2014-09-05 05:42:11 +08:00
Ignored if netCDF-4 is not enabled.])])
2010-06-03 21:25:25 +08:00
test "x$enable_logging" = xyes || enable_logging=no
AC_MSG_RESULT([$enable_logging])
2018-05-13 01:27:11 +08:00
# Does the user want to turn off nc_set_log_level() function? (It will
# always be defined if --enable-logging is used.)
AC_MSG_CHECKING([whether nc_set_log_level() function is included (will do nothing unless enable-logging is also used)])
AC_ARG_ENABLE([set_log_level_func], [AS_HELP_STRING([--disable-set-log-level-func],
[disable the nc_set_log_level function])])
test "x$enable_set_log_level_func" = xno -a "x$enable_logging" = xno || enable_set_log_level_func=yes
if test "x$enable_set_log_level_func" = xyes; then
2018-05-13 01:46:04 +08:00
AC_DEFINE([ENABLE_SET_LOG_LEVEL], 1, [If true, define nc_set_log_level.])
2018-05-13 01:27:11 +08:00
fi
AC_MSG_RESULT($enable_set_log_level_func)
2017-03-09 08:01:10 +08:00
## Capture the state of the --enable-dap flag => enable dap2+dap4
AC_MSG_CHECKING([whether DAP client(s) are to be built])
2010-06-03 21:25:25 +08:00
AC_ARG_ENABLE([dap],
[AS_HELP_STRING([--disable-dap],
[build without DAP client support.])])
test "x$enable_dap" = xno || enable_dap=yes
AC_MSG_RESULT($enable_dap)
2017-03-31 05:25:20 +08:00
# --enable-dap => enable-dap4
enable_dap4=$enable_dap
2012-03-20 03:24:46 +08:00
# Curl support is required if and only if any of these flags are set:
2011-05-25 05:48:44 +08:00
# 1. --enable-dap
2015-08-16 06:26:35 +08:00
if test "x$enable_dap" = "xyes" ; then
2011-04-29 01:11:21 +08:00
require_curl=yes
else
require_curl=no
fi
2011-01-16 04:57:00 +08:00
2012-03-20 03:24:46 +08:00
# See if the user provided us with a curl library
2012-03-20 03:47:31 +08:00
# Do an initial lib test for curl, but suppress the default action
AC_CHECK_LIB([curl],[curl_easy_setopt],[found_curl=yes],[found_curl=no])
2011-04-29 01:11:21 +08:00
# If curl is required but there is no curl, then complain
2012-05-16 01:10:41 +08:00
if test $require_curl = yes ; then
2012-06-08 06:35:17 +08:00
if test $found_curl = no ; then
2012-05-16 01:10:41 +08:00
AC_MSG_NOTICE([libcurl not found; disabling remote protocol(s) support])
enable_dap=no
elif test $found_curl = yes ; then
# Redo the check lib to actually add -lcurl
2012-06-08 06:35:17 +08:00
#AC_CHECK_LIB([curl], [curl_easy_setopt])
AC_SEARCH_LIBS([curl_easy_setopt],[curl curl.dll], [], [])
2012-05-16 01:10:41 +08:00
fi
2011-04-29 01:11:21 +08:00
fi
2010-06-03 21:25:25 +08:00
# Default is now to always do the short remote tests
AC_MSG_CHECKING([whether dap remote testing should be enabled (default on)])
AC_ARG_ENABLE([dap-remote-tests],
[AS_HELP_STRING([--disable-dap-remote-tests],
[disable dap remote tests])])
test "x$enable_dap_remote_tests" = xno || enable_dap_remote_tests=yes
if test "x$enable_dap" = "xno" ; then
enable_dap_remote_tests=no
fi
AC_MSG_RESULT($enable_dap_remote_tests)
2014-03-08 03:04:38 +08:00
# Default is now to do the remote authorization tests
AC_MSG_CHECKING([whether dap remote authorization testing should be enabled (default off)])
2014-03-11 06:40:52 +08:00
AC_ARG_ENABLE([dap-auth-tests],
2014-03-08 03:04:38 +08:00
[AS_HELP_STRING([--enable-dap-auth-tests],
[enable dap remote authorization tests])])
test "x$enable_dap_auth_tests" = xyes || enable_dap_auth_tests=no
# dap must be enabled
if test "x$enable_dap" = "xno" ; then
enable_dap_auth_tests=no
fi
# if remote tests are disabled, then so is this
if test "x$enable_dap_remote_tests" = "xno" ; then
enable_dap_remote_tests=no
fi
AC_MSG_RESULT($enable_dap_auth_tests)
2011-12-06 04:53:43 +08:00
# Control if groups are supported in [netcdf4]dap2 code
2018-03-16 22:38:40 +08:00
AC_MSG_CHECKING([whether [netcdf4] group names for DAP2 should be enabled (default on)])
2011-12-06 04:53:43 +08:00
AC_ARG_ENABLE([dap-groups],
[AS_HELP_STRING([--disable-dap-groups],
2017-03-09 08:01:10 +08:00
[disable [netcdf4] DAP2 group names])])
test "x$enable_dap_groups" = xno || enable_dap_groups=yes
AC_MSG_RESULT($enable_dap_groups)
if test "x$enable_dap" = "xno" ; then
AC_MSG_NOTICE([DAP2 groups is being disabled because DAP2 support is disabled or netcdf-4 disabled])
2011-12-06 04:53:43 +08:00
enable_dap_groups=no
fi
if test "x$enable_dap_groups" = xyes; then
AC_DEFINE([ENABLE_DAP_GROUPS], [1], [if true, enable DAP group names])
fi
2017-03-09 08:01:10 +08:00
# Did the user specify a list of test servers to try for remote tests?
AC_MSG_CHECKING([which remote test server(s) to use])
AC_ARG_WITH([testservers],
[AS_HELP_STRING([--with-testservers=<host+port>,<host+port>...],
[Specify the testserver(s) to try for remote tests.])],
[REMOTETESTSERVERS=$with_testservers], [REMOTETESTSERVERS=no])
msg="$REMOTETESTSERVERS"
if test "x$REMOTETESTSERVERS" = xno ; then
msg="remotetest.unidata.ucar.edu,jetstream.unidata.ucar.edu (defaults)"
REMOTETESTSERVERS=remotetest.unidata.ucar.edu,jetstream.unidata.ucar.edu
fi
AC_MSG_RESULT([$msg])
AC_DEFINE_UNQUOTED([REMOTETESTSERVERS], ["$REMOTETESTSERVERS"], [the testservers for remote tests.])
2010-12-16 05:45:05 +08:00
# Set the config.h flags
if test "x$enable_dap" = xyes; then
AC_DEFINE([USE_DAP], [1], [if true, build DAP Client])
AC_DEFINE([ENABLE_DAP], [1], [if true, build DAP Client])
fi
if test "x$enable_dap_remote_tests" = xyes; then
AC_DEFINE([ENABLE_DAP_REMOTE_TESTS], [1], [if true, do remote tests])
fi
2010-06-03 21:25:25 +08:00
AC_MSG_CHECKING([whether the time-consuming dap tests should be enabled (default off)])
AC_ARG_ENABLE([dap-long-tests],
[AS_HELP_STRING([--enable-dap-long-tests],
[enable dap long tests])])
test "x$enable_dap_long_tests" = xyes || enable_dap_long_tests=no
if test "x$enable_dap_remote_tests" = "xno" ; then
enable_dap_long_tests=no
fi
AC_MSG_RESULT([$enable_dap_long_tests])
2010-11-10 06:53:03 +08:00
AM_CONDITIONAL(INTERNAL_OCLIB,[test "x" = "x"])
2010-06-03 21:25:25 +08:00
2017-11-21 06:50:47 +08:00
# Check whether we want to enable strict null byte header padding.
2017-11-22 03:49:14 +08:00
# See https://github.com/Unidata/netcdf-c/issues/657 for more information.
2017-11-21 06:50:47 +08:00
AC_MSG_CHECKING([whether to enable strict null-byte header padding when reading (default off)])
AC_ARG_ENABLE([strict-null-byte-header-padding],
[AS_HELP_STRING([--enable-strict-null-byte-header-padding],
[enable strict null-byte header padding when reading netCDF3 files.])])
test "x$enable_strict_null_byte_header_padding" = xyes || enable_strict_null_byte_header_padding=no
AC_MSG_RESULT($enable_strict_null_byte_header_padding)
if test "x$enable_strict_null_byte_header_padding" = xyes; then
AC_DEFINE([USE_STRICT_NULL_BYTE_HEADER_PADDING], [1], [if true, enable strict null byte header padding])
fi
AM_CONDITIONAL(USE_STRICT_NULL_BYTE_HEADER_PADDING, [test x$enable_strict_null_byte_header_padding = xyes ])
2010-06-03 21:25:25 +08:00
# Does the user want to use the ffio module?
AC_MSG_CHECKING([whether FFIO will be used])
AC_ARG_ENABLE([ffio],
[AS_HELP_STRING([--enable-ffio],
[use ffio instead of posixio (ex. on the Cray)])])
test "x$enable_ffio" = xyes || enable_ffio=no
AC_MSG_RESULT($enable_ffio)
2012-03-26 09:34:32 +08:00
if test "x$enable_ffio" = xyes; then
AC_DEFINE([USE_FFIO], [1], [if true, use ffio instead of posixio])
fi
2010-06-03 21:25:25 +08:00
AM_CONDITIONAL(USE_FFIO, [test x$enable_ffio = xyes])
2015-08-20 07:14:13 +08:00
# Does the user want to use the stdio module?
AC_MSG_CHECKING([whether STDIO will be used])
AC_ARG_ENABLE([stdio],
[AS_HELP_STRING([--enable-stdio],
[use stdio instead of posixio (ex. on the Cray)])])
test "x$enable_stdio" = xyes || enable_stdio=no
AC_MSG_RESULT($enable_stdio)
if test "x$enable_stdio" = xyes; then
AC_DEFINE([USE_STDIO], [1], [if true, use stdio instead of posixio])
fi
AM_CONDITIONAL(USE_STDIO, [test x$enable_stdio = xyes])
2011-04-27 04:57:24 +08:00
nc_build_c=yes
2010-06-03 21:25:25 +08:00
nc_build_v2=yes
nc_build_utilities=yes
2012-04-13 10:41:00 +08:00
nc_build_tests=yes
2010-06-03 21:25:25 +08:00
nc_build_examples=yes
# Does the user want to build examples?
AC_MSG_CHECKING([whether examples should be built])
AC_ARG_ENABLE([examples],
[AS_HELP_STRING([--disable-examples],
[don't build the netCDF examples during make check \
(examples are treated as extra tests by netCDF)])])
test "x$enable_examples" = xno && nc_build_examples=no
AC_MSG_RESULT($nc_build_examples)
AM_CONDITIONAL(BUILD_EXAMPLES, [test x$nc_build_examples = xyes])
# Does the user want to disable the V2 API?
AC_MSG_CHECKING([whether v2 netCDF API should be built])
AC_ARG_ENABLE([v2],
[AS_HELP_STRING([--disable-v2],
[turn off the netCDF version 2 API])])
test "x$enable_v2" = xno && nc_build_v2=no
AC_MSG_RESULT($nc_build_v2)
AM_CONDITIONAL(BUILD_V2, [test x$nc_build_v2 = xyes])
if test "x$nc_build_v2" = xno; then
AC_DEFINE_UNQUOTED(NO_NETCDF_2, 1, [do not build the netCDF version 2 API])
2014-09-05 06:17:13 +08:00
else
AC_DEFINE_UNQUOTED(USE_NETCDF_2, 1, [build the netCDF version 2 API])
2010-06-03 21:25:25 +08:00
fi
2010-09-15 23:25:20 +08:00
# Does the user want to disable ncgen/ncdump/nccopy?
AC_MSG_CHECKING([whether the ncgen/ncdump/nccopy should be built])
2010-06-03 21:25:25 +08:00
AC_ARG_ENABLE([utilities],
[AS_HELP_STRING([--disable-utilities],
2010-09-15 23:25:20 +08:00
[don't build netCDF utilities ncgen, ncdump, and nccopy])])
2010-06-03 21:25:25 +08:00
test "x$nc_build_c" = xno && enable_utilities=no
test "x$enable_utilities" = xno && nc_build_utilities=no
AC_MSG_RESULT($nc_build_utilities)
AM_CONDITIONAL(BUILD_UTILITIES, [test x$nc_build_utilities = xyes])
2012-04-13 10:41:00 +08:00
# Does the user want to disable all tests?
AC_MSG_CHECKING([whether test should be built and run])
AC_ARG_ENABLE([testsets],
[AS_HELP_STRING([--disable-testsets],
[don't build or run netCDF tests])])
test "x$enable_testsets" = xno || enable_testsets=yes
nc_build_tests=$enable_testsets
AC_MSG_RESULT($nc_build_tests)
AM_CONDITIONAL(BUILD_TESTSETS, [test x$nc_build_tests = xyes])
2010-06-03 21:25:25 +08:00
# Does the user want to run tests for large files (> 2GiB)?
AC_MSG_CHECKING([whether large file (> 2GB) tests should be run])
AC_ARG_ENABLE([large-file-tests],
[AS_HELP_STRING([--enable-large-file-tests],
[Run tests which create very large data files (~13 GB disk space
required, but it will be recovered when tests are complete). See
option --with-temp-large to specify temporary directory])])
test "x$enable_large_file_tests" = xyes || enable_large_file_tests=no
AC_MSG_RESULT($enable_large_file_tests)
AM_CONDITIONAL(LARGE_FILE_TESTS, [test x$enable_large_file_tests = xyes])
if test "x$enable_large_file_tests" = xyes; then
AC_DEFINE([LARGE_FILE_TESTS], [1], [do large file tests])
fi
# Does the user want to run benchmarks?
2015-05-30 03:08:09 +08:00
AC_MSG_CHECKING([whether benchmarks should be run (experimental)])
2010-06-03 21:25:25 +08:00
AC_ARG_ENABLE([benchmarks],
[AS_HELP_STRING([--enable-benchmarks],
2014-09-05 05:42:11 +08:00
[Run benchmarks. This is an experimental feature. You must fetch
sample data files from the Unidata ftp site to use these benchmarks.
2010-06-03 21:25:25 +08:00
The benchmarks are a bunch of extra tests, which are timed. We use these
tests to check netCDF performance.])])
test "x$enable_benchmarks" = xyes || enable_benchmarks=no
AC_MSG_RESULT($enable_benchmarks)
AM_CONDITIONAL(BUILD_BENCHMARKS, [test x$enable_benchmarks = xyes])
# Does the user want to use extreme numbers in testing.
AC_MSG_CHECKING([whether extreme numbers should be used in tests])
AC_ARG_ENABLE([extreme-numbers],
[AS_HELP_STRING([--disable-extreme-numbers],
[don't use extreme numbers during testing, such as MAX_INT - 1])])
case "$host_cpu $host_os" in
*386*solaris*)
test "x$enable_extreme_numbers" = xyes || enable_extreme_numbers=no
;;
*)
test "x$enable_extreme_numbers" = xno || enable_extreme_numbers=yes
;;
2014-09-05 05:42:11 +08:00
esac
2010-06-03 21:25:25 +08:00
AC_MSG_RESULT($enable_extreme_numbers)
if test "x$enable_extreme_numbers" = xyes; then
AC_DEFINE(USE_EXTREME_NUMBERS, 1, [set this to use extreme numbers in tests])
fi
# If the env. variable TEMP_LARGE is set, or if
# --with-temp-large=<directory>, use it as a place for the large
# (i.e. > 2 GiB) files created during the large file testing.
AC_MSG_CHECKING([where to put large temp files if large file tests are run])
AC_ARG_WITH([temp-large],
[AS_HELP_STRING([--with-temp-large=<directory>],
[specify directory where large files (i.e. >2 GB) \
will be written, if large files tests are run with
--enable-large-file-tests])],
[TEMP_LARGE=$with_temp_large])
TEMP_LARGE=${TEMP_LARGE-.}
AC_MSG_RESULT($TEMP_LARGE)
#AC_SUBST(TEMP_LARGE)
AC_DEFINE_UNQUOTED([TEMP_LARGE], ["$TEMP_LARGE"], [Place to put very large netCDF test files.])
# According to the autoconf mailing list gurus, we must test for
# compilers unconditionally. That is, we can't skip looking for the
# fortran compilers, just because the user doesn't want fortran. This
# is due to a limitation in autoconf.
# Find the C compiler.
AC_MSG_NOTICE([finding C compiler])
2014-05-31 03:48:55 +08:00
## Compiler with version information. This consists of the full path
## name of the compiler and the reported version number.
AC_SUBST([CC_VERSION])
## Strip anything that looks like a flag off of $CC
CC_NOFLAGS=`echo $CC | sed 's/ -.*//'`
if `echo $CC_NOFLAGS | grep ^/ >/dev/null 2>&1`; then
CC_VERSION="$CC"
else
CC_VERSION="$CC";
for x in `echo $PATH | sed -e 's/:/ /g'`; do
if test -x $x/$CC_NOFLAGS; then
CC_VERSION="$x/$CC"
break
fi
done
fi
if test -n "$cc_version_info"; then
CC_VERSION="$CC_VERSION ( $cc_version_info)"
fi
2011-04-27 04:57:24 +08:00
AC_PROG_CC
2010-06-03 21:25:25 +08:00
AM_PROG_CC_C_O
AC_C_CONST
2014-03-18 06:00:45 +08:00
# CURLOPT_USERNAME is not defined until curl version 7.19.1
# CURLOPT_PASSWORD is not defined until curl version 7.19.1
2011-02-05 03:23:30 +08:00
# CURLOPT_KEYPASSWD is not defined until curl version 7.16.4
2014-03-14 00:06:12 +08:00
# CURLINFO_RESPONSE_CODE is not defined until curl version 7.10.7
2014-12-28 14:59:06 +08:00
# CURLOPT_CHUNK_BGN_FUNCTION is not defined until curl version 7.21.0
2011-02-05 03:23:30 +08:00
# Save/restore CFLAGS
SAVECFLAGS="$CFLAGS"
CFLAGS="${curl_cflags}"
2014-03-12 01:58:22 +08:00
2014-03-18 06:00:45 +08:00
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[#include "curl/curl.h"],
[[int x = CURLOPT_USERNAME;]])],
[haveusername=yes],
[haveusername=no])
AC_MSG_CHECKING([whether CURLOPT_USERNAME is defined])
AC_MSG_RESULT([${haveusername}])
if test $haveusername = yes; then
AC_DEFINE([HAVE_CURLOPT_USERNAME],[1],[Is CURLOPT_USERNAME defined])
fi
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[#include "curl/curl.h"],
[[int x = CURLOPT_PASSWORD;]])],
[havepassword=yes],
[havepassword=no])
AC_MSG_CHECKING([whether CURLOPT_PASSWORD is defined])
AC_MSG_RESULT([${havepassword}])
if test $havepassword = yes; then
AC_DEFINE([HAVE_CURLOPT_PASSWORD],[1],[Is CURLOPT_PASSWORD defined])
fi
2011-02-05 03:23:30 +08:00
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[#include "curl/curl.h"],
[[int x = CURLOPT_KEYPASSWD;]])],
[havekeypassword=yes],
[havekeypassword=no])
2014-03-12 01:58:22 +08:00
AC_MSG_CHECKING([whether CURLOPT_KEYPASSWD is defined])
2011-02-05 03:23:30 +08:00
AC_MSG_RESULT([${havekeypassword}])
if test $havekeypassword = yes; then
AC_DEFINE([HAVE_CURLOPT_KEYPASSWD],[1],[Is CURLOPT_KEYPASSWD defined])
fi
2014-03-12 01:58:22 +08:00
AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
[#include "curl/curl.h"],
2014-03-14 00:06:12 +08:00
[[int x = CURLINFO_RESPONSE_CODE;]])],
2014-03-12 01:58:22 +08:00
[haveresponsecode=yes],
[haveresponsecode=no])
2014-03-14 00:06:12 +08:00
AC_MSG_CHECKING([whether CURLINFO_RESPONSE_CODE is defined])
2014-03-12 01:58:22 +08:00
AC_MSG_RESULT([${haveresponsecode}])
if test $haveresponsecode = yes; then
2014-03-14 00:06:12 +08:00
AC_DEFINE([HAVE_CURLINFO_RESPONSE_CODE],[1],[Is CURLINFO_RESPONSE_CODE defined])
2014-03-12 01:58:22 +08:00
fi
2011-02-05 03:23:30 +08:00
CFLAGS="$SAVECFLAGS"
2010-06-03 21:25:25 +08:00
# Set up libtool.
AC_MSG_NOTICE([setting up libtool])
2011-07-02 00:14:25 +08:00
LT_PREREQ([2.2])
2017-11-30 20:40:17 +08:00
LT_INIT()
2010-11-30 06:23:16 +08:00
2010-06-03 21:25:25 +08:00
AC_MSG_NOTICE([finding other utilities])
2015-01-13 01:36:11 +08:00
# Is m4 installed? If not, bail.
2015-01-14 00:56:37 +08:00
AC_CHECK_PROGS([NC_M4], [m4])
2015-01-13 01:36:11 +08:00
if test -z "$NC_M4"; then
AC_MSG_ERROR([Cannot find m4 utility. Install m4 and try again.])
fi
2011-07-21 05:39:14 +08:00
# Is doxygen installed? If so, have configure construct the Doxyfile.
AC_CHECK_PROGS([DOXYGEN], [doxygen])
2014-09-05 05:42:11 +08:00
if test -z "$DOXYGEN"; then
2011-08-22 21:53:37 +08:00
AC_MSG_WARN([Doxygen not found - documentation will not be built])
fi
2014-02-05 07:13:18 +08:00
2014-09-05 05:42:11 +08:00
# Is graphviz/dot installed? If so, we'll use dot to create
2014-02-05 07:13:18 +08:00
# graphs in the documentation.
AC_CHECK_PROGS([DOT], [dot])
if test -z "$DOT"; then
AC_MSG_WARN([dot not found - will use simple charts in documentation])
HAVE_DOT=NO
elif test "x$enable_dot" = xno; then
HAVE_DOT=NO
2014-09-05 05:42:11 +08:00
else
2014-02-05 07:13:18 +08:00
HAVE_DOT=YES
2014-09-05 05:42:11 +08:00
fi
2011-08-22 21:53:37 +08:00
# If we have doxygen, and it's enabled, then process the file.
if test "x$enable_doxygen" != xno; then
if test -n "$DOXYGEN"; then
2014-09-05 05:42:11 +08:00
AC_SUBST(HAVE_DOT)
2014-09-19 02:26:42 +08:00
AC_CONFIG_FILES([docs/Doxyfile])
2011-08-22 21:53:37 +08:00
fi
2012-03-15 07:26:48 +08:00
# Note: the list of files to input to doxygen
2014-05-22 04:40:39 +08:00
# has been moved to docs/Doxyfile.in so
2012-03-15 07:26:48 +08:00
# that make distcheck works correctly.
# Any new inputs should be inserted into
2014-05-22 04:40:39 +08:00
# docs/Doxyfile.in and possibley docs/Makefile.am
2011-07-21 05:39:14 +08:00
fi
# Find the install program.
2010-06-03 21:25:25 +08:00
AC_PROG_INSTALL
# Check to see if any macros must be set to enable large (>2GB) files.
AC_SYS_LARGEFILE
AC_MSG_NOTICE([displaying some results])
## This next macro just prints some results for debugging
## support issues.
UD_DISPLAY_RESULTS
# For nightly build testing, output CC, FC, etc.
2011-08-12 01:54:34 +08:00
echo "CPPFLAGS=$CPPFLAGS CC=$CC CFLAGS=$CFLAGS LDFLAGS=$LDFLAGS LIBS=$LIBS" >> comps.txt
2010-06-03 21:25:25 +08:00
AC_MSG_NOTICE([checking types, headers, and functions])
2011-07-13 20:36:22 +08:00
AC_CHECK_HEADERS([sys/param.h])
2018-02-03 10:57:55 +08:00
AC_CHECK_HEADERS([libgen.h])
2011-03-22 04:31:56 +08:00
#AC_CHECK_HEADERS([locale.h])
2010-06-03 21:25:25 +08:00
AC_HEADER_STDC
2018-02-05 23:17:25 +08:00
AC_CHECK_HEADERS([locale.h stdio.h stdarg.h fcntl.h malloc.h stdlib.h string.h strings.h unistd.h sys/stat.h getopt.h sys/time.h sys/types.h])
2010-06-03 21:25:25 +08:00
2012-05-16 01:10:41 +08:00
# Do sys/resource.h separately
#AC_CHECK_HEADERS([sys/resource.h],[havesysresource=1],[havesysresource=0])
#if test "x$enable_dll" != xyes ; then
AC_CHECK_HEADERS([sys/resource.h])
#fi
2017-07-06 00:03:48 +08:00
# See if we have ftw.h to walk directory trees
AC_CHECK_HEADERS([ftw.h])
2010-06-03 21:25:25 +08:00
# Check for these functions...
2018-02-05 23:17:25 +08:00
AC_CHECK_FUNCS([strlcat snprintf \
strdup strtoll strtoull \
mkstemp mktemp random \
2011-11-14 12:20:19 +08:00
getrlimit gettimeofday fsync MPI_Comm_f2c])
2012-04-09 06:47:38 +08:00
2012-05-16 01:10:41 +08:00
# Does the user want to use NC_DISKLESS?
2012-05-16 01:48:27 +08:00
AC_MSG_CHECKING([whether in-memory files are enabled])
2012-05-16 01:10:41 +08:00
AC_ARG_ENABLE([diskless],
[AS_HELP_STRING([--disable-diskless],
2012-06-19 00:55:00 +08:00
[disable support for in-memory (NC_DISKLESS) files])])
2012-05-16 01:10:41 +08:00
test "x$enable_diskless" = xno || enable_diskless=yes
2015-08-16 06:26:35 +08:00
AC_MSG_RESULT($enable_diskless)
2014-11-19 06:33:16 +08:00
2017-08-06 12:41:31 +08:00
# If DAP enabled and diskless not enabled, then warn of consequences
if test "x$enable_dap" = "xyes" -a "x$enable_diskless" = xno ; then
AC_MSG_NOTICE([Warning: DAP support is enabled but diskless support is disabled.])
AC_MSG_NOTICE([=> temporary files will be created + reclaimed when using DAP.])
2017-03-09 08:01:10 +08:00
fi
# disable dap4 if netcdf-4 is disabled
if test "x$enable_netcdf_4" = "xno" ; then
AC_MSG_WARN([netcdf-4 not enabled; disabling DAP4])
enable_dap4=no
fi
if test "x$enable_dap4" = xyes; then
AC_DEFINE([ENABLE_DAP4], [1], [if true, build DAP4 Client])
2012-08-03 05:04:47 +08:00
fi
2012-05-16 01:10:41 +08:00
# check for useful, but not essential, memio support
AC_CHECK_FUNCS([memmove getpagesize sysconf])
2012-06-24 03:25:49 +08:00
# Does the user want to allow use of mmap for NC_DISKLESS?
AC_MSG_CHECKING([whether mmap is enabled for in-memory files])
2012-04-23 04:34:21 +08:00
AC_ARG_ENABLE([mmap],
[AS_HELP_STRING([--enable-mmap],
2012-06-24 03:25:49 +08:00
[allow mmap for in-memory files])])
2012-04-23 04:34:21 +08:00
test "x$enable_mmap" = xyes || enable_mmap=no
AC_MSG_RESULT($enable_mmap)
2012-05-16 01:10:41 +08:00
# check for mmap and mremap availability before committing to use mmap
2012-04-23 04:34:21 +08:00
AC_CHECK_FUNCS([mremap])
2012-05-16 01:10:41 +08:00
2012-05-10 01:21:32 +08:00
if test "x$ac_cv_func_mmap_fixed_mapped" != xyes -o "x$ac_cv_func_mremap" != xyes ; then
2012-04-23 04:34:21 +08:00
echo "mmap function or mremap function is not available: disabling mmap"
enable_mmap=no
fi
2012-04-13 10:41:00 +08:00
2012-05-16 01:10:41 +08:00
# Setup the diskless and mmap conditionals
if test "x$enable_diskless" = xyes ; then
2018-02-26 12:45:31 +08:00
AC_DEFINE([USE_DISKLESS], [1], [if true, include NC_DISKLESS and NC_INMEMORY code])
2012-05-16 01:10:41 +08:00
if test "x$enable_mmap" = xyes; then
AC_DEFINE([USE_MMAP], [1], [if true, use mmap for in-memory files])
fi
2012-04-13 10:41:00 +08:00
fi
2012-04-09 06:47:38 +08:00
2010-06-03 21:25:25 +08:00
AC_FUNC_ALLOCA
2018-02-05 23:17:25 +08:00
AC_CHECK_DECLS([isnan, isinf, isfinite],,,[#include <math.h>])
2010-06-03 21:25:25 +08:00
AC_STRUCT_ST_BLKSIZE
UD_CHECK_IEEE
2018-02-05 23:17:25 +08:00
AC_CHECK_TYPES([size_t, ssize_t, schar, uchar, longlong, ushort, uint, int64, uint64])
2010-06-03 21:25:25 +08:00
AC_TYPE_OFF_T
2018-03-17 01:46:18 +08:00
AC_TYPE_UINTPTR_T
AC_C_CHAR_UNSIGNED
2010-06-03 21:25:25 +08:00
AC_C_BIGENDIAN
2015-09-24 02:49:08 +08:00
###
# Crude hack to work around an issue
# in Cygwin.
###
SLEEPCMD=""
PLTFORMOUT="$(uname | cut -d '_' -f 1)"
if test "$PLTFORMOUT" = "CYGWIN"; then
2017-04-04 11:39:44 +08:00
ISCYGWIN=yes
2015-09-24 02:49:08 +08:00
SLEEPCMD="sleep 5"
AC_MSG_NOTICE([Pausing between sizeof() checks to mitigate a Cygwin issue.])
fi
2017-04-04 11:39:44 +08:00
AM_CONDITIONAL(ISCYGWIN, [test "x$ISCYGWIN" = xyes])
2015-09-24 02:49:08 +08:00
$SLEEPCMD
2010-06-03 21:25:25 +08:00
AC_CHECK_SIZEOF(short)
2015-09-24 02:49:08 +08:00
$SLEEPCMD
2010-06-03 21:25:25 +08:00
AC_CHECK_SIZEOF(int)
2015-09-24 02:49:08 +08:00
$SLEEPCMD
2010-06-03 21:25:25 +08:00
AC_CHECK_SIZEOF(long)
2015-09-24 02:49:08 +08:00
$SLEEPCMD
2012-05-31 09:28:42 +08:00
AC_CHECK_SIZEOF(long long)
2015-09-24 02:49:08 +08:00
$SLEEPCMD
2010-06-03 21:25:25 +08:00
AC_CHECK_SIZEOF(float)
2015-09-24 02:49:08 +08:00
$SLEEPCMD
2010-06-03 21:25:25 +08:00
AC_CHECK_SIZEOF(double)
2015-09-24 02:49:08 +08:00
$SLEEPCMD
2010-06-03 21:25:25 +08:00
AC_CHECK_SIZEOF(off_t)
2015-09-24 02:49:08 +08:00
$SLEEPCMD
2010-06-03 21:25:25 +08:00
AC_CHECK_SIZEOF(size_t)
2015-09-16 05:18:59 +08:00
$SLEEPCMD
2015-08-16 06:26:35 +08:00
AC_CHECK_SIZEOF(unsigned long long)
2017-09-17 06:35:52 +08:00
2018-02-03 14:05:14 +08:00
# Check whether we want to enable CDF5 support.
AC_MSG_CHECKING([whether CDF5 support should be enabled])
AC_ARG_ENABLE([cdf5],
2018-04-20 03:26:58 +08:00
[AS_HELP_STRING([--enable-cdf5],
2018-02-03 14:05:14 +08:00
[build without CDF5 support.])],
[enable_cdf5=${enableval}], [enable_cdf5=auto]
)
if test "x${enable_cdf5}" = xyes && test "$ac_cv_sizeof_size_t" -lt "8" ; then
dnl unable to support CDF5, but --enable-cdf5 is explicitly set
AC_MSG_ERROR([Unable to support CDF5 feature because size_t is less than 4 bytes])
fi
if test "$ac_cv_sizeof_size_t" -lt "8" ; then
enable_cdf5=no
else
enable_cdf5=yes
fi
AC_MSG_RESULT($enable_cdf5)
if test "x${enable_cdf5}" = xyes; then
AC_DEFINE([USE_CDF5], [1], [if true, enable CDF5 Support])
AC_DEFINE([ENABLE_CDF5], [1], [if true, enable CDF5 Support])
fi
AM_CONDITIONAL(USE_CDF5, [test x$enable_cdf5 = xyes ])
AM_CONDITIONAL(ENABLE_CDF5, [test x$enable_cdf5 = xyes ])
2015-08-16 06:26:35 +08:00
2016-10-29 07:16:49 +08:00
$SLEEPCMD
if test "$ac_cv_type_uchar" = yes ; then
AC_CHECK_SIZEOF(uchar)
else
AC_CHECK_SIZEOF(unsigned char)
fi
2015-11-20 04:44:07 +08:00
$SLEEPCMD
2015-08-16 06:26:35 +08:00
if test "$ac_cv_type_ushort" = yes ; then
AC_CHECK_SIZEOF(ushort)
else
AC_CHECK_SIZEOF(unsigned short int)
fi
2015-11-20 04:44:07 +08:00
$SLEEPCMD
2015-08-16 06:26:35 +08:00
if test "$ac_cv_type_uint" = yes ; then
AC_CHECK_SIZEOF(uint)
else
AC_CHECK_SIZEOF(unsigned int)
fi
2015-09-16 05:18:59 +08:00
$SLEEPCMD
2015-08-16 06:26:35 +08:00
if test "$ac_cv_type_ushort" = yes ; then
AC_CHECK_SIZEOF(ushort)
else
AC_CHECK_SIZEOF(unsigned short int)
fi
2015-09-16 05:18:59 +08:00
$SLEEPCMD
2015-08-16 06:26:35 +08:00
if test "$ac_cv_type_uint" = yes ; then
AC_CHECK_SIZEOF(uint)
else
AC_CHECK_SIZEOF(unsigned int)
fi
2015-11-06 04:40:35 +08:00
$SLEEPCMD
2017-03-09 08:01:10 +08:00
AC_CHECK_SIZEOF(ssize_t)
$SLEEPCMD
AC_CHECK_SIZEOF([void*])
2010-06-03 21:25:25 +08:00
2011-02-09 20:38:07 +08:00
if test "x$enable_netcdf_4" = xyes || test "x$enable_dap" = xyes; then
2012-06-12 03:44:32 +08:00
AC_SEARCH_LIBS([deflate], [zlibwapi zlibstat zlib zlib1 z], [], [
2011-05-25 18:54:57 +08:00
AC_MSG_ERROR([Can't find or link to the z library. Turn off netCDF-4 and \
2017-03-09 08:01:10 +08:00
DAP clients with --disable-netcdf-4 --disable-dap, or see config.log for errors.])])
2011-02-09 20:38:07 +08:00
fi
2012-05-16 01:10:41 +08:00
# We need the math library
2014-09-05 05:42:11 +08:00
AC_CHECK_LIB([m], [floor], [],
2011-06-02 03:48:33 +08:00
[AC_MSG_ERROR([Can't find or link to the math library.])])
2010-06-03 21:25:25 +08:00
if test "x$enable_netcdf_4" = xyes; then
2011-12-13 12:16:52 +08:00
2010-06-03 21:25:25 +08:00
AC_DEFINE([USE_NETCDF4], [1], [if true, build netCDF-4])
AC_DEFINE([H5_USE_16_API], [1], [use HDF5 1.6 API])
2011-05-13 00:31:48 +08:00
# Check for the main hdf5 and hdf5_hl library.
2011-12-13 12:16:52 +08:00
2014-09-05 05:42:11 +08:00
AC_SEARCH_LIBS([H5Fflush], [hdf5dll hdf5], [],
2011-05-13 00:31:48 +08:00
[AC_MSG_ERROR([Can't find or link to the hdf5 library. Use --disable-netcdf-4, or see config.log for errors.])])
2014-09-05 05:42:11 +08:00
AC_SEARCH_LIBS([H5DSis_scale], [hdf5_hldll hdf5_hl], [],
2011-05-13 00:31:48 +08:00
[AC_MSG_ERROR([Can't find or link to the hdf5 high-level. Use --disable-netcdf-4, or see config.log for errors.])])
2014-09-05 05:42:11 +08:00
2012-09-26 05:48:14 +08:00
AC_CHECK_HEADERS([hdf5.h], [], [AC_MSG_ERROR([Compiling a test with HDF5 failed. Either hdf5.h cannot be found, or config.log should be checked for other reason.])])
2018-02-05 23:17:25 +08:00
AC_CHECK_FUNCS([H5Z_SZIP])
2018-02-27 03:56:10 +08:00
hdf5_parallel=no
2011-03-15 18:19:08 +08:00
2018-02-27 03:56:10 +08:00
AC_CHECK_FUNCS([H5Pget_fapl_mpiposix H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP H5free_memory H5Pset_libver_bounds H5Pset_all_coll_metadata_ops])
2010-06-03 21:25:25 +08:00
# The user may have parallel HDF5 based on MPI POSIX.
2011-03-15 18:19:08 +08:00
if test "x$ac_cv_func_H5Pget_fapl_mpiposix" = xyes; then
2010-06-03 21:25:25 +08:00
AC_DEFINE([USE_PARALLEL_POSIX], [1], [if true, compile in parallel netCDF-4 based on MPI/POSIX])
fi
2014-09-05 05:42:11 +08:00
2010-06-03 21:25:25 +08:00
# The user may have parallel HDF5 based on MPI mumble mumble.
2011-03-15 18:19:08 +08:00
if test "x$ac_cv_func_H5Pget_fapl_mpio" = xyes; then
2010-06-03 21:25:25 +08:00
AC_DEFINE([USE_PARALLEL_MPIO], [1], [if true, compile in parallel netCDF-4 based on MPI/IO])
fi
2016-12-02 02:56:33 +08:00
# Check to see if HDF5 library has collective metadata APIs, (HDF5 >= 1.10.0)
if test "x$ac_cv_func_H5Pset_all_coll_metadata_ops" = xyes; then
AC_DEFINE([HDF5_HAS_COLL_METADATA_OPS], [1], [if true, use collective metadata ops in parallel netCDF-4])
fi
2015-08-16 06:26:35 +08:00
# If parallel is available in hdf5, enable it in the C code. Also add some stuff to netcdf.h.
hdf5_parallel=no
2011-03-15 18:19:08 +08:00
if test "x$ac_cv_func_H5Pget_fapl_mpio" = xyes -o "x$ac_cv_func_H5Pget_fapl_mpiposix" = xyes; then
2015-08-16 06:26:35 +08:00
hdf5_parallel=yes
2010-06-03 21:25:25 +08:00
fi
2018-02-27 08:08:26 +08:00
2015-08-16 06:26:35 +08:00
AC_MSG_CHECKING([whether parallel io is enabled in hdf5])
AC_MSG_RESULT([$hdf5_parallel])
2014-09-05 05:42:11 +08:00
2018-02-27 08:08:26 +08:00
if test "x$hdf5_parallel" = "xno"; then
if test "x$enable_parallel_tests" = "xyes"; then
AC_MSG_ERROR([Parallel tests requested, but no parallel HDF5 installation detected.])
fi
fi
2011-04-30 02:26:51 +08:00
# The user may have built HDF5 with the SZLIB library.
2017-09-19 04:40:51 +08:00
enable_szlib=no
2011-04-30 04:39:32 +08:00
if test "x$ac_cv_func_H5Z_SZIP" = xyes; then
2017-09-19 04:40:51 +08:00
enable_szlib=yes
AC_SEARCH_LIBS([ SZ_Compress], [szip sz], [], [])
2012-11-10 07:11:01 +08:00
AC_DEFINE([USE_SZIP], [1], [if true, compile in szip compression in netCDF-4 variables])
2010-06-03 21:25:25 +08:00
fi
2017-09-19 04:40:51 +08:00
2015-04-22 05:25:05 +08:00
if test "x$ac_cv_func_H5free_memory" = xyes; then
AC_DEFINE([HDF5_HAS_H5FREE], [1], [if true, H5free_memory() will be used to free hdf5-allocated memory in nc4file.])
fi
2016-04-09 05:37:37 +08:00
if test "x$ac_cv_func_H5Pset_libver_bounds" = xyes; then
AC_DEFINE([HDF5_HAS_LIBVER_BOUNDS], [1], [if true, netcdf4 file properties will be set using H5Pset_libver_bounds])
fi
2010-06-03 21:25:25 +08:00
# If the user wants hdf4 built in, check it out.
if test "x$enable_hdf4" = xyes; then
2014-09-05 05:42:11 +08:00
AC_CHECK_HEADERS([mfhdf.h], [], [nc_mfhdf_h_missing=yes])
2010-06-03 21:25:25 +08:00
if test "x$nc_mfhdf_h_missing" = xyes; then
AC_MSG_ERROR([Cannot find mfhdf.h, yet --enable-hdf4 was used.])
2014-09-05 05:42:11 +08:00
fi
2013-09-18 05:10:17 +08:00
AC_CHECK_LIB([df], [Hclose], [], [AC_MSG_ERROR([Can't find or link to the hdf4 df library. See config.log for errors.])])
AC_CHECK_LIB([mfhdf], [SDcreate], [], [AC_MSG_ERROR([Can't find or link to the hdf4 mfhdf library. See config.log for errors.])])
2014-09-05 05:42:11 +08:00
2013-11-23 07:03:03 +08:00
AC_CHECK_LIB([jpeg], [jpeg_set_quality], [], [AC_MSG_ERROR([Can't find or link to the jpeg library (required by hdf4). See config.log for errors.])])
2010-06-03 21:25:25 +08:00
AC_DEFINE([USE_HDF4], [1], [if true, use HDF4 too])
fi
fi
2015-08-16 06:26:35 +08:00
# There are several cases for parallelism:
# 1. pnetcdf enabled => we want to parallelism for CDF-1,CDF-2,and CDF-5
# 2. hdf5 has mpio enabled
# a. do not want to use it for netcdf4
# b. do want to use it for netcdf4
2017-10-27 04:05:04 +08:00
# Should we provide parallel io for netcdf-4?
2015-08-16 06:26:35 +08:00
if test "x$enable_netcdf_4" = xyes ; then
2017-10-27 04:05:04 +08:00
AC_MSG_CHECKING([whether parallel I/O is enabled for netcdf-4])
AC_ARG_ENABLE([parallel4],
[AS_HELP_STRING([--disable-parallel4],
[disable parallel I/O for netcdf-4, even if it's enabled in libhdf5])],
[user_set_parallel4=${enableval}])
test "x$enable_parallel4" = xno || enable_parallel4=yes
AC_MSG_RESULT($enable_parallel4)
# If user wants parallel IO for netCDF-4, make sure HDF5 can provide it.
if test "x$enable_parallel4" = xyes; then
if test "x$hdf5_parallel" = xno; then
# If user specifically asked for parallel4, then error out.
if test "x$user_set_parallel4" = xyes; then
AC_MSG_ERROR([Paralllel IO in netCDF-4 requested, but HDF5 does not provide parallel IO.])
fi
# User didn't specify, so disable parallel4
enable_parallel4=no
AC_MSG_WARN([Parallel io disabled for netcdf-4 because hdf5 does not support])
fi
fi
2015-08-16 06:26:35 +08:00
else
2017-10-27 04:05:04 +08:00
enable_parallel4=no
2015-08-16 06:26:35 +08:00
fi
# We have already tested for parallel io in netcdf4
# Now do it for netcdf-3
# Does the user want parallel I/O for classic and 64-bit offset files using parallel-netcdf (pnetcdf)?
AC_MSG_CHECKING([whether parallel I/O for classic files is to be enabled])
AC_ARG_ENABLE([pnetcdf], [AS_HELP_STRING([--enable-pnetcdf],
[build with parallel I/O for classic files])])
test "x$enable_pnetcdf" = xyes || enable_pnetcdf=no
AC_MSG_RESULT($enable_pnetcdf)
# See if the pnetcdf lib is available and of the
# right version (1.6.0 or later)
if test "x$enable_pnetcdf" = xyes; then
pnetcdf_conflict=no
AC_CHECK_LIB([pnetcdf], [ncmpi_create], [],[pnetcdf_conflict=yes])
2017-10-26 19:38:31 +08:00
if test "x$pnetcdf_conflict" = xyes ; then
AC_MSG_ERROR([Cannot link to pnetcdf library.])
2017-11-21 06:50:47 +08:00
fi
2017-10-26 19:38:31 +08:00
2015-08-16 06:26:35 +08:00
# Pnetcdf did not support utf-8 until 1.6.0
# Save/restore CFLAGS
SAVELIBS=$LIBS
LIBS="$LIBS -lpnetcdf"
AC_RUN_IFELSE([AC_LANG_PROGRAM([#include <pnetcdf.h>],
[[
int major = PNETCDF_VERSION_MAJOR;
int minor = PNETCDF_VERSION_MINOR;
int version = major*1000 + minor;
int ok = (version >= (1*1000 + 6));
return (ok?0:1);]])],
[pnetcdf16=yes],
[pnetcdf16=no])
CFLAGS="$SAVECFLAGS"
LIBS="$SAVELIBS"
AC_MSG_CHECKING([Is libpnetcdf version 1.6.0 or later?])
AC_MSG_RESULT([$pnetcdf16])
if test x$pnetcdf16 = xno; then
2017-10-26 19:38:31 +08:00
AC_MSG_ERROR([--enable-pnetcdf requires version 1.6.0 or later])
2015-08-16 06:26:35 +08:00
fi
fi
# Now, set enable_parallel if either pnetcdf or parallel4 is set
if test "x$enable_pnetcdf" = xyes -o "x$enable_parallel4" = xyes; then
enable_parallel=yes
else
enable_parallel=no
fi
2017-10-17 00:30:47 +08:00
AM_CONDITIONAL(ENABLE_PARALLEL, [test x$enable_parallel = xyes ])
2015-08-16 06:26:35 +08:00
if test "x$hdf5_parallel" = xyes; then
# Provide more precise parallel control
AC_DEFINE([HDF5_PARALLEL], [1], [if true, hdf5 has parallelism enabled])
fi
# Set config flags
if test "x$enable_parallel4" = xyes; then
# Provide more precise parallel control
AC_DEFINE([USE_PARALLEL4], [1], [if true, parallel netcdf-4 is in use])
fi
if test "x$enable_pnetcdf" = xyes; then
AC_DEFINE([USE_PNETCDF], [1], [if true, parallel netCDF is used])
fi
# If enable_parallel is in use, enable it in the C code. Also add some stuff to netcdf.h.
if test "x$enable_parallel" = xyes; then
AC_DEFINE([USE_PARALLEL], [1], [if true, pnetcdf or parallel netcdf-4 is in use])
fi
2016-11-04 04:14:14 +08:00
AC_ARG_ENABLE([erange_fill],
2017-04-06 07:09:39 +08:00
[AS_HELP_STRING([--enable-erange-fill],
[Enable use of fill value when out-of-range type
conversion causes NC_ERANGE error. @<:@default: disabled@:>@])],
[enable_erange_fill=${enableval}], [enable_erange_fill=no]
2016-11-04 04:14:14 +08:00
)
2017-04-07 06:59:21 +08:00
AC_ARG_ENABLE([zero-length-coord-bound],
[AS_HELP_STRING([--enable-zero-length-coord-bound],
2016-11-13 13:58:09 +08:00
[Enable a more relaxed boundary error check NC_EINVALCOORDS
to allow coordinate start argument equal to dimension size
when argument count is zero. @<:@default: disabled@:>@])],
2017-04-07 06:59:21 +08:00
[enable_zero_length_coord_bound=${enableval}], [enable_zero_length_coord_bound=no]
2016-11-13 13:58:09 +08:00
)
2016-11-15 00:41:10 +08:00
# check PnetCDF's settings on enable_erange_fill and relax_coord_bound
2016-11-13 13:58:09 +08:00
if test "x$enable_pnetcdf" = xyes; then
UD_CHECK_HEADER_PATH([pnetcdf.h])
2016-11-15 00:41:10 +08:00
AC_MSG_CHECKING([if erange-fill is enabled in PnetCDF])
erange_fill_pnetcdf=`grep PNETCDF_ERANGE_FILL ${ac_cv_header_path_pnetcdf_h}`
if test "x$erange_fill_pnetcdf" = x; then
erange_fill_pnetcdf=no
else
erange_fill_pnetcdf=`echo ${erange_fill_pnetcdf} | cut -d' ' -f3`
2017-10-26 01:12:15 +08:00
if test "x$erange_fill_pnetcdf" = x0; then
2016-11-15 00:41:10 +08:00
enable_erange_fill_pnetcdf=no
else
enable_erange_fill_pnetcdf=yes
fi
fi
2017-10-26 19:38:31 +08:00
AC_MSG_RESULT([$enable_erange_fill_pnetcdf])
2016-11-15 00:41:10 +08:00
if test "$enable_erange_fill" != "$enable_erange_fill_pnetcdf"; then
if test "$enable_erange_fill_pnetcdf" = yes; then
AC_MSG_WARN([Enable erange-fill to conform with PnetCDF setting])
else
AC_MSG_WARN([Disable erange-fill to conform with PnetCDF setting])
fi
enable_erange_fill=$enable_erange_fill_pnetcdf
fi
AC_MSG_CHECKING([if relax-coord-bound is enabled in PnetCDF])
2016-11-13 13:58:09 +08:00
relax_coord_bound_pnetcdf=`grep PNETCDF_RELAX_COORD_BOUND ${ac_cv_header_path_pnetcdf_h}`
if test "x$relax_coord_bound_pnetcdf" = x; then
2017-04-07 06:59:21 +08:00
elax_coord_bound_pnetcdf=no
2016-11-13 13:58:09 +08:00
else
coord_bound_pnetcdf=`echo ${relax_coord_bound_pnetcdf} | cut -d' ' -f3`
if test "x$coord_bound_pnetcdf" = x0; then
relax_coord_bound_pnetcdf=no
else
relax_coord_bound_pnetcdf=yes
fi
fi
2017-10-26 19:38:31 +08:00
AC_MSG_RESULT([$relax_coord_bound_pnetcdf])
2017-04-07 06:59:21 +08:00
if test "$enable_zero_length_coord_bound" != "$relax_coord_bound_pnetcdf"; then
2016-11-13 13:58:09 +08:00
if test "$relax_coord_bound_pnetcdf" = yes; then
AC_MSG_WARN([Enable relax-coord-bound to conform with PnetCDF setting])
else
AC_MSG_WARN([Disable relax-coord-bound to conform with PnetCDF setting])
fi
2017-04-07 06:59:21 +08:00
enable_zero_length_coord_bound=$relax_coord_bound_pnetcdf
2016-11-13 13:58:09 +08:00
fi
fi
2016-11-15 00:41:10 +08:00
if test "x$enable_erange_fill" = xyes ; then
if test "x$M4FLAGS" = x ; then
M4FLAGS="-DERANGE_FILL"
else
M4FLAGS="$M4FLAGS -DERANGE_FILL"
fi
2017-08-21 03:32:57 +08:00
AC_DEFINE([ERANGE_FILL], [1], [if true, use _FillValue for NC_ERANGE data elements])
2016-11-15 00:41:10 +08:00
fi
AC_SUBST(M4FLAGS)
2017-04-07 06:59:21 +08:00
if test "x$enable_zero_length_coord_bound" = xyes; then
2016-11-13 13:58:09 +08:00
AC_DEFINE([RELAX_COORD_BOUND], [1], [if true, NC_EINVALCOORDS check is more relaxed])
fi
2014-11-19 06:33:16 +08:00
# Check for downloading/building fortran via postinstall script.
2014-11-21 06:56:11 +08:00
if test "x$enable_remote_fortran_bootstrap" = xyes; then
2014-11-19 06:33:16 +08:00
AC_DEFINE([BUILD_FORTRAN], 1, [If true, will attempt to download and build netcdf-fortran.])
fi
2010-06-03 21:25:25 +08:00
# No logging for netcdf-3.
if test "x$enable_netcdf_4" = xno; then
enable_logging=no
fi
if test "x$enable_logging" = xyes; then
AC_DEFINE([LOGGING], 1, [If true, turn on logging.])
fi
# Automake conditionals need to be called, whether the answer is yes
# or no.
AM_CONDITIONAL(BUILD_PARALLEL, [test x$enable_parallel = xyes])
2015-08-16 06:26:35 +08:00
AM_CONDITIONAL(TEST_PARALLEL4, [test "x$enable_parallel4" = xyes -a "x$enable_parallel_tests" = xyes])
2010-06-03 21:25:25 +08:00
AM_CONDITIONAL(BUILD_DAP, [test "x$enable_dap" = xyes])
AM_CONDITIONAL(USE_DAP, [test "x$enable_dap" = xyes]) # Alias
2017-03-09 08:01:10 +08:00
# Provide protocol specific flags
AM_CONDITIONAL(ENABLE_DAP, [test "x$enable_dap" = xyes])
AM_CONDITIONAL(ENABLE_DAP4, [test "x$enable_dap4" = xyes])
2017-11-21 06:50:47 +08:00
AM_CONDITIONAL(USE_STRICT_NULL_BYTE_HEADER_PADDING, [test x$enable_strict_null_byte_header_padding = xyes])
2017-09-14 05:25:40 +08:00
AM_CONDITIONAL(ENABLE_CDF5, [test "x$enable_cdf5" = xyes])
2010-06-03 21:25:25 +08:00
AM_CONDITIONAL(ENABLE_DAP_REMOTE_TESTS, [test "x$enable_dap_remote_tests" = xyes])
2014-03-08 03:04:38 +08:00
AM_CONDITIONAL(ENABLE_DAP_AUTH_TESTS, [test "x$enable_dap_auth_tests" = xyes])
2010-06-03 21:25:25 +08:00
AM_CONDITIONAL(ENABLE_DAP_LONG_TESTS, [test "x$enable_dap_long_tests" = xyes])
AM_CONDITIONAL(EXTRA_EXAMPLE_TESTS, [test "x$enable_extra_example_tests" = xyes])
2011-04-30 04:39:32 +08:00
AM_CONDITIONAL(USE_SZIP, [test "x$ac_cv_func_H5Z_SZIP" = xyes])
2010-06-03 21:25:25 +08:00
AM_CONDITIONAL(USE_PNETCDF_DIR, [test ! "x$PNETCDFDIR" = x])
AM_CONDITIONAL(USE_LOGGING, [test "x$enable_logging" = xyes])
AM_CONDITIONAL(CROSS_COMPILING, [test "x$cross_compiling" = xyes])
AM_CONDITIONAL(USE_NETCDF4, [test x$enable_netcdf_4 = xyes])
AM_CONDITIONAL(USE_HDF4, [test x$enable_hdf4 = xyes])
AM_CONDITIONAL(USE_HDF4_FILE_TESTS, [test x$enable_hdf4_file_tests = xyes])
AM_CONDITIONAL(USE_RENAMEV3, [test x$enable_netcdf_4 = xyes -o x$enable_dap = xyes])
2014-11-21 06:56:11 +08:00
AM_CONDITIONAL(BUILD_FORTRAN, [test x$enable_remote_fortran_bootstrap = xyes])
2010-06-03 21:25:25 +08:00
AM_CONDITIONAL(USE_PNETCDF, [test x$enable_pnetcdf = xyes])
AM_CONDITIONAL(USE_DISPATCH, [test x$enable_dispatch = xyes])
2014-09-05 05:42:11 +08:00
AM_CONDITIONAL(BUILD_DISKLESS, [test x$enable_diskless = xyes])
2012-05-16 01:10:41 +08:00
AM_CONDITIONAL(BUILD_MMAP, [test x$enable_mmap = xyes])
2015-05-27 04:29:28 +08:00
AM_CONDITIONAL(BUILD_DOCS, [test x$enable_doxygen = xyes])
AM_CONDITIONAL(SHOW_DOXYGEN_TAG_LIST, [test x$enable_doxygen_tasks = xyes])
2018-03-18 06:25:13 +08:00
AM_CONDITIONAL(ENABLE_METADATA_PERF, [test x$enable_metadata_perf = xyes])
2010-06-03 21:25:25 +08:00
# If the machine doesn't have a long long, and we want netCDF-4, then
# we've got problems!
if test "x$enable_netcdf_4" = xyes; then
AC_TYPE_LONG_LONG_INT
AC_TYPE_UNSIGNED_LONG_LONG_INT
dnl if test ! "x$ac_cv_type_long_long_int" = xyes -o ! "x$ac_cv_type_unsigned_long_long_int" = xyes; then
dnl AC_MSG_ERROR([This platform does not support long long types. These are required for netCDF-4.])
dnl fi
fi
# Create the file name for a "make ftpbin" which is used to generate a
# binary distribution. For each release we generate binary releases on
# the thousands of machines in Unidata's vast underground complex at
# an undisclosed location in the Rocky Mountains. The binary
# distributions, along with the 25-foot thick cement slabs and the
# giant springs, will help distribute netCDF even after a catastrophic
# meteor strike.
AC_MSG_CHECKING([what to call the output of the ftpbin target])
BINFILE_NAME=binary-netcdf-$PACKAGE_VERSION
test "x$enable_netcdf_4" = xno && BINFILE_NAME=${BINFILE_NAME}_nc3
BINFILE_NAME=${BINFILE_NAME}.tar
AC_SUBST(BINFILE_NAME)
AC_MSG_RESULT([$BINFILE_NAME $FC $CXX])
2015-11-03 07:26:50 +08:00
##
# Bugfix for Cygwin.
##
AC_MSG_CHECKING([if libtool needs -no-undefined flag to build shared libraries])
case "`uname`" in
CYGWIN*|MINGW*|AIX*)
## Add in the -no-undefined flag to LDFLAGS for libtool.
2015-11-04 01:37:42 +08:00
AC_MSG_RESULT([yes])
2015-11-03 07:26:50 +08:00
NOUNDEFINED=" -no-undefined"
;;
*)
## Don't add anything
AC_MSG_RESULT([no])
;;
esac
2010-06-03 21:25:25 +08:00
2011-05-18 03:14:35 +08:00
AC_MSG_CHECKING([value of LIBS])
AC_MSG_RESULT([$LIBS])
2010-06-03 21:25:25 +08:00
# Flags for nc-config script; by design $prefix, $includir, $libdir,
# etc. are left as shell variables in the script so as to facilitate
# relocation
2014-09-05 05:42:11 +08:00
if test "x$with_netcdf_c_lib" = x ; then
2010-06-03 21:25:25 +08:00
NC_LIBS="-lnetcdf"
else
NC_LIBS="$with_netcdf_c_lib"
fi
if test "x$enable_shared" != xyes; then
2011-06-10 21:34:12 +08:00
NC_LIBS="$LDFLAGS $NC_LIBS $LIBS"
2014-09-05 05:42:11 +08:00
fi
2010-06-03 21:25:25 +08:00
case "x$target_os" in
2014-09-05 05:42:11 +08:00
xsolaris*)
2010-06-03 21:25:25 +08:00
NEWNCLIBS=""
for x in $NC_LIBS ; do
case "$x" in
-L*) r=`echo "$x" | sed -e 's|^-L|-R|'`
NEWNCLIBS="$NEWNCLIBS $x $r"
;;
*) NEWNCLIBS="$NEWNCLIBS $x" ;;
esac
done
NC_LIBS="$NEWNCLIBS"
;;
*);;
esac
2011-04-27 04:57:24 +08:00
NC_FLIBS="-lnetcdff $NC_LIBS"
2010-06-03 21:25:25 +08:00
2014-04-10 05:20:16 +08:00
# temporary to deal with a JNA problem
AC_MSG_CHECKING([If compilation is for use with JNA])
AC_ARG_ENABLE([jna],
[AS_HELP_STRING([--enable-jna],
[enable jna bug fix])],
[],
[enable_jna=no])
test "x$enable_jna" = xno || enable_jna=yes
AC_MSG_RESULT($enable_jna)
if test "x$enable_jna" = xyes ; then
AC_DEFINE([JNA], [1], [if true, include JNA bug fix])
fi
2018-03-18 06:25:13 +08:00
# Control large metadata performance test
AC_MSG_CHECKING([whether large metadata performance testing should be run])
AC_ARG_ENABLE([metadata-perf],
[AS_HELP_STRING([--enable-metadata-perf],
[Test performance of nc_create and nc_open on large metadata])])
test "x$enable_metadata_perf" = xyes || enable_metadata_perf=no
AC_MSG_RESULT($enable_metadata_perf)
2018-01-17 02:00:09 +08:00
# Control filter test/example
AC_MSG_CHECKING([whether filter testing should be run])
AC_ARG_ENABLE([filter-testing],
[AS_HELP_STRING([--disable-filter-testing],
[Do not run filter test and example; requires shared libraries and netCDF-4])])
test "x$enable_filter_testing" = xno || enable_filter_testing=yes
AC_MSG_RESULT($enable_filter_testing)
2017-05-15 08:10:02 +08:00
if test "x$enable_netcdf_4" = xno ; then
2018-01-17 02:00:09 +08:00
AC_MSG_WARN([netCDF-4 disabled => --disable-filter-testing])
2018-03-17 01:46:18 +08:00
enable_filter_testing=no
2018-01-17 02:00:09 +08:00
fi
if test "x$enable_shared" = xno ; then
AC_MSG_WARN([Shared libraries are disabled => --disable-filter-testing])
2018-03-17 01:46:18 +08:00
enable_filter_testing=no
2017-05-15 08:10:02 +08:00
fi
2018-01-17 02:00:09 +08:00
AM_CONDITIONAL(ENABLE_FILTER_TESTING, [test x$enable_filter_testing = xyes])
2017-04-28 03:01:59 +08:00
2014-05-31 05:30:58 +08:00
AC_SUBST(NC_LIBS,[$NC_LIBS])
AC_SUBST(HAS_DAP,[$enable_dap])
2017-09-27 01:33:33 +08:00
AC_SUBST(HAS_DAP2,[$enable_dap])
2017-03-09 08:01:10 +08:00
AC_SUBST(HAS_DAP4,[$enable_dap4])
2014-05-31 05:30:58 +08:00
AC_SUBST(HAS_NC2,[$nc_build_v2])
AC_SUBST(HAS_NC4,[$enable_netcdf_4])
2017-09-14 05:25:40 +08:00
AC_SUBST(HAS_CDF5,[$enable_cdf5])
2014-05-31 05:30:58 +08:00
AC_SUBST(HAS_HDF4,[$enable_hdf4])
AC_SUBST(HAS_PNETCDF,[$enable_pnetcdf])
AC_SUBST(HAS_HDF5,[$enable_netcdf_4])
2016-03-01 02:22:10 +08:00
AC_SUBST(HAS_LOGGING, [$enable_logging])
2017-09-19 04:40:51 +08:00
AC_SUBST(HAS_SZLIB,[$enable_szlib])
2014-05-31 05:30:58 +08:00
AC_SUBST(HAS_PARALLEL,[$enable_parallel])
2015-08-16 06:26:35 +08:00
AC_SUBST(HAS_PARALLEL4,[$enable_parallel4])
2014-05-31 05:30:58 +08:00
AC_SUBST(HAS_DISKLESS,[$enable_diskless])
AC_SUBST(HAS_MMAP,[$enable_mmap])
AC_SUBST(HAS_JNA,[$enable_jna])
2016-11-13 13:58:09 +08:00
AC_SUBST(RELAX_COORD_BOUND,[$enable_relax_coord_bound])
2018-02-03 11:31:45 +08:00
AC_SUBST(HAS_ERANGE_FILL,[$enable_erange_fill])
2014-05-31 05:30:58 +08:00
2012-12-06 06:06:38 +08:00
# Include some specifics for netcdf on windows.
#AH_VERBATIM([_WIN32_STRICMP],
AH_BOTTOM(
[/* Define strcasecmp, snprintf on Win32 systems. */
#ifdef _WIN32
#define strcasecmp _stricmp
#define snprintf _snprintf
#endif])
2011-07-15 06:24:02 +08:00
# Access netcdf specific version of config.h
AH_BOTTOM([#include "ncconfigure.h"])
2010-06-03 21:25:25 +08:00
##################################################
# Uncomment this to keep a copy of autoconf defines at this point, for
# debugging purposes.
# cp confdefs.h my_config.h
2014-09-05 07:20:15 +08:00
#####
2014-09-05 05:42:11 +08:00
# Create output variables from various
2014-05-31 05:30:58 +08:00
# shell variables, for use in generating
# libnetcdf.settings.
2014-09-05 07:20:15 +08:00
#####
2014-05-31 05:30:58 +08:00
AC_SUBST([enable_shared])
AC_SUBST([enable_static])
AC_SUBST([CFLAGS])
AC_SUBST([CPPFLAGS])
AC_SUBST([LDFLAGS])
AC_SUBST([AM_CFLAGS])
AC_SUBST([AM_CPPFLAGS])
AC_SUBST([AM_LDFLAGS])
2015-11-03 07:26:50 +08:00
AC_SUBST([NOUNDEFINED])
2014-05-31 05:30:58 +08:00
2014-09-11 06:50:45 +08:00
# Args:
# 1. netcdf_meta.h variable
# 2. conditional variable that is yes or no.
# 3. default condition
#
# example: AX_SET_META([NC_HAS_NC2],[$nc_build_v2],[]) # Because it checks for no.
# AX_SET_META([NC_HAS_HDF4],[$enable_hdf4],[yes])
AC_DEFUN([AX_SET_META],[
if [ test "x$2" = x$3 ]; then
AC_SUBST([$1]) $1=1
2014-09-06 01:09:46 +08:00
else
2014-09-11 06:50:45 +08:00
AC_SUBST([$1]) $1=0
2014-09-06 01:09:46 +08:00
fi
])
2014-09-05 07:20:15 +08:00
#####
# Define values used in include/netcdf_meta.h
#####
2014-09-11 06:50:45 +08:00
AC_SUBST([NC_VERSION]) NC_VERSION=$VERSION
AX_SET_META([NC_HAS_NC2],[$nc_build_v2],[yes])
AX_SET_META([NC_HAS_NC4],[$enable_netcdf_4],[yes])
AX_SET_META([NC_HAS_HDF4],[$enable_hdf4],[yes])
AX_SET_META([NC_HAS_HDF5],[$enable_netcdf_4],[yes])
AX_SET_META([NC_HAS_SZIP],[$ac_cv_func_H5Z_SZIP],[yes])
2017-09-27 01:33:33 +08:00
AX_SET_META([NC_HAS_DAP2],[$enable_dap],[yes])
2017-03-09 08:01:10 +08:00
AX_SET_META([NC_HAS_DAP4],[$enable_dap4],[yes])
2014-09-11 06:50:45 +08:00
AX_SET_META([NC_HAS_DISKLESS],[$enable_diskless],[yes])
AX_SET_META([NC_HAS_MMAP],[$enable_mmap],[yes])
AX_SET_META([NC_HAS_JNA],[$enable_jna],[yes])
AX_SET_META([NC_HAS_PNETCDF],[$enable_pnetcdf],[yes])
AX_SET_META([NC_HAS_PARALLEL],[$enable_parallel],[yes])
2015-08-16 06:26:35 +08:00
AX_SET_META([NC_HAS_PARALLEL4],[$enable_parallel4],[yes])
2017-09-27 01:33:33 +08:00
AX_SET_META([NC_HAS_CDF5],[$enable_cdf5],[yes])
2018-01-26 03:46:46 +08:00
AX_SET_META([NC_HAS_ERANGE_FILL], [$enable_erange_fill],[yes])
2012-07-18 06:23:37 +08:00
2017-03-09 08:01:10 +08:00
# Automake says that this is always run in top_builddir
# and that srcdir is defined (== top_srcdir)
abs_top_builddir=`pwd`
cd $srcdir
abs_top_srcdir=`pwd`
cd $abs_top_builddir
2017-06-08 03:21:07 +08:00
2018-01-17 02:00:09 +08:00
# test_common.sh setup
2017-06-08 03:21:07 +08:00
AC_CONFIG_FILES(test_common.sh:test_common.in)
#rm -f ${abs_top_builddir}/test_common.sh
#sed -e "s|@TOPSRCDIR@|${abs_top_srcdir}|" -e "s|@TOPBUILDDIR@|${abs_top_builddir}|" <${abs_top_srcdir}/test_common.in >${abs_top_builddir}/test_common.sh
2017-03-09 08:01:10 +08:00
2018-01-17 02:00:09 +08:00
# nc_test4/findplugin.sh setup
AC_SUBST([ISCMAKE], [])
AC_SUBST([MSVC], [])
AC_CONFIG_FILES(nc_test4/findplugin.sh:nc_test4/findplugin.in)
2018-03-17 01:46:18 +08:00
AC_CONFIG_FILES(examples/C/findplugin.sh:nc_test4/findplugin.in)
2018-01-17 02:00:09 +08:00
2014-09-06 01:09:46 +08:00
#####
# End netcdf_meta.h definitions.
#####
2010-06-03 21:25:25 +08:00
AC_MSG_NOTICE([generating header files and makefiles])
AC_CONFIG_FILES([Makefile
nc-config
netcdf.pc
2016-01-27 01:09:14 +08:00
libnetcdf.settings
postinstall.sh
include/netcdf_meta.h
2010-06-04 04:22:55 +08:00
include/Makefile
2014-09-06 01:09:46 +08:00
h5_test/Makefile
2018-03-05 18:45:18 +08:00
hdf4_test/Makefile
2010-06-03 21:25:25 +08:00
libsrc/Makefile
libsrc4/Makefile
2015-08-15 10:38:30 +08:00
libsrcp/Makefile
2010-06-03 21:25:25 +08:00
ncdump/Makefile
ncgen3/Makefile
ncgen/Makefile
examples/Makefile
examples/C/Makefile
examples/CDL/Makefile
2012-08-01 04:34:13 +08:00
oc2/Makefile
2012-06-13 05:50:02 +08:00
libdap2/Makefile
2017-03-09 08:01:10 +08:00
libdap4/Makefile
2018-02-08 21:20:58 +08:00
libhdf4/Makefile
2012-06-13 05:50:02 +08:00
libdispatch/Makefile
liblib/Makefile
2014-09-19 08:26:06 +08:00
ncdump/cdl/Makefile
ncdump/expected/Makefile
2017-03-09 08:01:10 +08:00
docs/Makefile
docs/images/Makefile
nctest/Makefile
nc_test4/Makefile
nc_test/Makefile
2012-06-13 05:50:02 +08:00
ncdap_test/Makefile
ncdap_test/testdata3/Makefile
ncdap_test/expected3/Makefile
ncdap_test/expectremote3/Makefile
2017-03-09 08:01:10 +08:00
dap4_test/Makefile
2018-04-22 10:10:47 +08:00
plugins/Makefile
2012-06-13 05:50:02 +08:00
],
[test -f nc-config && chmod 755 nc-config])
2018-03-17 01:46:18 +08:00
2010-06-03 21:25:25 +08:00
AC_OUTPUT()
2014-05-31 05:30:58 +08:00
2017-06-09 02:38:43 +08:00
#mv -f ${abs_top_srcdir}/test_common.sh ${abs_top_builddir}/test_common.sh
2017-06-01 05:42:59 +08:00
2014-05-31 05:30:58 +08:00
cat libnetcdf.settings