1
# FreeS/WAN pathnames and other master configuration
2
# Copyright (C) 2001, 2002 Henry Spencer.
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>.
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
14
# RCSID $Id: Makefile.inc,v 1.68.2.5 2004/06/17 00:55:44 ken Exp $
18
# Variables in this file with names starting with INC_ are not for use
19
# by Makefiles which include it; they are subject to change without warning.
21
# "Final" and "finally" refer to where the files will end up on the
22
# running IPsec system, as opposed to where they get installed by our
23
# Makefiles. (The two are different for cross-compiles and the like,
24
# where our Makefiles are not the end of the installation process.)
25
# Paths with FINAL in their names are the only ones that the installed
26
# software itself depends on. (Very few things should know about the
27
# FINAL paths; think twice and consult Henry before making something new
28
# depend on them.) All other paths are install targets.
29
# See also DESTDIR, below.
33
### boilerplate, do not change
36
### paths within the source tree
38
KLIPSINC=${FREESWANSRCDIR}/linux/include
39
KLIPSSRC=${FREESWANSRCDIR}/linux/net/ipsec
41
LIBFREESWANDIR=${FREESWANSRCDIR}/linux/lib/libfreeswan
42
FREESWANLIB=${FREESWANSRCDIR}/lib/libfreeswan/libfreeswan.a
44
LWRESDIR=${FREESWANSRCDIR}/lib/liblwres
45
LWRESLIB=${LWRESDIR}/liblwres.a
47
LIBDESSRCDIR=${FREESWANSRCDIR}/linux/crypto/ciphers/des
48
LIBDESLITE=${FREESWANSRCDIR}/lib/libdes/libdes.a
50
LIBPOLICYDIR=${FREESWANSRCDIR}/linux/lib/libipsecpolicy
51
POLICYLIB=${FREESWANSRCDIR}/lib/libipsecpolicy/libipsecpolicy.a
53
.PHONY: programs checkprograms clean
57
# DESTDIR can be used to supply a prefix to all install targets.
58
# (Note that "final" pathnames, signifying where files will eventually
59
# reside rather than where install puts them, are exempt from this.)
60
# The prefixing is done in this file, so as to have central control over
61
# it; DESTDIR itself should never appear in any other Makefile.
64
# "local" part of tree, used in building other pathnames
65
INC_USRLOCAL=/usr/local
67
# PUBDIR is where the "ipsec" command goes; beware, many things define PATH
68
# settings which are assumed to include it (or at least, to include *some*
69
# copy of the "ipsec" command).
70
PUBDIR=$(DESTDIR)$(INC_USRLOCAL)/sbin
72
# BINDIR is where sub-commands get put, FINALBINDIR is where the "ipsec"
73
# command will look for them when it is run. Also called LIBEXECDIR.
74
FINALLIBEXECDIR=$(INC_USRLOCAL)/libexec/ipsec
75
LIBEXECDIR=$(DESTDIR)$(FINALBINDIR)
77
FINALBINDIR=${FINALLIBEXECDIR}
81
# SBINDIR is where the user interface command goes.
82
FINALSBINDIR=$(INC_USRLOCAL)/sbin
83
SBINDIR=$(DESTDIR)$(FINALSBINDIR)
85
# libdir is where utility files go
86
FINALLIBDIR=$(INC_USRLOCAL)/lib/ipsec
87
LIBDIR=$(DESTDIR)$(FINALLIBDIR)
90
# where the appropriate manpage tree is located
91
# location within INC_USRLOCAL
94
MANTREE=$(DESTDIR)$(INC_USRLOCAL)/$(INC_MANDIR)
95
# all relevant subdirectories of MANTREE
96
MANPLACES=man3 man5 man8
98
# where configuration files go
99
FINALCONFFILE?=/etc/ipsec.conf
100
CONFFILE=$(DESTDIR)$(FINALCONFFILE)
103
CONFDIR=$(DESTDIR)$(FINALCONFDIR)
105
FINALCONFDDIR?=${FINALCONFDIR}/ipsec.d
106
CONFDDIR=$(DESTDIR)$(FINALCONFDDIR)
108
# sample configuration files go into
109
INC_DOCDIR?=share/doc
110
FINALEXAMPLECONFDIR=${INC_USRLOCAL}/${INC_DOCDIR}/freeswan
111
EXAMPLECONFDIR=${DESTDIR}${FINALEXAMPLECONFDIR}
113
FINALDOCDIR?=${INC_USRLOCAL}/${INC_DOCDIR}/freeswan
114
DOCDIR=${DESTDIR}${FINALDOCDIR}
116
# where per-conn pluto logs go
118
FINALLOGDIR?=${VARDIR}/log
119
LOGDIR?=${DESTDIR}${FINALLOGDIR}
122
# An attempt is made to automatically figure out where boot/shutdown scripts
123
# will finally go: the first directory in INC_RCDIRS which exists gets them.
124
# If none of those exists (or INC_RCDIRS is empty), INC_RCDEFAULT gets them.
125
# With a non-null DESTDIR, INC_RCDEFAULT will be used unless one of the
126
# INC_RCDIRS directories has been pre-created under DESTDIR.
127
INC_RCDIRS=/etc/rc.d/init.d /etc/rc.d /etc/init.d /sbin/init.d
128
INC_RCDEFAULT=/etc/rc.d/init.d
130
# RCDIR is where boot/shutdown scripts go; FINALRCDIR is where they think
131
# will finally be (so utils/Makefile can create a symlink in BINDIR to the
132
# place where the boot/shutdown script will finally be, rather than the
133
# place where it is installed).
134
FINALRCDIR=$(shell for d in $(INC_RCDIRS) ; \
135
do if test -d $(DESTDIR)/$$d ; \
136
then echo $$d ; exit 0 ; \
137
fi ; done ; echo $(INC_RCDEFAULT) )
138
RCDIR=$(DESTDIR)$(FINALRCDIR)
144
# Kernel location: where patches are inserted, where kernel builds are done.
146
# this is a hack using the wildcard to look for existence of a file/dir
147
ifneq ($(wildcard /usr/src/linux-2.4),)
148
KERNELSRC?=/usr/src/linux-2.4
150
KERNELSRC?=/usr/src/linux
154
# where kernel configuration outputs are located
155
KCFILE=$(KERNELSRC)/.config
156
ACFILE=$(KERNELSRC)/include/linux/autoconf.h
157
VERFILE=$(KERNELSRC)/include/linux/version.h
161
### misc installation stuff
163
# what program to use when installing things
166
# flags to the install program, for programs, manpages, and config files
167
# -b has install make backups (n.b., unlinks original), --suffix controls
168
# how backup names are composed.
169
# Note that the install procedures will never overwrite an existing config
170
# file, which is why -b is not specified for them.
171
INSTBINFLAGS=-b --suffix=.old
176
### misc configuration, included here in hopes that other files will not
177
### have to be changed for common customizations.
179
# extra compile flags, for userland and kernel stuff, e.g. -g for debug info
180
# (caution, this stuff is still being sorted out, will change in future)
184
# command used to link/copy KLIPS into kernel source tree
185
# There are good reasons why this is "ln -s"; only people like distribution
186
# builders should ever change it.
189
# extra options for use in kernel build
192
# kernel Makefile targets to be done before build
193
# Can be overridden if you are *sure* your kernel doesn't need them. (2.2.xx
194
# and later reportedly do not.)
198
# kernel make name: zImage for 2.0.xx, bzImage for 2.2.xx and later, and
199
# boot on non-x86s (what ever happened to standards?)
200
INC_B=$(shell test -d $(DIRIN22) && echo b)
201
KERNEL=$(shell if expr " `uname -m`" : ' i.86' >/dev/null ; \
202
then echo $(INC_B)zImage ; \
207
# default number of bits for ipsec newhostkey
211
# temporary directory to be used when building RPMs, and where to put the
213
RPMKERNDIR := $(shell echo `pwd`/tmp.rpmkernel)
214
RPMTMPDIR := $(shell echo `pwd`/tmp.rpmbuild)
215
RPMDEST := $(shell echo `pwd`/rpms)
217
# Newer versions of RPM do not permit building of packages with the "rpm"
218
# command. For RedHat systems with older version of RPM, use:
223
### paths to resources on the host system
225
# Set this to a RedHat kernel-sources RPM. This normally extracts into
226
# /usr/src/linux-2.4, but you might have extracted it elsewhere with
229
RH_KERNELSRC?=/usr/src/linux-2.4
231
#RH_KERNELSRC=/c2/kernel/rh/linux-2.4.9-13
234
## build environment variations
237
# set this to a place where you have installed a bind9.3
238
# snapshot (20021115 or better). A bind 9.2, particularly a RedHat
239
# installed one in RH 7.2, won't work - you wind up depending upon
242
BIND9STATICLIBDIR?=/usr/local/lib
244
# if you install elsewere, you may need to point the include files to it.
245
#BIND9STATICLIBDIR?=/sandel/lib
246
#BIND9INCDIR?=/sandel/include
248
# FreeSWAN 3.x will require bind9.
251
# whether or not to use iproute2 based commands.
255
# what kind of firewalling to use:
260
IPSEC_FIREWALLTYPE=iptables
262
# whether or not to include ipsec policy code into pluto.
263
# false for now, since it is still experimental.
264
USE_IPSECPOLICY?=false
266
# include IKEPING in the distribution
269
# include support for KEY RR
270
# this will become false in late 2003.
273
# include support for KERNEL 2.5/2.6 IPsec in pluto
276
# do we have pthreads available? Ususally yes, but on some embedded
280
# include XAUTH authentication system.
281
# off by default, since XAUTH is tricky, and you can get into security trouble
284
# when doing XAUTH, include PAM support as well, requires threads.
287
# whether to support NAT traversal (in pluto!)
288
USE_NAT_TRAVERSAL?=true
290
# where to support NAT-T in transport mode (needed for Win2K NAT-T Interop)
291
USE_NAT_TRAVERSAL_TRANSPORT_MODE?=true
293
# should opportunistic encryption be turned on by default?
296
# warning: examples subdirectory is statically defined here
297
OE_FLAG=\#Disable Opportunistic Encryption\\ninclude ${FINALCONFDDIR}/examples/no_oe.conf
301
# set this to space where a linked/configured tree can be created by
302
# preprhkern4module. Only needed if you are going to be created RPMs
303
# outside of a distribution (as the FS team does for RedHat).
304
#RH_KERNELSRC_POOL=/c2/freeswan/rh_kern
306
# the following is a list of symbols which will be used to construct
307
# the module goo to identify which module goes with each kernel.
308
MODULE_GOO_LIST=irq_stat netif_rx register_sysctl_table send_sig
309
MODULE_GOO_LIST+=kmalloc __kfree_skb __ip_select_ident alloc_skb
310
MODULE_GOO_LIST+=icmp_send ip_fragment sock_register
312
MODULE_DEF_INCLUDE=${FREESWANSRCDIR}/packaging/linus/config-all.h
313
MODULE_DEFCONFIG?=${KLIPSSRC}/defconfig
315
MODULE_FLAGS:=KLIPSMODULE=true TOPDIR=${KERNELSRC} -f ${MODULE_DEFCONFIG}
317
# supply kernel-configuration ARCH defaults
319
ARCH := $(shell uname -m)
321
# always sanitize $(ARCH)
322
ARCH := $(shell echo $(ARCH) | sed -e s/i.86/i386/ -e s/sun4u/sparc64/ -e s/arm.*/arm/ -e s/sa110/arm/)
324
# export everything so that scripts can use them.
325
export LIBFREESWANDIR FREESWANSRCDIR FREESWANLIB
327
-include ${FREESWANSRCDIR}/Makefile.ver
331
# Local Variables: ;;;