Commits

Ronald Oussoren  committed 6e77207

Hacks to improve functionality on OSX 10.5

  • Participants
  • Parent commits 43f6a4e

Comments (0)

Files changed (2)

File objective/metadata/compile.py

             if name in excinfo:
                 if excinfo[name].get('ignore', False): continue
                 if excinfo[name].get('value'):
-                    values[name] = {'value': excinfo[name]['value'] }
+                    result[name] = [{'value': excinfo[name]['value'], 'arch': None }]
                     continue
 
                 if excinfo[name].get('type') == 'unicode':

File objective/metadata/parsing.py

 SC_SCHEMA_RE=re.compile(r"SC_SCHEMA_KV\s*\(\s*([A-Za-z0-9_]*)\s*,.*\)")
 OR_EXPR_RE=re.compile(r"\([A-Za-z0-9]*(\s*\|\s*[A-Za-z0-9]*)*\)")
 
+CPP='clang'
+if int(os.uname()[2].split('.')[0]) <= 9:
+    CPP='gcc'
+
 
 class FilteredVisitor (c_ast.NodeVisitor):
     """ 
                 use_cpp=True, cpp_args=[
                     '-arch', self.arch, '-isysroot', self.sdk,
                     '-E', '-arch', self.arch, '-D__attribute__(x)=',
+                    '-D__asm__(...)=',
+                    '-D__volatile__(...)=',
+                    '-D__extension__=',
                     '-DMAC_OS_X_VERSION_MIN_REQUIRED=1040',
                     '-Wno-#warnings',
-                    '-D__typeof__(x)=long',], cpp_path='clang')
+                    '-D__typeof__(x)=long',], cpp_path=CPP)
 
             self.parse_defines(fname)
         finally:
             fp.write("   return 0;\n")
             fp.write("}\n")
 
-        p = subprocess.Popen(['clang', 
+        p = subprocess.Popen([CPP, 
             '-o', fname[:-2], 
             '-arch', self.arch,
             '-isysroot', self.sdk,
 
     def parse_defines(self, fname):
         p = subprocess.Popen(
-            ['clang', '-arch', self.arch, '-isysroot', self.sdk, '-DMAC_OS_X_VERSION_MIN_REQUIRED=1040', '-Wno-#warnings', '-E', '-Wp,-dD', fname],
+            [CPP, '-arch', self.arch, '-isysroot', self.sdk, '-DMAC_OS_X_VERSION_MIN_REQUIRED=1040', '-Wno-#warnings', '-E', '-Wp,-dD', fname],
             stdout=subprocess.PIPE)
         data = p.communicate()[0]
         xit = p.wait()