samba_version: When working from git checkout, display git revision SHA1 rather
[abartlet/samba.git/.git] / source4 / wscript
index cbc0bf49ac2d5e66caab3fe631344db4ba246502..bf4ccbdfcaedde954f280ca0049cd2e4205dc78d 100644 (file)
@@ -18,7 +18,7 @@ def load_version(have_git=False):
     if not have_git:
         env = samba_utils.LOAD_ENVIRONMENT()
         have_git = 'GIT' in env
-    version = wafsamba.samba_version_file("./VERSION", have_git=have_git)
+    version = wafsamba.samba_version_file("./VERSION", "..", have_git=have_git)
     Utils.g_module.VERSION = version.STRING
     return version
 
@@ -118,6 +118,12 @@ def configure(conf):
     # resolution of symbols
     conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)
 
+    # gentoo always adds this. We want our normal build to be as
+    # strict as the strictest OS we support, so adding this here
+    # allows us to find problems on our development hosts faster.
+    # It also results in faster load time.
+    conf.ADD_LDFLAGS('-Wl,--as-needed', testflags=True)
+
     # we don't want PYTHONDIR in config.h, as otherwise changing
     # --prefix causes a complete rebuild
     del(conf.env.defines['PYTHONDIR'])
@@ -128,7 +134,7 @@ def etags(ctx):
     '''build TAGS file using etags'''
     import Utils
     source_root = os.path.dirname(Utils.g_module.root_path)
-    cmd = 'etags $(find %s/.. -name "*.[ch]")' % source_root
+    cmd = 'etags $(find %s/.. -name "*.[ch]" | egrep -v \.inst\.)' % source_root
     print("Running: %s" % cmd)
     os.system(cmd)
 
@@ -136,7 +142,7 @@ def ctags(ctx):
     "build 'tags' file using ctags"
     import Utils
     source_root = os.path.dirname(Utils.g_module.root_path)
-    cmd = 'ctags $(find %s/.. -name "*.[ch]" | grep -v "*_proto\.h")' % source_root
+    cmd = 'ctags $(find %s/.. -name "*.[ch]" | grep -v "*_proto\.h" | egrep -v \.inst\.)' % source_root
     print("Running: %s" % cmd)
     os.system(cmd)
 
@@ -150,7 +156,7 @@ def build(bld):
 
 def pydoctor(ctx):
     '''build python apidocs'''
-    cmd='LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --project-name=Samba --project-url=http://www.samba.org --make-html --docformat=restructuredtext --add-package bin/python/samba'
+    cmd='PYTHONPATH=bin/python pydoctor --project-name=Samba --project-url=http://www.samba.org --make-html --docformat=restructuredtext --add-package bin/python/samba'
     print("Running: %s" % cmd)
     os.system(cmd)
 
@@ -160,7 +166,7 @@ def wafdocs(ctx):
     os.system('pwd')
     list = recursive_dirlist('../buildtools/wafsamba', '.', pattern='*.py')
 
-    cmd='LD_LIBRARY_PATH=bin/shared PYTHONPATH=bin/python pydoctor --project-name=wafsamba --project-url=http://www.samba.org --make-html --docformat=restructuredtext'
+    cmd='PYTHONPATH=bin/python pydoctor --project-name=wafsamba --project-url=http://www.samba.org --make-html --docformat=restructuredtext'
     print(list)
     for f in list:
         cmd += ' --add-module %s' % f