]> git.sur5r.net Git - openldap/blob - INSTALL
Add environment examples and hints.
[openldap] / INSTALL
1 Making and Installing the OpenLDAP Distribution
2
3 ** It is recommended that you read or at least skim through ALL of the
4 ** instructions in this file before attempting to build the software.
5
6 If you want to build binaries for more than one platform from a single
7 source tree, skip ahead to the "Building LDAP For More Than One Platform"
8 section near the end of this file.
9
10 If you simply want to build LDAP for a single machine platform, follow
11 these steps:
12
13  1. untar the distribution and cd to the top:
14
15         % tar xfz openldap-VERSION.tgz
16         % cd ldap
17
18     If you are reading this file, you probably have already done this!
19
20  2. Type:
21         % ./configure --help
22
23         to list available configuration options.   A description of
24         these options is provided in the 'CONFIGURE OPTIONS' section
25         below.
26
27         The configure script uses environmental variables for
28         determining compiler/linker options.  See the HINTS
29         section for commonly used settings. 
30
31         These environment variables are used: 
32                 CC                      C Compiler      (cc, ecgs)
33                 CFLAGS          C Flags         (-ansi)
34                 CPPFLAGS        CPP Flags       (-I/path/include -Ddef)
35                 LDFLAGS         LDFLAGS         (-L/path/lib -llib)
36
37         See the 'USING ENVIRONMENT VARIABLES' section for information
38         on how to use the variables. 
39
40  3. edit the file include/ldapconfig.h.edit to configure
41     the software for your site (the files are well-commented):
42
43         % vi include/ldapconfig.h.edit
44
45  4. Configure the build system
46
47         % [env settings] ./configure [options]
48
49         If all goes well, the configure script with auto-detect the
50         appropriate settings.  Use configure enable/with options and/or
51         environment variables to obtain desired results.
52
53  5. Build dependencies
54
55         % make depend
56
57  6. Build the system
58
59         % make
60
61     If all goes well, the system will build as configured.  If not,
62         return to step 4 after reviewing the enable/with options settings.
63         
64  7. install the binaries and man pages.  You may need to be superuser to
65     do this (depending on where you are installing things):
66
67         % su
68         # make install
69
70     That's it!  See the man pages for the individual clients for information
71     on configuring and using them.  Eventually you will probably want to
72     edit the configuration files used by the various clients (installed in
73     the LDAP etc directory).  The files are:
74
75         ldapfilter.conf      - search filter configuration
76         ldapfriendly         - mapping of X.500 names to human-friendly names
77         ldapsearchprefs.conf - search object definitions
78         ldaptemplates.conf   - display template definitions
79
80     There are section 5 man pages for all of these files.
81
82
83 Building LDAP For More Than One Platform
84
85 It is now possible to build LDAP for more than one platform from the same
86 source tree.  This is accomplished by using make(1) VPATH support.  If
87 your make(1) program is old and doesn't have VPATH support, install GNU
88 Make.
89
90 Follow these steps for each different platform:
91
92  1.     Create a directory for the platform object files.
93
94         % mkdir obj-platform
95
96  2. Change your working directory to the platform object directory.
97
98         % cd obj-platform
99
100  3. Configure the build system
101
102         % [env settings] ../configure --src-dir=.. [options]
103
104                 ( replace ".." with the appropriate path )
105
106  4. Continue as above (starting at step 6).
107
108         Note: make depend in VPATH environment is not yet supported.
109
110
111 CONFIGURE OPTIONS
112
113 Regrettably, this section has not been written (yet).  See
114 "./configure --help" for current list of options.
115
116
117 USING ENVIRONMENT VARIABLES
118
119 The configure script will also use your environmental
120 variables for determining compiler/linker options.   This can
121 be used to manual specify features and compilation options.
122
123 Supported Environmental Variables
124         CC                      C Compiler              (cc, ecgs)
125         CFLAGS          C Flags                 (-ansi)
126         CPPFLAGS        CPP Flags               (-I/path/include -Ddef)
127         LDFLAGS         LDFLAGS                 (-L/path/lib -llib)
128         PATH            command path    /usr/local/bin:/usr/bin:/bin
129
130 * Including alternative compilers
131         Use the CC environment variable to tell configure to
132         use a specific compiler.  For example, to use ecgs
133         instead of the compiler configure choose, use:
134
135         [env] CC=ecgs ./configure 
136
137         You can also use CC use specific flags with the
138         specified compiler.  For example, to require strict
139         ANSI C using the GNU C Compiler, use:
140
141         [env] CC="gcc -ansi -predantic" ./configure
142
143         (you can use CFLAGS to specify compiler flags)
144
145 * Preprocessor Flags
146         You may specify additional preprocessor flags by setting
147         CPPFLAGS.  For example, if you would like to use headers
148         installed in /usr/local/include, use:
149
150         [env] CPPFLAGS="-I/usr/local/include" ./configure
151
152         You can also use CPPFLAGS to specify preprocessor macros.
153
154         [env] CPPFLAGS="-D__SPECIAL_FLAG__" ./configure
155
156 * Linker Flags
157         You may specify additional linker flags by setting LDFLAGS.
158         For example, if you would like to use libraries installed
159         in /usr/local/lib, use:
160
161         [env] LDFLAGS="-L/usr/local/lib" ./configure
162
163         You can also use CPPFLAGS to specify linker flags:
164
165         [env] LDFLAGS="-Bstatic" ./configure
166
167 * Path
168         You may alter your path to affect configure ability to
169         find (or not find) commands.  For example, to have configure
170         additionally look in /usr/css/bin for commands, use:
171
172         [env] PATH="/usr/css/bin:$PATH" ./configure
173         
174
175 HINTS
176
177 * use software under installed in /usr/local/{include,lib}
178         [env] \
179                 CPPFLAGS="-I/usr/local/include" \
180                 LDFLAGS="-L/usr/local/lib" \
181                 ./configure
182
183
184 End of OpenLDAP INSTALL file.