#===============================================================================
#
# ERR Libs
#
# GENERAL DESCRIPTION
#    build script
#
# Copyright (c) 2009-2009 by QUALCOMM, Incorporated.
# All Rights Reserved.
# QUALCOMM Proprietary/GTDR
#
#-------------------------------------------------------------------------------
#
#  $Header: //source/qcom/qct/core/pkg/bootloaders/rel/1.2.2/boot_images/core/debugtools/err/build/SConscript#1 $
#  $DateTime: 2012/08/07 05:32:02 $
#  $Author: coresvc $
#  $Change: 2668414 $
#                      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/debugtools/err/src"

if not env.SubstPathExists(SRCPATH):
   # Legay Path
   SRCPATH = "${BUILD_ROOT}/services/err"

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

#-------------------------------------------------------------------------------
# External depends outside CoreBSP
#-------------------------------------------------------------------------------
env.RequireExternalApi([
   'BREW',
   'CS',
   'DSM',
   'MODEM_MDSP',
   'MODEM_PMIC',
   'MULTIMEDIA_DISPLAY',
   'MODEM_1X',
])

#-------------------------------------------------------------------------------
# Internal depends within CoreBSP
#-------------------------------------------------------------------------------
CBSP_API = [
   'BOOT',
   'DAL',
   'DEBUGTOOLS',
   'HAL',
   'HWENGINES',
   'IODEVICES',
   'MPROC',
   'POWER',
   'SERVICES',
   'STORAGE',
   'SYSTEMDRIVERS',
   'WIREDCONNECTIVITY',

   # needs to be last also contains wrong comdef.h
   'KERNEL',
]

env.RequirePublicApi(CBSP_API)
env.RequireRestrictedApi(CBSP_API)

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

ERR_SOURCES =  [
   '${BUILDPATH}/err.c',
   '${BUILDPATH}/err_nzi.c',
   '${BUILDPATH}/err_gpio.c',
   '${BUILDPATH}/err_nv_log.c',
   '${BUILDPATH}/err_exception_handler.c',
   '${BUILDPATH}/err_f3_trace.c',
   '${BUILDPATH}/errlog.c',
]

ERR_RESET_DETECT_SOURCES = [
   '${BUILDPATH}/err_reset_detect.c'
]

ERR_RESET_LOG_SOURCES = [
   '${BUILDPATH}/err_reset_log.c'
]

ERR_ARM_SOURCES = [
   '${BUILDPATH}/arm/err_q6_miniboot.s',
   '${BUILDPATH}/arm/err_jettison_core.s',
]

ERR_STUBS_SOURCES = [
   '${BUILDPATH}/err_stubs.c'
]

ERR_QDSP6_SOURCES = [
   '${BUILDPATH}/q6/err_jettison_core.s',
]

err_obj = env.Object(ERR_SOURCES)
err_lib = env.Library('${BUILDPATH}/err', err_obj)

err_reset_detect_objs = env.Object(ERR_RESET_DETECT_SOURCES)
err_reset_detect_lib = env.Library('${BUILDPATH}/err_reset_detect', err_reset_detect_objs)

err_reset_log_objs = env.Object(ERR_RESET_LOG_SOURCES)
err_reset_log_lib = env.Library('${BUILDPATH}/err_reset_log', err_reset_log_objs)

err_stubs_objs = env.Object(ERR_STUBS_SOURCES)
err_stubs_lib = env.Library('${BUILDPATH}/err_stubs', err_stubs_objs)

err_arm_obj = env.Object(ERR_ARM_SOURCES)
err_arm_lib = env.Library('${BUILDPATH}/err_arm', err_arm_obj)

err_qdsp6_obj = env.Object(ERR_QDSP6_SOURCES)
err_qdsp6_lib = env.Library('${BUILDPATH}/err_qdsp6', err_qdsp6_obj)

#-------------------------------------------------------------------------------
# Add Libraries to image
#-------------------------------------------------------------------------------

