~ubuntu-branches/ubuntu/utopic/tdb/utopic-proposed

« back to all changes in this revision

Viewing changes to buildtools/wafadmin/Tools/ar.py

  • Committer: Package Import Robot
  • Author(s): Andrew Bartlett
  • Date: 2013-02-12 20:43:55 UTC
  • mfrom: (1.4.6)
  • mto: (1.4.7) (3.3.7 experimental)
  • mto: This revision was merged to the branch mainline in revision 28.
  • Revision ID: package-import@ubuntu.com-20130212204355-6q6jvxshtoie7ex5
ImportĀ upstreamĀ versionĀ 1.2.11

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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')
 
35
 
 
36