Skip to content

Commit 0d236eb

Browse files
Fix build issue on OSX 10.4
1 parent 3f67c43 commit 0d236eb

6 files changed

Lines changed: 80 additions & 8 deletions

File tree

‎Mac/Modules/MacOS.c‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
3030
#include <Carbon/Carbon.h>
3131
#include <ApplicationServices/ApplicationServices.h>
3232

33+
#ifndef HAVE_MACOS105_SDK
34+
typedef SInt16 FSIORefNum;
35+
#endif
3336

3437
static PyObject *MacOS_Error; /* Exception MacOS.Error */
3538

‎Mac/Modules/ae/_AEmodule.c‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
#include "pymactoolbox.h"
99

10+
#ifndef HAVE_OSX105_SDK
11+
typedef SInt32 SRefCon;
12+
#endif
13+
1014
/* Macro to test whether a weak-loaded CFM function exists */
1115
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
1216
PyErr_SetString(PyExc_NotImplementedError, \

‎Mac/Modules/file/_Filemodule.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77

88
#include "pymactoolbox.h"
99

10+
#ifndef HAVE_MACOS105_SDK
11+
typedef SInt16 FSIORefNum;
12+
#endif
13+
1014
/* Macro to test whether a weak-loaded CFM function exists */
1115
#define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\
1216
PyErr_SetString(PyExc_NotImplementedError, \
@@ -193,10 +197,6 @@ static int FSCatalogInfo_Convert(PyObject *v, FSCatalogInfo *p_itself)
193197
static void FSCatalogInfo_dealloc(FSCatalogInfoObject *self)
194198
{
195199
/* Cleanup of self->ob_itself goes here */
196-
FSPermissionInfo* info = (FSPermissionInfo*)&(self->ob_itself.permissions);
197-
if (info->fileSec != NULL) {
198-
CFRelease(info->fileSec);
199-
}
200200
self->ob_type->tp_free((PyObject *)self);
201201
}
202202

‎configure‎

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#! /bin/sh
2-
# From configure.in Revision: 63690 .
2+
# From configure.in Revision: 63955 .
33
# Guess values for system-dependent variables and create Makefiles.
44
# Generated by GNU Autoconf 2.61 for python 2.6.
55
#
@@ -4659,6 +4659,7 @@ echo "$as_me: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&2
46594659

46604660

46614661
BASECFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
4662+
CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
46624663
fi
46634664

46644665
;;
@@ -12400,6 +12401,7 @@ esac
1240012401
echo "${ECHO_T}$enable_toolbox_glue" >&6; }
1240112402

1240212403

12404+
1240312405
case $ac_sys_system/$ac_sys_release in
1240412406
Darwin/[01567]\..*)
1240512407
OTHER_LIBTOOL_OPT="-prebind -seg1addr 0x10000000"
@@ -12746,6 +12748,7 @@ fi
1274612748
echo "${ECHO_T}$LINKFORSHARED" >&6; }
1274712749

1274812750

12751+
1274912752
{ echo "$as_me:$LINENO: checking CFLAGSFORSHARED" >&5
1275012753
echo $ECHO_N "checking CFLAGSFORSHARED... $ECHO_C" >&6; }
1275112754
if test ! "$LIBRARY" = "$LDLIBRARY"
@@ -15309,6 +15312,58 @@ if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
1530915312
fi
1531015313
fi
1531115314

