Skip to content
Snippets Groups Projects
Commit a295665d authored by Edward Brash's avatar Edward Brash Committed by Stephen A. Wood
Browse files

Added ability to check required C header files to configure section

Invoked with 'scons checkheaders=1'

Also added cppcheck_report.txt to .gitignore
parent 82248007
No related branches found
No related tags found
No related merge requests found
# ignore patterns # ignore patterns
# Auto generated files # Auto generated files
cppcheck_report.txt
HallCDict.cxx HallCDict.cxx
HallCDict.C HallCDict.C
HallCDict.h HallCDict.h
......
...@@ -64,6 +64,7 @@ ivercode = 65536*int(float(baseenv.subst('$SOVERSION')))+ 256*int(10*(float(base ...@@ -64,6 +64,7 @@ ivercode = 65536*int(float(baseenv.subst('$SOVERSION')))+ 256*int(10*(float(base
baseenv.Append(VERCODE = ivercode) baseenv.Append(VERCODE = ivercode)
baseenv.Append(CPPPATH = ['$HC_SRC','$HA_SRC','$HA_DC','$HA_SCALER']) baseenv.Append(CPPPATH = ['$HC_SRC','$HA_SRC','$HA_DC','$HA_SCALER'])
proceed = "1" or "y" or "yes" or "Yes" or "Y"
######## Configure Section ####### ######## Configure Section #######
import configure import configure
...@@ -81,6 +82,14 @@ if not conf.CheckFunc('printf'): ...@@ -81,6 +82,14 @@ if not conf.CheckFunc('printf'):
print('!! Your compiler and/or environment is not correctly configured.') print('!! Your compiler and/or environment is not correctly configured.')
Exit(0) Exit(0)
if baseenv.subst('$CHECKHEADERS')==proceed:
system_header_list = ['arpa/inet.h','errno.h','assert.h','netdb.h','netinet/in.h','pthread.h','signal.h','stddef.h','stdio.h','stdlib.h','string.h','strings.h','sys/ioctl.h','sys/socket.h','sys/time.h','sys/types.h','time.h','unistd.h','memory.h','math.h','limits.h']
for header_file in system_header_list:
if not conf.CheckHeader(header_file):
print('!! Header file %s not found.' % header_file)
Exit(0)
baseenv = conf.Finish() baseenv = conf.Finish()
######## ROOT Dictionaries ######### ######## ROOT Dictionaries #########
...@@ -124,7 +133,6 @@ def which(program): ...@@ -124,7 +133,6 @@ def which(program):
return exe_file return exe_file
return None return None
proceed = "1" or "y" or "yes" or "Yes" or "Y"
if baseenv.subst('$CPPCHECK')==proceed: if baseenv.subst('$CPPCHECK')==proceed:
is_cppcheck = which('cppcheck') is_cppcheck = which('cppcheck')
print "Path to cppcheck is %s\n" % is_cppcheck print "Path to cppcheck is %s\n" % is_cppcheck
......
...@@ -6,6 +6,7 @@ def config(env,args): ...@@ -6,6 +6,7 @@ def config(env,args):
debug = args.get('debug',0) debug = args.get('debug',0)
standalone = args.get('standalone',0) standalone = args.get('standalone',0)
cppcheck = args.get('cppcheck',0) cppcheck = args.get('cppcheck',0)
checkheaders = args.get('checkheaders',0)
if int(debug): if int(debug):
env.Append(CXXFLAGS = '-g -O0') env.Append(CXXFLAGS = '-g -O0')
...@@ -18,6 +19,9 @@ def config(env,args): ...@@ -18,6 +19,9 @@ def config(env,args):
if int(cppcheck): if int(cppcheck):
env.Append(CPPCHECK= '1') env.Append(CPPCHECK= '1')
if int(checkheaders):
env.Append(CHECKHEADERS= '1')
#env.Append(CXXFLAGS = '-Wall -Woverloaded-virtual -pthread -rdynamic') #env.Append(CXXFLAGS = '-Wall -Woverloaded-virtual -pthread -rdynamic')
env.Append(CXXFLAGS = '-Wall -Woverloaded-virtual -pthread') env.Append(CXXFLAGS = '-Wall -Woverloaded-virtual -pthread')
......
...@@ -6,6 +6,7 @@ def config(env,args): ...@@ -6,6 +6,7 @@ def config(env,args):
debug = args.get('debug',0) debug = args.get('debug',0)
standalone = args.get('standalone',0) standalone = args.get('standalone',0)
cppcheck = args.get('cppcheck',0) cppcheck = args.get('cppcheck',0)
checkheaders = args.get('checkheaders',0)
if int(debug): if int(debug):
env.Append(CXXFLAGS = '-g -O0') env.Append(CXXFLAGS = '-g -O0')
...@@ -18,6 +19,9 @@ def config(env,args): ...@@ -18,6 +19,9 @@ def config(env,args):
if int(cppcheck): if int(cppcheck):
env.Append(CPPCHECK= '1') env.Append(CPPCHECK= '1')
if int(checkheaders):
env.Append(CHECKHEADERS= '1')
env.Append(CXXFLAGS = '-m32 -Wall -Woverloaded-virtual') env.Append(CXXFLAGS = '-m32 -Wall -Woverloaded-virtual')
env.Append(CPPDEFINES = '-DLINUXVERS') env.Append(CPPDEFINES = '-DLINUXVERS')
......
...@@ -6,6 +6,7 @@ def config(env,args): ...@@ -6,6 +6,7 @@ def config(env,args):
debug = args.get('debug',0) debug = args.get('debug',0)
standalone = args.get('standalone',0) standalone = args.get('standalone',0)
cppcheck = args.get('cppcheck',0) cppcheck = args.get('cppcheck',0)
checkheaders = args.get('checkheaders',0)
if int(debug): if int(debug):
env.Append(CXXFLAGS = '-g -O0') env.Append(CXXFLAGS = '-g -O0')
...@@ -19,6 +20,9 @@ def config(env,args): ...@@ -19,6 +20,9 @@ def config(env,args):
if int(cppcheck): if int(cppcheck):
env.Append(CPPCHECK= '1') env.Append(CPPCHECK= '1')
if int(checkheaders):
env.Append(CHECKHEADERS= '1')
env.Append(CXXFLAGS = '-Wall -Woverloaded-virtual') env.Append(CXXFLAGS = '-Wall -Woverloaded-virtual')
env.Append(CPPDEFINES = '-DLINUXVERS') env.Append(CPPDEFINES = '-DLINUXVERS')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment