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

1305 Commits

Author SHA1 Message Date
Noel Power
b342e6f038 PY3: bytes.maketrans, string.maketrans is a PY2 only function
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-16 06:16:19 +02:00
Noel Power
9fc6759792 PY3: enclose filter with list as len on result of filter fails
filter returns an iterator in PY3 (and a list in PY2)

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-16 06:16:19 +02:00
Noel Power
59f69a7c21 py2/py3 enclose map with list
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-16 06:16:19 +02:00
Noel Power
3cc284b2af PY3: fix some octal literals
Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-16 06:16:19 +02:00
Martin Schwenke
93d72bcfb0 wafsamba: Only use $DESTDIR in INSTALL_DIR() if it is set
Otherwise the leading '/' is stripped and directories are created
relative to the current directory.

This fixes a regression introduced in recent commit
26ea0f58da.

Reported-by: Ralph Böhme <slow@samba.org>
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Sep 13 09:37:23 CEST 2018 on sn-devel-144
2018-09-13 09:37:23 +02:00
Martin Schwenke
587bbd3eb1 wafsamba: Drop unused, broken install_dir()
This is broken because it doesn't respect $DESTDIR.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Tue Sep 11 10:00:05 CEST 2018 on sn-devel-144
2018-09-11 10:00:05 +02:00
Martin Schwenke
b4fa3f982a wafsamba: Have INSTALL_DIR() log directory creation
Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-09-11 06:59:11 +02:00
Martin Schwenke
26ea0f58da wafsamba: Make INSTALL_DIR() respect $DESTDIR
INSTALL_DIR() currently ignores $DESTDIR and just installs directories
into the final destination.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-09-11 06:59:11 +02:00
Stefan Metzmacher
ad04275769 wafsamba: remove tru64cc.py as it's not compatible with waf 2
third_party/waf/waflib/Tools/compiler_c.py proposed
gcc for osf1V/Tru64.

If there's more needed on Tru64 someone with a Tru64 box needs to
provide a waf 2 compatible fix.

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): Mon Sep 10 22:49:31 CEST 2018 on sn-devel-144
2018-09-10 22:49:31 +02:00
Stefan Metzmacher
b35ac32b2e wafsamba: remove hpuxcc.py as it's not compatible with waf 2
third_party/waf/waflib/Tools/compiler_c.py proposed
gcc for HPUX.

If there's more needed on HPUX someone with a HPUX box needs to
provide a waf 2 compatible fix.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-10 19:28:15 +02:00
Stefan Metzmacher
420d0b5606 wafsamba: remove irixcc.py as we don't support IRIX any more
There's still a irixcc.py in waf itself.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-10 19:28:15 +02:00
Stefan Metzmacher
0cd9452ea6 wafsamba: fix generic_cc.py to work with waf 2
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-10 19:28:15 +02:00
Alexander Bokovoy
230796d7ee buildtools/wafsamba: undefine a define for a failed test unless asked to keep it
If conf.CHECK_CODE() is called without `always=True` and the test has
failed, undefine the define already set to '0' by conf.check_code().

This restores expectations that undefined symbols are not considered to
be set by CONFIG_SET() method.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-10 19:28:15 +02:00
Stefan Metzmacher
93b2357035 Revert "wafsamba/samba_autoconf: when setting undefined result, use empty tuple"
This reverts commit 95ba6b9744.

There was already a better fix under discusion.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-10 19:28:14 +02:00
Alexander Bokovoy
95ba6b9744 wafsamba/samba_autoconf: when setting undefined result, use empty tuple
A difference between waf 1.x and 2.x is that we gained 0 as an undefined
variable in the cache file. This does not allow to differentiate unset
and set to 0 defines.

Force to use empty tuple () to signify unset defines.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-08 08:44:16 +02:00
Andreas Schneider
70169d4789 wafsamba: Fix 'make -j<jobs>'
Currently only 'make -j' enables parallel builds and e.g. 'make -j4'
results in no parallel compile jobs at all.

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

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): Fri Sep  7 20:24:46 CEST 2018 on sn-devel-144
2018-09-07 20:24:46 +02:00
Alexander Bokovoy
4847daf0b7 wafsamba/samba_waf18: redefine flex function
There is a bug in waf: flex routine adjusts its inputs against
the task's current working directory but assumes it is being called from
within the build variant directory.

For Samba this means we adjust one level up than the actual work
directory we use to run (bin/ vs bin/default) and flex doesn't find the
source files.

Fix the issue by creating a local override of flex definition that
utilizes the same workd directory for both path adjustment and running
the flex itself.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Sep  7 15:45:36 CEST 2018 on sn-devel-144
2018-09-07 15:45:36 +02:00
Alexander Bokovoy
311e1eb673 wafsamba/samba_autoconf: when setting undefined result, use empty tuple
A difference between waf 1.x and 2.x is that we gained 0 as an undefined
variable in the cache file. This does not allow to differentiate unset
and set to 0 defines.

Force to use empty tuple () to signify unset defines.

Also, fix handling of extra cflags in case of 'strict=True': if
extra_cflags were not defined, we'd append None to the cflags list and
it confuses conf.check() later. 'None' is added to the command line of a
tool executed by the conf.check() which, depending on a tool, may be
treated as an error and cause wrong test result.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-07 11:37:23 +02:00
Andreas Schneider
c4c6ca5e0c wafsamba: Support clang as C compiler
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Thu Sep  6 12:06:05 CEST 2018 on sn-devel-144
2018-09-06 12:06:05 +02:00
Alexander Bokovoy
72c3ff9ae2 buildtools/wafsamba: use CACHE_SUFFIX instead of a hard-coded name
waflib.Build provides CACHE_SUFFIX constant to append to the target
name. We have a reference to samba-specific cache suffix (.cache.py)
while original WAF uses _cache.py as a cache suffix since 2011 (see
commit 44a967e326cc2e670a31b3712e4763b72d65e81b in WAF project code).

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:27 +02:00
Alexander Bokovoy
f495f64e2e buildtools/wafsamba: remove ENFORCE_GROUP_ORDERING
ENFORCE_GROUP_ORDERING is not needed with waf 2.0 anymore

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:27 +02:00
Alexander Bokovoy
7944ed6e7b buildtools/wafsamba: port stale_files to waf 2.0
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:27 +02:00
Alexander Bokovoy
2a3fcdf1ef buildtools/wafsamba: generate build options output with waf 2.0
With WAF 2.0 we get all defines in environment at the same level.
Fix build options source code generator to handle this.

