OpenSSL: Fix includes insanity.
authorPeter Avalos <pavalos@dragonflybsd.org>
Sat, 25 Sep 2010 11:21:43 +0000 (01:21 -1000)
committerPeter Avalos <pavalos@dragonflybsd.org>
Sat, 25 Sep 2010 12:08:04 +0000 (02:08 -1000)
Use INCS instead of the hard-to-understand and rustic stuff that was
there.

secure/lib/libcrypto/Makefile
secure/lib/libcrypto/Makefile.inc
secure/lib/libssl/Makefile
secure/usr.bin/openssl/Makefile

index be04120..eb70965 100644 (file)
@@ -13,13 +13,16 @@ NOLINT=             true
 .include "Makefile.inc"
 
 # base sources
-SRCS+= cpt_err.c cryptlib.c cversion.c dyn_lck.c ebcdic.c ex_data.c \
+SRCS cpt_err.c cryptlib.c cversion.c dyn_lck.c ebcdic.c ex_data.c \
        fips_err.c mem.c mem_clr.c \
        mem_dbg.c o_dir.c o_init.c o_time.c tmdiff.c uid.c
+INCS=  ../e_os.h ../e_os2.h crypto.h ebcdic.h fips_err.h \
+       opensslv.h ossl_typ.h symhacks.h tmdiff.h
 
 # aes
 SRCS+= aes_cbc.c aes_cfb.c aes_core.c aes_ctr.c aes_ecb.c aes_ige.c \
        aes_misc.c aes_ofb.c aes_wrap.c
+INCS+= aes.h aes_locl.h
 
 # asn1
 SRCS+= a_bitstr.c a_bool.c a_bytes.c a_d2i_fp.c a_digest.c \
@@ -36,15 +39,18 @@ SRCS+=      a_bitstr.c a_bool.c a_bytes.c a_d2i_fp.c a_digest.c \
        tasn_utl.c x_algor.c x_attrib.c x_bignum.c x_crl.c \
        x_exten.c x_info.c x_long.c x_name.c x_pkey.c x_pubkey.c \
        x_req.c x_sig.c x_spki.c x_val.c x_x509.c x_x509a.c
+INCS+= asn1.h asn1_mac.h asn1t.h
 
 # bf
 SRCS+= bf_cfb64.c bf_ecb.c bf_enc.c bf_ofb64.c bf_skey.c
+INCS+= blowfish.h
 
 # bio
 SRCS+= b_dump.c b_print.c b_sock.c bf_buff.c bf_lbuf.c bf_nbio.c \
        bf_null.c bio_cb.c bio_err.c bio_lib.c bss_acpt.c bss_bio.c \
        bss_conn.c bss_dgram.c bss_fd.c bss_file.c bss_log.c bss_mem.c \
        bss_null.c bss_sock.c
+INCS+= bio.h
 
 # bn
 SRCS+= bn_add.c bn_asm.c bn_blind.c bn_const.c bn_ctx.c bn_depr.c \
@@ -53,17 +59,21 @@ SRCS+=      bn_add.c bn_asm.c bn_blind.c bn_const.c bn_ctx.c bn_depr.c \
        bn_mpi.c bn_mul.c bn_nist.c bn_opt.c \
        bn_prime.c bn_print.c bn_rand.c bn_recp.c \
        bn_shift.c bn_sqr.c bn_sqrt.c bn_word.c bn_x931p.c
+INCS+= bn.h
 
 # buffer
 SRCS+= buf_err.c buf_str.c buffer.c
+INCS+= buffer.h
 
 # camellia
 # still disabled in 0.9.8
 #SRCS+=        camellia.c cmll_misc.c cmll_ecb.c cmll_cbc.c cmll_ofb.c \
 #      cmll_cfb.c cmll_ctr.c 
+INCS+= camellia.h
 
 # cast
 SRCS+= c_cfb64.c c_ecb.c c_enc.c c_ofb64.c c_skey.c
+INCS+= cast.h
 
 # cms
 #SRCS+=        cms_att.c cms_att.c cms_cd.c cms_dd.c cms_enc.c cms_env.c cms_err.c \
@@ -71,9 +81,11 @@ SRCS+=       c_cfb64.c c_ecb.c c_enc.c c_ofb64.c c_skey.c
 
 # comp
 SRCS+= c_rle.c c_zlib.c comp_err.c comp_lib.c
+INCS+= comp.h
 
 # conf
 SRCS+= conf_api.c conf_def.c conf_err.c conf_lib.c conf_mall.c conf_mod.c conf_sap.c
