summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorYichen Yan <oraluben@outlook.com>2024-04-23 07:56:00 (GMT)
committerGitHub <noreply@github.com>2024-04-23 07:56:00 (GMT)
commite17cd1fbfd4f20824c686c7242423e84ba6a6cc5 (patch)
treeeddfebc23f756a3b4d91e1b16c1c933e43ee9863
parent456c29cf85847c67dfc0fa36d6fe6168569b46fe (diff)
downloadcpython-e17cd1fbfd4f20824c686c7242423e84ba6a6cc5.zip
cpython-e17cd1fbfd4f20824c686c7242423e84ba6a6cc5.tar.gz
cpython-e17cd1fbfd4f20824c686c7242423e84ba6a6cc5.tar.bz2
gh-116984: Install mimalloc headers (#116985)
- Install mimalloc header only when enabled - Rename WITH_MIMALLOC to INSTALL_MIMALLOC
-rw-r--r--Makefile.pre.in19
-rwxr-xr-xconfigure3
-rw-r--r--configure.ac2
3 files changed, 22 insertions, 2 deletions
diff --git a/Makefile.pre.in b/Makefile.pre.in
index f7c21a3..c7cf44d 100644
--- a/Makefile.pre.in
+++ b/Makefile.pre.in
@@ -233,6 +233,9 @@ LIBHACL_SHA2_A= Modules/_hacl/libHacl_Hash_SHA2.a
# Default zoneinfo.TZPATH. Added here to expose it in sysconfig.get_config_var
TZPATH=@TZPATH@
+# If to install mimalloc headers
+INSTALL_MIMALLOC=@INSTALL_MIMALLOC@
+
# Modes for directories, executables and data files created by the
# install process. Default to user-only-writable for all file types.
DIRMODE= 755
@@ -2616,6 +2619,12 @@ inclinstall:
$(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/internal; \
else true; \
fi
+ @if test "$(INSTALL_MIMALLOC)" == "yes"; then \
+ if test ! -d $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc; then \
+ echo "Creating directory $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc"; \
+ $(INSTALL) -d -m $(DIRMODE) $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc; \
+ fi; \
+ fi
@for i in $(srcdir)/Include/*.h; \
do \
echo $(INSTALL_DATA) $$i $(INCLUDEPY); \
@@ -2631,6 +2640,16 @@ inclinstall:
echo $(INSTALL_DATA) $$i $(INCLUDEPY)/internal; \
$(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/internal; \
done
+ @if test "$(INSTALL_MIMALLOC)" == "yes"; then \
+ echo $(INSTALL_DATA) $(srcdir)/Include/internal/mimalloc/mimalloc.h $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc.h; \
+ $(INSTALL_DATA) $(srcdir)/Include/internal/mimalloc/mimalloc.h $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc.h; \
+ for i in $(srcdir)/Include/internal/mimalloc/mimalloc/*.h; \
+ do \
+ echo $(INSTALL_DATA) $$i $(INCLUDEPY)/internal/mimalloc/mimalloc; \
+ $(INSTALL_DATA) $$i $(DESTDIR)$(INCLUDEPY)/internal/mimalloc/mimalloc; \
+ done; \
+ fi
+ echo $(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
$(INSTALL_DATA) pyconfig.h $(DESTDIR)$(CONFINCLUDEPY)/pyconfig.h
# Install the library and miscellaneous stuff needed for extending/embedding
diff --git a/configure b/configure
index 29a7d5b..94ee1ca 100755
--- a/configure
+++ b/configure
@@ -869,7 +869,7 @@ DTRACE_OBJS
DTRACE_HEADERS
DFLAGS
DTRACE
-WITH_MIMALLOC
+INSTALL_MIMALLOC
MIMALLOC_HEADERS
GDBM_LIBS
GDBM_CFLAGS
@@ -17335,6 +17335,7 @@ fi
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: result: $with_mimalloc" >&5
printf "%s\n" "$with_mimalloc" >&6; }
+INSTALL_MIMALLOC=$with_mimalloc
diff --git a/configure.ac b/configure.ac
index 7723c80..7877ef4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -4779,7 +4779,7 @@ elif test "$disable_gil" = "yes"; then
fi
AC_MSG_RESULT([$with_mimalloc])
-AC_SUBST([WITH_MIMALLOC])
+AC_SUBST([INSTALL_MIMALLOC], [$with_mimalloc])
AC_SUBST([MIMALLOC_HEADERS])
# Check for Python-specific malloc support