Changeset 78502


Ignore:
Timestamp:
May 10, 2011, 7:19:08 AM (6 years ago)
Author:
jmr@…
Message:

python24, python25: fix build_arch and universal support (#21248), consolidate some patches

Location:
trunk/dports/lang
Files:
2 added
4 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/dports/lang/python24/Portfile

    r78492 r78502  
    3838                        patch-Mac-OSX-Makefile.in \
    3939                        patch-Mac-OSX-IDLE-Makefile.in \
    40                         patch-Mac-OSX-PythonLauncher-Makefile.in \
    41                         patch-configure-badcflags.diff \
    42                         patch-configure-arch_only.diff
     40                        patch-Mac-OSX-PythonLauncher-Makefile.in
    4341
    4442depends_lib             port:gettext port:openssl
     
    6361        ${worksrcpath}/Mac/OSX/Makefile.in \
    6462        ${worksrcpath}/Mac/OSX/PythonLauncher/Makefile.in
     63    reinplace "s|__BUILD_ARCH__|${build_arch}|" ${worksrcpath}/configure
     64    reinplace "s|__UNIVERSAL_CFLAGS__|${configure.universal_cflags}|" ${worksrcpath}/configure
     65    reinplace "s|__UNIVERSAL_LDFLAGS__|${configure.universal_ldflags}|" ${worksrcpath}/configure
    6566}
    6667
     
    191192}
    192193
    193 configure.universal_archs i386 ppc
    194 
    195194variant universal {
    196195   if {${configure.sdkroot} != ""} {
     
    199198      configure.args-append   --enable-universalsdk=/
    200199   }
     200   post-configure {
     201      system "cd ${worksrcpath} && ed - pyconfig.h < ${filespath}/pyconfig.h-universal.ed"
     202   }
    201203}
    202204
  • trunk/dports/lang/python24/files/patch-configure

    r44176 r78502  
    1 --- configure.orig      2007-04-05 21:32:57.000000000 -0700
    2 +++ configure   2007-04-05 21:32:59.000000000 -0700
    3 @@ -3907,7 +3907,12 @@
     1--- configure.orig      2006-10-18 02:03:36.000000000 +1000
     2+++ configure   2011-05-10 15:15:25.000000000 +1000
     3@@ -3907,9 +3907,16 @@
    44            ;;
    55        # is there any other compiler on Darwin besides gcc?
     
    88+           if [[ `/usr/bin/arch` = 'ppc' ]]
    99+        then
    10 +          BASECFLAGS="$BASECFLAGS -Wno-long-double -no-cpp-precomp -mno-fused-madd -fno-common"
     10+          BASECFLAGS="$BASECFLAGS -mno-fused-madd -fno-common"
    1111+        else
    12 +          BASECFLAGS="$BASECFLAGS -Wno-long-double -no-cpp-precomp -fno-common"
     12+          BASECFLAGS="$BASECFLAGS -fno-common"
    1313+        fi
    1414            if test "${enable_universalsdk}"; then
    15                 BASECFLAGS="-arch ppc -arch i386 -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
     15-               BASECFLAGS="-arch ppc -arch i386 -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
     16+               BASECFLAGS="__UNIVERSAL_CFLAGS__ -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
     17+           else
     18+           BASECFLAGS="-arch __BUILD_ARCH__ ${BASECFLAGS}"
    1619            fi
    17 @@ -10328,7 +10333,7 @@
     20 
     21            ;;
     22@@ -10316,7 +10323,7 @@
     23   Darwin/[01234567].*)
     24     LIBTOOL_CRUFT="-framework System -lcc_dynamic"
     25     if test -z "${enable_universalsdk}"; then
     26-           LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `arch`"
     27+           LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only __BUILD_ARCH__"
     28     fi
     29     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
     30     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
     31@@ -10328,7 +10335,7 @@
    1832         else
    1933             LIBTOOL_CRUFT=""
    2034     fi
    2135-    LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -lSystem -lSystemStubs -arch_only ppc'
    22 +    LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -lSystem -lSystemStubs -arch_only '`/usr/bin/arch`
     36+    LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -lSystem -lSystemStubs -arch_only __BUILD_ARCH__'
    2337     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
    2438     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
    2539 esac
     40@@ -10460,7 +10467,9 @@
     41                if test ${MACOSX_DEPLOYMENT_TARGET-${cur_target}} '>' 10.2
     42                then
     43                        if test "${enable_universalsdk}"; then
     44-                               LDFLAGS="-arch i386 -arch ppc -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
     45+                               LDFLAGS="__UNIVERSAL_LDFLAGS__ -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
     46+                       else
     47+                               LDFLAGS="-arch __BUILD_ARCH__ ${LDFLAGS}"
     48                        fi
     49                        LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup'
     50                        BLDSHARED="$LDSHARED"
  • trunk/dports/lang/python25/Portfile

    r76830 r78502  
    3333                        patch-Lib-distutils-dist.py.diff \
    3434                        patch-setup.py.diff \
    35                         patch-configure-badcflags.diff \
    36                         patch-configure-arch_only.diff \
     35                        patch-configure.diff \
    3736                        patch-64bit.diff
    3837
     
    5857        reinplace "s|xargs -0 rm -r|xargs -0 rm -rf|g" \
    5958                ${worksrcpath}/Mac/PythonLauncher/Makefile.in
     59        reinplace "s|__BUILD_ARCH__|${build_arch}|" ${worksrcpath}/configure
     60        reinplace "s|__UNIVERSAL_CFLAGS__|${configure.universal_cflags}|" ${worksrcpath}/configure
     61        reinplace "s|__UNIVERSAL_LDFLAGS__|${configure.universal_ldflags}|" \
     62            ${worksrcpath}/configure \
     63            ${worksrcpath}/Makefile.pre.in
    6064
    6165        # http://trac.macports.org/ticket/21517
     
    186190}
    187191
    188 configure.universal_archs i386 ppc
    189 
    190192variant universal {
    191193   if {${configure.sdkroot} == ""} {
     
    194196      configure.args-append   --enable-universalsdk=${configure.sdkroot}
    195197   }
     198   post-configure {
     199      system "cd ${worksrcpath} && ed - pyconfig.h < ${filespath}/pyconfig.h-universal.ed"
     200   }
    196201}
    197202
  • trunk/dports/lang/python25/files/patch-Makefile.pre.in.diff

    r43000 r78502  
    1 --- Makefile.pre.in.orig        2007-12-05 13:43:57.000000000 -0700
    2 +++ Makefile.pre.in     2008-07-25 21:41:02.000000000 -0600
     1--- Makefile.pre.in.orig        2008-09-22 10:22:44.000000000 +1000
     2+++ Makefile.pre.in     2011-05-10 16:46:43.000000000 +1000
    33@@ -348,8 +348,8 @@
    44 # Build the shared modules
     
    1212 
    1313 # Build static library
    14 @@ -894,7 +904,7 @@
     14@@ -387,7 +387,7 @@
     15                 $(RESSRCDIR)/English.lproj/InfoPlist.strings
     16        $(INSTALL) -d -m $(DIRMODE) $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)
     17        if test "${UNIVERSALSDK}"; then \
     18-               $(CC) -o $(LDLIBRARY) -arch i386 -arch ppc -dynamiclib \
     19+               $(CC) -o $(LDLIBRARY) __UNIVERSAL_LDFLAGS__ -dynamiclib \
     20                        -isysroot "${UNIVERSALSDK}" \
     21                        -all_load $(LIBRARY) -Wl,-single_module \
     22                        -install_name $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/Python \
     23@@ -894,7 +894,7 @@
    1524 # Install the dynamically loadable modules
    1625 # This goes into $(exec_prefix)
     
    2130                --install-scripts=$(BINDIR) \
    2231                --install-platlib=$(DESTSHARED) \
    23 @@ -968,7 +978,7 @@
     32@@ -968,7 +968,7 @@
    2433 # This installs a few of the useful scripts in Tools/scripts
    2534 scriptsinstall:
  • trunk/dports/lang/python25/files/patch-configure.diff

    r34379 r78502  
    1 --- configure.in.orig   2007-09-28 21:07:32.000000000 +0200
    2 +++ configure.in        2007-09-28 21:08:12.000000000 +0200
    3 @@ -669,6 +669,11 @@
    4           BLDLIBRARY='-L. -lpython$(VERSION)'
    5           RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib}
    6           ;;
    7 +       Darwin*)
    8 +         LDLIBRARY='libpython$(VERSION).dylib'
    9 +         BLDLIBRARY='-L. -lpython$(VERSION)'
    10 +         RUNSHARED=DYLD_LIBRARY_PATH="`pwd`:${DYLD_LIBRARY_PATH}"
    11 +         ;;
    12    esac
    13  else # shared is disabled
    14    case $ac_sys_system in
    15 --- configure.orig      2007-09-28 21:07:26.000000000 +0200
    16 +++ configure   2007-09-28 21:07:33.000000000 +0200
    17 @@ -3445,6 +3445,11 @@
    18           BLDLIBRARY='-L. -lpython$(VERSION)'
    19           RUNSHARED=DLL_PATH=`pwd`:${DLL_PATH:-/atheos/sys/libs:/atheos/autolnk/lib}
    20           ;;
    21 +       Darwin*)
    22 +         LDLIBRARY='libpython$(VERSION).dylib'
    23 +         BLDLIBRARY='-L. -lpython$(VERSION)'
    24 +         RUNSHARED=DYLD_LIBRARY_PATH="`pwd`:${DYLD_LIBRARY_PATH}"
    25 +         ;;
    26    esac
    27  else # shared is disabled
    28    case $ac_sys_system in
     1--- configure.orig      2008-12-14 01:13:52.000000000 +1100
     2+++ configure   2011-05-10 16:25:02.000000000 +1000
     3@@ -4534,9 +4534,11 @@
     4            ;;
     5        # is there any other compiler on Darwin besides gcc?
     6        Darwin*)
     7-           BASECFLAGS="$BASECFLAGS -Wno-long-double -no-cpp-precomp -mno-fused-madd"
     8+           BASECFLAGS="$BASECFLAGS -mno-fused-madd"
     9            if test "${enable_universalsdk}"; then
     10-               BASECFLAGS="-arch ppc -arch i386 -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
     11+               BASECFLAGS="__UNIVERSAL_CFLAGS__ -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
     12+           else
     13+               BASECFLAGS="-arch __BUILD_ARCH__ ${BASECFLAGS}"
     14            fi
     15 
     16            ;;
     17@@ -11362,7 +11364,7 @@
     18     if test "${enable_universalsdk}"; then
     19            :
     20     else
     21-       LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only `arch`"
     22+       LIBTOOL_CRUFT="${LIBTOOL_CRUFT} -arch_only __BUILD_ARCH__"
     23     fi
     24     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
     25     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
     26@@ -11374,7 +11376,7 @@
     27         else
     28             LIBTOOL_CRUFT=""
     29     fi
     30-    LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only `arch`"
     31+    LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only __BUILD_ARCH__"
     32     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
     33     LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
     34 esac
     35@@ -11524,7 +11526,9 @@
     36                if test ${MACOSX_DEPLOYMENT_TARGET-${cur_target}} '>' 10.2
     37                then
     38                        if test "${enable_universalsdk}"; then
     39-                               LDFLAGS="-arch i386 -arch ppc -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
     40+                               LDFLAGS="__UNIVERSAL_LDFLAGS__ -isysroot ${UNIVERSALSDK} ${LDFLAGS}"
     41+                       else
     42+                               LDFLAGS="-arch __BUILD_ARCH__ ${LDFLAGS}"
     43                        fi
     44                        LDSHARED='$(CC) $(LDFLAGS) -bundle -undefined dynamic_lookup'
     45                        BLDSHARED="$LDSHARED"
Note: See TracChangeset for help on using the changeset viewer.