*BSD News Article 67034


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mira.net.au!news.vbc.net!alpha.sky.net!winternet.com!mr.net!newshub.tc.umn.edu!spool.mu.edu!howland.reston.ans.net!agate!agate!usenet
From: hodges@plato.ds.boeing.com (Bill Hodges)
Newsgroups: comp.unix.bsd.netbsd.announce
Subject: Announcing GNAT-3.03 (Object Oriented Ada95) to NetBSD
Followup-To: poster
Date: 27 Apr 1996 13:05:05 -0700
Organization: University of California, Berkeley
Lines: 303
Sender: cgd@agate.berkeley.edu
Approved: netbsd-announce-request@agate.berkeley.edu
Message-ID: <9604260340.AA13428@plato.ds.boeing.com>
NNTP-Posting-Host: agate.berkeley.edu
Status: RO





                Gnat-3.03  for  NetBSD-1.1/i386



                        Jesus M. Gonzalez Barahona

                             jgb@gsyc.inf.uc3m.es


                                  April 24, 1996



1     What's  this  stuff


This is the README file for the port of GNAT to NetBSD-1.1/i386.  GNAT
is an Ada front-end for GCC, which supports the Ada95 standard. The binary
package for NetBSD is in fact and Ada and C compiler, based on gcc-2.7.2.
   Important note:  This is not a `supported version' built by the GNAT core
team.  So, any noise relating to the port should be addressed directly to the
`porter' _see title for e-mail address. Beggining with port of gnat-3.03, NetBSD
does also have Ada tasking, based in MIT (Provenzano's) pthreads. It has been
tested, and most things work.  There are some bugs, though.  If you want to
help to find them, just drop me a line.
   This file tells you:


   -  Section 2:  How to install the binary package for NetBSD (and where to
      get it).

   -  Section 4: How this port has been made, compiling the GNAT source.

   -  Section 3: Where to look for documentation.


   I just hope you find it useful...



2     Installing  gnat-3.03  from  binaries


This is for binaries of gnat-3.03 for NetBSD/i386-1.1.  You can get the tared,
compressed file from:

   - ftp://cs.nyu.edu /pub/gnat/gnat-3.03-i386-unknown-netbsd1.1.tar.gz

   -  ftp://ftp.gsyc.inf.uc3m.es/ pub/NetBSD/ports/gnat-3.03-i386-unknown-netbsd1.1.tar.gz


   The following recipe assumes you have the tar.gz file as /mix/share/distrib/gnat/gnat-
3.03-i386-unknown-netbsd1.0.tar.gz ).

   1. cd /

   2. tar xvzf /mix/share/distrib/gnat/gnat-3.03-i386-unknown-netbsd1.1.tar.gz

   Once you have done that, you have gnat installed. Now, before using it, you
have to set paths and the like. To do so, just source the proper env-vals (from
a csh):



                                          1




%  source  /usr/local/install/gnat-3.03/env-vals


   If you want to install gnat in other place, different from /usr/local/install/gnat-3.03,
you'll have to figure out how to set a proper env-vals.  Have a look at the one
provided.



3     Where  to  find  documentation


Try out the doc directory in the binary distribution. There you can find:


   -  gnatinfo.txt: How to use gnat, and some rationale about it.

   -  gnatdoc1.ps: Well, the name says almost everything: : :

   -  features: What does current version of gnat do.


   You can also browse ftp://cs.nyu.edu/pub/gnat, where there is info not only
about Gnat use and development, but also about Ada95 and related topics.
   A lot of info about Ada is also available on the Web. Try out http://lglwww.epfl.ch/Ada.



4     Building  up  the  thing  from  sources


4.1    Tools and sources

