From 375beee9f15df39b875fafeca3ee7a34da0f8ab6 Mon Sep 17 00:00:00 2001 From: Ward Fisher Date: Tue, 1 Feb 2022 11:40:01 -0700 Subject: [PATCH] Cleaning up make dist, it's generating tarballs that don't work with cmake. --- CMakeLists.txt | 4 +++- Makefile.am | 2 +- fuzz/CMakeLists.txt | 8 ++++++++ fuzz/Makefile.am | 15 +++++++++++++++ libnczarr/Makefile.am | 1 - nc_test4/Makefile.am | 3 ++- nczarr_test/Makefile.am | 2 +- 7 files changed, 30 insertions(+), 5 deletions(-) create mode 100644 fuzz/Makefile.am diff --git a/CMakeLists.txt b/CMakeLists.txt index 9d708c7ce2..b90a7ceb61 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -2460,7 +2460,9 @@ IF(ENABLE_TESTS) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/ncdap_test/pingurl.c ${CMAKE_CURRENT_BINARY_DIR}/dap4_test/pingurl4.c @ONLY NEWLINE_STYLE LF) ENDIF() -add_subdirectory(fuzz) +if(DEFINED ENV{LIB_FUZZING_ENGINE}) + add_subdirectory(fuzz) +endif(DEFINED ENV{LIB_FUZZING_ENGINE}) #### # Export files diff --git a/Makefile.am b/Makefile.am index 798f0dd269..d0efa842f8 100644 --- a/Makefile.am +++ b/Makefile.am @@ -16,7 +16,7 @@ cmake CMakeLists.txt COMPILE.cmake.txt config.h.cmake.in \ cmake_uninstall.cmake.in FixBundle.cmake.in nc-config.cmake.in \ RELEASE_NOTES.md CTestCustom.cmake CTestConfig.cmake.in \ libnetcdf.settings.in netCDFConfig.cmake.in CMakeInstallation.cmake \ -test-driver-verbose test_common.in +test-driver-verbose test_common.in fuzz pkgconfigdir = $(libdir)/pkgconfig pkgconfig_DATA = netcdf.pc diff --git a/fuzz/CMakeLists.txt b/fuzz/CMakeLists.txt index abfc4719d1..a1b1290990 100644 --- a/fuzz/CMakeLists.txt +++ b/fuzz/CMakeLists.txt @@ -1,3 +1,11 @@ +# This is part of the netCDF package. +# Copyright 2022 University Corporation for Atmospheric Research/Unidata +# See COPYRIGHT file for conditions of use. +# +# Added for fuzzing in https://github.com/Unidata/netcdf-c/pull/1972 +# +# @authors Ward Fisher + if(DEFINED ENV{LIB_FUZZING_ENGINE}) add_executable(fuzz_open fuzz_open.c) target_link_libraries(fuzz_open netcdf $ENV{LIB_FUZZING_ENGINE}) diff --git a/fuzz/Makefile.am b/fuzz/Makefile.am new file mode 100644 index 0000000000..26815e736c --- /dev/null +++ b/fuzz/Makefile.am @@ -0,0 +1,15 @@ +# This is part of the netCDF package. +# Copyright 2022 University Corporation for Atmospheric Research/Unidata +# See COPYRIGHT file for conditions of use. +# +# @authors Ward Fisher + +# Set AM_CPPFLAGS and AM_LDFLAGS based on user choices. +include $(top_srcdir)/lib_flags.am + +#if(DEFINED ENV{LIB_FUZZING_ENGINE}) +# add_executable(fuzz_open fuzz_open.c) +# target_link_libraries(fuzz_open netcdf $ENV{LIB_FUZZING_ENGINE}) +#endif() + +EXTRA_DIST = fuzz.c fuzz_open.c \ No newline at end of file diff --git a/libnczarr/Makefile.am b/libnczarr/Makefile.am index 22720653f8..f5950fd847 100644 --- a/libnczarr/Makefile.am +++ b/libnczarr/Makefile.am @@ -55,7 +55,6 @@ zarr.h \ zcache.h \ zchunking.h \ zdispatch.h \ -ztracedispatch.h \ zincludes.h \ zinternal.h \ zmap.h \ diff --git a/nc_test4/Makefile.am b/nc_test4/Makefile.am index c8c3a0c61f..f853cd81e0 100644 --- a/nc_test4/Makefile.am +++ b/nc_test4/Makefile.am @@ -104,7 +104,8 @@ ref_filteredvv.cdl ref_multi.cdl \ ref_ncgenF.cdl ref_nccopyF.cdl \ ref_filter_repeat.txt ref_fillonly.cdl test_fillonly.sh \ ref_filter_order_create.txt ref_filter_order_read.txt \ -ref_any.cdl tst_specific_filters.sh +ref_any.cdl tst_specific_filters.sh \ +tst_virtual_datasets.c CLEANFILES = tst_mpi_parallel.bin cdm_sea_soundings.nc bm_chunking.nc \ tst_floats_1D.cdl floats_1D_3.nc floats_1D.cdl tst_*.nc tmp_*.txt \ diff --git a/nczarr_test/Makefile.am b/nczarr_test/Makefile.am index b466a68510..1249598a62 100644 --- a/nczarr_test/Makefile.am +++ b/nczarr_test/Makefile.am @@ -151,7 +151,7 @@ ref_groups.h5 ref_byte.zarr.zip ref_byte_fill_value_null.zarr.zip \ ref_groups_regular.cdl ref_byte.cdl ref_byte_fill_value_null.cdl # Interoperability files -EXTRA_DIST += ref_power_901_constants.zip ref_power_901_constants.cdl ref_quotes.zip ref_quotes.cdl ref_zarr_test_data.cdl.gz +EXTRA_DIST += ref_power_901_constants.zip ref_power_901_constants.cdl ref_quotes.zip ref_quotes.cdl CLEANFILES = ut_*.txt ut*.cdl tmp*.nc tmp*.cdl tmp*.txt tmp*.dmp tmp*.zip tmp*.nc tmp*.dump tmp*.tmp tmp_ngc.c ref_zarr_test_data.cdl