[an error occurred while processing this directive]
Node:Changing,
Next:Packages,
Previous:g++.exe,
Up:Miscellany
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:
Makefile
or makefile
probably means you
could just type make.
CONFIGUR.BAT
file, possibly in a
subdirectory called djgpp/
or pc/
; if so, run it first.
MAKE.BAT
file, run it; if not, look for a file
named MAKEFILE.DJ
or MAKEFILE.DJG
; sometimes these will be
in a subdirectory called dos/
, or msdos/
, or pc/
.
If there is such a file, then type, e.g., make -f makefile.djg, if
not, just say make and see what happens.
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:
-c
switch to diff
, and never use
-c
with an argument that is less than 3 (for example, do
not use -c2
).
diff
from the root of the DJGPP installation, i.e. from
the directory where you keep the DJGPP.ENV
file, and specify the
files being compared with their pathnames relative to that directory.
This allows to concatenate related patches to several files, and apply
the combined patch in a single run of the patch
utility.
patch
doesn't understand backslashes. In particular, DJ Delorie
maintains DJGPP on a Unix box.
foo.old
or
foo.bak
; see the example above.
djlsrNNN.zip
distribution follow his distinct style (that style is quite obvious from
the sources, but if you are unsure, ask DJ).
diff
ignore
whitespace, like -b
or -w
. In most cases, patches
generated with these switches will fail 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.