• Skip to sidebar navigation
  • Skip to content

Bitbucket

  • More
    ProjectsRepositories
  • Help
    • Online help
    • Learn Git
    • Welcome to Bitbucket
    • Keyboard shortcuts
  • Log In
Alexander Dahl
  1. Alexander Dahl

buildroot

Public
Actions
  • Clone
  • Compare

Learn more about cloning repositories

You have read-only access

Navigation
  • Source
  • Commits
  • Branches
  • All Branches Graph
  • Forks
  1. Alexander Dahl
  2. buildroot

Source

buildroot/package/python3/python3-001-support-for-build.patch
Maxime RipardMaxime Ripard committed f1c092da8ba29 May 2013
Raw file
Source viewDiff to previous
xxxxxxxxxx
 
1
Add support in Python build system to specify host pgen
2
​
3
Python needs a "pgen" program to build itself. Unfortunately, the
4
Python build system assumes that it can use the pgen program it has
5
just built to build itself. Obviously, this cannot work in
6
cross-compilation mode since the pgen program have been built for the
7
target.
8
​
9
Therefore, this patch adds support in the Python build system for the
10
new PGEN_FOR_BUILD variable, so that we can point Python ./configure
11
script to the pgen program that have been previously built for the
12
host.
13
​
14
Patch ported to python2.7 by Maxime Ripard <ripard@archos.com>, and
15
later significantly reworked by Thomas Petazzoni
16
<thomas.petazzoni@free-electrons.com>, with some inspiration taken
17
from the Python patches of the PTXdist project, and then ported to
18
python3.3 by Maxime Ripard <maxime.ripard@free-electrons.com>
19
​
20
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
21
---
22
 Makefile.pre.in |    5 +++--
23
 configure.ac    |    5 +++++
24
 2 files changed, 8 insertions(+), 2 deletions(-)
25
​
26
Index: Python-3.3.0/Makefile.pre.in
27
===================================================================
28
--- Python-3.3.0.orig/Makefile.pre.in
29
+++ Python-3.3.0/Makefile.pre.in
30
@@ -239,6 +239,7 @@
31
 ##########################################################################
32
 # Parser
33
 PGEN=      Parser/pgen$(EXE)
34
+PGEN_FOR_BUILD=@PGEN_FOR_BUILD@
35
 
36
 PSRCS=     \
37
        Parser/acceler.c \
38
@@ -639,8 +640,8 @@
39
 
40
 $(GRAMMAR_H): $(GRAMMAR_INPUT) $(PGENSRCS)
41
        @$(MKDIR_P) Include
42
-       $(MAKE) $(PGEN)
43
-       $(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
44
+       $(MAKE) $(PGEN_FOR_BUILD)
45
+       $(PGEN_FOR_BUILD) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
46
 $(GRAMMAR_C): $(GRAMMAR_H) $(GRAMMAR_INPUT) $(PGENSRCS)
47
        $(MAKE) $(GRAMMAR_H)
48
        touch $(GRAMMAR_C)
49
Index: Python-3.3.0/configure.ac
50
===================================================================
51
--- Python-3.3.0.orig/configure.ac
52
+++ Python-3.3.0/configure.ac
53
@@ -51,10 +51,15 @@
54
         AC_MSG_RESULT($interp)
55
    PYTHON_FOR_BUILD="_PYTHON_PROJECT_BASE=$srcdir"' _PYTHON_HOST_PLATFORM=$(_PYTHON_HOST_PLATFORM) PYTHONPATH=$(srcdir)/Lib:$(srcdir)/Lib/plat-$(MACHDEP) '$interp
56
     fi
57
+    AC_MSG_CHECKING(pgen for build)
58
+    PGEN_FOR_BUILD="${PGEN_FOR_BUILD}"
59
+    AC_MSG_RESULT($PGEN_FOR_BUILD)
60
 else
61
     PYTHON_FOR_BUILD='./$(BUILDPYTHON) -E'
62
+    PGEN_FOR_BUILD='./$(PGEN)'
63
 fi
64
 AC_SUBST(PYTHON_FOR_BUILD)
65
+AC_SUBST(PGEN_FOR_BUILD)
66
 
67
 dnl Ensure that if prefix is specified, it does not end in a slash. If
68
 dnl it does, we get path names containing '//' which is both ugly and
  • Git repository management for enterprise teams powered by Atlassian Bitbucket
  • Atlassian Bitbucket v6.7.2
  • Documentation
  • Request a feature
  • About
  • Contact Atlassian
Atlassian

Everything looks good. We'll let you know here if there's anything you should know about.