third_party/heimdal_build: Don't generate .x source files
authorJoseph Sutton <josephsutton@catalyst.net.nz>
Mon, 21 Feb 2022 06:12:28 +0000 (19:12 +1300)
committerJoseph Sutton <jsutton@samba.org>
Tue, 1 Mar 2022 22:34:35 +0000 (22:34 +0000)
This is an adaptation to Heimdal:

commit 9427796f1a65906f12768b28abdb5a928222f3c6
Author: Jeffrey Altman <jaltman@secure-endpoints.com>
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 <josephsutton@catalyst.net.nz>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
third_party/heimdal_build/wscript_build

index 69aeb12019189ef1143e9b4d9fd3ed40fb1d52a6..3ea1fc93653f7a3bfb0579a22d037431a418405c 100644 (file)
@@ -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')