diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2018-04-08 15:08:32 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2018-04-08 15:08:32 -0400 |
commit | cca563f38422f2a7c6c56f162efe2689bf1c7697 (patch) | |
tree | 5e7bd4f97bb870eba51813966267effb3dc1b865 /src | |
parent | cefa3871534d2c467a520820c0ae3f002a46d8e4 (diff) | |
download | postgresql-cca563f38422f2a7c6c56f162efe2689bf1c7697.tar.gz postgresql-cca563f38422f2a7c6c56f162efe2689bf1c7697.zip |
Reduce worst-case shell command line length during "make install".
Addition of the catalog/pg_foo_d.h headers seems to have pushed us over
the brink of the maximum command line length for some older platforms
during "make install" for our header files. The main culprit here is
repetition of the target directory path, which could be long.
Rearrange so that we don't repeat that once per file, but only once
per subdirectory.
Per buildfarm.
Discussion: https://postgr.es/m/E1f5Dwm-0004n5-7O@gemulon.postgresql.org
Diffstat (limited to 'src')
-rw-r--r-- | src/include/Makefile | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/include/Makefile b/src/include/Makefile index 59e18c73d71..19d2524e531 100644 --- a/src/include/Makefile +++ b/src/include/Makefile @@ -47,18 +47,21 @@ install: all installdirs $(INSTALL_DATA) utils/fmgroids.h '$(DESTDIR)$(includedir_server)/utils' $(INSTALL_DATA) utils/fmgrprotos.h '$(DESTDIR)$(includedir_server)/utils' # We don't use INSTALL_DATA for performance reasons --- there are a lot of files - cp $(srcdir)/*.h '$(DESTDIR)$(includedir_server)'/ || exit; \ - chmod $(INSTALL_DATA_MODE) '$(DESTDIR)$(includedir_server)'/*.h || exit; \ +# (in fact, we have to take some pains to avoid overlength shell commands here) + cp $(srcdir)/*.h '$(DESTDIR)$(includedir_server)'/ for dir in $(SUBDIRS); do \ cp $(srcdir)/$$dir/*.h '$(DESTDIR)$(includedir_server)'/$$dir/ || exit; \ - chmod $(INSTALL_DATA_MODE) '$(DESTDIR)$(includedir_server)'/$$dir/*.h || exit; \ done ifeq ($(vpath_build),yes) for file in dynloader.h catalog/schemapg.h catalog/pg_*_d.h parser/gram.h storage/lwlocknames.h utils/probes.h; do \ cp $$file '$(DESTDIR)$(includedir_server)'/$$file || exit; \ - chmod $(INSTALL_DATA_MODE) '$(DESTDIR)$(includedir_server)'/$$file || exit; \ done endif + cd '$(DESTDIR)$(includedir_server)' && chmod $(INSTALL_DATA_MODE) *.h + for dir in $(SUBDIRS); do \ + cd '$(DESTDIR)$(includedir_server)'/$$dir || exit; \ + chmod $(INSTALL_DATA_MODE) *.h || exit; \ + done installdirs: $(MKDIR_P) '$(DESTDIR)$(includedir)/libpq' '$(DESTDIR)$(includedir_internal)/libpq' |