Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

holden57

macrumors member
Original poster
Jul 18, 2009
94
0
I'm trying to learn how to build applications from source on Mac OS 10.5.7, and I'm not really sure how to do it. What do you do with files that look like 'filename.tar.gz' or 'filename.tar.bz2'. How do you install these and build them on your computer?

Thank You
 
I'm trying to learn how to build applications from source on Mac OS 10.5.7, and I'm not really sure how to do it. What do you do with files that look like 'filename.tar.gz' or 'filename.tar.bz2'. How do you install these and build them on your computer?

Thank You

It's all done on the command line in terminal. First you need to unpack the archive. There are probably ways to unpack it with a GUI but I prefer to just use Terminal. You'll most likely have to use terminal to compile the code anyway. You'll obviously need XCode installed to build anything. In Terminal do the following if it is a .gz file:

Code:
tar -zvxf filename.tar.gz

If it's a .bz2 file:

Code:
tar -jxvf filename.tar.bz2

Do a 'man tar' if you want to know what those command line options do. That will usually create a directory called whatever 'filename' is. Go into that directory (cd <filename>). There should be a README file and/or an INSTALL file that tells you how to build it, however, most open source software is built using the GNU autoconf/make/etc tools. The typical way to do it is:

Code:
./configure
make

That will build the code. You may want to install it. You will probably need to be a superuser to do that and thus you should know where it is going to be installed and if it will overwrite anything in the process. Make sure you know what you are doing and what will happen when you do this or you can screw up your computer ...

Code:
 sudo make install

You should still read the README file though. configure may take arguments.
 
Thank you, that sounds pretty strait forward, so as long as I'm in the right directory, it will know 'what' to install?

Another quick question, how do you uninstall?
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.