Browse Source

waf: installation of jack.pc

git-svn-id: http://subversion.jackaudio.org/jack/jack2/trunk/jackmp@2476 0c269be4-1314-0410-8aa9-9f06e86f4224
tags/1.90
nedko 17 years ago
parent
commit
0ef358ccbe
2 changed files with 49 additions and 0 deletions
  1. +48
    -0
      common/wscript
  2. +1
    -0
      wscript

+ 48
- 0
common/wscript View File

@@ -1,6 +1,40 @@
#! /usr/bin/env python
# encoding: utf-8

import re
import os

# by default waf subst tool uses @VAR@ while scons legacy is ${VAR}
# so we use same template as scons for now
def subst_func(tsk):
"Substitutes variables in a .in file"

m4_re = re.compile('\$\{(\w+)\}', re.M)

env = tsk.env()
infile = tsk.m_inputs[0].abspath(env)
outfile = tsk.m_outputs[0].abspath(env)

file = open(infile, 'r')
code = file.read()
file.close()

s = m4_re.sub(r'%(\1)s', code)

dict = tsk.dict
if not dict:
names = m4_re.findall(code)
for i in names:
if env[i] and type(env[i]) is types.ListType :
dict[i] = " ".join(env[i])
else: dict[i] = env[i]

file = open(outfile, 'w')
file.write(s % dict)
file.close()

return 0

def build(bld):
common_libsources = [
'JackActivationCount.cpp',
@@ -88,3 +122,17 @@ def build(bld):
netmanager_lib.source = 'JackNetManager.cpp'

install_files('PREFIX', 'jack', 'jack/*.h')

# process jack.pc.in -> jack.pc
obj = bld.create_obj('subst')
obj.source = '../jack.pc.in'
obj.target = 'jack.pc'
obj.dict = {'PREFIX': bld.env()['PREFIX'],
'LIBDIR': os.path.normpath(bld.env()['PREFIX'] + '/lib'),
'INCLUDEDIR': os.path.normpath(bld.env()['PREFIX'] + '/include'),
'SERVERLIB': serverlib.target,
'JACK_VERSION': bld.env()['JACK_VERSION'],
}
obj.inst_var = bld.env()['PREFIX']
obj.inst_dir = '/lib/pkgconfig/'
obj.fun = subst_func # @VAR@ -> ${VAR}

+ 1
- 0
wscript View File

@@ -58,6 +58,7 @@ def configure(conf):
conf.env['LIB_DL'] = ['dl']
conf.env['LIB_RT'] = ['rt']
conf.env['JACK_API_VERSION'] = JACK_API_VERSION
conf.env['JACK_VERSION'] = VERSION

conf.define('ADDON_DIR', os.path.normpath(conf.env['PREFIX'] + '/lib/jack'))
conf.define('JACK_LOCATION', os.path.normpath(conf.env['PREFIX'] + '/bin'))


Loading…
Cancel
Save