~ubuntu-branches/ubuntu/lucid/openssl/lucid-proposed

« back to all changes in this revision

Viewing changes to Makefile

  • Committer: Bazaar Package Importer
  • Author(s): Nicolas Valcárcel Scerpella (Canonical)
  • Date: 2009-12-06 20:16:24 UTC
  • mfrom: (11.1.9 sid)
  • Revision ID: james.westby@ubuntu.com-20091206201624-u126qjpqm2n2uuhu
Tags: 0.9.8k-7ubuntu1
* Merge from debian unstable, remaining changes (LP: #493392):
  - Link using -Bsymbolic-functions
  - Add support for lpia
  - Disable SSLv2 during compile
  - Ship documentation in openssl-doc, suggested by the package.
  - Use a different priority for libssl0.9.8/restart-services
    depending on whether a desktop, or server dist-upgrade is being
    performed.
  - Display a system restart required notification bubble on libssl0.9.8
    upgrade.
  - Replace duplicate files in the doc directory with symlinks.
  - Move runtime libraries to /lib, for the benefit of wpasupplicant
* Strip the patches out of the source into quilt patches
* Disable CVE-2009-3555.patch

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
## Makefile for OpenSSL
5
5
##
6
6
 
7
 
VERSION=0.9.8g
 
7
VERSION=0.9.8k
8
8
MAJOR=0
9
9
MINOR=9.8
10
10
SHLIB_VERSION_NUMBER=0.9.8
13
13
SHLIB_MINOR=9.8
14
14
SHLIB_EXT=.so.$(SHLIB_MAJOR).$(SHLIB_MINOR)
15
15
PLATFORM=debian-amd64
16
 
OPTIONS=--prefix=/usr --openssldir=/usr/lib/ssl enable-zlib enable-tlsext no-camellia no-gmp no-idea no-krb5 no-mdc2 no-rc5 no-rfc3779 no-seed no-shared no-sslv2 no-zlib-dynamic
17
 
CONFIGURE_ARGS=--prefix=/usr --openssldir=/usr/lib/ssl no-idea no-mdc2 no-rc5 zlib enable-tlsext no-sslv2 debian-amd64
 
16
OPTIONS=--prefix=/usr --openssldir=/usr/lib/ssl enable-zlib enable-tlsext no-camellia no-capieng no-cms no-gmp no-idea no-jpake no-krb5 no-mdc2 no-montasm no-rc5 no-rfc3779 no-seed no-shared no-zlib-dynamic
 
17
CONFIGURE_ARGS=--prefix=/usr --openssldir=/usr/lib/ssl no-idea no-mdc2 no-rc5 zlib enable-tlsext debian-amd64
18
18
SHLIB_TARGET=linux-shared
19
19
 
20
20
# HERE indicates where this Makefile lives.  This can be used to indicate
60
60
# PKCS1_CHECK - pkcs1 tests.
61
61
 
62
62
CC= gcc
63
 
CFLAG= -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall -DMD32_REG_T=int -DMD5_ASM
64
 
DEPFLAG= -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_GMP -DOPENSSL_NO_IDEA -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SEED -DOPENSSL_NO_SSLV2 
 
63
CFLAG= -DZLIB -DOPENSSL_THREADS -D_REENTRANT -DDSO_DLFCN -DHAVE_DLFCN_H -m64 -DL_ENDIAN -DTERMIO -O3 -Wa,--noexecstack -g -Wall -DMD32_REG_T=int -DOPENSSL_BN_ASM_MONT -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DMD5_ASM -DAES_ASM
 
64
DEPFLAG= -DOPENSSL_NO_CAMELLIA -DOPENSSL_NO_CAPIENG -DOPENSSL_NO_CMS -DOPENSSL_NO_GMP -DOPENSSL_NO_IDEA -DOPENSSL_NO_JPAKE -DOPENSSL_NO_MDC2 -DOPENSSL_NO_RC5 -DOPENSSL_NO_RFC3779 -DOPENSSL_NO_SEED
65
65
PEX_LIBS= 
66
 
EX_LIBS= -ldl -Wl,-Bsymbolic-functions -lz
 
66
EX_LIBS= -ldl -lz
67
67
EXE_EXT= 
68
68
ARFLAGS= 
69
69
AR=ar $(ARFLAGS) r
 
70
ARD=ar $(ARFLAGS) d
70
71
RANLIB= /usr/bin/ranlib
71
72
PERL= /usr/bin/perl
72
73
TAR= tar
87
88
 
88
89
# CPUID module collects small commonly used assembler snippets
89
90
CPUID_OBJ= x86_64cpuid.o
90
 
BN_ASM= x86_64-gcc.o
 
91
BN_ASM= x86_64-gcc.o x86_64-mont.o
91
92
DES_ENC= des_enc.o fcrypt_b.o
92
 
AES_ASM_OBJ= aes_core.o aes_cbc.o
 
93
AES_ASM_OBJ= aes-x86_64.o
93
94
BF_ENC= bf_enc.o
94
95
CAST_ENC= c_enc.o
95
 
RC4_ENC= rc4_enc.o
 
96
RC4_ENC= rc4_enc.o rc4_skey.o
96
97
RC5_ENC= rc5_enc.o
97
98
MD5_ASM_OBJ= md5-x86_64.o
98
 
SHA1_ASM_OBJ= 
 
99
SHA1_ASM_OBJ= sha1-x86_64.o sha256-x86_64.o sha512-x86_64.o
99
100
RMD160_ASM_OBJ= 
100
101
 
101
102
# KRB5 stuff
106
107
ZLIB_INCLUDE=
107
108
LIBZLIB=
108
109
 
 
110
# This is the location of fipscanister.o and friends.
 
111
# The FIPS module build will place it $(INSTALLTOP)/lib
 
112
# but since $(INSTALLTOP) can only take the default value
 
113
# when the module is built it will be in /usr/local/ssl/lib
 
114
# $(INSTALLTOP) for this build make be different so hard
 
115
# code the path.
 
116
 
 
117
FIPSLIBDIR=/usr/local/ssl/fips-1.0/lib/
 
118
 
 
119
# This is set to "y" if fipscanister.o is compiled internally as
 
120
# opposed to coming from an external validated location.
 
121
 
 
122
FIPSCANISTERINTERNAL=n
 
123
 
 
124
# The location of the library which contains fipscanister.o
 
125
# normally it will be libcrypto unless fipsdso is set in which
 
126
# case it will be libfips. If not compiling in FIPS mode at all
 
127
# this is empty making it a useful test for a FIPS compile.
 
128
 
 
129
FIPSCANLIB=
 
130
 
 
131
# Shared library base address. Currently only used on Windows.
 
132
#
 
133
 
 
134
BASEADDR=0xFB00000
 
135
 
109
136
DIRS=   crypto ssl engines apps tools
110
137
SHLIBDIRS= crypto ssl
111
138
 
141
168
LIBS=   libcrypto.a libssl.a
142
169
SHARED_CRYPTO=libcrypto$(SHLIB_EXT)
143
170
SHARED_SSL=libssl$(SHLIB_EXT)
 
171
SHARED_FIPS=
144
172
SHARED_LIBS=
145
173
SHARED_LIBS_LINK_EXTS=.so
146
174
SHARED_LDFLAGS=-m64 -Wl,--version-script=openssl.ld
194
222
                SHA1_ASM_OBJ='${SHA1_ASM_OBJ}'                  \
195
223
                MD5_ASM_OBJ='${MD5_ASM_OBJ}'                    \
196
224
                RMD160_ASM_OBJ='${RMD160_ASM_OBJ}'              \
 
225
                FIPSLIBDIR='${FIPSLIBDIR}'                      \
 
226
                FIPSCANLIB="$${FIPSCANLIB:-$(FIPSCANLIB)}"      \
 
227
                FIPSCANISTERINTERNAL='${FIPSCANISTERINTERNAL}'  \
 
228
                FIPS_EX_OBJ='${FIPS_EX_OBJ}'    \
197
229
                THIS=$${THIS:-$@} MAKEFILE=Makefile MAKEOVERRIDES=
198
230
# MAKEOVERRIDES= effectively "equalizes" GNU-ish and SysV-ish make flavors,
199
231
# which in turn eliminates ambiguities in variable treatment with -e.
212
244
# subdirectories defined in $(DIRS).  It requires that the target
213
245
# is given through the shell variable `target'.
214
246
BUILD_CMD=  if [ -d "$$dir" ]; then \
215
 
            (   cd $$dir && echo "making $$target in $$dir..." && \
 
247
            (   [ $$target != all -a -z "$(FIPSCANLIB)" ] && FIPSCANLIB=/dev/null; \
 
248
                cd $$dir && echo "making $$target in $$dir..." && \
216
249
                $(CLEARENV) && $(MAKE) -e $(BUILDENV) TOP=.. DIR=$$dir $$target \
217
250
            ) || exit 1; \
218
251
            fi
225
258
reflect:
226
259
        @[ -n "$(THIS)" ] && $(CLEARENV) && $(MAKE) $(THIS) -e $(BUILDENV)
227
260
 
 
261
FIPS_EX_OBJ= ../crypto/aes/aes_cfb.o \
 
262
        ../crypto/aes/aes_ecb.o \
 
263
        ../crypto/aes/aes_ofb.o \
 
264
        ../crypto/bn/bn_add.o \
 
265
        ../crypto/bn/bn_blind.o \
 
266
        ../crypto/bn/bn_ctx.o \
 
267
        ../crypto/bn/bn_div.o \
 
268
        ../crypto/bn/bn_exp2.o \
 
269
        ../crypto/bn/bn_exp.o \
 
270
        ../crypto/bn/bn_gcd.o \
 
271
        ../crypto/bn/bn_lib.o \
 
272
        ../crypto/bn/bn_mod.o \
 
273
        ../crypto/bn/bn_mont.o \
 
274
        ../crypto/bn/bn_mul.o \
 
275
        ../crypto/bn/bn_prime.o \
 
276
        ../crypto/bn/bn_rand.o \
 
277
        ../crypto/bn/bn_recp.o \
 
278
        ../crypto/bn/bn_shift.o \
 
279
        ../crypto/bn/bn_sqr.o \
 
280
        ../crypto/bn/bn_word.o \
 
281
        ../crypto/bn/bn_x931p.o \
 
282
        ../crypto/buffer/buf_str.o \
 
283
        ../crypto/cryptlib.o \
 
284
        ../crypto/des/cfb64ede.o \
 
285
        ../crypto/des/cfb64enc.o \
 
286
        ../crypto/des/cfb_enc.o \
 
287
        ../crypto/des/ecb3_enc.o \
 
288
        ../crypto/des/ecb_enc.o \
 
289
        ../crypto/des/ofb64ede.o \
 
290
        ../crypto/des/ofb64enc.o \
 
291
        ../crypto/des/fcrypt.o \
 
292
        ../crypto/des/set_key.o \
 
293
        ../crypto/dsa/dsa_utl.o \
 
294
        ../crypto/dsa/dsa_sign.o \
 
295
        ../crypto/dsa/dsa_vrf.o \
 
296
        ../crypto/err/err.o \
 
297
        ../crypto/evp/digest.o \
 
298
        ../crypto/evp/enc_min.o \
 
299
        ../crypto/evp/e_aes.o \
 
300
        ../crypto/evp/e_des3.o \
 
301
        ../crypto/evp/p_sign.o \
 
302
        ../crypto/evp/p_verify.o \
 
303
        ../crypto/mem_clr.o \
 
304
        ../crypto/mem.o \
 
305
        ../crypto/rand/md_rand.o \
 
306
        ../crypto/rand/rand_egd.o \
 
307
        ../crypto/rand/randfile.o \
 
308
        ../crypto/rand/rand_lib.o \
 
309
        ../crypto/rand/rand_os2.o \
 
310
        ../crypto/rand/rand_unix.o \
 
311
        ../crypto/rand/rand_win.o \
 
312
        ../crypto/rsa/rsa_lib.o \
 
313
        ../crypto/rsa/rsa_none.o \
 
314
        ../crypto/rsa/rsa_oaep.o \
 
315
        ../crypto/rsa/rsa_pk1.o \
 
316
        ../crypto/rsa/rsa_pss.o \
 
317
        ../crypto/rsa/rsa_ssl.o \
 
318
        ../crypto/rsa/rsa_x931.o \
 
319
        ../crypto/sha/sha1dgst.o \
 
320
        ../crypto/sha/sha256.o \
 
321
        ../crypto/sha/sha512.o \
 
322
        ../crypto/uid.o
 
323
 
228
324
sub_all: build_all
229
325
build_all: build_libs build_apps build_tests build_tools
230
326
 
231
 
build_libs: build_crypto build_ssl build_engines
 
327
build_libs: build_crypto build_fips build_ssl build_shared build_engines
232
328
 
233
329
build_crypto:
234
 
        @dir=crypto; target=all; $(BUILD_ONE_CMD)
 
330
        if [ -n "$(FIPSCANLIB)" ]; then \
 
331
                EXCL_OBJ='$(AES_ASM_OBJ) $(BN_ASM) $(DES_ENC) $(CPUID_OBJ) $(SHA1_ASM_OBJ) $(FIPS_EX_OBJ)' ; export EXCL_OBJ ; \
 
332
                ARX='$(PERL) $${TOP}/util/arx.pl $(AR)' ; \
 
333
        else \
 
334
                ARX='${AR}' ; \
 
335
        fi ; export ARX ; \
 
336
                dir=crypto; target=all; $(BUILD_ONE_CMD)
 
337
build_fips:
 
338
        @dir=fips; target=all; [ -z "$(FIPSCANLIB)" ] || $(BUILD_ONE_CMD)
235
339
build_ssl:
236
340
        @dir=ssl; target=all; $(BUILD_ONE_CMD)
237
341
build_engines:
247
351
build_testapps:
248
352
        @dir=crypto; target=testapps; $(BUILD_ONE_CMD)
249
353
 
250
 
libcrypto$(SHLIB_EXT): libcrypto.a
 
354
build_shared:   $(SHARED_LIBS)
 
355
libcrypto$(SHLIB_EXT): libcrypto.a $(SHARED_FIPS)
251
356
        @if [ "$(SHLIB_TARGET)" != "" ]; then \
252
 
                $(MAKE) SHLIBDIRS=crypto build-shared; \
 
357
                if [ "$(FIPSCANLIB)" = "libfips" ]; then \
 
358
                        $(ARD) libcrypto.a fipscanister.o ; \
 
359
                        $(MAKE) SHLIBDIRS='crypto' SHLIBDEPS='-lfips' build-shared; \
 
360
                        $(AR) libcrypto.a fips/fipscanister.o ; \
 
361
                else \
 
362
                        if [ "$(FIPSCANLIB)" = "libcrypto" ]; then \
 
363
                                FIPSLD_CC=$(CC); CC=fips/fipsld; \
 
364
                                export CC FIPSLD_CC; \
 
365
                        fi; \
 
366
                        $(MAKE) -e SHLIBDIRS='crypto' build-shared; \
 
367
                fi \
253
368
        else \
254
369
                echo "There's no support for shared libraries on this platform" >&2; \
255
370
                exit 1; \
257
372
 
258
373
libssl$(SHLIB_EXT): libcrypto$(SHLIB_EXT) libssl.a
259
374
        @if [ "$(SHLIB_TARGET)" != "" ]; then \
260
 
                $(MAKE) SHLIBDIRS=ssl SHLIBDEPS='-lcrypto' build-shared; \
 
375
                shlibdeps=-lcrypto; \
 
376
                [ "$(FIPSCANLIB)" = "libfips" ] && shlibdeps="$$shlibdeps -lfips"; \
 
377
                $(MAKE) SHLIBDIRS=ssl SHLIBDEPS="$$shlibdeps" build-shared; \
 
378
        else \
 
379
                echo "There's no support for shared libraries on this platform" >&2 ; \
 
380
                exit 1; \
 
381
        fi
 
382
 
 
383
fips/fipscanister.o:    build_fips
 
384
libfips$(SHLIB_EXT):            fips/fipscanister.o
 
385
        @if [ "$(SHLIB_TARGET)" != "" ]; then \
 
386
                FIPSLD_CC=$(CC); CC=fips/fipsld; export CC FIPSLD_CC; \
 
387
                $(MAKE) -f Makefile.shared -e $(BUILDENV) \
 
388
                        CC=$${CC} LIBNAME=fips THIS=$@ \
 
389
                        LIBEXTRAS=fips/fipscanister.o \
 
390
                        LIBDEPS="$(EX_LIBS)" \
 
391
                        LIBVERSION=${SHLIB_MAJOR}.${SHLIB_MINOR} \
 
392
                        link_o.$(SHLIB_TARGET) || { rm -f $@; exit 1; } \
261
393
        else \
262
394
                echo "There's no support for shared libraries on this platform" >&2; \
263
395
                exit 1; \
264
396
        fi
265
397
 
 
398
libfips.a:
 
399
        dir=fips; target=all; $(BUILD_ONE_CMD)
 
400
 
266
401
clean-shared:
267
402
        @set -e; for i in $(SHLIBDIRS); do \
268
403
                if [ -n "$(SHARED_LIBS_LINK_EXTS)" ]; then \
375
510
        @$(PERL) $(TOP)/util/mkdir-p.pl include/openssl
376
511
        @$(PERL) $(TOP)/util/mklink.pl include/openssl $(EXHEADER)
377
512
        @set -e; target=links; $(RECURSIVE_BUILD_CMD)
 
513
        @if [ -z "$(FIPSCANLIB)" ]; then \
 
514
                set -e; target=links; dir=fips ; $(BUILD_CMD) ; \
 
515
        fi
378
516
 
379
517
gentests:
380
518
        @(cd test && echo "generating dummy tests (if needed)..." && \