env.AddLibsToImage(
   ['SINGLE_IMAGE', 'CBSP_SINGLE_IMAGE', 'MODEM_IMAGE', 'CBSP_MODEM_IMAGE',
   'APPS_IMAGE', 'CBSP_APPS_IMAGE', 'QDSP6_SW_IMAGE', 'CBSP_QDSP6_SW_IMAGE'],
   [err_lib, err_reset_detect_lib])

env.AddLibsToImage([
   'OSBL_BOOT_IMAGE', 'SBL3_BOOT_IMAGE', 'APPSBL_BOOT_IMAGE', 'ERR_RESET_DETECT_BOOT_DRIVER'],
   [err_reset_detect_lib, err_reset_log_lib])  

if 'USES_SAHARA_BOOT' in env:
   env.AddLibsToImage(
      ['DBL_BOOT_IMAGE'],
      [err_reset_detect_lib, err_reset_log_lib])

env.AddLibsToImage([
   'DBL_BOOT_IMAGE','OSBL_BOOT_IMAGE','HOSTDL_IMAGE','EHOSTDL_IMAGE',
   'RPMSBL_BOOT_IMAGE','SPBL_BOOT_IMAGE','SSBL_BOOT_IMAGE','APPSBL_BOOT_IMAGE',
   'ERR_STUBS_BOOT_DRIVER'],
   [err_stubs_lib])   

if 'USES_QDSP6' in env:
   env.AddLibsToImage(
      ['SINGLE_IMAGE', 'CBSP_SINGLE_IMAGE', 'MODEM_IMAGE', 'CBSP_MODEM_IMAGE',
      'APPS_IMAGE', 'CBSP_APPS_IMAGE', 'QDSP6_SW_IMAGE', 'CBSP_QDSP6_SW_IMAGE'],
      err_qdsp6_lib)
else:
   if 'USES_L4' in env:
      env.AddLibsToImage(
         ['SINGLE_IMAGE', 'CBSP_SINGLE_IMAGE', 'MODEM_IMAGE', 'CBSP_MODEM_IMAGE',
         'APPS_IMAGE', 'CBSP_APPS_IMAGE'],
         err_arm_lib)



f72e25d8210cea38273d52a36449a1fdca411d28
<mask token>

Import('env')
<mask token>
if not env.SubstPathExists(SRCPATH):
    SRCPATH = '${BUILD_ROOT}/services/err'
env.VariantDir('${BUILDPATH}', SRCPATH, duplicate=0)
env.RequireExternalApi(['BREW', 'CS', 'DSM', 'MODEM_MDSP', 'MODEM_PMIC',
    'MULTIMEDIA_DISPLAY', 'MODEM_1X'])
<mask token>
env.RequirePublicApi(CBSP_API)
env.RequireRestrictedApi(CBSP_API)
<mask token>
env.AddLibsToImage(['SINGLE_IMAGE', 'CBSP_SINGLE_IMAGE', 'MODEM_IMAGE',
    'CBSP_MODEM_IMAGE', 'APPS_IMAGE', 'CBSP_APPS_IMAGE', 'QDSP6_SW_IMAGE',
    'CBSP_QDSP6_SW_IMAGE'], [err_lib, err_reset_detect_lib])
env.AddLibsToImage(['OSBL_BOOT_IMAGE', 'SBL3_BOOT_IMAGE',
    'APPSBL_BOOT_IMAGE', 'ERR_RESET_DETECT_BOOT_DRIVER'], [
    err_reset_detect_lib, err_reset_log_lib])
if 'USES_SAHARA_BOOT' in env:
    env.AddLibsToImage(['DBL_BOOT_IMAGE'], [err_reset_detect_lib,
        err_reset_log_lib])
env.AddLibsToImage(['DBL_BOOT_IMAGE', 'OSBL_BOOT_IMAGE', 'HOSTDL_IMAGE',
    'EHOSTDL_IMAGE', 'RPMSBL_BOOT_IMAGE', 'SPBL_BOOT_IMAGE',
    'SSBL_BOOT_IMAGE', 'APPSBL_BOOT_IMAGE', 'ERR_STUBS_BOOT_DRIVER'], [
    err_stubs_lib])
