Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d985a71

Browse files
committed
gh-103053: Fix BUILDPYTHON target of Makefile
On FreeBSD when Python is built out of tree, the "python" program was created in the source directory instead of build directory. Fix the Makefile to write the "python" program in the build directory.
1 parent 3c0f65e commit d985a71

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

Makefile.pre.in

+4-1
Original file line numberDiff line numberDiff line change
@@ -783,7 +783,10 @@ clinic-tests: check-clean-src $(srcdir)/Lib/test/clinic.test.c
783783

784784
# Build the interpreter
785785
$(BUILDPYTHON): Programs/python.o $(LINK_PYTHON_DEPS)
786-
$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $@ Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS)
786+
@ # gh-103053: Use "-o $(BUILDPYTHON)" instead of "-o $@".
787+
@ # On FreeBSD when Python is built out of tree, $@ contains the source
788+
@ # directory, whereas the build directory is expected.
789+
$(LINKCC) $(PY_CORE_LDFLAGS) $(LINKFORSHARED) -o $(BUILDPYTHON) Programs/python.o $(LINK_PYTHON_OBJS) $(LIBS) $(MODLIBS) $(SYSLIBS)
787790

788791
platform: $(PYTHON_FOR_BUILD_DEPS) pybuilddir.txt
789792
$(RUNSHARED) $(PYTHON_FOR_BUILD) -c 'import sys ; from sysconfig import get_platform ; print("%s-%d.%d" % (get_platform(), *sys.version_info[:2]))' >platform
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
On FreeBSD when Python is built out of tree, the "python" program was
2+
created in the source directory instead of build directory. Fix the Makefile
3+
to write the "python" program in the build directory. Patch by Victor
4+
Stinner.

0 commit comments

Comments
 (0)