summaryrefslogtreecommitdiffstats
path: root/3rdparty/openpgm-svn-r1085/pgm/SConscript.libpgmhttp
blob: 9824b3c3662658e5404e9320ee195b8c8b7d90d3 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# -*- 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