I felt uneasy at filtering out some defines so instead the code
is mangling generic defines to be correct for C compiler by
replacing '-', '.', and '()' with an underscore ('_').

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:27 +02:00
Alexander Bokovoy
31f8945aa6 wafsamba: install Python modules back to bin/python, not bin/python_modules
Partially revert 80fce353e7 which started
installing generated Python modules into python_modules directory back
in 2013. This, unfortunately, does not work anymore as Python gets quite
confused with our setup even when both bin/python and bin/python_modules
directories are part of sys.path.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:27 +02:00
Alexander Bokovoy
77f3a1387f buildtools/wafsamba: use cflags instead of ccflags for waf 2.0
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:27 +02:00
Alexander Bokovoy
1d25ae580b buildtools/wafsamba: use context instead of options for cross-compile checks for waf 2.0
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:27 +02:00
Alexander Bokovoy
aebcd69876 buildtools/wafsamba: crosscompile should use Utils.subprocess in waf 2.0
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:26 +02:00
Alexander Bokovoy
fb43723bc1 buildtools/wafsamba: use top and out for waf 2.0
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:26 +02:00
Alexander Bokovoy
0fdba4be9c buildtools/wafsamba: use top for waf 2.0
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:26 +02:00
Alexander Bokovoy
cdda0d9048 buildtools/wafsamba: change SAMBA_BUILD_ENV to use bldnode.abspath()
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:26 +02:00
Alexander Bokovoy
1fdcbd0696 wafsamba: use correct context for APPNAME
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:26 +02:00
Thomas Nagy
850ceec810 buildtools/wafsamba: compile asn1 files by adding missing code from compat15
Signed-off-by:    Thomas Nagy <tnagy@waf.io>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:26 +02:00
Alexander Bokovoy
7aaa1e680e buildtools/wafsamba/samba_abi: always_run helper was deprecated in waf 2.0
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:26 +02:00
Alexander Bokovoy
3fc4786658 buildtools/wafsamba: add install_dir to build context
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:25 +02:00
Alexander Bokovoy
69c655fe98 buildtools/wafsamba: reduce imports
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:25 +02:00
Alexander Bokovoy
7eab91a068 buildtools/wafsamba: adopt to waf 2.0.8
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:25 +02:00
Alexander Bokovoy
15288c38b3 lib/tdb/wscript: update to handle waf 2.0.4
Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:23 +02:00
Alexander Bokovoy
4e65b33c1d third_party:waf: update to upstream 2.0.4 release
Update third_party/waf/ to 2.0.4 to bring us closer to Python 3

This change requires a number of changes in buildtools/ too.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:22 +02:00
Thomas Nagy
5d99786151 build:wafsamba: Update dist/distcheck commands
Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:21 +02:00
Thomas Nagy
8077f462c9 build:wafsamba: Build on waf 1.9
Signed-off-by: Thomas Nagy <tnagy@waf.io>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-05 06:37:21 +02:00
Andreas Schneider
fc4df251c8 waf: Add -fstack-clash-protection
https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-04 02:31:27 +02:00
Andreas Schneider
38e97f8b52 waf: Check for -fstack-protect-strong support
The -fstack-protector* flags are compiler only flags, don't pass them to
the linker.

https://developers.redhat.com/blog/2018/03/21/compiler-and-linker-flags-gcc/

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2018-09-04 02:31:27 +02:00
Andrew Bartlett
739691fd1e buildtools: Split git ls-files output on newline, not any whitespace
This allows files to have a space in the filename within the Samba git tree.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-08-16 23:42:19 +02:00
Alexander Bokovoy
4e123c4682 wafsamba/samba_abi: always hide ABI symbols which must be local
binutils 2.31 is going to change how shared libraries are linked, such
that they always provide their own local definitions of the _end, _edata
and _bss_start symbols.  This would all be fine, except for shared
libraries that export all symbols be default.  (Rather than just
exporting those symbols that form part of their API).

According to binutils developers, we should only export the symbols we
explicitly want to be used. We don't use this principle for all our
libraries and deliberately don't want to have ABI versioning control for
all of them, so the change I introduce here is to explicitly mark those
symbols that will always be added by default linker configuration with
binutils 2.31 as local. Right now these are '_end', '_edata', and
'__bss_start' symbols.

Signed-off-by: Alexander Bokovoy <ab@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Jul 13 17:45:36 CEST 2018 on sn-devel-144
2018-07-13 17:45:35 +02:00
Christof Schmitt
5c58ccba71 wscript: Add --with-system-heimdalkrb5
Add the configure option --with-system-heimdalkrb5 to build Samba
explicitly with a system Heimdal kerberos library. This does the same as
the more complicated syntax

--bundled-libraries='!heimdal,!asn1,!com_err,!roken,!hx509,!wind,!gssapi,!hcrypto,!krb5,!heimbase,!asn1_compile,!compile_et,!kdc,!hdb,!heimntlm'

and it also enforces the conflicts with MIT Kerbros and the AD DC
build.

Signed-off-by: Christof Schmitt <cs@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jul 11 05:18:59 CEST 2018 on sn-devel-144
2018-07-11 05:18:59 +02:00
Amitay Isaacs
a9775c2429 wafsamba: Be strict when checking __attribute__ features
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13493

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
2018-07-04 23:56:43 +02:00
Amitay Isaacs
c08d65c3ee wafsamba: Add strict option to CHECK_CODE
Some compilers (e.g. xlc) ignores unsupported features, generates a
warning, but does not fail compilation.

