# -*- mode: python -*- # OpenPGM build script # $Id$ Import('env') e = env.Clone() e.Append(CCFLAGS = '-DGETTEXT_PACKAGE=\'"pgm-http"\''); # add binary tree to include path to find embedded htdocs e.Append(CPPPATH = ['.']); src = Split(""" http.c """) htdocs = Split(""" htdocs/404.html htdocs/base.css htdocs/robots.txt htdocs/xhtml10_strict.doctype """) pgmhttp = e.StaticLibrary('libpgmhttp', src); pgmhttppic = e.StaticSharedLibrary('libpgmhttp-pic', src); # embed htdocs into C headers embed_htdoc = Builder(action = './htdocs/convert_to_macro.pl $SOURCE > $TARGET') e.Append(BUILDERS = {'EmbedHtdoc' : embed_htdoc}) for htdoc in htdocs: embedded = htdoc + '.h' e.EmbedHtdoc(embedded, htdoc) #----------------------------------------------------------------------------- # unit testing if env['WITH_CHECK'] == 'true': te = e.Clone(); # add new suffix so we can re-use libpgm objects te['SHOBJSUFFIX'] = '.http' + te['SHOBJSUFFIX']; te['OBJSUFFIX'] = '.http' + te['OBJSUFFIX']; newCCFLAGS = []; for flag in te['CCFLAGS']: if ("-W" != flag[:2]) and ("-pedantic" != flag[:9]): newCCFLAGS.append(flag); te['CCFLAGS'] = newCCFLAGS; te.ParseConfig ('pkg-config --cflags --libs check'); te.Program (['http_unittest.c', te.Object('sockaddr.c'), te.Object('getifaddrs.c')]); # end of file