Skip to contentSkip to conversation

autoconf: correctly parse *_INCLUDES and *_LIB env vars

PATCH In review Roger Pau Monne 2 participants 2 messages Jun 28, 2012 – Jun 29, 2012

lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 autoconf: correctly parse *_INCLUDES and *_LIB env vars

Parse those options correctly, since the "+=" operator is not valid. Also added CPPFLAGS, so headers checks don't give strange results.

Please rerun configure after applying.

Cc Ian Jackson <[email protected]>
Cc Christoph Egger <[email protected]>
---
 tools/m4/set_cflags_ldflags.m4 |   14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)
tools/m4/set_cflags_ldflags.m4 +7 -7
index 7e357ba..cbad3c1 100644
@@ -1,20 +1,20 @@
 AC_DEFUN([AX_SET_FLAGS],
-[for cflag in $PREPEND_INCLUDES
+[for cppflag in $PREPEND_INCLUDES
 do
-    PREPEND_CFLAGS+=" -I$cflag"
+    PREPEND_CPPFLAGS="$PREPEND_CPPFLAGS -I$cppflag"
 done
 for ldflag in $PREPEND_LIB
 do
-    PREPEND_LDFLAGS+=" -L$ldflag"
+    PREPEND_LDFLAGS="$PREPEND_LDFLAGS -L$ldflag"
 done
-for cflag in $APPEND_INCLUDES
+for cppflag in $APPEND_INCLUDES
 do
-    APPEND_CFLAGS+=" -I$cflag"
+    APPEND_CPPFLAGS="$APPEND_CPPFLAGS -I$cppflag"
 done
 for ldflag in $APPEND_LIB
 do
-    APPEND_LDFLAGS+=" -L$ldflag"
+    APPEND_LDFLAGS="$APPEND_LDFLAGS -L$ldflag"
 done
-CFLAGS="$PREPEND_CFLAGS $CFLAGS $APPEND_CFLAGS"
+CPPFLAGS="$PREPEND_CPPFLAGS $CPPFLAGS $APPEND_CPPFLAGS"
 LDFLAGS="$PREPEND_LDFLAGS $LDFLAGS $APPEND_LDFLAGS"])
 
Signature · 1 line
1.7.7.5 (Apple Git-26)
Acked-by on v2 1/1
#1 lore raw

Roger Pau Monne writes ("[Xen-devel] [PATCH v2] autoconf: correctly parse *_INCLUDES and *_LIB env vars"):

Quoted 8 lines

Parse those options correctly, since the "+=" operator is not valid. Also added CPPFLAGS, so headers checks don't give strange results.

Please rerun configure after applying.

Cc Ian Jackson <[email protected]>
Cc Christoph Egger <[email protected]>