kgorlen@sparkler.dcrt.nih.gov (Keith Gorlen) (10/06/90)
Notes on compiling NIHCL 3.0 with Sun C++ R2.0 under SunOS 4.0.3
October 5, 1990
Problems with stdarg on SPARC
-----------------------------
NIHCL 3.0 contains a hack to make stdarg work with AT&T C++ R2.0 on
the SPARC architecture. This hack must be removed when compiling with
Sun C++ R2.0 as follows:
errfac/errors.c
#ifndef SUNCC
#ifdef sparc
// Use magic name to make stdarg work
#define sev __builtin_va_alist
#endif
#endif
lib/Class.c
#ifndef SUNCC
#ifdef sparc
// Use magic name to make stdarg work
#define arg0 __builtin_va_alist
#endif
#endif
lib/Exception.c
#ifndef SUNCC
#ifdef sparc
// Use magic name to make stdarg work
#define sev_ __builtin_va_alist
#endif
#endif
ex/Vehicle.c
#ifndef SUNCC
#ifdef sparc
// Use magic name to make stdarg work
#define fname __builtin_va_alist
#endif
#endif
Then recompile these four files with -DSUNCC.
Selection of _main.c for Sun C++ R2.0
-------------------------------------
The "munch" version of lib/_main.c must be used for Sun C++ R2.0
because the "patch" version cannot initialize the static objects in a
shared library, such as libC.so. Select MAIN = _main.c_m in the top
level Makefile and apply the following patch to lib/Makefile:
always:
-rm -f targetlist *.o _main.c
touch targetlist
ln ${LNFLAGS} ${MAIN} _main.c
${MAKE} generic
Keith Gorlen phone: (301) 496-1111
Building 12A, Room 2033 uucp: uunet!nih-csl!kgorlen
National Institutes of Health Internet: kgorlen@alw.nih.gov
Bethesda, MD 20892