How-To:  Install a DJGPP CVS snapshot

Last modified: Sun Jun 28 20:00:26 EDT 2020

Based on instructions generously provided by Juan Manuel Guerrero.

Preface:  The State of the Dist

Quoting from the primary site, http://www.delorie.com/djgpp/:  "DJGPP is a complete 32-bit C/C++ development system for Intel 80386 (and higher) PCs running DOS.  It includes ports of many GNU development utilities."  By providing a robust 32-bit platform and DOS implementations of many standard library functions, DJGPP makes it possible to build and run many Unix applications under DOS, and consequently in a DOS box under any 32-bit version of Windows, with less porting effort.

The following was written in October 2014 to explain how to build the CVS version of DJGPP 2.04.  These instructions are now out of date since DJGPP 2.05 was released 2015-11-08.

As of October 2014, the last release of DJGPP was version 2.03, in 2002.  A beta of DJGPP 2.04 emerged in 2003, but it never progressed to final release.  Updated versions of GCC, libraries, and applications continued to be released for both 2.03 and the 2.04 beta.  However, some important fixes could be obtained only by building the latest versions of the DJGPP platform files from the CVS repository sources.  This article explains how to get a working build environment with the latest versions of everything.

Archives

The DJGPP archive is best accessed through a fast mirror.  The "current" directory is 2.03; "beta" is 2.04.  Essential files and utilities are divided between subdirectories v2 and v2gnu; additional prebuilt libraries and apps are found in v2tk and v2apps.  A directory for other etceteras, v2misc, exists only in current.

CAUTION:  You cannot mix libraries.  If you have decided to use version 2.04 (whether the as-is beta or the CVS repository version), you cannot link applications with libraries from the current (2.03) directory.  Compiler, binutils, and libraries must match!

A quick way to get a CVS snapshot is from http://www.ludd.luth.se/~ams/djgpp/cvs/.  For actual CVS retrieval, see the DJGPP CVS page.

Drivers

If using hard-core DOS, both a Long File Name (LFN) driver and a DPMI provider must be installed.  Recommended:

If using a DOS box (CMD.EXE) in a 32-bit version of Windows, LFN and DPMI should just work.

Additional configuration advice is provided in the DJGPP FAQ.

Unzipping

When unpacking zip files, use the unzip32.exe that is distributed with DJGPP to prevent file names from getting broken.

File names on NTFS must be created in the DOS namespace.  Linux ntfs-3g doesn't do that.  Similarly, the LFN implementation in Linux vfat is not entirely compatible with doslfn.  It only works reliably if you mount the vfat partition with the option shortname=winnt.

Stage 1:  Install build environment from 2.04 "beta"

Following is the minimum set of packages needed to successfully complete the next stage.  Newer versions of the various packages will appear over time.  Feel free to use the latest.

DirectoryPackage
beta/v2 2211289Nov 30 2003djdev204.zip
beta/v2gnu6628096Sep 2 16:56bnu224br2.zip
beta/v2gnu641348Sep 26 2009bsh205bbr3.zip
beta/v2gnu434398Jan 9 2010bsn241b.zip
beta/v2gnu2446889Oct 12 08:11fil41b.zip
beta/v2gnu730551Jun 27 2008fnd4233br4.zip
beta/v2gnu21142487Jul 17 00:34gcc491b.zip
beta/v2gnu10969714Jul 17 00:34gpp491b.zip
beta/v2gnu629895Sep 2 16:56grep220b.zip
beta/v2gnu2943279Dec 15 2003gro116b.zip
beta/v2gnu8363181Aug 31 13:57gtxt192b.zip
beta/v2gnu363193Jul 14 19:06m4-1417b.zip
beta/v2gnu755391Oct 10 23:03mak41b.zip
beta/v2gnu429978Sep 5 20:42sed422b.zip
beta/v2gnu2362671Oct 12 08:11shl2011b.zip
beta/v2gnu1142732Jan 9 2009txi413br2.zip
beta/v2gnu2305385Oct 12 08:11txt20b.zip

Unzip all files in C:\DJGPP and set the following environment variables accordingly:

  set PATH=C:\DJGPP\BIN;%PATH%
  set DJGPP=C:\DJGPP\DJGPP.ENV

In addition, a command-line zip program must be installed in the path.  One that works is the DJGPP-compiled Info-ZIP binary available from the FreeDOS archive.

Stage 2:  Build CVS snapshot

2.1.  Unpack the CVS snapshot in a working directory, not inside the C:\DJGPP installation.  We will call it C:\BUILD.

2.2.  Copy 2 linker scripts from the snapshot into the C:\DJGPP installation, overwriting the existing versions:

  COPY C:\BUILD\DJGPP\LIB\DJGPP.DJL C:\DJGPP\LIB
  COPY C:\BUILD\DJGPP\LIB\DXE.LD    C:\DJGPP\LIB

2.3.  CD into the C:\BUILD\DJGPP\SRC directory and start the build process by typing "make".  It may take some time to complete.  If the process finishes without error messages, you win.

2.4.  Zip up the newly built files by CDing into C:\BUILD\DJGPP\DISTRIB and typing "mkdist".  The resulting packages, which replace those from beta/v2, end up in C:\BUILD\DJGPP\ZIPS.

883592Oct 19 21:01djcrx204.zip
2625207Oct 19 20:58djdev204.zip
1997227Oct 19 21:00djlsr204.zip
1056391Oct 19 21:01djtst204.zip
581835Oct 19 21:01djtzn204.zip
407962Oct 19 21:02djtzs204.zip

Stage 3:  Merge built packages into 2.04 installation

At a minimum, the djdev204.zip that was installed previously is now obsolete.  A brave person could simply unzip the newly built packages in C:\DJGPP.  To prevent any obsolete files from accidentally getting used, a more cautious person would erase the C:\DJGPP directory and recreate it with the new packages substituting for the old ones.


KB
Home