~ubuntu-branches/debian/squeeze/ffcall/squeeze

« back to all changes in this revision

Viewing changes to ffcall/m4/openflags.m4

  • Committer: Bazaar Package Importer
  • Author(s): Christoph Egger
  • Date: 2010-06-26 15:29:30 UTC
  • mfrom: (5.1.1 experimental)
  • Revision ID: james.westby@ubuntu.com-20100626152930-c09y01gk3szcnykn
Tags: 1.10+cvs20100619-2
Ship to unstable

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl -*- Autoconf -*-
2
 
dnl Copyright (C) 1993-2003 Free Software Foundation, Inc.
3
 
dnl This file is free software, distributed under the terms of the GNU
4
 
dnl General Public License.  As a special exception to the GNU General
5
 
dnl Public License, this file may be distributed as part of a program
6
 
dnl that contains a configuration script generated by Autoconf, under
7
 
dnl the same distribution terms as the rest of that program.
8
 
 
9
 
dnl From Bruno Haible, Marcus Daniels, Sam Steingold.
10
 
 
11
 
AC_PREREQ(2.57)
12
 
 
13
 
AC_DEFUN([CL_OPENFLAGS],
14
 
dnl BSD systems require #include <sys/file.h> for O_RDWR etc. being defined.
15
 
[AC_BEFORE([$0], [CL_MMAP])
16
 
AC_CHECK_HEADERS(sys/file.h)
17
 
if test $ac_cv_header_sys_file_h = yes; then
18
 
openflags_decl='
19
 
#include <stdlib.h>
20
 
#ifdef HAVE_UNISTD_H
21
 
#include <sys/types.h>
22
 
#include <unistd.h>
23
 
#endif
24
 
#include <fcntl.h>
25
 
'
26
 
openflags_prog='int x = O_RDWR | O_RDONLY | O_WRONLY | O_CREAT | O_TRUNC;'
27
 
CL_COMPILE_CHECK([O_RDWR in fcntl.h], cl_cv_decl_O_RDWR_fcntl_h,
28
 
$openflags_decl, $openflags_prog, openflags_ok=1)dnl
29
 
if test -z "$openflags_ok"; then
30
 
dnl CL_COMPILE_CHECK([O_RDWR in sys/file.h], cl_cv_decl_O_RDWR_sys_file_h,
31
 
dnl $openflags_decl[#include <sys/file.h>], $openflags_prog,
32
 
AC_DEFINE(OPEN_NEEDS_SYS_FILE_H,,[need <sys/file.h> for using open() flags like O_RDWR])
33
 
dnl openflags_ok=1)dnl
34
 
fi
35
 
fi
36
 
])