Avoid building fortran modules twice, just install them instead. https://bugs.gentoo.org/296174 --- netcdf-4.1.1/f90/Makefile.am +++ netcdf-4.1.1/f90/Makefile.am @@ -101,17 +101,25 @@ # Some fortran compilers change the file names of .mod files to all # uppercase. Just to be special. if UPPER_CASE_MOD -nodist_include_HEADERS = TYPESIZES.mod NETCDF.mod -TYPESIZES.mod: typeSizes.o -NETCDF.mod: $(NETCDF_O) -BUILT_SOURCES = TYPESIZES.mod +NETCDF_MODULES = TYPESIZES.mod NETCDF.mod else -nodist_include_HEADERS = typesizes.mod netcdf.mod -typesizes.mod: typeSizes.o -netcdf.mod: $(NETCDF_O) -BUILT_SOURCES = typesizes.mod +NETCDF_MODULES = typesizes.mod netcdf.mod endif +NETCDF_LO := $(NETCDF_O:.o=.lo) +$(NETCDF_LO): typeSizes.o +install-data-local: + test -z "$(includedir)" || $(MKDIR_P) "$(DESTDIR)$(includedir)" + @list='$(NETCDF_MODULES)'; test -n "$(includedir)" || list=; \ + for p in $$list; do \ + if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \ + echo "$$d$$p"; \ + done | $(am__base_list) | \ + while read files; do \ + echo " $(INSTALL_HEADER) $$files '$(DESTDIR)$(includedir)'"; \ + $(INSTALL_HEADER) $$files "$(DESTDIR)$(includedir)" || exit $$?; \ + done + # This is what we are building: a convenience library of F90 functions. noinst_LTLIBRARIES = libnetcdff90.la