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

« back to all changes in this revision

Viewing changes to src/m4/eloop.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_ELOOP],
14
 
[AC_REQUIRE([AC_PROG_CC])dnl
15
 
AC_CACHE_CHECK(for ELOOP, cl_cv_decl_eloop, [
16
 
if test $cross_compiling = no; then
17
 
cat > conftest.c <<EOF
18
 
#include "confdefs.h"
19
 
#include <stdlib.h>
20
 
#ifdef HAVE_UNISTD_H
21
 
#include <unistd.h>
22
 
#endif
23
 
#include <errno.h>
24
 
#include <stdio.h>
25
 
#ifdef ELOOP
26
 
int main () { printf("ELOOP\n"); exit(0); }
27
 
#else
28
 
extern int errno;
29
 
#define foo "conflink"
30
 
#define foobar "conflink/somefile"
31
 
int main()
32
 
{ /* If a system goes into an endless loop on this, it must be really broken. */
33
 
  if (symlink(foo,foo)<0) exit(1);
34
 
  if (unlink(foobar)>=0) { unlink(foo); exit(1); }
35
 
  printf("%d\n",errno); unlink(foo); exit(0);
36
 
}
37
 
#endif
38
 
EOF
39
 
AC_TRY_EVAL(ac_link)
40
 
 if test -x conftest; then
41
 
  cl_cv_decl_ELOOP=`./conftest`
42
 
  if test "$cl_cv_decl_ELOOP" = "ELOOP"; then
43
 
    cl_cv_decl_eloop=yes
44
 
  else
45
 
    cl_cv_decl_eloop="$cl_cv_decl_ELOOP"
46
 
  fi
47
 
 else cl_cv_decl_eloop=no
48
 
     cl_cv_decl_ELOOP="ELOOP"
49
 
 fi
50
 
else
51
 
AC_EGREP_CPP(yes,[
52
 
#include <stdlib.h>
53
 
#ifdef HAVE_UNISTD_H
54
 
#include <unistd.h>
55
 
#endif
56
 
#include <errno.h>
57
 
#include <stdio.h>
58
 
#ifdef ELOOP
59
 
yes
60
 
#endif
61
 
],
62
 
cl_cv_decl_eloop=yes,
63
 
cl_cv_decl_eloop=no)
64
 
cl_cv_decl_ELOOP="ELOOP"
65
 
fi
66
 
rm -f conftest*
67
 
])
68
 
AC_DEFINE_UNQUOTED(ELOOP_VALUE,$cl_cv_decl_ELOOP,[the real value of ELOOP even if it is hidden in <errno.h>])
69
 
])