[asterisk-bugs] [Asterisk 0017045]: Configure script inconsistent in using CFLAGS when detecting header files

Asterisk Bug Tracker noreply at bugs.digium.com
Thu Jun 3 21:43:44 CDT 2010


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17045 
====================================================================== 
Reported By:                pprindeville
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   17045
Category:                   Core/BuildSystem
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     acknowledged
Asterisk Version:           1.6.2.6 
JIRA:                       SWP-1108 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): N/A 
SVN Revision (number only!):  
Request Review:              
====================================================================== 
Date Submitted:             2010-03-16 20:15 CDT
Last Modified:              2010-06-03 21:43 CDT
====================================================================== 
Summary:                    Configure script inconsistent in using CFLAGS when
detecting header files
Description: 
Building with cross-compiler tools, we get:

configure:34069: checking libpri.h usability
configure:34086:
/home/digium/trunk/build_i586/staging_dir/bin/i586-linux-uclibc-gcc -c -Os
-pipe -fomit-frame-pointer -march=k6-2 -fno-align-functions
-fno-align-loops -fno-align-jumps -fno-align-labels  -isysroot
/home/digium/trunk/build_i586/staging_dir -isystem
/home/digium/trunk/build_i586/staging_dir/usr/include -D_GNU_SOURCE   
conftest.c>&5
configure:34093: $? = 0
configure:34107: result: yes
configure:34111: checking libpri.h presence
configure:34126:
/home/digium/trunk/build_i586/staging_dir/bin/i586-linux-uclibc-cpp   
conftest.c
conftest.c:206:20: error: libpri.h: No such file or directory
configure:34133: $? = 1 

note that on line 34086 $(CC) is invoked with $(CFLAGS) and works
properly.

On line 34126, however, $(CPP) is invoked without $(CFLAGS) and fails.

Should CPPFLAGS be forced to CFLAGS if it's not explicitly set?
 
====================================================================== 

---------------------------------------------------------------------- 
 (0122942) tilghman (administrator) - 2010-06-03 21:43
 https://issues.asterisk.org/view.php?id=17045#c122942 
---------------------------------------------------------------------- 
CPPFLAGS are used at a different time than CFLAGS.  CPPFLAGS are used to
preprocess the file, whereas CFLAGS are used to compile the code into
object format.  This secondary test (checking for header presence) uses the
preprocessor alone, which is why it's not finding it.  The correct thing
for you to do is to specify the include directories in the CPPFLAGS
variable, not the CFLAGS variable, as they are needed at preprocessing
time.  Only flags that are exclusive to the compiler should be specified in
CFLAGS. 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2010-06-03 21:43 tilghman       Note Added: 0122942                          
======================================================================




More information about the asterisk-bugs mailing list