cde8cc396d5f62111cfb321c1fba1ed84e774d8c
[mmh] / INSTALL
1 #
2 # INSTALL -- installation instructions
3 #
4
5 --------------
6 Installing mmh
7 --------------
8 Please read all of the following instructions before you begin
9 building mmh.
10
11 You should check the docs/MACHINES file to see if there are any
12 specific build instructions for your operating system. To build mmh,
13 you will need an ANSI C compiler such as gcc.
14
15 0) If you have obtained mmh by checking it out of the version control
16    system, you will need to run the GNU autotools to regenerate some
17    files. (If your directory already contains a file 'config.h.in'
18    then this has already been done and you do not need to do it.)
19    You can regenerate the files by running the command
20
21    ./autogen.sh
22
23    (Note that if you're doing mmh development, you should look at
24    docs/README.developers for related information.)
25
26 1) From the top-level source directory, run the command:
27
28        ./configure [options]
29
30    This will check the configuration of your OS, as well as the various
31    Makefiles.
32
33    The configure script accepts various options. The options of
34    most interest are listed in a section below. To see the list
35    of all available options, you can run:
36
37        ./configure --help
38
39 2) make
40
41 3) make install
42
43    Note that if you have mmh files in the target directories with
44    the same names as the files being installed, the old ones will get
45    overwritten without any warning. The only directory this isn't
46    true for, is the `etc' directory -- in that directory, the distributed
47    files are installed with a `.dist' suffix if they differ from the
48    existing file. Watch for information messages while make is processing
49    that directory to see if you need to merge changes.
50
51 4) You may edit the file `mhn.defaults' in the mmh `etc' directory.
52
53    This file contains the default profile entries for the mmh commands
54    mhlist/mhstore/show.  The syntax of this file is described in section
55    9.4 of the book "MH & xmh: Email for Users and Programmers", 3rd edition,
56    by Jerry Peek, on the Internet at
57    <http://rand-mh.sourceforge.net/book/mh/confmhn.html>.
58    In most cases you can skip this step.
59
60 5) Add the bindir to your PATH variable.
61
62    If you haven't change any paths, then the bindir is `/usr/local/mmh/bin'.
63    Likely, your PATH is set in ~/.profile, ~/.kshrc, ~/.bashrc, or a similar
64    file. Have a look at mmhwrap(1), which allows you to access mmh tools
65    conveniently without changing the PATH variable.
66
67
68 -----------------------------------------------
69 Compiler options, or using a different compiler
70 -----------------------------------------------
71 By default, configure will use the "gcc" compiler if found. You can use a
72 different compiler, or add unusual options for compiling or linking that
73 the "configure" script does not know about, by either editing the user
74 configuration section of the top level Makefile (after running configure)
75 or giving "configure" initial values for these in its command line or in
76 its environment. For example:
77
78     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
79
80 Or on systems that have the "env" program, you can do it like this:
81     env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
82
83 If you want to add to, not replace, compile flags, you can use OURDEFS:
84     ./configure OURDEFS='-Wextra -Wno-sign-compare'
85
86 ----------------------------------------
87 Building mmh on additional architectures
88 ----------------------------------------
89 To build mmh on additional architectures, you can do a "make distclean".
90 This should restore the mmh source distribution back to its original
91 state. You can then configure mmh as above on other architectures in
92 which you wish to build mmh. Or alternatively, you can use a different
93 build directory for each architecture.
94
95 ---------------------------------
96 Using a different build directory
97 ---------------------------------
98 You can compile mmh in a different directory from the one containing
99 the source code. Doing so allows you to compile it on more than one
100 architecture at the same time. To do this, you must use a version of
101 "make" that supports the "VPATH" variable, such as GNU "make". Change
102 to the directory where you want the object files and executables to go
103 and run the "configure" script. "configure" automatically checks for
104 the source code in the directory that "configure" is in. For example,
105
106     cd /usr/local/solaris/mmh
107     /usr/local/src/mmh-0.1/configure
108     make
109
110 ---------------------
111 Options for configure
112 ---------------------
113 --prefix=DIR     (DEFAULT is /usr/local/mmh)
114      This will change the base prefix for the installation location
115      for the various parts of mmh. Unless overridden, mmh is installed
116      in ${prefix}/bin, ${prefix}/etc, ${prefix}/lib, ${prefix}/man.
117
118 --bindir=DIR     (DEFAULT is ${prefix}/bin)
119      mmh's binaries (show, inc, comp, ...) are installed here.
120      You need to have this directory in your PATH variable.
121
122 --libdir=DIR     (DEFAULT is ${prefix}/lib)
123      mmh's test tools (ap, dp, mhtest, ...) are installed here.
124      They are seldom useful to normal users.
125
126 --sysconfdir=DIR     (DEFAULT is ${prefix}/etc)
127      mmh's config files (mhn.defaults, ...) are installed here.
128
129 --mandir=DIR     (DEFAULT is ${prefix}/man)
130      mmh's man pages are installed here.
131
132 --enable-debug
133      Enable debugging support.
134
135 --with-locking=LOCKTYPE    (DEFAULT is dot)
136      Specify the locking mechanism when attempting to "inc"
137      a local mail spool. Valid options are "dot", "fcntl", "flock",
138      and "lockf". Of the four, dot-locking requires no special kernel
139      or filesystem support, and simply creates a file called
140      "FILE.lock" to indicate that "FILE" is locked.
141
142      In order to be effective, you should contact the site
143      administrator to find out what locking mechanisms other
144      mail delivery and user programs respect. The most common
145      reason not to use dot-locking is if the mail spool directory
146      is not world- or user-writeable, and thus a lock file cannot
147      be created.