]> git.ipfire.org Git - thirdparty/strongswan.git/blob - Makefile.inc
- import of strongswan-2.7.0
[thirdparty/strongswan.git] / Makefile.inc
1 # FreeS/WAN pathnames and other master configuration
2 # Copyright (C) 2001, 2002 Henry Spencer.
3 #
4 # This program is free software; you can redistribute it and/or modify it
5 # under the terms of the GNU General Public License as published by the
6 # Free Software Foundation; either version 2 of the License, or (at your
7 # option) any later version. See <http://www.fsf.org/copyleft/gpl.txt>.
8 #
9 # This program is distributed in the hope that it will be useful, but
10 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 # for more details.
13 #
14 # RCSID $Id: Makefile.inc,v 1.12 2006/01/25 17:23:15 as Exp $
15
16
17 # Variables in this file with names starting with INC_ are not for use
18 # by Makefiles which include it; they are subject to change without warning.
19 #
20 # "Final" and "finally" refer to where the files will end up on the
21 # running IPsec system, as opposed to where they get installed by our
22 # Makefiles. (The two are different for cross-compiles and the like,
23 # where our Makefiles are not the end of the installation process.)
24 # Paths with FINAL in their names are the only ones that the installed
25 # software itself depends on. (Very few things should know about the
26 # FINAL paths; think twice and consult Henry before making something new
27 # depend on them.) All other paths are install targets.
28 # See also DESTDIR, below.
29
30
31 ### boilerplate, do not change
32 SHELL=/bin/sh
33
34 ### paths within the source tree
35
36 KLIPSINC=${FREESWANSRCDIR}/linux/include
37 KLIPSSRC=${FREESWANSRCDIR}/linux/net/ipsec
38
39 LIBFREESWANDIR=${FREESWANSRCDIR}/linux/lib/libfreeswan
40 FREESWANLIB=${FREESWANSRCDIR}/lib/libfreeswan/libfreeswan.a
41
42 LWRESDIR=${FREESWANSRCDIR}/lib/liblwres
43 LWRESLIB=${LWRESDIR}/liblwres.a
44
45 LIBDESSRCDIR=${FREESWANSRCDIR}/linux/crypto/ciphers/des
46 LIBDESLITE=${FREESWANSRCDIR}/lib/libdes/libdes.a
47
48 LIBPOLICYDIR=${FREESWANSRCDIR}/linux/lib/libipsecpolicy
49 POLICYLIB=${FREESWANSRCDIR}/lib/libipsecpolicy/libipsecpolicy.a
50
51 .PHONY: programs checkprograms clean
52
53 ### install pathnames
54
55 # DESTDIR can be used to supply a prefix to all install targets.
56 # (Note that "final" pathnames, signifying where files will eventually
57 # reside rather than where install puts them, are exempt from this.)
58 # The prefixing is done in this file, so as to have central control over
59 # it; DESTDIR itself should never appear in any other Makefile.
60 DESTDIR?=
61
62 # "local" part of tree, used in building other pathnames
63 INC_USRLOCAL=/usr/local
64
65 # PUBDIR is where the "ipsec" command goes; beware, many things define PATH
66 # settings which are assumed to include it (or at least, to include *some*
67 # copy of the "ipsec" command).
68 PUBDIR=$(DESTDIR)$(INC_USRLOCAL)/sbin
69
70 # BINDIR is where sub-commands get put, FINALBINDIR is where the "ipsec"
71 # command will look for them when it is run. Also called LIBEXECDIR.
72 FINALLIBEXECDIR=$(INC_USRLOCAL)/libexec/ipsec
73 LIBEXECDIR=$(DESTDIR)$(FINALBINDIR)
74
75 FINALBINDIR=${FINALLIBEXECDIR}
76 BINDIR=${LIBEXECDIR}
77
78
79 # SBINDIR is where the user interface command goes.
80 FINALSBINDIR=$(INC_USRLOCAL)/sbin
81 SBINDIR=$(DESTDIR)$(FINALSBINDIR)
82
83 # libdir is where utility files go
84 FINALLIBDIR=$(INC_USRLOCAL)/lib/ipsec
85 LIBDIR=$(DESTDIR)$(FINALLIBDIR)
86
87
88 # where the appropriate manpage tree is located
89 # location within INC_USRLOCAL
90 INC_MANDIR=man
91 # the full pathname
92 MANTREE=$(DESTDIR)$(INC_USRLOCAL)/$(INC_MANDIR)
93 # all relevant subdirectories of MANTREE
94 MANPLACES=man3 man5 man8
95
96 # where configuration files go
97 FINALCONFFILE?=/etc/ipsec.conf
98 CONFFILE=$(DESTDIR)$(FINALCONFFILE)
99
100 FINALCONFDIR?=/etc
101 CONFDIR=$(DESTDIR)$(FINALCONFDIR)
102
103 FINALCONFDDIR?=${FINALCONFDIR}/ipsec.d
104 CONFDDIR=$(DESTDIR)$(FINALCONFDDIR)
105
106 # sample configuration files go into
107 INC_DOCDIR?=share/doc
108 FINALEXAMPLECONFDIR=${INC_USRLOCAL}/${INC_DOCDIR}/strongswan
109 EXAMPLECONFDIR=${DESTDIR}${FINALEXAMPLECONFDIR}
110
111 FINALDOCDIR?=${INC_USRLOCAL}/${INC_DOCDIR}/strongswan
112 DOCDIR=${DESTDIR}${FINALDOCDIR}
113
114 # where per-conn pluto logs go
115 VARDIR?=/var
116 LOGDIR?=${VARDIR}/log
117 FINALLOGDIR?=${DESTDIR}${LOGDIR}
118
119
120 # An attempt is made to automatically figure out where boot/shutdown scripts
121 # will finally go: the first directory in INC_RCDIRS which exists gets them.
122 # If none of those exists (or INC_RCDIRS is empty), INC_RCDEFAULT gets them.
123 # With a non-null DESTDIR, INC_RCDEFAULT will be used unless one of the
124 # INC_RCDIRS directories has been pre-created under DESTDIR.
125 INC_RCDIRS=/etc/rc.d/init.d /etc/rc.d /etc/init.d /sbin/init.d
126 INC_RCDEFAULT=/etc/rc.d/init.d
127
128 # RCDIR is where boot/shutdown scripts go; FINALRCDIR is where they think
129 # will finally be (so utils/Makefile can create a symlink in BINDIR to the
130 # place where the boot/shutdown script will finally be, rather than the
131 # place where it is installed).
132 FINALRCDIR=$(shell for d in $(INC_RCDIRS) ; \
133 do if test -d $(DESTDIR)/$$d ; \
134 then echo $$d ; exit 0 ; \
135 fi ; done ; echo $(INC_RCDEFAULT) )
136 RCDIR=$(DESTDIR)$(FINALRCDIR)
137
138
139
140 ### kernel pathnames
141
142 # Kernel location: where patches are inserted, where kernel builds are done.
143
144 # this is a hack using the wildcard to look for existence of a file/dir
145 ifneq ($(wildcard /usr/src/linux-2.4),)
146 KERNELSRC?=/usr/src/linux-2.4
147 else
148 KERNELSRC?=/usr/src/linux
149 endif
150
151
152 # where kernel configuration outputs are located
153 KCFILE=$(KERNELSRC)/.config
154 ACFILE=$(KERNELSRC)/include/linux/autoconf.h
155 VERFILE=$(KERNELSRC)/include/linux/version.h
156
157
158
159 ### misc installation stuff
160
161 # what program to use when installing things
162 INSTALL=install
163
164 # flags to the install program, for programs, manpages, and config files
165 # -b has install make backups (n.b., unlinks original), --suffix controls
166 # how backup names are composed.
167 # Note that the install procedures will never overwrite an existing config
168 # file, which is why -b is not specified for them.
169 INSTBINFLAGS=-b --suffix=.old
170 INSTMANFLAGS=
171 INSTCONFFLAGS=
172
173
174 ### misc configuration, included here in hopes that other files will not
175 ### have to be changed for common customizations.
176
177 # extra compile flags, for userland and kernel stuff, e.g. -g for debug info
178 # (caution, this stuff is still being sorted out, will change in future)
179 USERCOMPILE?=-g -O3
180 KLIPSCOMPILE=-O3
181
182 # command used to link/copy KLIPS into kernel source tree
183 # There are good reasons why this is "ln -s"; only people like distribution
184 # builders should ever change it.
185 KLIPSLINK=ln -s -f
186
187 # extra options for use in kernel build
188 KERNMAKEOPTS=
189
190 # kernel Makefile targets to be done before build
191 # Can be overridden if you are *sure* your kernel doesn't need them. (2.2.xx
192 # and later reportedly do not.)
193 KERNDEP=dep
194 KERNCLEAN=clean
195
196 # kernel make name: zImage for 2.0.xx, bzImage for 2.2.xx and later, and
197 # boot on non-x86s (what ever happened to standards?)
198 INC_B=$(shell test -d $(DIRIN22) && echo b)
199 KERNEL=$(shell if expr " `uname -m`" : ' i.86' >/dev/null ; \
200 then echo $(INC_B)zImage ; \
201 else echo boot ; \
202 fi)
203
204 # temporary directory to be used when building RPMs, and where to put the
205 # resulting RPM tree
206 RPMKERNDIR := $(shell echo `pwd`/tmp.rpmkernel)
207 RPMTMPDIR := $(shell echo `pwd`/tmp.rpmbuild)
208 RPMDEST := $(shell echo `pwd`/rpms)
209
210 # Newer versions of RPM do not permit building of packages with the "rpm"
211 # command. For RedHat systems with older version of RPM, use:
212 # RPMBUILD=rpm
213 # instead.
214 RPMBUILD=rpmbuild
215
216 ### paths to resources on the host system
217 #
218 # Set this to a RedHat kernel-sources RPM. This normally extracts into
219 # /usr/src/linux-2.4, but you might have extracted it elsewhere with
220 # rpm2cpio.
221 #
222 RH_KERNELSRC?=/usr/src/linux-2.4
223
224 ## build environment variations
225 ##
226
227 # set this to a place where you have installed a bind9.3
228 # snapshot (20021115 or better). A bind 9.2, particularly a RedHat
229 # installed one in RH 7.2, won't work - you wind up depending upon
230 # openssl.
231
232 BIND9STATICLIBDIR?=/usr/local/lib
233
234 # FreeSWAN 3.x will require bind9.
235 USE_LWRES?=false
236
237 # whether or not to use iproute2 based commands.
238 #
239 USE_IPROUTE2?=true
240
241 # what kind of firewalling to use:
242 # 2.0 - ipfwadm
243 # 2.2 - ipchains
244 # 2.4 - iptables
245 IPSEC_FIREWALLTYPE=iptables
246
247 # whether or not to include ipsec policy code into pluto.
248 # false for now, since it is still experimental.
249 USE_IPSECPOLICY?=false
250
251 # include IKEPING in the distribution
252 USE_IKEPING?=false
253
254 # include support for KEY RR
255 # this will become false in late 2003.
256 USE_KEYRR?=true
257
258 # include support for KERNEL 2.5/2.6 IPsec in pluto
259 USE_KERNEL26?=true
260
261 # whether or not pluto sends its strongSwan Vendor ID
262 USE_VENDORID?=true
263
264 # whether or not pluto sends an XAUTH VID (Cisco Mode Config Interoperability)
265 USE_XAUTH_VID?=false
266
267 # whether to support NAT Traversal (aka NAT-T)
268 USE_NAT_TRAVERSAL?=true
269
270 # whether to support NAT-T in transport mode (needed for Win2K NAT-T Interop)
271 USE_NAT_TRAVERSAL_TRANSPORT_MODE?=false
272
273 # include libcurl support (currently used for fetching CRLs, OCSP and SCEP)
274 USE_LIBCURL?=false
275
276 # include LDAP support (currently used for fetching CRLs)
277 USE_LDAP?=false
278
279 # uncomment this line if using the LDAPv3 protocol
280 LDAP_VERSION=3
281 # uncomment this line if using the LDAPv2 protocol
282 #LDAP_VERSION=2
283
284 # include PKCS11-based smartcard support
285 USE_SMARTCARD?=false
286
287 # Default PKCS11 library
288 # Uncomment this line if using OpenSC <= 0.9.6
289 PKCS11_DEFAULT_LIB=\"/usr/lib/pkcs11/opensc-pkcs11.so\"
290 # Uncomment this line if using OpenSC >= 0.10.0
291 #PKCS11_DEFAULT_LIB=\"/usr/lib/opensc-pkcs11.so\"
292 # Uncomment and complete this line if using another default library
293 #PKCS11_DEFAULT_LIB=\"/usr/lib/...\"
294
295 # Enable the leak detective to find memory leaks
296 USE_LEAK_DETECTIVE?=false
297
298 # set this to space where a linked/configured tree can be created by
299 # preprhkern4module. Only needed if you are going to be created RPMs
300 # outside of a distribution (as the FS team does for RedHat).
301 #RH_KERNELSRC_POOL=/c2/freeswan/rh_kern
302
303 # the following is a list of symbols which will be used to construct
304 # the module goo to identify which module goes with each kernel.
305 MODULE_GOO_LIST=irq_stat netif_rx register_sysctl_table send_sig
306 MODULE_GOO_LIST+=kmalloc __kfree_skb __ip_select_ident alloc_skb
307 MODULE_GOO_LIST+=icmp_send ip_fragment sock_register
308
309 MODULE_DEF_INCLUDE=${FREESWANSRCDIR}/packaging/linus/config-all.h
310 MODULE_DEFCONFIG?=${KLIPSSRC}/defconfig
311
312 MODULE_FLAGS:=KLIPSMODULE=true TOPDIR=${KERNELSRC} -f ${MODULE_DEFCONFIG} -f Makefile
313
314 # supply kernel-configuration ARCH defaults
315 ifeq ($(ARCH),)
316 ARCH := $(shell uname -m)
317 endif
318 # always sanitize $(ARCH)
319 ARCH := $(shell echo $(ARCH) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
320
321 # export everything so that scripts can use them.
322 export LIBFREESWANDIR FREESWANSRCDIR FREESWANLIB
323
324 -include ${FREESWANSRCDIR}/Makefile.ver
325
326 # for emacs
327 #
328 # Local Variables: ;;;
329 # mode: makefile ;;;
330 # End Variables: ;;;
331 #