mirror of
https://github.com/Unidata/netcdf-c.git
synced 2025-01-24 16:04:40 +08:00
Initial version of template header file.
This commit is contained in:
parent
2c6b2d8c5e
commit
45f9f153c0
@ -395,22 +395,32 @@ ENDMACRO()
|
||||
# A function used to create autotools-style 'yes/no' definitions.
|
||||
# If a variable is set, it 'yes' is returned. Otherwise, 'no' is
|
||||
# returned.
|
||||
#
|
||||
# Also creates a version of the ret_val appended with 'BOOL',
|
||||
# when feature is true, which is used to generate netcdf_meta.h.
|
||||
FUNCTION(is_enabled feature ret_val)
|
||||
IF(${feature})
|
||||
SET(${ret_val} "yes" PARENT_SCOPE)
|
||||
SET("${ret_val}_BOOL" 1 PARENT_SCOPE)
|
||||
ELSE()
|
||||
SET(${ret_val} "no" PARENT_SCOPE)
|
||||
SET("${ret_val}_BOOL" 0 PARENT_SCOPE)
|
||||
ENDIF(${feature})
|
||||
ENDFUNCTION()
|
||||
|
||||
# A function used to create autotools-style 'yes/no' definitions.
|
||||
# If a variable is set, it 'yes' is returned. Otherwise, 'no' is
|
||||
# returned.
|
||||
#
|
||||
# Also creates a version of the ret_val appended with 'BOOL',
|
||||
# when feature is true, which is used to generate netcdf_meta.h.
|
||||
FUNCTION(is_disabled feature ret_val)
|
||||
IF(${feature})
|
||||
SET(${ret_val} "no" PARENT_SCOPE)
|
||||
SET("${ret_val}_BOOL" 0 PARENT_SCOPE)
|
||||
ELSE()
|
||||
SET(${ret_val} "yes" PARENT_SCOPE)
|
||||
SET("${ret_val}_BOOL" 1 PARENT_SCOPE)
|
||||
ENDIF(${feature})
|
||||
ENDFUNCTION()
|
||||
|
||||
@ -1402,6 +1412,16 @@ INSTALL(FILES "${netCDF_BINARY_DIR}/libnetcdf.settings"
|
||||
# End libnetcdf.settings section.
|
||||
#####
|
||||
|
||||
#####
|
||||
# Create 'netcdf_meta.h' include file.
|
||||
#####
|
||||
configure_file(
|
||||
${netCDF_SOURCE_DIR}/include/netcdf_meta.h.in
|
||||
${netCDF_BINARY_DIR}/include/netcdf_meta.h @ONLY)
|
||||
|
||||
|
||||
|
||||
|
||||
####
|
||||
# Export files
|
||||
####
|
||||
|
75
configure.ac
75
configure.ac
@ -5,16 +5,16 @@
|
||||
# the COPYRIGHT file for more information.
|
||||
|
||||
# Recall that ${VAR-exp} expands to $VAR if var is set (even to null),
|
||||
# and to exp otherwise.
|
||||
# and to exp otherwise.
|
||||
|
||||
## 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 $])
|
||||
|
||||
# Running autoconf on this file will trigger a warning if
|
||||
# Running autoconf on this file will trigger a warning if
|
||||
# autoconf is not at least the specified version.
|
||||
AC_PREREQ([2.59])
|
||||
|
||||
# Initialize with name, version, and support email address.
|
||||
# Initialize with name, version, and support email address.
|
||||
AC_INIT([netCDF], [4.3.3-rc2], [support-netcdf@unidata.ucar.edu])
|
||||
|
||||
|
||||
@ -79,7 +79,7 @@ AC_ARG_ENABLE([doxygen],
|
||||
[AS_HELP_STRING([--enable-doxygen],
|
||||
[Enable generation of documentation.])])
|
||||
test "x$enable_doxygen" = xyes || enable_doxygen=no
|
||||
AM_CONDITIONAL([BUILD_DOCS], [test "x$enable_doxygen" = xyes])
|
||||
AM_CONDITIONAL([BUILD_DOCS], [test "x$enable_doxygen" = xyes])
|
||||
|
||||
AC_ARG_ENABLE([dot],
|
||||
[AS_HELP_STRING([--enable-dot],
|
||||
@ -90,7 +90,7 @@ 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.])])
|
||||
test "x$enable_internal_docs" = xyes || enable_internal_docs=no
|
||||
AC_SUBST([BUILD_INTERNAL_DOCS], [$enable_internal_docs])
|
||||
AC_SUBST([BUILD_INTERNAL_DOCS], [$enable_internal_docs])
|
||||
|
||||
AC_MSG_CHECKING([if fsync support is enabled])
|
||||
AC_ARG_ENABLE([fsync],
|
||||
@ -119,7 +119,7 @@ AC_DEFINE([JNA], [1], [if true, include jna bug workaround code])
|
||||
fi
|
||||
|
||||
# Does the user want to run extra tests with valgrind?
|
||||
AC_MSG_CHECKING([whether extra valgrind tests should be run])
|
||||
AC_MSG_CHECKING([whether extra valgrind tests should be run])
|
||||
AC_ARG_ENABLE([valgrind-tests],
|
||||
[AS_HELP_STRING([--enable-valgrind-tests],
|
||||
[build with valgrind-tests (valgrind is required, static builds only)])])
|
||||
@ -252,7 +252,7 @@ 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. \
|
||||
Ignored if netCDF-4 is not enabled.])])
|
||||
Ignored if netCDF-4 is not enabled.])])
|
||||
test "x$enable_logging" = xyes || enable_logging=no
|
||||
AC_MSG_RESULT([$enable_logging])
|
||||
|
||||
@ -417,8 +417,8 @@ AM_CONDITIONAL(USE_FFIO, [test x$enable_ffio = xyes])
|
||||
dnl AC_MSG_CHECKING([whether netCDF NEC-SX vectorization patch is enabled])
|
||||
dnl AC_ARG_ENABLE([sx-vectorization],
|
||||
dnl [AS_HELP_STRING([--enable-sx-vectorization],
|
||||
dnl [enable a user-provided performance patch to allow \
|
||||
dnl vectorization of type conversions on NEC SX machines.])])
|
||||
dnl [enable a user-provided performance patch to allow \
|
||||
dnl vectorization of type conversions on NEC SX machines.])])
|
||||
dnl test "x$enable_sx_vectorization" = xyes || enable_sx_vectorization=no
|
||||
dnl AC_MSG_RESULT([$enable_sx_vectorization])
|
||||
dnl if test "x$enable_sx_vectorization" = xyes; then
|
||||
@ -491,8 +491,8 @@ fi
|
||||
AC_MSG_CHECKING([whether benchmaks should be run (experimental)])
|
||||
AC_ARG_ENABLE([benchmarks],
|
||||
[AS_HELP_STRING([--enable-benchmarks],
|
||||
[Run benchmarks. This is an experimental feature. You must fetch
|
||||
sample data files from the Unidata ftp site to use these benchmarks.
|
||||
[Run benchmarks. This is an experimental feature. You must fetch
|
||||
sample data files from the Unidata ftp site to use these benchmarks.
|
||||
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
|
||||
@ -511,7 +511,7 @@ case "$host_cpu $host_os" in
|
||||
*)
|
||||
test "x$enable_extreme_numbers" = xno || enable_extreme_numbers=yes
|
||||
;;
|
||||
esac
|
||||
esac
|
||||
AC_MSG_RESULT($enable_extreme_numbers)
|
||||
|
||||
if test "x$enable_extreme_numbers" = xyes; then
|
||||
@ -640,11 +640,11 @@ AC_MSG_NOTICE([finding other utilities])
|
||||
|
||||
# Is doxygen installed? If so, have configure construct the Doxyfile.
|
||||
AC_CHECK_PROGS([DOXYGEN], [doxygen])
|
||||
if test -z "$DOXYGEN"; then
|
||||
if test -z "$DOXYGEN"; then
|
||||
AC_MSG_WARN([Doxygen not found - documentation will not be built])
|
||||
fi
|
||||
|
||||
# Is graphviz/dot installed? If so, we'll use dot to create
|
||||
# Is graphviz/dot installed? If so, we'll use dot to create
|
||||
# graphs in the documentation.
|
||||
AC_CHECK_PROGS([DOT], [dot])
|
||||
if test -z "$DOT"; then
|
||||
@ -652,13 +652,13 @@ if test -z "$DOT"; then
|
||||
HAVE_DOT=NO
|
||||
elif test "x$enable_dot" = xno; then
|
||||
HAVE_DOT=NO
|
||||
else
|
||||
else
|
||||
HAVE_DOT=YES
|
||||
fi
|
||||
fi
|
||||
# If we have doxygen, and it's enabled, then process the file.
|
||||
if test "x$enable_doxygen" != xno; then
|
||||
if test -n "$DOXYGEN"; then
|
||||
AC_SUBST(HAVE_DOT)
|
||||
AC_SUBST(HAVE_DOT)
|
||||
AC_CONFIG_FILES([docs/Doxyfile
|
||||
docs/Doxyfile.guide
|
||||
docs/Doxyfile.tutorial])
|
||||
@ -781,7 +781,7 @@ if test "x$enable_netcdf_4" = xyes || test "x$enable_dap" = xyes; then
|
||||
fi
|
||||
|
||||
# We need the math library
|
||||
AC_CHECK_LIB([m], [floor], [],
|
||||
AC_CHECK_LIB([m], [floor], [],
|
||||
[AC_MSG_ERROR([Can't find or link to the math library.])])
|
||||
|
||||
if test "x$enable_netcdf_4" = xyes; then
|
||||
@ -798,14 +798,14 @@ if test "x$enable_netcdf_4" = xyes; then
|
||||
AC_CHECK_LIB([dl],[dlopen], [], [AC_MSG_ERROR([Can't find or link against libdf. See config.log for errors.])])
|
||||
AC_DEFINE([USE_LIBDL],[1], [if true, enable dynamic loading support])
|
||||
fi
|
||||
|
||||
|
||||
# Check for the main hdf5 and hdf5_hl library.
|
||||
|
||||
AC_SEARCH_LIBS([H5Fflush], [hdf5dll hdf5], [],
|
||||
AC_SEARCH_LIBS([H5Fflush], [hdf5dll hdf5], [],
|
||||
[AC_MSG_ERROR([Can't find or link to the hdf5 library. Use --disable-netcdf-4, or see config.log for errors.])])
|
||||
AC_SEARCH_LIBS([H5DSis_scale], [hdf5_hldll hdf5_hl], [],
|
||||
AC_SEARCH_LIBS([H5DSis_scale], [hdf5_hldll hdf5_hl], [],
|
||||
[AC_MSG_ERROR([Can't find or link to the hdf5 high-level. Use --disable-netcdf-4, or see config.log for errors.])])
|
||||
|
||||
|
||||
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.])])
|
||||
AC_CHECK_FUNCS([H5Pget_fapl_mpiposix H5Pget_fapl_mpio H5Pset_deflate H5Z_SZIP])
|
||||
|
||||
@ -813,7 +813,7 @@ if test "x$enable_netcdf_4" = xyes; then
|
||||
if test "x$ac_cv_func_H5Pget_fapl_mpiposix" = xyes; then
|
||||
AC_DEFINE([USE_PARALLEL_POSIX], [1], [if true, compile in parallel netCDF-4 based on MPI/POSIX])
|
||||
fi
|
||||
|
||||
|
||||
# The user may have parallel HDF5 based on MPI mumble mumble.
|
||||
if test "x$ac_cv_func_H5Pget_fapl_mpio" = xyes; then
|
||||
AC_DEFINE([USE_PARALLEL_MPIO], [1], [if true, compile in parallel netCDF-4 based on MPI/IO])
|
||||
@ -825,14 +825,14 @@ if test "x$enable_netcdf_4" = xyes; then
|
||||
enable_parallel=yes
|
||||
AC_DEFINE([USE_PARALLEL], [1], [if true, parallel netCDF-4 is in use])
|
||||
fi
|
||||
|
||||
|
||||
AC_MSG_CHECKING([whether parallel I/O features are to be included])
|
||||
AC_MSG_RESULT([$enable_parallel])
|
||||
|
||||
AC_MSG_RESULT([$enable_parallel])
|
||||
|
||||
# The user must have built HDF5 with the ZLIB library.
|
||||
if test "x$ac_cv_func_H5Pset_deflate" = xyes; then
|
||||
AC_DEFINE([USE_ZLIB], [1], [if true, compile in zlib compression in netCDF-4 variables])
|
||||
else
|
||||
else
|
||||
AC_MSG_ERROR([HDF5 must be built with zlib for netCDF-4])
|
||||
fi
|
||||
|
||||
@ -844,13 +844,13 @@ if test "x$enable_netcdf_4" = xyes; then
|
||||
|
||||
# If the user wants hdf4 built in, check it out.
|
||||
if test "x$enable_hdf4" = xyes; then
|
||||
AC_CHECK_HEADERS([mfhdf.h], [], [nc_mfhdf_h_missing=yes])
|
||||
AC_CHECK_HEADERS([mfhdf.h], [], [nc_mfhdf_h_missing=yes])
|
||||
if test "x$nc_mfhdf_h_missing" = xyes; then
|
||||
AC_MSG_ERROR([Cannot find mfhdf.h, yet --enable-hdf4 was used.])
|
||||
fi
|
||||
fi
|
||||
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.])])
|
||||
|
||||
|
||||
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.])])
|
||||
|
||||
AC_DEFINE([USE_HDF4], [1], [if true, use HDF4 too])
|
||||
@ -867,7 +867,7 @@ fi
|
||||
|
||||
# Using pnetcdf for classic parallel I/O?
|
||||
if test "x$enable_pnetcdf" = xyes; then
|
||||
AC_CHECK_LIB([pnetcdf], [ncmpi_create], [],
|
||||
AC_CHECK_LIB([pnetcdf], [ncmpi_create], [],
|
||||
[AC_MSG_ERROR([Cannot link to pnetcdf library, yet --enable-pnetcdf was used.])])
|
||||
AC_DEFINE([USE_PNETCDF], [1], [if true, parallel netCDF is used])
|
||||
|
||||
@ -927,7 +927,7 @@ AM_CONDITIONAL(USE_PNETCDF, [test x$enable_pnetcdf = xyes])
|
||||
AM_CONDITIONAL(USE_DISPATCH, [test x$enable_dispatch = xyes])
|
||||
AM_CONDITIONAL(BUILD_CDMREMOTE, [test "x$enable_cdmremote" = xyes]) # Alias
|
||||
AM_CONDITIONAL(BUILD_RPC, [test "x$enable_rpc" = xyes])
|
||||
AM_CONDITIONAL(BUILD_DISKLESS, [test x$enable_diskless = xyes])
|
||||
AM_CONDITIONAL(BUILD_DISKLESS, [test x$enable_diskless = xyes])
|
||||
AM_CONDITIONAL(BUILD_MMAP, [test x$enable_mmap = xyes])
|
||||
|
||||
# If the machine doesn't have a long long, and we want netCDF-4, then
|
||||
@ -962,17 +962,17 @@ AC_MSG_RESULT([$LIBS])
|
||||
# Flags for nc-config script; by design $prefix, $includir, $libdir,
|
||||
# etc. are left as shell variables in the script so as to facilitate
|
||||
# relocation
|
||||
if test "x$with_netcdf_c_lib" = x ; then
|
||||
if test "x$with_netcdf_c_lib" = x ; then
|
||||
NC_LIBS="-lnetcdf"
|
||||
else
|
||||
NC_LIBS="$with_netcdf_c_lib"
|
||||
fi
|
||||
if test "x$enable_shared" != xyes; then
|
||||
NC_LIBS="$LDFLAGS $NC_LIBS $LIBS"
|
||||
fi
|
||||
fi
|
||||
|
||||
case "x$target_os" in
|
||||
xsolaris*)
|
||||
xsolaris*)
|
||||
NEWNCLIBS=""
|
||||
for x in $NC_LIBS ; do
|
||||
case "$x" in
|
||||
@ -1032,7 +1032,7 @@ AH_BOTTOM([#include "ncconfigure.h"])
|
||||
# debugging purposes.
|
||||
# cp confdefs.h my_config.h
|
||||
|
||||
# Create output variables from various
|
||||
# Create output variables from various
|
||||
# shell variables, for use in generating
|
||||
# libnetcdf.settings.
|
||||
AC_SUBST([enable_shared])
|
||||
@ -1050,7 +1050,8 @@ AC_MSG_NOTICE([generating header files and makefiles])
|
||||
AC_CONFIG_FILES([Makefile
|
||||
nc-config
|
||||
netcdf.pc
|
||||
libnetcdf.settings
|
||||
libnetcdf.settings
|
||||
include/netcdf_meta.h
|
||||
include/Makefile
|
||||
h5_test/Makefile
|
||||
docs/Makefile
|
||||
|
19
include/netcdf_meta.h.in
Normal file
19
include/netcdf_meta.h.in
Normal file
@ -0,0 +1,19 @@
|
||||
/*! Meta information for libnetcdf.
|
||||
|
||||
This file is automatically generated by the build system
|
||||
at configure time, and contains information related to
|
||||
how libnetcdf was built.
|
||||
*/
|
||||
|
||||
#ifndef NETCDF_META_H
|
||||
#define NETCDF_META_H
|
||||
|
||||
#define NC_VERSION @PACKAGE_VERSION@
|
||||
|
||||
|
||||
|
||||
#define NC_HAS_NC2 @HAS_NC2_BOOL@ @HAS_NC2@
|
||||
#define NC_HAS_NC4 @HAS_NC4_BOOL@ @HAS_NC4@
|
||||
#define NC_HAS_HDF4 @HAS_HDF4_BOOL@ @HAS_HDF4@
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user