summaryrefslogtreecommitdiff
blob: 22708e2201e9164d5a518b8df1cde23e4b7502c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
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