8000 Install mimalloc header only when enabled · python/cpython@78c228b · GitHub
[go: up one dir, main page]

Skip to content

Commit 78c228b

Browse files
committed
Install mimalloc header only when enabled
1 parent deef17c commit 78c228b

File tree

3 files changed

+19
-12
lines changed

3 files changed

+19
-12
lines changed

Makefile.pre.in

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,9 @@ LIBHACL_SHA2_A= Modules/_hacl/libHacl_Hash_SHA2.a
227227
# Default zoneinfo.TZPATH. Added here to expose it in sysconfig.get_config_var
228228
TZPATH=@TZPATH@
229229

230+
# If to install mimalloc headers
231+
WITH_MIMALLOC=@WITH_MIMALLOC@
232+
230233
# Modes for directories, executables and data files created by the
231234
# install process. Default to user-only-writable for all file types.
232235
DIRMODE= 755
@@ -2581,10 +2584,11 @@ inclinstall:
25812584
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/internal; \
25822585
else true; \
25832586
fi
2584-
@if test ! -d $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc; then \
2585-
echo "Creating directory $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc"; \
2586-
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc; \
2587-
else true; \
2587+
@if test "$(WITH_MIMALLOC)" == "yes"; then \
2588+
if test ! -d $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc; then \
2589+
echo "Creating directory $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc"; \
2590+
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc; \
2591+
fi; \
25882592
fi
25892593
@for i in $(srcdir)/Include/*.h; \
25902594
do \
@@ -2601,13 +2605,15 @@ inclinstall:
26012605
echo $(INSTALL_DATA) $$i $(INCLUDEPY)/internal; \
26022606
$(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/internal; \
26032607
done
2604-
echo $(INSTALL_DATA) $(srcdir)/Include/internal/mimalloc/mimalloc.h $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc.h
2605-
$(INSTALL_DATA) $(srcdir)/Include/internal/mimalloc/mimalloc.h $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc.h
2606-
@for i in $(srcdir)/Include/internal/mimalloc/mimalloc/*.h; \
2607-
do \
2608-
echo $(INSTALL_DATA) $$i $(INCLUDEPY)/internal/mimalloc/mimalloc; \
2609-
$(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc; \
2610-
done
2608+
@if test "$(WITH_MIMALLOC)" == "yes"; then \
2609+
echo $(INSTALL_DATA) $(srcdir)/Include/internal/mimalloc/mimalloc.h $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc.h; \
2610+
$(INSTALL_DATA) $(srcdir)/Include/internal/mimalloc/mimalloc.h $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc.h; \
2611+
for i in $(srcdir)/Include/internal/mimalloc/mimalloc/*.h; \
2612+
do \
2613+
echo $(INSTALL_DATA) $$i $(INCLUDEPY)/internal/mimalloc/mimalloc; \
2614+
$(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc; \
2615+
done; \
2616+
fi
26112617
echo $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
26122618
$(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
26132619

configure

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

configure.ac

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4752,7 +4752,7 @@ elif test "$disable_gil" = "yes"; then
47524752
fi
47534753

47544754
AC_MSG_RESULT([$with_mimalloc])
4755-
AC_SUBST([WITH_MIMALLOC])
4755+
AC_SUBST([WITH_MIMALLOC], $with_mimalloc)
47564756
AC_SUBST([MIMALLOC_HEADERS])
47574757

47584758
# Check for Python-specific malloc support

0 commit comments

Comments
 (0)
0