]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/blob
85e9a45615f8e8c41a1a69bb74750f0545e40928
[thirdparty/openembedded/openembedded-core-contrib.git] /
1 From e25dfa75e18295d28de67747b4ff9d65f65c4f06 Mon Sep 17 00:00:00 2001
2 From: Zack Weinberg <zackw@panix.com>
3 Date: Sun, 2 Apr 2023 22:17:55 -0400
4 Subject: [PATCH 14/29] Remove the last few internal uses of AC_EGREP_CPP.
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 Most of the remaining uses were converted to AC_COMPILE_IFELSE.
10 The use in AC_FUNC_LOADAVG becomes an AC_PREPROC_IFELSE because
11 we can’t be sure getloadavg.c can be _compiled_ at this point in
12 the build. The use in AC_C_VARARRAYS could be either _PREPROC_ or
13 _COMPILE_; we use _COMPILE_ because, _PREPROC_ is never used, then
14 we don’t have to do the “checking how to run the C preprocessor” test.
15
16 * lib/autoconf/c.m4 (AC_C_VARARRAYS): Use AC_COMPILE_IFELSE instead of
17 AC_EGREP_CPP.
18 * lib/autoconf/headers.m4 (_AC_HEADER_TIOCGWINSZ_IN_TERMIOS_H)
19 (_AC_HEADER_TIOCGWINSZ_IN_SYS_IOCTL_H): Likewise.
20 * lib/autoconf/functions.m4 (AC_FUNC_GETLOADAVG): Use AC_PREPROC_IFELSE
21 instead of AC_EGREP_CPP.
22
23 Upstream-Status: Backport
24 Signed-off-by: Khem Raj <raj.khem@gmail.com>
25 ---
26 lib/autoconf/c.m4 | 8 ++++----
27 lib/autoconf/functions.m4 | 10 +++++-----
28 lib/autoconf/headers.m4 | 24 ++++++++++--------------
29 3 files changed, 19 insertions(+), 23 deletions(-)
30
31 diff --git a/lib/autoconf/c.m4 b/lib/autoconf/c.m4
32 index c8c6a665c..b8350c339 100644
33 --- a/lib/autoconf/c.m4
34 +++ b/lib/autoconf/c.m4
35 @@ -2197,11 +2197,11 @@ AC_DEFUN([AC_C_VARARRAYS],
36 [
37 AC_CACHE_CHECK([for variable-length arrays],
38 ac_cv_c_vararrays,
39 - [AC_EGREP_CPP([defined],
40 - [#ifdef __STDC_NO_VLA__
41 - defined
42 + [AC_COMPILE_IFELSE([AC_LANG_SOURCE(
43 +[[ #ifndef __STDC_NO_VLA__
44 + #error __STDC_NO_VLA__ not defined
45 #endif
46 - ],
47 +]])],
48 [ac_cv_c_vararrays='no: __STDC_NO_VLA__ is defined'],
49 [AC_COMPILE_IFELSE(
50 [AC_LANG_PROGRAM(
51 diff --git a/lib/autoconf/functions.m4 b/lib/autoconf/functions.m4
52 index 74512e97d..499e4c024 100644
53 --- a/lib/autoconf/functions.m4
54 +++ b/lib/autoconf/functions.m4
55 @@ -842,11 +842,11 @@ AC_CHECK_FUNCS(getloadavg, [],
56 # Some definitions of getloadavg require that the program be installed setgid.
57 AC_CACHE_CHECK(whether getloadavg requires setgid,
58 ac_cv_func_getloadavg_setgid,
59 -[AC_EGREP_CPP([Yowza Am I SETGID yet],
60 -[#include "$srcdir/$ac_config_libobj_dir/getloadavg.c"
61 -#ifdef LDAV_PRIVILEGED
62 -Yowza Am I SETGID yet
63 -@%:@endif],
64 +[AC_PREPROC_IFELSE([AC_LANG_SOURCE(
65 +[[#include "$srcdir/$ac_config_libobj_dir/getloadavg.c"
66 +#ifndef LDAV_PRIVILEGED
67 +#error setgid not needed
68 +@%:@endif]])],
69 ac_cv_func_getloadavg_setgid=yes,
70 ac_cv_func_getloadavg_setgid=no)])
71 if test $ac_cv_func_getloadavg_setgid = yes; then
72 diff --git a/lib/autoconf/headers.m4 b/lib/autoconf/headers.m4
73 index 7f70e8fd4..19c124cc3 100644
74 --- a/lib/autoconf/headers.m4
75 +++ b/lib/autoconf/headers.m4
76 @@ -721,13 +721,11 @@ you to include it and time.h simultaneously.])
77 m4_define([_AC_HEADER_TIOCGWINSZ_IN_TERMIOS_H],
78 [AC_CACHE_CHECK([whether termios.h defines TIOCGWINSZ],
79 ac_cv_sys_tiocgwinsz_in_termios_h,
80 -[AC_EGREP_CPP([yes],
81 - [#include <sys/types.h>
82 -#include <termios.h>
83 -#ifdef TIOCGWINSZ
84 - yes
85 -#endif
86 -],
87 +[AC_COMPILE_IFELSE([AC_LANG_SOURCE(
88 +[AC_INCLUDES_DEFAULT
89 +[#include <termios.h>
90 +const int tiocgwinsz = TIOCGWINSZ;
91 +]])],
92 ac_cv_sys_tiocgwinsz_in_termios_h=yes,
93 ac_cv_sys_tiocgwinsz_in_termios_h=no)])
94 ])# _AC_HEADER_TIOCGWINSZ_IN_TERMIOS_H
95 @@ -738,13 +736,11 @@ m4_define([_AC_HEADER_TIOCGWINSZ_IN_TERMIOS_H],
96 m4_define([_AC_HEADER_TIOCGWINSZ_IN_SYS_IOCTL],
97 [AC_CACHE_CHECK([whether sys/ioctl.h defines TIOCGWINSZ],
98 ac_cv_sys_tiocgwinsz_in_sys_ioctl_h,
99 -[AC_EGREP_CPP([yes],
100 - [#include <sys/types.h>
101 -#include <sys/ioctl.h>
102 -#ifdef TIOCGWINSZ
103 - yes
104 -#endif
105 -],
106 +[AC_COMPILE_IFELSE([AC_LANG_SOURCE(
107 +[AC_INCLUDES_DEFAULT
108 +[#include <sys/ioctl.h>
109 +const int tiocgwinsz = TIOCGWINSZ;
110 +]])],
111 ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=yes,
112 ac_cv_sys_tiocgwinsz_in_sys_ioctl_h=no)])
113 ])# _AC_HEADER_TIOCGWINSZ_IN_SYS_IOCTL
114 --
115 2.41.0
116