fixes to dtrt with ANSI_STDIO; previously there was gratuitous abuse of
authorTom Yu <tlyu@mit.edu>
Tue, 2 Aug 1994 09:41:55 +0000 (09:41 +0000)
committerTom Yu <tlyu@mit.edu>
Tue, 2 Aug 1994 09:41:55 +0000 (09:41 +0000)
this particular definition, as it was really just detecting the presence
of setvbuf().  Now it does a compile-and-run to check for binary fopen()
availability, and the check for setvbuf() has been moved.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@4030 dc483132-0cff-0310-8789-dd5450dbe970

src/include/krb5/ChangeLog
src/include/krb5/acconfig.h
src/include/krb5/configure.in

index 7dae7d2d9969d0e14201e48c95fbc7ab0a3a5118..cfbf9bc7585b64d6e1223911e08fbd63c9b116ce 100644 (file)
@@ -1,3 +1,10 @@
+Tue Aug  2 03:39:14 1994  Tom Yu  (tlyu@dragons-lair)
+
+       * acconfig.h: add HAVE_SETVBUF
+
+       * configure.in: changes to make things saner when checking for
+       ANSI_STDIO
+
 Thu Jul 14 03:31:06 1994  Tom Yu  (tlyu at dragons-lair)
 
        * Makefile.in: some cleanup to not echo cruft
index 7d84251c59ed8e88d497e3a859e7a9b861b46de8..eaf5ca50dfe9484b70138a577e15ea0ab8ed52c8 100644 (file)
@@ -1,6 +1,7 @@
 /* just stuff needed by kerberos 5 */
 
 #undef ANSI_STDIO
+#undef HAS_SETVBUF
 #undef BITS32
 #undef HAS_ANSI_CONST
 #undef HAS_ANSI_VOLATILE
index e6204a181a7a4364d13c5161f70bfa0c8a29806f..3b4d5b0cdd65863b59df7baeb7f161c892435ccb 100644 (file)
@@ -39,9 +39,21 @@ AC_HEADER_CHECK(string.h,AC_DEFINE(USE_STRING_H))
 AC_HEADER_CHECK(stdlib.h,AC_DEFINE(HAS_STDLIB_H),AC_DEFINE(NO_STDLIB_H))
 CHECK_STDARG
 
-dnl this is misused to *also* mean that "b" is needed to fopen binary...
-AC_FUNC_CHECK([setvbuf],AC_DEFINE(ANSI_STDIO))
-
+AC_FUNC_CHECK([setvbuf],AC_DEFINE(HAS_SETVBUF))
+dnl check for ANSI stdio, esp "b" option to fopen().  This (unfortunately)
+dnl requires a run check...
+AC_CHECKING([for ANSI stdio])
+AC_TEST_PROGRAM([
+#include <stdio.h>
+int main()
+{
+  FILE *conftest;
+  if ((conftest = fopen("conftest.dat", "w")) == NULL) exit(1);
+  if (fclose(conftest)) exit(1);
+  if ((conftest = fopen("conftest.dat", "rb+")) == NULL) exit(1);
+  if (fputs("testing ANSI for stdio\n", conftest) == EOF) exit(1);
+  exit(0);
+}],AC_DEFINE(ANSI_STDIO))
 
 AC_COMPILE_CHECK([prototype support],
 [int x(double y, int z);],,AC_DEFINE(KRB5_PROVIDE_PROTOTYPES))