From: Joseph Sutton Date: Mon, 21 Feb 2022 06:12:28 +0000 (+1300) Subject: third_party/heimdal_build: Don't generate .x source files X-Git-Tag: tevent-0.12.0~601 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7cb68fdba75c362cdfd8f3bf08bcd9c22bbe4556;p=thirdparty%2Fsamba.git third_party/heimdal_build: Don't generate .x source files This is an adaptation to Heimdal: commit 9427796f1a65906f12768b28abdb5a928222f3c6 Author: Jeffrey Altman Date: Wed Jan 5 15:45:23 2022 -0500 Generate .x source files as .c source files The generated .x source and .hx header files are plain C source files. Generate them as .c source files and avoid unnecessary file copying and special makefile rules. Change-Id: Ifc4bbe3c46dd357fdd642040ad964c7cfe1d395c NOTE: THIS COMMIT WON'T COMPILE/WORK ON ITS OWN! BUG: https://bugzilla.samba.org/show_bug.cgi?id=14995 Signed-off-by: Joseph Sutton Reviewed-by: Stefan Metzmacher Reviewed-by: Andrew Bartlett --- diff --git a/third_party/heimdal_build/wscript_build b/third_party/heimdal_build/wscript_build index 69aeb120191..3ea1fc93653 100644 --- a/third_party/heimdal_build/wscript_build +++ b/third_party/heimdal_build/wscript_build @@ -40,10 +40,10 @@ def HEIMDAL_ASN1(name, source, bld.set_group('build_source') out_files = heimdal_paths([ - "%s/asn1_%s_asn1.x" % (directory, bname), - "%s/%s_asn1.hx" % (directory, bname), - "%s/%s_asn1-priv.hx" % (directory, bname), - "%s/%s_asn1_oids.x" % (directory, bname), + "%s/asn1_%s_asn1.c" % (directory, bname), + "%s/%s_asn1.h" % (directory, bname), + "%s/%s_asn1-priv.h" % (directory, bname), + "%s/%s_asn1_oids.c" % (directory, bname), ]) # the ${TGT[0].parent.abspath(env)} expression gives us the parent directory of @@ -81,7 +81,7 @@ def HEIMDAL_ASN1(name, source, deps = 'asn1_compile' t = bld(rule=asn1_rule, - ext_out = '.x', + ext_out = '.c', before = 'c', update_outputs = True, shell = True, @@ -97,40 +97,9 @@ def HEIMDAL_ASN1(name, source, t.env.OPTION_FILE = "--option-file='%s'" % \ os.path.normpath(os.path.join(bld.path.abspath(), option_file)) - cfile = out_files[0][0:-2] + '.c' - hfile = out_files[1][0:-3] + '.h' - hpriv = out_files[2][0:-3] + '.h' - - # now generate a .c file from the .x file - t = bld(rule='''( echo '#include "config.h"' && cat ${SRC} ) > ${TGT}''', - source = out_files[0], - target = cfile, - shell = True, - update_outputs=True, - ext_out = '.c', - ext_in = '.x', - depends_on = name + '_ASN1', - name = name + '_C') - - # and generate a .h file from the .hx file - t = bld(rule='cp ${SRC} ${TGT}', - source = out_files[1], - ext_out = '.c', - ext_in = '.x', - update_outputs=True, - target = hfile, - depends_on = name + '_ASN1', - name = name + '_H') - - # and generate a .h file from the .hx file - t = bld(rule='cp ${SRC} ${TGT}', - source = out_files[2], - ext_out = '.c', - ext_in = '.x', - update_outputs=True, - target = hpriv, - depends_on = name + '_ASN1', - name = name + '_PRIV_H') + cfile = out_files[0] + hfile = out_files[1] + hpriv = out_files[2] bld.set_group('main')