From 6f3f2d6c129577f8666aee7b506d0b52a58bba0e Mon Sep 17 00:00:00 2001 From: Jackie Huang Date: Mon, 27 Apr 2020 11:53:55 +0800 Subject: [PATCH 3/4] fix header defs lookup Signed-off-by: Bian Naimeng Rebase for 4.1.1 Signed-off-by: Jackie Huang --- configure.ac | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index e1ed2e8..4d5fb96 100644 --- a/configure.ac +++ b/configure.ac @@ -148,9 +148,8 @@ extract_header_define() { Cfile=$srcdir/extract_define.$2.${$} printf "#include \n" > ${Cfile}.c printf "#include <%s>\n" $1 >> ${Cfile}.c - printf "int main(int argc, char **argv) { printf(\"%%s\", %s); return 0; }\n" $2 >> ${Cfile}.c - $CC $CFLAGS ${Cfile}.c -o ${Cfile} - value=`${Cfile}` + printf "\"%s\":%s\n" $2 $2 >> ${Cfile}.c + value=`$CC $CFLAGS -E ${Cfile}.c | grep \"$2\" | cut -f 2 -d ':'` AC_MSG_RESULT($value) printf $value rm -f ${Cfile}.c ${Cfile} -- 2.7.4