if 'USES_QDSP6' in env:
    env.AddLibsToImage(['SINGLE_IMAGE', 'CBSP_SINGLE_IMAGE', 'MODEM_IMAGE',
        'CBSP_MODEM_IMAGE', 'APPS_IMAGE', 'CBSP_APPS_IMAGE',
        'QDSP6_SW_IMAGE', 'CBSP_QDSP6_SW_IMAGE'], err_qdsp6_lib)
elif 'USES_L4' in env:
    env.AddLibsToImage(['SINGLE_IMAGE', 'CBSP_SINGLE_IMAGE', 'MODEM_IMAGE',
        'CBSP_MODEM_IMAGE', 'APPS_IMAGE', 'CBSP_APPS_IMAGE'], err_arm_lib)

Import('env')
env = env.Clone()
SRCPATH = '${BUILD_ROOT}/core/debugtools/err/src'
if not env.SubstPathExists(SRCPATH):
    SRCPATH = '${BUILD_ROOT}/services/err'
env.VariantDir('${BUILDPATH}', SRCPATH, duplicate=0)
env.RequireExternalApi(['BREW', 'CS', 'DSM', 'MODEM_MDSP', 'MODEM_PMIC',
    'MULTIMEDIA_DISPLAY', 'MODEM_1X'])
CBSP_API = ['BOOT', 'DAL', 'DEBUGTOOLS', 'HAL', 'HWENGINES', 'IODEVICES',
    'MPROC', 'POWER', 'SERVICES', 'STORAGE', 'SYSTEMDRIVERS',
    'WIREDCONNECTIVITY', 'KERNEL']
env.RequirePublicApi(CBSP_API)
env.RequireRestrictedApi(CBSP_API)
ERR_SOURCES = ['${BUILDPATH}/err.c', '${BUILDPATH}/err_nzi.c',
    '${BUILDPATH}/err_gpio.c', '${BUILDPATH}/err_nv_log.c',
    '${BUILDPATH}/err_exception_handler.c', '${BUILDPATH}/err_f3_trace.c',
    '${BUILDPATH}/errlog.c']
ERR_RESET_DETECT_SOURCES = ['${BUILDPATH}/err_reset_detect.c']
ERR_RESET_LOG_SOURCES = ['${BUILDPATH}/err_reset_log.c']
ERR_ARM_SOURCES = ['${BUILDPATH}/arm/err_q6_miniboot.s',
    '${BUILDPATH}/arm/err_jettison_core.s']
ERR_STUBS_SOURCES = ['${BUILDPATH}/err_stubs.c']
ERR_QDSP6_SOURCES = ['${BUILDPATH}/q6/err_jettison_core.s']
err_obj = env.Object(ERR_SOURCES)
err_lib = env.Library('${BUILDPATH}/err', err_obj)
err_reset_detect_objs = env.Object(ERR_RESET_DETECT_SOURCES)
err_reset_detect_lib = env.Library('${BUILDPATH}/err_reset_detect',
    err_reset_detect_objs)
err_reset_log_objs = env.Object(ERR_RESET_LOG_SOURCES)
err_reset_log_lib = env.Library('${BUILDPATH}/err_reset_log',
    err_reset_log_objs)
err_stubs_objs = env.Object(ERR_STUBS_SOURCES)
err_stubs_lib = env.Library('${BUILDPATH}/err_stubs', err_stubs_objs)
err_arm_obj = env.Object(ERR_ARM_SOURCES)
err_arm_lib = env.Library('${BUILDPATH}/err_arm', err_arm_obj)
err_qdsp6_obj = env.Object(ERR_QDSP6_SOURCES)
err_qdsp6_lib = env.Library('${BUILDPATH}/err_qdsp6', err_qdsp6_obj)
env.AddLibsToImage(['SINGLE_IMAGE', 'CBSP_SINGLE_IMAGE', 'MODEM_IMAGE',
    'CBSP_MODEM_IMAGE', 'APPS_IMAGE', 'CBSP_APPS_IMAGE', 'QDSP6_SW_IMAGE',
    'CBSP_QDSP6_SW_IMAGE'], [err_lib, err_reset_detect_lib])
