Restore .hx support for avoiding unneeded regeneration of header files

Fix PR lib/39185

Partly restore the changes which were removed during the Heimdal 1.1 update:
src/lib/libasn1/Makefile 1.28 -> 1.29
src/lib/libhdb/Makefile 1.21 -> 1.22
src/crypto/dist/heimdal/lib/asn1/gen.c 1.8 -> 1.9

Add .hx support in 'new' heimdal libraries:
src/lib/libgssapi/Makefile
src/lib/libhx509/Makefile

Add a new entry in doc/HACKS for this changes.
This commit is contained in:
veego 2008-08-03 07:16:58 +00:00
parent 6223c57814
commit cca63e16c3
6 changed files with 83 additions and 59 deletions

View File

@ -34,7 +34,7 @@
#include "gen_locl.h"
__RCSID("$Heimdal: gen.c 22429 2008-01-13 10:25:50Z lha $"
"$NetBSD: gen.c,v 1.9 2008/03/22 08:37:04 mlelstv Exp $");
"$NetBSD: gen.c,v 1.10 2008/08/03 07:16:58 veego Exp $");
FILE *headerfile, *codefile, *logfile;
@ -84,7 +84,7 @@ init_generate (const char *filename, const char *base)
if (headerbase == NULL)
errx(1, "strdup");
}
asprintf(&header, "%s.h", headerbase);
asprintf(&header, "%s.hx", headerbase);
if (header == NULL)
errx(1, "malloc");
headerfile = fopen (header, "w");

View File

