all-unix:: autoconf.h $(BUILT_HEADERS)
all-windows:: autoconf.h $(BUILT_HEADERS)
+all-unix:: @MAINT@ verify-calling-conventions-krb5
+
$(srcdir)/autoconf.h.in: @MAINT@ $(srcdir)/autoconf.stmp
$(srcdir)/autoconf.stmp: $(srcdir)/$(thisconfigdir)/configure.in $(SRCTOP)/aclocal.m4
$(RM) -r $(srcdir)/$(thisconfigdir)/autom4te.cache
cat $(srcdir)/krb5/krb5.hin krb5_err.h kdb5_err.h kv5m_err.h krb524_err.h \
asn1_err.h >> krb5/krb5.h
+verify-calling-conventions-krb5: krb5/krb5.h
+ $(PERL) -w $(SRCTOP)/util/def-check.pl krb5/krb5.h $(SRCTOP)/lib/krb5_32.def
+
#
# Build the error table include files:
# asn1_err.h kdb5_err.h krb5_err.h kv5m_err.h krb524_err.h
SHLIB_RDIRS=$(KRB5_LIBDIR)
RELDIR=gssapi
-all-unix:: all-liblinks
+all-unix:: all-liblinks @MAINT@ verify-calling-conventions-gssapi
install-unix:: install-libs
-clean-unix:: clean-liblinks clean-libs clean-libobjs
+clean-unix:: clean-liblinks clean-libs clean-libobjs clean-misc-unix
clean-windows::
$(RM) gssapi.lib gssapi.bak
+clean-misc-unix:
+ $(RM) merged-gssapi-header.h
+
+EHDRDIR=$(BUILDTOP)$(S)include$(S)gssapi
+EXPORTED_HEADERS= \
+ $(EHDRDIR)$(S)gssapi_krb5.h \
+ $(EHDRDIR)$(S)gssapi_generic.h \
+ $(EHDRDIR)$(S)gssapi.h
+$(EXPORTED_HEADERS): all-recurse
+merged-gssapi-header.h: $(EXPORTED_HEADERS)
+ cat $(EXPORTED_HEADERS) > merged.tmp
+ $(MV) merged.tmp merged-gssapi-header.h
+verify-calling-conventions-gssapi: merged-gssapi-header.h
+ $(PERL) -w $(SRCTOP)/util/def-check.pl merged-gssapi-header.h $(srcdir)/../gssapi32.def
+
all-windows::
cd generic
@echo Making in gssapi\generic
use strict;
use IO::File;
-my $h_filename = shift @ARGV || die "usage: $0 header-file [def-file]\n";
+my $verbose = 0;
+my $error = 0;
+if ( $ARGV[0] eq "-v" ) { $verbose = 1; shift @ARGV; }
+my $h_filename = shift @ARGV || die "usage: $0 [-v] header-file [def-file]\n";
my $d_filename = shift @ARGV;
my $h = open_always($h_filename);
}
Top:
# drop KRB5INT_BEGIN_DECLS and KRB5INT_END_DECLS
- if (/^ *KRB5INT_BEGIN_DECLS/) {
- next LINE;
- }
- if (/^ *KRB5INT_END_DECLS/) {
+ if (/^ *(KRB5INT|GSSAPI[A-Z]*)_(BEGIN|END)_DECLS/) {
next LINE;
}
# drop preprocessor directives
if (/^ *#/) {
+ while (/\\$/) { $_ .= $h->getline(); }
next LINE;
}
if (/^ *\?==/) {
}
# multi-line comments?
if (/\/\*$/) {
- $_ .= "\n";
+ $_ .= " ";
$len1 = length;
$_ .= $h->getline();
chop if $len1 < length;
if (/^[ \t]*$/) {
next LINE;
}
- if (/ *extern "C" {/) {
+ if (/^ *extern "C" {/) {
next LINE;
}
# elide struct definitions
}
}
-print join("\n\t", "Using default calling convention:", sort(@convD));
-print join("\n\t", "\nUsing KRB5_CALLCONV:", sort(@convK));
-print join("\n\t", "\nUsing KRB5_CALLCONV_C:", sort(@convC));
-print join("\n\t", "\nUsing KRB5_CALLCONV_WRONG:", sort(@convW));
-print "\n","-"x70,"\n";
+if ( $verbose ) {
+ print join("\n\t", "Using default calling convention:", sort(@convD));
+ print join("\n\t", "\nUsing KRB5_CALLCONV:", sort(@convK));
+ print join("\n\t", "\nUsing KRB5_CALLCONV_C:", sort(@convC));
+ print join("\n\t", "\nUsing KRB5_CALLCONV_WRONG:", sort(@convW));
+ print "\n","-"x70,"\n";
+}
%conv = ();
map { $conv{$_} = "default"; } @convD;
map { $vararg{$_} = 1; } @vararg;
if (!$d) {
- print "No .DEF file specified\n";
- exit;
+ print "No .DEF file specified\n" if $verbose;
+ exit 0;
}
LINE2:
$printit = 0;
next LINE2;
}
- if (/^EXPORTS/) {
+ if (/^EXPORTS/ || /^DESCRIPTION/ || /^HEAPSIZE/) {
$printit = 0;
next LINE2;
}
my($xconv);
if (/PRIVATE/ || /INTERNAL/) {
$xconv = "PRIVATE";
+ } elsif (/DATA/) {
+ $xconv = "DATA";
} elsif (/!CALLCONV/ || /KRB5_CALLCONV_WRONG/) {
$xconv = "KRB5_CALLCONV_WRONG";
} elsif ($vararg{$_}) {
s/;.*$//;
if ($xconv eq "PRIVATE") {
- print "\t private $_\n";
+ print "\t private $_\n" if $verbose;
+ next LINE2;
+ }
+ if ($xconv eq "DATA") {
+ print "\t data $_\n" if $verbose;
next LINE2;
}
if (!defined($conv{$_})) {
print "No calling convention specified for $_!\n";
+ $error = 1;
} elsif (! ($conv{$_} eq $xconv)) {
print "Function $_ should have calling convention '$xconv', but has '$conv{$_}' instead.\n";
+ $error = 1;
} else {
# print "Function $_ is okay.\n";
}
}
#print "Calling conventions defined for: ", keys(%conv);
+exit $error;