summaryrefslogtreecommitdiff
path: root/source4/heimdal_build
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2005-08-03 05:28:08 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 13:31:04 -0500
commit7facdcc161b75c7a3a85a0f6380f5b83394183c4 (patch)
treee14c0fb17019471f0c67b0d8a323a9809983043e /source4/heimdal_build
parent4fd6c8e9cfc69821f574f30f8e6c1eaa781594fc (diff)
downloadsamba-7facdcc161b75c7a3a85a0f6380f5b83394183c4.tar.gz
samba-7facdcc161b75c7a3a85a0f6380f5b83394183c4.tar.bz2
samba-7facdcc161b75c7a3a85a0f6380f5b83394183c4.zip
r8985: Automatically generate make dependency rules for
the asn1 and error table files. This removes the need for HEIMDAL_EXTERNAL (This used to be commit 2f481ac93c0151b82dab737d49ae8d0d3cbbbbbe)
Diffstat (limited to 'source4/heimdal_build')
-rwxr-xr-xsource4/heimdal_build/asn1_deps.pl31
-rwxr-xr-xsource4/heimdal_build/build_external.sh43
-rw-r--r--source4/heimdal_build/config.mk21
-rwxr-xr-xsource4/heimdal_build/et_deps.pl14
4 files changed, 58 insertions, 51 deletions
diff --git a/source4/heimdal_build/asn1_deps.pl b/source4/heimdal_build/asn1_deps.pl
new file mode 100755
index 0000000000..4cff3e2fae
--- /dev/null
+++ b/source4/heimdal_build/asn1_deps.pl
@@ -0,0 +1,31 @@
+#!/usr/bin/perl
+# Generate make dependency rules for asn1 files
+# Jelmer Vernooij <jelmer@samba.org> 2005
+# GPL
+
+use File::Basename;
+
+my $file = shift;
+my $prefix = shift;
+
+if (not defined ($prefix)) { $prefix = "asn1"; }
+
+$dirname = dirname($file);
+$basename = basename($file);
+
+my $header = "$dirname/$prefix.h";
+
+print "$header: $file bin/asn1_compile\n";
+print "\t\@echo \"Compiling ASN1 file $file\"\n";
+print "\t\@cd $dirname && ../../../bin/asn1_compile $basename $prefix\n\n";
+
+open(IN,$file) or die("Can't open $file: $!");
+foreach(<IN>) {
+ if (/^([A-Za-z0-9_-]+)[ \t]*::= /) {
+ my $output = $1;
+ $output =~ s/-/_/g;
+ print "$dirname/asn1_$output.c: $header\n";
+ print "\t\@mv $dirname/asn1_$output.x $dirname/asn1_$output.c\n\n";
+ }
+}
+close(IN);
diff --git a/source4/heimdal_build/build_external.sh b/source4/heimdal_build/build_external.sh
deleted file mode 100755
index 9d80625a38..0000000000
--- a/source4/heimdal_build/build_external.sh
+++ /dev/null
@@ -1,43 +0,0 @@
-#!/bin/sh
-#####################
-# build generated asn1 files in heimdal/ tree
-# tridge@samba.org, June 2005
-
-CC="$1"
-
-TOP=`pwd`
-ASN1_COMPILE=$TOP/bin/asn1_compile
-
-build_asn1() {
- f=$1
- name=$2
-
- dir=`dirname $f`
- file=`basename $f`
- echo Building $f
- cd $dir && $ASN1_COMPILE $file $name || exit 1
- for f in *.x; do
- base=`basename $f .x`
- rm -f $base.c && cp $base.x $base.c
- done
- cd $TOP || exit 1
-}
-
-build_cp() {
- f=$1
- dir=`dirname $f`
- file=`basename $f`
- base=`basename $f in`
- echo Building $f
- echo cp $base"in" $base
- cd $dir && cp $base"in" $base
- cd $TOP || exit 1
-}
-
-build_cp heimdal/lib/roken/vis.hin
-build_cp heimdal/lib/roken/err.hin
-
-make bin/asn1_compile || exit 1
-build_asn1 heimdal/lib/hdb/hdb.asn1 hdb_asn1
-build_asn1 heimdal/lib/gssapi/spnego.asn1 spnego_asn1
-build_asn1 heimdal/lib/asn1/k5.asn1 krb5_asn1
diff --git a/source4/heimdal_build/config.mk b/source4/heimdal_build/config.mk
index d2a29626f6..03aea81b5a 100644
--- a/source4/heimdal_build/config.mk
+++ b/source4/heimdal_build/config.mk
@@ -354,7 +354,6 @@ REQUIRED_SUBSYSTEMS = ASN1_COMPILER LIBREPLACE
# End BINARY asn1_compile
#######################
-
#######################
# Start SUBSYSTEM COMPILE_ET
[SUBSYSTEM::COMPILE_ET]
@@ -380,15 +379,21 @@ REQUIRED_SUBSYSTEMS = COMPILE_ET LIBREPLACE
# End BINARY compile_et
#######################
+heimdal/lib/roken/vis.hin: heimdal/lib/roken/vis.h
+ @cp heimdal/lib/roken/vis.h heimdal/lib/roken/vis.hin
-#######################
-# Start TARGET HEIMDAL_EXTERNAL
-[TARGET::HEIMDAL_EXTERNAL]
-CMD = heimdal_build/build_external.sh "@HOSTCC@"
-REQUIRED_SUBSYSTEMS = ASN1_COMPILER
-# END TARGET HEIMDAL_EXTERNAL
-#######################
+heimdal/lib/roken/err.hin: heimdal/lib/roken/err.h
+ @cp heimdal/lib/roken/err.h heimdal/lib/roken/err.hin
+
+include ./heimdal_build/asn1_deps.pl heimdal/lib/hdb/hdb.asn1 hdb_asn1|
+include ./heimdal_build/asn1_deps.pl heimdal/lib/gssapi/spnego.asn1 spnego_asn1|
+include ./heimdal_build/asn1_deps.pl heimdal/lib/asn1/k5.asn1 krb5_asn1|
+include ./heimdal_build/et_deps.pl heimdal/lib/asn1/asn1_err.et|
+include ./heimdal_build/et_deps.pl heimdal/lib/hdb/hdb_err.et|
+include ./heimdal_build/et_deps.pl heimdal/lib/krb5/heim_err.et|
+include ./heimdal_build/et_deps.pl heimdal/lib/krb5/k524_err.et|
+include ./heimdal_build/et_deps.pl heimdal/lib/krb5/krb5_err.et|
#######################
# Start SUBSYSTEM HEIMDAL
diff --git a/source4/heimdal_build/et_deps.pl b/source4/heimdal_build/et_deps.pl
new file mode 100755
index 0000000000..d7be6074fe
--- /dev/null
+++ b/source4/heimdal_build/et_deps.pl
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+
+use File::Basename;
+
+my $file = shift;
+my $dirname = dirname($file);
+my $basename = basename($file);
+
+my $header = $file; $header =~ s/\.et$/.h/;
+my $source = $file; $source =~ s/\.et$/.c/;
+print "$source: $file bin/compile_et\n";
+print "\t\@cd $dirname && ../../../bin/compile_et $basename\n\n";
+
+print "$header: $source\n";