patch-Makefile_pre_in 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. diff -Nur Python-2.7.1.orig/Makefile.pre.in Python-2.7.1/Makefile.pre.in
  2. --- Python-2.7.1.orig/Makefile.pre.in 2010-10-14 13:37:30.000000000 +0200
  3. +++ Python-2.7.1/Makefile.pre.in 2010-12-14 16:02:44.000000000 +0100
  4. @@ -179,6 +179,7 @@
  5. PYTHON= python$(EXE)
  6. BUILDPYTHON= python$(BUILDEXE)
  7. +HOSTPYTHON?= $(BUILDPYTHON)
  8. # The task to run while instrument when building the profile-opt target
  9. PROFILE_TASK= $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck
  10. @@ -211,6 +212,7 @@
  11. ##########################################################################
  12. # Parser
  13. PGEN= Parser/pgen$(EXE)
  14. +HOSTPGEN?= $(PGEN)$(EXE)
  15. POBJS= \
  16. Parser/acceler.o \
  17. @@ -380,7 +382,7 @@
  18. $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov"
  19. run_profile_task:
  20. - ./$(BUILDPYTHON) $(PROFILE_TASK)
  21. + $(HOSTPYTHON) $(PROFILE_TASK)
  22. build_all_use_profile:
  23. $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use"
  24. @@ -398,14 +400,14 @@
  25. $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST)
  26. platform: $(BUILDPYTHON)
  27. - $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
  28. + $(RUNSHARED) $(HOSTPYTHON) -E -c 'import sys ; from sysconfig import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform
  29. # Build the shared modules
  30. sharedmods: $(BUILDPYTHON)
  31. @case $$MAKEFLAGS in \
  32. - *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \
  33. - *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \
  34. + *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \
  35. + *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
  36. esac
  37. # Build static library
  38. @@ -538,7 +540,7 @@
  39. $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
  40. -@$(INSTALL) -d Include
  41. - -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
  42. + -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
  43. $(PGEN): $(PGENOBJS)
  44. $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
  45. @@ -702,7 +704,7 @@
  46. TESTOPTS= -l $(EXTRATESTOPTS)
  47. TESTPROG= $(srcdir)/Lib/test/regrtest.py
  48. -TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
  49. +TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
  50. test: all platform
  51. -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
  52. -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
  53. @@ -725,7 +727,7 @@
  54. -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
  55. -$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
  56. $(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
  57. - $(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E -tt $(TESTPROG) -uall $(TESTOPTS)
  58. + $(RUNSHARED) /usr/libexec/oah/translate $(HOSTPYTHON) -E -tt $(TESTPROG) -uall $(TESTOPTS)
  59. # Like testall, but with a single pass only
  60. @@ -920,26 +922,26 @@
  61. done; \
  62. done
  63. $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
  64. - PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  65. - ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
  66. + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  67. + $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
  68. -d $(LIBDEST) -f \
  69. -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
  70. $(DESTDIR)$(LIBDEST)
  71. - PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  72. - ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
  73. + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  74. + $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
  75. -d $(LIBDEST) -f \
  76. -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
  77. $(DESTDIR)$(LIBDEST)
  78. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  79. - ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
  80. + $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
  81. -d $(LIBDEST)/site-packages -f \
  82. -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
  83. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  84. - ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
  85. + $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
  86. -d $(LIBDEST)/site-packages -f \
  87. -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
  88. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  89. - ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
  90. + $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
  91. # Create the PLATDIR source directory, if one wasn't distributed..
  92. $(srcdir)/Lib/$(PLATDIR):
  93. @@ -1044,7 +1046,8 @@
  94. # Install the dynamically loadable modules
  95. # This goes into $(exec_prefix)
  96. sharedinstall: sharedmods
  97. - $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
  98. + CROSS_COMPILE='$(CROSS_COMPILE)' \
  99. + $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
  100. --prefix=$(prefix) \
  101. --install-scripts=$(BINDIR) \
  102. --install-platlib=$(DESTSHARED) \
  103. @@ -1082,7 +1085,7 @@
  104. fi; \
  105. done
  106. $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
  107. - sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
  108. + sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
  109. $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
  110. $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
  111. $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
  112. @@ -1117,7 +1120,7 @@
  113. # This installs a few of the useful scripts in Tools/scripts
  114. scriptsinstall:
  115. SRCDIR=$(srcdir) $(RUNSHARED) \
  116. - ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
  117. + $(HOSTPYTHON) $(srcdir)/Tools/scripts/setup.py install \
  118. --prefix=$(prefix) \
  119. --install-scripts=$(BINDIR) \
  120. --root=/$(DESTDIR)
  121. @@ -1139,7 +1142,7 @@
  122. # Run reindent on the library
  123. reindent:
  124. - ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
  125. + $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
  126. # Rerun configure with the same options as it was run last time,
  127. # provided the config.status script exists
  128. @@ -1242,7 +1245,7 @@
  129. # Perform some verification checks on any modified files.
  130. patchcheck:
  131. - $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
  132. + $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
  133. # Dependencies