diff options
| author | Eli Zaretskii | 2012-11-13 16:17:18 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2012-11-13 16:17:18 +0200 |
| commit | 3c4ca7155293ffc2d04708007131bcbc882d8913 (patch) | |
| tree | 61787be8cd43b6fb3d5159852fbd186eea404de7 /m4 | |
| parent | 5ade42a5114255c43117065494b96d480c1e1588 (diff) | |
| parent | c708524567662c8911c5ab2695acc7bda0383705 (diff) | |
| download | emacs-3c4ca7155293ffc2d04708007131bcbc882d8913.tar.gz emacs-3c4ca7155293ffc2d04708007131bcbc882d8913.zip | |
Merge from trunk.
Diffstat (limited to 'm4')
| -rw-r--r-- | m4/close-stream.m4 | 11 | ||||
| -rw-r--r-- | m4/fpending.m4 | 90 | ||||
| -rw-r--r-- | m4/gnulib-comp.m4 | 15 |
3 files changed, 116 insertions, 0 deletions
diff --git a/m4/close-stream.m4 b/m4/close-stream.m4 new file mode 100644 index 00000000000..be0c8a22979 --- /dev/null +++ b/m4/close-stream.m4 | |||
| @@ -0,0 +1,11 @@ | |||
| 1 | #serial 4 | ||
| 2 | dnl Copyright (C) 2006-2007, 2009-2012 Free Software Foundation, Inc. | ||
| 3 | dnl This file is free software; the Free Software Foundation | ||
| 4 | dnl gives unlimited permission to copy and/or distribute it, | ||
| 5 | dnl with or without modifications, as long as this notice is preserved. | ||
| 6 | |||
| 7 | dnl Prerequisites of lib/close-stream.c. | ||
| 8 | AC_DEFUN([gl_CLOSE_STREAM], | ||
| 9 | [ | ||
| 10 | : | ||
| 11 | ]) | ||
diff --git a/m4/fpending.m4 b/m4/fpending.m4 new file mode 100644 index 00000000000..33a5c94c3a3 --- /dev/null +++ b/m4/fpending.m4 | |||
| @@ -0,0 +1,90 @@ | |||
| 1 | # serial 19 | ||
| 2 | |||
| 3 | # Copyright (C) 2000-2001, 2004-2012 Free Software Foundation, Inc. | ||
| 4 | # This file is free software; the Free Software Foundation | ||
| 5 | # gives unlimited permission to copy and/or distribute it, | ||
| 6 | # with or without modifications, as long as this notice is preserved. | ||
| 7 | |||
| 8 | dnl From Jim Meyering | ||
| 9 | dnl Using code from emacs, based on suggestions from Paul Eggert | ||
| 10 | dnl and Ulrich Drepper. | ||
| 11 | |||
| 12 | dnl Find out how to determine the number of pending output bytes on a stream. | ||
| 13 | dnl glibc (2.1.93 and newer) and Solaris provide __fpending. On other systems, | ||
| 14 | dnl we have to grub around in the FILE struct. | ||
| 15 | |||
| 16 | AC_DEFUN([gl_FUNC_FPENDING], | ||
| 17 | [ | ||
| 18 | AC_CHECK_HEADERS_ONCE([stdio_ext.h]) | ||
| 19 | AC_CHECK_FUNCS_ONCE([__fpending]) | ||
| 20 | fp_headers=' | ||
| 21 | # include <stdio.h> | ||
| 22 | # if HAVE_STDIO_EXT_H | ||
| 23 | # include <stdio_ext.h> | ||
| 24 | # endif | ||
| 25 | ' | ||
| 26 | AC_CHECK_DECLS([__fpending], , , $fp_headers) | ||
| 27 | ]) | ||
| 28 | |||
| 29 | AC_DEFUN([gl_PREREQ_FPENDING], | ||
| 30 | [ | ||
| 31 | AC_CACHE_CHECK( | ||
| 32 | [how to determine the number of pending output bytes on a stream], | ||
| 33 | ac_cv_sys_pending_output_n_bytes, | ||
| 34 | [ | ||
| 35 | for ac_expr in \ | ||
| 36 | \ | ||
| 37 | '# glibc2' \ | ||
| 38 | 'fp->_IO_write_ptr - fp->_IO_write_base' \ | ||
| 39 | \ | ||
| 40 | '# traditional Unix' \ | ||
| 41 | 'fp->_ptr - fp->_base' \ | ||
| 42 | \ | ||
| 43 | '# BSD' \ | ||
| 44 | 'fp->_p - fp->_bf._base' \ | ||
| 45 | \ | ||
| 46 | '# SCO, Unixware' \ | ||
| 47 | '(fp->__ptr ? fp->__ptr - fp->__base : 0)' \ | ||
| 48 | \ | ||
| 49 | '# QNX' \ | ||
| 50 | '(fp->_Mode & 0x2000 /*_MWRITE*/ ? fp->_Next - fp->_Buf : 0)' \ | ||
| 51 | \ | ||
| 52 | '# old glibc?' \ | ||
| 53 | 'fp->__bufp - fp->__buffer' \ | ||
| 54 | \ | ||
| 55 | '# old glibc iostream?' \ | ||
| 56 | 'fp->_pptr - fp->_pbase' \ | ||
| 57 | \ | ||
| 58 | '# emx+gcc' \ | ||
| 59 | 'fp->_ptr - fp->_buffer' \ | ||
| 60 | \ | ||
| 61 | '# Minix' \ | ||
| 62 | 'fp->_ptr - fp->_buf' \ | ||
| 63 | \ | ||
| 64 | '# Plan9' \ | ||
| 65 | 'fp->wp - fp->buf' \ | ||
| 66 | \ | ||
| 67 | '# VMS' \ | ||
| 68 | '(*fp)->_ptr - (*fp)->_base' \ | ||
| 69 | \ | ||
| 70 | '# e.g., DGUX R4.11; the info is not available' \ | ||
| 71 | 1 \ | ||
| 72 | ; do | ||
| 73 | |||
| 74 | # Skip each embedded comment. | ||
| 75 | case "$ac_expr" in '#'*) continue;; esac | ||
| 76 | |||
| 77 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stdio.h>]], | ||
| 78 | [[FILE *fp = stdin; (void) ($ac_expr);]])], | ||
| 79 | [fp_done=yes] | ||
| 80 | ) | ||
| 81 | test "$fp_done" = yes && break | ||
| 82 | done | ||
| 83 | |||
| 84 | ac_cv_sys_pending_output_n_bytes=$ac_expr | ||
| 85 | ] | ||
| 86 | ) | ||
| 87 | AC_DEFINE_UNQUOTED([PENDING_OUTPUT_N_BYTES], | ||
| 88 | $ac_cv_sys_pending_output_n_bytes, | ||
| 89 | [the number of pending output bytes on stream 'fp']) | ||
| 90 | ]) | ||
diff --git a/m4/gnulib-comp.m4 b/m4/gnulib-comp.m4 index de2355d87c3..5cd278454e7 100644 --- a/m4/gnulib-comp.m4 +++ b/m4/gnulib-comp.m4 | |||
| @@ -44,6 +44,7 @@ AC_DEFUN([gl_EARLY], | |||
| 44 | # Code from module c-strcase: | 44 | # Code from module c-strcase: |
| 45 | # Code from module careadlinkat: | 45 | # Code from module careadlinkat: |
| 46 | # Code from module clock-time: | 46 | # Code from module clock-time: |
| 47 | # Code from module close-stream: | ||
| 47 | # Code from module crypto/md5: | 48 | # Code from module crypto/md5: |
| 48 | # Code from module crypto/sha1: | 49 | # Code from module crypto/sha1: |
| 49 | # Code from module crypto/sha256: | 50 | # Code from module crypto/sha256: |
| @@ -58,6 +59,7 @@ AC_DEFUN([gl_EARLY], | |||
| 58 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) | 59 | AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS]) |
| 59 | # Code from module extern-inline: | 60 | # Code from module extern-inline: |
| 60 | # Code from module filemode: | 61 | # Code from module filemode: |
| 62 | # Code from module fpending: | ||
| 61 | # Code from module getloadavg: | 63 | # Code from module getloadavg: |
| 62 | # Code from module getopt-gnu: | 64 | # Code from module getopt-gnu: |
| 63 | # Code from module getopt-posix: | 65 | # Code from module getopt-posix: |
| @@ -141,6 +143,8 @@ AC_DEFUN([gl_INIT], | |||
| 141 | gl_FUNC_ALLOCA | 143 | gl_FUNC_ALLOCA |
| 142 | AC_CHECK_FUNCS_ONCE([readlinkat]) | 144 | AC_CHECK_FUNCS_ONCE([readlinkat]) |
| 143 | gl_CLOCK_TIME | 145 | gl_CLOCK_TIME |
| 146 | gl_CLOSE_STREAM | ||
| 147 | gl_MODULE_INDICATOR([close-stream]) | ||
| 144 | gl_MD5 | 148 | gl_MD5 |
| 145 | gl_SHA1 | 149 | gl_SHA1 |
| 146 | gl_SHA256 | 150 | gl_SHA256 |
| @@ -157,6 +161,11 @@ AC_DEFUN([gl_INIT], | |||
| 157 | gl_EXECINFO_H | 161 | gl_EXECINFO_H |
| 158 | AC_REQUIRE([gl_EXTERN_INLINE]) | 162 | AC_REQUIRE([gl_EXTERN_INLINE]) |
| 159 | gl_FILEMODE | 163 | gl_FILEMODE |
| 164 | gl_FUNC_FPENDING | ||
| 165 | if test $ac_cv_func___fpending = no; then | ||
| 166 | AC_LIBOBJ([fpending]) | ||
| 167 | gl_PREREQ_FPENDING | ||
| 168 | fi | ||
| 160 | gl_GETLOADAVG | 169 | gl_GETLOADAVG |
| 161 | if test $HAVE_GETLOADAVG = 0; then | 170 | if test $HAVE_GETLOADAVG = 0; then |
| 162 | AC_LIBOBJ([getloadavg]) | 171 | AC_LIBOBJ([getloadavg]) |
| @@ -534,6 +543,8 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 534 | lib/c-strncasecmp.c | 543 | lib/c-strncasecmp.c |
| 535 | lib/careadlinkat.c | 544 | lib/careadlinkat.c |
| 536 | lib/careadlinkat.h | 545 | lib/careadlinkat.h |
| 546 | lib/close-stream.c | ||
| 547 | lib/close-stream.h | ||
| 537 | lib/dosname.h | 548 | lib/dosname.h |
| 538 | lib/dtoastr.c | 549 | lib/dtoastr.c |
| 539 | lib/dtotimespec.c | 550 | lib/dtotimespec.c |
| @@ -542,6 +553,8 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 542 | lib/execinfo.in.h | 553 | lib/execinfo.in.h |
| 543 | lib/filemode.c | 554 | lib/filemode.c |
| 544 | lib/filemode.h | 555 | lib/filemode.h |
| 556 | lib/fpending.c | ||
| 557 | lib/fpending.h | ||
| 545 | lib/ftoastr.c | 558 | lib/ftoastr.c |
| 546 | lib/ftoastr.h | 559 | lib/ftoastr.h |
| 547 | lib/getloadavg.c | 560 | lib/getloadavg.c |
| @@ -609,12 +622,14 @@ AC_DEFUN([gl_FILE_LIST], [ | |||
| 609 | m4/alloca.m4 | 622 | m4/alloca.m4 |
| 610 | m4/c-strtod.m4 | 623 | m4/c-strtod.m4 |
| 611 | m4/clock_time.m4 | 624 | m4/clock_time.m4 |
| 625 | m4/close-stream.m4 | ||
| 612 | m4/dup2.m4 | 626 | m4/dup2.m4 |
| 613 | m4/environ.m4 | 627 | m4/environ.m4 |
| 614 | m4/execinfo.m4 | 628 | m4/execinfo.m4 |
| 615 | m4/extensions.m4 | 629 | m4/extensions.m4 |
| 616 | m4/extern-inline.m4 | 630 | m4/extern-inline.m4 |
| 617 | m4/filemode.m4 | 631 | m4/filemode.m4 |
| 632 | m4/fpending.m4 | ||
| 618 | m4/getloadavg.m4 | 633 | m4/getloadavg.m4 |
| 619 | m4/getopt.m4 | 634 | m4/getopt.m4 |
| 620 | m4/gettime.m4 | 635 | m4/gettime.m4 |