summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2010-03-28 17:05:30 +1100
committerAndrew Tridgell <tridge@samba.org>2010-04-06 20:27:13 +1000
commitb9aa63887c005971b1b812893d6c1bbc50ea21b2 (patch)
treea5e73d210538ec5b12019170cff367dc144d3d16
parentbfbf43cc36ab360b34b49d7e07c2f594e2b7e7c9 (diff)
downloadsamba-b9aa63887c005971b1b812893d6c1bbc50ea21b2.tar.gz
samba-b9aa63887c005971b1b812893d6c1bbc50ea21b2.tar.bz2
samba-b9aa63887c005971b1b812893d6c1bbc50ea21b2.zip
s4-waf: cleanup use of LIBPOPT vs popt dependency
-rw-r--r--buildtools/wafsamba/samba_bundled.py14
-rw-r--r--lib/popt/wscript26
-rw-r--r--lib/replace/wscript3
-rw-r--r--libcli/nbt/wscript_build2
-rw-r--r--nsswitch/wscript_build2
-rw-r--r--source4/client/wscript_build4
-rw-r--r--source4/lib/cmdline/wscript_build6
-rw-r--r--source4/lib/ldb/wscript3
-rw-r--r--source4/lib/registry/wscript_build8
-rw-r--r--source4/lib/wmi/wscript_build4
-rw-r--r--source4/librpc/wscript_build2
-rw-r--r--source4/smbd/wscript_build2
-rw-r--r--source4/torture/wscript_build8
-rw-r--r--source4/utils/net/wscript_build2
-rw-r--r--source4/utils/wscript_build4
-rw-r--r--source4/wscript1
16 files changed, 49 insertions, 42 deletions
diff --git a/buildtools/wafsamba/samba_bundled.py b/buildtools/wafsamba/samba_bundled.py
index 2a6d75f7c9..6e3753a790 100644
--- a/buildtools/wafsamba/samba_bundled.py
+++ b/buildtools/wafsamba/samba_bundled.py
@@ -42,15 +42,27 @@ def BUNDLED_EXTENSION_DEFAULT(opt, extension, noextenion=''):
Options.Handler.BUNDLED_EXTENSION_DEFAULT = BUNDLED_EXTENSION_DEFAULT
+@runonce
@conf
-def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0'):
+def CHECK_BUNDLED_SYSTEM(conf, libname, minversion='0.0.0',
+ checkfunctions=None, headers=None):
if 'ALL' in conf.env.BUNDLED_LIBS or libname in conf.env.BUNDLED_LIBS:
return False
+ found = 'FOUND_SYSTEMLIB_%s' % libname
+ if found in conf.env:
+ return conf.env[found]
+ # try pkgconfig first
if conf.check_cfg(package=libname,
args='"%s >= %s" --cflags --libs' % (libname, minversion),
msg='Checking for system %s >= %s' % (libname, minversion)):
conf.SET_TARGET_TYPE(libname, 'SYSLIB')
+ conf.env[found] = True
return True
+ if checkfunctions is not None:
+ if conf.CHECK_FUNCS_IN(checkfunctions, libname, headers=headers):
+ conf.env[found] = True
+ return True
+ conf.env[found] = False
if 'NONE' in conf.env.BUNDLED_LIBS or '!'+libname in conf.env.BUNDLED_LIBS:
print('ERROR: System library %s of version %s not found, and bundling disabled' % (libname, minversion))
sys.exit(1)
diff --git a/lib/popt/wscript b/lib/popt/wscript
index 88eed81c92..425402ebe7 100644
--- a/lib/popt/wscript
+++ b/lib/popt/wscript
@@ -2,23 +2,17 @@
import Options
-def set_options(opt):
- opt.add_option('--with-included-popt',
- help=("use bundled popt library, not from system"),
- action="store_true", dest='INCLUDED_POPT', default=False)
-
def configure(conf):
conf.CHECK_HEADERS('float.h')
- if not Options.options.INCLUDED_POPT:
- if conf.CHECK_FUNCS_IN('poptGetContext', 'popt', headers='popt.h'):
- conf.DEFINE('HAVE_SYSTEM_POPT', 1)
+
+ if conf.CHECK_BUNDLED_SYSTEM('popt', checkfunctions='poptGetContext', headers='popt.h'):
+ conf.define('USING_SYSTEM_POPT', 1)
def build(bld):
- if not bld.CONFIG_SET('HAVE_SYSTEM_POPT'):
- bld.SAMBA_SUBSYSTEM('LIBPOPT',
- source='findme.c popt.c poptconfig.c popthelp.c poptparse.c',
- cflags='-DDBL_EPSILON=__DBL_EPSILON__'
- )
- bld.TARGET_ALIAS('LIBPOPT', 'popt')
- else:
- bld.TARGET_ALIAS('popt', 'LIBPOPT')
+ if bld.CONFIG_SET('USING_SYSTEM_POPT'):
+ return
+
+ bld.SAMBA_LIBRARY('popt',
+ source='findme.c popt.c poptconfig.c popthelp.c poptparse.c',
+ cflags='-DDBL_EPSILON=__DBL_EPSILON__'
+ )
diff --git a/lib/replace/wscript b/lib/replace/wscript
index d5f2b0dce9..134cb76f49 100644
--- a/lib/replace/wscript
+++ b/lib/replace/wscript
@@ -40,7 +40,7 @@ def configure(conf):
conf.CHECK_HEADERS('windows.h winsock2.h ws2tcpip.h')
conf.CHECK_HEADERS('libintl.h errno.h')
conf.CHECK_HEADERS('gcrypt.h getopt.h iconv.h')
- conf.CHECK_HEADERS('sys/inotify.h memory.h nss.h popt.h sasl/sasl.h')
+ conf.CHECK_HEADERS('sys/inotify.h memory.h nss.h sasl/sasl.h')
conf.CHECK_HEADERS('security/pam_appl.h sys/inotify.h zlib.h asm/unistd.h')
conf.CHECK_HEADERS('aio.h sys/unistd.h rpc/rpc.h rpc/nettype.h alloca.h float.h')
@@ -127,7 +127,6 @@ def configure(conf):
conf.CHECK_FUNCS_IN('dlopen dlsym dlerror dlclose', 'dl',
checklibc=True, headers='dlfcn.h dl.h')
- conf.CHECK_FUNCS_IN('poptGetContext', 'popt')
conf.CHECK_FUNCS_IN('fdatasync', 'rt', checklibc=True)
diff --git a/libcli/nbt/wscript_build b/libcli/nbt/wscript_build
index 7da0706d95..6d31ba6214 100644
--- a/libcli/nbt/wscript_build
+++ b/libcli/nbt/wscript_build
@@ -20,7 +20,7 @@ bld.SAMBA_BINARY('nmblookup',
source='tools/nmblookup.c',
manpages='man/nmblookup.1',
installdir='BINDIR',
- deps='LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL LIBCLI_NBT LIBPOPT POPT_SAMBA LIBNETIF LIBCLI_RESOLVE'
+ deps='LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL LIBCLI_NBT popt POPT_SAMBA LIBNETIF LIBCLI_RESOLVE'
)
diff --git a/nsswitch/wscript_build b/nsswitch/wscript_build
index 760b86e01c..dd40cc1857 100644
--- a/nsswitch/wscript_build
+++ b/nsswitch/wscript_build
@@ -20,6 +20,6 @@ bld.SAMBA_BINARY('nsstest',
bld.SAMBA_BINARY('wbinfo',
source='wbinfo.c',
installdir='BINDIR',
- deps='LIBSAMBA-UTIL LIBREPLACE_EXT LIBCLI_AUTH LIBPOPT POPT_SAMBA LIBWINBIND-CLIENT LIBWBCLIENT tevent UTIL_TEVENT LIBASYNC_REQ UID_WRAPPER'
+ deps='LIBSAMBA-UTIL LIBREPLACE_EXT LIBCLI_AUTH popt POPT_SAMBA LIBWINBIND-CLIENT LIBWBCLIENT tevent UTIL_TEVENT LIBASYNC_REQ UID_WRAPPER'
)
diff --git a/source4/client/wscript_build b/source4/client/wscript_build
index ac409619f1..08dc90c961 100644
--- a/source4/client/wscript_build
+++ b/source4/client/wscript_build
@@ -3,13 +3,13 @@
bld.SAMBA_BINARY('smbclient',
source='client.c',
installdir='BINDIR',
- deps='LIBSAMBA-HOSTCONFIG SMBREADLINE LIBSAMBA-UTIL LIBCLI_SMB RPC_NDR_SRVSVC LIBCLI_LSA LIBPOPT POPT_SAMBA POPT_CREDENTIALS LIBCLI_RAW'
+ deps='LIBSAMBA-HOSTCONFIG SMBREADLINE LIBSAMBA-UTIL LIBCLI_SMB RPC_NDR_SRVSVC LIBCLI_LSA popt POPT_SAMBA POPT_CREDENTIALS LIBCLI_RAW'
)
bld.SAMBA_BINARY('cifsdd',
source='cifsdd.c cifsddio.c',
installdir='BINDIR',
- deps='LIBSAMBA-HOSTCONFIG LIBCLI_SMB LIBPOPT POPT_SAMBA POPT_CREDENTIALS'
+ deps='LIBSAMBA-HOSTCONFIG LIBCLI_SMB popt POPT_SAMBA POPT_CREDENTIALS'
)
diff --git a/source4/lib/cmdline/wscript_build b/source4/lib/cmdline/wscript_build
index 4494c7d2eb..0229089167 100644
--- a/source4/lib/cmdline/wscript_build
+++ b/source4/lib/cmdline/wscript_build
@@ -3,12 +3,12 @@
bld.SAMBA_SUBSYSTEM('LIBCMDLINE_CREDENTIALS',
source='credentials.c',
autoproto='credentials.h',
- public_deps='CREDENTIALS LIBPOPT'
+ public_deps='CREDENTIALS popt'
)
bld.SAMBA_SUBSYSTEM('POPT_SAMBA',
source='popt_common.c',
- public_deps='LIBPOPT',
+ public_deps='popt',
public_headers='popt_common.h:popt.h',
header_path='samba',
deps='talloc'
@@ -18,7 +18,7 @@ bld.SAMBA_SUBSYSTEM('POPT_SAMBA',
bld.SAMBA_SUBSYSTEM('POPT_CREDENTIALS',
source='popt_credentials.c',
autoproto='popt_credentials.h',
- public_deps='CREDENTIALS LIBCMDLINE_CREDENTIALS LIBPOPT',
+ public_deps='CREDENTIALS LIBCMDLINE_CREDENTIALS popt',
deps='LIBSAMBA-UTIL'
)
diff --git a/source4/lib/ldb/wscript b/source4/lib/ldb/wscript
index 97e345b834..e0269d7607 100644
--- a/source4/lib/ldb/wscript
+++ b/source4/lib/ldb/wscript
@@ -11,6 +11,7 @@ import wafsamba
LIBTDB_DIR= srcdir + '/lib/tdb'
LIBTEVENT_DIR= srcdir + '/lib/tevent'
+LIBPOPT_DIR= srcdir + '/lib/popt'
def set_options(opt):
opt.BUILTIN_DEFAULT('replace')
@@ -21,6 +22,7 @@ def set_options(opt):
def configure(conf):
conf.sub_config(LIBTDB_DIR)
conf.sub_config(LIBTEVENT_DIR)
+ conf.sub_config(LIBPOPT_DIR)
# where does the default LIBDIR end up? in conf.env somewhere?
#
conf.CONFIG_PATH('LDB_MODULESDIR', conf.SUBST_ENV_VAR('MODULESDIR') + '/ldb')
@@ -39,6 +41,7 @@ def configure(conf):
def build(bld):
bld.BUILD_SUBDIR(LIBTDB_DIR)
bld.BUILD_SUBDIR(LIBTEVENT_DIR)
+ bld.BUILD_SUBDIR(LIBPOPT_DIR)
# in Samba4 we build some extra modules, and add extra
# capabilities to the ldb cmdline tools
diff --git a/source4/lib/registry/wscript_build b/source4/lib/registry/wscript_build
index 16276674f6..66f2aa86d5 100644
--- a/source4/lib/registry/wscript_build
+++ b/source4/lib/registry/wscript_build
@@ -30,7 +30,7 @@ bld.SAMBA_BINARY('regdiff',
source='tools/regdiff.c',
manpages='man/regdiff.1',
installdir='BINDIR',
- deps='LIBSAMBA-HOSTCONFIG registry LIBPOPT POPT_SAMBA POPT_CREDENTIALS'
+ deps='LIBSAMBA-HOSTCONFIG registry popt POPT_SAMBA POPT_CREDENTIALS'
)
@@ -38,7 +38,7 @@ bld.SAMBA_BINARY('regpatch',
source='tools/regpatch.c',
manpages='man/regpatch.1',
installdir='BINDIR',
- deps='LIBSAMBA-HOSTCONFIG registry LIBPOPT POPT_SAMBA POPT_CREDENTIALS registry_common'
+ deps='LIBSAMBA-HOSTCONFIG registry popt POPT_SAMBA POPT_CREDENTIALS registry_common'
)
@@ -46,7 +46,7 @@ bld.SAMBA_BINARY('regshell',
source='tools/regshell.c',
manpages='man/regshell.1',
installdir='BINDIR',
- deps='LIBSAMBA-HOSTCONFIG LIBPOPT registry POPT_SAMBA POPT_CREDENTIALS SMBREADLINE registry_common'
+ deps='LIBSAMBA-HOSTCONFIG popt registry POPT_SAMBA POPT_CREDENTIALS SMBREADLINE registry_common'
)
@@ -54,7 +54,7 @@ bld.SAMBA_BINARY('regtree',
source='tools/regtree.c',
manpages='man/regtree.1',
installdir='BINDIR',
- deps='LIBSAMBA-HOSTCONFIG LIBPOPT registry POPT_SAMBA POPT_CREDENTIALS registry_common'
+ deps='LIBSAMBA-HOSTCONFIG popt registry POPT_SAMBA POPT_CREDENTIALS registry_common'
)
diff --git a/source4/lib/wmi/wscript_build b/source4/lib/wmi/wscript_build
index 04ef860d67..fd8c17a667 100644
--- a/source4/lib/wmi/wscript_build
+++ b/source4/lib/wmi/wscript_build
@@ -13,14 +13,14 @@ bld.SAMBA_SUBSYSTEM('WMI',
bld.SAMBA_BINARY('wmic',
source='tools/wmic.c',
installdir='BINDIR',
- deps='POPT_SAMBA POPT_CREDENTIALS LIBPOPT WMI'
+ deps='POPT_SAMBA POPT_CREDENTIALS popt WMI'
)
bld.SAMBA_BINARY('wmis',
source='tools/wmis.c',
installdir='BINDIR',
- deps='POPT_SAMBA POPT_CREDENTIALS LIBPOPT WMI'
+ deps='POPT_SAMBA POPT_CREDENTIALS popt WMI'
)
diff --git a/source4/librpc/wscript_build b/source4/librpc/wscript_build
index 5328d1da2c..538d9636c3 100644
--- a/source4/librpc/wscript_build
+++ b/source4/librpc/wscript_build
@@ -18,7 +18,7 @@ bld.SAMBA_BINARY('ndrdump',
source='../../librpc/tools/ndrdump.c',
manpages='../../librpc/tools/ndrdump.1',
installdir='BINDIR',
- deps='LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL LIBPOPT POPT_SAMBA NDR_TABLE LIBSAMBA-ERRORS'
+ deps='LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL popt POPT_SAMBA NDR_TABLE LIBSAMBA-ERRORS'
)
diff --git a/source4/smbd/wscript_build b/source4/smbd/wscript_build
index da49ddb8a4..6c7a6dee03 100644
--- a/source4/smbd/wscript_build
+++ b/source4/smbd/wscript_build
@@ -23,7 +23,7 @@ bld.SAMBA_BINARY('samba',
installdir='SBINDIR',
subsystem_name='service',
deps='''LIBEVENTS process_model service LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL POPT_SAMBA PIDFILE
- LIBPOPT gensec registry ntptr ntvfs share CLUSTER DCESRV''',
+ popt gensec registry ntptr ntvfs share CLUSTER DCESRV''',
needs_python=True,
install_path='${SBINDIR}'
)
diff --git a/source4/torture/wscript_build b/source4/torture/wscript_build
index aee3ff4179..abed55bf7b 100644
--- a/source4/torture/wscript_build
+++ b/source4/torture/wscript_build
@@ -139,7 +139,7 @@ bld.SAMBA_BINARY('smbtorture',
manpages='man/smbtorture.1',
public_headers='smbtorture.h',
installdir='BINDIR',
- deps='torture LIBPOPT POPT_SAMBA POPT_CREDENTIALS dcerpc LIBCLI_SMB SMBREADLINE ' + TORTURE_MODULES,
+ deps='torture popt POPT_SAMBA POPT_CREDENTIALS dcerpc LIBCLI_SMB SMBREADLINE ' + TORTURE_MODULES,
needs_python=True
)
@@ -148,7 +148,7 @@ bld.SAMBA_BINARY('gentest',
source='gentest.c',
manpages='man/gentest.1',
installdir='BINDIR',
- deps='LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL LIBPOPT POPT_SAMBA POPT_CREDENTIALS LIBCLI_SMB LIBCLI_RAW'
+ deps='LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL popt POPT_SAMBA POPT_CREDENTIALS LIBCLI_SMB LIBCLI_RAW'
)
@@ -156,7 +156,7 @@ bld.SAMBA_BINARY('masktest',
source='masktest.c',
manpages='man/masktest.1',
installdir='BINDIR',
- deps='LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL LIBPOPT POPT_SAMBA POPT_CREDENTIALS LIBCLI_SMB'
+ deps='LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL popt POPT_SAMBA POPT_CREDENTIALS LIBCLI_SMB'
)
@@ -167,7 +167,7 @@ bld.SAMBA_BINARY('locktest',
#cflags='--coverage',
# GCOV='1',
manpages='man/locktest.1',
- deps='LIBPOPT POPT_SAMBA POPT_CREDENTIALS LIBSAMBA-UTIL LIBCLI_SMB LIBSAMBA-HOSTCONFIG',
+ deps='popt POPT_SAMBA POPT_CREDENTIALS LIBSAMBA-UTIL LIBCLI_SMB LIBSAMBA-HOSTCONFIG',
installdir='BINDIR'
)
diff --git a/source4/utils/net/wscript_build b/source4/utils/net/wscript_build
index 9845be44cc..7c7e6ad4cb 100644
--- a/source4/utils/net/wscript_build
+++ b/source4/utils/net/wscript_build
@@ -13,7 +13,7 @@ bld.SAMBA_BINARY('net',
source='net.c net_machinepw.c net_password.c net_time.c net_join.c net_vampire.c net_user.c net_export_keytab.c',
autoproto='net_proto.h',
installdir='BINDIR',
- deps='LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL LIBSAMBA-NET LIBPOPT POPT_SAMBA POPT_CREDENTIALS net_drs',
+ deps='LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL LIBSAMBA-NET popt POPT_SAMBA POPT_CREDENTIALS net_drs',
needs_python=True
)
diff --git a/source4/utils/wscript_build b/source4/utils/wscript_build
index 6e43425e98..9b44c85333 100644
--- a/source4/utils/wscript_build
+++ b/source4/utils/wscript_build
@@ -8,7 +8,7 @@ bld.SAMBA_BINARY('ntlm_auth',
source='ntlm_auth.c',
manpages='man/ntlm_auth.1',
installdir='BINDIR',
- deps='LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL LIBPOPT POPT_SAMBA POPT_CREDENTIALS gensec LIBCLI_RESOLVE auth ntlm_check MESSAGING LIBEVENTS service',
+ deps='LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL popt POPT_SAMBA POPT_CREDENTIALS gensec LIBCLI_RESOLVE auth ntlm_check MESSAGING LIBEVENTS service',
needs_python=True
)
@@ -23,7 +23,7 @@ bld.SAMBA_BINARY('setnttoken',
bld.SAMBA_BINARY('testparm',
source='testparm.c',
installdir='BINDIR',
- deps='LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL LIBPOPT samba_socket POPT_SAMBA LIBCLI_RESOLVE CHARSET'
+ deps='LIBSAMBA-HOSTCONFIG LIBSAMBA-UTIL popt samba_socket POPT_SAMBA LIBCLI_RESOLVE CHARSET'
)
diff --git a/source4/wscript b/source4/wscript
index d8361398f4..c191dd1b0d 100644
--- a/source4/wscript
+++ b/source4/wscript
@@ -19,7 +19,6 @@ def set_options(opt):
opt.recurse('../lib/nss_wrapper')
opt.recurse('../lib/socket_wrapper')
opt.recurse('../lib/uid_wrapper')
- opt.recurse('../lib/popt')
opt.recurse('../pidl')
def configure(conf):