Merge from vendor branch TNF:
[pkgsrc.git] / security / libassuan / patches / patch-ac
1 $NetBSD$
2
3 --- aclocal.m4.orig     2008-09-06 22:03:58.000000000 -0400
4 +++ aclocal.m4
5 @@ -940,3 +940,66 @@ m4_include([m4/gnupg-pth.m4])
6  m4_include([m4/onceonly.m4])
7  m4_include([m4/socklen.m4])
8  m4_include([m4/sys_socket_h.m4])
9 +
10 +# AC_USE_SYSTEM_EXTENSIONS
11 +# ------------------------
12 +# Enable extensions on systems that normally disable them,
13 +# typically due to standards-conformance issues.
14 +#
15 +# Remember that #undef in AH_VERBATIM gets replaced with #define by
16 +# AC_DEFINE.  The goal here is to define all known feature-enabling
17 +# macros, then, if reports of conflicts are made, disable macros that
18 +# cause problems on some platforms (such as __EXTENSIONS__).
19 +AC_DEFUN([AC_USE_SYSTEM_EXTENSIONS],
20 +[AC_BEFORE([$0], [AC_COMPILE_IFELSE])dnl
21 +AC_BEFORE([$0], [AC_RUN_IFELSE])dnl
22 +
23 +  AC_CHECK_HEADER([minix/config.h], [MINIX=yes], [MINIX=])
24 +  if test "$MINIX" = yes; then
25 +    AC_DEFINE([_POSIX_SOURCE], [1],
26 +      [Define to 1 if you need to in order for `stat' and other
27 +       things to work.])
28 +    AC_DEFINE([_POSIX_1_SOURCE], [2],
29 +      [Define to 2 if the system does not provide POSIX.1 features
30 +       except with this defined.])
31 +    AC_DEFINE([_MINIX], [1],
32 +      [Define to 1 if on MINIX.])
33 +  fi
34 +
35 +  AH_VERBATIM([__EXTENSIONS__],
36 +[/* Enable extensions on AIX 3, Interix.  */
37 +#ifndef _ALL_SOURCE
38 +# undef _ALL_SOURCE
39 +#endif
40 +/* Enable GNU extensions on systems that have them.  */
41 +#ifndef _GNU_SOURCE
42 +# undef _GNU_SOURCE
43 +#endif
44 +/* Enable threading extensions on Solaris.  */
45 +#ifndef _POSIX_PTHREAD_SEMANTICS
46 +# undef _POSIX_PTHREAD_SEMANTICS
47 +#endif
48 +/* Enable extensions on HP NonStop.  */
49 +#ifndef _TANDEM_SOURCE
50 +# undef _TANDEM_SOURCE
51 +#endif
52 +/* Enable general extensions on Solaris.  */
53 +#ifndef __EXTENSIONS__
54 +# undef __EXTENSIONS__
55 +#endif
56 +])
57 +  AC_CACHE_CHECK([whether it is safe to define __EXTENSIONS__],
58 +    [ac_cv_safe_to_define___extensions__],
59 +    [AC_COMPILE_IFELSE(
60 +       [AC_LANG_PROGRAM([
61 +#        define __EXTENSIONS__ 1
62 +         AC_INCLUDES_DEFAULT])],
63 +       [ac_cv_safe_to_define___extensions__=yes],
64 +       [ac_cv_safe_to_define___extensions__=no])])
65 +  test $ac_cv_safe_to_define___extensions__ = yes &&
66 +    AC_DEFINE([__EXTENSIONS__])
67 +  AC_DEFINE([_ALL_SOURCE])
68 +  AC_DEFINE([_GNU_SOURCE])
69 +  AC_DEFINE([_POSIX_PTHREAD_SEMANTICS])
70 +  AC_DEFINE([_TANDEM_SOURCE])
71 +])# AC_USE_SYSTEM_EXTENSIONS