summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-17 20:32:15 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:26:34 +1000
commit2b5a1cc70cbc5bafe6183300b131d95505c03b36 (patch)
treefdcb0321be5cfd39d13b0a03cfdbf4394e7ac7bc /lib
parent635a7ce6c1dfbfa2fd9ccefa0253a0a846a29f94 (diff)
downloadsamba-2b5a1cc70cbc5bafe6183300b131d95505c03b36.tar.gz
samba-2b5a1cc70cbc5bafe6183300b131d95505c03b36.tar.bz2
samba-2b5a1cc70cbc5bafe6183300b131d95505c03b36.zip
build: added waf build rules for ldb
Diffstat (limited to 'lib')
-rw-r--r--lib/replace/wafsamba.py45
-rw-r--r--lib/replace/wscript7
-rw-r--r--lib/talloc/wscript6
-rw-r--r--lib/tdb/wscript6
-rw-r--r--lib/tevent/wscript10
5 files changed, 55 insertions, 19 deletions
diff --git a/lib/replace/wafsamba.py b/lib/replace/wafsamba.py
index f57ce28417..7c05aeaf9c 100644
--- a/lib/replace/wafsamba.py
+++ b/lib/replace/wafsamba.py
@@ -1,7 +1,7 @@
# a waf tool to add autoconf-like macros to the configure section
# and for SAMBA_ macros for building libraries, binaries etc
-import Build
+import Build, os, Logs
from Configure import conf
@@ -45,14 +45,14 @@ def CHECK_FUNCS_IN(conf, list, library):
if conf.check(lib=library, uselib_store=library):
for f in list.split():
conf.check(function_name=f, lib=library, header_name=conf.env.hlist)
+ conf.env['LIB_' + library.upper()] = library
#################################################
# write out config.h in the right directory
@conf
def SAMBA_CONFIG_H(conf):
- import os
- if os.path.normpath(conf.curdir) == os.path.normpath(conf.srcdir):
- conf.write_config_header('config.h')
+ if os.path.normpath(conf.curdir) == os.path.normpath(os.environ.get('PWD')):
+ conf.write_config_header('config.h', top=True)
##############################################################
@@ -75,7 +75,7 @@ def set_rpath(bld):
if Options.is_install:
bld.env['RPATH'] = ['-Wl,-rpath=' + bld.env.PREFIX + '/lib']
else:
- bld.env.append_value('RPATH', '-Wl,-rpath=build/default')
+ bld.env.append_value('RPATH', '-Wl,-rpath=bin/lib')
Build.BuildContext.set_rpath = set_rpath
@@ -88,6 +88,16 @@ def SUBDIR(bld, subdir, list):
return ret
Build.BuildContext.SUBDIR = SUBDIR
+#################################################################
+# create the samba build environment
+def SAMBA_BUILD_ENV(bld):
+ bld(
+ target = 'binlib',
+ rule = 'test -d lib || mkdir -p lib && touch ${TGT}',
+ shell = True
+ )
+Build.BuildContext.SAMBA_BUILD_ENV = SAMBA_BUILD_ENV
+
################################################################
# this will contain the set of includes needed per Samba library
@@ -127,21 +137,40 @@ def SAMBA_LIBRARY(bld, libname, source_list,
features = 'cc cshlib',
source = source_list,
target=libname,
- includes='. ' + ilist,
+ includes='. ' + os.environ.get('PWD') + '/bin/default ' + ilist,
vnum=vnum)
+
+ # put a link to the library in bin/lib
+ soext=""
+ if vnum is not None:
+ soext = '.' + vnum.split('.')[0]
+ bld(
+ source = 'lib%s.so' % libname,
+ rule = 'ln -sf ../${SRC}%s lib' % soext,
+ after = 'binlib'
+ )
bld.SAMBA_LIBRARY_INCLUDES[libname] = ilist
bld.SAMBA_LIBRARY_DEPS[libname] = libdeps
Build.BuildContext.SAMBA_LIBRARY = SAMBA_LIBRARY
#################################################################
# define a Samba binary
-def SAMBA_BINARY(bld, binname, source_list, libdeps='', include_list=''):
+def SAMBA_BINARY(bld, binname, source_list, libdeps='', syslibs='', include_list=''):
+ #print('binname=%s libs=%s' % (binname, bld.SAMBA_LIBRARY_LIB_LIST(libdeps)))
bld(
features = 'cc cprogram',
source = source_list,
target = binname,
uselib_local = bld.SAMBA_LIBRARY_LIB_LIST(libdeps),
- includes = '. ' + bld.SAMBA_LIBRARY_INCLUDE_LIST(libdeps) + include_list)
+ uselib = syslibs,
+ includes = '. ' + os.environ.get('PWD') + '/bin/default ' + bld.SAMBA_LIBRARY_INCLUDE_LIST(libdeps) + include_list,
+ top=True)
+ # put a link to the binary in bin/
+ bld(
+ source = binname,
+ rule = 'ln -sf ${SRC} .',
+ )
+
Build.BuildContext.SAMBA_BINARY = SAMBA_BINARY
############################################################
diff --git a/lib/replace/wscript b/lib/replace/wscript
index c2e545f882..5c1975bf5f 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -1,5 +1,5 @@
-srcdir = '.'
-blddir = 'build'
+srcdir = '../..'
+blddir = 'bin'
import Options, os, wafsamba
@@ -89,6 +89,7 @@ def configure(conf):
conf.CHECK_FUNCS('timegm getifaddrs freeifaddrs')
conf.CHECK_FUNCS_IN('dlopen dlsym dlerror dlclose', 'dl')
+ conf.CHECK_FUNCS_IN('poptGetContext', 'popt')
conf.check_cc(fragment='''
#include <stdarg.h>
@@ -153,6 +154,8 @@ def build(bld):
REPLACE_SOURCE = 'replace.c snprintf.c'
+ bld.SAMBA_BUILD_ENV()
+
bld.SAMBA_LIBRARY('replace',
REPLACE_SOURCE)
diff --git a/lib/talloc/wscript b/lib/talloc/wscript
index 989a8a8b41..ad8ef3bd45 100644
--- a/lib/talloc/wscript
+++ b/lib/talloc/wscript
@@ -1,9 +1,9 @@
VERSION = '2.0.1'
-srcdir = '.'
-blddir = 'build'
+srcdir = '../..'
+blddir = 'bin'
-LIBREPLACE_DIR='../replace'
+LIBREPLACE_DIR= srcdir + '/lib/replace'
def set_options(opt):
opt.recurse(LIBREPLACE_DIR)
diff --git a/lib/tdb/wscript b/lib/tdb/wscript
index c746af6def..d3184d4922 100644
--- a/lib/tdb/wscript
+++ b/lib/tdb/wscript
@@ -1,9 +1,9 @@
VERSION='1.2.1'
-srcdir = '.'
-blddir = 'build'
+srcdir = '../..'
+blddir = 'bin'
-LIBREPLACE_DIR='../replace'
+LIBREPLACE_DIR= srcdir + '/lib/replace'
def set_options(opt):
opt.recurse(LIBREPLACE_DIR)
diff --git a/lib/tevent/wscript b/lib/tevent/wscript
index 87d6037aea..aaa3ce7fb7 100644
--- a/lib/tevent/wscript
+++ b/lib/tevent/wscript
@@ -1,15 +1,18 @@
VERSION = '0.9.8'
-srcdir = '.'
-blddir = 'build'
+srcdir = '../..'
+blddir = 'bin'
-LIBREPLACE_DIR='../replace'
+LIBREPLACE_DIR= srcdir + '/lib/replace'
+LIBTALLOC_DIR= srcdir + '/lib/talloc'
def set_options(opt):
opt.recurse(LIBREPLACE_DIR)
+ opt.recurse(LIBTALLOC_DIR)
def configure(conf):
conf.sub_config(LIBREPLACE_DIR)
+ conf.sub_config(LIBTALLOC_DIR)
conf.CHECK_HEADERS('sys/epoll.h')
conf.CHECK_FUNCS('epoll_create')
@@ -18,6 +21,7 @@ def configure(conf):
def build(bld):
bld.add_subdirs(LIBREPLACE_DIR)
+ bld.add_subdirs(LIBTALLOC_DIR)
SRC = '''tevent.c tevent_debug.c tevent_epoll.c tevent_fd.c tevent_immediate.c
tevent_queue.c tevent_req.c tevent_select.c