compiling gpc sources in plain dos / djgpp

Maurice Lombardi Maurice.Lombardi at ujf-grenoble.fr
Tue Aug 4 06:42:45 CEST 1998


Hi all,

Sometimes ago I have seen in a message of DJ Delorie in
comp.os.msdos.djgpp, saying that now djgpp with the autoconf port can
build with minor modification nearly every unix program governed by
configure shell scripts. 
I have thus retried to build gpc under plain DOS from gcc-2.8.1 and the
latest alpha sources gpc-980511.tar.gz.
It works indeed with very few modifications, but everything contained in
the directory p/config/msdos is now outdated, the configuration for gcc
has been completely changed between 2.7.2.x and 2.8.x.

I give in attachment a couple of files suggested for doing the
modifications automatically (a driver prepare.bat and a shell script
doprepar.sh), and a couple of instruction files (install.txt for
binaries, the old one only slightly updated, and readme.djgpp for
sources) to be put into the p/config/msdos directory (replacing the old
ones).

The modifications are
- a few 8.3 issues
   stamp-objlist   ->   s-objlist
   .gdbinit        ->   gdb.ini
   g??.info-NN     ->   g??.iNN     (only when LFN=n)
- GCC is built into the build.djgpp subdirectory of the gnu/gc-2.81
source directory, while gpc must be built into the source directory
itself.
- enlarge the stack for gpc1 and gpc-cpp. Done by modifying a file
config/i386/x-go32 which is already used by Delorie for enlarging the
stack of cc1 cc1plus and cc1obj.

With these modifications (plus one below to be done in the gpc sources
themselves) all compiles, and the built compiler gives the same results
as the binaries contained in the distribution for everything I have
tried, some private programs, test programs from bgi2grx, the gpc test
and testsuite.

The modification suggested to gpc sources themselves is the following
While looking around in the gcc "makefile.in" I have found the
following:

# Install the info files.
# $(INSTALL_DATA) might be a relative pathname, so we can't cd into
srcdir
# to do the install.  The sed rule was copied from stmp-int-hdrs.
install-info: doc installdirs lang.install-info
        -rm -f $(infodir)/cpp.i* $(infodir)/gcc.i*
        for f in $(srcdir)/cpp.i* $(srcdir)/gcc.i*; do \
            realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
            $(INSTALL_DATA) $$f $(infodir)/$$realfile; \
        done
        -chmod a-x $(infodir)/cpp.i* $(infodir)/gcc.i*

... and in the file "make-lang.in" from gpc, we indeed cd into the
srcdir, and this fails when I install in a relative directory (to see
what happens without overwriting my previous binary installation of
gpc).
So I suggest to replace in "gpc/p/make-lan.in"
the old content

pascal.install-info: $(srcdir)/p/doc/gpc.info
        -rm -f $(infodir)/gpc.info* ;
        cd $(srcdir)/p/doc; for f in gpc.info*; \
        do $(INSTALL_DATA) $$f $(infodir)/$$f; done
        -chmod a-x $(infodir)/gpc.info*

by the new content 

pascal.install-info: $(srcdir)/p/doc/gpc.info
        -rm -f $(infodir)/gpc.info* ;
        for f in $(srcdir)/p/doc/gpc.info*; do \
            realfile=`echo $$f | sed -e 's|.*/\([^/]*\)$$|\1|'`; \
            $(INSTALL_DATA) $$f $(infodir)/$$realfile; \
        done
        -chmod a-x $(infodir)/gpc.info*

The doprepar.sh will take care of info* -> i* afterwards, only for the
dos/LFN=no case.
I have checked thas this works.

Finally I have taken the .tar.gz sources untarred by the djtar utility.
For .zip sources there remain a couple of problems to be solved:
  .gdbinit is ignored by pkzip and extracted as _.gdb by infozip.
The extraction as _gdbinit done by djtar is supposed in the doprepar.sh
script.
  in gpc-980401.zip I have tried, the info files have the long names
gpc.info-NN, which cause problem both with pkunzip and infozip. This is
also the case in the .tar.gz archive, but djtar takes care of this, by
translating them to gpc.iNN, when LFN=no. The simplest workaround is
probably not to include these files, since they are rebuilt easily from
texi sources.
  the gpc diff filenames gpc-2.8.0.diff and gpc-2.8.1.diff are extracted
by djtar as gpc-2.8-0 and gpc-2.8-1, which is fine for doprepar.sh,
while infozip extract both as gpc-2_8_.dif (and barks for overwriting). 
This has no importance for alpha or beta stages, where you can supply
only .tar.gz files, but needs to be solved when releasing an official
version (everything is in zip format in the djgpp archives).

Hope this helps.

-- 
       Maurice Lombardi
Laboratoire de  Spectrometrie Physique,
Universite Joseph Fourier de Grenoble, BP87
38402 Saint Martin d'Heres Cedex     FRANCE
Tel: 33 (0)4 76 51 47 51
Fax: 33 (0)4 76 51 45 44
mailto:Maurice.Lombardi at ujf-grenoble.fr
-------------- next part --------------
@echo off
echo ... starting from p/config/msdos directory:
pwd
echo ... going to gcc source dir:
cd ..\..\..
pwd
echo ... running doprepar shell script
sh p\config\msdos\doprepar.sh
-------------- next part --------------
A non-text attachment was scrubbed...
Name: DOPREPAR.SH
Type: application/x-unknown-content-type-txtfile
Size: 1904 bytes
Desc: not available
URL: <http://www.g-n-u.de/pipermail/gpc/attachments/19980803/48fadf08/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: INSTALL.TXT
Type: application/x-unknown-content-type-txtfile
Size: 2547 bytes
Desc: not available
URL: <http://www.g-n-u.de/pipermail/gpc/attachments/19980803/48fadf08/attachment-0001.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: README.DJG
Type: application/x-unknown-content-type-txtfile
Size: 5123 bytes
Desc: not available
URL: <http://www.g-n-u.de/pipermail/gpc/attachments/19980803/48fadf08/attachment-0002.bin>


More information about the Gpc mailing list