These is where you can get the tools and sources mentioned here:


   -  gnat-3.01 for NetBSD from ftp://ftp.gsyc.inf.uc3m.es/pub/NetBSD/ports/gnat-
      3.01-i386-netbsd1.0.tar.gz

   -  gnat-3.03 sources from ftp://cs.nyu.edu/pub/gnat/gnat-3.03-src.tar.gz

   -  Patches for gnat-3.03 to compile in NetBSD-1.1/i386 from ftp://ftp.gsyc.inf.uc3m.es/pub/NetBS*
 *D/ports/gnat-
      3.03-src-netbsd.dif

   -  gcc-2.7.2 from ftp://prep.ai.mit.edu/pub/gnu/gcc-2.7.2.tar.gz

   -  pthreads-1_60_beta5 for NetBSD from ftp://ftp.gsyc.inf.uc3m.es/pub/NetBSD/ports/pthreads-1_60*
 *_beta5-i386-unknown-netbsd1.1.tar.gz

   -  GNU make from ftp://prep.ai.mit.edu/pub/gnu/make



                                          2




4.2    Building the whole thing

First of all,  I install gnat-3.01,  and set up some variables.  If you have the
various packages isntalled in other dirs, just setup the proper variables fo ryour
evironment:


setenv  GCC  gcc-2.7.2
setenv  OLD_GNAT  gnat-3.01
setenv  NEW_GNAT  gnat-3.03
setenv  NEW_GNAT_VERS  $NEW_GNAT
setenv  DIR_TEST  /usr/local/test/gnat
setenv  DIR_INSTALL  /usr/local/install
setenv  DIR_DISTRIB  /mix/share/distrib/gnat
setenv  OLD_GNAT_INSTALL  $DIR_INSTALL/$OLD_GNAT
setenv  NEW_GNAT_INSTALL  $DIR_INSTALL/$NEW_GNAT_VERS
setenv  NEW_GNAT_TEST  $DIR_TEST/$NEW_GNAT_VERS
setenv  NEW_GNAT_SRC  $DIR_TEST/$NEW_GNAT-src
setenv  NEW_GCC_DISTRIB  "
  $DIR_DISTRIB/$GCC.tar.gz
setenv  NEW_GNAT_DISTRIB  "
  $DIR_DISTRIB/$NEW_GNAT/$NEW_GNAT-src.tar.gz
setenv  NEW_GNAT_PKG  /usr/local/test/pkg_dir/$NEW_GNAT_VERS
source  $OLD_GNAT_INSTALL/env-vals
setenv  LOG_FILE  /var/tmp/$NEW_GNAT.log
unlimit
setenv  PTHREADS  pthreads-1_60_beta5


   Also, it is assumed that you can call the "pthreaded" gcc as "pgcc" (that is,
it's called "pgcc" and it in your path).
   I untar both GCCandNEW_GNAT:


mkdir  $NEW_GNAT_PKG
mkdir  $DIR_TEST
cd  $DIR_TEST
tar  xvzf  $NEW_GCC_DISTRIB  >>&!  $LOG_FILE
mv  $GCC  $NEW_GNAT_VERS
tar  xvzf  $NEW_GNAT_DISTRIB  >>&!  $LOG_FILE
patch  -p0  <  $DIR_DISTRIB/gnat-3.03-src-netbsd.dif


cd  $NEW_GNAT_TEST
patch  -N  -p0  <  $NEW_GNAT_SRC/src/gcc-272.dif


   Then, I copy the ada directory of $NEW_GNAT into the gcc distribution,
and touch some files:


cp  -rf  $NEW_GNAT_SRC/src/ada  $NEW_GNAT_TEST/
cd  $NEW_GNAT_TEST/ada
touch  treeprs.ads  a-[es]info.h  nmake.ad[bs]


   Now, configure and make:



                                          3




cd  $NEW_GNAT_TEST
./configure  --prefix=$NEW_GNAT_INSTALL  "
     --target=i386-unknown-netbsd1.1  --host=i386-unknown-netbsd1.1
make  CC=gcc  LANGUAGES="c  ada"  >>&!  $LOG_FILE
make  CC=gcc  gnatboot  >>&!  $LOG_FILE
make  CC=gcc  gnatlib_and_tools  >>&!  $LOG_FILE
mkdir  $NEW_GNAT_INSTALL
make  CC=gcc  LANGUAGES="c  ada"  install  >>&!  $LOG_FILE


   Let's put some useful files in the install directory (GNU's make-3.70, a proper
gcc, a file for helping with configuration, etc.):


