]> granicus.if.org Git - python/commitdiff
Two small changes to adjust framework builds to the new stable ABI
authorRonald Oussoren <ronaldoussoren@mac.com>
Tue, 7 Dec 2010 14:41:05 +0000 (14:41 +0000)
committerRonald Oussoren <ronaldoussoren@mac.com>
Tue, 7 Dec 2010 14:41:05 +0000 (14:41 +0000)
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.

Mac/BuildScript/build-installer.py
Makefile.pre.in

index 9ddfda989af574fdb2f90e7426da8d4c480bfa9e..db083b693dca40d05883040650b1b862debdec05 100755 (executable)
@@ -418,15 +418,16 @@ def checkEnvironment():
     #       to install a newer patch level.
 
     for framework in ['Tcl', 'Tk']:
-        fw = dict(lower=framework.lower(),
-                    upper=framework.upper(),
-                    cap=framework.capitalize())
-        fwpth = "Library/Frameworks/%(cap)s.framework/%(lower)sConfig.sh" % fw
-        sysfw = os.path.join('/System', fwpth)
+        #fw = dict(lower=framework.lower(),
+        #            upper=framework.upper(),
+        #            cap=framework.capitalize())
+        #fwpth = "Library/Frameworks/%(cap)s.framework/%(lower)sConfig.sh" % fw
+        fwpth = 'Library/Frameworks/Tcl.framework/Versions/Current'
+        sysfw = os.path.join(SDKPATH, 'System', fwpth)
         libfw = os.path.join('/', fwpth)
         usrfw = os.path.join(os.getenv('HOME'), fwpth)
-        version = "%(upper)s_VERSION" % fw
-        if getTclTkVersion(libfw, version) != getTclTkVersion(sysfw, version):
+        #version = "%(upper)s_VERSION" % fw
+        if os.readlink(libfw) != os.readlink(sysfw):
             fatal("Version of %s must match %s" % (libfw, sysfw) )
         if os.path.exists(usrfw):
             fatal("Please rename %s to avoid possible dynamic load issues."
@@ -825,12 +826,29 @@ def buildPython():
             os.chmod(p, stat.S_IMODE(st.st_mode) | stat.S_IWGRP)
             os.chown(p, -1, gid)
 
+    LDVERSION=None
+    VERSION=None
+    ABIFLAGS=None
+
+    with open(os.path.join(buildDir, 'Makefile')) as fp:
+        for ln in fp:
+            if ln.startswith('VERSION='):
+                VERSION=ln.split()[1]
+            if ln.startswith('ABIFLAGS='):
+                ABIFLAGS=ln.split()[1]
+
+            if ln.startswith('LDVERSION='):
+                LDVERSION=ln.split()[1]
+
+    LDVERSION = LDVERSION.replace('$(VERSION)', VERSION)
+    LDVERSION = LDVERSION.replace('$(ABIFLAGS)', ABIFLAGS)
+
     # We added some directories to the search path during the configure
     # phase. Remove those because those directories won't be there on
     # the end-users system.
     path =os.path.join(rootDir, 'Library', 'Frameworks', 'Python.framework',
                 'Versions', version, 'lib', 'python%s'%(version,),
-                'config', 'Makefile')
+                'config-' + LDVERSION, 'Makefile')
     fp = open(path, 'r')
     data = fp.read()
     fp.close()
index 7193135ed72dd3e6fdf8c3a010da8d489163eb00..67a74b90014a4201093532ef039944d424018a4f 100644 (file)
@@ -498,7 +498,6 @@ $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/$(PYTHONFRAMEWORK): \
                $(PYTHONFRAMEWORKDIR)/Versions/$(VERSION)/Resources/Info.plist
        $(LN) -fsn $(VERSION) $(PYTHONFRAMEWORKDIR)/Versions/Current
        $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(PYTHONFRAMEWORKDIR)/$(PYTHONFRAMEWORK)
-       $(LN) -fsn Versions/Current/Headers $(PYTHONFRAMEWORKDIR)/Headers
        $(LN) -fsn Versions/Current/Resources $(PYTHONFRAMEWORKDIR)/Resources
 
 # This rule builds the Cygwin Python DLL and import library if configured
@@ -1113,7 +1112,7 @@ frameworkinstallstructure:        $(LDLIBRARY)
                else    true; \
                fi; \
        done
-       $(LN) -fsn include/python$(VERSION) $(DESTDIR)$(prefix)/Headers
+       $(LN) -fsn include/python$(LDVERSION) $(DESTDIR)$(prefix)/Headers
        sed 's/%VERSION%/'"`$(RUNSHARED) ./$(BUILDPYTHON) -c 'import platform; print(platform.python_version())'`"'/g' < $(RESSRCDIR)/Info.plist > $(DESTDIR)$(prefix)/Resources/Info.plist
        $(LN) -fsn $(VERSION) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/Versions/Current
        $(LN) -fsn Versions/Current/$(PYTHONFRAMEWORK) $(DESTDIR)$(PYTHONFRAMEWORKINSTALLDIR)/$(PYTHONFRAMEWORK)
@@ -1125,8 +1124,8 @@ frameworkinstallstructure:        $(LDLIBRARY)
 # Install a number of symlinks to keep software that expects a normal unix
 # install (which includes python-config) happy.
 frameworkinstallmaclib:
-       ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).a"
-       ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config/libpython$(VERSION).dylib"
+       ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config-$(LDVERSION)/libpython$(VERSION).a"
+       ln -fs "../../../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/python$(VERSION)/config-$(LDVERSION)/libpython$(VERSION).dylib"
        ln -fs "../$(PYTHONFRAMEWORK)" "$(DESTDIR)$(prefix)/lib/libpython$(VERSION).dylib"
 
 # This installs the IDE, the Launcher and other apps into /Applications