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.
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.
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.
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