1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-23 17:34:34 +03:00
Commit Graph

1058 Commits

Author SHA1 Message Date
Jelmer Vernooij
48ebeaa4aa Add private_headers flag to SAMBA_*() functions.
While this argument is correctly ignored, it does mean that we can
associate private headers with specific subsystems/libraries.

Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-By: Andrew Bartlett <abartlet@samba.org>
Reviewed-By: Stefan Metzmacher <metze@samba.org>
2016-01-13 04:43:22 +01:00
Andrew Bartlett
78e9f1effb build: Add space before -D option
This ensures that it is not concatonated with the previous option

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jan  8 02:36:47 CET 2016 on sn-devel-144
2016-01-08 02:36:47 +01:00
Andrew Bartlett
46b8d7fc52 python: Assert that we use Py_ssize_t consistently for PyParseArgs*()
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2016-01-07 23:33:10 +01:00
Thomas Nagy
d60465cfec build:wafsamba: Use the upstream version of gccdeps
This removes the duplicate gccdeps file provided in the Samba tree.
The two files buildtools/wafsamba/gccdeps.py and thirdparty/wafadmin/3rdparty/gccdeps.py
are identical except for the whitespaces (compare them with `diff -burN`)

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>

Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Sat Jan  2 22:31:56 CET 2016 on sn-devel-144
2016-01-02 22:31:56 +01:00
Thomas Nagy
3b2ae078a5 build:wafsamba: Ensure that check_group_ordering can be overridden
Group ordering verifications are performed by default in Waf 1.8,
so this method will be redundant. The purpose of this change is
to make it easier to disable check_group_ordering as it contains
code that is very specific to Waf 1.5.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Nov 24 08:03:29 CET 2015 on sn-devel-104
2015-11-24 08:03:29 +01:00
Thomas Nagy
735cf0683d build:wafsamba: Ensure that target clones get a different name
Changing the 'target' attribute results in a different file name,
which is visibly necessary. Yet the 'name' attribute should also
be modified even if invisible as it is used to query targets
(uselib for example). Failing to do so results in errors in Waf 1.8.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-11-24 05:00:27 +01:00
Thomas Nagy
cc4f7e3933 build:wafsamba: Specify whether node objects or flat lists in ant_glob
The changes enable the ant_glob declaration to be compatible with
more recent versions of Waf.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-11-24 05:00:27 +01:00
Thomas Nagy
5036c6e744 build:wafsamba: remove check_orphaned_targets
The function check_orphaned_targets is not used and has
no specification, so it can be removed safely.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Nov 19 13:10:53 CET 2015 on sn-devel-104
2015-11-19 13:10:53 +01:00
Thomas Nagy
db99742d8b build:wafsamba: Waf 1.8 compatible declaration of 'mandatory' configuration tests
The configuration tests raise exceptions by default in later Waf versions,
but the samba tests do not specify whether the errors should be raised or
not. This changes lifts the ambiguity.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Nov 16 14:50:39 CET 2015 on sn-devel-104
2015-11-16 14:50:38 +01:00
Thomas Nagy
cfe8becb9e build:wafsamba: Replace Options.is_install by bld.is_install
Options.is_install is a deprecated module variable that is more
verbose than bld.is_install and complicates the Waf 1.8 upgrade.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-11-16 11:48:14 +01:00
Thomas Nagy
f3033a1943 build:wafsamba: Remove the print_commands code from the build scripts
Using the print_commands tool makes it easier to upgrade to Waf 1.8.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Uri Simchoni uri@samba.org
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-11-06 10:37:24 +01:00
Thomas Nagy
963ccff806 build:wafsamba: Remove samba_utils.runonce
The decorator order matters in the following:
"""
@runonce
@conf
function()
"""

First, the @conf decorator binds the function to the configuration context
and then returns the same function. The @runonce decorator then takes
the output function and replaces it by another that performs caching. This new
function remains in the current script and is never bound to the configuration
context, so caching never occurs.

The declaration would have been correct if written like this:
"""
@conf
@runonce
function()
"""

Yet the decorator @run_once does not keep the function name (__name__), so the
annotation with @conf would fail. The straightforward approach is to remove
all the incorrect @runonce occurrences.

Besides that, the function Utils.run_once is already present in the Waf library,
and is sufficient for the current needs of the Samba code (it caches only the
first argument). Therefore samba_utils.runonce can be safely replaced by
Utils.run_once, which is also present in Waf 1.8.

Note: at runtime, only SETUP_BUILD_GROUPS seems to actually use caching.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Uri Simchoni uri@samba.org
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-11-06 10:37:24 +01:00
Thomas Nagy
9731979098 build:wafsamba: Moved samba_before_apply_obj_vars to samba_utils
The function samba_before_apply_obj_vars serves to remove system paths,
it is certainly not an optimisation and has no place in that module.
By optimisation, we mean that the build process could run without it.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Uri Simchoni uri@samba.org
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-11-06 10:37:24 +01:00
Thomas Nagy
40a2deb520 build:wafsamba: Removed unnecessary and misleading variables
There is no 'allow_duplicates' attribute anywhere.
The function 'check_duplicate_sources' always returns True unless it raises an exception
There is no list of source files to use
The variable 'tstart' is unused

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Uri Simchoni uri@samba.org
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-11-06 10:37:24 +01:00
Petr Viktorin
c54fc3f2b6 ldb: Run the Python testsuite
Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-11-05 18:04:23 +01:00
Stefan Metzmacher
b06544da6f wafsamba: detect programmer errors in CHECK_BUNDLED_SYSTEM()
All prerequisite libraries of CHECK_BUNDLED_SYSTEM[_PKG](onlyif='lib1 lib2')
need to be checked before.

