s4-waf: removed the unused installdir= option to SAMBA_BINARY()
[kai/samba.git] / buildtools / wafsamba / wafsamba.py
index 55ae36a247a366d53260b11b279c9526b84415cf..a750a161c9dbba8f418dd2d84aa2dbaf867746be 100644 (file)
@@ -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, os, Options, Task, Utils, cc, TaskGen, fnmatch, re, shutil, Logs
+import Build, os, Options, Task, Utils, cc, TaskGen, fnmatch, re, shutil, Logs, Constants
 from Configure import conf
 from Logs import debug
 from samba_utils import SUBST_VARS_RECURSIVE
@@ -20,6 +20,7 @@ from samba_deps import *
 from samba_bundled import *
 import samba_install
 import samba_conftests
+import samba_abi
 import tru64cc
 import irixcc
 import generic_cc
@@ -35,6 +36,19 @@ LIB_PATH="shared"
 
 os.putenv('PYTHONUNBUFFERED', '1')
 
+
+if Constants.HEXVERSION < 0x105016:
+    Logs.error('''
+Please use the version of waf that comes with Samba, not
+a system installed version. See http://wiki.samba.org/index.php/Waf
+for details.
+
+Alternatively, please use ./autogen-waf.sh, and then
+run ./configure and make as usual. That will call the right version of waf.
+''')
+    sys.exit(1)
+
+
 @conf
 def SAMBA_BUILD_ENV(conf):
     '''create the samba build environment'''
@@ -95,6 +109,9 @@ def SAMBA_LIBRARY(bld, libname, source,
                   target_type='LIBRARY',
                   bundled_extension=True,
                   link_name=None,
+                  abi_file=None,
+                  abi_match=None,
+                  hide_symbols=False,
                   enabled=True):
     '''define a Samba library'''
 
@@ -129,6 +146,7 @@ def SAMBA_LIBRARY(bld, libname, source,
                         autoproto      = autoproto,
                         depends_on     = depends_on,
                         needs_python   = needs_python,
+                        hide_symbols   = hide_symbols,
                         local_include  = local_include)
 
     if libname == obj_target:
@@ -152,6 +170,11 @@ def SAMBA_LIBRARY(bld, libname, source,
         features += ' pyext'
     elif needs_python:
         features += ' pyembed'
+    if abi_file:
+        features += ' abi_check'
+
+    if abi_file:
+        abi_file = os.path.join(bld.curdir, abi_file)
 
     bld.SET_BUILD_GROUP(group)
     t = bld(
@@ -168,18 +191,14 @@ def SAMBA_LIBRARY(bld, libname, source,
         samba_inst_path = install_path,
         name           = libname,
         samba_realname  = realname,
-        samba_install   = install
+        samba_install   = install,
+        abi_file        = abi_file,
+        abi_match       = abi_match
         )
 
     if link_name:
         t.link_name = link_name
 
-    if autoproto is not None:
-        bld.SAMBA_AUTOPROTO(autoproto, source)
-
-    if public_headers is not None:
-        bld.PUBLIC_HEADERS(public_headers, header_path=header_path)
-
     if pc_files is not None:
         bld.PKG_CONFIG_FILES(pc_files, vnum=vnum)
 
@@ -193,11 +212,11 @@ def SAMBA_BINARY(bld, binname, source,
                  public_headers=None,
                  header_path=None,
                  modules=None,
-                 installdir=None,
                  ldflags=None,
                  cflags='',
                  autoproto=None,
                  use_hostcc=False,
+                 use_global_deps=True,
                  compiler=None,
                  group='binaries',
                  manpages=None,
@@ -233,7 +252,8 @@ def SAMBA_BINARY(bld, binname, source,
                         subsystem_name = subsystem_name,
                         needs_python   = needs_python,
                         local_include  = local_include,
-                        use_hostcc     = use_hostcc)
+                        use_hostcc     = use_hostcc,
+                        use_global_deps= use_global_deps)
 
     bld.SET_BUILD_GROUP(group)
 
@@ -263,10 +283,6 @@ def SAMBA_BINARY(bld, binname, source,
     if subsystem_name is not None:
         bld.TARGET_ALIAS(subsystem_name, binname)
 
-    if autoproto is not None:
-        bld.SAMBA_AUTOPROTO(autoproto, source)
-    if public_headers is not None:
-        bld.PUBLIC_HEADERS(public_headers, header_path=header_path)
 Build.BuildContext.SAMBA_BINARY = SAMBA_BINARY
 
 
@@ -359,7 +375,9 @@ def SAMBA_SUBSYSTEM(bld, modname, source,
                     subsystem_name=None,
                     enabled=True,
                     use_hostcc=False,
+                    use_global_deps=True,
                     vars=None,
+                    hide_symbols=False,
                     needs_python=False):
     '''define a Samba subsystem'''
 
@@ -389,14 +407,15 @@ def SAMBA_SUBSYSTEM(bld, modname, source,
         features       = features,
         source         = source,
         target         = modname,
-        samba_cflags   = CURRENT_CFLAGS(bld, modname, cflags),
+        samba_cflags   = CURRENT_CFLAGS(bld, modname, cflags, hide_symbols=hide_symbols),
         depends_on     = depends_on,
         samba_deps     = TO_LIST(deps),
         samba_includes = includes,
         local_include  = local_include,
         local_include_first  = local_include_first,
         samba_subsystem= subsystem_name,
-        samba_use_hostcc = use_hostcc
+        samba_use_hostcc = use_hostcc,
+        samba_use_global_deps = use_global_deps
         )
 
     if cflags_end is not None: