From 138f59be670f9c73dfea48ac4153227f92e30ec7 Mon Sep 17 00:00:00 2001
From: andreast <andreast@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 23 Jan 2006 18:28:51 +0000
Subject: [PATCH] 2006-01-23  Andreas Tobler  <a.tobler@schweiz.ch>

	* config/posix/proc.c: Conditional include of sys/loadavg.h for
	Solaris.
	* configure.ac: Add check for loadavg.h.
	(link_gomp): Adjust comment.
	* configure: Regenerate.
	* config.h.in: Regenerate.


git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@110141 138bc75d-0d04-0410-961f-82ee72b054a4
---
 libgomp/ChangeLog           | 9 +++++++++
 libgomp/config.h.in         | 3 +++
 libgomp/config/posix/proc.c | 7 ++++++-
 libgomp/configure           | 5 +++--
 libgomp/configure.ac        | 4 ++--
 5 files changed, 23 insertions(+), 5 deletions(-)

diff --git a/libgomp/ChangeLog b/libgomp/ChangeLog
index e33066aa777f..651903cf7eda 100644
--- a/libgomp/ChangeLog
+++ b/libgomp/ChangeLog
@@ -1,3 +1,12 @@
+2006-01-23  Andreas Tobler  <a.tobler@schweiz.ch>
+
+	* config/posix/proc.c: Conditional include of sys/loadavg.h for
+	Solaris.
+	* configure.ac: Add check for loadavg.h.
+	(link_gomp): Adjust comment.
+	* configure: Regenerate.
+	* config.h.in: Regenerate.
+
 2006-01-21  Steve Ellcey  <sje@cup.hp.com>
 
 	PR libgomp/25877
diff --git a/libgomp/config.h.in b/libgomp/config.h.in
index a24e14867c74..d4e74222d6c9 100644
--- a/libgomp/config.h.in
+++ b/libgomp/config.h.in
@@ -39,6 +39,9 @@
 /* Define to 1 if the target supports __sync_*_compare_and_swap */
 #undef HAVE_SYNC_BUILTINS
 
+/* Define to 1 if you have the <sys/loadavg.h> header file. */
+#undef HAVE_SYS_LOADAVG_H
+
 /* Define to 1 if you have the <sys/stat.h> header file. */
 #undef HAVE_SYS_STAT_H
 
diff --git a/libgomp/config/posix/proc.c b/libgomp/config/posix/proc.c
index 3f5eb7ddc111..3ee84f5c9d6b 100644
--- a/libgomp/config/posix/proc.c
+++ b/libgomp/config/posix/proc.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 2005 Free Software Foundation, Inc.
+/* Copyright (C) 2005, 2006 Free Software Foundation, Inc.
    Contributed by Richard Henderson <rth@redhat.com>.
 
    This file is part of the GNU OpenMP Library (libgomp).
@@ -34,6 +34,11 @@
 #include "libgomp.h"
 #include <unistd.h>
 #include <stdlib.h>
+#ifdef HAVE_GETLOADAVG
+# ifdef HAVE_SYS_LOADAVG_H
+#  include <sys/loadavg.h>
+# endif
+#endif
 
 
 /* At startup, determine the default number of threads.  It would seem
diff --git a/libgomp/configure b/libgomp/configure
index 4824adc51e99..5855c07a67f7 100755
--- a/libgomp/configure
+++ b/libgomp/configure
@@ -5317,7 +5317,8 @@ done
 
 
 
-for ac_header in unistd.h semaphore.h sys/time.h
+
+for ac_header in unistd.h semaphore.h sys/loadavg.h sys/time.h
 do
 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
 if eval "test \"\${$as_ac_Header+set}\" = set"; then
@@ -6633,7 +6634,7 @@ else
 fi
 
 # Set up the set of libraries that we need to link against for libgomp.
-# Note that the GOMP_DRIVER_SPEC in gcc.c will force -pthread for -fopenmp,
+# Note that the GOMP_SELF_SPEC in gcc.c will force -pthread for -fopenmp,
 # which will force linkage against -lpthread (or equivalent for the system).
 # That's not 100% ideal, but about the best we can do easily.
 if test $enable_shared = yes; then
diff --git a/libgomp/configure.ac b/libgomp/configure.ac
index 854514a27f42..2a00337a57d8 100644
--- a/libgomp/configure.ac
+++ b/libgomp/configure.ac
@@ -136,7 +136,7 @@ AC_SUBST(libtool_VERSION)
 # Check header files.
 AC_STDC_HEADERS
 AC_HEADER_TIME
-AC_CHECK_HEADERS(unistd.h semaphore.h sys/time.h)
+AC_CHECK_HEADERS(unistd.h semaphore.h sys/loadavg.h sys/time.h)
 AC_CHECK_HEADER([pthread.h],[],
   [AC_MSG_ERROR([Pthreads are required to build libgomp])])
 
@@ -204,7 +204,7 @@ else
 fi
 
 # Set up the set of libraries that we need to link against for libgomp.
-# Note that the GOMP_DRIVER_SPEC in gcc.c will force -pthread for -fopenmp,
+# Note that the GOMP_SELF_SPEC in gcc.c will force -pthread for -fopenmp,
 # which will force linkage against -lpthread (or equivalent for the system).
 # That's not 100% ideal, but about the best we can do easily.
 if test $enable_shared = yes; then
-- 
GitLab