[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug #63185] configure fails to detect getloadavg declaration on sun and
From: |
Dmitry Goncharov |
Subject: |
[bug #63185] configure fails to detect getloadavg declaration on sun and aix. |
Date: |
Sat, 8 Oct 2022 16:27:23 -0400 (EDT) |
Follow-up Comment #1, bug #63185 (project make):
The latest configure from 4.3.90 fails to detect getloadavg declaration on
sun
and aix.
++++
../src/job.c: In function ▒load_too_high▒:
../src/job.c:2103:7: warning: implicit declaration of function
▒getloadavg▒ [-Wimplicit-function-declaration]
2103 | if (getloadavg (&load, 1) != 1)
| ^~~~~~~~~~
----
++++
$ grep GETLOADAVG src/config.h
#define GNULIB_TEST_GETLOADAVG 1
#define HAVE_DECL_GETLOADAVG 1
$
----
The change was introduced in dd24a4c1cfa7b6928ddb2bcd00a023f23aaaf440.
++++
$ git sh --pretty=format:%H dd24a4c1cfa7b6928ddb2bcd00a023f23aaaf440 --
configure.ac src/job.c
dd24a4c1cfa7b6928ddb2bcd00a023f23aaaf440
diff --git a/configure.ac b/configure.ac
index 51817b2c..4a0d5301 100644
--- a/configure.ac
+++ b/configure.ac
@@ -437,6 +437,9 @@ AS_CASE([$host],
AC_DEFINE_UNQUOTED([PATH_SEPARATOR_CHAR],['$PATH_SEPARATOR'],
[Define to the character that separates directories in PATH.])
+AC_DEFINE_UNQUOTED([HAVE_DECL_GETLOADAVG],[$HAVE_DECL_GETLOADAVG],
+ [Define to 1 if you have the declaration of 'getloadavg'.])
+
# Include the Maintainer's Makefile section, if it's here.
MAINT_MAKEFILE=/dev/null
diff --git a/src/job.c b/src/job.c
index 0c9054bd..402d409f 100644
--- a/src/job.c
+++ b/src/job.c
@@ -216,7 +216,7 @@ pid2str (pid_t pid)
return pidstring;
}
-#ifndef HAVE_GETLOADAVG
+#ifndef HAVE_DECL_GETLOADAVG
int getloadavg (double loadavg[], int nelem);
#endif
----
This is the relevant part of config.log
++++
configure:7677: checking for getloadavg
configure:7677: gcc-11 -o conftest -Wall -Wextra -ggdb -m64
-DMAKE_MAINTAINER_MODE=1 conftest.c >&5
configure:7677: $? = 0
configure:7677: result: yes
configure:8030: checking for sys/loadavg.h
configure:8030: gcc-11 -c -Wall -Wextra -ggdb -m64 -DMAKE_MAINTAINER_MODE=1
conftest.c >&5
configure:8030: $? = 0
configure:8030: result: yes
configure:8042: checking whether getloadavg is declared
configure:8042: gcc-11 -c -Wall -Wextra -ggdb -m64 -DMAKE_MAINTAINER_MODE=1
conftest.c >&5
configure:8042: $? = 0
configure:8042: result: yes
...
| #define HAVE_SYS_LOADAVG_H 1
| #define GNULIB_TEST_GETLOADAVG 1
...
ac_cv_func_getloadavg=yes
...
ac_cv_have_decl_getloadavg=yes
...
GETLOADAVG_LIBS=''
GL_COND_OBJ_GETLOADAVG_FALSE=''
GL_COND_OBJ_GETLOADAVG_TRUE='#'
...
GL_GNULIB_GETLOADAVG='1'
...
HAVE_DECL_GETLOADAVG='1'
...
#define HAVE_DECL_GETLOADAVG 1
----
Reverting the change in job.c fixes the issue.
_______________________________________________________
Reply to this item at:
<https://savannah.gnu.org/bugs/?63185>
_______________________________________________
Message sent via Savannah
https://savannah.gnu.org/
- [bug #63185] configure fails to detect getloadavg declaration on sun and aix., Dmitry Goncharov, 2022/10/08
- [bug #63185] configure fails to detect getloadavg declaration on sun and aix.,
Dmitry Goncharov <=
- [bug #63185] configure fails to detect getloadavg declaration on sun and aix., Paul D. Smith, 2022/10/15
- [bug #63185] configure fails to detect getloadavg declaration on sun and aix., Paul D. Smith, 2022/10/18
- [bug #63185] configure fails to detect getloadavg declaration on sun and aix., Dmitry Goncharov, 2022/10/18
- [bug #63185] configure fails to detect getloadavg declaration on sun and aix., Dmitry Goncharov, 2022/10/18
- [bug #63185] configure fails to detect getloadavg declaration on sun and aix., Dmitry Goncharov, 2022/10/25
- [bug #63185] configure fails to detect getloadavg declaration on sun and aix., Paul D. Smith, 2022/10/26
- [bug #63185] configure fails to detect getloadavg declaration on sun and aix., Dmitry Goncharov, 2022/10/26
- [bug #63185] configure fails to detect getloadavg declaration on sun and aix., Paul D. Smith, 2022/10/27