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

Skip to content

Commit 0499d0b

Browse files
Two small changes to adjust framework builds to the new stable ABI
Both the Makefile and the script that is used on OSX to create the binary installer refer to the directory containing the Makefile using the name 'config'. This name was changed with the new ABI (with default build flags it is now named config-3.2m). This patch ensures that both files use the correct name. The build-installer.py script contains one other change: it now tests for the Tcl/Tk framework version by looking at the 'Current' symlink in the framework instead of runnning a script. This makes it possible to verify the version that is in the SDK that's used during the build instead of the version that is installed on the system.
1 parent 7ed117a commit 0499d0b

2 files changed

Lines changed: 29 additions & 12 deletions

File tree

Mac/BuildScript/build-installer.py

Lines changed: 26 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -418,15 +418,16 @@ def checkEnvironment():
418418
# to install a newer patch level.
419419

420420
for framework in ['Tcl', 'Tk']:
421-
fw = dict(lower=framework.lower(),
422-
upper=framework.upper(),
423-
cap=framework.capitalize())
424-
fwpth = "Library/Frameworks/%(cap)s.framework/%(lower)sConfig.sh" % fw
425-
sysfw = os.path.join('/System', fwpth)
421+
#fw = dict(lower=framework.lower(),
422+
# upper=framework.upper(),
423+
# cap=framework.capitalize())
424+
#fwpth = "Library/Frameworks/%(cap)s.framework/%(lower)sConfig.sh" % fw
425+
fwpth = 'Library/Frameworks/Tcl.framework/Versions/Current'
426+
sysfw = os.path.join(SDKPATH, 'System', fwpth)
426427
libfw = os.path.join('/', fwpth)
427428
usrfw = os.path.join(os.getenv('HOME'), fwpth)
428-
version = "%(upper)s_VERSION" % fw
429-
if getTclTkVersion(libfw, version) != getTclTkVersion(sysfw, version):
429+
#version = "%(upper)s_VERSION" % fw
430+
if os.readlink(libfw) != os.readlink(sysfw):
430431
fatal("Version of %s must match %s" % (libfw, sysfw) )
431432
if os.path.exists(usrfw):
432433
fatal("Please rename %s to avoid possible dynamic load issues."
@@ -825,12 +826,29 @@ def buildPython():
825826
os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IWGRP)
826827
os.chown(p, -1, gid)
827828

829+
LDVERSION=None
830+
VERSION=None
831+
ABIFLAGS=None
832+
833+
with open(os.path.join(buildDir, 'Makefile')) as fp:
834+
for ln in fp:
835+
if ln.startswith('VERSION='):
836+
VERSION=ln.split()[1]
837+
if ln.startswith('ABIFLAGS='):
838+
ABIFLAGS=ln.split()[1]
839+
840+
if ln.startswith('LDVERSION='):
841+
LDVERSION=ln.split()[1]
842+
843+
LDVERSION = LDVERSION.replace('$(VERSION)', VERSION)
844+
LDVERSION = LDVERSION.replace('$(ABIFLAGS)', ABIFLAGS)
845+
828846
# We added some directories to the search path during the configure
829847
# phase. Remove those because those directories won't be there on
830848
# the end-users system.
831849
path =os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework',
832850
'Versions', version, 'lib', 'python%s'%(version,),
833-
'config', 'Makefile')
851+
'config-' + LDVERSION, 'Makefile')
834852
fp = open(path, 'r')
835853
data = fp.read()
836854
fp.close()

Makefile.pre.in

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -498,7 +498,6 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
498498
$(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
499499
$(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
500500
$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
501-
$(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
502501
$(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
503502

504503
# This rule builds the Cygwin Python DLL and import library if configured
@@ -1113,7 +1112,7 @@ frameworkinstallstructure: $(LDLIBRARY)
11131112
else true; \
11141113
fi; \
11151114
done
1116-
$(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
1115+
$(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers
11171116
sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
11181117
$(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
11191118
$(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
@@ -1125,8 +1124,8 @@ frameworkinstallstructure: $(LDLIBRARY)
11251124
# Install a number of symlinks to keep software that expects a normal unix
11261125
# install (which includes python-config) happy.
11271126
frameworkinstallmaclib:
1128-
ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a"
1129-
ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).dylib"
1127+
ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config-$(LDVERSION)/libpython$(VERSION).a"
1128+
ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config-$(LDVERSION)/libpython$(VERSION).dylib"
11301129
ln -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(VERSION).dylib"
11311130

11321131
# This installs the IDE, the Launcher and other apps into /Applications

0 commit comments

Comments
 (0)