Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions Doc/using/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1073,6 +1073,17 @@ Linker options

Enable building a shared Python library: ``libpython`` (default is no).

.. option:: --enable-relocatable

Enable experimental support for relocatable builds (default is no).
This option currently has no effect on the build.

.. warning::

This feature is under active development. Do not use it in production.

.. versionadded:: 3.16

.. option:: --without-static-libpython

Do not build ``libpythonMAJOR.MINOR.a`` and do not install ``python.o``
Expand Down
1 change: 1 addition & 0 deletions Makefile.pre.in
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ DSYMUTIL= @DSYMUTIL@
DSYMUTIL_PATH= @DSYMUTIL_PATH@

GNULD= @GNULD@
RELOCATABLE= @RELOCATABLE@

# Shell used by make (some versions default to the login shell, which is bad)
SHELL= /bin/sh -e
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Add the experimental :option:`--enable-relocatable` configure option.
The option currently has no effect on the build.
34 changes: 34 additions & 0 deletions configure

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -1594,6 +1594,21 @@ if test "x$enable_profiling" = xyes; then
LDFLAGS="-pg $LDFLAGS"
fi

AC_MSG_CHECKING([for --enable-relocatable])
AC_ARG_ENABLE([relocatable],
AS_HELP_STRING([--enable-relocatable],
[enable experimental relocatable build support (default is no)]),
[], [enable_relocatable=no])
AS_CASE([$enable_relocatable],
[yes|no], [],
[AC_MSG_ERROR([--enable-relocatable must be yes or no])])
AC_MSG_RESULT([$enable_relocatable])
AS_VAR_IF([enable_relocatable], [yes], [
AC_DEFINE([Py_ENABLE_RELOCATABLE], [1],
[Define if --enable-relocatable is used.])
])
AC_SUBST([RELOCATABLE], [$enable_relocatable])

AC_MSG_CHECKING([LDLIBRARY])

# Apple framework builds need more magic. LDLIBRARY is the dynamic
Expand Down
3 changes: 3 additions & 0 deletions pyconfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -1880,6 +1880,9 @@
/* Define if you want to build an interpreter with many run-time checks. */
#undef Py_DEBUG

/* Define if --enable-relocatable is used. */
#undef Py_ENABLE_RELOCATABLE

/* Defined if Python is built as a shared library. */
#undef Py_ENABLE_SHARED

Expand Down
Loading