blob: 50660ea8be1eed42a833829e28f4981bb84cf575 [file] [log] [blame]
akmhoquefa8ee9b2014-03-14 09:06:24 -05001#! /usr/bin/env python
2# encoding: utf-8
3# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
4
5from waflib import Utils
6from waflib.Configure import conf
7@conf
8def d_platform_flags(self):
9 v=self.env
10 if not v.DEST_OS:
11 v.DEST_OS=Utils.unversioned_sys_platform()
12 binfmt=Utils.destos_to_binfmt(self.env.DEST_OS)
13 if binfmt=='pe':
14 v['dprogram_PATTERN']='%s.exe'
15 v['dshlib_PATTERN']='lib%s.dll'
16 v['dstlib_PATTERN']='lib%s.a'
17 elif binfmt=='mac-o':
18 v['dprogram_PATTERN']='%s'
19 v['dshlib_PATTERN']='lib%s.dylib'
20 v['dstlib_PATTERN']='lib%s.a'
21 else:
22 v['dprogram_PATTERN']='%s'
23 v['dshlib_PATTERN']='lib%s.so'
24 v['dstlib_PATTERN']='lib%s.a'
25DLIB='''
26version(D_Version2) {
27 import std.stdio;
28 int main() {
29 writefln("phobos2");
30 return 0;
31 }
32} else {
33 version(Tango) {
34 import tango.stdc.stdio;
35 int main() {
36 printf("tango");
37 return 0;
38 }
39 } else {
40 import std.stdio;
41 int main() {
42 writefln("phobos1");
43 return 0;
44 }
45 }
46}
47'''
48@conf
49def check_dlibrary(self,execute=True):
50 ret=self.check_cc(features='d dprogram',fragment=DLIB,compile_filename='test.d',execute=execute,define_ret=True)
51 if execute:
52 self.env.DLIBRARY=ret.strip()