Mail Archives: djgpp/2006/08/22/15:46:59
X-Authentication-Warning: | delorie.com: mail set sender to djgpp-bounces using -f
|
From: | chuyphan AT gmail DOT com
|
Newsgroups: | comp.os.msdos.djgpp
|
Subject: | incorporate pdcurses 2.8 with djgpp 2.03
|
Date: | 22 Aug 2006 12:40:09 -0700
|
Organization: | http://groups.google.com
|
Lines: | 281
|
Message-ID: | <1156275609.336731.92130@m73g2000cwd.googlegroups.com>
|
NNTP-Posting-Host: | 132.239.142.130
|
Mime-Version: | 1.0
|
X-Trace: | posting.google.com 1156275616 7857 127.0.0.1 (22 Aug 2006 19:40:16 GMT)
|
X-Complaints-To: | groups-abuse AT google DOT com
|
NNTP-Posting-Date: | Tue, 22 Aug 2006 19:40:16 +0000 (UTC)
|
User-Agent: | G2/0.2
|
X-HTTP-UserAgent: | Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322),gzip(gfe),gzip(gfe)
|
Complaints-To: | groups-abuse AT google DOT com
|
Injection-Info: | m73g2000cwd.googlegroups.com; posting-host=132.239.142.130;
|
| posting-account=1zC-cQ0AAACPTNZ7EiJGpo6EG3GwJK4N
|
To: | djgpp AT delorie DOT com
|
DJ-Gateway: | from newsgroup comp.os.msdos.djgpp
|
Reply-To: | djgpp AT delorie DOT com
|
I want to thank the mailing archives and newsgroup for the posts that
help me get PD Curses working with DJGPP. I hope this guide will help
someone out there.
/*******************************************************************************
Last Rev. Date: 08/21/06
Author: Cuong Phan
Contact: cphan AT ucsd DOT edu
References:
http://pdcurses.sourceforge.net/doc/PDCurses.txt (~ 141 KB)
http://www.delorie.com/archives/
http://www.delorie.com/djgpp/doc/ug/intro/installing-djgpp.html
*******************************************************************************/
This README explains how to incorporate the PD Curses ver. 2.8 toolkit
with the
DJGPP ver. 2.03 development tools.
/*******************************************************************************
What to download (note: URLs become outdated).
*******************************************************************************/
djdev203.zip DJGPP development tools ver. 2.03
URL: ftp://ftp.delorie.com/pub/djgpp/current/v2/djdev203.zip
gcc410b.zip GNU Compiler Collection ver. 4.1.0 (binaries)
URL: ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/gcc410b.zip
bnu2161b.zip GNU Binutils ver. 2.16.1 (binaries)
URL: ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/bnu2161b.zip
mak3791b.zip GNU Make ver. 3.79.1 (binaries)
URL: ftp://ftp.delorie.com/pub/djgpp/current/v2gnu/mak3791b.zip
pdc28djg.zip PD Curses toolkit compiled for DJGPP
URL: http://prdownloads.sourceforge.net/pdcurses/pdc28djg.zip?download
Note: This is not a direct link; you must choose a mirror.
pdcurs28.zip PDCurses source files (for testing purposes)
URL: http://prdownloads.sourceforge.net/pdcurses/pdcurs28.zip?download
Note: This is not a direct link; you must choose a mirror.
/*******************************************************************************
Archivers to uncompress/extract archived files.
*******************************************************************************/
I recommend WinRAR for Windows operating systems and RAR for DOS
systems.
URL: http://www.rarlab.com/download.htm
Or you can use the one recommended by the DJGPP website.
URL: ftp://ftp.delorie.com/pub/djgpp/current/unzip32.exe
/*******************************************************************************
Install DJGPP (taken directly from readme.1st).
*******************************************************************************/
1. Create a directory for DJGPP, say C:\DJGPP. (WARNING: do NOT
install DJGPP in a directory C:\DEV, D:\DEV, etc., or in any of
their
subdirectories: it will not work! See the FAQ for more details.)
Do
not use a long directory name or one with spaces or special
characters.
If you have version 1.x installed, it's best to delete the contents
of its `bin/' subdirectory or move it to another directory (not on
your PATH), and delete everything else from that installation.
(Some of the problems reported by users of DJGPP v2 were caused by
inadvertently mixing it with old v1.x programs.) The only program
from v1.x that you should keep is `go32.exe'.
If you are running under Windows NT 4.0, you need to decide if you
want to use long names or DOS 8.3 names before you install. If you
plan to use long names you need to download and install the long
file
name TSR (ntlfn*b.zip) before expanding the distributions.
2. Unzip all the zip files from that directory, preserving the
directory structure. For example:
pkunzip -d djdev203
or
unzip32 djdev203
On Windows 9x, Windows/ME, Windows 2000 and Windows XP, use an unzip
program which supports long file names. Latest versions of
InfoZip's
UnZip and PKUnZip, as well as WinZip, all support long file names.
unzip32.exe, available from the DJGPP sites, also supports long
file names. One way to make sure you have preserved long file
names is to look for a file include/sys/sysmacros.h: if you see
only sysmacro.h instead, your unzip program does NOT support long
filenames, and you need to find another one.
You must make sure when you expand the distributions that you
preserve
the directory structure. If you use WinZip, you MUST check the box
"Use folder names". If you use pkunzip, you must use the -d switch.
On Windows/NT (NT version 4 and below, not W2K!) use an unzip
program which does NOT support long file names if you not plan on
using the LFN TSR, as DJGPP programs cannot access long file names
on NT4 without the TSR. Again, unzip32.exe will do The Right Thing
for you, so using it is recommended.
3. After unzipping all the zip files, set the DJGPP environment
variable to point to the file DJGPP.ENV in the main DJGPP
installation directory and add its BIN subdirectory to your PATH.
The exact way how these variables should be set depends on your
operating system:
* For Windows 98 systems:
- Click START;
- Choose Programs->Accessories->System Tools->System Information;
- Click Tools in the menu-bar, then choose "System Configuration";
- Use the tab provided there for editing your AUTOEXEC.BAT as
explained below.
* For Windows ME systems:
- Click START, choose Run, type msconfig.exe, click OK;
- Click the "Environment" tab;
- Edit the PATH system variable to add the DJGPP bin subdirectory;
- Add a new variable DJGPP and set its value to the full path
name of the DJGPP.ENV file as explained below.
* For Windows NT systems:
- Right-click "My Computer", then select "Properties";
- Click the "Environment" tab;
- Edit the PATH system variable to add the DJGPP bin subdirectory;
(if you are not an administrator, add the DJGPP bin directory to
the user PATH variable - or create one with only this directory
since it is added to the system path);
- Add a new variable DJGPP and set its value to the full path
name of the DJGPP.ENV file as explained below.
* For Windows 2000 or Windows XP systems:
- Right-click "My Computer", then select "Properties";
- Select the "Advanced" tab, then click "Environment Variables"
button;
- Edit the PATH system variable to add the DJGPP bin subdirectory;
(if you are not an administrator, add the DJGPP bin directory to
the user PATH variable - or create one with only this directory
since it is added to the system path);
- Add a new variable DJGPP and set its value to the full path
name of the DJGPP.ENV file as explained below.
* For all other systems (DOS, Windows 3.X and Windows 95): use any
text editor, e.g. the standard EDIT, to edit the file
AUTOEXEC.BAT in the root directory of the boot drive (usually,
C:).
Instead of editing your autoexec files and/or global environment,
you may wish to create a djgpp shortcut instead. To do this, create
a BAT file which has the lines below in it. This is often needed if
you have multiple compilers on the same system.
No matter which method you use, assuming your DJGPP installation is
rooted at C:\DJGPP, the values of the two environment variables
DJGPP and PATH should be set like this:
set DJGPP=C:\DJGPP\DJGPP.ENV
set PATH=C:\DJGPP\BIN;%PATH%
4. Reboot. This makes sure the two lines you added to autoexec.bat
will take effect. (On Windows NT, Windows 2000 and Windows XP, the
changes take effect immediately, so you don't need to reboot there,
but you do have to close and reopen the DOS box windows.)
5. Run the go32-v2.exe program without arguments:
go32-v2
It should report how much DPMI memory and swap space can DJGPP use
on your system, like this:
DPMI memory available: 8020 Kb
DPMI swap space available: 39413 Kb
The actual numbers will vary according to amount of RAM installed
on your system, the available disk space and the DPMI server. If
the sum of the two numbers reported by go32-v2 is less than 4MB,
read section 3.9 of the FAQ, "How to configure your system for
DJGPP". (If you have more than that, but want to get the optimal
performance from your system, read that section anyway.)
/*******************************************************************************
Install GNU tools.
*******************************************************************************/
The files listed in the "What to download" section that are of the
format
"*b.zip" were compiled for the DJGPP. Simply extract the archives one
at a time
into the root directory of the DJGPP toolset, e.g.,
"C:\djgpp".
To test if GNU tools were installed correctly:
gcc: Enter gcc into a command prompt:
C:\>gcc
You should see:
gcc.exe: no input files
make: Enter make into a command prompt:
C:\>make
You should see:
make.exe: *** No targets specified and no makefile
found. Stop.
binutils: Enter ld into a command prompt:
C:\>ld
You should see:
c:/djgpp/bin/ld.exe: no input files
/*******************************************************************************
Install PD Curses.
*******************************************************************************/
01. Extract the contents of pdc28djg.zip into any directory you choose
for now,
say, "C:\pdc28djg". Let's call this directory "%whatever%".
02. For simplicity, let's call the root directory of your DJGPP
installation
"%DJGPP%". So, if you installed DJGPP into "C:\djgpp", replace
"%DJGPP%"
with "C:\djgpp". Copy the files in %whatever% to the appropriate
directories
in %DJGPP% by following this guide:
%whatever%\curses.h -> %DJGPP%\include
%whatever%\curspriv.h -> %DJGPP%\include
%whatever%\panel.h -> %DJGPP%\include
%whatever%\term.h -> %DJGPP%\include
%whatever%\panel.a -> %DJGPP%\lib
%whatever%\pdcurses.a -> %DJGPP%\lib
All other files are optional.
03. Prepend "panel.a" and "pdcurses.a" that are now located in
%DJGPP%\lib with
"lib". For example, "pdcurses.a" becomes "libpdcurses.a".
/*******************************************************************************
Test the PD Curses library.
*******************************************************************************/
Extract the "demos" directory from pdcurs28.zip into any directory you
like.
Open the command prompt and go to that directory.
Compile the source files to test if you have successfully integrated
the PD
Curses library by entering the following command at the prompt:
gcc firework.c -o firework.exe -lpdcurses
You should get an executable by the name of "firework.exe". Enter
"firework" at
the command prompt (in that directory) and if all is well, you should
see a
fireworks display. Press 'Q' to get back the command prompt (there is a
little
delay, but it will eventually quit).
/*******************************************************************************
Closing comments.
*******************************************************************************/
Now you should be able to develop programs utilizing PD Curses
functionality.
Just remember to add the argument to gcc when you compile:
"-lpdcurses".
- Raw text -