mirror of
https://github.com/python/cpython.git
synced 2025-08-19 16:20:59 +00:00
Merged revisions 74672 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r74672 | ronald.oussoren | 2009-09-06 12:00:26 +0200 (Sun, 06 Sep 2009) | 1 line Fix build issues on OSX 10.6 (issue 6802) ........
This commit is contained in:
parent
76e9643088
commit
461f2205cc
8 changed files with 113 additions and 23 deletions
|
@ -58,7 +58,11 @@ unpacker_coercions = {
|
||||||
# Some python types we need in the packer:
|
# Some python types we need in the packer:
|
||||||
#
|
#
|
||||||
AEDescType = AE.AEDescType
|
AEDescType = AE.AEDescType
|
||||||
FSSType = Carbon.File.FSSpecType
|
try:
|
||||||
|
FSSType = Carbon.File.FSSpecType
|
||||||
|
except AttributeError:
|
||||||
|
class FSSType:
|
||||||
|
pass
|
||||||
FSRefType = Carbon.File.FSRefType
|
FSRefType = Carbon.File.FSRefType
|
||||||
AliasType = Carbon.File.AliasType
|
AliasType = Carbon.File.AliasType
|
||||||
|
|
||||||
|
|
|
@ -119,8 +119,13 @@ def decode(infile, outpath, resonly=False, verbose=False):
|
||||||
if not hasattr(infile, 'read'):
|
if not hasattr(infile, 'read'):
|
||||||
if isinstance(infile, Carbon.File.Alias):
|
if isinstance(infile, Carbon.File.Alias):
|
||||||
infile = infile.ResolveAlias()[0]
|
infile = infile.ResolveAlias()[0]
|
||||||
|
|
||||||
|
if hasattr(Carbon.File, "FSSpec"):
|
||||||
if isinstance(infile, (Carbon.File.FSSpec, Carbon.File.FSRef)):
|
if isinstance(infile, (Carbon.File.FSSpec, Carbon.File.FSRef)):
|
||||||
infile = infile.as_pathname()
|
infile = infile.as_pathname()
|
||||||
|
else:
|
||||||
|
if isinstance(infile, Carbon.File.FSRef):
|
||||||
|
infile = infile.as_pathname()
|
||||||
infile = open(infile, 'rb')
|
infile = open(infile, 'rb')
|
||||||
|
|
||||||
asfile = AppleSingle(infile, verbose=verbose)
|
asfile = AppleSingle(infile, verbose=verbose)
|
||||||
|
|
|
@ -15,7 +15,10 @@ import Carbon.File
|
||||||
import MacOS
|
import MacOS
|
||||||
import macostools
|
import macostools
|
||||||
import macresource
|
import macresource
|
||||||
import EasyDialogs
|
try:
|
||||||
|
import EasyDialogs
|
||||||
|
except ImportError:
|
||||||
|
EasyDialogs = None
|
||||||
import shutil
|
import shutil
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,6 +70,10 @@ def process(template, filename, destname, copy_codefragment=0,
|
||||||
rsrcname=None, others=[], raw=0, progress="default", destroot=""):
|
rsrcname=None, others=[], raw=0, progress="default", destroot=""):
|
||||||
|
|
||||||
if progress == "default":
|
if progress == "default":
|
||||||
|
if EasyDialogs is None:
|
||||||
|
print "Compiling %s"%(os.path.split(filename)[1],)
|
||||||
|
process = None
|
||||||
|
else:
|
||||||
progress = EasyDialogs.ProgressBar("Processing %s..."%os.path.split(filename)[1], 120)
|
progress = EasyDialogs.ProgressBar("Processing %s..."%os.path.split(filename)[1], 120)
|
||||||
progress.label("Compiling...")
|
progress.label("Compiling...")
|
||||||
progress.inc(0)
|
progress.inc(0)
|
||||||
|
@ -119,6 +126,10 @@ def update(template, filename, output):
|
||||||
if MacOS.runtimemodel == 'macho':
|
if MacOS.runtimemodel == 'macho':
|
||||||
raise BuildError, "No updating yet for MachO applets"
|
raise BuildError, "No updating yet for MachO applets"
|
||||||
if progress:
|
if progress:
|
||||||
|
if EasyDialogs is None:
|
||||||
|
print "Updating %s"%(os.path.split(filename)[1],)
|
||||||
|
progress = None
|
||||||
|
else:
|
||||||
progress = EasyDialogs.ProgressBar("Updating %s..."%os.path.split(filename)[1], 120)
|
progress = EasyDialogs.ProgressBar("Updating %s..."%os.path.split(filename)[1], 120)
|
||||||
else:
|
else:
|
||||||
progress = None
|
progress = None
|
||||||
|
|
|
@ -79,8 +79,8 @@ def open_pathname(pathname, verbose=0):
|
||||||
AppleSingle file"""
|
AppleSingle file"""
|
||||||
try:
|
try:
|
||||||
refno = Res.FSpOpenResFile(pathname, 1)
|
refno = Res.FSpOpenResFile(pathname, 1)
|
||||||
except Res.Error, arg:
|
except (AttributeError, Res.Error), arg:
|
||||||
if arg[0] in (-37, -39):
|
if isinstance(arg, AttributeError) or arg[0] in (-37, -39):
|
||||||
# No resource fork. We may be on OSX, and this may be either
|
# No resource fork. We may be on OSX, and this may be either
|
||||||
# a data-fork based resource file or a AppleSingle file
|
# a data-fork based resource file or a AppleSingle file
|
||||||
# from the CVS repository.
|
# from the CVS repository.
|
||||||
|
@ -106,8 +106,8 @@ def resource_pathname(pathname, verbose=0):
|
||||||
try:
|
try:
|
||||||
refno = Res.FSpOpenResFile(pathname, 1)
|
refno = Res.FSpOpenResFile(pathname, 1)
|
||||||
Res.CloseResFile(refno)
|
Res.CloseResFile(refno)
|
||||||
except Res.Error, arg:
|
except (AttributeError, Res.Error), arg:
|
||||||
if arg[0] in (-37, -39):
|
if instance(arg, AttributeError), or arg[0] in (-37, -39):
|
||||||
# No resource fork. We may be on OSX, and this may be either
|
# No resource fork. We may be on OSX, and this may be either
|
||||||
# a data-fork based resource file or a AppleSingle file
|
# a data-fork based resource file or a AppleSingle file
|
||||||
# from the CVS repository.
|
# from the CVS repository.
|
||||||
|
|
|
@ -59,6 +59,9 @@ class TestAepack(unittest.TestCase):
|
||||||
import Carbon.File
|
import Carbon.File
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
|
|
||||||
|
if not hasattr(Carbon.File, "FSSpec"):
|
||||||
|
return
|
||||||
o = Carbon.File.FSSpec(os.curdir)
|
o = Carbon.File.FSSpec(os.curdir)
|
||||||
packed = aepack.pack(o)
|
packed = aepack.pack(o)
|
||||||
unpacked = aepack.unpack(packed)
|
unpacked = aepack.unpack(packed)
|
||||||
|
@ -69,6 +72,8 @@ class TestAepack(unittest.TestCase):
|
||||||
import Carbon.File
|
import Carbon.File
|
||||||
except:
|
except:
|
||||||
return
|
return
|
||||||
|
if not hasattr(Carbon.File, "FSSpec"):
|
||||||
|
return
|
||||||
o = Carbon.File.FSSpec(os.curdir).NewAliasMinimal()
|
o = Carbon.File.FSSpec(os.curdir).NewAliasMinimal()
|
||||||
packed = aepack.pack(o)
|
packed = aepack.pack(o)
|
||||||
unpacked = aepack.unpack(packed)
|
unpacked = aepack.unpack(packed)
|
||||||
|
|
|
@ -12,7 +12,10 @@ sys.stdout = sys.stderr
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import MacOS
|
import MacOS
|
||||||
import EasyDialogs
|
try:
|
||||||
|
import EasyDialogs
|
||||||
|
except ImportError:
|
||||||
|
EasyDialogs = None
|
||||||
import buildtools
|
import buildtools
|
||||||
import getopt
|
import getopt
|
||||||
|
|
||||||
|
@ -32,6 +35,9 @@ def main():
|
||||||
try:
|
try:
|
||||||
buildapplet()
|
buildapplet()
|
||||||
except buildtools.BuildError, detail:
|
except buildtools.BuildError, detail:
|
||||||
|
if EasyDialogs is None:
|
||||||
|
print detail
|
||||||
|
else:
|
||||||
EasyDialogs.Message(detail)
|
EasyDialogs.Message(detail)
|
||||||
|
|
||||||
|
|
||||||
|
@ -46,6 +52,10 @@ def buildapplet():
|
||||||
# Ask for source text if not specified in sys.argv[1:]
|
# Ask for source text if not specified in sys.argv[1:]
|
||||||
|
|
||||||
if not sys.argv[1:]:
|
if not sys.argv[1:]:
|
||||||
|
if EasyDialogs is None:
|
||||||
|
usage()
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
filename = EasyDialogs.AskFileForOpen(message='Select Python source or applet:',
|
filename = EasyDialogs.AskFileForOpen(message='Select Python source or applet:',
|
||||||
typeList=('TEXT', 'APPL'))
|
typeList=('TEXT', 'APPL'))
|
||||||
if not filename:
|
if not filename:
|
||||||
|
|
|
@ -185,6 +185,8 @@ Extension Modules
|
||||||
Build
|
Build
|
||||||
-----
|
-----
|
||||||
|
|
||||||
|
- Issue #6802: Fix build issues on MacOSX 10.6
|
||||||
|
|
||||||
- Issue 5390: Add uninstall icon independent of whether file
|
- Issue 5390: Add uninstall icon independent of whether file
|
||||||
extensions are installed.
|
extensions are installed.
|
||||||
|
|
||||||
|
|
65
configure.in
65
configure.in
|
@ -92,7 +92,6 @@ AC_ARG_ENABLE(universalsdk,
|
||||||
])
|
])
|
||||||
AC_SUBST(UNIVERSALSDK)
|
AC_SUBST(UNIVERSALSDK)
|
||||||
|
|
||||||
ARCH_RUN_32BIT=
|
|
||||||
AC_SUBST(ARCH_RUN_32BIT)
|
AC_SUBST(ARCH_RUN_32BIT)
|
||||||
|
|
||||||
UNIVERSAL_ARCHS="32-bit"
|
UNIVERSAL_ARCHS="32-bit"
|
||||||
|
@ -921,6 +920,7 @@ yes)
|
||||||
|
|
||||||
elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
|
elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
|
||||||
UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
|
UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
|
||||||
|
ARCH_RUN_32BIT="true"
|
||||||
|
|
||||||
elif test "$UNIVERSAL_ARCHS" = "all" ; then
|
elif test "$UNIVERSAL_ARCHS" = "all" ; then
|
||||||
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
|
UNIVERSAL_ARCH_FLAGS="-arch i386 -arch ppc -arch ppc64 -arch x86_64"
|
||||||
|
@ -944,13 +944,23 @@ yes)
|
||||||
cur_target=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
|
cur_target=`sw_vers -productVersion | sed 's/\(10\.[[0-9]]*\).*/\1/'`
|
||||||
if test ${cur_target} '>' 10.2; then
|
if test ${cur_target} '>' 10.2; then
|
||||||
cur_target=10.3
|
cur_target=10.3
|
||||||
fi
|
if test ${enable_universalsdk}; then
|
||||||
if test "${UNIVERSAL_ARCHS}" = "all"; then
|
if test "${UNIVERSAL_ARCHS}" = "all"; then
|
||||||
# Ensure that the default platform for a 4-way
|
# Ensure that the default platform for a
|
||||||
# universal build is OSX 10.5, that's the first
|
# 4-way universal build is OSX 10.5,
|
||||||
# OS release where 4-way builds make sense.
|
# that's the first OS release where
|
||||||
|
# 4-way builds make sense.
|
||||||
cur_target='10.5'
|
cur_target='10.5'
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
if test `arch` = "i386"; then
|
||||||
|
# On Intel macs default to a deployment
|
||||||
|
# target of 10.4, that's the first OSX
|
||||||
|
# release with Intel support.
|
||||||
|
cur_target="10.4"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
|
CONFIGURE_MACOSX_DEPLOYMENT_TARGET=${MACOSX_DEPLOYMENT_TARGET-${cur_target}}
|
||||||
|
|
||||||
# Make sure that MACOSX_DEPLOYMENT_TARGET is set in the
|
# Make sure that MACOSX_DEPLOYMENT_TARGET is set in the
|
||||||
|
@ -1519,6 +1529,8 @@ case $ac_sys_system/$ac_sys_release in
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
ARCH_RUN_32BIT=""
|
||||||
AC_SUBST(LIBTOOL_CRUFT)
|
AC_SUBST(LIBTOOL_CRUFT)
|
||||||
case $ac_sys_system/$ac_sys_release in
|
case $ac_sys_system/$ac_sys_release in
|
||||||
Darwin/@<:@01567@:>@\..*)
|
Darwin/@<:@01567@:>@\..*)
|
||||||
|
@ -1538,7 +1550,48 @@ case $ac_sys_system/$ac_sys_release in
|
||||||
else
|
else
|
||||||
LIBTOOL_CRUFT=""
|
LIBTOOL_CRUFT=""
|
||||||
fi
|
fi
|
||||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only `arch`"
|
AC_TRY_RUN([[
|
||||||
|
#include <unistd.h>
|
||||||
|
int main(int argc, char*argv[])
|
||||||
|
{
|
||||||
|
if (sizeof(long) == 4) {
|
||||||
|
return 0;
|
||||||
|
} else {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
]], ac_osx_32bit=yes,
|
||||||
|
ac_osx_32bit=no,
|
||||||
|
ac_osx_32bit=no)
|
||||||
|
|
||||||
|
if test "${ac_osx_32bit}" = "yes"; then
|
||||||
|
case `arch` in
|
||||||
|
i386)
|
||||||
|
MACOSX_DEFAULT_ARCH="i386"
|
||||||
|
;;
|
||||||
|
ppc)
|
||||||
|
MACOSX_DEFAULT_ARCH="ppc"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
else
|
||||||
|
case `arch` in
|
||||||
|
i386)
|
||||||
|
MACOSX_DEFAULT_ARCH="x86_64"
|
||||||
|
;;
|
||||||
|
ppc)
|
||||||
|
MACOSX_DEFAULT_ARCH="ppc64"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
AC_MSG_ERROR([Unexpected output of 'arch' on OSX])
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
#ARCH_RUN_32BIT="true"
|
||||||
|
fi
|
||||||
|
|
||||||
|
LIBTOOL_CRUFT=$LIBTOOL_CRUFT" -lSystem -lSystemStubs -arch_only ${MACOSX_DEFAULT_ARCH}"
|
||||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -install_name $(PYTHONFRAMEWORKINSTALLDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK)'
|
||||||
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
|
LIBTOOL_CRUFT=$LIBTOOL_CRUFT' -compatibility_version $(VERSION) -current_version $(VERSION)';;
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue