patch-Makefile_pre_in 7.3 KB

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