+INCS+= conf.h conf_api.h
 
 # des
 SRCS+= cbc3_enc.c cbc_cksm.c cbc_enc.c cfb64ede.c cfb64enc.c cfb_enc.c \
@@ -82,33 +94,41 @@ SRCS+=      cbc3_enc.c cbc_cksm.c cbc_enc.c cfb64ede.c cfb64enc.c cfb_enc.c \
        enc_read.c enc_writ.c fcrypt.c fcrypt_b.c ofb64ede.c ofb64enc.c \
        ofb_enc.c pcbc_enc.c qud_cksm.c rand_key.c read2pwd.c \
        rpc_enc.c set_key.c str2key.c xcbc_enc.c
+INCS+= des.h des_old.h
 
 # dh
 SRCS+= dh_asn1.c dh_check.c dh_depr.c dh_err.c dh_gen.c dh_key.c dh_lib.c
+INCS+= dh.h
 
 # dsa
 SRCS+= dsa_asn1.c dsa_depr.c dsa_err.c dsa_gen.c dsa_key.c dsa_lib.c \
        dsa_ossl.c dsa_sign.c dsa_utl.c dsa_vrf.c
+INCS+= dsa.h
 
 # dso
 SRCS+= dso_dl.c dso_dlfcn.c dso_err.c dso_lib.c dso_null.c dso_openssl.c
+INCS+= dso.h
 
 # ec
 SRCS+= ec_asn1.c ec_check.c ec_curve.c ec_cvt.c ec_err.c ec_key.c ec_lib.c \
        ec_mult.c ec_print.c ec2_smpl.c ec2_mult.c ecp_mont.c ecp_nist.c \
        ecp_smpl.c
+INCS+= ec.h
 
 # ecdh
 SRCS+= ech_err.c ech_key.c ech_lib.c ech_ossl.c
+INCS+= ecdh.h
 
 # ecdsa
 SRCS+= ecs_asn1.c ecs_err.c ecs_lib.c ecs_ossl.c ecs_sign.c ecs_vrf.c
+INCS+= ecdsa.h
 
 # engine
 SRCS+= eng_all.c eng_cnf.c eng_cryptodev.c eng_ctrl.c eng_dyn.c eng_err.c \
        eng_fat.c eng_init.c eng_lib.c eng_list.c eng_openssl.c eng_padlock.c \
        eng_pkey.c eng_table.c tb_cipher.c tb_dh.c tb_ecdh.c tb_ecdsa.c \
        tb_digest.c tb_dsa.c tb_rand.c tb_rsa.c tb_store.c
+INCS+= eng_int.h engine.h
 
 # engines
 CFLAGS+=-DOPENSSL_NO_DYNAMIC_ENGINE    # needs more hacking
@@ -117,6 +137,7 @@ SRCS+=      e_4758cca.c e_aep.c e_atalla.c e_chil.c e_cswift.c e_gmp.c \
 
 # err
 SRCS+= err.c err_all.c err_bio.c err_def.c err_prn.c err_str.c
+INCS+= err.h
 
 # evp
 SRCS+= bio_b64.c bio_enc.c bio_md.c bio_ok.c c_all.c c_allc.c c_alld.c \
@@ -129,95 +150,121 @@ SRCS+=   bio_b64.c bio_enc.c bio_md.c bio_ok.c c_all.c c_allc.c c_alld.c \
        m_mdc2.c m_null.c m_ripemd.c m_sha.c m_sha1.c names.c openbsd_hw.c \
        p5_crpt.c p5_crpt2.c p_dec.c p_enc.c p_lib.c p_open.c p_seal.c \
        p_sign.c p_verify.c
+INCS+= evp.h
 
 # hmac
 SRCS+= hmac.c
+INCS+= hmac.h
 
 # idea
 .if defined(WANT_IDEA)
 SRCS+= i_cbc.c i_cfb64.c i_ecb.c i_ofb64.c i_skey.c
+INCS+= idea.h
 .endif
 
 # krb5
 #SRCS+=        krb5_asn.c
+#INCS+=        krb5_asn.h
 
 # lhash
 SRCS+= lh_stats.c lhash.c
+INCS+= lhash.h
 
 # md2
 SRCS+= md2_dgst.c md2_one.c
+INCS+= md2.h
 
 # md4
 SRCS+= md4_dgst.c md4_one.c
+INCS+= md4.h
 
 # md5
 SRCS+= md5_dgst.c md5_one.c
+INCS+= md5.h
 
 # mdc2
 # ... is patented, so don't compile by default.
 #SRCS+=        mdc2_one.c mdc2dgst.c
