summaryrefslogtreecommitdiffstats
path: root/3rdparty/openpgm-svn-r1085/pgm/examples/SConscript
diff options
context:
space:
mode:
Diffstat (limited to '3rdparty/openpgm-svn-r1085/pgm/examples/SConscript')
-rw-r--r--3rdparty/openpgm-svn-r1085/pgm/examples/SConscript88
1 files changed, 88 insertions, 0 deletions
diff --git a/3rdparty/openpgm-svn-r1085/pgm/examples/SConscript b/3rdparty/openpgm-svn-r1085/pgm/examples/SConscript
new file mode 100644
index 0000000..46ebce3
--- /dev/null
+++ b/3rdparty/openpgm-svn-r1085/pgm/examples/SConscript
@@ -0,0 +1,88 @@
+# -*- mode: python -*-
+# OpenPGM build script
+# $Id$
+
+import os;
+
+Import('env');
+e = env.Clone();
+e.Prepend(LIBS = ['libpgm']);
+p = e.Clone();
+if '-DCONFIG_HAVE_GETOPT' in env['CCFLAGS']:
+ getopt = []
+else:
+ getopt = ['getopt.c']
+
+if e['WITH_GLIB'] == 'true':
+ e.Prepend(LIBS = ['libpgmex']);
+ e.MergeFlags(env['GLIB_FLAGS']);
+ e2 = e.Clone();
+ if e2['WITH_SNMP'] == 'true':
+ e2.Append(CCFLAGS = ['-DCONFIG_WITH_SNMP']);
+ e2.Prepend(LIBS = ['libpgmsnmp']);
+ e2.MergeFlags(e['SNMP_FLAGS']);
+ if e2['WITH_HTTP'] == 'true':
+ e2.Append(CCFLAGS = ['-DCONFIG_WITH_HTTP']);
+ e2.Prepend(LIBS = ['libpgmhttp']);
+
+# core preferred examples
+ e.Program(['pgmdump.c'])
+ e2.Program(['pgmsend.c'])
+ e2.Program(['pgmrecv.c'])
+
+# sync examples
+ e.Program(['blocksyncrecv.c'])
+ e.Program(['snonblocksyncrecv.c'])
+ if '-DCONFIG_HAVE_POLL' in e['CCFLAGS']:
+ e.Program(['pnonblocksyncrecv.c'])
+
+# epoll based examples
+ if '-DCONFIG_HAVE_EPOLL' in e['CCFLAGS']:
+ e.Program(['enonblocksyncrecv.c'])
+ e.Program(['enonblocksyncrecvmsg.c'])
+ e.Program(['enonblocksyncrecvmsgv.c'])
+
+# ncurses examples
+ if e['WITH_NCURSES'] == 'true':
+ en = e.Clone()
+ en.Append(LIBS = ['panel', 'ncurses']);
+ en.Program(['pgmtop.c'])
+
+# Google Protocol Buffer example
+ if e['WITH_PROTOBUF'] == 'true':
+ ep = e2.Clone();
+ newCCFLAGS = [];
+ for flag in ep['CCFLAGS']:
+ if ("-W" != flag[:2]) and ("-std=gnu99" != flag[:10]) and ("-pedantic" != flag[:9]) and ("-D_XOPEN_SOURCE=600" != flag[:19]) and ("-xc99=all" != flag[:9]):
+ newCCFLAGS.append(flag);
+ if ("-D_XOPEN_SOURCE=600" == flag[:19]):
+ newCCFLAGS.append("-D_XOPEN_SOURCE=500");
+ ep['CCFLAGS'] = newCCFLAGS;
+ ep.Append(CPPPATH = '.');
+ ep.Append(CCFLAGS = ep['PROTOBUF_CCFLAGS']);
+ ep.Depends('pgmping.cc', ['ping.pb.cc', 'ping.pb.h']);
+ protobuf = Builder(action = 'cd ${SOURCE.dir} && %s ${SOURCE.file} --cpp_out=../${TARGET.dir}' % ep['PROTOBUF_PROTOC'])
+ ep.Append(BUILDERS = {'Protobuf' : protobuf})
+ ep.Protobuf('ping.pb.cc', 'ping.proto')
+ ep.Program(['pgmping.cc', 'ping.pb.cc', ep['PROTOBUF_LIBS']])
+
+# Vanilla example
+p.Program(['purinsend.c'] + getopt)
+p.Program(['purinrecv.c'] + getopt)
+p.Program(['daytime.c'] + getopt)
+p.Program(['shortcakerecv.c', 'async.c'] + getopt)
+
+# Vanilla C++ example
+if e['WITH_CC'] == 'true':
+ pcc = p.Clone();
+ newCCFLAGS = [];
+ for flag in pcc['CCFLAGS']:
+ if ("-W" != flag[:2]) and ("-std=gnu99" != flag[:10]) and ("-pedantic" != flag[:9]) and ("-D_XOPEN_SOURCE=600" != flag[:19]) and ("-xc99=all" != flag[:9]):
+ newCCFLAGS.append(flag);
+ if ("-D_XOPEN_SOURCE=600" == flag[:19]):
+ newCCFLAGS.append("-D_XOPEN_SOURCE=500");
+ pcc['CCFLAGS'] = newCCFLAGS;
+ pcc.Program('purinsendcc', ['purinsendcc.cc'] + p.Object(getopt))
+ pcc.Program('purinrecvcc', ['purinrecvcc.cc'] + p.Object(getopt))
+
+# end of file