Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure fails when an Objective-C .h file is specified #840

Closed
bos opened this issue May 24, 2012 · 4 comments
Closed

Configure fails when an Objective-C .h file is specified #840

bos opened this issue May 24, 2012 · 4 comments

Comments

@bos
Copy link
Contributor

bos commented May 24, 2012

(Imported from Trac #850, reported by @dankna on 2011-05-27)

When configuring a library or executable which has specified a C header with includes: in its .cabal file, and that header is actually Objective-C or includes other headers which are, configure fails. This is because of the test that Cabal does to determine whether all prerequisite C libraries are present, in which it compiles with gcc directly rather than going through the Haskell compiler as it does in the build phase.

I'm working on a patch to this and should have it in about an hour.

@ghost ghost self-assigned this May 24, 2012
@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @dankna on 2011-05-27)

It occurs to me trying to solve this that it's actually a hard problem. Passing the -x <language> flag to gcc is the easy part, but in the general case the header file could be C, ObjC, C++, or even ObjC++. There's no way for Cabal to infer which it is, since it has the same extension, .h, in all four cases.

I see two approaches. One would be to have the package author pass the information in the .cabal file somehow. The drawback is that it's not really clear what a good interface would be. The other would be to try to autodetect it after all somehow, perhaps by getting gcc to spit out dependency information to see what source files (which /can/ have their languages inferred by their filenames) includes what header files.

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @dankna on 2011-05-27)

Harvesting the dependency information turns out to be feasible and not too difficult; I'm working on this approach.

@bos
Copy link
Contributor Author

bos commented May 24, 2012

(Imported comment by @dankna on 2011-05-27)

Patch sent with "darcs send".

@jsl
Copy link

jsl commented Feb 28, 2015

This ticket doesn't have any activity since 2011, and the patch that was sent is not attached. I propose closing - please re-open or create a new ticket if this is still desired.

@ttuegel ttuegel closed this as completed Feb 28, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants