#===============================================================================
#
# OEM RAPI Libs
#
# GENERAL DESCRIPTION
#    build script
#
# Copyright (c) 2009-2009 by QUALCOMM, Incorporated.
# All Rights Reserved.
# QUALCOMM Proprietary/GTDR
#
#-------------------------------------------------------------------------------
#
#  $Header: //source/qcom/qct/core/api/rapi/mproc/rel/2h09/build/oem_rapi/SConscript#1 $
#  $DateTime: 2010/09/16 11:00:56 $
#  $Author: aeprasad $
#  $Change: 1442412 $
#                      EDIT HISTORY FOR FILE
#
#  This section contains comments describing changes made to the module.
#  Notice that changes are listed in reverse chronological order.
#
# when       who     what, where, why
# --------   ---     ---------------------------------------------------------
#
#===============================================================================
Import('env')
env = env.Clone()

#-------------------------------------------------------------------------------
# Source PATH
#-------------------------------------------------------------------------------
SRCPATH = "${BUILD_ROOT}/core/api/rapi/mproc/src"

env.VariantDir('${BUILDPATH}', SRCPATH, duplicate=0)

#-------------------------------------------------------------------------------
# External depends within CoreBSP
#-------------------------------------------------------------------------------
env.RequireExternalApi([
   'DSM',
   'MODEM_DATA',
   'MODEM_HDR',
])

#-------------------------------------------------------------------------------
# Internal depends within CoreBSP
#-------------------------------------------------------------------------------
CBSP_API = [
   'DEBUGTOOLS',
   'DAL',
   'MPROC',
   'SERVICES',
   'SYSTEMDRIVERS',
   'KERNEL',
   # needs to be last also contains wrong comdef.h
]

env.RequirePublicApi(CBSP_API)
env.RequireRestrictedApi(CBSP_API)
env.RequireRestrictedApi(['MPROC_RAPI'])

#-------------------------------------------------------------------------------
# Sources, libraries
#-------------------------------------------------------------------------------


OEM_RAPI_CLIENT_SOURCES = [
   '${BUILDPATH}/oem_rapi_clnt.c',
   '${BUILDPATH}/oem_rapi_xdr.c'
]

OEM_RAPI_SERVER_SOURCES = [
   '${BUILDPATH}/oem_rapi_svc.c',
   '${BUILDPATH}/oem_rapi_xdr.c'
]

oem_rapi_client_obj = env.Object(OEM_RAPI_CLIENT_SOURCES)
oem_rapi_client_lib = env.Library('${BUILDPATH}/oem_rapi_client', oem_rapi_client_obj)

oem_rapi_server_obj = env.Object(OEM_RAPI_SERVER_SOURCES)
oem_rapi_server_lib = env.Library('${BUILDPATH}/oem_rapi_server', oem_rapi_server_obj)

OEM_RAPI_FUSION_CLIENT_SOURCES = [
   '${BUILDPATH}/oem_rapi_fusion_clnt.c',
   '${BUILDPATH}/oem_rapi_fusion_xdr.c'
]

OEM_RAPI_FUSION_SERVER_SOURCES = [
   '${BUILDPATH}/oem_rapi_fusion_svc.c',
   '${BUILDPATH}/oem_rapi_fusion_xdr.c'
]

oem_rapi_fusion_client_obj = env.Object(OEM_RAPI_FUSION_CLIENT_SOURCES)
oem_rapi_fusion_client_lib = env.Library('${BUILDPATH}/oem_rapi_fusion_client', oem_rapi_fusion_client_obj)

oem_rapi_fusion_server_obj = env.Object(OEM_RAPI_FUSION_SERVER_SOURCES)
oem_rapi_fusion_server_lib = env.Library('${BUILDPATH}/oem_rapi_fusion_server', oem_rapi_fusion_server_obj)

#-------------------------------------------------------------------------------
# Add Libraries to image
#-------------------------------------------------------------------------------
if env.has_key('USES_MDM_MSM_FUSION'):
  env.AddLibsToImage(['MODEM_IMAGE', 'CBSP_MODEM_IMAGE'], [oem_rapi_server_lib, oem_rapi_fusion_client_lib])
else:
  env.AddLibsToImage(['MODEM_IMAGE', 'CBSP_MODEM_IMAGE'], oem_rapi_server_lib)

env.AddLibsToImage(['APPS_IMAGE', 'CBSP_APPS_IMAGE'], oem_rapi_client_lib)
