summaryrefslogtreecommitdiff
path: root/lib/replace/autoconf.py
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-02-20 16:25:37 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:26:33 +1000
commit9757da515d4f9927255cfa293974ec6fe3437aa4 (patch)
tree631ca5b9747d2211ddf0c0e208d37aab8169cee2 /lib/replace/autoconf.py
parent55e1af856ee64670c7ee925676d13f48ffcdd6ad (diff)
downloadsamba-9757da515d4f9927255cfa293974ec6fe3437aa4.tar.gz
samba-9757da515d4f9927255cfa293974ec6fe3437aa4.tar.bz2
samba-9757da515d4f9927255cfa293974ec6fe3437aa4.zip
build: a first attempt at waf build for talloc and libreplace
very rough so far
Diffstat (limited to 'lib/replace/autoconf.py')
-rw-r--r--lib/replace/autoconf.py46
1 files changed, 46 insertions, 0 deletions
diff --git a/lib/replace/autoconf.py b/lib/replace/autoconf.py
new file mode 100644
index 0000000000..cb7e7f0bc7
--- /dev/null
+++ b/lib/replace/autoconf.py
@@ -0,0 +1,46 @@
+# a waf tool to add autoconf-like macros to the configure section
+
+from Configure import conf
+
+@conf
+def DEFUN(conf, d, v):
+ conf.define(d, v, quote=False)
+ conf.env.append_value('CCDEFINES', d + '=' + str(v))
+
+@conf
+def CHECK_HEADERS(conf, list):
+ for hdr in list.rsplit(' '):
+ if conf.check(header_name=hdr):
+ conf.env.hlist.append(hdr)
+
+@conf
+def CHECK_TYPES(conf, list):
+ for t in list.rsplit(' '):
+ conf.check(type_name=t, header_name=conf.env.hlist)
+
+@conf
+def CHECK_TYPE_IN(conf, t, hdr):
+ if conf.check(header_name=hdr):
+ conf.check(type_name=t, header_name=hdr)
+
+@conf
+def CHECK_TYPE(conf, t, alternate):
+ if not conf.check(type_name=t, header_name=conf.env.hlist):
+ conf.DEFUN(t, alternate)
+
+@conf
+def CHECK_FUNCS(conf, list):
+ for f in list.rsplit(' '):
+ conf.check(function_name=f, header_name=conf.env.hlist)
+
+@conf
+def CHECK_FUNCS_IN(conf, list, library):
+ if conf.check(lib=library, uselib_store=library):
+ for f in list.rsplit(' '):
+ conf.check(function_name=f, lib=library, header_name=conf.env.hlist)
+
+@conf
+def check_rpath(conf):
+ # this should check if rpath works
+ conf.env.append_value('RPATH', '-Wl,-rpath=build/default')
+