views:

83

answers:

2

I've never done this before, so I'm not sure where to even start. I have a few projects where I want to use the liblio library, both on the iPhone and OS X. I've put the installation instructions in a gist.

Here are my questions, and I'll try and edit these questions as I figure them out.

  1. Do I want to use make install to compile these files? I feel like all the compilation should be done within XCode.
  2. It looks like there are a lot of platform specific settings during compilation. How do I control this from XCode?
  3. It seems like I should be able to add all the .h/.m files to my XCode project and compile them myself. Is this missing something?

For the record, I'm aware of a few LibLO libraries created for use on the iPhone. I may break down and use one, but I'd prefer to learn how to do this myself.

+1  A: 

Yes, if you want to compile these projects from within XCode, you need to add the .c/.h files and then setup them accordingly. XCode has support for passing argument to the compiler of course, so it is indeed possible.

From the gist snippet, it looks like the installation instructions are GNU standard instructions, ie. configure; make; make install. You could try playing with arguments to configure (which, btw, creates the Makefile on the spot) and see what options you have for compiling to a different target platform.

However, it may not be worth all the trouble to convert the Makefile's to a pure XCode project. Another approach, which I think I would start with, is to hack the created Makefile until you are able to compile an iPhone friendly lib-file. After that you can tell XCode to run 'make ...' as part of your projects build steps. Then, once you understand the issues, it may be easier to include them in your XCode project proper.

Martin Wickman
It was really much easier than I thought it would be. Add the .h/.c files to the project and clean up a few little things (bad paths to header files, preproccessor macros that are inexplicably wrapping the wrong code, etc). Maybe I got lucky with an easy project, but it didn't take that much effort.
kubi
Nice work! Thats the beauty of C, it works everywhere... eventually :-)
Martin Wickman
+1  A: 

I have not tried this myself, but Building autoconf-configured libraries for iPhone OS might have some useful information for you.

sigjuice
oh awesome. I'll give that a try this evening.
kubi