This ensures that any compiler warnings are treated as errors and the
feature support is correctly identified.  This adds equivalent compiler
option to -Werror for xlc.

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

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
2018-07-04 23:56:42 +02:00
Joe Guo
f3b5287538 python: bulk replace dict.iteritems to items for py3
In py3, iterxxx methods are removed.

Signed-off-by: Joe Guo <joeg@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2018-04-13 07:27:12 +02:00
Andreas Schneider
924f3f000e wafsamba: Add '-Werror=strict-overflow -Wstrict-overflow=2' to the developer build
We could move it to 3, but shouldn't go higher. If you set it to 4 and 5
you will probably also get a lot of false positives.

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Apr  6 02:07:16 CEST 2018 on sn-devel-144
2018-04-06 02:07:15 +02:00
Andreas Schneider
5ebb1dd18e wafsamba: Add missing cflags_end argument to SAMBA_BINARY
Signed-off-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 Apr  3 23:08:33 CEST 2018 on sn-devel-144
2018-04-03 23:08:33 +02:00
Andreas Schneider
a12e12e986 wafsamba: Add missing cflags_end argument to SAMBA_MODULE
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2018-04-03 20:20:11 +02:00
Andreas Schneider
33fa6778e1 wafsamba: Build with -Wimplicit-fallthrough if supported
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Mar  1 19:38:12 CET 2018 on sn-devel-144
2018-03-01 19:38:12 +01:00
Douglas Bagnall
578786c38b buildtools python: convert 'except X, e' to 'except X as e'
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Thu Feb 15 05:40:55 CET 2018 on sn-devel-144
2018-02-15 05:40:55 +01:00
Andreas Schneider
87f105d76c wafsamba: Allow passing 'lib' to CHECK_STRUCTURE_MEMBER
BUG: https://bugzilla.samba.org/show_bug.cgi?id=13238

We need to be able to point it to the right header location, so we need
to be able to pass the 'lib' that it gets set.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2018-01-22 12:26:20 +01:00
Mathieu Parent
e131ce4ddc waf: Remove build system info (uname -a)
Preventing reproducible builds while adding minor benefit.

More information at <https://reproducible-builds.org/>.

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

Signed-off-by: Mathieu Parent <math.parent@gmail.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
2018-01-14 17:38:26 +01:00
Andreas Schneider
19606e4dc6 third_party: Update socket_wrapper to version 1.1.9
* Fixed thread - signal deadlock issue
* Added support for openat()
* Added support for open64() and fopen64()
* Always turn on logging
* Increased maximum of wrapped interfaces to 64
* Improved fd duplication code
* Fixed strict-aliasing issues
* Fixed some use after free issues
* Fixed issues on ppc64le

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2017-12-06 19:06:21 +01:00
Andreas Schneider
8635465d77 build: Move pam_wrapper to third_party
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2017-11-25 10:14:13 +01:00
Andreas Schneider
6fbc8b810e build: Move uid_wrapper to third_party
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2017-11-25 10:14:13 +01:00
Andreas Schneider
ac65070490 build: Move resolv_wrapper to third_party
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2017-11-25 10:14:13 +01:00
Andreas Schneider
5d2b5e9848 build: Move nss_wrapper to third_party
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2017-11-25 10:14:13 +01:00
Andreas Schneider
22bf36c85a build: Move socket_wrapper to third_party
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>
2017-11-25 10:14:13 +01:00
Uri Simchoni
667335a42d build: ensure compiler flags are properly detected
While checking for compiler flag availability, treat warnings
as errors. Thus if the compiler only warns about unsupported flag,
it will fail the test and the flag shall be marked as unsupported.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Nov 22 14:19:20 CET 2017 on sn-devel-144
2017-11-22 14:19:20 +01:00
Uri Simchoni
2e53d6a30f build: specify -Wformat as a prerequisite of -Wformat-security
Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-11-22 10:20:21 +01:00
Uri Simchoni
34b4be091f build: allow specifying prerequisite flags when checking flags
In gcc, "-Wformat-security" is ignored unless "-Wformat" is also
specified. This patch allow adding a "prerequisite flag" to a flag
we're testing during configuration.

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-11-22 10:20:21 +01:00
Uri Simchoni
e973ac0643 build: disable format-zero-length warning
format-zero-length warns against printf-style calls with
zero-length format string. vfs_full_audit module has such
calls, and up until now there was no warning against it because
the do_log in vfs_full_audit is not recognized as printf-style
function. In a following commit the do_log will be converted to
a printf-style function, hence the need to disable this warning.

(an alternative would be to disable only for vfs_full_audit, but that
would complicate things needlessly).

Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-11-22 10:20:21 +01:00
Uri Simchoni
2606c99ed3 build: allow adding cflags to end of python module build command
Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-11-22 10:20:20 +01:00
Uri Simchoni
98813a605d build: allow passing custom cflags to end of library build
Signed-off-by: Uri Simchoni <uri@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-11-22 10:20:20 +01:00
Andreas Schneider
e5a2e6291a wafsamba: We need to honor DESTDIR in INSTALL_DIR
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12957

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Sep 16 04:47:29 CEST 2017 on sn-devel-144
2017-09-16 04:47:29 +02:00
Andreas Schneider
2bf9b5e166 wafsamba: Do not chmod already existing dirs on install
This might break backward compatibility.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-09-16 00:57:24 +02:00
Andreas Schneider
4c9608fb27 param: Add 'binddns dir' parameter
This allows to us to have restricted access to the directory by the group
'named' which bind is a member of.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
2017-09-05 23:58:20 +02:00
Andreas Schneider
4311332a07 wafsamba: Call INSTALL_DIR in INSTALL_DIRS
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12957

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-08-24 05:39:26 +02:00
Andreas Schneider
59dc9eb776 wafsamba: Add INSTALL_DIR function
The install_dir function in waf has been deprecated and it doesn't
support setting directory permissions. So we need to implement our own
function anyway.

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

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-08-24 05:39:26 +02:00
Martin Schwenke
769e889e0e build: Do not recurse on symlinks to directories when building tarballs
DIST_FILES() causes all files in any specified directory to be
recursively added to the tarball.  However, a symbolic link to a
directory is detected as a regular directory so is also subject to
recursion.  This means that a symbolic link to a directory is
dereferenced and the directory of files beyond it are added to the
tarball under a directory corresponding to the link.  This is almost
certainly not what is intended because it will usually result in
duplicate files.  This is because the contents of a symbolic link's
target directory will already be present in the tarball.

