I strongly recommend you use make. Using a script is like going in with a
scoop shovel when a teaspoon will do.  Make will let you do a build so that
if only one of the routines has changed, that's the only one that compiles.

To learn make, get the O'Reilly book "Managing Projects with make." You'll
find make useful on both your Solaris and AIX platforms and can use one set
of rules for building on both. Just be aware of the differences in the
output of the two when watching for errors.

If you're not doing version control, you might also want to start using
something like RCS. O'Reilly has a book on that, too.

Good luck,
Bruce


===============
Bruce Olsen
System Integration Strategy and Architecture
Email: [EMAIL PROTECTED]
Phone: (727) 898-8851
Mobile: (727) 421-0865
Fax: (507) 262-1567

-----Original Message-----
From: MQSeries List [mailto:[EMAIL PROTECTED]]On Behalf Of Bruce
Barclay
Sent: Tuesday, September 17, 2002 11:19 AM
To: [EMAIL PROTECTED]
Subject: FW: SUN Solaris Compile Script

The following note was sent to me from one of our developers. It concerns
the problem of being able to compile a program having several subprograms.
This is not necessarily an MQ problem but all our MQ programs have to be
compiled for the Sun system. We have no problem on AIX or OS/390, just Sun.
Anyone out there experience this problem??  Any suggestions greatly
appreciated. BB.

> Bruce,
>
>      I have a trouble to create an executable module from a separate
> compiled C-routine for the SUN Solaris machine.  Can you provide me some
> asistance?    Below is the script used to compile the routine separately:
>
> #!/bin/ksh
> #
> #  compile the next 11 subprograms into object files
> #
> LIB=/usr/lib
> LVERSION=libshare.so.1
> gcc -g  -c  -fPIC -I/usr/include -o Buffdump.o Buffdump.c
> gcc -g  -c  -fPIC -I/usr/include -o Extrfnme.o Extrfnme.c
> gcc -g  -c  -fPIC -I/usr/include -o Getmemry.o Getmemry.c
> gcc -g  -c  -fPIC -I/usr/include -o Gtconfig.o Gtconfig.c
> gcc -g  -c  -fPIC -I/usr/include -o Writelog.o Writelog.c
> gcc -g  -c  -fPIC -I/usr/include -o Writmess.o Writmess.c
> gcc -g  -c  -fPIC -I/usr/include -o Sendrply.o Sendrply.c
> gcc -g  -c  -fPIC -I/usr/include -o Dynalloc.o Dynalloc.c
> gcc -g  -c  -fPIC -I/usr/include -o Crtmvsjb.o Crtmvsjb.c
> gcc -g  -c  -fPIC -I/usr/include -o getmess.o  getmess.c
> gcc -g  -c  -fPIC -I/usr/include -o chkreply.o chkreply.c
>
>
>
>    For the AIX machine, I have no problem to create the executable module.
> Below is the script that I use :
>
> 1.
>
>
> #!/bin/ksh
> #
> #  compile the next 11 subprograms into object files
> #
> /usr/vac/bin/xlc -c -L/usr/mqm/lib -lmqm Buffdump.c
> /usr/vac/bin/xlc -c -L/usr/mqm/lib -lmqm Extrfnme.c
> /usr/vac/bin/xlc -c -L/usr/mqm/lib -lmqm Getmemry.c
> /usr/vac/bin/xlc -c -L/usr/mqm/lib -lmqm Gtconfig.c
> /usr/vac/bin/xlc -c -L/usr/mqm/lib -lmqm Writelog.c
> /usr/vac/bin/xlc -c -L/usr/mqm/lib -lmqm Writmess.c
> /usr/vac/bin/xlc -c -L/usr/mqm/lib -lmqm Sendrply.c
> /usr/vac/bin/xlc -c -L/usr/mqm/lib -lmqm Dynalloc.c
> /usr/vac/bin/xlc -c -L/usr/mqm/lib -lmqm Crtmvsjb.c
> /usr/vac/bin/xlc -c -L/usr/mqm/lib -lmqm getmess.c
> /usr/vac/bin/xlc -c -L/usr/mqm/lib -lmqm chkreply.c
> #
> #  create share object file using the above object files
> #  Note that create an entry in the export file (libadd.exp)
> #  for each callable function name defined in the subprogram
> #
> /usr/vac/bin/xlc -o/common/shareobj.o -L/usr/mqm/lib -lmqm \
>  Buffdump.o \
>  Extrfnme.o \
>  Getmemry.o \
>  Gtconfig.o \
>  Writelog.o \
>  Writmess.o \
>  Sendrply.o \
>  Dynalloc.o \
>  Crtmvsjb.o  \
>  getmess.o \
>  chkreply.o \
>  -bE:libadd.exp \
>  -bM:SRE -bnoentry
>
> exit
>
> The 1st step fo the above script is to compile each individual subprogram
> into an object file which is then used to create an share object file in
> the 2nd step.
>
>    2.  Create an executable module for MASISGET for the AIX machine:
>
> #!/bin/ksh
> /usr/vac/bin/xlc -omasisget -L/usr/mqm/lib -lmqm Masisget.c \
>  -L/u/ema/rel3.1 /common/shareobj.o
>
> exit
>
>

Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive

Instructions for managing your mailing list subscription are provided in
the Listserv General Users Guide available at http://www.lsoft.com
Archive: http://vm.akh-wien.ac.at/MQSeries.archive

Reply via email to