That means conf.env['FOUND_SYSTEMLIB_lib1'] and conf.env['FOUND_SYSTEMLIB_lib2']
need to exist independed of its value (True or False). Otherwise this is a logic error.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=11458

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Wed Nov  4 18:38:18 CET 2015 on sn-devel-104
2015-11-04 18:38:18 +01:00
Thomas Nagy
861018f143 build:wafsamba: Remove the now unneeded special treatment of rpath flags
The flags parsing fixes were backported to waf 1.5 from waf 1.8. There is no reason
to keep the flags parsing fixes in Samba.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Mon Nov  2 03:35:31 CET 2015 on sn-devel-104
2015-11-02 03:35:31 +01:00
Petr Viktorin
9ef47d2531 buildtools: Ignore exact Python version for ABI checking
Utilities for Python libraries are built for a specific Python
version. Starting with Python 3, the Python version is recorded
in the shared library filename as an ABI tag, e.g. "pytalloc.cpython-34m.so.
The exact version doesn't matter for Samba's ABI check.
Replace the ABI tag with a simpler one that just records the major
version of Python.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Sun Nov  1 01:09:06 CET 2015 on sn-devel-104
2015-11-01 01:09:06 +01:00
Thomas Nagy
1466e27fa6 build:wafsamba: Removed hard-coded class names from build scripts
Using hard-coded class names prevents subclassing and make it hard
to reason about the workflow. The wscript files read during the build
must be read during the installation phase as well.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-10-28 21:40:24 +01:00
Thomas Nagy
2666d06f29 build:wafsamba: removed most import * statements
The 'import *' statements make it more difficult to reason about
the modules and tends to conceal bugs. These changes enable running
pyflakes against most of the build scripts.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Wed Oct 28 12:52:17 CET 2015 on sn-devel-104
2015-10-28 12:52:17 +01:00
Martin Schwenke
cbae31c794 build: --picky-developer implies --enable-developer
Have --picky-developer enable --enable-developer too, instead of
requiring both options to be specified.  This makes it obey the
principle of least surprise.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Oct 27 07:19:33 CET 2015 on sn-devel-104
2015-10-27 07:19:33 +01:00
Thomas Nagy
84b7a9f939 build:wafsamba: dead code removal in gettext detection
Since the --gettext-location command-line option has no effect, the misleading
code is removed. The samba functions ADD_CFLAGS must also be used in the future

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue Oct 27 03:34:28 CET 2015 on sn-devel-104
2015-10-27 03:34:28 +01:00
Thomas Nagy
96108058d0 build:wafsamba: Enable feature-compatible declaration for Waf 1.8
In Waf 1.8 the declaration is features='c', not features='cc'. These changes
prepare the replacement of Waf 1.5 by Waf 1.8 for Samba.

Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-10-13 06:34:16 +02:00
Andrew Bartlett
1dc05386f2 build: Move __attribute__ ((destructor)) and ((constructor)) tests to wafsamba
This allows us to use them in talloc as well.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Adrian Cochrane <adrianc@catalyst.net.nz>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-10-09 20:14:06 +02:00
Gustavo Zacarias
1399198d51 build: improve stack protector check
Testing a toolchain for proper -fstack-protector must go beyond ensuring
the compiler and linker accept the option.
If the test C program does nothing with the stack then guards aren't
inserted and/or are optimized away giving the false impression that it
works when in fact the libc might not support it.

Update the check to a program that uses the stack, hence making a link
fail if proper support isn't available, for example in non-ssp enabled
uclibc toolchains like this:

