~ubuntu-branches/ubuntu/hardy/openswan/hardy-updates

« back to all changes in this revision

Viewing changes to linux/net/ipsec/Makefile.fs2_4

  • Committer: Bazaar Package Importer
  • Author(s): Rene Mayrhofer
  • Date: 2005-01-27 16:10:11 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050127161011-idgybmyz3vwhpfiq
Tags: 2.3.0-2
Urgency HIGH due to security issue and problems with build-deps in sarge.
* Fix the security issue. Please see
  http://www.idefense.com/application/poi/display?id=190&
      type=vulnerabilities&flashstatus=false
  for more details. Thanks to Martin Schulze for informing me about
  this issue.
  Closes: #292458: Openswan XAUTH/PAM Buffer Overflow Vulnerability
* Added a Build-Dependency to lynx.
  Closes: #291143: openswan: FTBFS: Missing build dependency.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
# Makefile for KLIPS kernel code as a module    for 2.4 kernels
 
2
#
 
3
# Makefile for KLIPS kernel code as a module
 
4
# Copyright (C) 1998, 1999, 2000,2001  Richard Guy Briggs.
 
5
# Copyright (C) 2002,2003       Michael Richardson <mcr@freeswan.org>
 
6
# Copyright (C) 2004            Michael Richardson <mcr@xelerance.com>
 
7
 
8
# This program is free software; you can redistribute it and/or modify it
 
9
# under the terms of the GNU General Public License as published by the
 
10
# Free Software Foundation; either version 2 of the License, or (at your
 
11
# option) any later version.  See <http://www.fsf.org/copyleft/gpl.txt>.
 
12
 
13
# This program is distributed in the hope that it will be useful, but
 
14
# WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
 
15
# or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
 
16
# for more details.
 
17
#
 
18
# RCSID $Id: Makefile.fs2_4,v 1.5 2004/09/14 00:03:47 mcr Exp $
 
19
#
 
20
# Note! Dependencies are done automagically by 'make dep', which also
 
21
# removes any old dependencies. DON'T put your own dependencies here
 
22
# unless it's something special (ie not a .c file).
 
23
#
 
24
 
 
25
ifeq ($(strip $(KLIPSMODULE)),)
 
26
OPENSWANSRCDIR=.
 
27
else
 
28
OPENSWANSRCDIR=../../..
 
29
endif
 
30
-include ${OPENSWANSRCDIR}/Makefile.ver
 
31
 
 
32
ifeq ($(strip $(KLIPS_TOP)),)
 
33
KLIPS_TOP=../..
 
34
endif
 
35
 
 
36
ifneq ($(strip $(KLIPSMODULE)),)
 
37
 
 
38
ifndef TOPDIR
 
39
TOPDIR:=/usr/src/linux
 
40
endif
 
41
export TOPDIR
 
42
 
 
43
endif
 
44
 
 
45
subdir-  := 
 
46
subdir-n := 
 
47
subdir-y :=
 
48
subdir-m :=
 
49
export-objs :=
 
50
exportobj-y :=
 
51
 
 
52
MOD_DESTDIR:=net/ipsec
 
53
 
 
54
export TOPDIR
 
55
 
 
56
all: ipsec.o
 
57
 
 
58
foo:
 
59
        echo KERNEL: ${KERNEL_CFLAGS}
 
60
        echo MODULE: ${MODULE_CFLAGS}
 
61
 
 
62
ipsec.o: foo
 
63
 
 
64
# always force it on
 
65
CONFIG_KLIPS_ESP:=y
 
66
CONFIG_KLIPS_IPIP:=y
 
67
 
 
68
O_TARGET := ipsec.o
 
69
obj-y := ipsec_init.o ipsec_sa.o ipsec_radij.o radij.o
 
70
obj-y += ipsec_life.o ipsec_proc.o
 
71
obj-y += ipsec_tunnel.o ipsec_xmit.o ipsec_rcv.o ipsec_ipip.o
 
72
obj-y += sysctl_net_ipsec.o 
 
73
obj-y += pfkey_v2.o pfkey_v2_parser.o pfkey_v2_ext_process.o 
 
74
obj-y += version.o
 
75
obj-$(CONFIG_KLIPS_ESP)     += ipsec_esp.o
 
76
obj-$(CONFIG_KLIPS_IPCOMP)  += ipsec_ipcomp.o
 