@ -1,4 +1,4 @@
# $NetBSD: HACKS,v 1.108 2008/08/02 04:37:54 mrg Exp $
# $NetBSD: HACKS,v 1.109 2008/08/03 07:16:58 veego Exp $
#
# This file is intended to document workarounds for currently unsolved
# (mostly) compiler bugs.
@ -293,6 +293,21 @@ descr
workaround not to call mdsetimage with the -v argument on Darwin
kcah
hack avoid rebuilding asn1 libraries
mdate 03 August 2008
who veego
file src/crypto/dist/heimdal/lib/asn1/gen.c : 1.10
file src/lib/libasn1/Makefile : 1.32
file src/lib/libhdb/Makefile : 1.23
file src/lib/libgssapi/Makefile : 1.20
file src/lib/libhx509/Makefile : 1.3
pr 9702 39185
descr
asn1_compile does not check if generated header files do not have to
be rebuild.
Generate .hx files and copy it in the Makefiles if they changed.
kcah
port vax
hack gcc4/vax ICE

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.31 2008/04/21 21:30:59 veego Exp $
# $NetBSD: Makefile,v 1.32 2008/08/03 07:16:58 veego Exp $
USE_FORT?= yes # network protocol library
@ -27,7 +27,18 @@ ${ASN1COMPILEOBJ}/asn1_compile:
@cd ${.CURDIR}/asn1_compile && ${MAKE}
.endif
DPSRCS+= asn1_err.h
DPSRCS += \
krb5_asn1.h \
cms_asn1.h \
rfc2459_asn1.h \
pkinit_asn1.h \
pkcs12_asn1.h \
pkcs8_asn1.h \
pkcs9_asn1.h \
digest_asn1.h \
kx509_asn1.h \
asn1_err.h
CLEANFILES+= asn1_err.h
asn1_err.h asn1_err.c: asn1_err.et ${TOOL_COMPILE_ET}
@ -480,15 +491,15 @@ CPPFLAGS+= -I. \
CPPFLAGS+=-DHAVE_IPV6
.endif
${gen_files_k5} krb5_asn1.h: krb5_asn1_files
${gen_files_cms} cms_asn1.h: cms_asn1_files
${gen_files_rfc2459} rfc2459_asn1.h: rfc2459_asn1_files
${gen_files_pkinit} pkinit_asn1.h: pkinit_asn1_files
${gen_files_pkcs12} pkcs12_asn1.h: pkcs12_asn1_files
${gen_files_pkcs8} pkcs8_asn1.h: pkcs8_asn1_files
${gen_files_pkcs9} pkcs9_asn1.h: pkcs9_asn1_files
${gen_files_digest} digest_asn1.h: digest_asn1_files
${gen_files_kx509} kx509_asn1.h: kx509_asn1_files
${gen_files_k5} krb5_asn1.hx: krb5_asn1_files
${gen_files_cms} cms_asn1.hx: cms_asn1_files
${gen_files_rfc2459} rfc2459_asn1.hx: rfc2459_asn1_files
${gen_files_pkinit} pkinit_asn1.hx: pkinit_asn1_files
${gen_files_pkcs12} pkcs12_asn1.hx: pkcs12_asn1_files
${gen_files_pkcs8} pkcs8_asn1.hx: pkcs8_asn1_files
${gen_files_pkcs9} pkcs9_asn1.hx: pkcs9_asn1_files
${gen_files_digest} digest_asn1.hx: digest_asn1_files
${gen_files_kx509} kx509_asn1.hx: kx509_asn1_files
krb5_asn1_files: k5.asn1 ${TOOL_ASN1_COMPILE}
${TOOL_ASN1_COMPILE} \
@ -523,32 +534,20 @@ digest_asn1_files: digest.asn1 ${TOOL_ASN1_COMPILE}
kx509_asn1_files: kx509.asn1 ${TOOL_ASN1_COMPILE}
${TOOL_ASN1_COMPILE} ${DIST}/heimdal/lib/asn1/kx509.asn1 kx509_asn1
${SRCS}: \
krb5_asn1.h \
cms_asn1.h \
rfc2459_asn1.h \
pkinit_asn1.h \
pkcs12_asn1.h \
pkcs8_asn1.h \
pkcs9_asn1.h \
digest_asn1.h \
kx509_asn1.h
CLEANFILES= ${BUILT_SOURCES} ${gen_files_k5} \
${gen_files_cms} ${gen_files_rfc2459} \
${gen_files_pkinit} ${gen_files_pkcs12} \
${gen_files_pkcs8} ${gen_files_pkcs9} \
${gen_files_digest} ${gen_files_kx509} \
krb5_asn1_files krb5_asn1.h \
cms_asn1_files cms_asn1.h \
rfc2459_asn1_files rfc2459_asn1.h \
pkinit_asn1_files pkinit_asn1.h \
pkcs12_asn1_files pkcs12_asn1.h \
pkcs8_asn1_files pkcs8_asn1.h \
pkcs9_asn1_files pkcs9_asn1.h \
digest_asn1_files digest_asn1.h \
kx509_asn1_files kx509_asn1.h
krb5_asn1_files krb5_asn1.h krb5_asn1.hx \
cms_asn1_files cms_asn1.h cms_asn1.hx \
rfc2459_asn1_files rfc2459_asn1.h rfc2459_asn1.hx \
pkinit_asn1_files pkinit_asn1.h pkinit_asn1.hx \
pkcs12_asn1_files pkcs12_asn1.h pkcs12_asn1.hx \
pkcs8_asn1_files pkcs8_asn1.h pkcs8_asn1.hx \
pkcs9_asn1_files pkcs9_asn1.h pkcs9_asn1.hx \
digest_asn1_files digest_asn1.h digest_asn1.hx \
kx509_asn1_files kx509_asn1.h kx509_asn1.hx
.if ${USETOOLS} != "yes"
SUBDIR= asn1_compile
@ -559,7 +558,10 @@ SUBDIR= asn1_compile
.include <bsd.subdir.mk>
.endif
.SUFFIXES: .x
.SUFFIXES: .hx .x
.hx.h:
@cmp -s $< $@ 2> /dev/null || cp $< $@
.x.c:
@cmp -s $< $@ 2> /dev/null || cp $< $@

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.19 2008/03/29 17:51:42 wiz Exp $
# $NetBSD: Makefile,v 1.20 2008/08/03 07:16:58 veego Exp $
USE_FORT?= yes # network protocol library
@ -47,7 +47,7 @@ spnego_files = \
asn1_NegTokenInitWin.x \
asn1_NegTokenResp.x
DPSRCS= gkrb5_err.h
DPSRCS= spnego_asn1.h gssapi_asn1.h gkrb5_err.h
BUILT_SOURCES= \
${gssapi_files:.x=.c} \
@ -261,13 +261,15 @@ INCS+= gssapi/gssapi.h gssapi/gssapi_krb5.h gssapi/gssapi_spnego.h
INCSDIR= /usr/include
CLEANFILES+= ${BUILT_SOURCES} \
${spnego_files} spnego_asn1_files spnego_asn1.h \
${gssapi_files} gssapi_asn1_files gssapi_asn1.h \
${spnego_files} spnego_asn1_files \
spnego_asn1.h spnego_asn1.hx \
${gssapi_files} gssapi_asn1_files \
gssapi_asn1.h gssapi_asn1.hx \
gkrb5_err.h \
${krb5src} ${mechsrc} ${spnegosrc} ${ntlmsrc}
${spnego_files} spnego_asn1.h: spnego_asn1_files
${gssapi_files} gssapi_asn1.h: gssapi_asn1_files
${spnego_files} spnego_asn1.hx: spnego_asn1_files
${gssapi_files} gssapi_asn1.hx: gssapi_asn1_files
spnego_asn1_files: spnego/spnego.asn1 ${TOOL_ASN1_COMPILE}
${TOOL_ASN1_COMPILE} \
@ -305,7 +307,10 @@ COPTS+= -Wno-pointer-sign
.include <bsd.lib.mk>
.SUFFIXES: .x
.SUFFIXES: .hx .x
.hx.h:
@cmp -s $< $@ 2> /dev/null || cp $< $@
.x.c:
@cmp -s $< $@ 2> /dev/null || cp $< $@

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.22 2008/03/22 08:37:26 mlelstv Exp $
# $NetBSD: Makefile,v 1.23 2008/08/03 07:16:58 veego Exp $
USE_FORT?= yes # network protocol library
@ -98,16 +98,17 @@ COPTS.${f}.c+= -Wno-pointer-sign
.endfor
.endif
${gen_files} hdb_asn1.h: hdb_asn1_files
${SRCS:.c=.o}: hdb_err.h hdb_asn1.h
${gen_files} hdb_asn1.hx: hdb_asn1_files
CLEANFILES= ${gen_files} ${BUILT_SOURCES} \
hdb_asn1.h hdb_asn1_files hdb_err.h
hdb_asn1.h hdb_asn1.hx hdb_asn1_files hdb_err.h
.include <bsd.lib.mk>
.SUFFIXES: .x
.SUFFIXES: .hx .x
.hx.h:
@cmp -s $< $@ 2> /dev/null || cp $< $@
.x.c:
@cmp -s $< $@ 2> /dev/null || cp $< $@