Instead, do not treat symbolic links to directories as directories,
but add them to the tarball like normal files.

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-08-10 06:43:13 +02:00
Martin Schwenke
68a02d18c1 build: Do not ignore symlinks to directories when building tarballs
Tarballs currently do not contain symbolic links to directories even
if they are committed in git.  This means that CTDB tests fail when
run in-tree from a tarball, due to a couple of missing links needed by
unit tests:

  ERROR: Directory .../ctdb/tests/var/unit_eventscripts/etc-ctdb/events.d does not exist.

Subdirectories of directories specified via DIST_DIRS() are ignored,
since all the files within them are separately added to the tarball.
Symbolic links to directories are detected as directories, so they are
also ignored, causing them to be missing from the tarball.

Instead, do not treat symbolic links to directories as directories,
but add them to the tarball like normal files.

It is easy to confirm that this change causes no difference to current
tarballs other than causing the missing CTDB test links to be added:

  $ diff -u samba-4.8.0pre1-GIT-eb691cd0242.tar.gz.contents samba-4.8.0pre1-GIT-dfb16de0149.tar.gz.contents
  --- samba-4.8.0pre1-GIT-eb691cd0242.tar.gz.contents	2017-08-08 20:21:40.022993091 +1000
  +++ samba-4.8.0pre1-GIT-dfb16de0149.tar.gz.contents	2017-08-08 20:35:11.001580747 +1000
  @@ -578,7 +578,9 @@
   ctdb/tests/eventscripts/91.lvs.startup.001.sh
   ctdb/tests/eventscripts/91.lvs.startup.002.sh
   ctdb/tests/eventscripts/README
  +ctdb/tests/eventscripts/etc-ctdb/events.d
   ctdb/tests/eventscripts/etc-ctdb/functions
  +ctdb/tests/eventscripts/etc-ctdb/nfs-checks.d
   ctdb/tests/eventscripts/etc-ctdb/nfs-linux-kernel-callout
   ctdb/tests/eventscripts/etc-ctdb/public_addresses
   ctdb/tests/eventscripts/etc-ctdb/rc.local

Signed-off-by: Martin Schwenke <martin@meltin.net>
Reviewed-by: Amitay Isaacs <amitay@gmail.com>
2017-08-10 06:43:13 +02:00
Bernhard M. Wiedemann
85b10a636e s3: drop build_env
As a follow up to eedebe2ef1 ("docs-xml: Sort input file list"), this
change enables reproducible builds, without the added complexity of
https://lists.samba.org/archive/samba-technical/2017-June/121302.html

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

Signed-off-by: Bernhard M. Wiedemann <bwiedemann@suse.de>
Reviewed-by: David Disseldorp <ddiss@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): David Disseldorp <ddiss@samba.org>
Autobuild-Date(master): Fri Jul 14 18:48:08 CEST 2017 on sn-devel-144
2017-07-14 18:48:07 +02:00
Stefan Metzmacher
4ca48ee4d0 wafsamba: add maxversion and version_blacklist to CHECK_BUNDLED_SYSTEM[_PKG]()
BUG: https://bugzilla.samba.org/show_bug.cgi?id=12859

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2017-07-02 17:35:18 +02:00
Andreas Schneider
0aadb5068f wafsamba: Pass down the install argument for samba modules
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-06-06 18:36:06 +02:00
Amitay Isaacs
ae35bb8eaf wafsamba: Allow to specify VERSION file path
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
2017-05-24 17:03:28 +02:00
Jeremy Allison
306783d6f5 lib: modules: Change XXX_init interface from XXX_init(void) to XXX_init(TALLOC_CTX *)
Not currently used - no logic changes inside.

This will make it possible to pass down a long-lived talloc
context from the loading function for modules to use instead
of having them internally all use talloc_autofree_context()
which is a hidden global.

Updated all known module interface numbers, and added a
WHATSNEW.

Signed-off-by: Jeremy Allison <jra@samba.org>
Signed-off-by: Ralph Böhme <slow@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Apr 22 01:17:00 CEST 2017 on sn-devel-144
2017-04-22 01:17:00 +02:00
Ralph Boehme
4a43129b7a wafsamba: add source directory define SRCDIR to config.h
This will be used in the next commit to prepare the path to a test
script in a smbtorture test.

Signed-off-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-04-20 16:53:16 +02:00
Andreas Schneider
686ac6b171 wafsamba: Add CHECK_CMOCKA function
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Andrew Bartlet <abartlet@samba.org>
2017-04-10 07:45:24 +02:00
Stefan Metzmacher
d1b88c6a6e wafsamba: move -L/some/path from LINKFLAGS_PYEMBED to LIBPATH_PYEMBED
LINKFLAGS should not have path components.

This fixes the build on systems like FreeBSD where python
is located in /usr/local/lib.

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

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Stefan Metzmacher <metze@samba.org>
Autobuild-Date(master): Tue Apr  4 16:10:18 CEST 2017 on sn-devel-144
2017-04-04 16:10:18 +02:00
Ian Stakenvicius
5bbcd09382 waf: disable-python - add option globally to build system
This commit adds --disable-python as an option to the build system.
It adds PYTHON_BUILD_IS_ENABLED() to bld, to be used with enabled=
on other modules, and adjusts SAMBA_PYTHON() to set enabled=False
if PYTHON_BUILD_IS_ENABLED() is false.

