Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
O
OpenXG-RAN
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zzha zzha
OpenXG-RAN
Commits
9301d8a7
Commit
9301d8a7
authored
Mar 22, 2022
by
Raymond Knopp
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add websrv as optional lib and frontend as independant target in oai build
parent
8ad4c7b7
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
45 additions
and
10 deletions
+45
-10
cmake_targets/build_oai
cmake_targets/build_oai
+1
-1
common/utils/telnetsrv/telnetsrv_CMakeLists.txt
common/utils/telnetsrv/telnetsrv_CMakeLists.txt
+3
-3
common/utils/telnetsrv/telnetsrv_loader.c
common/utils/telnetsrv/telnetsrv_loader.c
+4
-0
common/utils/websrv/websrv.c
common/utils/websrv/websrv.c
+0
-1
common/utils/websrv/websrv_CMakeLists.txt
common/utils/websrv/websrv_CMakeLists.txt
+37
-5
No files found.
cmake_targets/build_oai
View file @
9301d8a7
...
...
@@ -57,7 +57,7 @@ CMAKE_BUILD_TYPE="RelWithDebInfo"
CMAKE_CMD
=
"
$CMAKE
"
BUILD_ECLIPSE
=
0
NR
=
"False"
OPTIONAL_LIBRARIES
=
"telnetsrv enbscope uescope nrscope"
OPTIONAL_LIBRARIES
=
"telnetsrv enbscope uescope nrscope
websrv
"
RU
=
0
trap
handle_ctrl_c INT
...
...
common/utils/telnetsrv/telnetsrv_CMakeLists.txt
View file @
9301d8a7
...
...
@@ -30,6 +30,6 @@ endforeach()
install(TARGETS telnetsrv DESTINATION bin)
if (EXISTS "${OPENAIR_
BUILD_DIR}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR
}/ran_build/build")
install(TARGETS telnetsrv DESTINATION ${OPENAIR_
BUILD_DIR
}/ran_build/build)
endif (EXISTS "${OPENAIR_
BUILD_DIR}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR
}/ran_build/build")
if (EXISTS "${OPENAIR_
CMAKE}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_CMAKE
}/ran_build/build")
install(TARGETS telnetsrv DESTINATION ${OPENAIR_
CMAKE
}/ran_build/build)
endif (EXISTS "${OPENAIR_
CMAKE}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_CMAKE
}/ran_build/build")
common/utils/telnetsrv/telnetsrv_loader.c
View file @
9301d8a7
...
...
@@ -50,6 +50,10 @@ telnetshell_cmddef_t loader_cmdarray[] = {
/*-------------------------------------------------------------------------------------*/
int
loader_show_cmd
(
char
*
buff
,
int
debug
,
telnet_printfunc_t
prnt
)
{
if
(
buff
==
NULL
)
{
prnt
(
"ERROR wrong loader SHOW command...
\n
"
);
return
0
;
}
if
(
debug
>
0
)
prnt
(
"loader_show_cmd received %s
\n
"
,
buff
);
...
...
common/utils/websrv/websrv.c
View file @
9301d8a7
...
...
@@ -249,7 +249,6 @@ int websrv_callback_get_softmodeminfo(const struct _u_request * request, struct
// telnetparams.CmdParsers[i].cmd[j].helpstr);
// }
}
json_t
*
body
=
json_pack
(
"{s:{s:s,s:s},s:o}"
,
"display_status"
,
"config_file"
,
cfgfile
,
"executable_function"
,
execfunc
,
"menu_cmds"
,
cmdnames
);
...
...
common/utils/websrv/websrv_CMakeLists.txt
View file @
9301d8a7
if ( "${OPENAIR_CMAKE}" STREQUAL "")
message( FATAL_ERROR "oai Environment variables not set")
endif ( "${OPENAIR_CMAKE}" STREQUAL "")
set(WEBSRVROOT ${OPENAIR_DIR}/common/utils/websrv )
# websrv dependencies
#set( ULFIUS "")
find_library(ULFIUS NAMES "libulfius.so" REQUIRED NO_CACHE)
if ("${ULFIUS}" STREQUAL "")
message( FATAL_ERROR "ulfius library (https://github.com/babelouest/ulfius) not found, install libulfius-dev (ubuntu) ")
endif("${ULFIUS}" STREQUAL "")
#set (NPM "")
find_program(NPM NAMES npm NO_CACHE)
if ("${NPM}" STREQUAL "")
message( ERROR " npm is not installed, frontend won't be built. Possibly install npm, package is available for ubuntu and fedora")
endif("${NPM}" STREQUAL "")
# build the backend ( the embedded web server)
set(WEBSRV_SOURCE
${WEBSRVROOT}/websrv.c
)
add_library(websrv MODULE ${WEBSRV_SOURCE} )
target_link_libraries(websrv PRIVATE ulfius jansson)
install(TARGETS websrv DESTINATION bin)
# build the frontend ( loaded from web server by browsers)
add_custom_target (
websrvfront_installjsdep
WORKING_DIRECTORY ${WEBSRVROOT}/frontend
COMMAND npm install
DEPENDS ${WEBSRVROOT}/frontend/package-lock.json
)
if (EXISTS "${OPENAIR_BUILD_DIR}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/ran_build/build")
install(TARGETS websrv DESTINATION ${OPENAIR_BUILD_DIR}/ran_build/build)
endif (EXISTS "${OPENAIR_BUILD_DIR}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_BUILD_DIR}/ran_build/build")
add_custom_target (
websrvfront
WORKING_DIRECTORY ${WEBSRVROOT}/frontend
COMMAND npm run build
DEPENDS websrvfront_installjsdep
)
#install built files, required at exec time
install(TARGETS websrv DESTINATION bin)
if (EXISTS "${OPENAIR_CMAKE}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_CMAKE}/ran_build/build")
add_custom_command(TARGET websrvfront
POST_BUILD COMMAND ${CMAKE_COMMAND} -E copy_directory ${WEBSRVROOT}/frontend/dist/softmodem-ngx ${OPENAIR_CMAKE}/ran_build/build/websrv
COMMAND ${CMAKE_COMMAND} -E copy_directory ${WEBSRVROOT}/frontend/dist/softmodem-ngx ${OPENAIR_TARGETS}/bin/websrv
COMMENT "Moving frontend files to:\n ${OPENAIR_CMAKE}/ran_build/build/websrv\n ${OPENAIR_TARGETS}/bin/websrv" )
endif (EXISTS "${OPENAIR_CMAKE}/ran_build/build" AND IS_DIRECTORY "${OPENAIR_CMAKE}/ran_build/build")
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment