Skip to content
Snippets Groups Projects
Commit acd74e02 authored by Edward Brash's avatar Edward Brash
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 6e7c2485
No related branches found
No related tags found
No related merge requests found
# ignore patterns
# Auto generated files
cppcheck_report.txt
HallCDict.cxx
HallCDict.C
HallCDict.h
......
......@@ -64,6 +64,7 @@ ivercode = 65536*int(float(baseenv.subst('$SOVERSION')))+ 256*int(10*(float(base
baseenv.Append(VERCODE = ivercode)
baseenv.Append(CPPPATH = ['$HC_SRC','$HA_SRC','$HA_DC','$HA_SCALER'])
proceed = "1" or "y" or "yes" or "Yes" or "Y"
######## Configure Section #######
import configure
......@@ -81,6 +82,14 @@ if not conf.CheckFunc('printf'):
print('!! Your compiler and/or environment is not correctly configured.')
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()
######## ROOT Dictionaries #########
......@@ -124,7 +133,6 @@ def which(program):
return exe_file
return None
proceed = "1" or "y" or "yes" or "Yes" or "Y"
if baseenv.subst('$CPPCHECK')==proceed:
is_cppcheck = which('cppcheck')
print "Path to cppcheck is %s\n" % is_cppcheck
......
......@@ -6,6 +6,7 @@ def config(env,args):
debug = args.get('debug',0)
standalone = args.get('standalone',0)
cppcheck = args.get('cppcheck',0)
checkheaders = args.get('checkheaders',0)
if int(debug):
env.Append(CXXFLAGS = '-g -O0')
......@@ -18,6 +19,9 @@ def config(env,args):
if int(cppcheck):
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')
......
......@@ -6,6 +6,7 @@ def config(env,args):
debug = args.get('debug',0)
standalone = args.get('standalone',0)
cppcheck = args.get('cppcheck',0)
checkheaders = args.get('checkheaders',0)
if int(debug):
env.Append(CXXFLAGS = '-g -O0')
......@@ -18,6 +19,9 @@ def config(env,args):
if int(cppcheck):
env.Append(CPPCHECK= '1')
if int(checkheaders):
env.Append(CHECKHEADERS= '1')
env.Append(CXXFLAGS = '-m32 -Wall -Woverloaded-virtual')
env.Append(CPPDEFINES = '-DLINUXVERS')
......
......@@ -6,6 +6,7 @@ def config(env,args):
debug = args.get('debug',0)
standalone = args.get('standalone',0)
cppcheck = args.get('cppcheck',0)
checkheaders = args.get('checkheaders',0)
if int(debug):
env.Append(CXXFLAGS = '-g -O0')
......@@ -19,6 +20,9 @@ def config(env,args):
if int(cppcheck):
env.Append(CPPCHECK= '1')
if int(checkheaders):
env.Append(CHECKHEADERS= '1')
env.Append(CXXFLAGS = '-Wall -Woverloaded-virtual')
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