77
 
 
78
# AH, if you really think you need it.
 
79
obj-$(CONFIG_KLIPS_AH) += ipsec_ah.o
 
80
 
 
81
CFLAGS_ipsec_alg.o += -DEXPORT_SYMTAB 
 
82
obj-$(CONFIG_KLIPS_ALG)           += ipsec_alg.o
 
83
 
 
84
obj-$(CONFIG_KLIPS_ENC_AES)       += ipsec_alg_aes.o
 
85
obj-$(CONFIG_KLIPS_ENC_CRYPTOAPI) += ipsec_alg_cryptoapi.o
 
86
 
 
87
VPATH+=${KLIPS_TOP}/net/ipsec/des
 
88
 
 
89
obj-$(CONFIG_KLIPS_ENC_3DES) += cbc_enc.o
 
90
obj-$(CONFIG_KLIPS_ENC_3DES) += ecb_enc.o
 
91
obj-$(CONFIG_KLIPS_ENC_3DES) += set_key.o
 
92
 
 
93
 
 
94
VPATH+=${KLIPS_TOP}/net/ipsec/aes
 
95
ASM-$(ARCH_ASM):=1
 
96
ASM_X86:=$(ASM-i586)$(ASM-i686)
 
97
 
 
98
ifneq ($(strip $(ASM_X86)),)
 
99
obj-$(CONFIG_KLIPS_ENC_AES) += aes-i586.o
 
100
 
 
101
# and use assembly version of zlib code.
 
102
CFLAGS+=-DASMV
 
103
else
 
104
obj-$(CONFIG_KLIPS_ENC_AES) += aes.o
 
105
endif
 
106
 
 
107
obj-$(CONFIG_KLIPS_ENC_AES) += aes_cbc.o
 
108
obj-$(CONFIG_KLIPS_ENC_AES) += aes_xcbc_mac.o
 
109
 
 
110
ifeq ($(strip ${SUBARCH}),)
 
111
SUBARCH:=${ARCH}
 
112
endif
 
113
 
 
114
ifeq (${SUBARCH},i386)
 
115
obj-$(CONFIG_KLIPS_ENC_3DES) += dx86unix.o
 
116
else
 
117
obj-$(CONFIG_KLIPS_ENC_3DES) += des_enc.o
 
118
endif
 
119
 
 
120
obj-y += satot.o
 
121
obj-y += addrtot.o
 
122
obj-y += ultot.o 
 
123
obj-y += addrtypeof.o
 
124
obj-y += anyaddr.o
 
125
obj-y += initaddr.o
 
126
obj-y += ultoa.o 
 
127
obj-y += addrtoa.o 
 
128
obj-y += subnettoa.o 
 
129
obj-y += subnetof.o 
 
130
obj-y += goodmask.o 
 
131
obj-y += datatot.o 
 
132
obj-y += rangetoa.o 
 
133
obj-y += prng.o 
 
134
obj-y += pfkey_v2_parse.o 
 
135
obj-y += pfkey_v2_build.o 
 
136
obj-y += pfkey_v2_debug.o 
 
137
obj-y += pfkey_v2_ext_bits.o 
 
138
 
 
139
# IPcomp stuff
 
140
obj-$(CONFIG_KLIPS_IPCOMP) += ipcomp.o 
 
141
 
 
142
obj-$(CONFIG_KLIPS_IPCOMP) += adler32.o
 
143
obj-$(CONFIG_KLIPS_IPCOMP) += deflate.o
 
144
obj-$(CONFIG_KLIPS_IPCOMP) += infblock.o
 
145
obj-$(CONFIG_KLIPS_IPCOMP) += infcodes.o
 
146
obj-$(CONFIG_KLIPS_IPCOMP) += inffast.o
 
147
obj-$(CONFIG_KLIPS_IPCOMP) += inflate.o
 
148
obj-$(CONFIG_KLIPS_IPCOMP) += inftrees.o
 
149
obj-$(CONFIG_KLIPS_IPCOMP) += infutil.o
 
150
obj-$(CONFIG_KLIPS_IPCOMP) += trees.o
 
151
obj-$(CONFIG_KLIPS_IPCOMP) += zutil.o
 
152
 
 
153
asm-obj-$(CONFIG_M586)          += match586.o
 
154
asm-obj-$(CONFIG_M586TSC)       += match586.o
 
