]> granicus.if.org Git - linux-pam/commitdiff
build: extend cross compiling check to cover CPPFLAGS (ticket #21)
authorDmitry V. Levin <ldv@altlinux.org>
Tue, 9 Dec 2014 21:47:40 +0000 (21:47 +0000)
committerDmitry V. Levin <ldv@altlinux.org>
Wed, 10 Dec 2014 00:52:17 +0000 (00:52 +0000)
Use BUILD_CPPFLAGS variable to override CPPFLAGS where necessary in
case of cross compiling, in addition to CC_FOR_BUILD, BUILD_CFLAGS,
and BUILD_LDFLAGS variables introduced earlier to override CC,
CFLAGS, and LDFLAGS, respectively.

* configure.in (BUILD_CPPFLAGS): Define.
* doc/specs/Makefile.am (CPPFLAGS): Define to @BUILD_CPPFLAGS@.

configure.in
doc/specs/Makefile.am

index 2597802f674eca74bcf0872c9a71963e38b4775e..6797e2fe5df02110fbb6a3079081025df9087c3e 100644 (file)
@@ -144,6 +144,15 @@ AC_MSG_CHECKING([for CC_FOR_BUILD])
 AC_MSG_RESULT([$CC_FOR_BUILD])
 AC_SUBST(CC_FOR_BUILD)
 
+if test "x${BUILD_CPPFLAGS+set}" != "xset" ; then
+  if test "x$cross_compiling" = "xyes" ; then
+    BUILD_CPPFLAGS=
+  else
+    BUILD_CPPFLAGS=${CPPFLAGS}
+  fi
+fi
+AC_SUBST(BUILD_CPPFLAGS)
+
 if test "x${BUILD_CFLAGS+set}" != "xset" ; then
   if test "x$cross_compiling" = "xyes" ; then
     BUILD_CFLAGS=
index 36d53baf3d4e60862f62b1a89efa07bdb68c82ce..99ecc70e2c4ca84be03c41fda7f25e0844edc820 100644 (file)
@@ -12,6 +12,7 @@ draft-morgan-pam-current.txt: padout draft-morgan-pam.raw
 AM_YFLAGS = -d
 
 CC = @CC_FOR_BUILD@
+CPPFLAGS = @BUILD_CPPFLAGS@
 CFLAGS = @BUILD_CFLAGS@
 LDFLAGS = @BUILD_LDFLAGS@