www.delorie.com/djgpp/v2faq/faq22_3.html   search  
Node:Changing, Next:, Previous:g++.exe, Up:Miscellany

22.3 How to change a DJGPP package?

Q: I want to change cc1. How do I do this?

Q: How do I fix a bug/add a feature to one of the DJGPP programs?

Q: How should I produce patches for DJGPP programs I want to submit, and to whom should I submit them?

A: First, get the sources. These are called *s.zip in the DJGPP distribution. The C Library sources are in djlsr203.zip. Some sources are too big, and might be split into multiple zips, all of which must be unzipped to get a complete source distribution, like this:

 em1934s1.zip
 em1934s2.zip
 em1934s3.zip

All sources are shipped in ready-to-build form. Any diffs that come with the source distribution, like the files called DIFFS, have already been applied, and any configuration scripts and/or batch files have been run already; you don't need to run them again.

Next, try to build the program without changing it. Look for a file called README.dos or README.djgpp: it should explain the build procedure and list any optional packages you need to install for that.

If such a README file is unavailable, you will have to poke around and figure things out for yourself; here are some hints to help you out:

The reason for an apparent lack of a standard here is that different packages were ported to DJGPP by different people, as best as they saw fit.

After you've successfully built the program, make your fixes and build the program the same way you did before.

Note that generally to build these programs, you must have the GNU Make program, installed, and some makefiles require that you install additional development utilities, like the SED editor. Sometimes the makefiles won't even run under COMMAND.COM (they require a smarter shell). In that case, either get a better shell, or convert the makefile to be runnable by COMMAND.COM, or do the required steps manually. If the Makefile is too complex for you and you can't figure out what are the necessary commands, invoke make with -n switch and see what it would have done.

If your machine lacks floating-point hardware (like a 386 without a 387, or a 486SX), then you should know that current versions of GNU Sed and GNU Make issue floating point instructions, so you will have to make provisions for loading an emulator, see above, FP Emulation. The port of Make 3.75 and later can be built so that it doesn't issue FP instructions, but you will have to get the sources and recompile Make first, as the stock version wasn't configured in that way.

If you think that you found a bug in one of the programs or libraries written for DJGPP (e.g. the C library, CWSDPMI, symify, etc.) be sure to check the list of known bugs. If your bug is not there, you can later submit it to the bug-tracking system.

Before you submit a bug report, please make every effort to verify that your bug is not caused by incorrect usage, or by problems in your DJGPP installation. Reports such as "All DJGPP programs crash" or "I cannot compile any program" are clearly not bugs, because these things work for many hundreds of DJGPP users every day; so either your system setup is messed up or you invoke programs incorrectly.

If you can investigate the cause of the bug and find a solution that makes it go away, submit a bug report with all the details. If you cannot find the cause(s), I suggest posting your problem description to the news group and asking people to verify that it is indeed a bug, before you submit a bug report. The bug-tracking system includes a list of all known bugs, many of them with solutions or work-arounds; please check them before creating a new bug report.

Patches to DJGPP programs and ports should be sent to the person who maintains the relevant package. Patches for the C library, utilities and other software which comes with the djdevNNN.zip distribution should be sent to the DJGPP developers mailing list; please send them as plain text, not as binary attachments.

If you don't know who maintains a particular package or port, post the patches to the comp.os.msdos.djgpp news group, since the maintainer is most probably reading that group.

To generate a patch, run the diff program (from GNU Diffutils, v2gnu/dif272b.zip) on the old and the new version of a source file. For example:

 diff -c src/libc/dos/dos/int86.old src/libc/dos/dos/int86.c >int86.dif

The file int86.dif created this way should be sent to the maintainer, with a short description of the problem it solves. It is a good idea to run the patch file through DTOU (a utility which comes with DJGPP and converts DOS-style CR-LF pairs into Unix-style newlines), since this makes the patch work on Unix as well, in case the maintainer of the package in question does that on Unix. (The DJGPP port of GNU patch accept both Unix-style and DOS-style patch files.)

Observing the following guidelines when creating the patch will make your patches easy to apply:

In addition, it would be mighty nice if every change in functionality were accompanied by a suitable change in the relevant docs (e.g., for a patch to a library function, edit the corresponding .txh file with its docs), although you are under no obligation to do that.



  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2001   by Eli Zaretskii     Updated Apr 2001