155
asm-obj-$(CONFIG_M586MMX)       += match586.o
 
156
asm-obj-$(CONFIG_M686)          += match686.o
 
157
asm-obj-$(CONFIG_MPENTIUMIII)   += match686.o
 
158
asm-obj-$(CONFIG_MPENTIUM4)     += match686.o
 
159
asm-obj-$(CONFIG_MK6)           += match586.o
 
160
asm-obj-$(CONFIG_MK7)           += match686.o
 
161
asm-obj-$(CONFIG_MCRUSOE)       += match586.o
 
162
asm-obj-$(CONFIG_MWINCHIPC6)    += match586.o
 
163
asm-obj-$(CONFIG_MWINCHIP2)     += match686.o
 
164
asm-obj-$(CONFIG_MWINCHIP3D)    += match686.o
 
165
 
 
166
obj-m += $(O_TARGET)
 
167
 
 
168
 
 
169
#ifeq ($(CONFIG_KLIPS_DEBUG),y)
 
170
#EXTRA_CFLAGS += -g
 
171
#endif
 
172
 
 
173
# MOST of these flags are in KERNEL_CFLAGS already!
 
174
 
 
175
# cannot use both -Wpointer-arith and -Werror with CONFIG_HIGHMEM
 
176
# include/linux/highmem.h has an inline function definition that uses void* arithmentic.
 
177
ifeq ($(CONFIG_NOHIGHMEM),y)
 
178
#EXTRA_CFLAGS += -Wpointer-arith 
 
179
endif
 
180
#EXTRA_CFLAGS += -Wcast-qual 
 
181
#EXTRA_CFLAGS += -Wmissing-declarations 
 
182
#EXTRA_CFLAGS += -Wstrict-prototypes
 
183
#EXTRA_CFLAGS += -pedantic
 
184
#EXTRA_CFLAGS += -O3
 
185
#EXTRA_CFLAGS += -W
 
186
#EXTRA_CFLAGS += -Wwrite-strings 
 
187
#EXTRA_CFLAGS += -Wbad-function-cast 
 
188
EXTRA_CFLAGS += -DIPCOMP_PREFIX
 
189
 
 
190
ifneq ($(strip $(KLIPSMODULE)),)
 
191
# for when we aren't building in the kernel tree
 
192
EXTRA_CFLAGS += -DARCH=${ARCH} 
 
193
EXTRA_CFLAGS += -DMODVERSIONS
 
194
EXTRA_CFLAGS += -include ${TOPDIR}/include/linux/modversions.h
 
195
EXTRA_CFLAGS += ${MODULE_CFLAGS} 
 
196
endif
 
197
 
 
198
# GCC 3.2 (and we presume any other 3.x) wants -falign-functions
 
199
# in place of the traditional -malign-functions.  Getting this
 
200
# wrong leads to a warning, which is fatal due to our use of -Werror.
 
201
ifeq ($(patsubst 3.%,3,$(shell $(CC) -dumpversion)),3)
 
202
override CFLAGS:=$(subst -malign-functions=,-falign-functions=,$(CFLAGS))
 
203
endif
 
204
 
 
205
 
 
206
obj-$(CONFIG_KLIPS_AUTH_HMAC_MD5) += ipsec_md5c.o
 
207
obj-$(CONFIG_KLIPS_AUTH_HMAC_SHA1) += ipsec_sha1.o
 
208
 
 
209
# These rules translate from new to old makefile rules
 
210
# Translate to Rules.make lists.
 
211
multi-used      := $(filter $(list-multi), $(obj-y) $(obj-m))
 
212
multi-objs      := $(foreach m, $(multi-used), $($(basename $(m))-objs))
 
213
active-objs     := $(sort $(multi-objs) $(obj-y) $(obj-m))
 
214
 
 
215
O_OBJS          := $(filter-out $(export-objs), $(obj-y))
 
216
OX_OBJS         := $(filter     $(export-objs), $(obj-y))
 
217
M_OBJS          := $(sort $(filter-out $(export-objs), $(obj-m)))
 
218
MX_OBJS         := $(sort $(filter     $(export-objs), $(obj-m)))
 
219
 
 
220
SUB_DIRS        := $(subdir-y)
 
221
ALL_SUB_DIRS    := $(subdir-y) $(subdir-m)
 
