4 # Copyright 2019 AT&T Intellectual Property
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
19 # build utility for E2 Agent
24 ASN1_C_DIR=$E2SIM_DIR/build/CMakeFiles/ASN1
26 source $E2SIM_DIR/tools/build_helper.bash
31 This program installs E2 Simulator
32 You should have ubuntu 14.xx, updated, and the Linux kernel >= 3.14
33 The program is run by default with no option
37 Erase all files to make a rebuild from start
43 generate_asn1c_codes()
46 X2AP_ASN_FILES="x2ap-14.6.0.asn1"
47 ASN_SOURCE_X2AP=$E2SIM_DIR/src/X2AP/MESSAGES/ASN1/${X2AP_RELEASE}/${X2AP_ASN_FILES}
49 ASN_SOURCE_Pendulum=$E2SIM_DIR/src/ONS2019/pendulum.asn1
51 done_flag="$ASN1_C_DIR"/done
53 #-ot = older than, -nt = newer than
55 if [ "$done_flag" -ot $ASN_SOURCE_X2AP ] ; then
56 echo_info "Generate C codes for from source file"
57 #echo_info $ASN_SOURCE
59 rm -f "$ASN1_C_DIR"/*.c "$ASN1_C_DIR"/*.h
61 asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example \
62 -fno-include-deps -D $ASN1_C_DIR $ASN_SOURCE_X2AP \
63 |& egrep -v "^Copied|^Compiled" | sort -u
65 asn1c -pdu=all -fcompound-names -gen-PER -no-gen-OER -no-gen-example \
66 -fno-include-deps -D $ASN1_C_DIR $ASN_SOURCE_Pendulum \
67 |& egrep -v "^Copied|^Compiled" | sort -u
69 echo_success "ASN1 C codes generated at: $ASN1_C_DIR"
76 echo_info "Will install rmr library"
77 /bin/bash rmr_interface/rmr_install.sh
82 echo_info "Will complie ASN1_API library"
83 # rm -rf build/libASN1_API.a
84 # rm -rf build/asn_x2ap.o
85 # rm -rf build/asn_e2ap.o
87 g++ -O3 -std=c++14 -Wall \
88 -I./src/ASN1/ -I./src/ASN1/asn/ -I./src/ASN1/generated/ \
89 -c src/ASN1/lib/asn_e2ap.cpp \
91 ar -crv build/libASN1_API.a build/asn_e2ap.o
93 g++ -O3 -std=c++14 -Wall \
94 -I./src/ASN1/ -I./src/ASN1/asn/ -I./src/ASN1/generated/ \
95 -c src/ASN1/lib/asn_x2ap.cpp \
97 ar -crv build/libASN1_API.a build/asn_x2ap.o
105 echo_info "Will clean all previously producted files under build/"
106 rm -rf $E2SIM_DIR/build
107 echo_success "Clean Done"
129 echo_error "Unknown option $1"
133 BUILD_DIR=$E2SIM_DIR/build
135 mkdir -p $BUILD_DIR/log
137 # generate_asn1c_codes #X2AP, pendulum
141 echo_info "Will build e2sim"
143 rm -rf CMakeCache.txt
147 echo_success "e2sim compiled"