Rework the build system for osx applications:

* Don't use xcodebuild for building PythonLauncher, but use a normal unix
  makefile. This makes it a lot easier to use the same build flags as for the
  rest of python (e.g. make a universal version of python launcher)
* Convert the mac makefile-s to makefile.in-s and use configure to set makefile
  variables instead of forwarding them as command-line arguments
* Add a C version of pythonw, that we you can use '#!/usr/local/bin/pythonw'
* Build IDLE.app using bundlebuilder instead of BuildApplet, that will allow
  easier modification of the bundle contents later on.
diff --git a/Lib/plat-mac/bundlebuilder.py b/Lib/plat-mac/bundlebuilder.py
index 03d8c81..aac92bd 100755
--- a/Lib/plat-mac/bundlebuilder.py
+++ b/Lib/plat-mac/bundlebuilder.py
@@ -145,11 +145,24 @@
         self.message("Building %s" % repr(self.bundlepath), 1)
         if os.path.exists(self.bundlepath):
             shutil.rmtree(self.bundlepath)
-        os.mkdir(self.bundlepath)
-        self.preProcess()
-        self._copyFiles()
-        self._addMetaFiles()
-        self.postProcess()
+        if os.path.exists(self.bundlepath + '~'):
+            shutil.rmtree(self.bundlepath + '~')
+        bp = self.bundlepath
+
+        # Create the app bundle in a temporary location and then
+        # rename the completed bundle. This way the Finder will 
+        # never see an incomplete bundle (where it might pick up
+        # and cache the wrong meta data)
+        self.bundlepath = bp + '~'
+        try:
+            os.mkdir(self.bundlepath)
+            self.preProcess()
+            self._copyFiles()
+            self._addMetaFiles()
+            self.postProcess()
+            os.rename(self.bundlepath, bp)
+        finally:
+            self.bundlepath = bp
         self.message("Done.", 1)
 
     def preProcess(self):