Add new implementation m_getfld2()
[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 Mmh can be built and installed on POSIX-compliant systems, using
12 an ANSI C compiler. (Check out docs/MACHINES for shortcomings of
13 operating systems.)
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    (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 generate
31    the various 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    For less terminal output, use: make -s
42
43 3) make install
44
45    Note that if you have mmh files in the target directories with
46    the same names as the files being installed, the old ones will get
47    overwritten without any warning. The only directory this isn't
48    true for, is the `etc' directory -- in that directory, the distributed
49    files are installed with a `.dist' suffix if they differ from the
50    existing file. Watch for information messages while make is processing
51    that directory to see if you need to merge changes.
52
53 4) You may edit the file `mhn.defaults' in mmh's `etc' directory.
54
55    This file contains the default profile entries for the mmh commands
56    mhlist/mhstore/show.  The syntax of this file is described in section
57    9.4 of the book "MH & xmh: Email for Users and Programmers", 3rd edition,
58    by Jerry Peek, on the Internet at
59    <http://rand-mh.sourceforge.net/book/mh/confmhn.html>.
60    In most cases you can skip this step.
61
62 5) Add the bindir to your PATH variable.
63
64    If you haven't changed any paths, then the bindir is
65    `/usr/local/mmh/bin'. Adjust your PATH in ~/.profile, ~/.kshrc,
66    ~/.bashrc, or a similar file.
67
68    Have a look at mmhwrap(1), which allows you to access mmh tools
69    conveniently without changing the PATH variable.
70
71
72 -----------------------------------------------
73 Compiler options, or using a different compiler
74 -----------------------------------------------
75 By default, configure will use the "gcc" compiler if found. You can use a
76 different compiler, or add unusual options for compiling or linking that
77 the "configure" script does not know about, by either editing the user
78 configuration section of the top level Makefile (after running configure)
79 or giving "configure" initial values for these in its command line or in
80 its environment. For example:
81
82     ./configure CC=c89 CFLAGS=-O2 LIBS=-lposix
83
84 Or on systems that have the "env" program, you can do it like this:
85     env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure
86
87 If you want to add to, not replace, compile flags, you can use OURDEFS:
88     ./configure OURDEFS='-Wextra -Wno-sign-compare'
89
90 ---------------------------------
91 Using a different build directory
92 ---------------------------------
93 You can compile mmh in a different directory from the one containing
94 the source code. Doing so allows you to compile it on more than one
95 architecture at the same time. To do this, you must use a version of
96 "make" that supports the "VPATH" variable, such as GNU "make". Change
97 to the directory where you want the object files and executables to go
98 and run the "configure" script. "configure" automatically checks for
99 the source code in the directory that "configure" is in. For example,
100
101     cd /usr/local/src/mmh        # source directory
102     make clean
103     cd /usr/local/solaris/mmh    # build directory
104     /usr/local/src/mmh/configure
105     make
106
107 ----------------------------------------
108 Building mmh on additional architectures
109 ----------------------------------------
110 To build mmh on additional architectures, you can do a "make distclean".
111 This should restore the mmh source distribution back to its original
112 state. You can then configure mmh as above on other architectures in
113 which you wish to build mmh. Or alternatively, you can use a different
114 build directory for each architecture.
115
116 ---------------------
117 Options for configure
118 ---------------------
119 --prefix=DIR     (DEFAULT is /usr/local/mmh)
120      This will change the base prefix for the installation location
121      for the various parts of mmh. Unless overridden, mmh is installed
122      in ${prefix}/bin, ${prefix}/etc, ${prefix}/lib, ${prefix}/man.
123
124 --bindir=DIR     (DEFAULT is ${prefix}/bin)
125      mmh's binaries (show, inc, comp, ...) are installed here.
126      You need to have this directory in your PATH variable.
127
128 --libdir=DIR     (DEFAULT is ${prefix}/lib)
129      mmh's test tools (ap, dp, mhtest, ...) are installed here.
130      They are seldom useful to normal users.
131
132 --sysconfdir=DIR     (DEFAULT is ${prefix}/etc)
133      mmh's global config files (mhn.defaults, ...) are installed here.
134
135 --mandir=DIR     (DEFAULT is ${prefix}/man)
136      mmh's man pages are installed here.
137
138 --enable-debug
139      Add debugging symbols to the binaries.
140
141 --with-locking=LOCKTYPE    (DEFAULT is dot)
142      Specify the locking mechanism when attempting to "inc"
143      a local mail spool. Valid options are "dot", "fcntl", "flock",
144      and "lockf".
145
146      Of the four, dot-locking requires no special kernel
147      or filesystem support, and simply creates a file called
148      "FILE.lock" to indicate that "FILE" is locked.
149      If LOCKDIR is specified, lock files will be created in that
150      directory. Otherwise, lock files will be created in the
151      directory where the file being locked resides.
152
153      To configure nmh for kernel locking, use one of the `flock',
154      `lockf' or `fcntl' values, each using the equally named
155      system call to perform the kernel-level locking.
156
157      In order to be effective, you should contact the site
158      administrator to find out what locking mechanisms other
159      mail delivery and user programs respect. The most common
160      reason not to use dot-locking is if the mail spool directory
161      is not world- or user-writeable, and thus a lock file cannot
162      be created.
163
164 --with-lockdir=DIR
165      If you have defined "dot" locking, then the default is to
166      place the lock files in the same directory as the file that
167      is to be locked. Alternately, if you use this option, you can
168      specify that all lock files go in the specified directory.
169      Don't define this unless you know you need it.
170
171      This option is only relevant if "dot" locking is used.
172      In the other cases, it is ignored.