+INCS+= mdc2.h
 
 # objects
 SRCS+= o_names.c obj_dat.c obj_err.c obj_lib.c
+INCS+= objects.h obj_mac.h
 
 # ocsp
 SRCS+= ocsp_asn.c ocsp_cl.c ocsp_err.c ocsp_ext.c ocsp_ht.c \
        ocsp_lib.c ocsp_prn.c ocsp_srv.c ocsp_vfy.c
+INCS+= ocsp.h
 
 # pem
 SRCS+= pem_all.c pem_err.c pem_info.c pem_lib.c pem_oth.c pem_pk8.c \
        pem_pkey.c pem_seal.c pem_sign.c pem_x509.c pem_xaux.c
+INCS+= pem.h pem2.h
 
 # pkcs12
 SRCS+= p12_add.c p12_asn.c p12_attr.c p12_crpt.c p12_crt.c \
        p12_decr.c p12_init.c p12_key.c p12_kiss.c p12_mutl.c \
        p12_npas.c p12_p8d.c p12_p8e.c p12_utl.c pk12err.c
+INCS+= pkcs12.h
 
 # pkcs7
 SRCS+= example.c pk7_asn1.c pk7_attr.c pk7_dgst.c pk7_doit.c \
        pk7_lib.c pk7_mime.c pk7_smime.c pkcs7err.c
+INCS+= pkcs7.h
 
 # pqueue
 SRCS+= pqueue.c
+INCS+= pqueue.h pq_compat.h
 
 # rand
 SRCS+= md_rand.c rand_egd.c rand_eng.c \
        rand_err.c rand_lib.c rand_nw.c rand_unix.c \
        randfile.c
+INCS+= rand.h
 
 # rc2
 SRCS+= rc2_cbc.c rc2_ecb.c rc2_skey.c rc2cfb64.c rc2ofb64.c
+INCS+= rc2.h
 
 # rc4
 SRCS+= rc4_enc.c rc4_fblk.c rc4_skey.c
+INCS+= rc4.h
 
 # rc5
 # .. is patented, so don't compile by default
 #SRCS+=        rc5_ecb.c rc5_enc.c rc5_skey.c rc5cfb64.c rc5ofb64.c
+INCS+= rc5.h
 
 # ripemd
 SRCS+= rmd_dgst.c rmd_one.c
+INCS+= ripemd.h
 
 # rsa
 SRCS+= rsa_asn1.c rsa_chk.c rsa_depr.c rsa_eay.c \
        rsa_eng.c rsa_err.c rsa_gen.c \
        rsa_lib.c rsa_none.c rsa_null.c rsa_oaep.c rsa_pk1.c rsa_pss.c \
        rsa_saos.c rsa_sign.c rsa_ssl.c rsa_x931.c rsa_x931g.c
+INCS+= rsa.h
 
 # sha
 SRCS+= sha1_one.c sha1dgst.c sha256.c sha512.c sha_dgst.c sha_one.c
+INCS+= sha.h
 
 # stack
 SRCS+= stack.c
+INCS+= stack.h safestack.h
 
 # store
 SRCS+= str_err.c str_lib.c str_meth.c str_mem.c
+INCS+= store.h
 
 # txt_db
 SRCS+= txt_db.c
+INCS+= txt_db.h
 
 # ui
 SRCS+= ui_compat.c ui_err.c ui_lib.c ui_openssl.c ui_util.c
+INCS+= ui.h ui_compat.h ui_locl.h
 
 # x509
 SRCS+= by_dir.c by_file.c x509_att.c x509_cmp.c x509_d2.c \
@@ -225,6 +272,7 @@ SRCS+=      by_dir.c by_file.c x509_att.c x509_cmp.c x509_d2.c \
        x509_r2x.c x509_req.c x509_set.c x509_trs.c x509_txt.c \
        x509_v3.c x509_vfy.c x509_vpm.c x509cset.c x509name.c x509rset.c \
        x509spki.c x509type.c x_all.c
+INCS+= x509.h x509_vfy.h
 
 # x509v3
 SRCS+= pcy_cache.c pcy_data.c pcy_lib.c pcy_map.c pcy_node.c pcy_tree.c \
@@ -233,10 +281,29 @@ SRCS+=    pcy_cache.c pcy_data.c pcy_lib.c pcy_map.c pcy_node.c pcy_tree.c \
        v3_genn.c v3_ia5.c v3_info.c v3_int.c v3_lib.c v3_ncons.c v3_ocsp.c \
        v3_pci.c v3_pcia.c v3_pcons.c v3_pmaps.c v3_pku.c v3_prn.c v3_purp.c \
        v3_skey.c v3_sxnet.c v3_utl.c v3err.c
