configs: add Freescale i.MX6 SoloX Sabre SD support
[buildroot-gz.git] / package / python3 / 004-old-stdlib-cache.patch
blob9ed7e59a9b4fa45242f510f8e464c5676118e9f2
1 python3: Fix pyc-only related runtime exceptions
3 Python3 changes the pyc lookup strategy, ignoring the
4 __pycache__ directory if the .py file is missing. Change
5 install location to enable use of .pyc without their parent .py
7 See http://www.python.org/dev/peps/pep-3147
9 Signed-off-by: Daniel Nelson <daniel@sigpwr.com>
11 Index: b/configure.ac
12 ===================================================================
13 --- a/configure.ac
14 +++ b/configure.ac
15 @@ -352,6 +352,23 @@
16 AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
17 AC_SUBST(FRAMEWORKINSTALLAPPSPREFIX)
19 +STDLIB_CACHE_FLAGS=
20 +AC_MSG_CHECKING(for --enable-old-stdlib-cache)
21 +AC_ARG_ENABLE(old-stdlib-cache,
22 + AS_HELP_STRING([--enable-old-stdlib-cache], [enable pre-pep3147 stdlib cache]),
24 + if test "$enableval" = "yes"
25 + then
26 + STDLIB_CACHE_FLAGS="-b"
27 + else
28 + STDLIB_CACHE_FLAGS=""
29 + fi
30 +],
32 + STDLIB_CACHE_FLAGS=""
33 +])
34 +AC_SUBST(STDLIB_CACHE_FLAGS)
36 ##AC_ARG_WITH(dyld,
37 ## AS_HELP_STRING([--with-dyld],
38 ## [Use (OpenStep|Rhapsody) dynamic linker]))
39 Index: b/Makefile.pre.in
40 ===================================================================
41 --- a/Makefile.pre.in
42 +++ b/Makefile.pre.in
43 @@ -162,6 +162,9 @@
44 # Options to enable prebinding (for fast startup prior to Mac OS X 10.3)
45 OTHER_LIBTOOL_OPT=@OTHER_LIBTOOL_OPT@
47 +# Option to enable old-style precompiled stdlib
48 +STDLIB_CACHE_FLAGS=@STDLIB_CACHE_FLAGS@
50 # Environment to run shared python without installed libraries
51 RUNSHARED= @RUNSHARED@
53 @@ -1247,21 +1250,21 @@
55 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
56 $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
57 - -d $(LIBDEST) -f \
58 + -d $(LIBDEST) -f $(STDLIB_CACHE_FLAGS) \
59 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
60 $(DESTDIR)$(LIBDEST)
61 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
62 $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
63 - -d $(LIBDEST) -f \
64 + -d $(LIBDEST) -f $(STDLIB_CACHE_FLAGS) \
65 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
66 $(DESTDIR)$(LIBDEST)
67 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
68 $(PYTHON_FOR_BUILD) -Wi $(DESTDIR)$(LIBDEST)/compileall.py \
69 - -d $(LIBDEST)/site-packages -f \
70 + -d $(LIBDEST)/site-packages -f $(STDLIB_CACHE_FLAGS) \
71 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
72 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
73 $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
74 - -d $(LIBDEST)/site-packages -f \
75 + -d $(LIBDEST)/site-packages -f $(STDLIB_CACHE_FLAGS) \
76 -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
77 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
78 $(PYTHON_FOR_BUILD) -m lib2to3.pgen2.driver $(DESTDIR)$(LIBDEST)/lib2to3/Grammar.txt