File: ac_cf_gnu_source.m4

package info (click to toggle)
spamass-milter 0.4.0-1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 960 kB
  • ctags: 485
  • sloc: sh: 3,783; cpp: 1,740; awk: 312; ansic: 134; makefile: 60
file content (31 lines) | stat: -rw-r--r-- 1,073 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
dnl BEGIN CF_GNU_SOURCE from lynx 2.8.5 distibution
dnl $Id: ac_cf_gnu_source.m4,v 1.1 2003/06/07 02:56:50 dnelson Exp $
dnl ---------------------------------------------------------------------------
dnl Check if we must define _GNU_SOURCE to get a reasonable value for
dnl _XOPEN_SOURCE, upon which many POSIX definitions depend.  This is a defect
dnl (or misfeature) of glibc2, which breaks portability of many applications,
dnl since it is interwoven with GNU extensions.
dnl
dnl Well, yes we could work around it...
AC_DEFUN([CF_GNU_SOURCE],
[
AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[
AC_TRY_COMPILE([#include <sys/types.h>],[
#ifndef _XOPEN_SOURCE
make an error
#endif],
	[cf_cv_gnu_source=no],
	[cf_save="$CPPFLAGS"
	 CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
	 AC_TRY_COMPILE([#include <sys/types.h>],[
#ifdef _XOPEN_SOURCE
make an error
#endif],
	[cf_cv_gnu_source=no],
	[cf_cv_gnu_source=yes])
	CPPFLAGS="$cf_save"
	])
])
test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE"
])dnl
dnl END CF_GNU_SOURCE from lynx 2.8.5 distibution