Signed-off-by: Ian Stakenvicius <axs@gentoo.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2017-03-10 07:31:12 +01:00
Andrew Bartlett
b7a5308612 buildtools: Work around a . being in the target name when building python3 helpers
The pyparam_util module becomes pyparam_util.cpython_35m_x86_64_linux_gnu but
the command line parser for -D stops at the first .

That we even set -DSTATIC_subsystem_MODULES_PROTO for these subsystems without
any modules ever declared is left for another time

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
2017-03-10 07:31:11 +01:00
Andrew Bartlett
f5cafee0c7 talloc: use the system pytalloc-util for python3 as well
This involves installing a .pc file for the python3 library as well

To get the .pc file generated and installed is quite a mission, we
have to rework the talloc build system to ensure that the second 'env'
created for EXTRA_PYTHON has everything set up on it, the
TALLOC_VERSION in particular.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>

Incorportaing fixes by Petr Viktorin <pviktori@redhat.com>

Signed-off-by: Petr Viktorin <pviktori@redhat.com>
2017-03-10 07:31:10 +01:00
Volker Lendecke
b93d58e48e waf: Fix a typo
Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-03-01 20:33:18 +01:00
Thomas Nagy
e36e1f7b12 build:wafsamba: Remove ambiguous 'if x in conf.env' constructs
Configuration values such as HAVE_STDDEF_H can be set to 0
to indicate a test failure. Waf 1.5 has a few bugs that
prevent configuration tests from setting such values
consistently on failures.

Consequently, conditions such as 'if conf.env.VARNAME' must be
used to indicate that config test successes are expected.
Note that conf.env.VARNAME always returns an empty list (False value)
when no variable is defined so there are no risk of raising
AttributeError/KeyError exceptions.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Uri Simchoni <uri@samba.org>

Autobuild-User(master): Uri Simchoni <uri@samba.org>
Autobuild-Date(master): Tue Feb 21 13:47:07 CET 2017 on sn-devel-144
2017-02-21 13:47:07 +01:00
Matthieu Patou
3e2a36774f wafsamba: Remove 2010 comments that seems not accurate anymore
In my tests default value is correctly used and if we provide explicitly
a --with it will comply with the store_true and if we provide --without
then it will comply with the store_false

Change-Id: I820a7f2f08c51ec23b694bce7009c3891d4ab8ef
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-02-09 20:04:12 +01:00
Matthieu Patou
468301bedd wafsamba: Move command line option function labelled as 'samba3' to the common set of functions
It allows to be used for things that are not 'samba3' only (or more
accurately things not in common and not related to the AD DC
implementation)

Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Jeremy Allison <jra@samba.org>
2017-02-09 20:04:12 +01:00
Stefan Metzmacher
4b295b106c wscript: remove executable bits for all wscript* files
These files should not be executable.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>

Autobuild-User(master): Volker Lendecke <vl@samba.org>
Autobuild-Date(master): Wed Jan 11 20:21:01 CET 2017 on sn-devel-144
2017-01-11 20:21:01 +01:00
Lukas Slebodnik
be12f82cf1 WAF: Fix detection os sysname ...
Detection of sysname failed with stricter CFLAGS
"-Werrorr=implicit-function-declaration -Werror=implicit-int"

  Checking uname sysname type              : not found
  Checking uname machine type              : not found
  Checking uname release type              : not found
  Checking uname version type              : not found

../test.c: In function ‘main’:
../test.c:8:32: error: implicit declaration of function ‘printf’
    [-Werror=implicit-function-declaration]
                                printf("%s", n.sysname);
                                ^~~~~~
../test.c:8:32: warning: incompatible implicit declaration
    of built-in function ‘printf’
../test.c:8:32: note: include ‘<stdio.h>’ or provide a declaration of ‘printf’

Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-01-02 14:12:27 +01:00
Lukas Slebodnik
f4c0a750d4 WAF: Fix detection of linker features
Following check of linker feature failed with strict CFLAGS
"-Werrorr=implicit-function-declaration -Werror=implicit-int"

  Checking for rpath library support       : not found
  Checking for -Wl,--version-script support  : not found

../main.c: In function ‘main’:
../main.c:1:26: error: implicit declaration of function ‘lib_func’
    [-Werror=implicit-function-declaration]
 int main(void) {return !(lib_func() == 42);}
                          ^~~~~~~~

Signed-off-by: Lukas Slebodnik <lslebodn@redhat.com>
Reviewed-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
2017-01-02 14:12:27 +01:00
Andrew Bartlett
da67acbcfe build: Fix build with perl on debian sid.
build: Fix build with perl on debian sid.

It appears that "." is no longer in perl_inc

BUG: https://bugzilla.samba.org/show_bug.cgi?id=12395
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Martin Schwenke <martin@meltin.net>

Autobuild-User(master): Martin Schwenke <martins@samba.org>
Autobuild-Date(master): Sat Oct 29 09:32:37 CEST 2016 on sn-devel-144
2016-10-29 09:32:36 +02:00
Stefan Metzmacher
7c84cb54fc wafsamba: add -Werror=format-security to the developer build
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): Mon Sep  5 20:23:00 CEST 2016 on sn-devel-144
2016-09-05 20:22:59 +02:00
Michael Adam
a6ee401949 build: avoid -Wtautological-compare errors from gcc6+ by disabling it globally
Signed-off-by: Michael Adam <obnox@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Fri Jul 15 04:31:27 CEST 2016 on sn-devel-144
2016-07-15 04:31:27 +02:00
Douglas Bagnall
1c796547f2 configure: set HAVE___ATTRIBUTE__ for heimdal
Without this, heimdal ends up defining __attribute__ away, causing
gcc-6 compile errors with -Werror=return-type because it can't tell
when functions have __attribute__((noreturn)).

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Mar  9 13:52:26 CET 2016 on sn-devel-144
2016-03-09 13:52:26 +01:00
Jelmer Vernooij
3eb90650a8 Error when private libraries have public headers.
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
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
Gustavo Zacarias
f8c179b80e build: allow some python variable overrides
The python variables (settings) are fetched from a running python
interpreter which usually isn't the target one when cross compiling,
hence libraries and flags aren't the same and can pollute the target build.
Allow some of these variables to be redefined via environment variables
in order to aid cross-compiling.
According to testing python_LDFLAGS and python_LIBDIR should be enough.

Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: David Disseldorp <ddiss@samba.org>

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Thu Feb 13 06:03:26 CET 2014 on sn-devel-104
2014-02-13 06:03:26 +01:00
David Disseldorp
a8071954fe build: warn about mixed declarations and code
Attempt to use the -Wdeclaration-after-statement cflag when building in
developer mode.

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