env.AddLibsToImage(['OSBL_BOOT_IMAGE', 'SBL3_BOOT_IMAGE',
    'APPSBL_BOOT_IMAGE', 'ERR_RESET_DETECT_BOOT_DRIVER'], [
    err_reset_detect_lib, err_reset_log_lib])
if 'USES_SAHARA_BOOT' in env:
    env.AddLibsToImage(['DBL_BOOT_IMAGE'], [err_reset_detect_lib,
        err_reset_log_lib])
env.AddLibsToImage(['DBL_BOOT_IMAGE', 'OSBL_BOOT_IMAGE', 'HOSTDL_IMAGE',
    'EHOSTDL_IMAGE', 'RPMSBL_BOOT_IMAGE', 'SPBL_BOOT_IMAGE',
    'SSBL_BOOT_IMAGE', 'APPSBL_BOOT_IMAGE', 'ERR_STUBS_BOOT_DRIVER'], [
    err_stubs_lib])
if 'USES_QDSP6' in env:
    env.AddLibsToImage(['SINGLE_IMAGE', 'CBSP_SINGLE_IMAGE', 'MODEM_IMAGE',
        'CBSP_MODEM_IMAGE', 'APPS_IMAGE', 'CBSP_APPS_IMAGE',
        'QDSP6_SW_IMAGE', 'CBSP_QDSP6_SW_IMAGE'], err_qdsp6_lib)
elif 'USES_L4' in env:
    env.AddLibsToImage(['SINGLE_IMAGE', 'CBSP_SINGLE_IMAGE', 'MODEM_IMAGE',
        'CBSP_MODEM_IMAGE', 'APPS_IMAGE', 'CBSP_APPS_IMAGE'], err_arm_lib)

#===============================================================================
#
# ERR Libs
#
# GENERAL DESCRIPTION
#    build script
#
# Copyright (c) 2009-2009 by QUALCOMM, Incorporated.
# All Rights Reserved.
# QUALCOMM Proprietary/GTDR
#
#-------------------------------------------------------------------------------
#
#  $Header: //source/qcom/qct/core/pkg/bootloaders/rel/1.2.2/boot_images/core/debugtools/err/build/SConscript#1 $
#  $DateTime: 2012/08/07 05:32:02 $
#  $Author: coresvc $
#  $Change: 2668414 $
#                      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/debugtools/err/src"

if not env.SubstPathExists(SRCPATH):
   # Legay Path
   SRCPATH = "${BUILD_ROOT}/services/err"

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

#-------------------------------------------------------------------------------
# External depends outside CoreBSP
#-------------------------------------------------------------------------------
env.RequireExternalApi([
   'BREW',
   'CS',
   'DSM',
   'MODEM_MDSP',
   'MODEM_PMIC',
   'MULTIMEDIA_DISPLAY',
   'MODEM_1X',
])

#-------------------------------------------------------------------------------
# Internal depends within CoreBSP
#-------------------------------------------------------------------------------
CBSP_API = [
   'BOOT',
   'DAL',
   'DEBUGTOOLS',
   'HAL',
   'HWENGINES',
   'IODEVICES',
   'MPROC',
   'POWER',
   'SERVICES',
   'STORAGE',
   'SYSTEMDRIVERS',
   'WIREDCONNECTIVITY',

   # needs to be last also contains wrong comdef.h
   'KERNEL',
]

env.RequirePublicApi(CBSP_API)
env.RequireRestrictedApi(CBSP_API)

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

ERR_SOURCES =  [
   '${BUILDPATH}/err.c',
   '${BUILDPATH}/err_nzi.c',
   '${BUILDPATH}/err_gpio.c',
   '${BUILDPATH}/err_nv_log.c',
   '${BUILDPATH}/err_exception_handler.c',
   '${BUILDPATH}/err_f3_trace.c',
   '${BUILDPATH}/errlog.c',
]

