diff configure.ac @ 21172:33da7f2a30e4

Manually fflush() files written with purple_util_write_data_to_file, because apparently some filesystems (XFS) can and will leave bogus file contents if we don't. For systems which don't have fileno(), this involves closing and reopening the file.
author Ethan Blanton <elb@pidgin.im>
date Thu, 08 Nov 2007 19:49:12 +0000
parents 97f70e18c610
children 6de09629f091
line wrap: on
line diff
--- a/configure.ac	Tue Nov 06 16:46:04 2007 +0000
+++ b/configure.ac	Thu Nov 08 19:49:12 2007 +0000
@@ -233,6 +233,30 @@
 dnl FreeBSD doesn't have libdl, dlopen is provided by libc
 AC_CHECK_FUNC(dlopen, LIBDL="", [AC_CHECK_LIB(dl, dlopen, LIBDL="-ldl")])
 
+AC_MSG_CHECKING(for fileno())
+AC_TRY_RUN([
+#include <stdio.h>
+
+int main(int argc, char *argv[])
+{
+	int fd;
+
+	fd = fileno(stdout);
+
+	return !(fd > 0);
+}
+], [
+	AC_MSG_RESULT(yes)
+	AC_DEFINE([HAVE_FILENO], [1],
+	          [Define to 1 if your stdio has int fileno(FILE *).])
+], [
+	AC_MSG_RESULT(no)
+], [
+	# Fallback for Cross Compiling...
+	# This will enable the compatibility code.
+	AC_MSG_RESULT(no)
+])
+
 AC_MSG_CHECKING(for the %z format string in strftime())
 AC_TRY_RUN([
 #ifdef HAVE_SYS_TIME_H