From 71d9113f9b0dd357236dcaadda0ddd9faf1607be Mon Sep 17 00:00:00 2001
From: Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
Date: Wed, 21 Dec 2016 09:49:40 +0000
Subject: [PATCH] re PR libfortran/70311 (libgfortran build dies on "implicit
 declaration of function strncasecmp")

	PR libfortran/70311
	* intrinsics/selected_char_kind.c: Include <strings.h> header.
	* runtime/environ.c: Include <strings.h> header.
	* runtime/string.c: Include <strings.h> header.

From-SVN: r243843
---
 libgfortran/ChangeLog                       | 7 +++++++
 libgfortran/intrinsics/selected_char_kind.c | 2 +-
 libgfortran/runtime/environ.c               | 1 +
 libgfortran/runtime/string.c                | 1 +
 4 files changed, 10 insertions(+), 1 deletion(-)

diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 2c24253b6403..c98e5890cbe2 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,10 @@
+2016-12-21  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
+
+	PR libfortran/70311
+	* intrinsics/selected_char_kind.c: Include <strings.h> header.
+	* runtime/environ.c: Include <strings.h> header.
+	* runtime/string.c: Include <strings.h> header.
+
 2016-12-21  Francois-Xavier Coudert  <fxcoudert@gcc.gnu.org>
 
 	* gfortran.map: Remove _gfortran_ftell2.
diff --git a/libgfortran/intrinsics/selected_char_kind.c b/libgfortran/intrinsics/selected_char_kind.c
index bbb95a93cdc2..8e400a45e646 100644
--- a/libgfortran/intrinsics/selected_char_kind.c
+++ b/libgfortran/intrinsics/selected_char_kind.c
@@ -25,7 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #include "libgfortran.h"
 
-#include <string.h>
+#include <strings.h>
 
 
 extern GFC_INTEGER_4 selected_char_kind (gfc_charlen_type, char *);
diff --git a/libgfortran/runtime/environ.c b/libgfortran/runtime/environ.c
index 07c6351a8d9a..280f53303fa6 100644
--- a/libgfortran/runtime/environ.c
+++ b/libgfortran/runtime/environ.c
@@ -25,6 +25,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 #include "libgfortran.h"
 
 #include <string.h>
+#include <strings.h>
 #include <stdlib.h>
 #include <ctype.h>
 
diff --git a/libgfortran/runtime/string.c b/libgfortran/runtime/string.c
index bb486d9bb6b2..21505730ccb7 100644
--- a/libgfortran/runtime/string.c
+++ b/libgfortran/runtime/string.c
@@ -24,6 +24,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
 
 #include "libgfortran.h"
 #include <string.h>
+#include <strings.h>
 #include <stdlib.h>
 
 
-- 
GitLab