source: packages/lang/python/patches/000-cross-compile.patch @ 29369

Last change on this file since 29369 was 29369, checked in by jow, 4 years ago

[packages] python: fix compilation against Linux 3.x (#10197)

File size: 4.7 KB
  • Makefile.pre.in

    ---
     Makefile.pre.in |   25 +++++++++++++------------
     1 file changed, 13 insertions(+), 12 deletions(-)
    
    a b UNICODE_OBJS= @UNICODE_OBJS@ 
    175175 
    176176PYTHON=         python$(EXE) 
    177177BUILDPYTHON=    python$(BUILDEXE) 
     178HOSTPYTHON=     $(BUILDPYTHON) 
    178179 
    179180# The task to run while instrument when building the profile-opt target 
    180181PROFILE_TASK=   $(srcdir)/Tools/pybench/pybench.py -n 2 --with-gc --with-syscheck 
    GRAMMAR_INPUT= $(srcdir)/Grammar/Grammar 
    205206########################################################################## 
    206207# Parser 
    207208PGEN=           Parser/pgen$(EXE) 
    208  
     209HOSTPGEN=       $(PGEN)$(EXE) 
    209210POBJS=          \ 
    210211                Parser/acceler.o \ 
    211212                Parser/grammar1.o \ 
    build_all_generate_profile: 
    370371        $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-generate" LIBS="$(LIBS) -lgcov" 
    371372 
    372373run_profile_task: 
    373         ./$(BUILDPYTHON) $(PROFILE_TASK) 
     374        $(HOSTPYTHON) $(PROFILE_TASK) 
    374375 
    375376build_all_use_profile: 
    376377        $(MAKE) all CFLAGS="$(CFLAGS) -fprofile-use" 
    $(BUILDPYTHON): Modules/python.o $(LIBRA 
    388389                        $(BLDLIBRARY) $(LIBS) $(MODLIBS) $(SYSLIBS) $(LDLAST) 
    389390 
    390391platform: $(BUILDPYTHON) 
    391         $(RUNSHARED) ./$(BUILDPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform 
     392        $(RUNSHARED) $(HOSTPYTHON) -E -c 'import sys ; from distutils.util import get_platform ; print get_platform()+"-"+sys.version[0:3]' >platform 
    392393 
    393394 
    394395# Build the shared modules 
    395396sharedmods: $(BUILDPYTHON) 
    396397        @case $$MAKEFLAGS in \ 
    397         *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py -q build;; \ 
    398         *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' ./$(BUILDPYTHON) -E $(srcdir)/setup.py build;; \ 
     398        *s*) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py -q build;; \ 
     399        *) $(RUNSHARED) CC='$(CC)' LDSHARED='$(BLDSHARED)' OPT='$(OPT)' $(HOSTPYTHON) -E $(srcdir)/setup.py build;; \ 
    399400        esac 
    400401 
    401402# Build static library 
    Modules/python.o: $(srcdir)/Modules/pyth 
    517518 
    518519$(GRAMMAR_H) $(GRAMMAR_C): $(PGEN) $(GRAMMAR_INPUT) 
    519520                -@$(INSTALL) -d Include 
    520                 -$(PGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) 
     521                -$(HOSTPGEN) $(GRAMMAR_INPUT) $(GRAMMAR_H) $(GRAMMAR_C) 
    521522 
    522523$(PGEN):        $(PGENOBJS) 
    523524                $(CC) $(OPT) $(LDFLAGS) $(PGENOBJS) $(LIBS) -o $(PGEN) 
    $(LIBRARY_OBJS) $(MODOBJS) Modules/pytho 
    676677 
    677678TESTOPTS=       -l $(EXTRATESTOPTS) 
    678679TESTPROG=       $(srcdir)/Lib/test/regrtest.py 
    679 TESTPYTHON=     $(RUNSHARED) ./$(BUILDPYTHON) -E -tt 
     680TESTPYTHON=     $(RUNSHARED) $(HOSTPYTHON) -E -tt 
    680681test:           all platform 
    681682                -find $(srcdir)/Lib -name '*.py[co]' -print | xargs rm -f 
    682683                -$(TESTPYTHON) $(TESTPROG) $(TESTOPTS) 
    libainstall: all 
    10011002# Install the dynamically loadable modules 
    10021003# This goes into $(exec_prefix) 
    10031004sharedinstall: 
    1004         $(RUNSHARED) ./$(BUILDPYTHON) -E $(srcdir)/setup.py install \ 
     1005        $(RUNSHARED) $(HOSTPYTHON) -E $(srcdir)/setup.py install \ 
    10051006                --prefix=$(prefix) \ 
    10061007                --install-scripts=$(BINDIR) \ 
    10071008                --install-platlib=$(DESTSHARED) \ 
    frameworkinstallstructure: $(LDLIBRARY) 
    10391040                fi; \ 
    10401041        done 
    10411042        $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers 
    1042         sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist 
     1043        sed 's/%VERSION%/'"`$(RUNSHARED) $(HOSTPYTHON) -c 'import platform; print platform.python_version()'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist 
    10431044        $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current 
    10441045        $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK) 
    10451046        $(LN) -fsn Versions/Current/Headers $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Headers 
    frameworkinstallextras: 
    10811082# This installs a few of the useful scripts in Tools/scripts 
    10821083scriptsinstall: 
    10831084        SRCDIR=$(srcdir) $(RUNSHARED) \ 
    1084         ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/setup.py install \ 
     1085        $(HOSTPYTHON) $(srcdir)/Tools/scripts/setup.py install \ 
    10851086        --prefix=$(prefix) \ 
    10861087        --install-scripts=$(BINDIR) \ 
    10871088        --root=/$(DESTDIR) 
    config.status: $(srcdir)/configure 
    11031104 
    11041105# Run reindent on the library 
    11051106reindent: 
    1106         ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib 
     1107        $(HOSTPYTHON) $(srcdir)/Tools/scripts/reindent.py -r $(srcdir)/Lib 
    11071108 
    11081109# Rerun configure with the same options as it was run last time, 
    11091110# provided the config.status script exists 
    funny: 
    12001201 
    12011202# Perform some verification checks on any modified files. 
    12021203patchcheck: 
    1203         $(RUNSHARED) ./$(BUILDPYTHON) $(srcdir)/Tools/scripts/patchcheck.py 
     1204        $(RUNSHARED) $(HOSTPYTHON) $(srcdir)/Tools/scripts/patchcheck.py 
    12041205 
    12051206# Dependencies 
    12061207 
Note: See TracBrowser for help on using the repository browser.