222
MOD_SUB_DIRS    := $(subdir-m)
 
223
 
 
224
include $(TOPDIR)/Rules.make
 
225
 
 
226
$(obj-y) $(obj-m):  $(TOPDIR)/include/linux/config.h $(TOPDIR)/include/linux/autoconf.h
 
227
 
 
228
USE_STANDARD_AS_RULE=true
 
229
 
 
230
tags TAGS: *.c *.h libfreeswan/*.c libfreeswan/*.h
 
231
        etags *.c ../../include/*.h ../../include/freeswan/*.h
 
232
        ctags *.c ../../include/*.h ../../include/freeswan/*.h
 
233
 
 
234
baz:
 
235
        @echo OX: ${OX_OBJS}
 
236
        @echo MIX: ${MIX_OBJS}
 
237
        @echo O: ${O_OBJS}
 
238
        @echo M: ${M_OBJS}
 
239
 
 
240
tar:
 
241
                tar -cvf /dev/f1 .
 
242
 
 
243
#
 
244
# $Log: Makefile.fs2_4,v $
 
245
# Revision 1.5  2004/09/14 00:03:47  mcr
 
246
#       use assembly code on i586/i686 for zlib.
 
247
#
 
248
# Revision 1.4  2004/07/22 02:09:12  mcr
 
249
#       do not use export-objs on ipsec_alg.c, as the rule does not
 
250
#       work with VPATH for silly reasons.
 
251
#       Instead, define -DEXPORT_SYMTAB directly.
 
252
#
 
253
# Revision 1.3  2004/07/19 01:48:54  mcr
 
254
#       adjustment of Makefile to use split OX/O_OBJS.
 
255
#
 
256
# Revision 1.2  2004/07/18 16:17:10  mcr
 
257
#       list ipsec_alg.o as both an export object and an object
 
258
#       that has to be compiled.
 
259
#
 
260
# Revision 1.1  2004/07/10 19:11:18  mcr
 
261
#       CONFIG_IPSEC -> CONFIG_KLIPS.
 
262
#
 
263
# Revision 1.3  2004/02/24 17:17:04  mcr
 
264
#       s/CONFIG_IPSEC/CONFIG_KLIPS/ as 26sec uses "CONFIG_IPSEC" to
 
265
#       turn it on/off as well.
 
266
#
 
267
# Revision 1.2  2004/02/22 06:50:42  mcr
 
268
#       kernel 2.6 port - merged with 2.4 code.
 
269
#
 
270
# Revision 1.1  2004/02/14 21:59:19  mcr
 
271
#       split up Makefile into kernel specific versions.
 
272
#
 
273
# Revision 1.68  2003/12/15 20:38:11  mcr
 
274
#       make sure that IPIP is always on.
 
275
#
 
276
# Revision 1.67  2003/12/15 15:42:27  mcr
 
277
#       make sure that ESP is always on, and AH is no more.
 
278
#
 
279
# Revision 1.66  2003/12/13 04:09:21  mcr
 
280
#       AH transform removed.
 
281
#
 
282
# Revision 1.65  2003/12/11 20:15:04  mcr
 
283
#       refactored the xmit code, to move all encapsulation
 
284
#       code into protocol functions. Note that all functions
 
285
#       are essentially done by a single function, which is probably
 
286
#       wrong.
 
287
#       the rcv_functions structures are renamed xform_functions.
 
288
#
 
289
# Revision 1.64  2003/12/06 21:21:38  mcr
 
290
#       split up receive path into per-transform files, for
 
291
#       easier later removal.
 
292
#
 
293
# Revision 1.63  2003/11/07 02:58:06  mcr
 
294
#       backout of port-selector and X.509 patches
 
295
#
 
296
# Revision 1.61  2003/06/22 21:07:46  mcr
 
297
#       adjusted TAGS target in makefile to be useful in 2.00 source layout.
 
298
#
 
299
# Revision 1.60  2003/05/03 23:45:23  mcr
 
300
#       rm .o.flags and generated version.c file.
 
301
#
 
302
# Revision 1.59  2003/02/12 19:32:47  rgb
 
303
# Added ipsec_xmit to the list of object files.
 
304
#
 
305
# Revision 1.58  2003/01/03 00:36:44  rgb
 
306
#
 
307
# Added emacs compile-command.
 
308
#
 
309
# Revision 1.57  2002/11/08 23:49:53  mcr
 
310
#       use KERNEL_CFLAGS and MODULE_CFLAGS to get proper list
 
311
#       of include directories.
 
312
#       This also eliminates some of the guesswork in the kernel
 
313
#       configuration file.
 
314
#
 
315
# Revision 1.56  2002/11/08 23:23:18  mcr
 
316
#       attempt to guess kernel compilation flags (i.e. list of -I)
 
317
#       by using some magic targets in the kernel makefile.
 
318
#
 
319
# Revision 1.55  2002/11/08 10:13:33  mcr
 
320
#       added additional include directories for module builds for 2.4.19.
 
321
#
 
322
# Revision 1.54  2002/10/20 06:10:30  build
 
323
# CONFIG_NOHIGHMEM for -Wpointer-arith RPM building issues.
 
324
#
 
325
# Revision 1.53  2002/10/17 16:32:01  mcr
 
326
#       enable standard AS rules.
 
327
#
 
328
# Revision 1.52  2002/10/06 06:13:44  sam
 
329
# Altering order of includes, so that architecture-specific header files,
 
330
# used for building RPM modules specifically, are processed first.
 
331
#
 
332
# Revision 1.51  2002/10/05 15:06:38  dhr
 
333
#
 
334
# - To allow for gcc3.2 (used in Red Hat Linux 8.0):  adjust CFLAGS (set
 
335
#   by kernel machinery) to use -falign-functions= in place of
 
336
#   -malign-functions=.  Eliminates a warning (fatal with -Werror).
 
337
#
 
338
# - When CONFIG_HIGHMEM is on, -Wpointer-arith will warn about
 
339
#   include/linux/highmem.h.  Since this is fatal with -Werror, we
 
340
#   suppress -Wpointer-arith if CONFIG_HIGHMEM is set.
 
341
#
 
342
# Revision 1.50  2002/09/16 21:19:45  mcr
 
343
#       enable -Werror for production - this helps a lot (found a bug in ipsec_rcv.c)
 
344
#
 
345
# Revision 1.49  2002/07/29 05:12:39  mcr
 
346
#       get rid of some extraneous stuff, now handled by a prefix
 
347
#       Makefile when building as a module.
 
348
#
 
349
# Revision 1.48  2002/07/28 23:13:49  mcr
 
350
#       set KLIPS_TOP and use it instead of ../..
 
351
#       if KLIPSMODULE, then include a bunch of stuff defined in Makefile.inc
 
352
#       that gets us the "typical" configuration that we want.
 
353
#
 
354
# Revision 1.47  2002/06/02 21:51:41  mcr
 
355
#       changed TOPDIR->FREESWANSRCDIR in all Makefiles.
 
356
#       (note that linux/net/ipsec/Makefile uses TOPDIR because this is the
 
357
#       kernel sense.)
 
358
#
 
359
# Revision 1.46  2002/05/14 02:35:51  rgb
 
360
# Added file pfkey_v2_ext_process.c.
 
361
#
 
362
# Revision 1.45  2002/05/13 17:21:40  mcr
 
363
#       mkdep dies when given a -I to a directory that does not exist.
 
364
#       arch/${ARCH}/include is for UM arch only, so include it for that
 
365
#       ARCH only.
 
366
#
 
367
# Revision 1.44  2002/04/24 20:38:12  mcr
 
368
#       moved more stuff behind $KLIPSMODULE=y to get static linking to work.
 
369
#
 
370
# Revision 1.43  2002/04/24 09:16:18  mcr
 
371
#       include local Makefile.ver as well as FS_rootdir version.
 
372
#
 
373
# Revision 1.42  2002/04/24 08:50:08  mcr
 
374
#       critical patch is to set TOPDIR with :=.
 
375
#
 
376
# Revision 1.40  2002/04/24 00:41:07  mcr
 
377
# Moved from ./klips/net/ipsec/Makefile,v
 
378
#
 
379
# Revision 1.39  2002/01/17 04:39:40  rgb
 
380
# Take compile options from top level Makefile.inc
 
381
#
 
382
# [..elided..]
 
383
#
 
384
# Local Variables:
 
385
# compile-command: "(cd ../../.. && source umlsetup.sh && make -C ${POOLSPACE} module/ipsec.o)"
 
386
# End Variables:
 
387
#
 
388