s4-waf: cleanup use of LIBPOPT vs popt dependency
authorAndrew Tridgell <tridge@samba.org>
Sun, 28 Mar 2010 06:05:30 +0000 (17:05 +1100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 6 Apr 2010 10:27:13 +0000 (20:27 +1000)
popt/wscript

index 88eed81c9298e6d4f318c701c8ba11177675e963..425402ebe737120c99b46d740f43cff11d581657 100644 (file)
@@ -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__'
+                      )