patch-Makefile_pre_in 6.9 KB

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