Detect if the Vista version of ntsecapi.h is present
authorKevin Koch <kpkoch@mit.edu>
Tue, 18 Mar 2008 17:40:04 +0000 (17:40 +0000)
committerKevin Koch <kpkoch@mit.edu>
Tue, 18 Mar 2008 17:40:04 +0000 (17:40 +0000)
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
src/windows/build/bkw.pl
src/windows/ntsecapitest.c [new file with mode: 0644]
src/windows/ntsecapitest.pl [new file with mode: 0644]

index 3ba9da6e4c93e33050723e43b2d21a7ee9c203c1..f1a46c0df29a052ce9e5fc53247512b98fbb6ea0 100644 (file)
@@ -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
index 24c32a035d53d79ef945670a573d6c8b4d147c9f..c1e33d28f05a8323a29ca8d90f72a54294a09cf3 100644 (file)
@@ -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 (file)
index 0000000..7fbbacb
--- /dev/null
@@ -0,0 +1,11 @@
+/* Simple program to show what is in ntsecapi.h.\r
+   Compile -P to generate preprocessor output.\r
+ */\r
+\r
+#include "ntsecapi.h"\r
+\r
+#ifdef TRUST_ATTRIBUTE_TRUST_USES_AES_KEYS \r
+VISTA_SDK_VERSION\r
+#else\r
+NT_SDK_VERSION\r
+#endif
\ No newline at end of file
diff --git a/src/windows/ntsecapitest.pl b/src/windows/ntsecapitest.pl
new file mode 100644 (file)
index 0000000..c5306ea
--- /dev/null
@@ -0,0 +1,11 @@
+#!perl -w\r
+\r
+$filename = "ntsecapitest.i";\r
+$string = "VISTA_SDK_VERSION";\r
+\r
+if (system("grep $string $filename")) {\r
+    print "$string not found; deleting $filename.\n";\r
+    system("rm $filename");\r
+    }\r
+\r
+exit(0);
\ No newline at end of file