Commit 2a93484f authored by Robert Schmidt's avatar Robert Schmidt

Generate and build S1AP ASN.1 during build time

parent cf6ff96b
......@@ -413,35 +413,11 @@ add_dependencies(NR_RRC_LIB nr_rrc_flag)
include_directories ("${NR_RRC_FULL_DIR}")
# S1AP
# Same limitation as described in RRC: unknown generated file list
# so we generate it at cmake time
##############
set (S1AP_RELEASE R15)
set(S1AP_DIR ${OPENAIR3_DIR}/S1AP)
make_version(S1AP_VERSION 15 6 0)
set(S1AP_ASN_FILES "s1ap-15.6.0.asn1")
add_definitions(-DS1AP_VERSION=${S1AP_VERSION})
set(S1AP_ASN_DIR ${S1AP_DIR}/MESSAGES/ASN1/${S1AP_RELEASE})
set(S1AP_C_DIR ${asn1_generated_dir}/S1AP_${S1AP_RELEASE})
# Warning: if you modify ASN.1 source file to generate new C files, cmake should be re-run instead of make
set(s1ap_cmd ${OPENAIR_CMAKE}/tools/make_asn1c_includes.sh "S1AP_" -fno-include-deps "${S1AP_C_DIR}")
compile_asn1("${S1AP_ASN_DIR}/${S1AP_ASN_FILES}" "${s1ap_cmd}" s1ap_flag)
file(GLOB S1AP_source ${S1AP_C_DIR}/*.c)
add_library(S1AP_LIB
${S1AP_source}
${S1AP_DIR}/s1ap_common.c
)
add_dependencies(S1AP_LIB rrc_flag s1ap_flag)
include_directories ("${S1AP_C_DIR}")
include_directories ("${S1AP_DIR}")
add_library(S1AP_ENB
add_library(s1ap
${S1AP_DIR}/s1ap_common.c
${S1AP_DIR}/s1ap_eNB.c
${S1AP_DIR}/s1ap_eNB_context_management_procedures.c
${S1AP_DIR}/s1ap_eNB_decoder.c
......@@ -455,8 +431,8 @@ add_library(S1AP_ENB
${S1AP_DIR}/s1ap_eNB_trace.c
${S1AP_DIR}/s1ap_eNB_ue_context.c
)
add_dependencies(S1AP_ENB rrc_flag s1ap_flag)
add_dependencies(s1ap rrc_flag)
target_link_libraries(s1ap PUBLIC asn1_s1ap)
# NGAP
# Same limitation as described in RRC: unknown generated file list
......@@ -1846,8 +1822,8 @@ add_library(L2
${ENB_APP_SRC}
${MCE_APP_SRC}
)
add_dependencies(L2 rrc_flag s1ap_flag m2_flag m3_flag)
target_link_libraries(L2 PRIVATE f1ap x2ap)
add_dependencies(L2 rrc_flag m2_flag m3_flag)
target_link_libraries(L2 PRIVATE f1ap x2ap s1ap)
add_library(MAC_NR
${MAC_NR_SRC}
......@@ -1867,8 +1843,8 @@ add_library(L2_NR
${GNB_APP_SRC}
)
add_dependencies(L2_NR rrc_flag nr_rrc_flag s1ap_flag)
target_link_libraries(L2_NR PRIVATE f1ap x2ap)
#add_dependencies(L2_NR rrc_flag nr_rrc_flag s1ap_flag)
target_link_libraries(L2_NR PRIVATE f1ap x2ap s1ap)
add_library(L2_LTE_NR
${L2_RRC_SRC}
......@@ -1877,7 +1853,7 @@ add_library(L2_LTE_NR
${MCE_APP_SRC}
)
target_link_libraries(L2_LTE_NR PRIVATE f1ap)
target_link_libraries(L2_LTE_NR PRIVATE f1ap s1ap)
add_library(L2_UE
${L2_SRC_UE}
......@@ -1893,7 +1869,7 @@ if (NOT ${NOS1})
target_compile_definitions(L2_UE PUBLIC -DPDCP_USE_NETLINK)
endif()
add_dependencies(L2_UE rrc_flag s1ap_flag)
add_dependencies(L2_UE rrc_flag)
add_library( NR_L2_UE ${NR_L2_SRC_UE} ${MAC_NR_SRC_UE} )
target_link_libraries(NR_L2_UE PRIVATE f1ap)
......@@ -1924,7 +1900,7 @@ set (MME_APP_SRC
${OPENAIR3_DIR}/MME_APP/mme_config.c
)
add_library(MME_APP ${MME_APP_SRC})
add_dependencies(MME_APP rrc_flag s1ap_flag m2_flag m3_flag)
add_dependencies(MME_APP rrc_flag m2_flag m3_flag)
set(SCTP_SRC
${OPENAIR3_DIR}/SCTP/sctp_common.c
......@@ -2443,11 +2419,11 @@ add_executable(lte-softmodem
${T_SOURCE}
${SHLIB_LOADER_SOURCES}
)
add_dependencies(lte-softmodem rrc_flag s1ap_flag oai_iqplayer)
add_dependencies(lte-softmodem rrc_flag oai_iqplayer)
target_link_libraries (lte-softmodem
-Wl,--start-group
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB M2AP_LIB M2AP_ENB x2ap M3AP_LIB M3AP_ENB GTPV1U f1ap SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
RRC_LIB NR_RRC_LIB s1ap M2AP_LIB M2AP_ENB x2ap M3AP_LIB M3AP_ENB GTPV1U f1ap SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
${RAL_LIB} ${NAS_UE_LIB} ITTI
-Wl,--end-group z dl)
......@@ -2482,12 +2458,12 @@ add_executable(ocp-enb
${T_SOURCE}
${SHLIB_LOADER_SOURCES}
)
add_dependencies(ocp-enb rrc_flag s1ap_flag oai_iqplayer coding params_libconfig rfsimulator)
add_dependencies(ocp-enb rrc_flag oai_iqplayer coding params_libconfig rfsimulator)
target_link_libraries (ocp-enb
-Wl,--start-group
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB f1ap M2AP_LIB M2AP_ENB x2ap M3AP_LIB M3AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
RRC_LIB NR_RRC_LIB s1ap f1ap M2AP_LIB M2AP_ENB x2ap M3AP_LIB M3AP_ENB GTPV1U SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_LIB SCHED_RU_LIB
PHY_COMMON PHY PHY_RU L2 L2_LTE NFAPI_COMMON_LIB NFAPI_LIB MISC_NFAPI_LTE_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB SIMU_COMMON
${RAL_LIB} ${NAS_UE_LIB} ITTI
-Wl,--end-group z dl)
......@@ -2537,14 +2513,14 @@ add_executable(lte-uesoftmodem
${SHLIB_LOADER_SOURCES}
)
add_dependencies(lte-uesoftmodem rrc_flag s1ap_flag)
add_dependencies(lte-uesoftmodem rrc_flag)
if (NOT ${NOS1})
target_compile_definitions(lte-uesoftmodem PRIVATE -DPDCP_USE_NETLINK)
endif()
target_link_libraries (lte-uesoftmodem
-Wl,--start-group
RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB x2ap M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB
RRC_LIB NR_RRC_LIB s1ap x2ap M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB
SECU_CN SECU_OSA UTIL HASHTABLE SCTP_CLIENT MME_APP SCHED_RU_LIB SCHED_UE_LIB PHY_COMMON
PHY_UE PHY_RU L2_UE L2_LTE SIMU_COMMON SIMU NFAPI_COMMON_LIB NFAPI_LIB NFAPI_PNF_LIB NFAPI_USER_LIB MISC_NFAPI_LTE_LIB
${RAL_LIB} ${NAS_UE_LIB} ITTI ${ATLAS_LIBRARIES}
......@@ -2586,7 +2562,7 @@ target_link_libraries (nr-softmodem
-Wl,--start-group
UTIL HASHTABLE SCTP_CLIENT SCHED_LIB SCHED_RU_LIB SCHED_NR_LIB PHY_NR PHY PHY_COMMON PHY_NR_COMMON PHY_RU GTPV1U SECU_CN SECU_OSA
ITTI ${RAL_LIB} ${NAS_UE_LIB} RRC_LIB NR_RRC_LIB
NGAP_LIB NGAP_GNB S1AP_LIB S1AP_ENB L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
NGAP_LIB NGAP_GNB s1ap L2_LTE_NR L2_NR MAC_NR_COMMON NFAPI_COMMON_LIB NFAPI_LIB NFAPI_VNF_LIB NFAPI_PNF_LIB NFAPI_USER_LIB
x2ap f1ap M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB
-Wl,--end-group z dl)
......@@ -2871,7 +2847,7 @@ if (${T_TRACER})
syncsim nr_ulsim nr_dlsim nr_dlschsim nr_pbchsim nr_pucchsim
nr_ulschsim ldpctest polartest smallblocktest cu_test du_test
#all "add_library" definitions
ITTI RRC_LIB NR_RRC_LIB S1AP_LIB S1AP_ENB x2ap M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB f1ap
ITTI RRC_LIB NR_RRC_LIB s1ap x2ap M2AP_LIB M2AP_ENB M3AP_LIB M3AP_ENB f1ap
params_libconfig oai_usrpdevif oai_bladerfdevif oai_lmssdrdevif oai_iqplayer
oai_eth_transpro oai_mobipass coding HASHTABLE UTIL OMG_SUMO
SECU_OSA SECU_CN SCHED_LIB SCHED_NR_LIB SCHED_RU_LIB SCHED_UE_LIB SCHED_NR_UE_LIB default_sched remote_sched RAL
......@@ -2973,3 +2949,4 @@ include (${OPENAIR_DIR}/common/utils/telnetsrv/telnetsrv_CMakeLists.txt)
include(${OPENAIR1_DIR}/PHY/CODING/nrLDPC_decoder/nrLDPC_tools/CMakeLists.txt)
add_subdirectory(openair2)
add_subdirectory(openair3)
add_subdirectory(S1AP)
add_subdirectory(MESSAGES)
File mode changed from 100755 to 100644
This diff is collapsed.
set(S1AP_VERSION 15 6 0)
make_version(S1AP_cc ${S1AP_VERSION})
#add_definitions(-DS1AP_VERSION=${S1AP_cc})
string(REPLACE ";" "." S1AP_RELEASE "${S1AP_VERSION}")
if(S1AP_RELEASE VERSION_EQUAL "15.6.0")
include(ASN1/R15/s1ap-15.6.0.cmake)
else()
message(FATAL_ERROR "unknown S1AP_RELEASE ${S1AP_RELEASE}")
endif()
add_custom_command(OUTPUT ${s1ap_source} ${s1ap_headers}
COMMAND ASN1C_PREFIX=S1AP_ asn1c -gen-PER -no-gen-OER -fcompound-names -no-gen-example -fno-include-deps -D ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/${S1AP_GRAMMAR}
DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${S1AP_GRAMMAR}
COMMENT "Generating S1AP source files from ${CMAKE_CURRENT_SOURCE_DIR}/${S1AP_GRAMMAR}"
)
add_library(asn1_s1ap ${s1ap_source})
target_include_directories(asn1_s1ap PUBLIC "${CMAKE_CURRENT_BINARY_DIR}")
target_compile_options(asn1_s1ap PRIVATE -DASN_DISABLE_OER_SUPPORT -w)
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment