summaryrefslogtreecommitdiff
path: root/lib/popt/wscript
blob: ccdb2907032339af30d0259f8d11871dc39049fa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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_HEADERS('popt.h') and
            conf.CHECK_FUNCS_IN('poptGetContext', 'popt')):
            conf.DEFINE('HAVE_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')