Bug 58175 - exempi hardcodes Mac OS X header location
Summary: exempi hardcodes Mac OS X header location
Status: RESOLVED FIXED
Alias: None
Product: exempi
Classification: Unclassified
Component: Problems (show other bugs)
Version: unspecified
Hardware: Other Mac OS X (All)
: medium normal
Assignee: Hubert Figuiere
QA Contact: Hubert Figuiere
URL:
Whiteboard: [release:2.2.1]
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-12 07:23 UTC by Misty De Meo
Modified: 2014-09-02 15:43 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch to replace header usage (2.05 KB, patch)
2013-01-10 23:46 UTC, Misty De Meo
Details | Splinter Review

Description Misty De Meo 2012-12-12 07:23:05 UTC
In configure.ac, line 175, exempi adds the system header location to the CPPFLAGS with a hardcoded path of /Developer.

/Developer was the default path in older versions of Xcode; however, as of Xcode 4.3 the path has been moved inside the Xcode.app bundle, which by default is installed in /Applications. You can use the OS's xcodebuild utility to determine the correct SDK path.

So, the right lookup would be:

a) If /Developer/Headers/FlatCarbon exists, use that
b) If not, then xcodebuild can be shelled out to in order to determine the SDK path, e.g.: `xcodebuild -version -sdk macosx10.7 Path`/Developer/Headers/FlatCarbon

(You can determine the OS name via `sw_vers -productVersion` and shorten that to just the major OS version.)

I don't have a Snow Leopard machine in front of me, but you may be able to use xcodebuild to find the path on older versions of Xcode as well.
Comment 1 Hubert Figuiere 2012-12-13 22:42:49 UTC
I knew the hack would come to bite me. I don't have a Mac dev machine at the moment. Patches welcome
Comment 2 Misty De Meo 2013-01-10 23:46:48 UTC
Created attachment 72819 [details] [review]
Patch to replace header usage

Turns out to have been pretty simple. The include path being hardcoded was the FlatCarbon one, which is actually a set of shims to simulate the OS 9 Carbon layout. All of the headers exempi was using actually just point to CoreServices/CoreServices.h, which we don't need an include path for since we already add `-framework CoreServices` to the flags. This patch replaces the appropriate headers and removes the hardcoded path altogether.
Comment 3 Misty De Meo 2013-01-12 23:57:00 UTC
Incidentally, this doesn't break compatibility with older OS X versions. I can confirm that this works at least as far back as Tiger.
Comment 4 Hubert Figuiere 2013-01-13 18:51:31 UTC
I'll have a look at it this week. Thanks a lot !
Comment 5 Hubert Figuiere 2013-01-15 17:18:40 UTC
Ok, it does change the Adobe code, but I actually like the solution short of creating "fake headers"
Comment 6 Hubert Figuiere 2013-01-20 23:14:32 UTC
Pushed into git master. Thanks !


http://cgit.freedesktop.org/exempi/commit/?id=6c1a7111fd98f03559abe1883b5e25c289e56ca0
Comment 7 Hubert Figuiere 2013-07-01 21:29:02 UTC
This is in 2.2.1


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.