summaryrefslogtreecommitdiff
blob: 62d26ccc053cb2a48196bca3c0cb039a8e1a737e (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
Don't define deprecated glibc symbol

Avoid defining the deprecated symbols _BSD_SOURCE and _SVID_SOURCE
that xmkmf thinks are needed to compile X programs.

diff -r 09d56098ea2c -r 32a8151f8af7 configure.in
--- a/configure.in	Sat Feb 11 01:24:06 2017 +0100
+++ b/configure.in	Sat Feb 11 01:59:40 2017 +0100
@@ -2868,10 +2868,15 @@
 	  *     ) val=1 ;;
 	esac
 dnl Avoid re-AC_DEFINE-ing xmkmf symbols we've already defined above.
-	if grep "^#define $sym " confdefs.h >/dev/null; then :; else
-	  if test "$val" = "1"
-	    then AC_DEFINE_UNQUOTED($sym)
-	    else AC_DEFINE_UNQUOTED($sym,$val)
+dnl Also, glibc doesn't like two of the traditional POSIX macros that xmkmf
+dnl likes us to define; ignore them if appropriate.
+	if grep "^#define $sym " confdefs.h >/dev/null          || \
+           test "$have_glibc" = "yes" -a "$sym" = "_BSD_SOURCE" || \
+           test "$have_glibc" = "yes" -a "$sym" = "_SVID_SOURCE";
+        then :; else
+ 	  if test "$val" = "1"
+ 	    then AC_DEFINE_UNQUOTED($sym)
+ 	    else AC_DEFINE_UNQUOTED($sym,$val)
 	  fi
 	fi  ;;
       esac