Skip to content
This repository has been archived by the owner on Apr 11, 2020. It is now read-only.

Fix for upf build #5

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions src/upf/lib/gtpv1/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,19 @@ add_custom_target(libgtp5gnl ALL
)

link_directories("${CMAKE_SOURCE_DIR}/lib" "${LIBGTP5GNL_DST}/lib" ${LOGGER_DST})

# Test
add_executable("${PROJECT_NAME}_test" test.c)
set_target_properties("${PROJECT_NAME}_test" PROPERTIES
OUTPUT_NAME "${BUILD_BIN_DIR}/testgtpv1"
)

target_link_libraries("${PROJECT_NAME}_test" free5GC_lib gtp5gnl logger mnl)
target_include_directories("${PROJECT_NAME}_test" PRIVATE
include
${LOGGER_DST}
"${LIBGTP5GNL_DST}/include"
"${CMAKE_SOURCE_DIR}/lib/utlt/include"
)
target_compile_options("${PROJECT_NAME}_test" PRIVATE -Wall -Werror)
add_dependencies("${PROJECT_NAME}_test" utlt_logger libgtp5gnl)
21 changes: 21 additions & 0 deletions src/upf/lib/libgtp5gnl/m4/gcc4_visibility.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

# GCC 4.x -fvisibility=hidden

AC_DEFUN([CHECK_GCC_FVISIBILITY], [
AC_LANG_PUSH([C])
saved_CFLAGS="$CFLAGS"
CFLAGS="$saved_CFLAGS -fvisibility=hidden"
AC_CACHE_CHECK([whether compiler accepts -fvisibility=hidden],
[ac_cv_fvisibility_hidden], AC_COMPILE_IFELSE(
[AC_LANG_SOURCE()],
[ac_cv_fvisibility_hidden=yes],
[ac_cv_fvisibility_hidden=no]
))
if test "$ac_cv_fvisibility_hidden" = "yes"; then
AC_DEFINE([HAVE_VISIBILITY_HIDDEN], [1],
[True if compiler supports -fvisibility=hidden])
AC_SUBST([GCC_FVISIBILITY_HIDDEN], [-fvisibility=hidden])
fi
CFLAGS="$saved_CFLAGS"
AC_LANG_POP([C])
])