aboutsummaryrefslogtreecommitdiff
path: root/libgfortran/Makefile.am
diff options
context:
space:
mode:
authorTobias Burnus <tobias@codesourcery.com>2021-08-10 17:26:32 +0200
committerTobias Burnus <tobias@codesourcery.com>2021-08-10 17:26:32 +0200
commit2ba0376ac40447ce7ee09fcef00511c18db25dfa (patch)
treed225598b1425327a5f743877f00433ae6c3315f1 /libgfortran/Makefile.am
parent557d06f8b3ddb54bca134695e117c40c6e2267ab (diff)
downloadgcc-2ba0376ac40447ce7ee09fcef00511c18db25dfa.zip
gcc-2ba0376ac40447ce7ee09fcef00511c18db25dfa.tar.gz
gcc-2ba0376ac40447ce7ee09fcef00511c18db25dfa.tar.bz2
gfortran: Fix in-build-tree testing [PR101305, PR101660]
ISO_Fortran_binding.h is written in the build dir - hence, a previous commit added it as include directory for in-build-tree testing. However, it turned out that -I$specdir/libgfortran interferes with reading .mod files as they are then no longer regareded as intrinsic modules. Solution: Create an extra include/ directory in the libgfortran build dir and copy ISO_Fortran_binding.h to that directory. As -B$specdir/libgfortran already causes gfortran to read that include subdirectory, the -I flag is no longer needed. PR libfortran/101305 PR fortran/101660 PR testsuite/101847 libgfortran/ChangeLog: * Makefile.am (ISO_Fortran_binding.h): Create include/ in the build dir and copy the include file to it. (clean-local): Add for removing the 'include' directory. * Makefile.in: Regenerate. gcc/testsuite/ChangeLog: * lib/gfortran.exp (gfortran_init): Remove -I$specpath/libgfortran from the string used to set GFORTRAN_UNDER_TEST.
Diffstat (limited to 'libgfortran/Makefile.am')
-rw-r--r--libgfortran/Makefile.am9
1 files changed, 9 insertions, 0 deletions
diff --git a/libgfortran/Makefile.am b/libgfortran/Makefile.am
index 3546a3f..8d10432 100644
--- a/libgfortran/Makefile.am
+++ b/libgfortran/Makefile.am
@@ -1076,6 +1076,9 @@ fpu-target.inc: fpu-target.h $(srcdir)/libgfortran.h
grep '^#define GFC_FPE_' < $(top_srcdir)/../gcc/fortran/libgfortran.h > $@ || true
grep '^#define GFC_FPE_' < $(srcdir)/libgfortran.h >> $@ || true
+# Place ISO_Fortran_binding.h also under include/ in the build directory such
+# that it can be used for in-built-tree testsuite runs without interference of
+# other files in the build dir - like intrinsic .mod files or other .h files.
ISO_Fortran_binding.h: $(srcdir)/ISO_Fortran_binding-1-tmpl.h \
$(srcdir)/ISO_Fortran_binding-2-tmpl.h \
$(srcdir)/ISO_Fortran_binding-3-tmpl.h \
@@ -1085,6 +1088,9 @@ ISO_Fortran_binding.h: $(srcdir)/ISO_Fortran_binding-1-tmpl.h \
$(COMPILE) -E -dD $(srcdir)/ISO_Fortran_binding-2-tmpl.h \
| grep '^#define CFI_type' >> $@
cat $(srcdir)/ISO_Fortran_binding-3-tmpl.h >> $@
+ $(MKDIR_P) include
+ -rm -f include/ISO_Fortran_binding.h
+ cp $@ include/ISO_Fortran_binding.h
## A 'normal' build shouldn't need to regenerate these
## so we only include them in maintainer mode
@@ -1245,6 +1251,9 @@ $(gfor_misc_specifics): m4/misc_specifics.m4 m4/head.m4
## end of maintainer mode only rules
endif
+clean-local:
+ -rm -rf include
+
EXTRA_DIST = $(m4_files)
# target overrides