Ignore:
Timestamp:
Mar 19, 2014, 11:31:01 PM (12 years ago)
Author:
dmik
Message:

python: Merge vendor 2.7.6 to trunk.

Location:
python/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • python/trunk

  • python/trunk/Mac/Makefile.in

    r2 r391  
    1616PYTHONFRAMEWORK=@PYTHONFRAMEWORK@
    1717PYTHONFRAMEWORKIDENTIFIER=@PYTHONFRAMEWORKIDENTIFIER@
    18 
     18LIPO_32BIT_FLAGS=@LIPO_32BIT_FLAGS@
     19CC=@CC@
     20MACOSX_DEPLOYMENT_TARGET=@CONFIGURE_MACOSX_DEPLOYMENT_TARGET@
     21export MACOSX_DEPLOYMENT_TARGET
    1922
    2023# These are normally glimpsed from the previous set
    2124bindir=$(prefix)/bin
    22 PYTHONAPPSDIR=/Applications/$(PYTHONFRAMEWORK) $(VERSION)
     25PYTHONAPPSDIR=@FRAMEWORKINSTALLAPPSPREFIX@/$(PYTHONFRAMEWORK) $(VERSION)
    2326APPINSTALLDIR=$(prefix)/Resources/Python.app
    2427
     
    3639LN=@LN@
    3740STRIPFLAG=-s
    38 CPMAC=/Developer/Tools/CpMac
     41CPMAC=CpMac
    3942
    4043APPTEMPLATE=$(srcdir)/Resources/app
    41 APPSUBDIRS=MacOS Resources Resources/English.lproj \
    42         Resources/English.lproj/Documentation \
    43         Resources/English.lproj/Documentation/doc \
    44         Resources/English.lproj/Documentation/ide
    45 DOCDIR=$(srcdir)/Resources/app/Resources/English.lproj/Documentation
    46 DOCINDEX=$(DOCDIR)/"Documentation idx"
     44APPSUBDIRS=MacOS Resources
    4745CACHERSRC=$(srcdir)/scripts/cachersrc.py
    4846compileall=$(srcdir)/../Lib/compileall.py
    4947
    50 installapps: install_Python install_BuildApplet install_PythonLauncher \
    51         install_IDLE checkapplepython install_pythonw install_versionedtools
    52 
    53 installapps4way: install_Python4way install_BuildApplet install_PythonLauncher install_IDLE install_pythonw4way install_versionedtools
     48installapps: install_Python install_pythonw install_BuildApplet install_PythonLauncher \
     49        install_IDLE checkapplepython install_versionedtools
    5450
    5551
     
    5753        $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)"
    5854        $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/python$(VERSION)"
    59         ln -sf python$(VERSION) "$(DESTDIR)$(prefix)/bin/python"
    60         ln -sf pythonw$(VERSION) "$(DESTDIR)$(prefix)/bin/pythonw"
    61 
    62 
    63 # Install 3 variants of python/pythonw:
    64 #       - 32-bit (i386 and ppc)
    65 #       - 64-bit (x86_64 and ppc64)
    66 #       - all    (all four architectures)
    67 #       - Make 'python' and 'pythonw' aliases for the 32-bit variant
    68 install_pythonw4way: pythonw-32 pythonw-64 pythonw
    69         $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-64 "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-64"
    70         $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-64 "$(DESTDIR)$(prefix)/bin/python$(VERSION)-64"
    71         ln -sf python$(VERSION)-64 "$(DESTDIR)$(prefix)/bin/python-64"
    72         ln -sf pythonw$(VERSION)-64 "$(DESTDIR)$(prefix)/bin/pythonw-64"
    73 
    74         $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-32 "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-32"
    75         $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw-32 "$(DESTDIR)$(prefix)/bin/python$(VERSION)-32"
    76         ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python-32"
    77         ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw-32"
    78 
    79         $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-all"
    80         $(INSTALL_PROGRAM) $(STRIPFLAG) pythonw "$(DESTDIR)$(prefix)/bin/python$(VERSION)-all"
    81         ln -sf python$(VERSION)-all "$(DESTDIR)$(prefix)/bin/python-all"
    82         ln -sf pythonw$(VERSION)-all "$(DESTDIR)$(prefix)/bin/pythonw-all"
    83 
    84         ln -sf pythonw$(VERSION)-32     "$(DESTDIR)$(prefix)/bin/pythonw$(VERSION)"
    85         ln -sf python$(VERSION)-32      "$(DESTDIR)$(prefix)/bin/python$(VERSION)"
    86         ln -sf pythonw$(VERSION)-32     "$(DESTDIR)$(prefix)/bin/pythonw"
    87         ln -sf python$(VERSION)-32      "$(DESTDIR)$(prefix)/bin/python"
     55        ln -sf python$(VERSION) "$(DESTDIR)$(prefix)/bin/python2"
     56        ln -sf python2 "$(DESTDIR)$(prefix)/bin/python"
     57        ln -sf pythonw$(VERSION) "$(DESTDIR)$(prefix)/bin/pythonw2"
     58        ln -sf pythonw2 "$(DESTDIR)$(prefix)/bin/pythonw"
     59ifneq ($(LIPO_32BIT_FLAGS),)
     60        lipo $(LIPO_32BIT_FLAGS) -output $(DESTDIR)$(prefix)/bin/python$(VERSION)-32 pythonw
     61        lipo $(LIPO_32BIT_FLAGS) -output $(DESTDIR)$(prefix)/bin/pythonw$(VERSION)-32 pythonw
     62        ln -sf python$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/python2-32"
     63        ln -sf python2-32 "$(DESTDIR)$(prefix)/bin/python-32"
     64        ln -sf pythonw$(VERSION)-32 "$(DESTDIR)$(prefix)/bin/pythonw2-32"
     65        ln -sf pythonw2-32 "$(DESTDIR)$(prefix)/bin/pythonw-32"
     66endif
     67
    8868
    8969#
     
    9575                $(INSTALL) -d -m $(DIRMODE) "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin" ;\
    9676        fi
    97         for fn in python pythonw idle pydoc python-config smtpd.py   \
     77        for fn in python pythonw idle pydoc python-config smtpd.py 2to3 \
     78                  python2 pythonw2 idle2 \
     79                  pydoc2 python2-config smtpd2.py \
     80                  2to3-2 \
    9881                  python$(VERSION) pythonw$(VERSION) idle$(VERSION) \
    99                   pydoc$(VERSION) python$(VERSION)-config smtpd$(VERSION).py ;\
     82                  pydoc$(VERSION) python$(VERSION)-config smtpd$(VERSION).py \
     83                  2to3-$(VERSION) ;\
    10084        do \
    10185                ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
    10286        done
    103 
    104 
    105 # TODO: install symlinks for -32, -64 and -all as well
    106 installunixtools4way: installunixtools
     87ifneq ($(LIPO_32BIT_FLAGS),)
     88        for fn in python-32 pythonw-32 \
     89                  python2-32 pythonw2-32 \
     90                  python$(VERSION)-32 pythonw$(VERSION)-32 ;\
     91        do \
     92                ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
     93        done
     94endif
    10795
    10896
     
    119107                ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
    120108        done
    121 
    122 # TODO: -32, -64 and -all variants
    123 altinstallunixtools4way: altinstallunixtools
     109ifneq ($(LIPO_32BIT_FLAGS),)
     110        for fn in python$(VERSION)-32 pythonw$(VERSION)-32 ;\
     111        do \
     112                ln -fs "$(prefix)/bin/$${fn}" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/$${fn}" ;\
     113        done
     114endif
     115        ln -fs "$(prefix)/bin/2to3-$(VERSION)" "$(DESTDIR)$(FRAMEWORKUNIXTOOLSPREFIX)/bin/2to3-$(VERSION)" ;\
    124116
    125117# By default most tools are installed without a version in their basename, to
     
    134126                fi ;\
    135127                mv "$(DESTDIR)$(prefix)/bin/$${fn}" "$(DESTDIR)$(prefix)/bin/$${fn}$(VERSION)"  ;\
    136                 ln -sf "$${fn}$(VERSION)" "$(DESTDIR)$(prefix)/bin/$${fn}" ;\
    137         done
    138         if [ ! -h "$(DESTDIR)$(prefix)/bin/python-config" ]; then \
    139                 mv "$(DESTDIR)$(prefix)/bin/python-config" "$(DESTDIR)$(prefix)/bin/python$(VERSION)-config" ;\
    140                 ln -sf "python$(VERSION)-config" "$(DESTDIR)$(prefix)/bin/python-config" ; \
    141         fi
     128                ln -sf "$${fn}$(VERSION)" "$(DESTDIR)$(prefix)/bin/$${fn}2" ;\
     129                ln -sf "$${fn}2" "$(DESTDIR)$(prefix)/bin/$${fn}" ;\
     130        done
    142131        if [ ! -h "$(DESTDIR)$(prefix)/bin/smtpd.py" ]; then \
    143132                mv "$(DESTDIR)$(prefix)/bin/smtpd.py" "$(DESTDIR)$(prefix)/bin/smtpd$(VERSION).py"  ;\
    144                 ln -sf "smtpd$(VERSION).py" "$(DESTDIR)$(prefix)/bin/smtpd.py" ;\
     133                ln -sf "smtpd$(VERSION).py" "$(DESTDIR)$(prefix)/bin/smtpd2.py" ;\
     134                ln -sf "smtpd2.py" "$(DESTDIR)$(prefix)/bin/smtpd.py" ;\
     135        fi
     136        if [ ! -h "$(DESTDIR)$(prefix)/bin/2to3" ]; then \
     137                mv "$(DESTDIR)$(prefix)/bin/2to3" "$(DESTDIR)$(prefix)/bin/2to3-$(VERSION)"  ;\
     138                ln -sf "2to3-$(VERSION)" "$(DESTDIR)$(prefix)/bin/2to3-2" ;\
     139                ln -sf "2to3-2" "$(DESTDIR)$(prefix)/bin/2to3" ;\
    145140        fi
    146141
    147142
    148143pythonw: $(srcdir)/Tools/pythonw.c Makefile
    149         $(CC) $(LDFLAGS) -o $@ $(srcdir)/Tools/pythonw.c \
    150                 -DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"'
    151 
    152 pythonw-32: $(srcdir)/Tools/pythonw.c Makefile
    153         $(CC) $(subst -arch x86_64,,$(subst -arch ppc64,,$(LDFLAGS))) -o $@ @UNIVERSAL_ARCH32_FLAGS@ $(srcdir)/Tools/pythonw.c \
    154                 -DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-32"'
    155 
    156 pythonw-64: $(srcdir)/Tools/pythonw.c Makefile
    157         $(CC) $(subst -arch i386,,$(subst -arch ppc,,$(LDFLAGS))) -o $@ @UNIVERSAL_ARCH64_FLAGS@ $(srcdir)/Tools/pythonw.c \
    158                 -DPYTHONWEXECUTABLE='"$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-64"'
     144        $(CC) $(LDFLAGS) -DPYTHONFRAMEWORK='"$(PYTHONFRAMEWORK)"' -o $@ $(srcdir)/Tools/pythonw.c -I.. -I$(srcdir)/../Include ../$(PYTHONFRAMEWORK).framework/Versions/$(VERSION)/$(PYTHONFRAMEWORK)
    159145
    160146install_PythonLauncher:
     
    162148
    163149install_Python:
    164         @if test ! -f $(DOCINDEX); then \
    165                 echo WARNING: you should run Apple Help Indexing Tool on $(DOCDIR); \
    166         fi
    167150        @for i in "$(PYTHONAPPSDIR)" "$(APPINSTALLDIR)" "$(APPINSTALLDIR)/Contents"; do \
    168151                if test ! -d "$(DESTDIR)$$i"; then \
     
    215198        rm "$(DESTDIR)$(APPINSTALLDIR)/Contents/Info.plist.in"
    216199
    217 install_Python4way: install_Python
    218         lipo  @LIPO_32BIT_FLAGS@ -output "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-32" "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"
    219         lipo  @LIPO_64BIT_FLAGS@ -output "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)-64" "$(DESTDIR)$(APPINSTALLDIR)/Contents/MacOS/$(PYTHONFRAMEWORK)"
    220 
    221 
    222200
    223201install_IDLE:
     
    225203
    226204install_BuildApplet:
    227         $(RUNSHARED) @ARCH_RUN_32BIT@ $(BUILDPYTHON) $(srcdir)/scripts/BuildApplet.py \
    228                 --destroot "$(DESTDIR)" \
    229                 --python=$(prefix)/Resources/Python.app/Contents/MacOS/$(PYTHONFRAMEWORK)`test -f "$(DESTDIR)$(prefix)/Resources/Python.app/Contents/MacOS/$(PYTHONFRAMEWORK)-32" && echo "-32"`  \
    230                 --output "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app" \
    231                 $(srcdir)/scripts/BuildApplet.py
     205        if ! $(RUNSHARED) @ARCH_RUN_32BIT@ $(BUILDPYTHON) \
     206                        -c 'import EasyDialogs' 2>/dev/null ; then \
     207                echo "EasyDialogs not available in this Python - skipping Build Applet.app" ; \
     208        else \
     209                $(RUNSHARED) @ARCH_RUN_32BIT@ $(BUILDPYTHON) $(srcdir)/scripts/BuildApplet.py \
     210                        --destroot "$(DESTDIR)" \
     211                        --python=$(prefix)/Resources/Python.app/Contents/MacOS/Python \
     212                        --output "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app" \
     213                        $(srcdir)/scripts/BuildApplet.py && \
     214                if [ -n "$(LIPO_32BIT_FLAGS)" ] ; then \
     215                        rm "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app/Contents/MacOS/Python" && \
     216                        lipo $(LIPO_32BIT_FLAGS) \
     217                                -output "$(DESTDIR)$(PYTHONAPPSDIR)/Build Applet.app/Contents/MacOS/Python" \
     218                                $(BUILDPYTHON) ; \
     219                fi \
     220        fi
    232221
    233222MACLIBDEST=$(LIBDEST)/plat-mac
Note: See TracChangeset for help on using the changeset viewer.