Skip to content

Commit de72019

Browse files
committed
pythongh-100221: Fix creating dirs in make sharedinstall
Fix creating install directories in `make sharedinstall` if they exist already outside `DESTDIR`. The previous make rules assumed that the directories would be created via a dependency on a rule for `$(DESTSHARED)` that did not fire if the directory did exist outside `$(DESTDIR)`. While technically `$(DESTDIR)` could be prepended to the rule name, moving the rules for creating directories straight into the `sharedinstall` rule seems to fit the common practices better. Since the rule explicitly checks whether the individual directories exist anyway, there seems to be no reason to rely on make determining that implicitly as well.
1 parent 0fe61d0 commit de72019

File tree

3 files changed

+12
-12
lines changed

3 files changed

+12
-12
lines changed

Makefile.pre.in

Lines changed: 9 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,15 @@ commoninstall: check-clean-src @FRAMEWORKALTINSTALLFIRST@ \
18031803
# Install shared libraries enabled by Setup
18041804
DESTDIRS= $(exec_prefix) $(LIBDIR) $(BINLIBDEST) $(DESTSHARED)
18051805

1806-
sharedinstall: $(DESTSHARED) all
1806+
sharedinstall: all
1807+
@for i in $(DESTDIRS); \
1808+
do \
1809+
if test ! -d $(DESTDIR)$$i; then \
1810+
echo "Creating directory $$i"; \
1811+
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
1812+
else true; \
1813+
fi; \
1814+
done
18071815
@for i in X $(SHAREDMODS); do \
18081816
if test $$i != X; then \
18091817
echo $(INSTALL_SHARED) $$i $(DESTSHARED)/`basename $$i`; \
@@ -1815,17 +1823,6 @@ sharedinstall: $(DESTSHARED) all
18151823
fi; \
18161824
done
18171825

1818-
1819-
$(DESTSHARED):
1820-
@for i in $(DESTDIRS); \
1821-
do \
1822-
if test ! -d $(DESTDIR)$$i; then \
1823-
echo "Creating directory $$i"; \
1824-
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$$i; \
1825-
else true; \
1826-
fi; \
1827-
done
1828-
18291826
# Install the interpreter with $(VERSION) affixed
18301827
# This goes into $(exec_prefix)
18311828
altbininstall: $(BUILDPYTHON) @FRAMEWORKPYTHONW@

Misc/ACKS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ Tiago Gonçalves
640640
Chris Gonnerman
641641
Shelley Gooch
642642
David Goodger
643+
Michał Górny
643644
Elliot Gorokhovsky
644645
Hans de Graaff
645646
Tim Graham
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Fix creating install directories in ``make sharedinstall`` if they exist
2+
outside ``DESTDIR`` already.

0 commit comments

Comments
 (0)