1 From 6f3f2d6c129577f8666aee7b506d0b52a58bba0e Mon Sep 17 00:00:00 2001
2 From: Jackie Huang <jackie.huang@windriver.com>
3 Date: Mon, 27 Apr 2020 11:53:55 +0800
4 Subject: [PATCH 3/4] fix header defs lookup
6 Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>
10 Signed-off-by: Jackie Huang <jackie.huang@windriver.com>
12 configure.ac | 5 ++---
13 1 file changed, 2 insertions(+), 3 deletions(-)
15 diff --git a/configure.ac b/configure.ac
16 index e1ed2e8..4d5fb96 100644
19 @@ -148,9 +148,8 @@ extract_header_define() {
20 Cfile=$srcdir/extract_define.$2.${$}
21 printf "#include <stdio.h>\n" > ${Cfile}.c
22 printf "#include <%s>\n" $1 >> ${Cfile}.c
23 - printf "int main(int argc, char **argv) { printf(\"%%s\", %s); return 0; }\n" $2 >> ${Cfile}.c
24 - $CC $CFLAGS ${Cfile}.c -o ${Cfile}
26 + printf "\"%s\":%s\n" $2 $2 >> ${Cfile}.c
27 + value=`$CC $CFLAGS -E ${Cfile}.c | grep \"$2\" | cut -f 2 -d ':'`
30 rm -f ${Cfile}.c ${Cfile}