diff --git a/configure.ac b/configure.ac index 7ef2e9f4e..83694b9a2 100644 --- a/configure.ac +++ b/configure.ac @@ -7,8 +7,6 @@ # Recall that ${VAR-exp} expands to $VAR if var is set (even to null), # and to exp otherwise. -# $Id: configure.ac,v 1.450 2010/05/28 19:42:47 dmh Exp $ - ## 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 $]) @@ -523,14 +521,6 @@ if test "x$enable_extra_tests" = xyes; then fi AM_CONDITIONAL(EXTRA_TESTS, [test x$enable_extra_tests = xyes]) -# Does the user want to test f90 compiler. -AC_MSG_CHECKING([whether Fortran compiler(s) should be tested during configure]) -AC_ARG_ENABLE([fortran-compiler-check], - [AS_HELP_STRING([--disable-fortran-compiler-check], - [disable check of F77/F90 compiler during configure])]) -test "x$enable_fortran_compiler_check" = xno || enable_fortran_compiler_check=yes -AC_MSG_RESULT($enable_fortran_compiler_check) - # Does the user want to use the ffio module? AC_MSG_CHECKING([whether FFIO will be used]) AC_ARG_ENABLE([ffio], @@ -932,33 +922,6 @@ if test "x$nc_build_f90" = xyes; then # Set the FCLIBS flag to help with shared libraries. # AC_FC_LIBRARY_LDFLAGS # AC_F77_LIBRARY_LDFLAGS - - # Check the fortran 90 compiler to make sure it can compile a - # little test file. - if test "x$enable_fortran_compiler_check" = xyes; then - AC_MSG_CHECKING([if Fortran compiler can handle Fortran-90]) - cat <conftest.f90 - program foo - REAL, PARAMETER :: A = 3.141592654 - end program -EOF - doit='$FC ${FCFLAGS} ${FCFLAGS_f90} conftest.f90' - if AC_TRY_EVAL(doit); then - nc_ans=yes - else - nc_ans=no - if test "x$nc_build_f90" = xyes && test "x$enable_compiler_recover" = xno; then - AC_MSG_ERROR([Can't use F90 compiler, F90 API desired, and compiler recovery disabled.]) - fi - unset F90 - nc_build_f90=no - fi - rm -f conftest.* - AC_MSG_RESULT([$nc_ans]) - if test "x$nc_ans" = xno; then - AC_MSG_WARN([No F90 compiler found. F90 API will not be built.]) - fi - fi fi AC_MSG_NOTICE([finding C++ compiler (will not be used if C++ API is not desired)]) @@ -1087,38 +1050,30 @@ AC_MSG_NOTICE([checking types, headers, and functions]) AC_CHECK_HEADER(stdlib.h, ,AC_DEFINE([NO_STDLIB_H], [], [no stdlib.h])) AC_CHECK_HEADER(sys/types.h, ,AC_DEFINE([NO_SYS_TYPES_H], [], [no sys_types.h])) -AC_CHECK_HEADERS([locale.h]) +#AC_CHECK_HEADERS([locale.h]) AC_HEADER_DIRENT AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_HEADER_TIME -AC_CHECK_HEADERS([stdio.h stdarg.h errno.h ctype.h fcntl.h malloc.h stdlib.h string.h strings.h unistd.h sys/stat.h getopt.h sys/time.h sys/resource.h]) +AC_CHECK_HEADERS([locale.h stdio.h stdarg.h errno.h ctype.h fcntl.h malloc.h stdlib.h string.h \ + strings.h unistd.h sys/stat.h getopt.h sys/time.h sys/resource.h]) AC_FUNC_VPRINTF # Check for that conforms to C99 requirements AC_HEADER_STDBOOL # Check for these functions... -AC_CHECK_FUNCS([strlcat strerror snprintf strchr strrchr mktemp strcat strcpy strdup strcasecmp]) -AC_CHECK_FUNCS([strtod strtoll]) -AC_CHECK_FUNCS([getrlimit]) -AC_CHECK_FUNCS([gettimeofday]) -AC_CHECK_FUNCS([fsync]) -AC_CHECK_FUNCS([MPI_Comm_f2c]) +AC_CHECK_FUNCS([strlcat strerror snprintf strchr strrchr mktemp strcat strcpy strdup \ + strcasecmp strtod strtoll getrlimit gettimeofday fsync MPI_Comm_f2c]) AC_FUNC_ALLOCA AC_CHECK_DECLS([isnan, isinf, isfinite, signbit],,,[#include ]) #UD_CHECK_LIB_MATH -AC_CHECK_LIB([m], [floor], [], [ - AC_MSG_ERROR([Can't find or link to the math library.])]) - +AC_CHECK_LIB([m], [floor], [], [AC_MSG_ERROR([Can't find or link to the math library.])]) AC_STRUCT_ST_BLKSIZE UD_CHECK_IEEE AC_TYPE_SIZE_T AC_TYPE_OFF_T AC_CHECK_TYPES([ssize_t, ptrdiff_t, uchar, longlong]) -#AC_CHECK_TYPE(ssize_t, int) -#AC_CHECK_TYPE(ptrdiff_t, int) -#AC_CHECK_TYPE(uchar, unsigned char) AC_C_CHAR_UNSIGNED AC_C_BIGENDIAN AC_CHECK_SIZEOF(short) diff --git a/examples/CDL/Makefile.am b/examples/CDL/Makefile.am index 51a01124d..ae06ca175 100644 --- a/examples/CDL/Makefile.am +++ b/examples/CDL/Makefile.am @@ -7,7 +7,9 @@ # All we do is run two shell scripts, which create the sample files # and then compare them with the C versions of the examples. +if !BUILD_DLL TESTS = create_sample_files.sh do_comps.sh +endif # Ship the scripts needed to create the sample files and compare them. EXTRA_DIST = do_comps.sh create_sample_files.sh simple_xy.cdl \ diff --git a/ncdump/Makefile.am b/ncdump/Makefile.am index 58b13b241..6d1854740 100644 --- a/ncdump/Makefile.am +++ b/ncdump/Makefile.am @@ -4,10 +4,26 @@ # $Id: Makefile.am,v 1.147 2010/05/29 00:50:39 dmh Exp $ -AM_CPPFLAGS = -I$(top_srcdir)/include -I$(top_srcdir)/nc_test \ --I${top_srcdir}/liblib @EXTERN_CPPFLAGS@ -LDADD = -lm ${top_builddir}/liblib/libnetcdf.la @EXTERN_LDFLAGS@ +# Put together AM_CPPFLAGS and AM_LDFLAGS. +include $(top_srcdir)/lib_flags.am +LDADD = ${top_builddir}/liblib/libnetcdf.la -lm +# This is the program we're building, and it's sources. +bin_PROGRAMS = ncdump +ncdump_SOURCES = ncdump.c vardata.c dumplib.c indent.c nctime.c \ +ncdump.h vardata.h dumplib.h indent.h isnan.h nctime.h cdl.h \ +utils.h utils.c + +# Another utility program that copies any netCDF file using only the +# netCDF API +bin_PROGRAMS += nccopy +nccopy_SOURCES = nccopy.c nciter.c nciter.h chunkspec.h chunkspec.c \ +utils.h utils.c dimmap.h dimmap.c + +# This is the man page. +man_MANS = ncdump.1 nccopy.1 + +if !BUILD_DLL # These tests are run for both netCDF-4 and non-netCDF-4 builds. check_PROGRAMS = rewrite-scalar ctest ctest64 ncdump tst_utf8 TESTS = run_tests.sh tst_64bit.sh ctest ctest64 tst_output.sh \ @@ -33,6 +49,7 @@ endif # EXTRA_TESTS tst_h_rdc0_CPPFLAGS = -I${top_srcdir}/nc_test ${AM_CPPFLAGS} endif #!USE_NETCDF4 +endif #!BUILD_DLL CLEANFILES = test0.nc test1.cdl test1.nc test2.cdl ctest1.cdl ctest.c \ ctest64.c ctest0.nc ctest0_64.nc c1.cdl ctest1_64.cdl c0.nc small.nc \ @@ -50,22 +67,6 @@ tst_special_atts.cdl tst_nans.cdl tst_format_att_64.cdl \ tst_vlen_data.cdl tst_solar_1.cdl tst_format_att.cdl tst_inflated.nc \ tst_deflated.nc tst_chunking.nc tmp*.nc - -# This is the program we're building, and it's sources. -bin_PROGRAMS = ncdump -ncdump_SOURCES = ncdump.c vardata.c dumplib.c indent.c nctime.c \ -ncdump.h vardata.h dumplib.h indent.h isnan.h nctime.h cdl.h \ -utils.h utils.c - -# Another utility program that copies any netCDF file using only the -# netCDF API -bin_PROGRAMS += nccopy -nccopy_SOURCES = nccopy.c nciter.c nciter.h chunkspec.h chunkspec.c \ -utils.h utils.c dimmap.h dimmap.c - -# This is the man page. -man_MANS = ncdump.1 nccopy.1 - # These files all have to be included with the distribution. EXTRA_DIST = run_tests.sh tst_64bit.sh tst_output.sh test0.cdl \ ref_ctest1_nc4.cdl ref_ctest1_nc4c.cdl ref_tst_solar_1.cdl \ @@ -83,9 +84,8 @@ ref_tst_format_att.cdl ref_tst_format_att_64.cdl tst_nccopy3.sh \ tst_nccopy4.sh ref_nc_test_netcdf4_4_0.nc run_back_comp_tests.sh \ ref_nc_test_netcdf4.cdl ref_tst_special_atts3.cdl tst_brecs.cdl -BUILT_SOURCES = ctest.c ctest64.c - # Can't run ncgen to generate ctest.c and ctest64.c on cross-compiles. +BUILT_SOURCES = ctest.c ctest64.c if CROSS_COMPILING ctest.c: cp ref_ctest.c ctest.c @@ -106,7 +106,9 @@ EXTRA_DIST += tst_ncgen4_shared.sh tst_ncgen4.sh tst_ncgen4_classic.sh \ tst_ncgen4_diff.sh tst_ncgen4_cycle.sh ref_ctest.c ref_ctest64.c CLEANFILES += results/*.nc results/*.dmp results/*.dmp2 tmp*.cdl +if !BUILD_DLL TESTS += tst_ncgen4_classic.sh if USE_NETCDF4 TESTS += tst_ncgen4.sh endif +endif diff --git a/ncgen/Makefile.am b/ncgen/Makefile.am index 2ba417ecd..ef17da16b 100644 --- a/ncgen/Makefile.am +++ b/ncgen/Makefile.am @@ -2,24 +2,19 @@ # Copyright 2005, see the COPYRIGHT file for more information. # This file builds and runs the ncgen program. -# $Id: Makefile.am,v 1.59 2010/05/29 00:47:33 dmh Exp $ - -AM_CPPFLAGS = -I$(top_srcdir)/include -I${top_srcdir}/liblib @EXTERN_CPPFLAGS@ -LDADD = ${top_builddir}/liblib/libnetcdf.la @EXTERN_LDFLAGS@ -lm +# Put together AM_CPPFLAGS and AM_LDFLAGS. +include $(top_srcdir)/lib_flags.am +LDADD = ${top_builddir}/liblib/libnetcdf.la -lm # Build ncgen from the listed sources. bin_PROGRAMS = ncgen -ncgen_SOURCES=main.c cdata.c bindata.c genchar.c cvt.c data.c debug.c escapes.c \ -genc.c genbin.c generr.c genlib.c getfill.c odom.c offsets.c semantics.c \ -ncgentab.c \ -dump.c util.c bytebuffer.c list.c \ -data.h debug.h generr.h genlib.h includes.h ncgen.h odom.h offsets.h \ -dump.h util.h bytebuffer.h list.h \ -genf77.c f77data.c \ -genj.c jdata.c \ -nciter.h nciter.c \ -ConvertUTF.c ConvertUTF.h +ncgen_SOURCES=main.c cdata.c bindata.c genchar.c cvt.c data.c debug.c \ +escapes.c genc.c genbin.c generr.c genlib.c getfill.c odom.c offsets.c \ +semantics.c ncgentab.c dump.c util.c bytebuffer.c list.c data.h \ +debug.h generr.h genlib.h includes.h ncgen.h odom.h offsets.h dump.h \ +util.h bytebuffer.h list.h genf77.c f77data.c genj.c jdata.c nciter.h \ +nciter.c ConvertUTF.c ConvertUTF.h # This is the man page. man_MANS = ncgen.1 @@ -30,17 +25,14 @@ run_tests.sh run_nc4_tests.sh c0.cdl ref_camrun.cdl # This shell script causes ncgen to build a classic and a 64-bit # offset file from a cdl file shipped with the distribution. +if !BUILD_DLL TESTS = run_tests.sh -CLEANFILES = c0.nc c0_64.nc - if USE_NETCDF4 -# This shell script causes ncgen to build a netcdf-4 and netcdf-4 -# classic file from a cdl file shipped with the distribution. TESTS += run_nc4_tests.sh -# The nc4 tests produce these files. -CLEANFILES += c0_4.nc c0_4c.nc ref_camrun.c +endif # USE_NETCDF4 +endif # !BUILD_DLL -endif +CLEANFILES = c0.nc c0_64.nc c0_4.nc c0_4c.nc ref_camrun.c # These rule are used if someone wants to rebuild ncgenyy.c or ncgentab.c # Otherwise never invoked, but records how to do it. diff --git a/ncgen3/Makefile.am b/ncgen3/Makefile.am index 292d0b276..0b7f5972f 100644 --- a/ncgen3/Makefile.am +++ b/ncgen3/Makefile.am @@ -2,14 +2,11 @@ # Copyright 2005, see the COPYRIGHT file for more information. # This file builds and runs the ncgen program. -# $Id: Makefile.am,v 1.54 2010/05/29 00:42:11 dmh Exp $ - # Put together AM_CPPFLAGS and AM_LDFLAGS. include $(top_srcdir)/lib_flags.am -#AM_LDFLAGS = @EXTERN_LDFLAGS@ -#AM_CPPFLAGS = -I$(top_srcdir)/include -I${top_srcdir}/liblib -I${top_srcdir} @EXTERN_CFLAGS@ -LDADD = ${top_builddir}/liblib/libnetcdf.la #@EXTERN_LDFLAGS@ +# Link to the netCDF library. +LDADD = ${top_builddir}/liblib/libnetcdf.la -lm # Build ncgen from the listed sources. bin_PROGRAMS = ncgen3 @@ -19,40 +16,19 @@ genlib.c generic.h ncgen.h genlib.h ncgentab.h ncgentab.c man_MANS = ncgen3.1 # These files all need to be distributed. -EXTRA_DIST = ncgen.y ncgenyy.c ncgen.l c0.cdl run_tests.sh run_nc4_tests.sh \ - $(man_MANS) +EXTRA_DIST = ncgen.y ncgenyy.c ncgen.l c0.cdl run_tests.sh \ +run_nc4_tests.sh $(man_MANS) -# This shell script causes ncgen3 to build a classic and a 64-bit -# offset file from a cdl file shipped with the distribution. +# There is a netcdf classic and netcdf-4 test script, but don't run +# them for DLL builds. +if !BUILD_DLL TESTS = run_tests.sh - -# The tests produce these files. -CLEANFILES = c0.nc c0_64.nc - if USE_NETCDF4 - -# This shell script causes ncgen to build a netcdf-4 and netcdf-4 -# classic file from a cdl file shipped with the distribution. TESTS += run_nc4_tests.sh - -# The nc4 tests produce these files. -CLEANFILES += c0_4.nc c0_4c.nc - endif # USE_NETCDF4 +endif # !BUILD_DLL -LDADD += -lm - -# Here is the sequence of tests that need to be run: -# ./ncgen3 -b -o c0.nc c0.cdl -# ../ncdump/ncdump -n c1 c0.nc > c1.cdl -# *** ncgen3 -b test successful *** -# ./ncgen3 -c -o ctest0.nc c0.cdl > ctest.c && \ -# cc -o ctest -g -I../libsrc -I. -Df2cFortran ctest.c ../libsrc/libnetcdf.a && \ -# ./ctest && \ -# ../ncdump/ncdump -n c1 ctest0.nc > ctest1.cdl -# *** ncgen3 -c test successful *** - -test: check +CLEANFILES = c0.nc c0_64.nc c0_4.nc c0_4c.nc # This is used if someone wants to rebuild ncgenyy.c or ncgentab.c # Otherwise never invoked, but records how to do it. Don't forget to diff --git a/nf_test/Makefile.am b/nf_test/Makefile.am index f6f7e7bd5..e3fd170df 100644 --- a/nf_test/Makefile.am +++ b/nf_test/Makefile.am @@ -15,12 +15,11 @@ # The tst_f90 and f90tst_vars programs, which tests the netCDF fortran # 90 interface. (Unless F90 API is disabled). -# $Id: Makefile.am,v 1.98 2010/05/29 00:44:28 dmh Exp $ +# Put together AM_CPPFLAGS and AM_LDFLAGS. +include $(top_srcdir)/lib_flags.am LDADD = -AM_LDFLAGS = AM_CFLAGS = -AM_CPPFLAGS = -I$(top_srcdir)/include AM_FFLAGS = AM_FCFLAGS = TESTS = @@ -50,7 +49,7 @@ AM_FCFLAGS += ${AM_CPPFLAGS} if BUILD_SEPARATE_FORTRAN LDADD += ${top_builddir}/fortran/libnetcdff.la -lm endif -LDADD += ${top_builddir}/liblib/libnetcdf.la @EXTERN_LDFLAGS@ +LDADD += ${top_builddir}/liblib/libnetcdf.la if BUILD_UTILITIES # The create_fills shell creates the file fills.nc, needed by later