Skip to content

Commit

Permalink
waf: Factor checking for undefined symbol flags out into separate met…
Browse files Browse the repository at this point in the history
…hod.

Autobuild-User: Jelmer Vernooij <[email protected]>
Autobuild-Date: Sun Nov 13 19:38:38 CET 2011 on sn-devel-104
  • Loading branch information
jelmer committed Nov 13, 2011
1 parent af5c6fb commit 86afe83
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 9 deletions.
12 changes: 12 additions & 0 deletions buildtools/wafsamba/samba_autoconf.py
Original file line number Diff line number Diff line change
Expand Up @@ -712,3 +712,15 @@ def SETUP_CONFIGURE_CACHE(conf, enable):
preproc.recursion_limit = 1
# in either case we don't need to scan system includes
preproc.go_absolute = False


@conf
def SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS(conf):
# we don't want any libraries or modules to rely on runtime
# resolution of symbols
if sys.platform != "openbsd4":
conf.env.undefined_ldflags = conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)

if sys.platform != "openbsd4" and conf.env.undefined_ignore_ldflags == []:
if conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup']):
conf.env.undefined_ignore_ldflags = ['-undefined', 'dynamic_lookup']
2 changes: 2 additions & 0 deletions lib/ldb/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,8 @@ def configure(conf):

conf.SAMBA_CONFIG_H()

conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()

def build(bld):
bld.RECURSE('lib/tdb_compat')
bld.RECURSE('lib/tevent')
Expand Down
2 changes: 2 additions & 0 deletions lib/talloc/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,8 @@ def configure(conf):

conf.SAMBA_CONFIG_H()

conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()


def build(bld):
bld.RECURSE('lib/replace')
Expand Down
2 changes: 2 additions & 0 deletions lib/tdb/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ def configure(conf):

conf.SAMBA_CONFIG_H()

conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()

def build(bld):
bld.RECURSE('lib/replace')

Expand Down
2 changes: 2 additions & 0 deletions lib/tevent/wscript
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,8 @@ def configure(conf):

conf.SAMBA_CONFIG_H()

conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()

def build(bld):
bld.RECURSE('lib/replace')
bld.RECURSE('lib/talloc')
Expand Down
10 changes: 1 addition & 9 deletions wscript
Original file line number Diff line number Diff line change
Expand Up @@ -101,15 +101,7 @@ def configure(conf):
conf.RECURSE('selftest')
conf.RECURSE('source3')

# we don't want any libraries or modules to rely on runtime
# resolution of symbols
if sys.platform != "openbsd4":
conf.env.undefined_ldflags = conf.ADD_LDFLAGS('-Wl,-no-undefined', testflags=True)

if sys.platform != "openbsd4" and conf.env.undefined_ignore_ldflags == []:
if conf.CHECK_LDFLAGS(['-undefined', 'dynamic_lookup']):
conf.env.undefined_ignore_ldflags = ['-undefined', 'dynamic_lookup']

conf.SAMBA_CHECK_UNDEFINED_SYMBOL_FLAGS()

# gentoo always adds this. We want our normal build to be as
# strict as the strictest OS we support, so adding this here
Expand Down

0 comments on commit 86afe83

Please sign in to comment.