From: Roger Hoover <rhoover@watson.ibm.com>
Subject: IBMR2 fixes for 2.10
To: m3, barton@chopin.eche.ualberta.ca
Cc: rhoover@watson.ibm.com
X-External-Networks: yes
Date: Thu, 17 Dec 92 09:01:15 EST


Bug fixes to get 2.10 to compile on RS6000 with shared libs.

> From: Eric Muller <muller@src.dec.com>
> Another problem we have fixed recently, in m3make/src/M3makefile: the
> lines for the rule install should look like:
>
> ----------------------------------------
> install::
> 	@../src/recmkdir $(BIN_INSTALL)
> 	@../src/recmkdir $(LIB_INSTALL)
> 	@../src/recmkdir $(PUB_INSTALL)
>
> #if defined (MAN_SECTION)
> install::
> 	@../src/recmkdir $(MAN_INSTALL)/man##MAN_SECTION
> #else
> install:
> 	@../src/recmkdir $(MAN_INSTALL)/man1
> 	@../src/recmkdir $(MAN_INSTALL)/man2
> 	@../src/recmkdir $(MAN_INSTALL)/man3
> 	@../src/recmkdir $(MAN_INSTALL)/man4
> 	@../src/recmkdir $(MAN_INSTALL)/man5
> 	@../src/recmkdir $(MAN_INSTALL)/man6
> 	@../src/recmkdir $(MAN_INSTALL)/man7
> 	@../src/recmkdir $(MAN_INSTALL)/man8
> #endif
> ----------------------------------------
>
> otherwise you have a extra blank line at line 121 in .makefile.
>

Changes in model_configs/IBMR2:

o  A warning about which aix c compiler you need.
o  The library produced by library() is of the form
   lib##name.a, not lib##name.so.1.1 as it is for SPARK,
   thus all:: and clean:: should be lib##name.a
o  the sed command must contain real tabs, not \t's
o  there is a / missing before the p at the end of the sed
   expression.
o  colons in bsdcc command must be escaped with \ or imake
   will think they are make productions and screw up the
   tab before the line.
o  -nostart should be _nostart
o  libname.a should be lib##name.a (two occurrences)
o   _DREDUCED_TO_ASCII_SPACE should be -DREDUCED_TO_ASCII_SPACE
o  it turns out there is a second incompatable sysV install
   on AIX, so we need to specify /usr/ucb/install
o  Shared libraries on RS6K require all name resolution to
   be done at link time.  All libraries need -lm, but other
   libraries will need -lm3 and perhaps more.  (for example,
   libm3ui.a requires -lm3X11R4 -lX11 -lm3 in addition to -lm)
   I've added a second argument to library and Library to
   specify these.  This means adding a second argument to
   all of the library lines in m3makefiles.  Also, if you want
   to run on other architectures, you have to fix up the
   library macros everywhere with an ignored second arg.

roger

trek[m3]% diff -c m3make/model-configs/IBMR2 m3make/IBMR2/config
*** m3make/model-configs/IBMR2	Tue Oct 27 14:25:43 1992
- --- m3make/IBMR2/config	Thu Dec 17 08:01:16 1992
***************
*** 43,48 ****
- --- 43,53 ----
     discusses the remaining incompatibilities.  The troff source
     for a version of the porting document is in file
     /usr/lpp/bos/bsdport.tr.
+
+ ALSO NOTE:  There is a bug in earlier versions of the 3.2 xlc compiler
+ that will give you compilation errors.  The earliest version known to
+ compile m3 2.10(and above) is 1.2.0.7.  1.2.0.0 does not work.  To see
+ which version you have, type "/usr/ucb/what /usr/lpp/xlc/bin/xlcentry".
  */

  /*********************************************************************/
***************
*** 152,175 ****
  /* These macros are used instead of the ones in the template, so that we
     can have shared libraries */

! #define library(name)                                                       @@\
! all:: lib##name.so.1.1                                                      @@\
! clean:: ; rm -f lib##name.so.1.1 lib##name.ax                               @@\
  lib##name.a: FRC                                                            @@\
  	$(DO_M3) -a lib##name.a $(PGM_SOURCES) $(IMPORT_LIBS)               @@\
  	/bin/dump -g lib##name.a | sed -n -e \                              @@\
