~ubuntu-branches/ubuntu/quantal/gnutls26/quantal-security

« back to all changes in this revision

Viewing changes to lib/gl/m4/lseek.m4

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2011-05-20 13:07:18 UTC
  • mfrom: (12.1.11 sid)
  • Revision ID: james.westby@ubuntu.com-20110520130718-db41dybbanzfvlji
Tags: 2.10.5-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Fix build failure with --no-add-needed.
  - Build for multiarch.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# lseek.m4 serial 4
2
 
dnl Copyright (C) 2007 Free Software Foundation, Inc.
 
1
# lseek.m4 serial 5
 
2
dnl Copyright (C) 2007, 2009, 2010 Free Software Foundation, Inc.
3
3
dnl This file is free software; the Free Software Foundation
4
4
dnl gives unlimited permission to copy and/or distribute it,
5
5
dnl with or without modifications, as long as this notice is preserved.
19
19
  /* Exit with success only if stdin is seekable.  */
20
20
  return lseek (0, (off_t)0, SEEK_CUR) < 0;
21
21
}],
22
 
         [if test -s conftest$ac_exeext \
23
 
             && ./conftest$ac_exeext < conftest.$ac_ext \
24
 
             && { echo hi | ./conftest$ac_exeext; test $? = 1; }; then
25
 
            gl_cv_func_lseek_pipe=yes
26
 
          else
27
 
            gl_cv_func_lseek_pipe=no
28
 
          fi],
29
 
         [gl_cv_func_lseek_pipe=no])
 
22
         [if test -s conftest$ac_exeext \
 
23
             && ./conftest$ac_exeext < conftest.$ac_ext \
 
24
             && test 1 = "`echo hi \
 
25
               | { ./conftest$ac_exeext; echo $?; cat >/dev/null; }`"; then
 
26
            gl_cv_func_lseek_pipe=yes
 
27
          else
 
28
            gl_cv_func_lseek_pipe=no
 
29
          fi],
 
30
         [gl_cv_func_lseek_pipe=no])
30
31
     else
31
32
       AC_COMPILE_IFELSE([
32
33
#if ((defined _WIN32 || defined __WIN32__) && ! defined __CYGWIN__) || defined __BEOS__
33
34
/* mingw and BeOS mistakenly return 0 when trying to seek on pipes.  */
34
35
  Choke me.
35
36
#endif],
36
 
         [gl_cv_func_lseek_pipe=yes], [gl_cv_func_lseek_pipe=no])
 
37
         [gl_cv_func_lseek_pipe=yes], [gl_cv_func_lseek_pipe=no])
37
38
     fi])
38
39
  if test $gl_cv_func_lseek_pipe = no; then
39
40
    gl_REPLACE_LSEEK
46
47
  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
47
48
  REPLACE_LSEEK=1
48
49
  AC_DEFINE([LSEEK_PIPE_BROKEN], [1],
49
 
            [Define to 1 if lseek does not detect pipes.])
 
50
            [Define to 1 if lseek does not detect pipes.])
50
51
])