Autobuild-User(master): Jeremy Allison <jra@samba.org>
Autobuild-Date(master): Sat Feb  1 20:20:35 CET 2014 on sn-devel-104
2014-02-01 20:20:35 +01:00
Garming Sam
57ba012c10 docs: define and include entities for the docs
This allows for dynamic default settings to be generated.

Change-Id: If8b93d233fb941bc7e3073ccf4b5ec0b0a231bd9
Pair-programmed-with: Andrew Bartlett <abartlet@samba.org>
Signed-off-by: Garming Sam <garming@catalyst.net.nz>
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>
2014-01-31 21:07:05 +01:00
Christian Ambach
a83f491810 waf:lib/replace change detection of gettext
convert this to an automatic check: if no option is given, try to find gettext
and if found, use it
if user has specified --with-gettext, then bail out if it could not be found
in case of --without-gettext, skip all gettext related configure checks

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

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-01-03 05:04:44 +01:00
Björn Jacke
af5102fe00 build: test the generic md5 function after importing it from hashlib
otherwise we used the one from md5 which lead to the following warning on SerNet-imini:

the md5 module is deprecated; use hashlib instead import md5

Signed-off-by: Bjoern Jacke <bj@sernet.de>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2014-01-08 18:20:19 +13:00
Steven Siloti
319c2d7311 waf: parse LDFLAGS from python
The LDFLAGS returned by get_python_variables may contain additional library
search paths. These need to be parsed out and placed in LIBPATH to maintain
correct ordering of search paths in the final link flags.

Specifically, appending LDFLAGS directly to LINKFLAGS on my system was causing
/usr/lib to be the first search path specified. This lead to linking against
installed libraries rather than the versions from the current build.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Fri Oct 25 02:48:35 CEST 2013 on sn-devel-104
2013-10-25 02:48:35 +02:00
Michael Adam
64f5e24100 build: 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.

Signed-off-by: Michael Adam <obnox@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-10-25 11:55:14 +13:00
Matthieu Patou
096c962bfe Backport 0e97908 from WAF repository: symlink fix for OpenBSD
Author: Thomas Nagy <tnagy1024@gmail.com>
Signed-off-by: Matthieu Patou <mat@matws.net>
Reviewed-by: Kai Blin <kai@samba.org>

Autobuild-User(master): Kai Blin <kai@samba.org>
Autobuild-Date(master): Sat Sep 21 11:14:30 CEST 2013 on sn-devel-104
2013-09-21 11:14:30 +02:00
Christian Ambach
a742e87b39 waf: add --without-gettext option
Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-08-09 22:46:51 +02:00
Christian Ambach
ce8fbdf76e waf: fix build on AIX7
the same works for AIX 5,6,7 so leave away the version specifics (as autoconf build did)

Signed-off-by: Christian Ambach <ambi@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-08-09 22:45:35 +02:00
Andreas Schneider
191e6b9441 waf: Build with RELRO if supported by the compiler.
Make sure we create binaries with full RELocation Read-Only support. See
https://isisblogs.poly.edu/2011/06/01/relro-relocation-read-only/
for more details.

