Home | Premieres | ScreenPlayLab | CinePaint | MovieEditor | About

Gosh!TV
BooksDVD/Blu-rayFilmGiftsMoneyTVVideo

Gouge Mac OS X Open Source Programming

Mac OS X is, if you know the secrets, a great platform for working with popular open source software that was intended for Linux

By Robin Rowe

Using RText because Scite isn't available yet for the Mac

Using RText because Scite isn't available yet for the Mac

HOLLYWOOD, CA (Gosh!TV) 12/10/2009 – In this quick tutorial (or “gouge”) we’ll look at how to set up Mac OS X to build free open source Linux software such as CinePaint. Mac OS X offers a free graphical compiler app called Xcode. We’ll download that but not use it as a graphical programming environment. Instead, we’ll do everything the Linux way so that we maintain total compatibility of code across Linux and Mac OS X.

Installing GNU Make in a terminal in Mac OS X

Installing GNU Make in a terminal in Mac OS X

Snow Leopard 10.6, the current version of Mac OS X, only runs on Intel-based Macs. We’re developing on a G5 PowerPC desktop running Tiger 10.4.  It makes little difference what version of Mac OS X we’re using because we’re avoiding relying on anything specific to the Mac when building POSIX code. We’ll build code from a terminal window using the usual Linux commands.

We’ll make the same source code to build on Mac OS X or Linux. Each of these UNIX-based systems are highly compatible at the platform level known as POSIX. The same C/C++ POSIX-compatible code can be built on all systems. Windows can build Linux-based POSIX programs by using a small open source compatibility library called libunistd.

Mac OS X Open Source Set-up Gouge

1. Download and install the appropriate version of Xcode for your version of Mac OS X.

2. In Finder, go to Applications, Utilities and launch Terminal. All the commands shown below are run in terminals.

3. Because there’s a bug in Tiger make 3.78 that can cause builds to fail mysteriously with a memory error message, we’ll also download and install the latest version of GNU make. In a terminal:

  1. make –version
  2. which make
  3. ./configure –help

Using make –version informs us we have the buggy 3.79 version. Using which informs us that make is installed in /usr/bin and configure –help informs us our replacement make will go in /usr/local/bin. We won’t overwrite the default 3.79 make by using configure –prefix=/usr/bin. Doing that is not the UNIX way and won’t work anyway because the installer will bail after detecting a collision with /usr/bin/info (we tried).

Then we’ll use the cd command to navigate to whatever folder we put the downloaded GNU make tarball.

  1. cd /Volumes/Seagate-1.4TB/code
  2. tar xvfj make-3.81.tar.bz2
  3. cd make-3.81
  4. ./configure
  5. make
  6. sudo make install

The basic tar-configure-make-install process is standard for GNU and is sufficient for most Linux-based code. The other commands above are going the extra mile, aren’t needed once we have our PATH configured. We use tar xvfj to uncompress the bzipped source tarball. When we encounter gzipped tarballs, we’ll use  tar  xvfz instead.

Let’s test we’ve got the version of make we want:

  1. /usr/local/bin/make –version
  2. make –version
  3. export PATH=/usr/local/bin:$PATH
  4. make –version

We modified the PATH in this session so that our replacement make is preferred over the default. We’ll make the PATH permanent by adding this line to our ~/.profile file:

export PATH=/usr/local/bin:$PATH

To source and test the profile:

. ~/.profile; echo $PATH

4. Install a text editor. Using vi that’s built in is great for quick tasks in a terminal. That’s actually vim, the improved vi, the same program commonly encountered in Linux. An easy-to-read graphical text editor is a good idea for more complicated text editing. We can’t use the popular Linux editor Scite because it has no Mac version due to being dependent on GTK2. We’ll explore building Scite on the Mac in a separate article. For now, install the Java-based editor RText.

Note: The screenshots in this story were created using SnapNDrag on the Mac and edited in CinePaint on Linux.

Search Gosh!TV