From f62112276c2147b1334585322db40cd45da30ace Mon Sep 17 00:00:00 2001 From: Kevin Koch Date: Tue, 18 Mar 2008 17:40:04 +0000 Subject: Detect if the Vista version of ntsecapi.h is present TargetVersion: 1.7 Component: krb5-libs Ticket: 19569 tAGS: PULLUP Subj: Tweaks for 1.7 build on Windows. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@20277 dc483132-0cff-0310-8789-dd5450dbe970 --- src/windows/Makefile.in | 17 +++++++++++++++-- src/windows/build/bkw.pl | 5 +++++ src/windows/ntsecapitest.c | 11 +++++++++++ src/windows/ntsecapitest.pl | 11 +++++++++++ 4 files changed, 42 insertions(+), 2 deletions(-) create mode 100644 src/windows/ntsecapitest.c create mode 100644 src/windows/ntsecapitest.pl (limited to 'src') diff --git a/src/windows/Makefile.in b/src/windows/Makefile.in index 3ba9da6e4c..f1a46c0df2 100644 --- a/src/windows/Makefile.in +++ b/src/windows/Makefile.in @@ -4,7 +4,7 @@ NO_OUTPRE=1 # # Makefile that recurses into cns subdirectory. # -all-windows:: +all-windows:: ntsecapitest @echo Making in windows\lib cd lib $(MAKE) -$(MFLAGS) @@ -16,6 +16,7 @@ all-windows:: $(MAKE) -$(MFLAGS) @echo Making in windows\gss cd ..\gss + cd $(MAKE) -$(MFLAGS) @echo Making in windows\gina cd ..\gina @@ -33,7 +34,7 @@ all-windows:: !endif cd .. -clean-windows:: +clean-windows:: clean-ntsecapitest @echo Making clean in windows\lib cd lib $(MAKE) -$(MFLAGS) clean @@ -61,3 +62,15 @@ clean-windows:: $(MAKE) -$(MFLAGS) clean !endif cd .. + +# If ntsecapi.h contains the string that indicates it came from the Vista SDK, +# then ntsecapitest.i will be left behind. If the string is not present, +# ntsecapitest.i will be deleted. +ntsecapitest:: ntsecapitest.i + ntsecapitest.pl + +clean-ntsecapitest:: + $(RM) ntsecapitest.i + +{}.c{}.i: + @$(C_RULE) -P diff --git a/src/windows/build/bkw.pl b/src/windows/build/bkw.pl index 24c32a035d..c1e33d28f0 100644 --- a/src/windows/build/bkw.pl +++ b/src/windows/build/bkw.pl @@ -687,6 +687,11 @@ sub main { system("rm -rf $out/a.tmp"); ## Clean up junk. system("rm -rf $out/ziptemp"); ## Clean up junk. + print "Now check for ntsecapitest.i.\n"; + $dir = "$wd\\athena\\auth\\krb5\\src\\windows"; + chdir($dir) or die "Fatal -- Couldn't cd to $dir"; + print "Info -- chdir to ".`cd`."\n" if ($verbose); + # End logging: if ($odr->{logfile}->{def}) {$l->stop;} diff --git a/src/windows/ntsecapitest.c b/src/windows/ntsecapitest.c new file mode 100644 index 0000000000..7fbbacbaa5 --- /dev/null +++ b/src/windows/ntsecapitest.c @@ -0,0 +1,11 @@ +/* Simple program to show what is in ntsecapi.h. + Compile -P to generate preprocessor output. + */ + +#include "ntsecapi.h" + +#ifdef TRUST_ATTRIBUTE_TRUST_USES_AES_KEYS +VISTA_SDK_VERSION +#else +NT_SDK_VERSION +#endif \ No newline at end of file diff --git a/src/windows/ntsecapitest.pl b/src/windows/ntsecapitest.pl new file mode 100644 index 0000000000..c5306ea8d1 --- /dev/null +++ b/src/windows/ntsecapitest.pl @@ -0,0 +1,11 @@ +#!perl -w + +$filename = "ntsecapitest.i"; +$string = "VISTA_SDK_VERSION"; + +if (system("grep $string $filename")) { + print "$string not found; deleting $filename.\n"; + system("rm $filename"); + } + +exit(0); \ No newline at end of file -- cgit