The default is to check if the compiler supports RELRO and then enable
it. Specifying '--with-relro' will make it mandatory and
'--without-relro' will disable it.

Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-07-09 13:00:37 -07:00
Michael Adam
3f24d694e7 build: Add missing new line to replaced python shebang line. (Fix bug #9909)
When configuring with a non-standard python specified in
the PYTHON environment variable, the shebang lines in various
python tools like samba-tool and samba_dnsupdate get replaced.

This replace line for the shebang was missing a newline
which joined the shebang line with the following line,
rendereing those scripts with a nonempty second line unusuable,
for example samba_dnsupdate.

This patch fixes this bug which is bug #9909 on bugzilla.

Pair-Programmed-With: Karolin Seeger <kseeger@samba.org>

Signed-off-by: Michael Adam <obnox@samba.org>
Signed-off-by: Karolin Seeger <kseeger@samba.org>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Wed May 29 13:21:51 CEST 2013 on sn-devel-104
2013-05-29 13:21:51 +02:00
Andrew Bartlett
dd72d85e92 build: Remove unused tool for config.h comparison
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>

Reviewed-by: David Disseldorp <ddiss@samba.org>
2013-05-28 12:17:12 +10:00
David Disseldorp
4e76a77f62 waf: build position independent executables
This patch re-instates support for building Position Independent
Executables using the '-fPIE' and '-pie' compiler and linker flags
respectively.

PIE builds are enabled by default, and can be explicitly disabled using
the '--without-pie' configure argument.

Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Tue May 28 02:56:36 CEST 2013 on sn-devel-104
2013-05-28 02:56:36 +02:00
Andrew Bartlett
8903103bd6 build: Do not always regenerate the version.h file
Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2013-05-27 11:57:02 +10:00
Andrew Bartlett
c6673b96a5 build: Remove binaries and libraries build groups
Build groups are used in Samba to ensure that even if the dependency
chain for a target is not perfect, that it builds reliably.  This
matters most in the early build stages, where we are building the asn1
compiler and autogenerating files.

Once we get to the main stage, dependencies between C files, libraries
and binaries are much clearer, because the C compiler and linker takes
these as inputs anyway.

Groups were added to our waf build for stability during early
development, as dependency information was first imported from the
previous autoconf/perl based build system.

I don't think we need this distinction in the main build of C files
into .o, and when linking these into binaries, because the invocation
of these tools is very well defined, and we will find any missing
inputs very quickly.

As such, I've removed the libraries and binaries targets,
consolidating them with 'main'

By making this change, a build of smbtorture only on a clean tree
drops from 3778 to 2489 targets, and much of the expensive linker
stage is skipped.  The time for a null build of smbtorture only also
drops from 4.673s to as low as 2.499s on my laptop.

Andrew Bartlett

Reviewed-by: Jelmer Vernooij <jelmer@samba.org>
2013-05-27 11:56:46 +10:00
Matthieu Patou
e1b71f1c13 buildtools: Fix compilation warnings
STATIC_%s_MODULES_PROTO is defined on the compilation command line by
-DSTATIC_<something>_MODULES_PROTO which the compiler seems to turn into
define STATIC_<something>_MODULES_PROTO 1 thus yielding a warning due to
unused var

Signed-off-by: Matthieu Patou <mat@matws.net>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-05-20 21:52:44 +10:00
Kai Blin
61a2ad3c02 swat: Remove swat.
Signed-off-by: Kai Blin <kai@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>

Autobuild-User(master): Kai Blin <kai@samba.org>
Autobuild-Date(master): Sat May 18 16:32:38 CEST 2013 on sn-devel-104
2013-05-18 16:32:38 +02:00
Vadim Zhukov
2fda6c47f4 More generic check for OpenBSD platform
OpenBSD versioning is different from many other
projects, and, say, 5.0 does not differ from 4.9 more than from 5.1. So the
right approach will be to check that platform name starts with "openbsd"
instead. This is also the thing OpenBSD developers do when patching other
software, so this patch is consistent with already existing practicies.

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

Reviewed-by: Lars Müller <lars@samba.org>
Reviewed-by: Björn Jacke <bj@sernet.de>

Autobuild-User(master): Björn Jacke <bj@sernet.de>
Autobuild-Date(master): Fri May 17 17:58:16 CEST 2013 on sn-devel-104
2013-05-17 17:58:16 +02:00
Matthieu Patou
1160b699cb configure: print a message when docbook.xsl is missing localy
Signed-off-by: Matthieu Patou <mat@matws.net>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-05-06 21:05:25 +12:00
Andrew Bartlett
7955bf473f build: Raise minimum python version to 2.5.0 for samba build
RHEL5 has a python26 package for a modern python, and was the main reason we
kept python 2.5 support.

However, this support never actually worked for AD DC installations,
as samba-tool uses a feature only in 2.5 and above.  Very few folks
noticed and those were on RHEL5, and moving to 2.5 allows us to remove
some other workarounds.

Andrew Bartlett

Reviewed-by: Matthieu Patou <mat@matws.net>

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2013-04-11 16:44:46 +10:00
Andrew Bartlett
58e3c5323e build: Replace #!/usr/bin/env python with passed in PYTHON=
This means that if we were forced to use a specific python for the build, we
will put that binary into the top of samba-tool, so it continues to work
after the install.

Andrew Bartlett

Reviewed-by: Michael Adam <obnox@samba.org>
2013-04-10 00:13:45 +02:00
Alexander Bokovoy
6058bc9bb6 wafsamba: fix samba_abi for default catch-all case
Only filter out the symbol when positive match was not found and there is
negative match.

ABI signature file generator worked incorrectly for cases when mixture of
positive and negative matches were provided. This resulted in generating empty
signature file for libpdb since there was no catch-all positive match anymore.

Commit 9ba44cc610 removed explicit '*' positive
match and corresponding vscript generator adds '*' by default if global match
list is empty, so this commit introduces feature parity into signature
generator.

Reviewed-by: Andreas Schneider <asn@samba.org>
2013-04-09 20:29:18 +02:00
Stefan Metzmacher
81cc940c99 wafsamba: display the default value in help for SAMBA3_ADD_OPTION
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-04-03 09:53:08 +02:00
Andrew Bartlett
afe9343880 build: Do not pass CPP="" to pidl, skip the env variable entirely
This will cause pidl to use $CC -E instead.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-25 10:25:36 +01:00
Andrew Bartlett
7dc6dfd90c build: Remove the forced use of only the first part of the compiler string
This corrects parts of 378295c3fe and
301d59caf2.  This is seen if CC="ccache
gcc" and CPP isn't used for some reason.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-03-25 10:23:00 +01:00
Andrew Bartlett
80fce353e7 build: Change bin/default/python -> bin/python symlink to bin/default/python_modules
This avoids a collision with the new top level python directory.

Andrew Bartlett
2013-03-02 02:16:52 +01:00
Stefan Metzmacher
87f255821b wafsamba: add CHECK_VALUEOF() helper
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
2013-03-01 11:58:38 -08:00
Björn Baumbach
d61d2af372 wafsamba: use additional xml catalog file (bug #9512)
Add additional "/usr/local/share/xml/catalog" catalog file
platforms (used by freebsd).
Fix manual page build on freebsd.

Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Michael Adam <obnox@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
2013-01-15 14:49:19 +01:00
Andrew Bartlett
9dfd0a0dc9 build: Remove bashism from SAMBAMANPAGES rule
In sh, you must assign the variable, then export it.

Andrew Bartlett

Reviewed-by: Stefan Metzmacher <metze@samba.org>
2013-01-10 18:46:22 +11:00
Jelmer Vernooij
e1a819ea18 wafsamba: python-config is not always a script. 2012-12-26 20:48:36 +01:00
Alexander Bokovoy
b6e2be8e14 wafsamba: replace try:except: case with explicit comment about FIPS mode
Since exceptions will be caught be outer try:except: pair anyway, mark
the test of MD5 code by the comment that explains why we need to really
test it.

Do it for both hashlib.md5 and md5 modules.

Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Sat Dec  8 18:41:07 CET 2012 on sn-devel-104
2012-12-08 18:41:07 +01:00
Alexander Bokovoy
56d9c8c4bf wafsamba: Make sure md5 is really work before using it or overriding the hash function
In FIPS mode importing md5 Python module will not cause any error but calling md5.md5()
function will throw ValueError since md5 is not available.

Make sure md5.md5() actually works and if not, fall back to use hash replacement that
we already have in wafsamba.

Reviewed-by: Andreas Schneider <asn@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Sat Dec  8 13:30:07 CET 2012 on sn-devel-104
2012-12-08 13:30:07 +01:00
Andreas Schneider
2ad562057a BUG 9459: Install manpages only if we install the target.
Reviewed-by: Alexander Bokovoy <ab@samba.org>

Autobuild-User(master): Andreas Schneider <asn@cryptomilk.org>
Autobuild-Date(master): Tue Dec  4 18:07:47 CET 2012 on sn-devel-104
2012-12-04 18:07:47 +01:00
Christian Ambach
3712de7b9c build(waf): support AIX 6.1
on AIX6.1, we need to define _ALL_SOURCE as well, otherwise
system headers with BSD types like u_int cannot be used
2012-11-09 19:15:24 +01:00
Jelmer Vernooij
ec3cbb6c47 wafsamba.abi: Fix abi_match with both excludes and includes.
This fixes a regression introduced by 9c3e294400
which caused internal symbols in libldb to be exposed.

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

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
2012-11-06 08:27:44 +11:00
Jelmer Vernooij
d02c8ba122 wafsamba.samba_abi: Add basic unit tests.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
2012-11-06 08:27:44 +11:00
Andrew Bartlett
97102fa996 buildtools: Remove extra space from global: line
This makes it easier to put the expected values in a file
as we will not have trailing whitespace that is against git style.

Andrew Bartlett

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

Reviewed-by: Andrew Bartlett <abartlet@samba.org>
2012-11-06 08:27:44 +11:00
Jelmer Vernooij
ea5ef95fbe wafsamba.samba_abi: Refactor abi_write_vscript to take file argument.
Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stephen Gallagher <sgallagh@redhat.com>
2012-11-06 08:27:43 +11:00
Andrew Bartlett
06eee7f50b build: Remove support for IDL-generated files in git tree
This was added in a9ea3d6fa5 but is no
longer required, as we do not store IDL-generated files in GIT.

Andrew Bartlett
2012-10-28 19:39:00 +11:00
Andreas Schneider
8490c1a503 wafsamba: If we define a realname and a soname create a symlink.
This is needed that libnss_winbind.so.2 and libnss_wins.so.2 will get a
corresponding symlinks.
2012-10-22 09:04:21 +02:00
Stefan Metzmacher
1de9e71475 buildtools/wafsamba: only display 'ok' if the result is True
Otherwise we print the raw value.

metze

Signed-off-by: Michael Adam <obnox@samba.org>
2012-10-19 12:14:57 +02:00
Jelmer Vernooij
276460cf8a wafsamba: Ignore some more symbols when checking for dupes. 2012-10-11 15:21:31 +02:00
Andrew Bartlett
0f435a7adc build: Remove --disable-shared
This does not work, and has no known use cases.  Remove it so we do
not waste time trying to support it.

This also removes it for ldb/tdb/ntdb/talloc, but as these are first
shared libraries, and then tools on top of those, rpath or (for
emergency tools) --nonshared-binary= seems more appropriate.

Andrew Bartlett
2012-10-11 14:57:44 +11:00
Jelmer Vernooij
2a797f29aa s4-python: Various formatting fixes.
* Trailing whitespace
* use of "==" where "is" should be used
* double spaces
2012-09-27 18:45:12 +02:00
Ira Cooper
0231575709 waf: Make samba "ok" with directories for install being symlinks
stat -> lstat conversion.  This allows people for whom $PREFIX/var is a
symlink to complete make install.

Autobuild-User(master): Ira Cooper <ira@samba.org>
Autobuild-Date(master): Thu Sep 20 23:26:26 CEST 2012 on sn-devel-104
2012-09-20 23:26:26 +02:00
Alexander Bokovoy
73ed153310 docs-xml: convert smb.conf.5 build to waf
smb.conf(5) is different from other manpages because before it is
built, it gets merged together from a number of smaller files, one
per parameter. So we first create a parameters.all.xml file that
references all these files and then include it into master smb.conf.5.xml

One small issue is how to handle generated files in WAF build
from xi:include perspective as the files are generated in bin/default/docs-xml
rather than in docs-xml. We solve this by further expanding use of XML catalogs
and rewriting virtual path http://www.samba.org/samba/smbdotconf/ to proper
location.

Both docs-xml autoconf and waf builds work correctly now.

Autobuild-User(master): Alexander Bokovoy <ab@samba.org>
Autobuild-Date(master): Mon Sep 17 14:18:31 CEST 2012 on sn-devel-104
2012-09-17 14:18:31 +02:00
Michael Adam
d28f36d16e build:dist: extend meaning of DIST_FILES to also recurse into directories
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-09-12 23:53:12 +02:00
Michael Adam
36b2732426 build:dist: make use of file / distfile more obvious in handling of DIST_FILES in "make dist"
Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-09-12 23:53:09 +02:00
Michael Adam
8ea2a468c3 build:dist: extend samba_dist.DIST_FILES() to take optional parameter extend(=False)
This allows to do multpile DIST_FILES() calls that will extend the list
rather than only setting it initially.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2012-09-12 23:53:02 +02:00
Michael Adam
4989a9dd7c build:waf dist: factor out function to add list of files to the tarball
Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
2012-09-12 23:52:56 +02:00
Andreas Schneider
66a87d7cbe wafsamba: Add a SAMBAMANPAGES function. 2012-09-12 12:21:29 +02:00
Alexander Bokovoy
9c3e294400 wafsamba/samba_abi: allow negative matches in abi_match
abi_match keyword for samba libraries allows to selectively
apply ABI versions. samba_abi.py implied !sym to be used to
say 'all symbols but this one' but the actual demotion
of !sym to the local scope was not implemented.

Now abi_match='!sym' properly moves symbol to a local scope.
2012-09-07 12:31:42 +02:00