aboutsummaryrefslogtreecommitdiff
path: root/net/dante/patches/100-fix-autoconf-checkerrno.patch
blob: c44df1a6c0a6c2a546a7bb261d5464334c565994 (plain)
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
32
33
34
35
36
37
38
39
40
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -1106,6 +1106,8 @@ changequote([, ])dnl
 dnl test function that tries to determine if a specified errno error exists
 m4_define([checkerrno],
  [AC_MSG_CHECKING(for errno symbol $3)
+  saved_cppflags="$CPPFLAGS"
+  CPPFLAGS="$CPPFLAGS -P"
   AC_PREPROC_IFELSE(
        [AC_LANG_PROGRAM([[#include <errno.h>]],
                         [[
@@ -1117,7 +1119,8 @@ errnoval: $3
        [AC_MSG_RESULT([OK])
         $1="$$1 $3"
         cat conftest.i | grep errnoval: >>$2],
-       [AC_MSG_RESULT([no])])])
+       [AC_MSG_RESULT([no])])
+  CPPFLAGS="$saved_cppflags"])
 AC_DEFUN([L_CHECKERRNO],
  [checkerrno($@)])
 
@@ -1127,6 +1130,8 @@ dnl error exists
 dnl test function that tries to determine if a specified errno error exists
 m4_define([checkgaierror],
  [AC_MSG_CHECKING(for getaddrinfo() error $3)
+  saved_cppflags="$CPPFLAGS"
+  CPPFLAGS="$CPPFLAGS -P"
   AC_PREPROC_IFELSE(
        [AC_LANG_PROGRAM([[
 #include <sys/types.h>
@@ -1142,7 +1147,8 @@ gaierrval: $3
         $1="$$1 $3"
         AC_DEFINE(HAVE_ERR_$3, 1, [$3 gai error found])
         cat conftest.i | grep gaierrval: >>$2],
-       [AC_MSG_RESULT([no])])])
+       [AC_MSG_RESULT([no])])
+  CPPFLAGS="$saved_cppflags"])
 AC_DEFUN([L_CHECKGAIERROR],
  [checkgaierror($@)])