! 	  's/^[ \t]*[0-9][0-9]*[ \t]*\([^ \t.][^ \t]*\)$$/\1p' > _expnames  @@\
! 	/bin/bsdcc -bE:_expnames -bM:SRE -o _shar.o lib##name.a \           @@\
! 	  -L$(LIB_USE) $(IMPORT_LIBS) $(LINKFILES) -e -nostart              @@\
! 	rm -f libname.a                                                     @@\
! 	/bin/ar cru libname.a _shar.o                                       @@\
  	rm -f _expnames _shar.o	

! #define Library(name)                                                       @@\
  install::                                                                   @@\
  	INSTALL (lib##name.a, $(LIB_INSTALL), 644)                          @@\
  	INSTALL (lib##name.ax, $(LIB_INSTALL), 644)                         @@\
! library(name)

  /* Give the value 0 if you want the m3 driver to pass -L/-l arguments to
     LD for libraries; otherwise (value = 1), the m3 driver will pass
- --- 157,181 ----
  /* These macros are used instead of the ones in the template, so that we
     can have shared libraries */

! #define library(name,deplibs)                                               @@\
! all:: lib##name.a                                                           @@\
! clean:: ; rm -f lib##name.a lib##name.ax                                    @@\
  lib##name.a: FRC                                                            @@\
  	$(DO_M3) -a lib##name.a $(PGM_SOURCES) $(IMPORT_LIBS)               @@\
  	/bin/dump -g lib##name.a | sed -n -e \                              @@\
! 	  's/^[ 	]*[0-9][0-9]*[ 	]*\([^ 	.][^ 	]*\)$$/\1/p' \      @@\
! 	  > _expnames                                                       @@\
! 	/bin/bsdcc -bE\:_expnames -bM\:SRE -o _shar.o lib##name.a \         @@\
! 	  -L$(LIB_USE) deplibs -lm -e _nostart                              @@\
! 	rm -f lib##name.a                                                   @@\
! 	/bin/ar cru lib##name.a _shar.o                                     @@\
  	rm -f _expnames _shar.o	

! #define Library(name,deplibs)                                               @@\
  install::                                                                   @@\
  	INSTALL (lib##name.a, $(LIB_INSTALL), 644)                          @@\
  	INSTALL (lib##name.ax, $(LIB_INSTALL), 644)                         @@\
! library(name,deplibs)

  /* Give the value 0 if you want the m3 driver to pass -L/-l arguments to
     LD for libraries; otherwise (value = 1), the m3 driver will pass
***************
*** 188,194 ****
  /* Imake may need to be configured

     Note: the value of this symbol must not use the values of other symbols. */
! IMAKEFLAGS = _DREDUCED_TO_ASCII_SPACE

  /* Some versions of make(1) let us specify the shell to use. In any
     case, we want sh */
- --- 194,200 ----
  /* Imake may need to be configured

     Note: the value of this symbol must not use the values of other symbols. */
! IMAKEFLAGS = -DREDUCED_TO_ASCII_SPACE

  /* Some versions of make(1) let us specify the shell to use. In any
     case, we want sh */
***************
*** 205,211 ****
  MAKE = /usr/bin/make

  /* And install */
! #define INSTALL(f,d,p) install -c -m p f d

  /* Here are the pieces that the Modula-3 driver needs.
      PASS0: the Modula-3 to C compiler
- --- 211,217 ----
  MAKE = /usr/bin/make

  /* And install */
! #define INSTALL(f,d,p) /usr/ucb/install -c -m p f d

  /* Here are the pieces that the Modula-3 driver needs.
      PASS0: the Modula-3 to C compiler
trek[m3]% diff -c libm3/src/m3makefile~ libm3/src/m3makefile
*** libm3/src/m3makefile~       Mon Nov 16 13:07:47 1992
- --- libm3/src/m3makefile        Thu Dec 17 07:50:26 1992
***************
*** 201,204 ****

  M3FLAGS = -w1 -make -why -nostd -times

! Library (m3)
- --- 201,204 ----

  M3FLAGS = -w1 -make -why -nostd -times

! Library (m3,)
trek[m3]%
Newsgroups: comp.lang.modula3