# -*- mode: python -*-

Import("env")

env.StaticLibrary('serverauth', ['mongo_authentication_session.cpp'])

env.Command(['action_type.h', 'action_type.cpp'], ['generate_action_types.py', 'action_types.txt'],
            '$PYTHON $SOURCES $TARGETS')

# Just the data structures used
env.StaticLibrary('authcore', ['action_set.cpp',
                               'action_type.cpp',
                               'auth_external_state.cpp',
                               'authorization_manager.cpp',
                               'principal.cpp',
                               'principal_set.cpp',
                               'privilege.cpp',
                               'privilege_set.cpp'],
                  LIBDEPS=['$BUILD_DIR/mongo/base/base',
                           '$BUILD_DIR/mongo/bson',
                           '$BUILD_DIR/mongo/stringutils'])

env.StaticLibrary('authservercommon',
                  ['auth_external_state_server_common.cpp',
                   'auth_server_parameters.cpp',
                   'security_key.cpp'],
                  LIBDEPS=['authcore'])

env.StaticLibrary('authmongod',
                  ['auth_external_state_d.cpp',
                   'auth_index_d.cpp'],
                  LIBDEPS=['authservercommon'])

env.StaticLibrary('authmongos',
                  ['auth_external_state_s.cpp'],
                  LIBDEPS=['authservercommon'])

env.CppUnitTest('action_set_test', 'action_set_test.cpp', LIBDEPS=['authcore'])
env.CppUnitTest('principal_set_test', 'principal_set_test.cpp', LIBDEPS=['authcore'])
env.CppUnitTest('privilege_set_test', 'privilege_set_test.cpp', LIBDEPS=['authcore'])
env.CppUnitTest('authorization_manager_test', 'authorization_manager_test.cpp',
                LIBDEPS=['authcore'])