View File

@ -1,4 +1,4 @@
# $NetBSD: Makefile,v 1.2 2008/04/13 21:25:14 mlelstv Exp $
# $NetBSD: Makefile,v 1.3 2008/08/03 07:16:58 veego Exp $
USE_FORT?= yes # cryptographic software
@ -146,22 +146,23 @@ COPTS.${f}.c+= -Wno-pointer-sign
.endfor
.endif
${gen_files_ocsp} ocsp_asn1.h: ocsp_asn1_files
${gen_files_pkcs10} pkcs10_asn1.h: pkcs10_asn1_files
${gen_files_crmf} crmf_asn1.h: crmf_asn1_files
${SRCS}: ocsp_asn1.h pkcs10_asn1.h crmf_asn1.h hx509_err.h
${gen_files_ocsp} ocsp_asn1.hx: ocsp_asn1_files
${gen_files_pkcs10} pkcs10_asn1.hx: pkcs10_asn1_files
${gen_files_crmf} crmf_asn1.hx: crmf_asn1_files
CLEANFILES= ${gen_files_ocsp} ${gen_files_pkcs10} ${gen_files_crmf} \
${BUILT_SOURCES} \
ocsp_asn1_files ocsp_asn1.h \
pkcs10_asn1_files pkcs10_asn1.h \
crmf_asn1_files crmf_asn1.h \
ocsp_asn1_files ocsp_asn1.h ocsp_asn1.hx \
pkcs10_asn1_files pkcs10_asn1.h pkcs10_asn1.hx \
crmf_asn1_files crmf_asn1.h crmf_asn1.hx \
hx509_err.h
.include <bsd.lib.mk>
.SUFFIXES: .x
.SUFFIXES: .hx .x
.hx.h:
@cmp -s $< $@ 2> /dev/null || cp $< $@
.x.c:
@cmp -s $< $@ 2> /dev/null || cp $< $@