diff --git a/src/Makefile.am b/src/Makefile.am index 44cda238db7..4eaa356d1c8 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -17,6 +17,7 @@ if BUILD_NCINT NCINT = ncint endif # BUILD_NCINT -SUBDIRS = clib ${NCINT} ${GPTL} $(FLIB) +# Build these subdirectories. +SUBDIRS = ${NCINT} clib ${GPTL} $(FLIB) EXTRA_DIST = CMakeLists.txt diff --git a/src/clib/Makefile.am b/src/clib/Makefile.am index 3a1252d6d54..a938e0d867a 100644 --- a/src/clib/Makefile.am +++ b/src/clib/Makefile.am @@ -4,6 +4,11 @@ # The library we are building. lib_LTLIBRARIES = libpioc.la +# Are we building with netCDF integration? +if BUILD_NCINT +libpioc_la_LIBADD = ../ncint/libncint.la +endif # BUILD_NCINT + # These linker flags specify libtool version info. # See http://www.gnu.org/software/libtool/manual/libtool.html#Libtool-versioning # for information regarding incrementing `-version-info`. diff --git a/src/ncint/ncintdispatch.c b/src/ncint/ncintdispatch.c index 1d142e6949d..5c99ead5815 100644 --- a/src/ncint/ncintdispatch.c +++ b/src/ncint/ncintdispatch.c @@ -127,3 +127,42 @@ NC_NCINT_finalize(void) { return NC_NOERR; } + +#define TEST_VAL_42 42 +int +tst_open(const char *path, int mode, int basepe, size_t *chunksizehintp, + void *parameters, const NC_Dispatch *dispatch, NC *nc_file) +{ + return NC_NOERR; +} + +int +tst_abort(int ncid) +{ + return TEST_VAL_42; +} + +int +tst_close(int ncid, void *v) +{ + return NC_NOERR; +} + +int +tst_inq_format(int ncid, int *formatp) +{ + return TEST_VAL_42; +} + +int +tst_inq_format_extended(int ncid, int *formatp, int *modep) +{ + return TEST_VAL_42; +} + +int +tst_get_vara(int ncid, int varid, const size_t *start, const size_t *count, + void *value, nc_type t) +{ + return TEST_VAL_42; +} diff --git a/tests/ncint/Makefile.am b/tests/ncint/Makefile.am index 6092ac796b2..b7078557882 100644 --- a/tests/ncint/Makefile.am +++ b/tests/ncint/Makefile.am @@ -5,6 +5,7 @@ # Put together AM_CPPFLAGS and AM_LDFLAGS. include $(top_srcdir)/set_flags.am +LDADD = ${top_builddir}/src/clib/libpioc.la # Build the test for make check. check_PROGRAMS = tst_pio_udf diff --git a/tests/ncint/tst_pio_udf.c b/tests/ncint/tst_pio_udf.c index 5b68d34c882..4427a25fdc4 100644 --- a/tests/ncint/tst_pio_udf.c +++ b/tests/ncint/tst_pio_udf.c @@ -11,43 +11,43 @@ #define FILE_NAME "tst_pio_udf.nc" -int -tst_open(const char *path, int mode, int basepe, size_t *chunksizehintp, - void *parameters, const NC_Dispatch *dispatch, NC *nc_file) -{ - return NC_NOERR; -} - -int -tst_abort(int ncid) -{ - return TEST_VAL_42; -} - -int -tst_close(int ncid, void *v) -{ - return NC_NOERR; -} - -int -tst_inq_format(int ncid, int *formatp) -{ - return TEST_VAL_42; -} - -int -tst_inq_format_extended(int ncid, int *formatp, int *modep) -{ - return TEST_VAL_42; -} - -int -tst_get_vara(int ncid, int varid, const size_t *start, const size_t *count, - void *value, nc_type t) -{ - return TEST_VAL_42; -} +/* int */ +/* tst_open(const char *path, int mode, int basepe, size_t *chunksizehintp, */ +/* void *parameters, const NC_Dispatch *dispatch, NC *nc_file) */ +/* { */ +/* return NC_NOERR; */ +/* } */ + +/* int */ +/* tst_abort(int ncid) */ +/* { */ +/* return TEST_VAL_42; */ +/* } */ + +/* int */ +/* tst_close(int ncid, void *v) */ +/* { */ +/* return NC_NOERR; */ +/* } */ + +/* int */ +/* tst_inq_format(int ncid, int *formatp) */ +/* { */ +/* return TEST_VAL_42; */ +/* } */ + +/* int */ +/* tst_inq_format_extended(int ncid, int *formatp, int *modep) */ +/* { */ +/* return TEST_VAL_42; */ +/* } */ + +/* int */ +/* tst_get_vara(int ncid, int varid, const size_t *start, const size_t *count, */ +/* void *value, nc_type t) */ +/* { */ +/* return TEST_VAL_42; */ +/* } */ /* This is the dispatch object that holds pointers to all the * functions that make up the HDF4 dispatch interface. */ @@ -155,7 +155,7 @@ main(int argc, char **argv) if (nc_close(ncid)) ERR; /* Add our user defined format. */ - if (nc_def_user_format(NC_UDF0, &tst_dispatcher, NULL)) ERR; + if (nc_def_user_format(NC_UDF0, &NCINT_dispatcher, NULL)) ERR; /* Check that our user-defined format has been added. */ if (nc_inq_user_format(NC_UDF0, &disp_in, NULL)) ERR;