aboutsummaryrefslogtreecommitdiffstats
path: root/meta-cgl-common/recipes-cgl/pacemaker/pacemaker/0003-pacemaker-fix-header-defs-lookup.patch
blob: 6dc4663014de3b39536ef6a898f9abb6677e523e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
From 9236fa746d43adb098c2946e72e8b29ffbc78865 Mon Sep 17 00:00:00 2001
From: Bian Naimeng <biannm@cn.fujitsu.com>
Date: Fri, 3 Jul 2015 16:30:25 +0900
Subject: [PATCH] pacemaker: fix header defs lookup

Signed-off-by: Bian Naimeng <biannm@cn.fujitsu.com>

---
 configure.ac | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5d442a5..1429b01 100644
--- a/configure.ac
+++ b/configure.ac
@@ -147,9 +147,8 @@ extract_header_define() {
 	  Cfile=$srcdir/extract_define.$2.${$}
 	  printf "#include <stdio.h>\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 ':' | sed 's,^",,' | sed 's,"$,,'`
 	  AC_MSG_RESULT($value)
 	  printf $value
 	  rm -rf ${Cfile}.c ${Cfile} ${Cfile}.dSYM ${Cfile}.gcno