[Python-checkins] python/dist/src Makefile.pre.in,1.85,1.86 configure.in,1.325,1.326 configure,1.315,1.316 setup.py,1.94,1.95
jackjansen@users.sourceforge.net
jackjansen@users.sourceforge.net
2002年6月21日 07:48:40 -0700
Update of /cvsroot/python/python/dist/src
In directory usw-pr-cvs1:/tmp/cvs-serv2971
Modified Files:
Makefile.pre.in configure.in configure setup.py
Log Message:
Patch #557719 by Tony Lownds, slightly massaged by me: streamline the
OSX framework build process. Things fixed/modified:
- the filesystem case-sensitivity test now works for builds outside
the source directory
- various other fixes for building outside the source directory
- python.app now has a target in the main Makefile
- WASTE and AquaTk are found more automatically
Index: Makefile.pre.in
===================================================================
RCS file: /cvsroot/python/python/dist/src/Makefile.pre.in,v
retrieving revision 1.85
retrieving revision 1.86
diff -C2 -d -r1.85 -r1.86
*** Makefile.pre.in 11 Jun 2002 06:22:30 -0000 1.85
--- Makefile.pre.in 21 Jun 2002 14:48:36 -0000 1.86
***************
*** 799,802 ****
--- 799,808 ----
$(INSTALL_DATA) $(LDLIBRARY) $(PYTHONFRAMEWORKPREFIX)/$(LDLIBRARY)
+ # Build Python executable that can run GUI code. Another MacOSX pseudo
+ # target.
+ python.app:
+ $(MAKE) -f $(srcdir)/Mac/OSX/Makefile install installmacsubtree \
+ PYTHONSRCDIR=$(srcdir) PYTHONBUILDDIR=.
+
# Build the toplevel Makefile
Makefile.pre: Makefile.pre.in config.status
Index: configure.in
===================================================================
RCS file: /cvsroot/python/python/dist/src/configure.in,v
retrieving revision 1.325
retrieving revision 1.326
diff -C2 -d -r1.325 -r1.326
*** configure.in 14 Jun 2002 20:30:30 -0000 1.325
--- configure.in 21 Jun 2002 14:48:36 -0000 1.326
***************
*** 222,226 ****
AC_SUBST(BUILDEXEEXT)
AC_MSG_CHECKING(for case-insensitive build directory)
! if test -d "python"
then
AC_MSG_RESULT(yes)
--- 222,226 ----
AC_SUBST(BUILDEXEEXT)
AC_MSG_CHECKING(for case-insensitive build directory)
! if test -d "${srcdir}/python"
then
AC_MSG_RESULT(yes)
***************
*** 2317,2321 ****
AC_SUBST(SRCDIRS)
! SRCDIRS="Parser Grammar Objects Python Modules"
AC_MSG_CHECKING(for build directories)
for dir in $SRCDIRS; do
--- 2317,2321 ----
AC_SUBST(SRCDIRS)
! SRCDIRS="Parser Grammar Objects Python Modules Mac Mac/Python"
AC_MSG_CHECKING(for build directories)
for dir in $SRCDIRS; do
Index: configure
===================================================================
RCS file: /cvsroot/python/python/dist/src/configure,v
retrieving revision 1.315
retrieving revision 1.316
diff -C2 -d -r1.315 -r1.316
*** configure 14 Jun 2002 20:30:29 -0000 1.315
--- configure 21 Jun 2002 14:48:36 -0000 1.316
***************
*** 1,4 ****
#! /bin/sh
! # From configure.in Revision: 1.323 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.53.
--- 1,4 ----
#! /bin/sh
! # From configure.in Revision: 1.325 .
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.53.
***************
*** 2952,2956 ****
echo "$as_me:$LINENO: checking for case-insensitive build directory" >&5
echo $ECHO_N "checking for case-insensitive build directory... $ECHO_C" >&6
! if test -d "python"
then
echo "$as_me:$LINENO: result: yes" >&5
--- 2952,2956 ----
echo "$as_me:$LINENO: checking for case-insensitive build directory" >&5
echo $ECHO_N "checking for case-insensitive build directory... $ECHO_C" >&6
! if test -d "${srcdir}/python"
then
echo "$as_me:$LINENO: result: yes" >&5
***************
*** 11445,11448 ****
--- 11445,11449 ----
+
for ac_func in alarm chown chroot clock confstr ctermid ctermid_r execv \
fchdir flock fork fsync fdatasync fpathconf ftime ftruncate \
***************
*** 15925,15929 ****
! SRCDIRS="Parser Grammar Objects Python Modules"
echo "$as_me:$LINENO: checking for build directories" >&5
echo $ECHO_N "checking for build directories... $ECHO_C" >&6
--- 15926,15930 ----
! SRCDIRS="Parser Grammar Objects Python Modules Mac Mac/Python"
echo "$as_me:$LINENO: checking for build directories" >&5
echo $ECHO_N "checking for build directories... $ECHO_C" >&6
Index: setup.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/setup.py,v
retrieving revision 1.94
retrieving revision 1.95
diff -C2 -d -r1.94 -r1.95
*** setup.py 17 Jun 2002 17:55:30 -0000 1.94
--- setup.py 21 Jun 2002 14:48:38 -0000 1.95
***************
*** 719,723 ****
'../Python/getapplbycreator.c'],
extra_link_args=['-framework', 'Carbon']) )
! exts.append( Extension('_CF', ['cf/_CFmodule.c'],
extra_link_args=['-framework', 'CoreFoundation']) )
exts.append( Extension('_Res', ['res/_Resmodule.c'],
--- 719,723 ----
'../Python/getapplbycreator.c'],
extra_link_args=['-framework', 'Carbon']) )
! exts.append( Extension('_CF', ['cf/_CFmodule.c', 'cf/pycfbridge.c'],
extra_link_args=['-framework', 'CoreFoundation']) )
exts.append( Extension('_Res', ['res/_Resmodule.c'],
***************
*** 768,786 ****
exts.append( Extension('_TE', ['te/_TEmodule.c'],
extra_link_args=['-framework', 'Carbon']) )
! # As there is no standardized place (yet) to put user-installed
! # Mac libraries on OSX you should put a symlink to your Waste
! # installation in the same folder as your python source tree.
! # Or modify the next two lines:-)
! waste_incs = find_file("WASTE.h", [], ["../waste/C_C++ Headers"])
waste_libs = find_library_file(self.compiler, "WASTE", [],
! ["../waste/Static Libraries"])
if waste_incs != None and waste_libs != None:
exts.append( Extension('waste',
! ['waste/wastemodule.c',
'Mac/Wastemods/WEObjectHandlers.c',
'Mac/Wastemods/WETabHooks.c',
'Mac/Wastemods/WETabs.c'
],
! include_dirs = waste_incs + ['Mac/Wastemods'],
library_dirs = waste_libs,
libraries = ['WASTE'],
--- 768,791 ----
exts.append( Extension('_TE', ['te/_TEmodule.c'],
extra_link_args=['-framework', 'Carbon']) )
! # As there is no standardized place (yet) to put
! # user-installed Mac libraries on OSX, we search for "waste"
! # in parent directories of the Python source tree. You
! # should put a symlink to your Waste installation in the
! # same folder as your python source tree. Or modify the
! # next few lines:-)
! waste_incs = find_file("WASTE.h", [],
! ['../'*n + 'waste/C_C++ Headers' for n in (0,1,2,3,4)])
waste_libs = find_library_file(self.compiler, "WASTE", [],
! ["../"*n + "waste/Static Libraries" for n in (0,1,2,3,4)])
if waste_incs != None and waste_libs != None:
+ (srcdir,) = sysconfig.get_config_vars('srcdir')
exts.append( Extension('waste',
! ['waste/wastemodule.c'] + [
! os.path.join(srcdir, d) for d in
'Mac/Wastemods/WEObjectHandlers.c',
'Mac/Wastemods/WETabHooks.c',
'Mac/Wastemods/WETabs.c'
],
! include_dirs = waste_incs + [os.path.join(srcdir, 'Mac/Wastemods')],
library_dirs = waste_libs,
libraries = ['WASTE'],
***************
*** 795,802 ****
--- 800,868 ----
self.detect_tkinter(inc_dirs, lib_dirs)
+ def detect_tkinter_darwin(self, inc_dirs, lib_dirs):
+ # The _tkinter module, using frameworks. Since frameworks are quite
+ # different the UNIX search logic is not sharable.
+ from os.path import join, exists
+ framework_dirs = [
+ '/System/Library/Frameworks/',
+ '/Library/Frameworks',
+ join(os.getenv('HOME'), '/Library/Frameworks')
+ ]
+ # Find the directory that contains the Tcl.framwork and Tk.framework
+ # bundles.
+ # XXX distutils should support -F!
+ for F in framework_dirs:
+ # both Tcl.framework and Tk.framework should be present
+ for fw in 'Tcl', 'Tk':
+ if not exists(join(F, fw + '.framework')):
+ break
+ else:
+ # ok, F is now directory with both frameworks. Continure
+ # building
+ break
+ else:
+ # Tk and Tcl frameworks not found. Normal "unix" tkinter search
+ # will now resume.
+ return 0
+
+ # For 8.4a2, we must add -I options that point inside the Tcl and Tk
+ # frameworks. In later release we should hopefully be able to pass
+ # the -F option to gcc, which specifies a framework lookup path.
+ #
+ include_dirs = [
+ join(F, fw + '.framework', H)
+ for fw in 'Tcl', 'Tk'
+ for H in 'Headers', 'Versions/Current/PrivateHeaders'
+ ]
+
+ # For 8.4a2, the X11 headers are not included. Rather than include a
+ # complicated search, this is a hard-coded path. It could bail out
+ # if X11 libs are not found...
+ include_dirs.append('/usr/X11R6/include')
+ frameworks = ['-framework', 'Tcl', '-framework', 'Tk']
+
+ ext = Extension('_tkinter', ['_tkinter.c', 'tkappinit.c'],
+ define_macros=[('WITH_APPINIT', 1)],
+ include_dirs = include_dirs,
+ libraries = [],
+ extra_compile_args = frameworks,
+ extra_link_args = frameworks,
+ )
+ self.extensions.append(ext)
+ return 1
+
+
def detect_tkinter(self, inc_dirs, lib_dirs):
# The _tkinter module.
+ # Rather than complicate the code below, detecting and building
+ # AquaTk is a separate method. Only one Tkinter will be built on
+ # Darwin - either AquaTk, if it is found, or X11 based Tk.
+ platform = self.get_platform()
+ if platform == 'darwin' and \
+ self.detect_tkinter_darwin(inc_dirs, lib_dirs):
+ return
+
# Assume we haven't found any of the libraries or include files
# The versions with dots are used on Unix, and the versions without
***************
*** 836,840 ****
# Check for various platform-specific directories
- platform = self.get_platform()
if platform == 'sunos5':
include_dirs.append('/usr/openwin/include')
--- 902,905 ----