Skip to content

Commit cca563f

Browse files
committed
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/[email protected]
1 parent cefa387 commit cca563f

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/include/Makefile

+7-4
Original file line numberDiff line numberDiff line change
@@ -47,18 +47,21 @@ install: all installdirs
4747
$(INSTALL_DATA) utils/fmgroids.h '$(DESTDIR)$(includedir_server)/utils'
4848
$(INSTALL_DATA) utils/fmgrprotos.h '$(DESTDIR)$(includedir_server)/utils'
4949
# We don't use INSTALL_DATA for performance reasons --- there are a lot of files
50-
cp $(srcdir)/*.h '$(DESTDIR)$(includedir_server)'/ || exit; \
51-
chmod $(INSTALL_DATA_MODE) '$(DESTDIR)$(includedir_server)'/*.h || exit; \
50+
# (in fact, we have to take some pains to avoid overlength shell commands here)
51+
cp $(srcdir)/*.h '$(DESTDIR)$(includedir_server)'/
5252
for dir in $(SUBDIRS); do \
5353
cp $(srcdir)/$$dir/*.h '$(DESTDIR)$(includedir_server)'/$$dir/ || exit; \
54-
chmod $(INSTALL_DATA_MODE) '$(DESTDIR)$(includedir_server)'/$$dir/*.h || exit; \
5554
done
5655
ifeq ($(vpath_build),yes)
5756
for file in dynloader.h catalog/schemapg.h catalog/pg_*_d.h parser/gram.h storage/lwlocknames.h utils/probes.h; do \
5857
cp $$file '$(DESTDIR)$(includedir_server)'/$$file || exit; \
59-
chmod $(INSTALL_DATA_MODE) '$(DESTDIR)$(includedir_server)'/$$file || exit; \
6058
done
6159
endif
60+
cd '$(DESTDIR)$(includedir_server)' && chmod $(INSTALL_DATA_MODE) *.h
61+
for dir in $(SUBDIRS); do \
62+
cd '$(DESTDIR)$(includedir_server)'/$$dir || exit; \
63+
chmod $(INSTALL_DATA_MODE) *.h || exit; \
64+
done
6265

6366
installdirs:
6467
$(MKDIR_P) '$(DESTDIR)$(includedir)/libpq' '$(DESTDIR)$(includedir_internal)/libpq'

0 commit comments

Comments
 (0)