From 0d236eb05a80c088a15eb68d41eec7f3384dd76e Mon Sep 17 00:00:00 2001 From: Ronald Oussoren Date: Fri, 6 Jun 2008 21:31:33 +0000 Subject: Fix build issue on OSX 10.4 --- Mac/Modules/MacOS.c | 3 +++ Mac/Modules/ae/_AEmodule.c | 4 +++ Mac/Modules/file/_Filemodule.c | 8 +++--- configure | 57 +++++++++++++++++++++++++++++++++++++++++- configure.in | 10 ++++++++ pyconfig.h.in | 6 ++--- 6 files changed, 80 insertions(+), 8 deletions(-) diff --git a/Mac/Modules/MacOS.c b/Mac/Modules/MacOS.c index 99e531b..9148fe0 100644 --- a/Mac/Modules/MacOS.c +++ b/Mac/Modules/MacOS.c @@ -30,6 +30,9 @@ OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. #include #include +#ifndef HAVE_MACOS105_SDK +typedef SInt16 FSIORefNum; +#endif static PyObject *MacOS_Error; /* Exception MacOS.Error */ diff --git a/Mac/Modules/ae/_AEmodule.c b/Mac/Modules/ae/_AEmodule.c index dd154c7..e12a30c 100644 --- a/Mac/Modules/ae/_AEmodule.c +++ b/Mac/Modules/ae/_AEmodule.c @@ -7,6 +7,10 @@ #include "pymactoolbox.h" +#ifndef HAVE_OSX105_SDK +typedef SInt32 SRefCon; +#endif + /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ diff --git a/Mac/Modules/file/_Filemodule.c b/Mac/Modules/file/_Filemodule.c index 8ff007f..352ef64 100644 --- a/Mac/Modules/file/_Filemodule.c +++ b/Mac/Modules/file/_Filemodule.c @@ -7,6 +7,10 @@ #include "pymactoolbox.h" +#ifndef HAVE_MACOS105_SDK +typedef SInt16 FSIORefNum; +#endif + /* Macro to test whether a weak-loaded CFM function exists */ #define PyMac_PRECHECK(rtn) do { if ( &rtn == NULL ) {\ PyErr_SetString(PyExc_NotImplementedError, \ @@ -193,10 +197,6 @@ static int FSCatalogInfo_Convert(PyObject *v, FSCatalogInfo *p_itself) static void FSCatalogInfo_dealloc(FSCatalogInfoObject *self) { /* Cleanup of self->ob_itself goes here */ - FSPermissionInfo* info = (FSPermissionInfo*)&(self->ob_itself.permissions); - if (info->fileSec != NULL) { - CFRelease(info->fileSec); - } self->ob_type->tp_free((PyObject *)self); } diff --git a/configure b/configure index 6b94232..2abce67 100755 --- a/configure +++ b/configure @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 63690 . +# From configure.in Revision: 63955 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.61 for python 2.6. # @@ -4659,6 +4659,7 @@ echo "$as_me: error: proper usage is --with-universalarch=32-bit|64-bit|all" >&2 BASECFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${BASECFLAGS}" + CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}" fi ;; @@ -12400,6 +12401,7 @@ esac echo "${ECHO_T}$enable_toolbox_glue" >&6; } + case $ac_sys_system/$ac_sys_release in Darwin/[01567]\..*) OTHER_LIBTOOL_OPT="-prebind -seg1addr 0x10000000" @@ -12746,6 +12748,7 @@ fi echo "${ECHO_T}$LINKFORSHARED" >&6; } + { echo "$as_me:$LINENO: checking CFLAGSFORSHARED" >&5 echo $ECHO_N "checking CFLAGSFORSHARED... $ECHO_C" >&6; } if test ! "$LIBRARY" = "$LDLIBRARY" @@ -15309,6 +15312,58 @@ if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then fi fi +{ echo "$as_me:$LINENO: checking for OSX 10.5 SDK or later" >&5 +echo $ECHO_N "checking for OSX 10.5 SDK or later... $ECHO_C" >&6; } +cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include +int +main () +{ +FSIORefNum fRef = 0 + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (ac_try="$ac_compile" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_compile") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest.$ac_objext; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_OSX105_SDK 1 +_ACEOF + + { echo "$as_me:$LINENO: result: yes" >&5 +echo "${ECHO_T}yes" >&6; } +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + { echo "$as_me:$LINENO: result: no" >&5 +echo "${ECHO_T}no" >&6; } + +fi + +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext + # Check for --with-doc-strings { echo "$as_me:$LINENO: checking for --with-doc-strings" >&5 echo $ECHO_N "checking for --with-doc-strings... $ECHO_C" >&6; } diff --git a/configure.in b/configure.in index 6e8b9fe..2dea658 100644 --- a/configure.in +++ b/configure.in @@ -918,6 +918,7 @@ yes) BASECFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${BASECFLAGS}" + CFLAGS="${UNIVERSAL_ARCH_FLAGS} -isysroot ${UNIVERSALSDK} ${CFLAGS}" fi ;; @@ -1456,6 +1457,7 @@ yes) esac AC_MSG_RESULT($enable_toolbox_glue) + AC_SUBST(OTHER_LIBTOOL_OPT) case $ac_sys_system/$ac_sys_release in Darwin/@<:@01567@:>@\..*) @@ -1781,6 +1783,7 @@ then fi AC_MSG_RESULT($LINKFORSHARED) + AC_SUBST(CFLAGSFORSHARED) AC_MSG_CHECKING(CFLAGSFORSHARED) if test ! "$LIBRARY" = "$LDLIBRARY" @@ -2297,6 +2300,13 @@ if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then fi fi +AC_MSG_CHECKING(for OSX 10.5 SDK or later) +AC_TRY_COMPILE([#include ], FSIORefNum fRef = 0, + AC_DEFINE(HAVE_OSX105_SDK, 1, Define if compiling using MacOS X 10.5 SDK or later.) + AC_MSG_RESULT(yes), + AC_MSG_RESULT(no) +) + # Check for --with-doc-strings AC_MSG_CHECKING(for --with-doc-strings) AC_ARG_WITH(doc-strings, diff --git a/pyconfig.h.in b/pyconfig.h.in index 781597f..2899152 100644 --- a/pyconfig.h.in +++ b/pyconfig.h.in @@ -426,6 +426,9 @@ /* Define to 1 if you have the `openpty' function. */ #undef HAVE_OPENPTY +/* Define if compiling using MacOS X 10.5 SDK or later. */ +#undef HAVE_OSX105_SDK + /* Define to 1 if you have the `pathconf' function. */ #undef HAVE_PATHCONF @@ -489,9 +492,6 @@ /* Define if you have readline 4.2 */ #undef HAVE_RL_COMPLETION_MATCHES -/* Define when using libedit's readline emulation */ -#undef HAVE_RL_DISPM_VFUNC - /* Define if you have readline 4.0 */ #undef HAVE_RL_PRE_INPUT_HOOK -- cgit v0.12