Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c49e5b7

Browse files
committed
Added a MACHDEP_OBJS to the python link. Use this on MacOSX to include
Mac/macglue.c into the core interpreter. This file contains the glue code that allows extension modules for Mac toolboxes to live in different shared libraries but still communicate with each other. The glue code is controlled by the USE_MAC_TOOLBOX_GLUE define.
1 parent 82ac8d1 commit c49e5b7

3 files changed

Lines changed: 24 additions & 1 deletion

File tree

Makefile.pre.in

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ MAINOBJ= @MAINOBJ@
138138
LIBOBJS= @LIBOBJS@
139139
DLINCLDIR= @DLINCLDIR@
140140
DYNLOADFILE= @DYNLOADFILE@
141+
MACHDEP_OBJS= @MACHDEP_OBJS@
141142

142143
PYTHON= python$(EXE)
143144

@@ -222,6 +223,7 @@ PYTHON_OBJS= \
222223
Python/traceback.o \
223224
Python/getopt.o \
224225
Python/$(DYNLOADFILE) \
226+
$(MACHDEP_OBJS) \
225227
$(LIBOBJS)
226228

227229

@@ -411,6 +413,8 @@ Objects/object.o: $(srcdir)/Objects/object.c $(srcdir)/Objects/obmalloc.c
411413
Objects/unicodectype.o: $(srcdir)/Objects/unicodectype.c \
412414
$(srcdir)/Objects/unicodetype_db.h
413415

416+
Mac/Python/macglue.o: $(srcdir)/Mac/Python/macglue.c
417+
$(CC) -c $(CFLAGS) $(CPPFLAGS) -I$(srcdir)/Mac/Include -I$(srcdir)/Python -o $@ $(srcdir)/Mac/Python/macglue.c
414418

415419
############################################################################
416420
# Header files

config.h.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@
229229
(shared library plus accessory files). */
230230
#undef WITH_NEXT_FRAMEWORK
231231

232+
/* Define if you want to use MacPython modules on MacOSX in unix-Python */
233+
#undef USE_TOOLBOX_OBJECT_GLUE
234+
232235
/* Define if you want to use SGI (IRIX 4) dynamic linking.
233236
This requires the "dl" library by Jack Jansen,
234237
ftp://ftp.cwi.nl/pub/dynload/dl-1.6.tar.Z.

configure.in

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ then
677677
# crt1.o) gets erroneously defined as common, which breaks dynamic
678678
# loading of any modules which reference it in System.framework
679679
next/4*|next/5*) LINKFORSHARED="-u __dummy -framework System" ;;
680-
Darwin/*) LINKFORSHARED="-u __dummy -framework System -framework Foundation" ;;
680+
Darwin/*) LINKFORSHARED="-u __dummy -u _PyMac_Error -framework System -framework Foundation -framework Carbon" ;;
681681
UnixWare*) LINKFORSHARED="-dy -Bdynamic -Wl,-Bexport";;
682682
SCO_SV*) LINKFORSHARED="-Bdynamic -dy -Wl,-Bexport";;
683683
ReliantUNIX*) LINKFORSHARED="-W1 -Blargedynsym";;
@@ -997,6 +997,22 @@ then
997997
AC_DEFINE(HAVE_DYNAMIC_LOADING)
998998
fi
999999

1000+
# MACHDEP_OBJS can be set to platform-specific object files needed by Python
1001+
1002+
AC_SUBST(MACHDEP_OBJS)
1003+
AC_MSG_CHECKING(MACHDEP_OBJS)
1004+
if test -z "$MACHDEP_OBJS"
1005+
then
1006+
case $ac_sys_system/$ac_sys_release in
1007+
Darwin/*)
1008+
MACHDEP_OBJS="Mac/Python/macglue.o"
1009+
AC_DEFINE(USE_TOOLBOX_OBJECT_GLUE)
1010+
;;
1011+
*) MACHDEP_OBJS="";;
1012+
esac
1013+
fi
1014+
AC_MSG_RESULT($DYNLOADFILE)
1015+
10001016
# checks for library functions
10011017
AC_CHECK_FUNCS(alarm chown clock confstr ctermid ctermid_r execv \
10021018
flock fork fsync fdatasync fpathconf ftime ftruncate \

0 commit comments

Comments
 (0)