Manchester United Talk banner

1 - 9 of 9 Posts

1,270 Posts
Occasionally (very rarely) you will need to make patches to source code to get it to work with Solaris. Most commonly, you will need to tweak the Makefile.

There are two levels of tweaks. One is where you just alter the compile options, as the original authors intended. The other is where the Makefile is fundamentally broken under Solaris, or does not support DESTDIR prefixing. After you have obtained the source code, made changes to it, built and tested it (and included your tests in your patch, if possible), you'll want to get your changes reviewed and checked in. In order to do that, you need to create a file listing the changes you made, called a patch or a diff file. You can generate it using cvs diff command.

The first step is to get it working. So, you first have to edit the Makefile(s) as appropriate. Unfortunately, you will next have to duplicate your effort, since most autoconf software these days has a "" template, that is the real source for the Makefile. cp to, then duplicate the changes to made, to

Once this is done, you can usually regenerate the Makefiles from the templates, with ./config.status at the top level. If things still work, it is now time to make a patch file.

Patches are made with diff. For some reason, the standard for GNU software seems to be "unified diff", which only GNU diff supports. Also, there is no simple way to generate diffs for multiple files. So to generate a patch file for the changes I made to src/ and po/, I had to do the following steps:

gdiff -u src/ src/ >>~/pkgs/grep/patchfile
gdiff -u po/ po/ >>~/pkgs/grep/patchfile

The patch is applied to original source, from the top-level directory, with

gpatch -p0 -u <~/pkgs/grep/patchfile
1 - 9 of 9 Posts