cp  ./xgcc  $NEW_GNAT_INSTALL/bin/gcc
cp  $OLD_GNAT_INSTALL/bin/make  $NEW_GNAT_INSTALL/bin/make
cat  >!  $NEW_GNAT_INSTALL/env-vals
#  to  be  run  from  a  csh  as  "source  env-vals"  before  using  GNAT
#
unlimit
setenv  PATH  /usr/local/install/gnat-3.03/bin:$PATH
setenv  GCC_EXEC_PREFIX  /usr/local/install/gnat-3.03/lib/gcc-lib/i386-unknown-netbsd1.1/2.7.2/
setenv  ADA_INCLUDE_PATH  /usr/local/install/gnat-3.03/adainclude
setenv  ADA_OBJECTS_PATH  /usr/local/install/gnat-3.03/lib/gcc-lib/i386-unknown-netbsd1.1/2.7.2/ada*
 *lib
setenv  LIBRARY_PATH  /usr/local/install/gnat-3.03/lib/gcc-lib/i386-unknown-netbsd1.1/2.7.2/adalib
setenv  C_INCLUDE_PATH  /usr/local/install/gnat-3.03/lib/gcc-lib/i386-unknown-netbsd1.1/2.7.2/inclu*
 *de
^D


   We need a proper version of pthread library:


cp  $DIR_INSTALL/$PTHREADS/lib/libpthread.a  $NEW_GNAT_INSTALL/lib/gcc-lib/i386-unknown-netbsd1.1/2*
 *.7.2/adalib/libpthread.a


Also, let's make leaner software


cd  $NEW_GNAT_INSTALL/bin
strip  gcc  gnatbind  gnatbl  gnatchp  gnatf  gnatk8  gnatmake
cd  $NEW_GNAT_INSTALL/lib/gcc-lib/i386-unknown-netbsd1.1/2.7.2
strip  cc1  cpp  gnat1


   I also copy some examples:


mkdir  $NEW_GNAT_INSTALL/examples
cp  $NEW_GNAT_SRC/examples/*  $NEW_GNAT_INSTALL/examples


   And some documentation:


cd  $NEW_GNAT_PKG/doc
dvi2tty  -w100  -o  gnat-3.03-i386-unknown-netbsd1.1-README  "
    gnat-3.03-i386-unknown-netbsd1.1-README.dvi
dvips  -t  a4  -O  0cm,0cm  -o  gnat-3.03-i386-unknown-netbsd1.1-README.ps  "
    gnat-3.03-i386-unknown-netbsd1.1-README.dvi
mkdir  $NEW_GNAT_INSTALL/doc
cp  $NEW_GNAT_PKG/doc/gnat-3.03-i386-unknown-netbsd1.1-README.ps  "
    $NEW_GNAT_INSTALL/doc



                                          4




cp  $NEW_GNAT_PKG/doc/gnat-3.03-i386-unknown-netbsd1.1-README  "
    $NEW_GNAT_INSTALL/doc
cp  $NEW_GNAT_PKG/doc/gnat-3.03-i386-unknown-netbsd1.1-README.dvi  "
    $NEW_GNAT_INSTALL/doc
cp  $NEW_GNAT_SRC/gnatdoc1.tex  $NEW_GNAT_INSTALL/doc
cp  $NEW_GNAT_SRC/gnatinfo.txt  $NEW_GNAT_INSTALL/doc
cp  $NEW_GNAT_SRC/features  $NEW_GNAT_INSTALL/doc


   And let's package everithing together:


cd  $NEW_GNAT_PKG
tar  -C  /usr/local/install  -cvzf  "
    $NEW_GNAT_PKG/$NEW_GNAT-i386-unknown-netbsd1.1.tar.gz  $NEW_GNAT/



                                          5




5     Comments,  etc.


If you have any coment,  question,  etc.  about the port of gnat to NetBSD-
1.1/i386, please let me know. My address is in the title of this file.



                                          6