next up previous contents
Next: Testing Your Installation Up: Shore Software Installation Manual Previous: Installing the Binary

 

Compiling and Installing the Source Release

This section describes how to compile the Shore source release. Of course, there is no need to do this if you are just planning to use the binary release.

First, un-tar the release somewhere. You can put it in the same directory as the binary installation, or you can make a new directory for the sources.

    # Go to a directory where you want to install 
    # the sources.
    # For simpilicity, we let that be $SHROOT.
    # If you use another directory, make the
    # appropriate substitution for SHROOT in
    # the next step.
    set SRCDIR=$SHROOT
    cd $SRCDIR
    gunzip -c $TARDIR/shore.1.0.src.tar.gz | tar xvf -
(users of sh, ksh, etc. should omit the word "set").

This installs the $SRCDIR/config, $SRCDIR/tools, and $SRCDIR/src. The directions below tell you how to determine where the binaries will be installed when you make Shore from the sources.

 

Setting Configuration Options

Before you build Shore, you must give values to some configuration options. These options are located at the top of the file $SRCDIR/config/Project.tmpl.

    vi $SRCDIR/config/Project.tmpl

For compilation to succeed you must set the values of TCL_DIR BISON_DIR, FLEX, and FLEXLIB, indicating where Tcl, Bison and Flex are installed at your site. The INSTALL_DIR specifies where the binaries will be installed when make install is executed.

In addition you may also need to set some definitions in $SRCDIR/config/shore.def.

    vi $SRCDIR/config/shore.def

Usually, the only ones you will need to change are those controlling debugging support and optimization. They take one of the values ON and OFF. We describe them briefly here. More information about the effects of these options can be found by reading the comments prefaced by ``Compilation Options'' in config/Project.tmpl.

DEBUGCODE
controls whether auditing and assert checking code is generated. For development and testing purposes we strongly suggest setting this to ON. Turning it on seems to slow things down by a factor of two, at least.

DEBUGGERSYMBOLS
controls the -g compiler flag.

OPTIMIZE
controls compiler flags related to optimization. When OPTIMIZE is OFF and you are compiling with gcc, gcc is called with -O because this seems to avoid gcc bugs (at least in earlier versions of gcc).

 

Compilation Steps

To build the system, gcc, perl, imake, make, and the normal Unix utilities must be in your path. The Makefiles are generated by Imake. They can be generated to work with GNU Make or with /bin/make, but not both. The steps below explain how to select which version of Make you use.

Here are the steps to compile Shore:

    cd $SRCDIR

    # The Imakefiles are shipped configured for Gnu Make.
    # If you are using /bin/make, edit $SRCDIR/config/shore.def
    # to #undef GNU_MAKE.
	#
	# If you are building for Solaris, you must 
	# change #undef FORCE_SOLARIS to #define FORCE_SOLARIS
	#
    vi $SRCDIR/config/shore.def

    # generate the Makefiles. NOTE: be sure to include the "."
    tools/makemake .

    # generate dependencies for Make
    # (causes some compilation to be done)
    tools/depend

    # start compiling
    cd $SRCDIR/src
    make

The tools/makemake command generates Makefiles using Imake. The argument, ``.'' is important. Once Makefiles are generated, later changes to Imakefiles can be installed by running: make make in the src directory.

The tools/depend command generates dependencies. Making dependencies causes some other targets to be made in some directories. For example, rpcgen is built because it is needed to make the dependencies in the Shore Value-Added Server. Once tools/depend has been run, dependencies can be updated by running: make depend in the src directory.

The final make builds the system. You can use make clean to remove all generated files.

The util/mount/sunos directory is skipped when making from the src directory. This directory contains patches to SunOS sources that are used to build an alternative version of smount, (a program for mounting the Shore File System). If you have a SunOS source license, you can edit the mount/sunos/Imakefile to point to the sources and then build smount.

 

Installing the Compiled Files

The Make target, install, installs the executable files in $INSTALL_DIR/bin, include files in $INSTALL_DIR/include, and other supporting files in $INSTALL_DIR/lib. It installs code and README files from src/examples and src/oo7 in $INSTALL_DIR/examples.

INSTALL_DIR is the macro set at the top of config/Project.tmpl. If you wish to change the it, you must change the macro and rerun tools/makemake, as described in the previous section, before you run make install.

To install:

    # edit INSTALL_DIR config/Project.tmpl if you
    # want to change the destination 

    cd $SRCDIR/src
    make install



next up previous contents
Next: Testing Your Installation Up: Shore Software Installation Manual Previous: Installing the Binary



Marvin Solomon
Tue Jul 1 15:30:39 CDT 1997