15315+
{ echo "$as_me:$LINENO: checking for OSX 10.5 SDK or later" >&5
15316+
echo $ECHO_N "checking for OSX 10.5 SDK or later... $ECHO_C" >&6; }
15317+
cat >conftest.$ac_ext <<_ACEOF
15318+
/* confdefs.h. */
15319+
_ACEOF
15320+
cat confdefs.h >>conftest.$ac_ext
15321+
cat >>conftest.$ac_ext <<_ACEOF
15322+
/* end confdefs.h. */
15323+
#include <Carbon/Carbon.h>
15324+
int
15325+
main ()
15326+
{
15327+
FSIORefNum fRef = 0
15328+
;
15329+
return 0;
15330+
}
15331+
_ACEOF
15332+
rm -f conftest.$ac_objext
15333+
if { (ac_try="$ac_compile"
15334+
case "(($ac_try" in
15335+
*\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
15336+
*) ac_try_echo=$ac_try;;
15337+
esac
15338+
eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
15339+
(eval "$ac_compile") 2>conftest.er1
15340+
ac_status=$?
15341+
grep -v '^ *+' conftest.er1 >conftest.err
15342+
rm -f conftest.er1
15343+
cat conftest.err >&5
15344+
echo "$as_me:$LINENO: \$? = $ac_status" >&5
15345+
(exit $ac_status); } && {
15346+
test -z "$ac_c_werror_flag" ||
15347+
test ! -s conftest.err
15348+
} && test -s conftest.$ac_objext; then
15349+
15350+
cat >>confdefs.h <<\_ACEOF
15351+
#define HAVE_OSX105_SDK 1
15352+
_ACEOF
15353+
15354+
{ echo "$as_me:$LINENO: result: yes" >&5
15355+
echo "${ECHO_T}yes" >&6; }
15356+
else
15357+
echo "$as_me: failed program was:" >&5
15358+
sed 's/^/| /' conftest.$ac_ext >&5
15359+
15360+
{ echo "$as_me:$LINENO: result: no" >&5
15361+
echo "${ECHO_T}no" >&6; }
15362+
15363+
fi
15364+
15365+
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
15366+
1531215367
# Check for --with-doc-strings
1531315368
{ echo "$as_me:$LINENO: checking for --with-doc-strings" >&5
1531415369
echo $ECHO_N "checking for --with-doc-strings... $ECHO_C" >&6; }

‎configure.in‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -918,6 +918,7 @@ yes)
918918

919919

920920
BASECFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${BASECFLAGS}"
921+
CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}"
921922
fi
922923

923924
;;
@@ -1456,6 +1457,7 @@ yes)
14561457
esac
14571458
AC_MSG_RESULT($enable_toolbox_glue)
14581459

1460+
14591461
AC_SUBST(OTHER_LIBTOOL_OPT)
14601462
case $ac_sys_system/$ac_sys_release in
14611463
Darwin/@<:@01567@:>@\..*)
@@ -1781,6 +1783,7 @@ then
17811783
fi
17821784
AC_MSG_RESULT($LINKFORSHARED)
17831785

1786+
17841787
AC_SUBST(CFLAGSFORSHARED)
17851788
AC_MSG_CHECKING(CFLAGSFORSHARED)
17861789
if test ! "$LIBRARY" = "$LDLIBRARY"
@@ -2297,6 +2300,13 @@ if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
22972300
fi
22982301
fi
22992302

2303+
AC_MSG_CHECKING(for OSX 10.5 SDK or later)
2304+
AC_TRY_COMPILE([#include <Carbon/Carbon.h>], FSIORefNum fRef = 0,
2305+
AC_DEFINE(HAVE_OSX105_SDK, 1, Define if compiling using MacOS X 10.5 SDK or later.)
2306+
AC_MSG_RESULT(yes),
2307+
AC_MSG_RESULT(no)
2308+
)
2309+
23002310
# Check for --with-doc-strings
23012311
AC_MSG_CHECKING(for --with-doc-strings)
23022312
AC_ARG_WITH(doc-strings,

‎pyconfig.h.in‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -426,6 +426,9 @@
426426
/* Define to 1 if you have the `openpty' function. */
427427
#undef HAVE_OPENPTY
428428

429+
/* Define if compiling using MacOS X 10.5 SDK or later. */
430+
#undef HAVE_OSX105_SDK
431+
429432
/* Define to 1 if you have the `pathconf' function. */
430433
#undef HAVE_PATHCONF
431434

@@ -489,9 +492,6 @@
489492
/* Define if you have readline 4.2 */
490493
#undef HAVE_RL_COMPLETION_MATCHES
491494

492-
/* Define when using libedit's readline emulation */
493-
#undef HAVE_RL_DISPM_VFUNC
494-
495495
/* Define if you have readline 4.0 */
496496
#undef HAVE_RL_PRE_INPUT_HOOK
497497

0 commit comments

Comments
 (0)