s3: libsmbclient: Add missing talloc stackframe.
[sfrench/samba-autobuild/.git] / third_party / waf / wafadmin / Tools / ar.py
1 #!/usr/bin/env python
2 # encoding: utf-8
3 # Thomas Nagy, 2006-2008 (ita)
4 # Ralf Habacker, 2006 (rh)
5
6 "ar and ranlib"
7
8 import os, sys
9 import Task, Utils
10 from Configure import conftest
11
12 ar_str = '${AR} ${ARFLAGS} ${AR_TGT_F}${TGT} ${AR_SRC_F}${SRC}'
13 cls = Task.simple_task_type('static_link', ar_str, color='YELLOW', ext_in='.o', ext_out='.bin', shell=False)
14 cls.maxjobs = 1
15 cls.install = Utils.nada
16
17 # remove the output in case it already exists
18 old = cls.run
19 def wrap(self):
20         try: os.remove(self.outputs[0].abspath(self.env))
21         except OSError: pass
22         return old(self)
23 setattr(cls, 'run', wrap)
24
25 def detect(conf):
26         conf.find_program('ar', var='AR')
27         conf.find_program('ranlib', var='RANLIB')
28         conf.env.ARFLAGS = 'rcs'
29
30 @conftest
31 def find_ar(conf):
32         v = conf.env
33         conf.check_tool('ar')
34         if not v['AR']: conf.fatal('ar is required for static libraries - not found')