Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
755740f3
Commit
755740f3
authored
Feb 07, 2010
by
Ronald Oussoren
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forward port a number of OSX bugfixes from the trunk to 3.2
parent
a5336b60
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
104 additions
and
8 deletions
+104
-8
Mac/Makefile.in
Mac/Makefile.in
+1
-0
Mac/Tools/pythonw.c
Mac/Tools/pythonw.c
+28
-5
Modules/posixmodule.c
Modules/posixmodule.c
+4
-0
configure
configure
+36
-2
configure.in
configure.in
+29
-1
pyconfig.h.in
pyconfig.h.in
+6
-0
No files found.
Mac/Makefile.in
View file @
755740f3
...
...
@@ -16,6 +16,7 @@ FRAMEWORKUNIXTOOLSPREFIX=@FRAMEWORKUNIXTOOLSPREFIX@
PYTHONFRAMEWORK
=
@PYTHONFRAMEWORK@
PYTHONFRAMEWORKIDENTIFIER
=
@PYTHONFRAMEWORKIDENTIFIER@
LIPO_32BIT_FLAGS
=
@LIPO_32BIT_FLAGS@
CC
=
@CC@
# These are normally glimpsed from the previous set
...
...
Mac/Tools/pythonw.c
View file @
755740f3
...
...
@@ -6,9 +6,21 @@
*
* This program uses posix_spawn rather than plain execv because we need
* slightly more control over how the "real" interpreter is executed.
*
* On OSX 10.4 (and earlier) this falls back to using exec because the
* posix_spawnv functions aren't available there.
*/
#pragma weak_import posix_spawnattr_init
#pragma weak_import posix_spawnattr_setbinpref_np
#pragma weak_import posix_spawnattr_setflags
#pragma weak_import posix_spawn
#include <Python.h>
#include <unistd.h>
#ifdef HAVE_SPAWN_H
#include <spawn.h>
#endif
#include <stdio.h>
#include <string.h>
#include <errno.h>
...
...
@@ -74,6 +86,7 @@ static char* get_python_path(void)
return
g_path
;
}
#ifdef HAVE_SPAWN_H
static
void
setup_spawnattr
(
posix_spawnattr_t
*
spawnattr
)
{
...
...
@@ -132,16 +145,26 @@ setup_spawnattr(posix_spawnattr_t* spawnattr)
/* NOTREACHTED */
}
}
#endif
int
main
(
int
argc
,
char
**
argv
)
{
posix_spawnattr_t
spawnattr
=
NULL
;
char
*
exec_path
=
get_python_path
();
#ifdef HAVE_SPAWN_H
/* We're weak-linking to posix-spawnv to ensure that
* an executable build on 10.5 can work on 10.4.
*/
if
(
posix_spawn
!=
NULL
)
{
posix_spawnattr_t
spawnattr
=
NULL
;
setup_spawnattr
(
&
spawnattr
);
posix_spawn
(
NULL
,
exec_path
,
NULL
,
&
spawnattr
,
argv
,
environ
);
err
(
1
,
"posix_spawn: %s"
,
argv
[
0
]);
setup_spawnattr
(
&
spawnattr
);
posix_spawn
(
NULL
,
exec_path
,
NULL
,
&
spawnattr
,
argv
,
environ
);
err
(
1
,
"posix_spawn: %s"
,
argv
[
0
]);
}
#endif
execve
(
exec_path
,
argv
,
environ
);
err
(
1
,
"execve: %s"
,
argv
[
0
]);
/* NOTREACHED */
}
Modules/posixmodule.c
View file @
755740f3
...
...
@@ -3785,6 +3785,10 @@ posix_fork(PyObject *self, PyObject *noargs)
#else
#ifdef HAVE_LIBUTIL_H
#include <libutil.h>
#else
#ifdef HAVE_UTIL_H
#include <util.h>
#endif
/* HAVE_UTIL_H */
#endif
/* HAVE_LIBUTIL_H */
#endif
/* HAVE_PTY_H */
#ifdef HAVE_STROPTS_H
...
...
configure
View file @
755740f3
#! /bin/sh
# From configure.in Revision: 780
66
.
# From configure.in Revision: 780
73
.
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.61 for python 3.2.
#
...
...
@@ -4640,6 +4640,38 @@ echo "${ECHO_T}$ac_cv_no_strict_aliasing_ok" >&6; }
ARCH_RUN_32BIT
=
""
LIPO_32BIT_FLAGS
=
"-extract ppc7400 -extract i386"
# You have to use different flags on various versions of
# OSX to extract PPC code from an universal binary, basically
# '-arch ppc' on OSX 10.4 and '-arch ppc7400' on anything
# newer.
# Because '-arch pp7400' works on OSX 10.5 or higher this
# test is only present in the '32-bit' branch, all other
# branches require OSX 10.5 to compile.
{
echo
"
$as_me
:
$LINENO
: checking lipo flag for extracting ppc code"
>
&5
echo
$ECHO_N
"checking lipo flag for extracting ppc code...
$ECHO_C
"
>
&6
;
}
FN
=
"test.
$$
"
cat
>
${
FN
}
.c
<<-
EOF
int main() { return 0; }
EOF
${
CC
}
${
CFLAGS
}
-arch
ppc
-arch
i386
-o
${
FN
}
${
FN
}
.c
-isysroot
${
UNIVERSALSDK
}
if
test
$?
!=
0
;
then
rm
${
FN
}
${
FN
}
.c
{
echo
"
$as_me
:
$LINENO
: result: failed, assumee -extract ppc7400"
>
&5
echo
"
${
ECHO_T
}
failed, assumee -extract ppc7400"
>
&6
;
}
else
lipo
"
${
FN
}
"
-extract
ppc7400
-output
"
${
FN
}
.out"
2>/dev/null
if
test
$?
!=
0
;
then
LIPO_32BIT_FLAGS
=
"-extract ppc -extract i386"
{
echo
"
$as_me
:
$LINENO
: result:
\"
'-extract ppc'
\"
"
>
&5
echo
"
${
ECHO_T
}
\"
'-extract ppc'
\"
"
>
&6
;
}
else
{
echo
"
$as_me
:
$LINENO
: result:
\"
'-extract ppc7400'
\"
"
>
&5
echo
"
${
ECHO_T
}
\"
'-extract ppc7400'
\"
"
>
&6
;
}
fi
rm
-f
${
FN
}
${
FN
}
.c
${
FN
}
.out
fi
elif
test
"
$UNIVERSAL_ARCHS
"
=
"64-bit"
;
then
UNIVERSAL_ARCH_FLAGS
=
"-arch ppc64 -arch x86_64"
LIPO_32BIT_FLAGS
=
""
...
...
@@ -5586,6 +5618,8 @@ done
...
...
@@ -5600,7 +5634,7 @@ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
sys/termio.h sys/time.h
\
sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h
\
sys/resource.h netpacket/packet.h sysexits.h bluetooth.h
\
bluetooth/bluetooth.h linux/tipc.h
bluetooth/bluetooth.h linux/tipc.h
spawn.h util.h
do
as_ac_Header
=
`
echo
"ac_cv_header_
$ac_header
"
|
$as_tr_sh
`
if
{
as_var
=
$as_ac_Header
;
eval
"test
\"\$
{
$as_var
+set}
\"
= set"
;
}
;
then
...
...
configure.in
View file @
755740f3
...
...
@@ -898,6 +898,34 @@ yes)
ARCH_RUN_32BIT=""
LIPO_32BIT_FLAGS="-extract ppc7400 -extract i386"
# You have to use different flags on various versions of
# OSX to extract PPC code from an universal binary, basically
# '-arch ppc' on OSX 10.4 and '-arch ppc7400' on anything
# newer.
# Because '-arch pp7400' works on OSX 10.5 or higher this
# test is only present in the '32-bit' branch, all other
# branches require OSX 10.5 to compile.
AC_MSG_CHECKING(lipo flag for extracting ppc code)
FN="test.$$"
cat >${FN}.c <<-EOF
int main() { return 0; }
EOF
${CC} ${CFLAGS} -arch ppc -arch i386 -o ${FN} ${FN}.c -isysroot ${UNIVERSALSDK}
if test $? != 0 ; then
rm ${FN} ${FN}.c
AC_MSG_RESULT([failed, assumee -extract ppc7400])
else
lipo "${FN}" -extract ppc7400 -output "${FN}.out" 2>/dev/null
if test $? != 0 ; then
LIPO_32BIT_FLAGS="-extract ppc -extract i386"
AC_MSG_RESULT("'-extract ppc'")
else
AC_MSG_RESULT("'-extract ppc7400'")
fi
rm -f ${FN} ${FN}.c ${FN}.out
fi
elif test "$UNIVERSAL_ARCHS" = "64-bit" ; then
UNIVERSAL_ARCH_FLAGS="-arch ppc64 -arch x86_64"
LIPO_32BIT_FLAGS=""
...
...
@@ -1251,7 +1279,7 @@ sys/param.h sys/poll.h sys/select.h sys/socket.h sys/statvfs.h sys/stat.h \
sys/termio.h sys/time.h \
sys/times.h sys/types.h sys/un.h sys/utsname.h sys/wait.h pty.h libutil.h \
sys/resource.h netpacket/packet.h sysexits.h bluetooth.h \
bluetooth/bluetooth.h linux/tipc.h)
bluetooth/bluetooth.h linux/tipc.h
spawn.h util.h
)
AC_HEADER_DIRENT
AC_HEADER_MAJOR
...
...
pyconfig.h.in
View file @
755740f3
...
...
@@ -632,6 +632,9 @@
/* Define if you have the 'socketpair' function. */
#undef HAVE_SOCKETPAIR
/* Define to 1 if you have the <spawn.h> header file. */
#undef HAVE_SPAWN_H
/* Define if your compiler provides ssize_t */
#undef HAVE_SSIZE_T
...
...
@@ -850,6 +853,9 @@
Include/unicodeobject.h). */
#undef HAVE_USABLE_WCHAR_T
/* Define to 1 if you have the <util.h> header file. */
#undef HAVE_UTIL_H
/* Define to 1 if you have the `utimes' function. */
#undef HAVE_UTIMES
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment