Skip to content

Commit e17cd1f

Browse files
authored
gh-116984: Install mimalloc headers (#116985)
- Install mimalloc header only when enabled - Rename WITH_MIMALLOC to INSTALL_MIMALLOC
1 parent 456c29c commit e17cd1f

File tree

3 files changed

+22
-2
lines changed

3 files changed

+22
-2
lines changed

Makefile.pre.in

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -233,6 +233,9 @@ LIBHACL_SHA2_A= Modules/_hacl/libHacl_Hash_SHA2.a
233233
# Default zoneinfo.TZPATH. Added here to expose it in sysconfig.get_config_var
234234
TZPATH=@TZPATH@
235235

236+
# If to install mimalloc headers
237+
INSTALL_MIMALLOC=@INSTALL_MIMALLOC@
238+
236239
# Modes for directories, executables and data files created by the
237240
# install process. Default to user-only-writable for all file types.
238241
DIRMODE= 755
@@ -2616,6 +2619,12 @@ inclinstall:
26162619
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/internal; \
26172620
else true; \
26182621
fi
2622+
@if test "$(INSTALL_MIMALLOC)" == "yes"; then \
2623+
if test ! -d $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc; then \
2624+
echo "Creating directory $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc"; \
2625+
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc; \
2626+
fi; \
2627+
fi
26192628
@for i in $(srcdir)/Include/*.h; \
26202629
do \
26212630
echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
@@ -2631,6 +2640,16 @@ inclinstall:
26312640
echo $(INSTALL_DATA) $$i $(INCLUDEPY)/internal; \
26322641
$(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/internal; \
26332642
done
2643+
@if test "$(INSTALL_MIMALLOC)" == "yes"; then \
2644+
echo $(INSTALL_DATA) $(srcdir)/Include/internal/mimalloc/mimalloc.h $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc.h; \
2645+
$(INSTALL_DATA) $(srcdir)/Include/internal/mimalloc/mimalloc.h $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc.h; \
2646+
for i in $(srcdir)/Include/internal/mimalloc/mimalloc/*.h; \
2647+
do \
2648+
echo $(INSTALL_DATA) $$i $(INCLUDEPY)/internal/mimalloc/mimalloc; \
2649+
$(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc; \
2650+
done; \
2651+
fi
2652+
echo $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
26342653
$(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
26352654

26362655
# Install the library and miscellaneous stuff needed for extending/embedding

configure

Lines changed: 2 additions & 1 deletion
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
@@ -4779,7 +4779,7 @@ elif test "$disable_gil" = "yes"; then
47794779
fi
47804780

47814781
AC_MSG_RESULT([$with_mimalloc])
4782-
AC_SUBST([WITH_MIMALLOC])
4782+
AC_SUBST([INSTALL_MIMALLOC], [$with_mimalloc])
47834783
AC_SUBST([MIMALLOC_HEADERS])
47844784

47854785
# Check for Python-specific malloc support

0 commit comments

Comments
 (0)