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>
12 ===================================================================
16 AC_SUBST(FRAMEWORKUNIXTOOLSPREFIX)
17 AC_SUBST(FRAMEWORKINSTALLAPPSPREFIX)
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"
26 + STDLIB_CACHE_FLAGS="-b"
28 + STDLIB_CACHE_FLAGS=""
32 + STDLIB_CACHE_FLAGS=""
34 +AC_SUBST(STDLIB_CACHE_FLAGS)
37 ## AS_HELP_STRING([--with-dyld],
38 ## [Use (OpenStep|Rhapsody) dynamic linker]))
39 Index: b/Makefile.pre.in
40 ===================================================================
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 \
58 + -d $(LIBDEST) -f $(STDLIB_CACHE_FLAGS) \
59 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
61 -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
62 $(PYTHON_FOR_BUILD) -Wi -O $(DESTDIR)$(LIBDEST)/compileall.py \
64 + -d $(LIBDEST) -f $(STDLIB_CACHE_FLAGS) \
65 -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
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