ERR_RESET_DETECT_SOURCES = [
   '${BUILDPATH}/err_reset_detect.c'
]

ERR_RESET_LOG_SOURCES = [
   '${BUILDPATH}/err_reset_log.c'
]

ERR_ARM_SOURCES = [
   '${BUILDPATH}/arm/err_q6_miniboot.s',
   '${BUILDPATH}/arm/err_jettison_core.s',
]

ERR_STUBS_SOURCES = [
   '${BUILDPATH}/err_stubs.c'
]

ERR_QDSP6_SOURCES = [
   '${BUILDPATH}/q6/err_jettison_core.s',
]

err_obj = env.Object(ERR_SOURCES)
err_lib = env.Library('${BUILDPATH}/err', err_obj)

err_reset_detect_objs = env.Object(ERR_RESET_DETECT_SOURCES)
err_reset_detect_lib = env.Library('${BUILDPATH}/err_reset_detect', err_reset_detect_objs)

err_reset_log_objs = env.Object(ERR_RESET_LOG_SOURCES)
err_reset_log_lib = env.Library('${BUILDPATH}/err_reset_log', err_reset_log_objs)

err_stubs_objs = env.Object(ERR_STUBS_SOURCES)
err_stubs_lib = env.Library('${BUILDPATH}/err_stubs', err_stubs_objs)

err_arm_obj = env.Object(ERR_ARM_SOURCES)
err_arm_lib = env.Library('${BUILDPATH}/err_arm', err_arm_obj)

err_qdsp6_obj = env.Object(ERR_QDSP6_SOURCES)
err_qdsp6_lib = env.Library('${BUILDPATH}/err_qdsp6', err_qdsp6_obj)

#-------------------------------------------------------------------------------
# Add Libraries to image
#-------------------------------------------------------------------------------

env.AddLibsToImage(
   ['SINGLE_IMAGE', 'CBSP_SINGLE_IMAGE', 'MODEM_IMAGE', 'CBSP_MODEM_IMAGE',
   'APPS_IMAGE', 'CBSP_APPS_IMAGE', 'QDSP6_SW_IMAGE', 'CBSP_QDSP6_SW_IMAGE'],
   [err_lib, err_reset_detect_lib])

env.AddLibsToImage([
   'OSBL_BOOT_IMAGE', 'SBL3_BOOT_IMAGE', 'APPSBL_BOOT_IMAGE', 'ERR_RESET_DETECT_BOOT_DRIVER'],
   [err_reset_detect_lib, err_reset_log_lib])  

if 'USES_SAHARA_BOOT' in env:
   env.AddLibsToImage(
      ['DBL_BOOT_IMAGE'],
      [err_reset_detect_lib, err_reset_log_lib])

env.AddLibsToImage([
   'DBL_BOOT_IMAGE','OSBL_BOOT_IMAGE','HOSTDL_IMAGE','EHOSTDL_IMAGE',
   'RPMSBL_BOOT_IMAGE','SPBL_BOOT_IMAGE','SSBL_BOOT_IMAGE','APPSBL_BOOT_IMAGE',
   'ERR_STUBS_BOOT_DRIVER'],
   [err_stubs_lib])   

if 'USES_QDSP6' in env:
   env.AddLibsToImage(
      ['SINGLE_IMAGE', 'CBSP_SINGLE_IMAGE', 'MODEM_IMAGE', 'CBSP_MODEM_IMAGE',
      'APPS_IMAGE', 'CBSP_APPS_IMAGE', 'QDSP6_SW_IMAGE', 'CBSP_QDSP6_SW_IMAGE'],
      err_qdsp6_lib)
else:
   if 'USES_L4' in env:
      env.AddLibsToImage(
         ['SINGLE_IMAGE', 'CBSP_SINGLE_IMAGE', 'MODEM_IMAGE', 'CBSP_MODEM_IMAGE',
         'APPS_IMAGE', 'CBSP_APPS_IMAGE'],
         err_arm_lib)


