#!/usr/bin/env python

from waflib import Options

def configure(conf):
    conf.RECURSE('cmocka')
    conf.RECURSE('popt')
    if conf.CONFIG_GET('ENABLE_SELFTEST'):
        conf.RECURSE('socket_wrapper')
        conf.RECURSE('nss_wrapper')
        conf.RECURSE('resolv_wrapper')
        conf.RECURSE('uid_wrapper')
        if Options.options.with_pam:
            conf.RECURSE('pam_wrapper')


def build(bld):
    bld.RECURSE('cmocka')
    bld.RECURSE('popt')
    if bld.CONFIG_GET('SOCKET_WRAPPER'):
        bld.RECURSE('socket_wrapper')
    if bld.CONFIG_GET('NSS_WRAPPER'):
        bld.RECURSE('nss_wrapper')
    if bld.CONFIG_GET('RESOLV_WRAPPER'):
        bld.RECURSE('resolv_wrapper')
    if bld.CONFIG_GET('UID_WRAPPER'):
        bld.RECURSE('uid_wrapper')
    if bld.CONFIG_GET('PAM_WRAPPER'):
        bld.RECURSE('pam_wrapper')