+INCS+= x509v3.h
 
-INCS=          ${CRYTPO_HDRS} openssl/evp.h openssl/opensslconf.h
+SRCS+= buildinf.h
+INCS+= opensslconf.h
 INCSDIR=       ${INCLUDEDIR}/openssl
 
+CLEANFILES+=   buildinf.h opensslconf.h
+
+buildinf.h:
+       ( echo "#ifndef MK1MF_BUILD"; \
+       echo "  /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
+       echo "  #define CFLAGS \"$(CC)\""; \
+       echo "  #define PLATFORM \"`uname -s`-`uname -m`\""; \
+       echo "  #define DATE \"`LC_ALL=C date`\""; \
+       echo "#endif" ) > ${.TARGET}
+
+opensslconf.h: opensslconf-${MACHINE_ARCH}.h
+.if defined(WANT_IDEA)
+       sed '/^# define OPENSSL_NO_IDEA$$/d;/^#  define NO_IDEA$$/d' ${.ALLSRC} > ${.TARGET}
+.else
+       cp ${.ALLSRC} ${.TARGET}
+.endif
+
 MKDEP= -DOPENSSL_DOING_MAKEDEPEND
 
 .include <bsd.lib.mk>
@@ -253,6 +320,7 @@ _ideapath=  ${LCRYPTO_SRC}/crypto/idea
        ${LCRYPTO_SRC}/crypto/bio \
        ${LCRYPTO_SRC}/crypto/bn \
        ${LCRYPTO_SRC}/crypto/buffer \
+       ${LCRYPTO_SRC}/crypto/camellia \
        ${LCRYPTO_SRC}/crypto/cast \
        ${LCRYPTO_SRC}/crypto/comp \
        ${LCRYPTO_SRC}/crypto/conf \
@@ -273,6 +341,7 @@ _ideapath=  ${LCRYPTO_SRC}/crypto/idea
        ${LCRYPTO_SRC}/crypto/md2 \
        ${LCRYPTO_SRC}/crypto/md4 \
        ${LCRYPTO_SRC}/crypto/md5 \
+       ${LCRYPTO_SRC}/crypto/mdc2 \
        ${LCRYPTO_SRC}/crypto/objects \
        ${LCRYPTO_SRC}/crypto/ocsp \
        ${LCRYPTO_SRC}/crypto/pem \
@@ -282,6 +351,7 @@ _ideapath=  ${LCRYPTO_SRC}/crypto/idea
        ${LCRYPTO_SRC}/crypto/rand \
        ${LCRYPTO_SRC}/crypto/rc2 \
        ${LCRYPTO_SRC}/crypto/rc4 \
+       ${LCRYPTO_SRC}/crypto/rc5 \
        ${LCRYPTO_SRC}/crypto/ripemd \
        ${LCRYPTO_SRC}/crypto/rsa \
        ${LCRYPTO_SRC}/crypto/sha \
index 03d5f85..1406dc7 100644 (file)
@@ -15,107 +15,12 @@ CFLAGS+=   -DOPENSSL_NO_JPAKE
 
 .if !defined(WANT_IDEA)
 CFLAGS+=       -DOPENSSL_NO_IDEA
-.else
-_idea_h=       idea/idea.h
 .endif
 
 .if ${MACHINE_ARCH} == "i386"
 CFLAGS+= -DL_ENDIAN
 .endif
 
