Cleaned up and unified some of the crypto Makefile code

This commit is contained in:
Jouni Malinen 2009-10-11 19:42:04 +03:00
parent f042122a57
commit 000bbd77c9
2 changed files with 24 additions and 22 deletions

View file

@ -353,44 +353,45 @@ ifdef TLS_FUNCS
CFLAGS += -DEAP_TLS_FUNCS CFLAGS += -DEAP_TLS_FUNCS
OBJS += ../src/eap_server/eap_tls_common.o OBJS += ../src/eap_server/eap_tls_common.o
NEED_TLS_PRF=y NEED_TLS_PRF=y
endif
ifdef TLS_FUNCS
ifeq ($(CONFIG_TLS), openssl) ifeq ($(CONFIG_TLS), openssl)
OBJS += ../src/crypto/tls_openssl.o OBJS += ../src/crypto/tls_openssl.o
LIBS += -lssl -lcrypto LIBS += -lssl -lcrypto
LIBS_p += -lcrypto
LIBS_h += -lcrypto LIBS_h += -lcrypto
endif endif
ifeq ($(CONFIG_TLS), gnutls) ifeq ($(CONFIG_TLS), gnutls)
OBJS += ../src/crypto/tls_gnutls.o OBJS += ../src/crypto/tls_gnutls.o
LIBS += -lgnutls -lgcrypt -lgpg-error LIBS += -lgnutls -lgcrypt -lgpg-error
LIBS_p += -lgcrypt
LIBS_h += -lgcrypt LIBS_h += -lgcrypt
endif
ifdef CONFIG_GNUTLS_EXTRA ifdef CONFIG_GNUTLS_EXTRA
CFLAGS += -DCONFIG_GNUTLS_EXTRA CFLAGS += -DCONFIG_GNUTLS_EXTRA
LIBS += -lgnutls-extra LIBS += -lgnutls-extra
endif endif
endif
ifeq ($(CONFIG_TLS), schannel)
OBJS += ../src/crypto/tls_schannel.o
endif
ifeq ($(CONFIG_TLS), nss)
OBJS += ../src/crypto/tls_nss.o
LIBS += -lnss3 -lssl3
LIBS_h += -lnss3
endif
ifeq ($(CONFIG_TLS), internal) ifeq ($(CONFIG_TLS), internal)
OBJS += ../src/crypto/tls_internal.o OBJS += ../src/crypto/tls_internal.o
OBJS += ../src/tls/tlsv1_common.o ../src/tls/tlsv1_record.o OBJS += ../src/tls/tlsv1_common.o ../src/tls/tlsv1_record.o
OBJS += ../src/tls/tlsv1_cred.o ../src/tls/tlsv1_server.o OBJS += ../src/tls/tlsv1_cred.o ../src/tls/tlsv1_server.o
OBJS += ../src/tls/tlsv1_server_write.o ../src/tls/tlsv1_server_read.o OBJS += ../src/tls/tlsv1_server_write.o ../src/tls/tlsv1_server_read.o
OBJS += ../src/tls/asn1.o ../src/tls/x509v3.o OBJS += ../src/tls/asn1.o ../src/tls/x509v3.o
OBJS_p += ../src/tls/asn1.o
OBJS_p += ../src/crypto/rc4.o $(AESOBJS)
NEED_BASE64=y NEED_BASE64=y
CFLAGS += -DCONFIG_TLS_INTERNAL CFLAGS += -DCONFIG_TLS_INTERNAL
CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER CFLAGS += -DCONFIG_TLS_INTERNAL_SERVER
ifeq ($(CONFIG_CRYPTO), internal) ifeq ($(CONFIG_CRYPTO), internal)
ifdef CONFIG_INTERNAL_LIBTOMMATH
CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
else
LIBS += -ltommath
LIBS_p += -ltommath
endif
endif endif
ifeq ($(CONFIG_CRYPTO), libtomcrypt) ifeq ($(CONFIG_CRYPTO), libtomcrypt)
LIBS += -ltomcrypt -ltfm LIBS += -ltomcrypt -ltfm
LIBS_p += -ltomcrypt -ltfm LIBS_h += -ltomcrypt -ltfm
endif endif
endif endif
NEED_CRYPTO=y NEED_CRYPTO=y
@ -415,37 +416,37 @@ ifdef NEED_CRYPTO
ifndef TLS_FUNCS ifndef TLS_FUNCS
ifeq ($(CONFIG_TLS), openssl) ifeq ($(CONFIG_TLS), openssl)
LIBS += -lcrypto LIBS += -lcrypto
LIBS_p += -lcrypto
LIBS_h += -lcrypto LIBS_h += -lcrypto
endif endif
ifeq ($(CONFIG_TLS), gnutls) ifeq ($(CONFIG_TLS), gnutls)
LIBS += -lgcrypt LIBS += -lgcrypt
LIBS_p += -lgcrypt
LIBS_h += -lgcrypt LIBS_h += -lgcrypt
endif endif
ifeq ($(CONFIG_TLS), schannel)
endif
ifeq ($(CONFIG_TLS), nss)
LIBS += -lnss3
LIBS_h += -lnss3
endif
ifeq ($(CONFIG_TLS), internal) ifeq ($(CONFIG_TLS), internal)
ifeq ($(CONFIG_CRYPTO), libtomcrypt) ifeq ($(CONFIG_CRYPTO), libtomcrypt)
LIBS += -ltomcrypt -ltfm LIBS += -ltomcrypt -ltfm
LIBS_p += -ltomcrypt -ltfm LIBS_h += -ltomcrypt -ltfm
endif endif
endif endif
endif endif
ifeq ($(CONFIG_TLS), openssl) ifeq ($(CONFIG_TLS), openssl)
OBJS += ../src/crypto/crypto_openssl.o OBJS += ../src/crypto/crypto_openssl.o
OBJS_p += ../src/crypto/crypto_openssl.o
HOBJS += ../src/crypto/crypto_openssl.o HOBJS += ../src/crypto/crypto_openssl.o
ifdef NEED_FIPS186_2_PRF ifdef NEED_FIPS186_2_PRF
OBJS += ../src/crypto/fips_prf_openssl.o OBJS += ../src/crypto/fips_prf_openssl.o
OBJS_p += ../src/crypto/fips_prf_openssl.o
endif endif
endif endif
ifeq ($(CONFIG_TLS), gnutls) ifeq ($(CONFIG_TLS), gnutls)
OBJS += ../src/crypto/crypto_gnutls.o OBJS += ../src/crypto/crypto_gnutls.o
OBJS_p += ../src/crypto/crypto_gnutls.o
HOBJS += ../src/crypto/crypto_gnutls.o HOBJS += ../src/crypto/crypto_gnutls.o
ifdef NEED_FIPS186_2_PRF ifdef NEED_FIPS186_2_PRF
OBJS += ../src/crypto/fips_prf_gnutls.o OBJS += ../src/crypto/fips_prf_gnutls.o
OBJS_p += ../src/crypto/fips_prf_gnutls.o
endif endif
CONFIG_INTERNAL_SHA256=y CONFIG_INTERNAL_SHA256=y
CONFIG_INTERNAL_RC4=y CONFIG_INTERNAL_RC4=y
@ -454,14 +455,12 @@ endif
ifeq ($(CONFIG_TLS), internal) ifeq ($(CONFIG_TLS), internal)
ifeq ($(CONFIG_CRYPTO), libtomcrypt) ifeq ($(CONFIG_CRYPTO), libtomcrypt)
OBJS += ../src/crypto/crypto_libtomcrypt.o OBJS += ../src/crypto/crypto_libtomcrypt.o
OBJS_p += ../src/crypto/crypto_libtomcrypt.o
CONFIG_INTERNAL_SHA256=y CONFIG_INTERNAL_SHA256=y
CONFIG_INTERNAL_RC4=y CONFIG_INTERNAL_RC4=y
CONFIG_INTERNAL_DH_GROUP5=y CONFIG_INTERNAL_DH_GROUP5=y
endif endif
ifeq ($(CONFIG_CRYPTO), internal) ifeq ($(CONFIG_CRYPTO), internal)
OBJS += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o OBJS += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o
OBJS_p += ../src/crypto/crypto_internal.o ../src/tls/rsa.o ../src/tls/bignum.o
CFLAGS += -DCONFIG_CRYPTO_INTERNAL CFLAGS += -DCONFIG_CRYPTO_INTERNAL
ifdef CONFIG_INTERNAL_LIBTOMMATH ifdef CONFIG_INTERNAL_LIBTOMMATH
CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH CFLAGS += -DCONFIG_INTERNAL_LIBTOMMATH
@ -470,7 +469,7 @@ CFLAGS += -DLTM_FAST
endif endif
else else
LIBS += -ltommath LIBS += -ltommath
LIBS_p += -ltommath LIBS_h += -ltommath
endif endif
CONFIG_INTERNAL_AES=y CONFIG_INTERNAL_AES=y
CONFIG_INTERNAL_DES=y CONFIG_INTERNAL_DES=y

View file

@ -639,6 +639,9 @@ CFLAGS += -DEAP_TLS_FUNCS
OBJS += ../src/eap_peer/eap_tls_common.o OBJS += ../src/eap_peer/eap_tls_common.o
OBJS_h += ../src/eap_server/eap_tls_common.o OBJS_h += ../src/eap_server/eap_tls_common.o
NEED_TLS_PRF=y NEED_TLS_PRF=y
endif
ifdef TLS_FUNCS
ifeq ($(CONFIG_TLS), openssl) ifeq ($(CONFIG_TLS), openssl)
CFLAGS += -DEAP_TLS_OPENSSL CFLAGS += -DEAP_TLS_OPENSSL
OBJS += ../src/crypto/tls_openssl.o OBJS += ../src/crypto/tls_openssl.o