#
# Copyright (c) 2014 Juniper Networks, Inc. All rights reserved.
#

# -*- mode: python; -*-

Import('AgentEnv')

env = AgentEnv.Clone()
env.CppEnableExceptions()

env.Append(CPPPATH = './')
env.Append(CCFLAGS = '-iquote build/include/openvswitch/include')
env.Append(CPPPATH = '#/build/include/openvswitch/lib')
env.Append(LIBPATH = '#/build/lib')
env.Append(LIBS = 'openvswitch')

SandeshGenFiles = env.SandeshGenCpp('ovsdb.sandesh')
SandeshGenSrcs = env.ExtractCpp(SandeshGenFiles)
sandesh_objs = AgentEnv.BuildExceptionCppObj(env, SandeshGenSrcs)

libovsdbclient = env.Library('ovsdbclient',
                             sandesh_objs +
                             [
                                 'ha_stale_dev_vn.cc',
                                 'ha_stale_l2_route.cc',
                                 'ha_stale_vn.cc',
                                 'logical_switch_ovsdb.cc',
                                 'multicast_mac_local_ovsdb.cc',
                                 'ovsdb_client.cc',
                                 'ovsdb_client_connection_state.cc',
                                 'ovsdb_client_idl.cc',
                                 'ovsdb_client_session.cc',
                                 'ovsdb_client_ssl.cc',
                                 'ovsdb_client_tcp.cc',
                                 'ovsdb_entry.cc',
                                 'ovsdb_object.cc',
                                 'ovsdb_resource_vxlan_id.cc',
                                 'ovsdb_route_data.cc',
                                 'ovsdb_route_peer.cc',
                                 'ovsdb_sandesh.cc',
                                 'ovsdb_wrapper.c',
                                 'physical_locator_ovsdb.cc',
                                 'physical_port_ovsdb.cc',
                                 'physical_switch_ovsdb.cc',
                                 'unicast_mac_local_ovsdb.cc',
                                 'unicast_mac_remote_ovsdb.cc',
                                 'vlan_port_binding_ovsdb.cc',
                                 'vm_interface_ksync.cc',
                                 'vn_ovsdb.cc',
                                 'vrf_ovsdb.cc'
                             ])
env.Requires(libovsdbclient, '#/build/include/openvswitch/include')

env.SConscript('test/SConscript', exports='AgentEnv', duplicate=0)
