patch-Makefile_pre_in 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161
  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-10-15 16:09:58.000000000 +0200
  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,13 @@ $(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. + *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \
  44. esac
  45. # Build static library
  46. @@ -538,7 +539,7 @@ Modules/python.o: $(srcdir)/Modules/pyth
  47. $(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT)
  48. -@$(INSTALL) -d Include
  49. - -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
  50. + -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C)
  51. $(PGEN): $(PGENOBJS)
  52. $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN)
  53. @@ -702,7 +703,7 @@ $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho
  54. TESTOPTS= -l $(EXTRATESTOPTS)
  55. TESTPROG= $(srcdir)/Lib/test/regrtest.py
  56. -TESTPYTHON= $(RUNSHARED) ./$(BUILDPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
  57. +TESTPYTHON= $(RUNSHARED) $(HOSTPYTHON) -Wd -3 -E -tt $(TESTPYTHONOPTS)
  58. test: all platform
  59. -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
  60. -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS)
  61. @@ -725,7 +726,7 @@ testuniversal: all platform
  62. -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f
  63. -$(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
  64. $(TESTPYTHON) $(TESTPROG) -uall $(TESTOPTS)
  65. - $(RUNSHARED) /usr/libexec/oah/translate ./$(BUILDPYTHON) -E -tt $(TESTPROG) -uall $(TESTOPTS)
  66. + $(RUNSHARED) /usr/libexec/oah/translate $(HOSTPYTHON) -E -tt $(TESTPROG) -uall $(TESTOPTS)
  67. # Like testall, but with a single pass only
  68. @@ -920,26 +921,26 @@ libinstall: build_all $(srcdir)/Lib/$(PL
  69. done; \
  70. done
  71. $(INSTALL_DATA) $(srcdir)/LICENSE $(DESTDIR)$(LIBDEST)/LICENSE.txt
  72. - PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  73. - ./$(BUILDPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
  74. + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  75. + $(HOSTPYTHON) -Wi -tt $(DESTDIR)$(LIBDEST)/compileall.py \
  76. -d $(LIBDEST) -f \
  77. -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
  78. $(DESTDIR)$(LIBDEST)
  79. - PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  80. - ./$(BUILDPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
  81. + -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  82. + $(HOSTPYTHON) -Wi -tt -O $(DESTDIR)$(LIBDEST)/compileall.py \
  83. -d $(LIBDEST) -f \
  84. -x 'bad_coding|badsyntax|site-packages|lib2to3/tests/data' \
  85. $(DESTDIR)$(LIBDEST)
  86. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  87. - ./$(BUILDPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
  88. + $(HOSTPYTHON) -Wi -t $(DESTDIR)$(LIBDEST)/compileall.py \
  89. -d $(LIBDEST)/site-packages -f \
  90. -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
  91. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  92. - ./$(BUILDPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
  93. + $(HOSTPYTHON) -Wi -t -O $(DESTDIR)$(LIBDEST)/compileall.py \
  94. -d $(LIBDEST)/site-packages -f \
  95. -x badsyntax $(DESTDIR)$(LIBDEST)/site-packages
  96. -PYTHONPATH=$(DESTDIR)$(LIBDEST) $(RUNSHARED) \
  97. - ./$(BUILDPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
  98. + $(HOSTPYTHON) -Wi -t -c "import lib2to3.pygram, lib2to3.patcomp;lib2to3.patcomp.PatternCompiler()"
  99. # Create the PLATDIR source directory, if one wasn't distributed..
  100. $(srcdir)/Lib/$(PLATDIR):
  101. @@ -1044,7 +1045,8 @@ libainstall: all python-config
  102. # Install the dynamically loadable modules
  103. # This goes into $(exec_prefix)
  104. sharedinstall: sharedmods
  105. - $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \
  106. + CROSS_COMPILE='$(CROSS_COMPILE)' \
  107. + $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \
  108. --prefix=$(prefix) \
  109. --install-scripts=$(BINDIR) \
  110. --install-platlib=$(DESTSHARED) \
  111. @@ -1082,7 +1084,7 @@ frameworkinstallstructure: $(LDLIBRARY)
  112. fi; \
  113. done
  114. $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
  115. - sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
  116. + sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
  117. $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
  118. $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
  119. $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers
  120. @@ -1117,7 +1119,7 @@ frameworkinstallextras:
  121. # This installs a few of the useful scripts in Tools/scripts
  122. scriptsinstall:
  123. SRCDIR=$(srcdir) $(RUNSHARED) \
  124. - ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \
  125. + $(HOSTPYTHON) $(srcdir)/Tools/scripts/setup.py install \
  126. --prefix=$(prefix) \
  127. --install-scripts=$(BINDIR) \
  128. --root=/$(DESTDIR)
  129. @@ -1139,7 +1141,7 @@ config.status: $(srcdir)/configure
  130. # Run reindent on the library
  131. reindent:
  132. - ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
  133. + $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib
  134. # Rerun configure with the same options as it was run last time,
  135. # provided the config.status script exists
  136. @@ -1242,7 +1244,7 @@ funny:
  137. # Perform some verification checks on any modified files.
  138. patchcheck:
  139. - $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
  140. + $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py
  141. # Dependencies