[ expat-Bugs-842049 ] Configure script error - CC or CPP

"SourceForge.net" <[email protected]>
Newsgroups gmane.text.xml.expat.bugs
Message-ID <[email protected]>
Bugs item #842049, was opened at 2003-11-14 12:48
Message generated for change (Comment added) made by legoscia
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=842049&group_id=10127

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Greg Stein (gstein)
Summary: Configure script error - CC or CPP

Initial Comment:
expat-1.95.7

My check install is in a none standard location.

I set the CFLAGS enviroment variable so the file could 
be found.  You then get a configure warning:


configure: WARNING: check.h: accepted by the 
compiler, rejected by the preprocessor!
configure: WARNING: check.h: proceeding with the 
preprocessor's result


This seems to be due to the preprocessor check using 
CPP and the CPPFLAGS while the compiler check uses 
CC and CFLAGS.



----------------------------------------------------------------------

Comment By: Magnus Henoch (legoscia)
Date: 2004-10-10 17:40

Message:
Logged In: YES 
user_id=920364

This patch seems to fix the problem. (I found no way to
attach it...)
Can it be installed in CVS?

Index: conftools/expat.m4
===================================================================
RCS file: /cvsroot/expat/expat/conftools/expat.m4,v
retrieving revision 1.1
diff -u -r1.1 expat.m4
--- conftools/expat.m4	9 Nov 2001 04:55:33 -0000	1.1
+++ conftools/expat.m4	10 Oct 2004 15:26:46 -0000
@@ -1,6 +1,6 @@
 dnl Check if --with-expat[=PREFIX] is specified and
 dnl Expat >= 1.95.0 is installed in the system.
-dnl If yes, substitute EXPAT_CFLAGS, EXPAT_LIBS with regard to
+dnl If yes, substitute EXPAT_CPPFLAGS, EXPAT_LIBS with
regard to
 dnl the specified PREFIX and set with_expat to PREFIX, or
'yes' if PREFIX
 dnl has not been specified. Also HAVE_LIBEXPAT,
HAVE_EXPAT_H are defined.
 dnl If --with-expat has not been specified, set with_expat
to 'no'.
@@ -14,11 +14,11 @@
 
   AM_CONDITIONAL(EXPAT_INSTALLED, test $with_expat != no)
 
-  EXPAT_CFLAGS=
+  EXPAT_CPPFLAGS=
   EXPAT_LIBS=
   if test $with_expat != no; then
 	if test $with_expat != yes; then
-		EXPAT_CFLAGS="-I$with_expat/include"
+		EXPAT_CPPFLAGS="-I$with_expat/include"
 		EXPAT_LIBS="-L$with_expat/lib"
 	fi
 	AC_CHECK_LIB(expat, XML_ParserCreate,
@@ -29,15 +29,24 @@
 	if test $expat_found = no; then
 		AC_MSG_ERROR([Could not find the Expat library])
 	fi
-	expat_save_CFLAGS="$CFLAGS"
-	CFLAGS="$CFLAGS $EXPAT_CFLAGS"
+	expat_save_CPPFLAGS="$CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS $EXPAT_CPPFLAGS"
 	AC_CHECK_HEADERS(expat.h, , expat_found=no)
 	if test $expat_found = no; then
 		AC_MSG_ERROR([Could not find expat.h])
 	fi
-	CFLAGS="$expat_save_CFLAGS"
+	CPPFLAGS="$expat_save_CPPFLAGS"
   fi
 
+  AC_SUBST(EXPAT_CPPFLAGS)
   AC_SUBST(EXPAT_CFLAGS)
   AC_SUBST(EXPAT_LIBS)
+
+  # Earlier versions of this script incorrectly used CFLAGS
instead
+  # of CPPFLAGS, causing preprocessor-only autoconf tests
to fail
+  # when expat was installed in a nonstandard location. 
The following
+  # lines make sure that existing scripts depending on this bug
+  # still work.
+  EXPAT_CFLAGS="$EXPAT_CPPFLAGS"
+  AC_SUBST(EXPAT_CFLAGS)
 ])

Magnus


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=110127&aid=842049&group_id=10127
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.