mirror of https://github.com/python/cpython
bpo-32430: Rename Modules/Setup.dist to Modules/Setup (GH-8229)
bpo-32430: Rename Modules/Setup.dist to Modules/Setup Remove the necessity to copy the former manually to the latter when updating the local source tree.
This commit is contained in:
parent
35c0809158
commit
961d54c5c1
|
@ -139,6 +139,21 @@ Build and C API Changes
|
||||||
``const char *`` rather of ``char *``.
|
``const char *`` rather of ``char *``.
|
||||||
(Contributed by Serhiy Storchaka in :issue:`33818`.)
|
(Contributed by Serhiy Storchaka in :issue:`33818`.)
|
||||||
|
|
||||||
|
* The duality of ``Modules/Setup.dist`` and ``Modules/Setup`` has been
|
||||||
|
removed. Previously, when updating the CPython source tree, one had
|
||||||
|
to manually copy ``Modules/Setup.dist`` (inside the source tree) to
|
||||||
|
``Modules/Setup`` (inside the build tree) in order to reflect any changes
|
||||||
|
upstream. This was of a small benefit to packagers at the expense of
|
||||||
|
a frequent annoyance to developers following CPython development, as
|
||||||
|
forgetting to copy the file could produce build failures.
|
||||||
|
|
||||||
|
Now the build system always reads from ``Modules/Setup`` inside the source
|
||||||
|
tree. People who want to customize that file are encouraged to maintain
|
||||||
|
their changes in a git fork of CPython or as patch files, as they would do
|
||||||
|
for any other change to the source tree.
|
||||||
|
|
||||||
|
(Contributed by Antoine Pitrou in :issue:`32430`.)
|
||||||
|
|
||||||
|
|
||||||
Deprecated
|
Deprecated
|
||||||
==========
|
==========
|
||||||
|
|
|
@ -36,10 +36,8 @@ if (os.name == 'nt' and
|
||||||
# python_build: (Boolean) if true, we're either building Python or
|
# python_build: (Boolean) if true, we're either building Python or
|
||||||
# building an extension with an un-installed Python, so we use
|
# building an extension with an un-installed Python, so we use
|
||||||
# different (hard-wired) directories.
|
# different (hard-wired) directories.
|
||||||
# Setup.local is available for Makefile builds including VPATH builds,
|
|
||||||
# Setup.dist is available on Windows
|
|
||||||
def _is_python_source_dir(d):
|
def _is_python_source_dir(d):
|
||||||
for fn in ("Setup.dist", "Setup.local"):
|
for fn in ("Setup", "Setup.local"):
|
||||||
if os.path.isfile(os.path.join(d, "Modules", fn)):
|
if os.path.isfile(os.path.join(d, "Modules", fn)):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -119,7 +119,7 @@ if "_PYTHON_PROJECT_BASE" in os.environ:
|
||||||
_PROJECT_BASE = _safe_realpath(os.environ["_PYTHON_PROJECT_BASE"])
|
_PROJECT_BASE = _safe_realpath(os.environ["_PYTHON_PROJECT_BASE"])
|
||||||
|
|
||||||
def _is_python_source_dir(d):
|
def _is_python_source_dir(d):
|
||||||
for fn in ("Setup.dist", "Setup.local"):
|
for fn in ("Setup", "Setup.local"):
|
||||||
if os.path.isfile(os.path.join(d, "Modules", fn)):
|
if os.path.isfile(os.path.join(d, "Modules", fn)):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
|
@ -687,26 +687,16 @@ oldsharedmods: $(SHAREDMODS)
|
||||||
Makefile Modules/config.c: Makefile.pre \
|
Makefile Modules/config.c: Makefile.pre \
|
||||||
$(srcdir)/Modules/config.c.in \
|
$(srcdir)/Modules/config.c.in \
|
||||||
$(MAKESETUP) \
|
$(MAKESETUP) \
|
||||||
Modules/Setup \
|
$(srcdir)/Modules/Setup \
|
||||||
Modules/Setup.local
|
Modules/Setup.local
|
||||||
$(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
|
$(SHELL) $(MAKESETUP) -c $(srcdir)/Modules/config.c.in \
|
||||||
-s Modules \
|
-s Modules \
|
||||||
Modules/Setup.local \
|
Modules/Setup.local \
|
||||||
Modules/Setup
|
$(srcdir)/Modules/Setup
|
||||||
@mv config.c Modules
|
@mv config.c Modules
|
||||||
@echo "The Makefile was updated, you may need to re-run make."
|
@echo "The Makefile was updated, you may need to re-run make."
|
||||||
|
|
||||||
|
|
||||||
Modules/Setup: $(srcdir)/Modules/Setup.dist
|
|
||||||
@if test -f Modules/Setup; then \
|
|
||||||
echo "-----------------------------------------------"; \
|
|
||||||
echo "Modules/Setup.dist is newer than Modules/Setup;"; \
|
|
||||||
echo "check to make sure you have all the updates you"; \
|
|
||||||
echo "need in your Modules/Setup file."; \
|
|
||||||
echo "Usually, copying Modules/Setup.dist to Modules/Setup will work."; \
|
|
||||||
echo "-----------------------------------------------"; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
|
Programs/_testembed: Programs/_testembed.o $(LIBRARY) $(LDLIBRARY) $(PY3LIBRARY)
|
||||||
$(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
|
$(LINKCC) $(PY_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/_testembed.o $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
|
||||||
|
|
||||||
|
@ -1478,7 +1468,7 @@ libainstall: @DEF_MAKE_RULE@ python-config
|
||||||
$(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o
|
$(INSTALL_DATA) Programs/python.o $(DESTDIR)$(LIBPL)/python.o
|
||||||
$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
|
$(INSTALL_DATA) $(srcdir)/Modules/config.c.in $(DESTDIR)$(LIBPL)/config.c.in
|
||||||
$(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
|
$(INSTALL_DATA) Makefile $(DESTDIR)$(LIBPL)/Makefile
|
||||||
$(INSTALL_DATA) Modules/Setup $(DESTDIR)$(LIBPL)/Setup
|
$(INSTALL_DATA) $(srcdir)/Modules/Setup $(DESTDIR)$(LIBPL)/Setup
|
||||||
$(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
|
$(INSTALL_DATA) Modules/Setup.local $(DESTDIR)$(LIBPL)/Setup.local
|
||||||
$(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
|
$(INSTALL_DATA) Misc/python.pc $(DESTDIR)$(LIBPC)/python-$(VERSION).pc
|
||||||
$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
|
$(INSTALL_SCRIPT) $(srcdir)/Modules/makesetup $(DESTDIR)$(LIBPL)/makesetup
|
||||||
|
@ -1701,8 +1691,7 @@ distclean: clobber
|
||||||
for file in $(srcdir)/Lib/test/data/* ; do \
|
for file in $(srcdir)/Lib/test/data/* ; do \
|
||||||
if test "$$file" != "$(srcdir)/Lib/test/data/README"; then rm "$$file"; fi; \
|
if test "$$file" != "$(srcdir)/Lib/test/data/README"; then rm "$$file"; fi; \
|
||||||
done
|
done
|
||||||
-rm -f core Makefile Makefile.pre config.status \
|
-rm -f core Makefile Makefile.pre config.status Modules/Setup.local \
|
||||||
Modules/Setup Modules/Setup.local \
|
|
||||||
Modules/ld_so_aix Modules/python.exp Misc/python.pc \
|
Modules/ld_so_aix Modules/python.exp Misc/python.pc \
|
||||||
Misc/python-config.sh
|
Misc/python-config.sh
|
||||||
-rm -f python*-gdb.py
|
-rm -f python*-gdb.py
|
||||||
|
|
|
@ -0,0 +1,2 @@
|
||||||
|
Rename Modules/Setup.dist to Modules/Setup, and remove the necessity to copy
|
||||||
|
the former manually to the latter when updating the local source tree.
|
|
@ -1,14 +1,11 @@
|
||||||
# -*- makefile -*-
|
# -*- makefile -*-
|
||||||
# The file Setup is used by the makesetup script to construct the files
|
# The file Setup is used by the makesetup script to construct the files
|
||||||
# Makefile and config.c, from Makefile.pre and config.c.in,
|
# Makefile and config.c, from Makefile.pre and config.c.in,
|
||||||
# respectively. The file Setup itself is initially copied from
|
# respectively. Note that Makefile.pre is created from Makefile.pre.in
|
||||||
# Setup.dist; once it exists it will not be overwritten, so you can edit
|
# by the toplevel configure script.
|
||||||
# Setup to your heart's content. Note that Makefile.pre is created
|
|
||||||
# from Makefile.pre.in by the toplevel configure script.
|
|
||||||
|
|
||||||
# (VPATH notes: Setup and Makefile.pre are in the build directory, as
|
# (VPATH notes: Setup and Makefile.pre are in the build directory, as
|
||||||
# are Makefile and config.c; the *.in and *.dist files are in the source
|
# are Makefile and config.c; the *.in files are in the source directory.)
|
||||||
# directory.)
|
|
||||||
|
|
||||||
# Each line in this file describes one or more optional modules.
|
# Each line in this file describes one or more optional modules.
|
||||||
# Modules configured here will not be compiled by the setup.py script,
|
# Modules configured here will not be compiled by the setup.py script,
|
|
@ -322,7 +322,7 @@ search_for_prefix(const _PyCoreConfig *core_config,
|
||||||
/* Check to see if argv[0] is in the build directory */
|
/* Check to see if argv[0] is in the build directory */
|
||||||
wcsncpy(prefix, calculate->argv0_path, MAXPATHLEN);
|
wcsncpy(prefix, calculate->argv0_path, MAXPATHLEN);
|
||||||
prefix[MAXPATHLEN] = L'\0';
|
prefix[MAXPATHLEN] = L'\0';
|
||||||
joinpath(prefix, L"Modules/Setup");
|
joinpath(prefix, L"Modules/Setup.local");
|
||||||
if (isfile(prefix)) {
|
if (isfile(prefix)) {
|
||||||
/* Check VPATH to see if argv0_path is in the build directory. */
|
/* Check VPATH to see if argv0_path is in the build directory. */
|
||||||
vpath = Py_DecodeLocale(VPATH, NULL);
|
vpath = Py_DecodeLocale(VPATH, NULL);
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
# Setup files after a -n option are used for their variables, modules
|
# Setup files after a -n option are used for their variables, modules
|
||||||
# and libraries but not for their .o files.
|
# and libraries but not for their .o files.
|
||||||
#
|
#
|
||||||
# See Setup.dist for a description of the format of the Setup file.
|
# See Setup for a description of the format of the Setup file.
|
||||||
#
|
#
|
||||||
# The following edits are made:
|
# The following edits are made:
|
||||||
#
|
#
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
# generated automatically by aclocal 1.15.1 -*- Autoconf -*-
|
# generated automatically by aclocal 1.15 -*- Autoconf -*-
|
||||||
|
|
||||||
# Copyright (C) 1996-2017 Free Software Foundation, Inc.
|
# Copyright (C) 1996-2014 Free Software Foundation, Inc.
|
||||||
|
|
||||||
# This file is free software; the Free Software Foundation
|
# This file is free software; the Free Software Foundation
|
||||||
# gives unlimited permission to copy and/or distribute it,
|
# gives unlimited permission to copy and/or distribute it,
|
||||||
|
|
|
@ -18339,12 +18339,6 @@ $as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
echo "creating Modules/Setup" >&6
|
|
||||||
if test ! -f Modules/Setup
|
|
||||||
then
|
|
||||||
cp $srcdir/Modules/Setup.dist Modules/Setup
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "creating Modules/Setup.local" >&6
|
echo "creating Modules/Setup.local" >&6
|
||||||
if test ! -f Modules/Setup.local
|
if test ! -f Modules/Setup.local
|
||||||
then
|
then
|
||||||
|
@ -18354,7 +18348,7 @@ fi
|
||||||
echo "creating Makefile" >&6
|
echo "creating Makefile" >&6
|
||||||
$SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
|
$SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
|
||||||
-s Modules \
|
-s Modules \
|
||||||
Modules/Setup.local Modules/Setup
|
Modules/Setup.local $srcdir/Modules/Setup
|
||||||
mv config.c Modules
|
mv config.c Modules
|
||||||
|
|
||||||
if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then
|
if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then
|
||||||
|
|
|
@ -5547,12 +5547,6 @@ AC_CONFIG_FILES(Makefile.pre Misc/python.pc Misc/python-config.sh)
|
||||||
AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
|
AC_CONFIG_FILES([Modules/ld_so_aix], [chmod +x Modules/ld_so_aix])
|
||||||
AC_OUTPUT
|
AC_OUTPUT
|
||||||
|
|
||||||
echo "creating Modules/Setup" >&AS_MESSAGE_FD
|
|
||||||
if test ! -f Modules/Setup
|
|
||||||
then
|
|
||||||
cp $srcdir/Modules/Setup.dist Modules/Setup
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "creating Modules/Setup.local" >&AS_MESSAGE_FD
|
echo "creating Modules/Setup.local" >&AS_MESSAGE_FD
|
||||||
if test ! -f Modules/Setup.local
|
if test ! -f Modules/Setup.local
|
||||||
then
|
then
|
||||||
|
@ -5562,7 +5556,7 @@ fi
|
||||||
echo "creating Makefile" >&AS_MESSAGE_FD
|
echo "creating Makefile" >&AS_MESSAGE_FD
|
||||||
$SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
|
$SHELL $srcdir/Modules/makesetup -c $srcdir/Modules/config.c.in \
|
||||||
-s Modules \
|
-s Modules \
|
||||||
Modules/Setup.local Modules/Setup
|
Modules/Setup.local $srcdir/Modules/Setup
|
||||||
mv config.c Modules
|
mv config.c Modules
|
||||||
|
|
||||||
if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then
|
if test "$Py_OPT" = 'false' -a "$Py_DEBUG" != 'true'; then
|
||||||
|
|
Loading…
Reference in New Issue