~ubuntu-branches/ubuntu/utopic/gettext/utopic

« back to all changes in this revision

Viewing changes to gettext-tools/gnulib-m4/stdarg.m4

  • Committer: Colin Watson
  • Date: 2010-08-01 21:36:08 UTC
  • mfrom: (2.1.10 sid)
  • Revision ID: cjwatson@canonical.com-20100801213608-yy7vkm8lpatep3ci
merge from Debian 0.18.1.1-1

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# stdarg.m4 serial 1
2
 
dnl Copyright (C) 2006 Free Software Foundation, Inc.
 
1
# stdarg.m4 serial 3
 
2
dnl Copyright (C) 2006, 2008-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.
9
9
 
10
10
AC_DEFUN([gl_STDARG_H],
11
11
[
 
12
  STDARG_H='';                AC_SUBST([STDARG_H])
 
13
  NEXT_STDARG_H='<stdarg.h>'; AC_SUBST([NEXT_STDARG_H])
12
14
  AC_MSG_CHECKING([for va_copy])
13
15
  AC_CACHE_VAL([gl_cv_func_va_copy], [
14
16
    AC_TRY_COMPILE([#include <stdarg.h>], [
19
21
      [gl_cv_func_va_copy=yes], [gl_cv_func_va_copy=no])])
20
22
  AC_MSG_RESULT([$gl_cv_func_va_copy])
21
23
  if test $gl_cv_func_va_copy = no; then
22
 
    # Provide a substitute, either __va_copy or as a simple assignment.
23
 
    AC_CACHE_VAL([gl_cv_func___va_copy], [
24
 
      AC_TRY_COMPILE([#include <stdarg.h>], [
 
24
    dnl Provide a substitute.
 
25
    dnl Usually a simple definition in <config.h> is enough. Not so on AIX 5
 
26
    dnl with some versions of the /usr/vac/bin/cc compiler. It has an <stdarg.h>
 
27
    dnl which does '#undef va_copy', leading to a missing va_copy symbol. For
 
28
    dnl this platform, we use an <stdarg.h> substitute. But we cannot use this
 
29
    dnl approach on other platforms, because <stdarg.h> often defines only
 
30
    dnl preprocessor macros and gl_ABSOLUTE_HEADER, gl_CHECK_NEXT_HEADERS do
 
31
    dnl not work in this situation.
 
32
    AC_EGREP_CPP([vaccine],
 
33
      [#if defined _AIX && !defined __GNUC__
 
34
        AIX vaccine
 
35
       #endif
 
36
      ], [gl_aixcc=yes], [gl_aixcc=no])
 
37
    if test $gl_aixcc = yes; then
 
38
      dnl Provide a substitute <stdarg.h> file.
 
39
      STDARG_H=stdarg.h
 
40
      gl_CHECK_NEXT_HEADERS([stdarg.h])
 
41
      dnl Fallback for the case when <stdarg.h> contains only macro definitions.
 
42
      if test "$gl_cv_next_stdarg_h" = '""'; then
 
43
        gl_cv_next_stdarg_h='"///usr/include/stdarg.h"'
 
44
        NEXT_STDARG_H="$gl_cv_next_stdarg_h"
 
45
      fi
 
46
    else
 
47
      dnl Provide a substitute in <config.h>, either __va_copy or as a simple
 
48
      dnl assignment.
 
49
      gl_CACHE_VAL_SILENT([gl_cv_func___va_copy], [
 
50
        AC_TRY_COMPILE([#include <stdarg.h>], [
25
51
#ifndef __va_copy
26
52
error, bail out
27
53
#endif
28
54
],
29
 
        [gl_cv_func___va_copy=yes], [gl_cv_func___va_copy=no])])
30
 
    if test $gl_cv_func___va_copy = yes; then
31
 
      AC_DEFINE([va_copy], [__va_copy],
32
 
        [Define as a macro for copying va_list variables.])
33
 
    else
34
 
      AH_VERBATIM([gl_VA_COPY], [/* A replacement for va_copy, if needed.  */
 
55
          [gl_cv_func___va_copy=yes], [gl_cv_func___va_copy=no])])
 
56
      if test $gl_cv_func___va_copy = yes; then
 
57
        AC_DEFINE([va_copy], [__va_copy],
 
58
          [Define as a macro for copying va_list variables.])
 
59
      else
 
60
        AH_VERBATIM([gl_VA_COPY], [/* A replacement for va_copy, if needed.  */
35
61
#define gl_va_copy(a,b) ((a) = (b))])
36
 
      AC_DEFINE([va_copy], [gl_va_copy],
37
 
        [Define as a macro for copying va_list variables.])
 
62
        AC_DEFINE([va_copy], [gl_va_copy],
 
63
          [Define as a macro for copying va_list variables.])
 
64
      fi
38
65
    fi
39
66
  fi
40
67
])