summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGlenn Morris <rgm@gnu.org>2012-07-10 23:52:48 -0700
committerGlenn Morris <rgm@gnu.org>2012-07-10 23:52:48 -0700
commitc8add24e86d499000f0998558d635fffa1f3857c (patch)
tree4e66354f1cfce36f68f679c3b72dffbb73436852
parentb41253a389afdffde3d2551e4c165f0ebbafdf89 (diff)
downloademacs-c8add24e86d499000f0998558d635fffa1f3857c.tar.gz
Move GNU_LIBRARY_PENDING_OUTPUT_COUNT from src/s to configure
* configure.ac (GNU_LIBRARY_PENDING_OUTPUT_COUNT): Move here from src/s. * src/s/gnu.h, src/s/gnu-linux.h: Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
-rw-r--r--ChangeLog5
-rw-r--r--configure.ac70
-rw-r--r--src/ChangeLog5
-rw-r--r--src/s/gnu-linux.h18
-rw-r--r--src/s/gnu.h10
5 files changed, 72 insertions, 36 deletions
diff --git a/ChangeLog b/ChangeLog
index 53259731ebf..17690d1d913 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2012-07-11 Glenn Morris <rgm@gnu.org>
+
+ * configure.ac (GNU_LIBRARY_PENDING_OUTPUT_COUNT):
+ Move here from src/s.
+
2012-07-11 Paul Eggert <eggert@cs.ucla.edu>
Assume rename, strerror.
diff --git a/configure.ac b/configure.ac
index ddb25534257..23ddaa7e9f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -3163,19 +3163,14 @@ dnl Used in sound.c
AC_DEFINE_UNQUOTED(DEFAULT_SOUND_DEVICE, "$sound_device",
[Name of the default sound device.])
-dnl Used in vm-limit.c
-AH_TEMPLATE(DATA_START, [Address of the start of the data segment.])
-dnl Used in lisp.h, emacs.c, mem-limits.h
-dnl NEWS.18 describes this as "a number which contains
-dnl the high bits to be inclusive or'ed with pointers that are unpacked."
-AH_TEMPLATE(DATA_SEG_BITS, [Extra bits to be or'd in with any pointers
-stored in a Lisp_Object.])
-dnl if Emacs uses fewer than 32 bits for the value field of a LISP_OBJECT.
-
dnl Used in dispnew.c
AH_TEMPLATE(PENDING_OUTPUT_COUNT, [Number of chars of output in the
buffer of a stdio stream.])
+dnl FIXME just PENDING_OUTPUT_COUNT should suffice.
+AH_TEMPLATE(GNU_LIBRARY_PENDING_OUTPUT_COUNT, [Value of
+PENDING_OUTPUT_COUNT if using the GNU C library.])
+
case $opsys in
cygwin | darwin | freebsd | netbsd | openbsd )
AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->_p - (FILE)->_bf._base)])
@@ -3185,6 +3180,63 @@ case $opsys in
AC_DEFINE(PENDING_OUTPUT_COUNT(FILE), [((FILE)->__ptr - (FILE)->__base)])
;;
+ gnu | gnu-linux | gnu-kfreebsd )
+ AC_MSG_CHECKING([for style of pending output formalism])
+ dnl In autoconf 2.67 (?) and later, we could use a single test
+ dnl since the preprocessed output is accessible in "conftest.i".
+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+#if !defined (_IO_STDIO_H) && !defined (_STDIO_USES_IOSTREAM)
+# error "stdio definitions not found"
+#endif
+ ]], [[]])], emacs_pending_output=new, emacs_pending_output=unknown)
+
+ if test $emacs_pending_output = unknown; then
+ case $opsys in
+ gnu-linux | gnu-kfreebsd)
+ AC_PREPROC_IFELSE([AC_LANG_PROGRAM([[
+#include <stdio.h>
+#ifndef __UCLIBC__
+# error "not using uclibc"
+#endif
+ ]], [[]])], emacs_pending_output=uclibc, emacs_pending_output=old)
+ ;;
+ esac
+ fi
+
+ AC_MSG_RESULT([$emacs_pending_output])
+
+ case $emacs_pending_output in
+ new)
+ dnl New C libio names.
+ AC_DEFINE(GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE),
+ [((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)])
+ ;;
+ uclibc)
+ dnl Using the uClibc library.
+ AC_DEFINE(GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE),
+ [((FILE)->__bufpos - (FILE)->__bufstart)])
+ ;;
+ old)
+ dnl Old C++ iostream names.
+ AC_DEFINE(GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE),
+ [((FILE)->_pptr - (FILE)->_pbase)])
+ ;;
+ esac
+ ;;
+esac
+
+
+dnl Used in vm-limit.c
+AH_TEMPLATE(DATA_START, [Address of the start of the data segment.])
+dnl Used in lisp.h, emacs.c, mem-limits.h
+dnl NEWS.18 describes this as "a number which contains
+dnl the high bits to be inclusive or'ed with pointers that are unpacked."
+AH_TEMPLATE(DATA_SEG_BITS, [Extra bits to be or'd in with any pointers
+stored in a Lisp_Object.])
+dnl if Emacs uses fewer than 32 bits for the value field of a LISP_OBJECT.
+
+case $opsys in
gnu)
dnl libc defines data_start.
AC_DEFINE(DATA_START, [({ extern int data_start; (char *) &data_start; })])
diff --git a/src/ChangeLog b/src/ChangeLog
index 64a7989a70f..045a3d374b8 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,8 @@
+2012-07-11 Glenn Morris <rgm@gnu.org>
+
+ * s/gnu.h, s/gnu-linux.h:
+ Move GNU_LIBRARY_PENDING_OUTPUT_COUNT to configure.
+
2012-07-11 John Wiegley <johnw@newartisans.com>
* alloc.c (mark_memory): Guard the "no_address_safety_analysis"
diff --git a/src/s/gnu-linux.h b/src/s/gnu-linux.h
index 6f45ee00b78..9f8a994bb7e 100644
--- a/src/s/gnu-linux.h
+++ b/src/s/gnu-linux.h
@@ -92,25 +92,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
your system and must be used only through an encapsulation
(Which you should place, by convention, in sysdep.c). */
-/* This is needed for dispnew.c:update_frame. */
#ifdef emacs
-#include <stdio.h> /* Get the definition of _IO_STDIO_H. */
-#if defined (_IO_STDIO_H) || defined (_STDIO_USES_IOSTREAM)
-/* New C libio names. */
-#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
- ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
-#elif defined (__UCLIBC__)
-/* Using the uClibc library. */
-#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
- ((FILE)->__bufpos - (FILE)->__bufstart)
-#else /* !_IO_STDIO_H && ! __UCLIBC__ */
-/* Old C++ iostream names. */
-#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
- ((FILE)->_pptr - (FILE)->_pbase)
-#endif /* !_IO_STDIO_H && ! __UCLIBC__ */
-
#define INTERRUPT_INPUT
-#endif /* emacs */
+#endif
#define POSIX /* affects getpagesize.h and systty.h */
diff --git a/src/s/gnu.h b/src/s/gnu.h
index bac233266c8..9ec75081ca1 100644
--- a/src/s/gnu.h
+++ b/src/s/gnu.h
@@ -20,13 +20,3 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Get most of the stuff from bsd-common */
#include "bsd-common.h"
-
-/* It would be harmless to drop the ifdef emacs test. */
-#ifdef emacs
-#include <stdio.h> /* Get the definition of _IO_STDIO_H. */
-#if defined (_IO_STDIO_H) || defined (_STDIO_USES_IOSTREAM)
-/* new C libio names */
-#define GNU_LIBRARY_PENDING_OUTPUT_COUNT(FILE) \
- ((FILE)->_IO_write_ptr - (FILE)->_IO_write_base)
-#endif /* !_IO_STDIO_H */
-#endif /* emacs */