[Scons-users] Fwd: Help with scons: warning: No dependency generated for file: stdlib.h

Jason Fritz jasonfritzpublic at gmail.com
Tue Apr 8 12:58:45 EDT 2014


Hi Scons folks,

I'm a new SCons user trying to convert an existing makefile-based build
system to SCons. I'm having trouble with a bunch of SCons warnings about
being unable to find all kinds of standard header files, e.g. stdlib.h,
stdio.h, stdint.h, string.h, cassert.

For example:
scons: warning: No dependency generated for file: stdlib.h (included
from: lib/common/dbglog/dbglog.h) -- file not found
File "/usr/bin/scons", line 190, in <module>

The strange thing is that the compiler (gcc) compiles the source code just
fine. It is only SCons that is having trouble finding the files.

Here are simplified versions of my SConstruct (top-level) and SConscript (5
levels deep in directory hierarchy).

======== SConstruct begin ========
import sys
SetOption('warn','all')

cacheDir = '/local/mnt/workspace/.scons_cache'
print 'CacheDir is: %s' % cacheDir
CacheDir(cacheDir)

releaseEnv = Environment()

# Common C Preprocessor defines for all directories
cppdefines = [
('LINUX',1),
'_REENTRANT',
'_GNU_SOURCE',
'__ACE_INLINE__',
'ACE_HAS_AIO_CALLS',
'ACE_HAS_EXCEPTIONS',
'LINUXBTMAKE',
'USE_IOSTREAM'
]
releaseEnv.Append(CPPDEFINES=cppdefines)

# C/C++ compiler flags, other than include paths and C Preprocess defines
ccflags = [
'-mmmx', # Enable use of MMX instruction on i386/x86_64
'-msse', # Enable use of SSE instruction on i386/x86_64
'-msse2', # Enable use of SSE2 instruction on i386/x86_64
'-Wall', # This enables all the warnings about constructions
that some users consider questionable, and that are easy to avoid (or
modify to prevent the warning), even in conjunction with macros
'-g' # Produce debugging information in the operating
system's native format
]
releaseEnv.Replace(CCFLAGS = ccflags)

# The debugEnv is a clone of the releaseEnv. The only difference is that
# debugEnv is unoptimized to get stable debugger behavior.
debugEnv = releaseEnv.Clone()
releaseEnv.Append(CCFLAGS = '-O3') # Turn on max optimization for the
release build

# This is just an example... I'm not repeating the actual list
includes_rtf_common = ['#/lib/abc', '#/lib/def']

Export('releaseEnv debugEnv')
Export('includes_rtf_common')

# This includes a hierarchy of SConscript files which simply include the
next layer down until the SConscript file listed below
SConscript(['lib/SConscript'])

======== SConstruct end ========

======== SConscript begin ========
Import('*')
myReleaseEnv = releaseEnv.Clone()
myReleaseEnv.AppendUnique(CPPPATH=includes_rtf_common)

my_file = 'foo.cpp'

myReleaseEnv.SharedLibrary('foolib', my_file)
======== SConscript end ========

I'm using SCons v2.0.1 on RedHat Enterprise Linux 6.4 on x86_64 arch. I
get the same behavior with Scons 2.3.1.

Thank you for any help!
Jason
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://four.pairlist.net/pipermail/scons-users/attachments/20140408/ace2b695/attachment.htm


More information about the Scons-users mailing list