~ubuntu-branches/debian/experimental/lftp/experimental

« back to all changes in this revision

Viewing changes to m4/environ.m4

  • Committer: Package Import Robot
  • Author(s): Noël Köthe
  • Date: 2015-08-21 16:06:22 UTC
  • mfrom: (1.1.20) (24.1.38 sid)
  • Revision ID: package-import@ubuntu.com-20150821160622-lckdmbiqx16wefgy
Tags: 4.6.4-1
new upstream release 2015-08-21

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# environ.m4 serial 2
2
 
dnl Copyright (C) 2001-2004, 2006-2009 Free Software Foundation, Inc.
 
1
# environ.m4 serial 6
 
2
dnl Copyright (C) 2001-2004, 2006-2015 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.
6
6
 
7
 
AC_DEFUN([gl_ENVIRON],
 
7
AC_DEFUN_ONCE([gl_ENVIRON],
8
8
[
9
9
  AC_REQUIRE([gl_UNISTD_H_DEFAULTS])
10
10
  dnl Persuade glibc <unistd.h> to declare environ.
11
11
  AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
12
 
  gt_CHECK_VAR_DECL([#include <unistd.h>], environ)
 
12
 
 
13
  AC_CHECK_HEADERS_ONCE([unistd.h])
 
14
  gt_CHECK_VAR_DECL(
 
15
    [#if HAVE_UNISTD_H
 
16
     #include <unistd.h>
 
17
     #endif
 
18
     /* mingw, BeOS, Haiku declare environ in <stdlib.h>, not in <unistd.h>.  */
 
19
     #include <stdlib.h>
 
20
    ],
 
21
    [environ])
13
22
  if test $gt_cv_var_environ_declaration != yes; then
14
23
    HAVE_DECL_ENVIRON=0
15
24
  fi
22
31
  define([gt_cv_var], [gt_cv_var_]$2[_declaration])
23
32
  AC_MSG_CHECKING([if $2 is properly declared])
24
33
  AC_CACHE_VAL([gt_cv_var], [
25
 
    AC_TRY_COMPILE([$1
26
 
      extern struct { int foo; } $2;],
27
 
      [$2.foo = 1;],
28
 
      gt_cv_var=no,
29
 
      gt_cv_var=yes)])
 
34
    AC_COMPILE_IFELSE(
 
35
      [AC_LANG_PROGRAM(
 
36
         [[$1
 
37
           extern struct { int foo; } $2;]],
 
38
         [[$2.foo = 1;]])],
 
39
      [gt_cv_var=no],
 
40
      [gt_cv_var=yes])])
30
41
  AC_MSG_RESULT([$gt_cv_var])
31
42
  if test $gt_cv_var = yes; then
32
 
    AC_DEFINE([HAVE_]translit($2, [a-z], [A-Z])[_DECL], 1,
 
43
    AC_DEFINE([HAVE_]m4_translit($2, [a-z], [A-Z])[_DECL], 1,
33
44
              [Define if you have the declaration of $2.])
34
45
  fi
35
46
  undefine([gt_cv_var])