-CRYTPO_HDRS=   \
-       ../e_os.h ../e_os2.h \
-       crypto.h \
-       ebcdic.h \
-       fips_err.h \
-       opensslv.h \
-       ossl_typ.h \
-       symhacks.h \
-       tmdiff.h \
-       aes/aes.h aes/aes_locl.h \
-       asn1/asn1.h asn1/asn1_mac.h asn1/asn1t.h \
-       bio/bio.h \
-       bf/blowfish.h \
-       bn/bn.h \
-       buffer/buffer.h \
-       camellia/camellia.h \
-       cast/cast.h \
-       comp/comp.h \
-       conf/conf.h conf/conf_api.h \
-       des/des.h des/des_old.h \
-       dh/dh.h \
-       dsa/dsa.h \
-       dso/dso.h \
-       ec/ec.h \
-       ecdh/ecdh.h \
-       ecdsa/ecdsa.h \
-       engine/eng_int.h engine/engine.h \
-       err/err.h \
-       hmac/hmac.h \
-       ${_idea_h} \
-       krb5/krb5_asn.h \
-       lhash/lhash.h \
-       md2/md2.h \
-       md4/md4.h \
-       md5/md5.h \
-       mdc2/mdc2.h \
-       ocsp/ocsp.h \
-       objects/objects.h objects/obj_mac.h \
-       pem/pem.h pem/pem2.h \
-       pkcs12/pkcs12.h pkcs7/pkcs7.h \
-       pqueue/pqueue.h pqueue/pq_compat.h \
-       rand/rand.h \
-       rc2/rc2.h rc4/rc4.h rc5/rc5.h \
-       ripemd/ripemd.h \
-       rsa/rsa.h \
-       stack/stack.h stack/safestack.h \
-       store/store.h \
-       sha/sha.h \
-       txt_db/txt_db.h \
-       ui/ui.h ui/ui_compat.h ui/ui_locl.h \
-       x509/x509.h x509/x509_vfy.h x509v3/x509v3.h
-
-SSL_HDRS=      \
-       dtls1.h kssl.h ssl.h ssl2.h ssl23.h ssl3.h tls1.h
-
-HDRS+= ${CRYTPO_HDRS:S,^,crypto/,} \
-       ${SSL_HDRS:S,^,ssl/,}
-
-SRCS+=         buildinf.h openssl/opensslconf.h openssl/evp.h
-CLEANFILES+=   buildinf.h openssl/opensslconf.h openssl/evp.h
-CLEANDIRS+=    openssl
-
-buildinf.h:
-       ( echo "#ifndef MK1MF_BUILD"; \
-       echo "  /* auto-generated by crypto/Makefile.ssl for crypto/cversion.c */"; \
-       echo "  #define CFLAGS \"$(CC)\""; \
-       echo "  #define PLATFORM \"`uname -s`-`uname -m`\""; \
-       echo "  #define DATE \"`LC_ALL=C date`\""; \
-       echo "#endif" ) > ${.TARGET}
-
-openssl/opensslconf.h: openssl/.dummy ../../lib/libcrypto/opensslconf-${MACHINE_ARCH}.h
-.if defined(WANT_IDEA)
-       sed '/^# define OPENSSL_NO_IDEA$$/d;/^#  define NO_IDEA$$/d' ${.ALLSRC:Nopenssl/.dummy} > ${.TARGET}
-.else
-       cp ${.ALLSRC:Nopenssl/.dummy} ${.TARGET}
-.endif
-
-openssl/evp.h: openssl/.dummy ${LCRYPTO_SRC}/crypto/evp/evp.h
-       cp ${.ALLSRC:Nopenssl/.dummy} ${.TARGET}
-
-SRCS+= ${HDRS:T:S;^;openssl/;}
-.for h in ${HDRS:S,^,${LCRYPTO_SRC}/,}
-openssl/${h:T}: openssl/.dummy ${h}
-       cp ${h} openssl
-.endfor
-
-# mkdir the required directory as its own target, so multiple
-# mkdir commands do not race against each other.
-#
-openssl/.dummy:
-       mkdir -p openssl
-       if [ ! -f ${.TARGET} ]; then touch ${.TARGET}; fi
-
 MANDIR=        ${SHAREDIR}/openssl/man/man
 
 .if defined(LIB)
index bd13b85..022b351 100644 (file)
@@ -20,7 +20,7 @@ SRCS+=        bio_ssl.c d1_both.c d1_clnt.c d1_enc.c d1_lib.c d1_meth.c d1_pkt.c \
        ssl_err.c ssl_err2.c ssl_lib.c ssl_rsa.c ssl_sess.c ssl_stat.c \
        ssl_txt.c t1_clnt.c t1_enc.c t1_lib.c t1_meth.c t1_reneg.c t1_srvr.c
 
-INCS=  ${SSL_HDRS}
+INCS=  dtls1.h kssl.h ssl.h ssl2.h ssl23.h ssl3.h tls1.h
 INCSDIR=${INCLUDEDIR}/openssl
 
 LDADD= -lcrypto
index ad237da..a6e6c79 100644 (file)
@@ -1,15 +1,12 @@
 # $FreeBSD: src/secure/usr.bin/openssl/Makefile,v 1.11.2.6 2003/02/14 22:38:22 nectar Exp $
 # $DragonFly: src/secure/usr.bin/openssl/Makefile,v 1.6 2005/07/07 12:18:30 corecode Exp $
 
-PROG=  xopenssl
-PROGNAME=      openssl
+PROG=  openssl
 WARNS?=        2
 
 DPADD= ${LIBSSL} ${LIBCRYPTO}
 LDADD= -lssl -lcrypto
 
-NOLINT=                true
-
 .if exists(Makefile.man)
 .include "Makefile.man"
 .endif