# Copyright AllSeen Alliance. All rights reserved.
#
#    Permission to use, copy, modify, and/or distribute this software for any
#    purpose with or without fee is hereby granted, provided that the above
#    copyright notice and this permission notice appear in all copies.
#
#    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
#    WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
#    MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
#    ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
#    WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
#    ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
#    OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

Import('services_common_env')
 
if not services_common_env.has_key('_ALLJOYNCORE_'):
    services_common_env.Append(LIBS = ['alljoyn'])
    if services_common_env['OS'] == 'openwrt':
        services_common_env.AppendUnique(LIBS = [ 'stdc++', 'pthread' ])

services_common_env['SC_DISTDIR'] = services_common_env['DISTDIR'] + '/services_common'

services_common_env.Install('$SC_DISTDIR/inc/alljoyn/services_common', services_common_env.Glob('inc/alljoyn/services_common/*.h'))
services_common_env.Install('$SC_DISTDIR/lib', services_common_env.SConscript('src/SConscript', exports = ['services_common_env']))

# Build docs
installDocs = services_common_env.SConscript('docs/SConscript', exports = ['services_common_env'])
services_common_env.Depends(installDocs, services_common_env.Glob('$SC_DISTDIR/inc/alljoyn/services_common/*.h'));
