~drizzle-trunk/drizzle/development

« back to all changes in this revision

Viewing changes to m4/extensions.m4

  • Committer: Brian Aker
  • Date: 2009-02-02 23:10:18 UTC
  • mfrom: (779.3.40 devel)
  • Revision ID: brian@tangent.org-20090202231018-zlp0hka6kgwy1vfy
Merge from Monty

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
dnl Provide AC_USE_SYSTEM_EXTENSIONS for old autoconf machines.
2
 
AC_DEFUN([ACX_USE_SYSTEM_EXTENSIONS],[
3
 
  ifdef([AC_USE_SYSTEM_EXTENSIONS],[
4
 
    AC_USE_SYSTEM_EXTENSIONS
5
 
  ],[
6
 
    AC_BEFORE([$0], [AC_COMPILE_IFELSE])
7
 
    AC_BEFORE([$0], [AC_RUN_IFELSE])
8
 
 
9
 
    AC_REQUIRE([AC_GNU_SOURCE])
10
 
    AC_REQUIRE([AC_AIX])
11
 
    AC_REQUIRE([AC_MINIX])
12
 
 
13
 
    AH_VERBATIM([__EXTENSIONS__],
14
 
[/* Enable extensions on Solaris.  */
15
 
#ifndef __EXTENSIONS__
16
 
# undef __EXTENSIONS__
17
 
#endif
 
1
# serial 5  -*- Autoconf -*-
 
2
# Enable extensions on systems that normally disable them.
 
3
 
 
4
# Copyright (C) 2003, 2006-2008 Free Software Foundation, Inc.
 
5
# This file is free software; the Free Software Foundation
 
6
# gives unlimited permission to copy and/or distribute it,
 
7
# with or without modifications, as long as this notice is preserved.
 
8
 
 
9
# This definition of AC_USE_SYSTEM_EXTENSIONS is stolen from CVS
 
10
# Autoconf.  Perhaps we can remove this once we can assume Autoconf
 
11
# 2.62 or later everywhere, but since CVS Autoconf mutates rapidly
 
12
# enough in this area it's likely we'll need to redefine
 
13
# AC_USE_SYSTEM_EXTENSIONS for quite some time.
 
14
 
 
15
# AC_USE_SYSTEM_EXTENSIONS
 
16
# ------------------------
 
17
# Enable extensions on systems that normally disable them,
 
18
# typically due to standards-conformance issues.
 
19
# Remember that #undef in AH_VERBATIM gets replaced with #define by
 
20
# AC_DEFINE.  The goal here is to define all known feature-enabling
 
21
# macros, then, if reports of conflicts are made, disable macros that
 
22
# cause problems on some platforms (such as __EXTENSIONS__).
 
23
AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
 
24
[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
 
25
AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
 
26
 
 
27
  AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
 
28
  if test "$MINIX" = yes; then
 
29
    AC_DEFINE([_POSIX_SOURCE], [1],
 
30
      [Define to 1 if you need to in order for `stat' and other
 
31
       things to work.])
 
32
    AC_DEFINE([_POSIX_1_SOURCE], [2],
 
33
      [Define to 2 if the system does not provide POSIX.1 features
 
34
       except with this defined.])
 
35
    AC_DEFINE([_MINIX], [1],
 
36
      [Define to 1 if on MINIX.])
 
37
  fi
 
38
 
 
39
  AH_VERBATIM([__EXTENSIONS__],
 
40
[/* Enable extensions on AIX 3, Interix.  */
 
41
#ifndef _ALL_SOURCE
 
42
# undef _ALL_SOURCE
 
43
#endif
 
44
/* Enable GNU extensions on systems that have them.  */
 
45
#ifndef _GNU_SOURCE
 
46
# undef _GNU_SOURCE
 
47
#endif
 
48
/* Enable threading extensions on Solaris.  */
18
49
#ifndef _POSIX_PTHREAD_SEMANTICS
19
50
# undef _POSIX_PTHREAD_SEMANTICS
20
51
#endif
 
52
/* Enable extensions on HP NonStop.  */
21
53
#ifndef _TANDEM_SOURCE
22
54
# undef _TANDEM_SOURCE
23
 
#endif])
24
 
    AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
25
 
      [ac_cv_safe_to_define___extensions__],
26
 
      [AC_COMPILE_IFELSE(
27
 
         [AC_LANG_PROGRAM([
28
 
#           define __EXTENSIONS__ 1
29
 
            AC_INCLUDES_DEFAULT])],
30
 
         [ac_cv_safe_to_define___extensions__=yes],
31
 
         [ac_cv_safe_to_define___extensions__=no])])
32
 
    test $ac_cv_safe_to_define___extensions__ = yes &&
33
 
      AC_DEFINE([__EXTENSIONS__])
34
 
    AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
35
 
    AC_DEFINE([_TANDEM_SOURCE])
36
 
  ])
 
55
#endif
 
56
/* Enable general extensions on Solaris.  */
 
57
#ifndef __EXTENSIONS__
 
58
# undef __EXTENSIONS__
 
59
#endif
37
60
])
 
61
  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
 
62
    [ac_cv_safe_to_define___extensions__],
 
63
    [AC_COMPILE_IFELSE(
 
64
       [AC_LANG_PROGRAM([[
 
65
#         define __EXTENSIONS__ 1
 
66
          ]AC_INCLUDES_DEFAULT])],
 
67
       [ac_cv_safe_to_define___extensions__=yes],
 
68
       [ac_cv_safe_to_define___extensions__=no])])
 
69
  test $ac_cv_safe_to_define___extensions__ = yes &&
 
70
    AC_DEFINE([__EXTENSIONS__])
 
71
  AC_DEFINE([_ALL_SOURCE])
 
72
  AC_DEFINE([_GNU_SOURCE])
 
73
  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
 
74
  AC_DEFINE([_TANDEM_SOURCE])
 
75
])# AC_USE_SYSTEM_EXTENSIONS
 
76
 
 
77
# gl_USE_SYSTEM_EXTENSIONS
 
78
# ------------------------
 
79
# Enable extensions on systems that normally disable them,
 
80
# typically due to standards-conformance issues.
 
81
AC_DEFUN([gl_USE_SYSTEM_EXTENSIONS],
 
82
  [AC_REQUIRE([AC_USE_SYSTEM_EXTENSIONS])])