[comp.soft-sys.andrew] A Suggestion: config/@sys/site.*

bernerus@CS.CHALMERS.SE (Christer Bernerus) (01/25/91)

My  $.02 worth:

When building Andrew for many architectures it is often necessary to be
able to have different site.* configurations for different
architectures. E.g. becuse of different versions of X.

The current setup implies that all site dependent confgurations are done
in ONE (1) set of files for all architectures.
Since we want to keep only one copy of the source, it would be nice if
the config/@sys directories could also have one site.* fileset each
where architecture dependent configurations, that are also site
specific, could be placed. 

	Chris.
-------------------------------------------------------
Christer Bernerus 			! E-mail: bernerus@cs.chalmers.se
Chalmers University of Technology		! Phone: +46 31 721000
Department of Computer Science		! Ham radio: SM6FBQ	144.3 MHz
S-412 96 Gothenburg, SWEDEN	

ghoti+@ANDREW.CMU.EDU (Adam Stoller) (01/25/91)

Excerpts from internet.info-andrew: 25-Jan-91 A Suggestion:
config/@sys/s.. Christer Bernerus@cs.cha (825+0)

> My  $.02 worth:

> When building Andrew for many architectures it is often necessary to be
> able to have different site.* configurations for different
> architectures. E.g. becuse of different versions of X.

> The current setup implies that all site dependent confgurations are done
> in ONE (1) set of files for all architectures.
> Since we want to keep only one copy of the source, it would be nice if
> the config/@sys directories could also have one site.* fileset each
> where architecture dependent configurations, that are also site
> specific, could be placed. 

> 	Chris.

We primarilly keep one copy of the source too (this has changed somewhat
in the last year or so -as the people here, in charge of the
distribution, have another copy that they keep) - and we currently
support (to varying degrees) around four or five different sys-types. 
Having one site.h and one site.mcr file makes this rather easy to
maintain because:

    The first thing the imake.tmpl does is include the system.mcr
    The first think the system.mcr file does is include the system.h file.

    The last thing the system.h file does is include the site.h file -
    by this time the system-dependent flags have been set.
    The last thing the system.mcr file does is include the site.mcr file
    - by this time the system-dependent flags have been set too.

Thus - your site files are supposed to be able to have your own site's
ifdefs in it - i.e.

-----site.h------
/* 
 * Example: the allsys.h file does NOT define AMS_DELIVERY_ENV, and the
 * specific system.h doesn't define it either - but you want it for all
 * your system types at your site.
 */
#ifndef AMS_DELIVERY_ENV
#define AMS_DELIVERY_ENV 1
#endif 

/*
 * Example: Similar to the above - but you only want to build the SNAP
 * stuff if you are building on a sun4 running sunOS 4.0
 */
#ifdef sys_sun4_40
#ifndef SNAP_ENV
#define SNAP_ENV 1
#endif
#endif
________________

Similar examples can be made for the site.mcr file:

-----site.mcr-----
/* NOTE: whitespace before var names is <space>'s only, not <tab>'s */
/*
 * Example: Some of the systems are by default (or through your site.h
 * file) expected to be run with the RESOLVER_ENV turned on - several of
 * your systems have this library and it's associated include files in
 * different places.
 */
#ifdef RESOLVER_ENV
#ifdef sys_rt_r3
        RESOLVLIB = $(AFSBASEDIR)/lib/res/libresolv.a
        RESINC = $(AFSBASEDIR)/include/res
#endif
#ifdef sys_sun3_35
        RESOLVLIB = /usr/lib/libresolv.a
        RESINC = 
#endif
#ifdef sys_sun4_40
        RESOLVLIB = /usr/lib/bind/libresolv.a
        RESINC = /usr/include/bind
#endif
#endif /* RESOLVER_ENV */

/*
 * Example: The system.mcr file specifies that CC=cc, and this is fine
 * for most of your systems, but on the sun3_35 you want to use gcc - and
 * you want it to bitch like hell when it finds something questionable.
 */
#ifdef sys_sun3_35
        CC = gcc
        CDEBUGFLAGS = -g -O -Wall
#endif
________________

A similar example could also be found for the site.rules file....


--fish

bernerus@CS.CHALMERS.SE (Christer Bernerus) (01/28/91)

Thanks Adam for your answer. I guess that solves all of my problems, and
in a more elegant way than my $0.02 suggestion since I only need one set
of site.* files.

Now back to work....

Chris.