Commit eb74e19d authored by Tien-Thinh Nguyen's avatar Tien-Thinh Nguyen

remove unecessary files - NGAP

parent 3c115400
cmake_minimum_required (VERSION 3.0.2) cmake_minimum_required (VERSION 3.0.2)
project(OpenAirInterface)
# Override options for AMF # Override options for AMF
set ( PACKAGE_NAME "AMF" ) set ( PACKAGE_NAME "AMF" )
set ( STATIC_LINKING False ) set ( STATIC_LINKING False )
......
cmake_minimum_required (VERSION 3.0.2)
project(OpenAirInterface)
macro(add_list_string_option name val helpstr)
if(DEFINED ${name})
set(value ${${name}})
else(DEFINED ${name})
set(value ${val})
endif()
set(${name} ${value} CACHE STRING "${helpstr}")
set_property(CACHE ${name} PROPERTY STRINGS ${ARGN})
if(NOT "${value}" STREQUAL "False")
add_definitions("-D${name}=\"${value}\"")
endif()
endmacro(add_list_string_option)
SET(STATIC_LINKING FALSE CACHE BOOL "Build a static binary?")
IF(STATIC_LINKING)
SET(CMAKE_FIND_LIBRARY_SUFFIXES ".a")
ENDIF(STATIC_LINKING)
add_list_string_option(CMAKE_BUILD_TYPE "RelWithDebInfo" "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel." Debug Release
RelWithDebInfo MinSizeRel)
Message("Build type is ${CMAKE_BUILD_TYPE}")
if (CMAKE_BUILD_TYPE STREQUAL "RelWithDebInfo")
add_boolean_option(LOG_OAI True "Thread safe logging API")
add_boolean_option(LOG_OAI_MINIMAL True "Thread safe logging API, log only levels above NOTICE")
SET(ASAN asan)
endif()
if (CMAKE_BUILD_TYPE STREQUAL "Debug")
add_boolean_option(LOG_OAI True "Thread safe logging API")
SET(ASAN asan)
endif()
if (CMAKE_BUILD_TYPE STREQUAL "")
set(CMAKE_BUILD_TYPE "MinSizeRel")
endif()
Message("Build type is ${CMAKE_BUILD_TYPE}")
Message("Architecture is ${CMAKE_SYSTEM_PROCESSOR}")
if (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
set(C_FLAGS_PROCESSOR "-gdwarf-2 -mfloat-abi=hard -mfpu=neon -lgcc -lrt")
else (CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7l")
set(C_FLAGS_PROCESSOR "-msse4.2")
endif()
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} ${C_FLAGS_PROCESSOR} -std=gnu99 -Wall -Wstrict-prototypes -fno-strict-aliasing -rdynamic -funroll-loops -Wno-packed-bitfield-compat -fPIC ")
# add autoTOOLS definitions that were maybe used!
set(CMAKE_C_FLAGS
"${CMAKE_C_FLAGS} -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_FCNTL_H=1 -DHAVE_ARPA_INET_H=1 -DHAVE_SYS_TIME_H=1 -DHAVE_SYS_SOCKET_H=1 -DHAVE_STRERROR=1 -DHAVE_SOCKET=1 -DHAVE_MEMSET=1 -DHAVE_GETTIMEOFDAY=1 -DHAVE_STDLIB_H=1 -DHAVE_MALLOC=1 -DHAVE_LIBSCTP")
add_definitions(-DCMAKER)
add_definitions(-DBSTRLIB_CAN_USE_STL=1 -DBSTRLIB_CAN_USE_IOSTREAM=1 -DBSTRLIB_THROWS_EXCEPTIONS=1)
if(STATIC_LINKING)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -fstack-protector-all -DMALLOC_CHECK_=3 -DINFO_IS_ON=1 -DDEBUG_IS_ON=1 -DTRACE_IS_ON=1 -O0 -fno-omit-frame-pointer")
else (STATIC_LINKING)
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS} -g -fstack-protector-all -DMALLOC_CHECK_=3 -DINFO_IS_ON=1 -DDEBUG_IS_ON=1 -DTRACE_IS_ON=1 -O0 -fsanitize=address -fno-omit-frame-pointer")
endif(STATIC_LINKING)
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS} -O2 -fno-omit-frame-pointer -s -DINFO_IS_ON=1 ")
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS} -g -O2 -DINFO_IS_ON=1 ")
set(CMAKE_C_FLAGS_MINSIZEREL "${CMAKE_C_FLAGS} -Os -s -DTRACE_IS_ON=1 -DDEBUG_IS_ON=1 -DINFO_IS_ON=1")
if(STATIC_LINKING)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -std=c++17 -g -fstack-protector-all -DMALLOC_CHECK_=3 -DINFO_IS_ON=1 -DDEBUG_IS_ON=1 -DTRACE_IS_ON=1 -O0 -fno-omit-frame-pointer -DBUPT=1 -DEURECOM=0")
else(STATIC_LINKING)
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS} -std=c++17 -g -fstack-protector-all -DMALLOC_CHECK_=3 -DINFO_IS_ON=1 -DDEBUG_IS_ON=1 -DTRACE_IS_ON=1 -O0 -fsanitize=address -fno-omit-frame-pointer -DBUPT=1 -DEURECOM=0")
endif(STATIC_LINKING)
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -std=c++17 -O2 -fno-omit-frame-pointer -s -DINFO_IS_ON=1 -DBUPT=1 -DEURECOM=0")
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS} -std=c++17 -g -O2 -DINFO_IS_ON=1 -DBUPT=1 -DEURECOM=0")
set(CMAKE_CXX_FLAGS_MINSIZEREL "${CMAKE_CXX_FLAGS} -std=c++17 -Os -s -DTRACE_IS_ON=1 -DDEBUG_IS_ON=1 -DINFO_IS_ON=1")
set(CMAKE_MODULE_PATH "${OPENAIRCN_DIR}/build/cmake_modules" "${CMAKE_MODULE_PATH}")
include(FindPkgConfig)
message("${OPENAIRCN_DIR}/build/cmake_modules")
include_directories(${SRC_TOP_DIR}/oai-amf)
include_directories(${SRC_TOP_DIR}/amf-app)
include_directories(${SRC_TOP_DIR}/../build/ext/spdlog/include)
### for common
include_directories(${SRC_TOP_DIR}/common)
file(GLOB COMMON_SRC ${SRC_TOP_DIR}/common/conversions.cpp)
### end for common
### for utils/bstr
include_directories(${SRC_TOP_DIR}/utils/bstr)
file(GLOB BSTR_SRC ${SRC_TOP_DIR}/utils/bstr/bstrlib.c)
##end for utils/bstr
### for sctp
include_directories(${SRC_TOP_DIR}/sctp)
file(GLOB SCTP_SRC ${SRC_TOP_DIR}/sctp/sctp_server.cpp)
#end for sctp
### for ngap
include_directories(${SRC_TOP_DIR}/ngap/ngap_app)
file(GLOB NGAP_SRC ${SRC_TOP_DIR}/ngap/ngap_app/ngap_app.cpp)
###end for ngap
### for log
add_library( LOG STATIC
${SRC_TOP_DIR}/common/logger.cpp)
add_library( OPTIONS STATIC
${SRC_TOP_DIR}/oai-amf/options.cpp)
###end for log
### for config
add_library( CONFIGS STATIC
${SRC_TOP_DIR}/amf-app/amf_config.cpp)
pkg_search_module(CONFIG REQUIRED libconfig++)
include_directories(${CONFIG_INCLUDE_DIRS})
### end for config
add_executable(amf
${SRC_TOP_DIR}/ngap/main.cpp
${COMMON_SRC} ${BSTR_SRC} ${SCTP_SRC} ${NGAP_SRC}
)
# LOG from oai-amf/CMakeLists.txt
target_link_libraries(amf -Wl,--start-group LOG OPTIONS CONFIGS config++ sctp pthread)
/*
* Licensed to the OpenAirInterface (OAI) Software Alliance under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The OpenAirInterface Software Alliance licenses this file to You under
* the OAI Public License, Version 1.1 (the "License"); you may not use this file
* except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.openairinterface.org/?page_id=698
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*-------------------------------------------------------------------------------
* For more information about the OpenAirInterface (OAI) Software Alliance:
* contact@openairinterface.org
*/
/*! \file main.cpp
\brief
\author Keliang DU, BUPT
\date 2020
\email: contact@openairinterface.org
*/
#include <iostream>
#include <thread>
#include <signal.h>
#include <stdint.h>
#include <stdlib.h>
#include <unistd.h>
#include "logger.hpp"
#include "options.hpp"
#include "amf_config.hpp"
#include "ngap_app.hpp"
using namespace std;
using namespace config;
using namespace ngap;
amf_config amf_cfg;
ngap_app *ngap_inst = NULL;
int main(int argc, char **argv) {
srand (time(NULL));
if (!Options::parse(argc, argv)) {
cout<<"Options::parse() failed"<<endl;
return 1;
}
Logger::init( "AMF" , Options::getlogStdout() , Options::getlogRotFilelog());
Logger::amf_app().startup("Options parsed!");
amf_cfg.load(Options::getlibconfigConfig());
amf_cfg.display();
ngap_inst = new ngap_app("10.103.238.20",38412);
Logger::amf_app().debug("Initiating Done!");
pause();
return 0;
}
cmake_minimum_required (VERSION 3.0.2) cmake_minimum_required (VERSION 3.0.2)
project(OpenAirInterface)
macro(add_boolean_option name val helpstr) macro(add_boolean_option name val helpstr)
if(DEFINED ${name}) if(DEFINED ${name})
set(value ${${name}}) set(value ${${name}})
......
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