test.c:(.text.startup+0x64): undefined reference to `__stack_chk_fail'

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Böhme <rb@sernet.de>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Mon Sep 21 23:29:13 CEST 2015 on sn-devel-104
2015-09-21 23:29:13 +02:00
Thomas Nagy
ba6c7df7f9 build:wafsamba: Use the Waf 1.8 API get_tgen_by_name instead of name_to_obj
Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Sep  2 03:49:51 CEST 2015 on sn-devel-104
2015-09-02 03:49:51 +02:00
Thomas Nagy
ffea9a17d7 build:wafsamba: Close file handles in the build scripts too
Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-09-02 00:47:18 +02:00
Stefan Metzmacher
9d9a767ef2 wafsamba: don't add -DSTATIC_%s_MODULES* arguments for SAMBA_LIBRARY(pyembed=True)
Python helper libraries don't have any modules and having something like
'.cpython-34m' in the name, e.g. STATIC_pytalloc-util.cpython-34m_MODULES
breaks the build.

Another way to fix this would be removing PYTHON_SO_ABI_FLAG from the name.

This allows --extra-python=/usr/bin/python3 to work on Ubuntu 14.04.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-08-06 00:43:24 +02:00
Petr Viktorin
5090d491af buildtools: Fix crash on invalid --extra-python option
Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-21 19:04:15 +02:00
Petr Viktorin
5a4e5d7cbf buildtools: Don't configure Python more than once
Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-07-21 19:04:14 +02:00
Amitay Isaacs
4974322119 wafsamba: Cache final_libs for each target
The code for saving/loading dependencies does not cache final_libs for
each target.  If wafsamba tries to reuse the saved dependencies, then
it does not get the dependencies on the private libraries correctly.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Tue Jun 30 09:44:10 CEST 2015 on sn-devel-104
2015-06-30 09:44:10 +02:00
Thomas Nagy
26a7372e3b Always use Samba's CHECK_CFG instead of waf check_cfg 2015-06-26 02:10:12 +02:00
Thomas Nagy
21f98e58da Remove PYTHONDIR and PYTHONARCHDIR in a single place 2015-06-26 02:10:12 +02:00
Andreas Schneider
893b5f8144 wafsamba: Also build libraries with RELRO protection
BUG: https://bugzilla.samba.org/show_bug.cgi?id=11346

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Guenther Deschner <gd@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Fri Jun 19 12:51:48 CEST 2015 on sn-devel-104
2015-06-19 12:51:48 +02:00
Stefan Metzmacher
ff072a6336 wafsamba: let CHECK_DECLS() find enum values
In the current state this still generates the same config.h
at least on ubuntu 14.04 amd64.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-06-12 17:08:20 +02:00
Stefan Metzmacher
86671dbd9f wafsamba: remove unused allow_warnings=True from SAMBA_PYTHON()
This is not needed anymore all python bindings build without wawrnings now.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-06-12 17:08:20 +02:00
Petr Viktorin
2bf1443bd0 buildtools: Always reset the build environment
In install_library, the Build object's environment was not reset
after an early return, so the extrapython env would be used in
subsequent build steps.
Wrap everything in a try-finally block to make sure the env is reset.

(Almost all of the change is indentation, `git show -w` recommended.)

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2015-06-10 06:06:18 +02:00
Uri Simchoni
1c58fee706 waf: add a sample run-on-target script
This is a sample script that can be used with the --cross-execute
configure switch to run configure tests on a remote target for which
samba is being cross-compiled.

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2015-05-20 11:19:11 +02:00
Uri Simchoni
25b1721075 waf: Fix parsing of cross-answers file in case answer includes a colon
The answer provided in the cross-answers file may include a colon,
as in:
Checking uname version type: "#57-Ubuntu SMP Tue Jul 15 03:51:08 UTC 2014"

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2015-05-20 11:19:11 +02:00
Uri Simchoni
56114bb677 waf: allow cross-execute program to have arguments with spaces
When cross-compiling samba using the cross-execute method,
allow the cross-excute command to have arguments that contain
spaces by quoting them.

For example:

./configure --cross-compile '--cross-execute=ce-program "par am"'

In this case, for each cross test whose binary is /path/testprog,
waf shall run the equivalent of running from a shell:
ce-program "par am" /path/testprog

This is useful for passing an arbitrary argument list to a subprocess
of the cross-execute program, such as in buildtools/examples/run_on_target.py

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2015-05-20 11:19:11 +02:00
Uri Simchoni
c244e7dc09 waf: improve readability of cross-answers generated by cross-execute
When generating a result for cross-answers from the (retcode, retstring) tuple:
- (0, "output") indicated as "output"
- 1 is interpreted as generic fail code, instead of 255, because most
  if not all tests fail with 1 as exit code rather than 255
- For failing test, use NO instead of FAIL, because that's not
  necessarily a failure (it could mean that something is NOT
  broken)

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2015-05-20 11:19:11 +02:00
Uri Simchoni
eb696df493 Adds a new mode to samba cross-compiling.
When both --cross-answers and --cross-execute are set, this means:
- Use cross-answers
- If answer is unknown, then instead of adding UNKNOWN to the cross-answers
  file and failing configure, the new mode runs cross-execute to determine the
  answer and adds that to the cross-answers file.

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2015-05-20 11:19:11 +02:00
Uri Simchoni
3fb617310d waf: sanitize and fix added cross answer
When configuring samba for cross-compilation using the cross-answers
method, the function add_answer receives the standard output and exit code
of a configuration test and updates the cross-answers file accordingly.

This patch sanitizes the standard output to conform to the cross-answers
file format - one line of output. It also adds a missing newline.

(Note - at this point add_answer is only ever called with empty output
but this change is significant for the reminder of this patchset)

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2015-05-20 11:19:11 +02:00
Uri Simchoni
843c373d00 waf: always close cross answers file
When configuring samba for cross-compilation using the
cross-answers file, the file is not closed in a couple of
cases - fix that.

Signed-off-by: Uri Simchoni <urisimchoni@gmail.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2015-05-20 11:19:11 +02:00
Jelmer Vernooij
0dcf535795 Factor out submodule presence checking.
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue May 19 22:17:48 CEST 2015 on sn-devel-104
2015-05-19 22:17:47 +02:00
Jelmer Vernooij
5e0821201c Make waf fail if submodules are out of date.
Instead, suggest the user run 'git submodule update'.

This should prevent users from accidentally building Samba against
outdated or too new versions of the bundled third party libraries
after switching branches.

I've opted to make this an error rather than actually
running 'git submodule update' directly, as the latter could
cause unpredictable behaviour. If we find that manually updating
submodules is too cumbersome, we can always change this. The normal mode
of operation for developers should not involve any submodules at all,
but system versions of these libraries.

Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-19 19:28:19 +02:00
Jelmer Vernooij
5d672b9a53 Factor out function for finding Git binary.
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-19 19:28:19 +02:00
Jelmer Vernooij
8eda4efacd Drop bzr VCS support.
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-05-19 19:28:19 +02:00
Petr Viktorin
91b407fc94 buildtools: Add a helper for running Python tests
Add the function samba_utils.RUN_PYTHON_TESTS for running a Python
test. When building for multiple Python versions, all are tested.

Also, add the list of configured Python interpreters to build config.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2015-05-19 19:28:19 +02:00
Petr Viktorin
6f490000c6 buildtools: Add a helper to iterate through Python environments
This prevents code duplication to ensure the "extrapython" build
is the same as the normal one.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2015-05-19 19:28:19 +02:00
Petr Viktorin
616dfae8ff buildtools: Add --extra-python configure option
This allows building Python support for two different Python versions
at the same time.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2015-05-19 19:28:18 +02:00
Petr Viktorin
13a91e5427 buildtools: Expose the Python 3 ABI tag
Expose the tag in the env to allow using it in pkg-config files

Add a "pyembed_libname" function to correctly form library names.
(This can't be done automatically in SAMBA_LIBRARY because the name
could be used as a dependency for another library)

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2015-05-19 19:28:18 +02:00
Richard Sharpe
57568f1900 Convert all uint32/16/8 to _t in a grab-bag of remaining files.
I still need to fix the rpc stuff, but we are almost there.

Signed-off-by: Richard Sharpe <rsharpe@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu May 14 22:16:56 CEST 2015 on sn-devel-104
2015-05-14 22:16:56 +02:00
Ralph Boehme
ec085fe8b3 Revert "wafsamba: flags from enviroment are put before our own internal versions"
This reverts commit b2bb6aeb80.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>

Autobuild-User(master): Ralph Böhme <slow@samba.org>
Autobuild-Date(master): Sun Apr 26 18:40:39 CEST 2015 on sn-devel-104
2015-04-26 18:40:39 +02:00
Michael Adam
3e5d527766 docs: correctly depend on used xsl files and catalog for building manpages.t
So changes in (e.g.) our man.xsl will trigger a rebuild of the manpages.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Apr 24 15:39:31 CEST 2015 on sn-devel-104
2015-04-24 15:39:31 +02:00
Petr Viktorin
78cdd5ea7d buildtools: Use all of pyext_PATTERN in map_shlib_extension
In Python 3, C extension module filenames have an ABI tag;
the pyext_PATTERN is e.g. "%s.cpython-34m.so".
The build system was only using the last dot-separated element
of that extension (the ".so").

Use the whole extension when constructing the final filename.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Jelmer Vernooij <jelmer@samba.org>
Autobuild-Date(master): Fri Apr 24 04:26:45 CEST 2015 on sn-devel-104
2015-04-24 04:26:45 +02:00
Petr Viktorin
50311c7606 wafsamba: Add install argument to SAMBA_PYTHON
This allows building Python modules that are only used for testing.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-04-24 01:50:11 +02:00
Michael Adam
b542d1c83f build:wafsamba: fix a typo
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Ira Cooper <ira@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Thu Apr  2 16:39:01 CEST 2015 on sn-devel-104
2015-04-02 16:39:00 +02:00
Jeremy Allison
bdf0a81006 waf: Remove 'linkflags.remove(x)' line added in error.
Fixes bug #11165 - Bug in configure scripts when system-mitkrb5 is used

https://bugzilla.samba.org/show_bug.cgi?id=11165

Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Tue Mar 31 04:32:52 CEST 2015 on sn-devel-104
2015-03-31 04:32:52 +02:00
Jelmer Vernooij
483bb682a8 Merge update-waf.sh into update-external.sh
Signed-off-by: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-26 22:47:22 +01:00
Jelmer Vernooij
90ec37cf90 Move waf into third_party/.
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-03-26 22:47:22 +01:00
Volker Lendecke
de811f14af lib: Remove tdb_compat
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-03-17 11:30:52 +01:00
Thomas Nagy
3c0e3af395 Transition to waf 1.8: wrapped conf.check_cfg
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>

(forward ported to current master by abartlet)

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-16 03:00:07 +01:00
Thomas Nagy
5771276be9 Transition to waf 1.8: replaced on_results by update_outputs
Reviewed-By: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-16 03:00:07 +01:00
Jelmer Vernooij
2ab6c10f84 Update the copy of waf to current 1.5
After making the update, this commit reverts the upstream addition of
LDVERSION support in Python.py, which is necessary for Python 3
support in waf. This change conflicts with the last remaining
Samba-specific change in waf to help with cross-compilation.

Change-Id: Iedfdc0199e9d10dfbd910c4eab50c23f984b6e2d
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-16 03:00:06 +01:00
Jelmer Vernooij
ef2c6d0d57 test_duplicate_symbol: Use Samba subunit emitter.
Change-Id: I280495706ff460674244183103306ca717c419a8
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-03-06 04:41:47 +01:00
Michael Adam
1826f06be7 build:wafadmin: fix use of spaces instead of tabs.
Indentation should not be a mixture of tabs and spaces.
Waf uses tabs.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2015-03-04 14:46:07 +01:00
Volker Lendecke
a3adad7a17 waf: Fix the build on openbsd
We have single-digit vnum='0', make the assignment deal with it

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Tue Mar  3 03:33:24 CET 2015 on sn-devel-104
2015-03-03 03:33:24 +01:00
Garming Sam
63609eba99 build: amend typo for address sanitizer help
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2015-02-25 01:08:12 +01:00
Alexander Bokovoy
a00d72bf5d wafsamba: make sure build fails when uninitialized variable is detected
In developer build, fail if uninitialized variable is found by GCC.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Tue Feb 24 20:21:52 CET 2015 on sn-devel-104
2015-02-24 20:21:52 +01:00
Petr Viktorin
a0cbce60f4 buildtools: Use separate storage for each function in runonce
The runonce decorator used shared storage for all functions, and
dispatched only on arguments, so a call would be eliminated if
a different runonce function had already been called with the same
arguments.

Use separate storage for each decorated function.

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
Reviewed-by: Simo Sorce <simo@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2015-02-17 15:41:11 +01:00
Andreas Schneider
cf68c1accb waf: Add address sanitizer configure option.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-01-28 17:17:07 +01:00
Stefan Metzmacher
47155641cb wafsamba: create unique names when building shared modules
After commit 76fdcf5c15, we could endup
with bin/default/source3/auth/libauth-samba4.so being created two times.
Once by SAMBA3_LIBRARY('auth',...) and once again by SAMBA3_MODULE('auth_samba4', ...).

As a result bin/default/source3/auth/libauth-samba4.so gets randomly
overwritten.

SAMBA3_MODULE('auth_samba4', ...) results in
bin/default/source3/auth/libauth_module_samba4.so now.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10112

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Mon Jan 19 04:43:53 CET 2015 on sn-devel-104
2015-01-19 04:43:53 +01:00
Stefan Metzmacher
4da20e2e31 wafsamba: remove unused variable in SAMBA_MODULE()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10112

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2015-01-19 02:24:03 +01:00
Stefan Metzmacher
85a30cc440 wafsamba: passing 'subsystem' to SAMBA_MODULE() is not optional
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10112

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2015-01-19 02:24:03 +01:00
Stefan Metzmacher
7668e457a6 wafsamba: make it possible to pass bundled_name to SAMBA_LIBRARY()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10112

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2015-01-19 02:24:03 +01:00
Thomas Nagy
115eb94215 wafadmin: backported the openbsd fixes from waf 1.7
This is a backport from waf 1.5...

Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jan  9 02:02:07 CET 2015 on sn-devel-104
2015-01-09 02:02:07 +01:00
Michael Adam
9f2979a1a4 wafsamba: remove commented out code.
This code has only ever been there as commented out...

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-01-08 23:38:07 +01:00
Michael Adam
ffff95d421 Revert "waf: added suncc_wrap"
This reverts commit 65743f932b.

Conflicts:
	buildtools/wafsamba/samba_optimisation.py

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2015-01-08 23:38:07 +01:00
Stefan Metzmacher
d7bd51a79d wafsamba: generate an empty.c file if a SAMBA_{LIBRARY,SUBSYSTEM} doesn't have any source files
This is better than passing '-' as filename to the compiler/linker.
This replaces commit 65743f932b.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=9334
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10315

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2015-01-08 23:38:07 +01:00
Ralph Boehme
a6bda1f2bc wafsamba: flags from enviroment are put before our own internal versions
Ensure user provided CPPFLAGS and LDFLAGS are put *behind* our
internally computed compiler and linker flags.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10877

Pair-Programmed-With: Michael Adam <obnox@samba.org>
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2015-01-08 23:38:07 +01:00
Michael Adam
707dc16987 wafsamba: filter out standard library paths from RPATH and LIBPATH
We should avoid passing them explicitly to the compiler/linker.

We ask the compiler with the '-print-search-dirs' argument
or fallback to [ '/usr/lib', '/usr/lib64' ].

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-01-08 23:38:07 +01:00
Michael Adam
dc808a466e wafsamba: fix ordering problems with lib-provided and internal RPATHs
When a library or system (like cups) provides an RPATH,
e.g. with -Wl,-R or -Wl,-rpath, this was added by waf
to the LINKFLAGS, wich was later prepended to our RPATH.
But if the path by chance contains an older version of
one of our internal libraries like talloc, this would lead
to linking the too old talloc into our binaries.

This has been observed on, e.g., FreeBSD, but it is a general
problem.

This patch fixes the problem by specially parsing the RPATH
linker options from the pkg-config(, cups-config, ....) output
and putting the paths into the RPATH_<lib> container, which
is then later correctly appended to our internal RPATH.

This is a better fix than commit 64f5e24100
as it touches wafsamba only. 64f5e24100
is already in waf 1.5 upstream, but has some possible bugs,
e.g. it doesn't handle -Wl,-R, (with ',' at the end)
or some combinations where the path is given via an additional
-Wl,/path argument.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10548

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2015-01-08 23:38:07 +01:00
Stefan Metzmacher
d744c7c080 wafsamba: make it possible to specify ADDITIONAL_{CFLAGS,LDFLAGS} as env var to ./configure
CFLAGS and LDFLAGS are also used during the configure checks and might impact
their results.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-01-08 23:38:07 +01:00
Stefan Metzmacher
46fdd6221e wafsamba: improve -fvisibility=hidden, we should check it together this WERROR_CFLAGS
GCC ignores -fvisibility=hidden with a warning instead of failing
om some platforms (e.g. Solaris).

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11031

Based on a patch from Tom Schulz <schulz@adi.com>.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-01-08 23:38:07 +01:00
Stefan Metzmacher
52eb8854ff wafsamba: let CURRENT_CFLAGS() use bld.env.VISIBILITY_CFLAGS
This is better than a hardcoded value in multiple places.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-01-08 23:38:07 +01:00
Stefan Metzmacher
4683fc0f1d wafsamba: move -fvisibility=hidden checks from lib/replace to wafsamba
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-01-08 23:38:07 +01:00
Stefan Metzmacher
208be32c6a wafsamba: move '-fstack-protector' checks from lib/replace to wafsamba
This moves the check to the end of the configure run,
which means we no longer use this on configure checks,
but only for the real build.

This behavior is similar than our developer cflags.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-01-08 23:38:07 +01:00
Stefan Metzmacher
0f4ce418ae wafsamba: move WERROR_CFLAGS checks from lib/replace to wafsamba
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-01-08 23:38:07 +01:00
Stefan Metzmacher
7a3dc66852 wafsamba: move compiler / cflags related stuff from lib/replace to wafsamba
We should have this just in one central place.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-01-08 23:38:07 +01:00
Stefan Metzmacher
ab4b988ba2 wafsamba: let TO_LIST(mylist) return a copy of mylist
In most cases we have TO_LIST(mystring) which returns an independent
list.

newlist = TO_LIST(mylist) returned just a reference to mylist.
Which means newlist.append("end") would also modify mylist.

TO_LIST() should always return an independent list.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2015-01-08 23:38:06 +01:00
Ralph Boehme
89cc31f5cf wafsamba: check for rpath compiler/linker flags
Older SunOS linker only support -Wl,-R,/path instead of -Wl,-rpath,/path.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10112

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>

Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-12-19 13:15:12 +01:00
Stefan Metzmacher
76fdcf5c15 wafsamba: fill PRIVATE_NAME() logic again
We append bld.env.PRIVATE_EXTENSION to the name of private libraries
again, but only unless they have a abi_directory, vnum or soname defined.

This avoids naming conflicts with system libraries, e.g. libidmap.so
on Solaris

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10112

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-12-19 13:15:12 +01:00
Stefan Metzmacher
82e583b04b wafsamba: add optional keep_underscore=True to SAMBA_LIBRARY()
Bug: https://bugzilla.samba.org/show_bug.cgi?id=9299

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-12-19 13:15:12 +01:00
Stefan Metzmacher
7c7d3ebb41 wafsamba: change the default to allow_warnings=False for CURRENT_CFLAGS()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-25 07:25:46 +01:00
Stefan Metzmacher
994eea61cc wafsamba: change the default to allow_warnings=False for SAMBA_{SUBSYSTEM,LIBRARY,MODULE}()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-25 07:25:46 +01:00
Stefan Metzmacher
989eb5d8f8 wafsamba: use -Wno-error=deprecated-declarations in picky-developer mode
Currently we use too many deprecated function like
dcerpc_binding_handle_set_sync_ev() and others, but this should not be a reason
to require 'allow_warnings=True'.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-25 07:25:46 +01:00
Stefan Metzmacher
6ff9388172 wafsamba: add -Werror=return-type for developer builds
This avoids errors like this:

 ../source3/utils/status.c: In function ‘print_share_mode’:
 ../source3/utils/status.c:126:3: error: ‘return’ with no value, in function
 returning non-void [-Werror=return-type]
   return;

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-11-14 23:27:04 +01:00
Jelmer Vernooij
c7b6897b80 Run duplicate symbol check as just another test, rather than as part of "waf test".
This allows it to be scheduled independently as part of a parallel test
run, and reduces the overhead of "waf test".

Change-Id: I780fd2c4dd711ed27df73f56de98e7f1ffd53aaf
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Bug: https://bugzilla.samba.org/show_bug.cgi?id=10875
2014-10-14 06:44:07 +02:00
Jelmer Vernooij
0c24085317 Fix more pep8 issues in code I touched recently.
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Change-Id: I35f3204bdf5d00b3280d703427ded2fa2163a6f7
2014-10-14 06:44:06 +02:00
Jelmer Vernooij
bd6faaf56a Remove last instances of pep8 error E712 (use 'is' rather than '==' for booleans)
Signed-Off-By: Jelmer Vernooij <jelmer@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Change-Id: I43b394a6225b4c2049d979fda75548c82d781f67
2014-10-14 06:44:06 +02:00
Thomas Nagy
1c5ef289a8 Reduce the no-op build times by 30%
Change-Id: Ie68436c1e7c75c1786e9ed6b6a54d2b55abbbcea
Reviewed-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Fri Oct  3 13:25:18 CEST 2014 on sn-devel-104
2014-10-03 13:25:18 +02:00
Michael Adam
1f878b9986 Revert "buildtools: Rename perl vendorarch configure option."
This reverts commit 04685ff4ee.

We are reverting buildtools/wafadmin/Tools/perl.py back to upstream state.
Everything special is now in buildtools/wafsamba/samba_perl.py.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Sep  9 03:07:20 CEST 2014 on sn-devel-104
2014-09-09 03:07:20 +02:00
Michael Adam
0b91f7d806 Revert "buildtools: Add perl vendorlib configure option."
This reverts commit 48f0183dbe.

We are reverting buildtools/wafadmin/Tools/perl.py back to upstream state.
Everything special is now in buildtools/wafsamba/samba_perl.py.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-09-09 00:39:07 +02:00
Michael Adam
42990ca3c8 Revert "wafsamba: If perl can't provide defaults, define them."
This reverts commit 0ba276ebad.

We are reverting buildtools/wafadmin/Tools/perl.py back to upstream state.
Everything special is now in buildtools/wafsamba/samba_perl.py.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-09-09 00:39:07 +02:00
Michael Adam
c5dd2f18dd Revert "wafsamba: Fail with error message if perl doesn't provide valid dirs."
This reverts commit 2637890ef4.

We are reverting buildtools/wafadmin/Tools/perl.py back to upstream state.
Everything special is now in buildtools/wafsamba/samba_perl.py.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-09-09 00:39:07 +02:00
Michael Adam
f73a0c2af9 wafsamba: add perl_fixup parameter to INSTALL_FILES
This fixes the search path for modules when installing
a perl "binary" by replacing a line 'use lib "$RealBin/lib";'
which works for the build directory with the appropriate
"use lib" line.

This is a step in allowing to install perl modules under the
prefix directory again.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-09-05 19:47:06 +02:00
Michael Adam
75c3e240e0 wafsamba: add samba_perl.py with SAMBA_CHECK_PERL() higher level check.
This checks for the perl binary, sets PERL and PERL_SPECIFIED
as well es the PERL_ARCH_INSTALL_DIR and PERL_LIB_INSTALL_DIR.

We want to avoid installing the perl modules outside the prefix.
I.e. generally,the perl modules should be installed
under "$prefix/share/perl5".

This improves the fixes for bug #10472.

The new strategy for automatically setting the paths is this:

- if the prefix equals perl's vendorprefix, then
  - PERL_LIB_INSTALL_DIR is set to perl's vendorlib dir
  - PERL_ARCH_INSTALL_DIR is set to perl's vendorarch dir
- otherwise:
  - PERL_LIB_INSTALL_DIR is set to ${DATADIR}/perl5
    (usually ${PREFIX}/share/perl5)
  - PERL_ARCH_INSTALL_DIR is set to ${LIBDIR}/perl5
    (usually ${PREFIX}/lib/perl5)

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2014-09-05 19:47:06 +02:00
Stefan Metzmacher
a41a9ad074 wafsamba: let SAMBA_BLDOPTIONS() use dep_vars=['defines'] instead of always=True
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-05 19:47:06 +02:00
Stefan Metzmacher
7316653a82 wafsamba: fix dependencies on environment variables for python_fixup
We now checksum the sourcecode of copy_and_fix_python_path()
and the env variables used by this function.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-05 19:47:06 +02:00
Stefan Metzmacher
04bb8ff7e6 wafsamba: allow an optional dep_vars list to be passed to SAMBA_GENERATOR()
This can be used to checksum variables used in the rule function.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-05 19:47:06 +02:00
Stefan Metzmacher
da8c763545 wafsamba: fix dependency for SAMBA_GENERATOR() when passing vars!=None
vars can only be a dictionary as that's the only thing bld.EXPAND_VARIABLES()
accepts.

We need to checksum the whole vars dictionary into the dependencies.

We set task.env.SAMBA_GENERATOR_VARS = vars and add SAMBA_GENERATOR_VARS
to the dep_vars.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-05 19:47:05 +02:00
Stefan Metzmacher
ee8fbbd417 wafsamba: fix dependency calculation for SAMBA_GENERATOR()
We need to checksum the rule as string command of the
sourcecode of the python function.

This is stored in the 'ruledeps' envariable on the waf Task.
See exec_rule() in wafadmin/TaskGen.py.

    dep_vars = getattr(self, 'dep_vars', ['ruledeps'])
    if dep_vars:
        tsk.dep_vars = dep_vars
    if isinstance(self.rule, str):
        tsk.env.ruledeps = self.rule
    else:
        # only works if the function is in a global module such as a waf tool
        tsk.env.ruledeps = Utils.h_fun(self.rule)

If there's no 'dep_vars' it defaults to ['ruledeps'].
As we pass our own 'dep_vars' we need to explicitly add
'ruledeps'.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-09-05 19:47:05 +02:00
Michael Adam
210d7de34f wafsamba: improve wording in a comment
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-09-05 19:47:05 +02:00
Michael Adam
ca06fac2c8 wafsamba: remove unused variable from copy_and_fix_python_path
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-09-05 19:47:05 +02:00
Amitay Isaacs
4f105b27b7 wafsamba: Correctly locate the 'third_party' directory
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-08-21 09:11:06 +02:00
Jeremy Allison
a4fa65811d Don't build iniparser anymore.
Signed-off-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2014-08-14 21:27:13 +02:00
Ira Cooper
38de110b02 third_party/popt: Initial support for popt.
ctdb, ldb, and samba are supported builds for third_party popt.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-09 18:26:17 +02:00
Ira Cooper
ba8ee8c9e0 third_party/zlib: Initial support for zlib
Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-09 18:26:16 +02:00
Ira Cooper
f46b79bdb8 third_party/iniparser: Initial support for iniparser.
This is the initial support for iniparser, as well the basic
third_party framework.

Signed-off-by: Ira Cooper <ira@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-08-09 18:26:16 +02:00
Volker Lendecke
b3d1d56b5e smbd/nmbd: Remove HAVE_LONGLONG
We always have 64-bit variables available by now

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-07-22 15:32:39 +02:00
Michael Adam
fe6685dbf3 build: rename argument of list_directory_files(): abspath->path
It is never called with an absolute path.

Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2014-06-20 23:38:10 +02:00
Amitay Isaacs
4a5ded2b69 wafsamba: allow samba_dist.dist() to be called from a different directory.
Up to now it assumed to be called from the top level srcdir.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-06-20 23:38:09 +02:00
Stefan Metzmacher
2637890ef4 wafsamba: Fail with error message if perl doesn't provide valid dirs.
We try harder to get valid directories, we now fallback like this:

vendorarch => sitearch => archlib
and
vendorlib => sitelib => privlib

The new options are --with-perl-arch-install-dir and
--with-perl-lib-install-dir.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10472

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andreas Schneider <asn@samba.org>
2014-05-09 23:10:07 +02:00
Andreas Schneider
0ba276ebad wafsamba: If perl can't provide defaults, define them.
This should fix the installation on FreeBSD.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu May  8 13:55:50 CEST 2014 on sn-devel-104
2014-05-08 13:55:50 +02:00
Gustavo Zacarias
6619055f60 build: make wafsamba CHECK_SIZEOF cross-compile friendly
Use the same trick as commit 0d9bb86293
We do the same array trick iteratively starting from 1 (byte) by powers
of 2 up to 32.

The new 'critical' option is used to make the invocation die or not
according to each test.
The default is True since normally it's expected to find a proper
result and should error out if not.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-05-06 18:14:13 +02:00
Gustavo Zacarias
5ac317e2b6 build: unify and fix endian tests
Unify the endian tests out of lib/ccan/wscript into wafsamba since
they're almost cross-compile friendly.
While at it fix them to be so by moving the preprocessor directives out
of main scope since that will fail.
And keep the WORDS_BIGENDIAN, HAVE_LITTLE_ENDIAN and HAVE_BIG_ENDIAN
defines separate because of different codebases.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>
2014-05-06 18:14:13 +02:00
Andreas Schneider
ad3a431670 wafsamba: Add set_target to CHECK_BUNDLED_SYSTEM.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-04-17 14:56:05 +02:00
Ralph Boehme
85041c88d8 wafsamba: replace dots in library names
Certain libraries use a version number with a dot in the library name,
eg libtracker-sparql-0.16. The dot is passed to the HAVE_LIBXXX macro
but dots aren't allowed in C macros, compiler diagnostic:

  warning: missing whitespace after the macro name

Signed-off-by: Ralph Boehme <rb@sernet.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2014-04-08 19:26:13 +02:00
Stefan Metzmacher
e1ec1f5d8d wafsamba: explicitly use allow_warnings=True for SAMBA_PYTHON()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Apr  2 11:04:36 CEST 2014 on sn-devel-104
2014-04-02 11:04:36 +02:00
Stefan Metzmacher
8a1f67b53b wafsamba: add optional allow_warnings(default=True) to SAMBA_{SUBSYSTEM,LIBRARY,MODULE}()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:45 +02:00
Stefan Metzmacher
404f025284 wafsamba: add an optional allow_warnings(default=True) to CURRENT_CFLAGS()
-Werror is now remembered in PICKY_CFLAGS and only added if
allow_warnings is False.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:45 +02:00
Stefan Metzmacher
8cdd9f3a7f wafsamba: split out a conf.ADD_NAMED_CFLAGS() function
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:45 +02:00
Stefan Metzmacher
2f059329b0 wafsamba: use -Werror=declaration-after-statement if available
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:45 +02:00
Stefan Metzmacher
e21aa7bf09 wafsamba: use multiple conf.ADD_CFLAGS() lines for developer CFLAGS
We first check for warn flags then for error flags.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:45 +02:00
Stefan Metzmacher
cc765baa64 wafsamba: allow --bundled-libraries=ALL,!popt
This will not bundle 'popt', but everything else.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:42 +02:00
Stefan Metzmacher
c19e5a0386 wafsamba: allow --bundled-libraries=NONE,popt
This will bundle only 'popt'.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:41 +02:00
Stefan Metzmacher
ef380bb2a9 wafsamba: simplify LIB_MUST_BE_BUNDLED()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:41 +02:00
Stefan Metzmacher
9a8e35a049 wafsamba: simplify LIB_MAY_BE_BUNDLED()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:41 +02:00
Stefan Metzmacher
6ae4121da5 wafsamba: allow optional 'checkcode' argument to CHECK_BUNDLED_SYSTEM()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:41 +02:00
Stefan Metzmacher
764706c2b0 wafsamba: allow CHECK_BUNDLED_SYSTEM() to check headers without functions
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:41 +02:00
Stefan Metzmacher
cec109ccf9 wafsamba: simplify CHECK_BUNDLED_SYSTEM_PKG() by just calling CHECK_BUNDLED_SYSTEM()
If checkfunctions is not specified they are the same.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:41 +02:00
Stefan Metzmacher
4dea4e310d wafsamba: port optional 'pkg' option from CHECK_BUNDLED_SYSTEM_PKG() to CHECK_BUNDLED_SYSTEM()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:41 +02:00
Stefan Metzmacher
d88f41f698 wafsamba: require a ';' after STATIC_*_MODULES_PROTO
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-04-02 09:03:41 +02:00
Stefan Metzmacher
47dbd4ef60 wafsamba: use cluster_support_features in build_options.c
This way 'smbd -b' returns the cluster features of the currently used
libsamba-cluster-support.so.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-03-24 17:09:10 +01:00
Stefan Metzmacher
1c1a2e4596 wafsamba: add CONFIG_RESET()
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-03-24 17:09:10 +01:00
Andreas Schneider
48f0183dbe buildtools: Add perl vendorlib configure option.
After this patch has been pushed, we need to change autobuild to compile
with this option or we will not be able to install pidl.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-03-06 09:59:43 +01:00
Andreas Schneider
04685ff4ee buildtools: Rename perl vendorarch configure option.
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-03-06 09:59:42 +01:00
Andreas Schneider
c2d58c3c20 Revert "waf: Add option to specify perl vendor dir."
This reverts commit 9b200555fe.

Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
2014-03-06 09:59:42 +01:00
Andreas Schneider
9b200555fe waf: Add option to specify perl vendor dir.
BUG: https://bugzilla.samba.org/show_bug.cgi?id=10472

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Kai Blin <kai@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Thu Feb 27 11:48:54 CET 2014 on sn-devel-104
2014-02-27 11:48:54 +01:00