mirror of
https://github.com/gnss-sdr/gnss-sdr
synced 2025-01-28 18:04:51 +00:00
Try to use OpenSSL if GnuTLS with openssl compatibility enabled is not
found.
This commit is contained in:
parent
d1e15734ca
commit
e4206d38f6
@ -781,21 +781,42 @@ endif(NOT ARMADILLO_FOUND)
|
||||
# GnuTLS - http://www.gnutls.org/
|
||||
################################################################################
|
||||
find_package(GnuTLS)
|
||||
if(NOT GNUTLS_FOUND)
|
||||
message(" The GnuTLS library has not been found.")
|
||||
message(" You can try to install it by typing:")
|
||||
if(OS_IS_LINUX)
|
||||
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(" sudo yum install libgnutls-openssl-devel")
|
||||
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(" sudo apt-get install libgnutls-openssl-dev")
|
||||
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
endif(OS_IS_LINUX)
|
||||
if(OS_IS_MACOSX)
|
||||
message(" sudo port install gnutls")
|
||||
endif(OS_IS_MACOSX)
|
||||
message(FATAL_ERROR "GnuTLS libraries are required to build gnss-sdr")
|
||||
endif(NOT GNUTLS_FOUND)
|
||||
find_library(GNUTLS_OPENSSL_LIBRARY NAMES gnutls-openssl libgnutls-openssl.so.27
|
||||
HINTS /usr/lib
|
||||
/usr/lib64
|
||||
/usr/local/lib
|
||||
/usr/local/lib64
|
||||
/opt/local/lib
|
||||
/usr/lib/x86_64-linux-gnu
|
||||
/usr/lib/aarch64-linux-gnu
|
||||
/usr/lib/arm-linux-gnueabihf
|
||||
/usr/lib/arm-linux-gnueabi
|
||||
/usr/lib/i386-linux-gnu
|
||||
)
|
||||
|
||||
if(NOT GNUTLS_OPENSSL_LIBRARY)
|
||||
message(STATUS "Looking for OpenSSL instead...")
|
||||
find_package(OpenSSL)
|
||||
if(OPENSSL_FOUND)
|
||||
set(GNUTLS_INCLUDE_DIR ${OPENSSL_INCLUDE_DIR})
|
||||
set(GNUTLS_LIBRARIES "")
|
||||
set(GNUTLS_OPENSSL_LIBRARY ${OPENSSL_SSL_LIBRARY})
|
||||
else(OPENSSL_FOUND)
|
||||
message(" The GnuTLS library with openssl compatibility enabled has not been found.")
|
||||
message(" You can try to install it by typing:")
|
||||
if(OS_IS_LINUX)
|
||||
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(" sudo yum install libgnutls-openssl-devel")
|
||||
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(" sudo apt-get install libgnutls-openssl-dev")
|
||||
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
endif(OS_IS_LINUX)
|
||||
if(OS_IS_MACOSX)
|
||||
message(" sudo port install gnutls")
|
||||
endif(OS_IS_MACOSX)
|
||||
message(FATAL_ERROR "GnuTLS libraries with openssl compatibility are required to build gnss-sdr")
|
||||
endif(OPENSSL_FOUND)
|
||||
endif(NOT GNUTLS_OPENSSL_LIBRARY)
|
||||
|
||||
|
||||
################################################################################
|
||||
|
@ -18,6 +18,10 @@
|
||||
|
||||
add_subdirectory(supl)
|
||||
|
||||
if(OPENSSL_FOUND)
|
||||
add_definitions( -DUSE_OPENSSL_FALLBACK=1 )
|
||||
endif(OPENSSL_FOUND)
|
||||
|
||||
set(CORE_LIBS_SOURCES
|
||||
ini.cc
|
||||
INIReader.cc
|
||||
|
@ -23,6 +23,10 @@ set (SUPL_SOURCES
|
||||
supl.c
|
||||
)
|
||||
|
||||
if(OPENSSL_FOUND)
|
||||
add_definitions( -DUSE_OPENSSL_FALLBACK=1 )
|
||||
endif(OPENSSL_FOUND)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_CURRENT_SOURCE_DIR}
|
||||
${CMAKE_SOURCE_DIR}/src/core/libs/supl
|
||||
@ -38,31 +42,6 @@ if(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
endif(CMAKE_C_COMPILER_ID MATCHES "Clang")
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${MY_C_FLAGS}")
|
||||
|
||||
find_library(GNUTLS_OPENSSL_LIBRARY NAMES gnutls-openssl libgnutls-openssl.so.27
|
||||
HINTS /usr/lib
|
||||
/usr/lib64
|
||||
/usr/local/lib
|
||||
/usr/local/lib64
|
||||
/opt/local/lib
|
||||
/usr/lib/x86_64-linux-gnu
|
||||
/usr/lib/aarch64-linux-gnu
|
||||
/usr/lib/arm-linux-gnueabihf
|
||||
/usr/lib/arm-linux-gnueabi
|
||||
/usr/lib/i386-linux-gnu
|
||||
)
|
||||
|
||||
if(NOT GNUTLS_OPENSSL_LIBRARY)
|
||||
message(STATUS "The OpenSSL implementation provided by the GnuTLS library has not been found.")
|
||||
if(OS_IS_LINUX)
|
||||
message("Please install it by doing:")
|
||||
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(FATAL_ERROR " sudo yum install libgnutls-openssl-devel")
|
||||
else(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
message(FATAL_ERROR " sudo apt-get install libgnutls-openssl-dev")
|
||||
endif(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
|
||||
endif(OS_IS_LINUX)
|
||||
endif(NOT GNUTLS_OPENSSL_LIBRARY)
|
||||
|
||||
add_library (supl_library STATIC ${ASN_RRLP_SOURCES} ${ASN_SUPL_SOURCES} ${SUPL_SOURCES})
|
||||
target_link_libraries (supl_library ${GNUTLS_LIBRARIES} ${GNUTLS_OPENSSL_LIBRARY} gnss_system_parameters)
|
||||
set_target_properties(supl_library PROPERTIES LINKER_LANGUAGE C)
|
||||
|
@ -83,6 +83,10 @@ if(Boost_VERSION LESS 105000)
|
||||
add_definitions(-DOLD_BOOST=1)
|
||||
endif(Boost_VERSION LESS 105000)
|
||||
|
||||
if(OPENSSL_FOUND)
|
||||
add_definitions( -DUSE_OPENSSL_FALLBACK=1 )
|
||||
endif(OPENSSL_FOUND)
|
||||
|
||||
if(ENABLE_GN3S)
|
||||
add_definitions(-DGN3S_DRIVER=1)
|
||||
endif(ENABLE_GN3S)
|
||||
|
@ -33,6 +33,10 @@ if(ENABLE_UHD)
|
||||
set(GNSS_SDR_OPTIONAL_HEADERS ${GNSS_SDR_OPTIONAL_HEADERS} ${UHD_INCLUDE_DIRS})
|
||||
endif(ENABLE_UHD)
|
||||
|
||||
if(OPENSSL_FOUND)
|
||||
add_definitions( -DUSE_OPENSSL_FALLBACK=1 )
|
||||
endif(OPENSSL_FOUND)
|
||||
|
||||
if(ENABLE_CUDA)
|
||||
add_definitions(-DCUDA_GPU_ACCEL=1)
|
||||
set(GNSS_SDR_OPTIONAL_LIBS ${GNSS_SDR_OPTIONAL_LIBS} ${CUDA_LIBRARIES})
|
||||
|
@ -96,6 +96,10 @@ endif(ENABLE_GPERFTOOLS)
|
||||
if(Boost_VERSION LESS 105000)
|
||||
add_definitions(-DOLD_BOOST=1)
|
||||
endif(Boost_VERSION LESS 105000)
|
||||
|
||||
if(OPENSSL_FOUND)
|
||||
add_definitions( -DUSE_OPENSSL_FALLBACK=1 )
|
||||
endif(OPENSSL_FOUND)
|
||||
|
||||
include_directories(
|
||||
${GTEST_INCLUDE_DIRECTORIES}
|
||||
|
@ -17,74 +17,77 @@
|
||||
#
|
||||
|
||||
|
||||
#if(ENABLE_OSMOSDR)
|
||||
set(FRONT_END_CAL_SOURCES front_end_cal.cc)
|
||||
if(OPENSSL_FOUND)
|
||||
add_definitions( -DUSE_OPENSSL_FALLBACK=1 )
|
||||
endif(OPENSSL_FOUND)
|
||||
|
||||
include_directories(
|
||||
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
${CMAKE_SOURCE_DIR}/src/core/receiver
|
||||
${CMAKE_SOURCE_DIR}/src/core/libs
|
||||
${CMAKE_SOURCE_DIR}/src/core/libs/supl
|
||||
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp
|
||||
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/libs
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks
|
||||
${GLOG_INCLUDE_DIRS}
|
||||
${GFlags_INCLUDE_DIRS}
|
||||
${GNURADIO_RUNTIME_INCLUDE_DIRS}
|
||||
${GNURADIO_BLOCKS_INCLUDE_DIRS}
|
||||
${ARMADILLO_INCLUDE_DIRS}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${VOLK_GNSSSDR_INCLUDE_DIRS}
|
||||
)
|
||||
set(FRONT_END_CAL_SOURCES front_end_cal.cc)
|
||||
|
||||
file(GLOB FRONT_END_CAL_HEADERS "*.h")
|
||||
add_library(front_end_cal_lib ${FRONT_END_CAL_SOURCES} ${FRONT_END_CAL_HEADERS})
|
||||
source_group(Headers FILES ${FRONT_END_CAL_HEADERS})
|
||||
include_directories(
|
||||
${CMAKE_SOURCE_DIR}/src/core/system_parameters
|
||||
${CMAKE_SOURCE_DIR}/src/core/interfaces
|
||||
${CMAKE_SOURCE_DIR}/src/core/receiver
|
||||
${CMAKE_SOURCE_DIR}/src/core/libs
|
||||
${CMAKE_SOURCE_DIR}/src/core/libs/supl
|
||||
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-rrlp
|
||||
${CMAKE_SOURCE_DIR}/src/core/libs/supl/asn-supl
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/libs
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/adapters
|
||||
${CMAKE_SOURCE_DIR}/src/algorithms/acquisition/gnuradio_blocks
|
||||
${GLOG_INCLUDE_DIRS}
|
||||
${GFlags_INCLUDE_DIRS}
|
||||
${GNURADIO_RUNTIME_INCLUDE_DIRS}
|
||||
${GNURADIO_BLOCKS_INCLUDE_DIRS}
|
||||
${ARMADILLO_INCLUDE_DIRS}
|
||||
${Boost_INCLUDE_DIRS}
|
||||
${VOLK_GNSSSDR_INCLUDE_DIRS}
|
||||
)
|
||||
|
||||
target_link_libraries(front_end_cal_lib ${Boost_LIBRARIES}
|
||||
${GNURADIO_RUNTIME_LIBRARIES}
|
||||
${GNURADIO_BLOCKS_LIBRARIES}
|
||||
${GFlags_LIBS}
|
||||
${GLOG_LIBRARIES}
|
||||
${ARMADILLO_LIBRARIES}
|
||||
${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES}
|
||||
gnss_rx
|
||||
gnss_sp_libs
|
||||
)
|
||||
file(GLOB FRONT_END_CAL_HEADERS "*.h")
|
||||
add_library(front_end_cal_lib ${FRONT_END_CAL_SOURCES} ${FRONT_END_CAL_HEADERS})
|
||||
source_group(Headers FILES ${FRONT_END_CAL_HEADERS})
|
||||
|
||||
target_link_libraries(front_end_cal_lib ${Boost_LIBRARIES}
|
||||
${GNURADIO_RUNTIME_LIBRARIES}
|
||||
${GNURADIO_BLOCKS_LIBRARIES}
|
||||
${GFlags_LIBS}
|
||||
${GLOG_LIBRARIES}
|
||||
${ARMADILLO_LIBRARIES}
|
||||
${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES}
|
||||
gnss_rx
|
||||
gnss_sp_libs
|
||||
)
|
||||
|
||||
add_dependencies(front_end_cal_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE})
|
||||
add_dependencies(front_end_cal_lib glog-${glog_RELEASE} armadillo-${armadillo_RELEASE})
|
||||
|
||||
add_definitions( -DGNSS_SDR_VERSION="${VERSION}" )
|
||||
add_definitions( -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" )
|
||||
add_definitions( -DGNSS_SDR_VERSION="${VERSION}" )
|
||||
add_definitions( -DGNSSSDR_INSTALL_DIR="${CMAKE_INSTALL_PREFIX}" )
|
||||
|
||||
add_executable(front-end-cal ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
|
||||
add_executable(front-end-cal ${CMAKE_CURRENT_SOURCE_DIR}/main.cc)
|
||||
|
||||
add_custom_command(TARGET front-end-cal POST_BUILD
|
||||
add_custom_command(TARGET front-end-cal POST_BUILD
|
||||
COMMAND ${CMAKE_COMMAND} -E copy $<TARGET_FILE:front-end-cal>
|
||||
${CMAKE_SOURCE_DIR}/install/$<TARGET_FILE_NAME:front-end-cal>)
|
||||
|
||||
|
||||
target_link_libraries(front-end-cal ${GNURADIO_RUNTIME_LIBRARIES}
|
||||
${GNURADIO_BLOCKS_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
${GFlags_LIBS}
|
||||
${GLOG_LIBRARIES}
|
||||
${ARMADILLO_LIBRARIES}
|
||||
gnss_rx
|
||||
gnss_sp_libs
|
||||
front_end_cal_lib
|
||||
${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES}
|
||||
)
|
||||
target_link_libraries(front-end-cal ${GNURADIO_RUNTIME_LIBRARIES}
|
||||
${GNURADIO_BLOCKS_LIBRARIES}
|
||||
${Boost_LIBRARIES}
|
||||
${GFlags_LIBS}
|
||||
${GLOG_LIBRARIES}
|
||||
${ARMADILLO_LIBRARIES}
|
||||
gnss_rx
|
||||
gnss_sp_libs
|
||||
front_end_cal_lib
|
||||
${VOLK_GNSSSDR_LIBRARIES} ${ORC_LIBRARIES}
|
||||
)
|
||||
|
||||
install(TARGETS front-end-cal
|
||||
RUNTIME DESTINATION bin
|
||||
COMPONENT "front-end-cal"
|
||||
)
|
||||
install(TARGETS front-end-cal
|
||||
RUNTIME DESTINATION bin
|
||||
COMPONENT "front-end-cal"
|
||||
)
|
||||
|
||||
find_program(GZIP gzip
|
||||
find_program(GZIP gzip
|
||||
/bin
|
||||
/usr/bin
|
||||
/usr/local/bin
|
||||
@ -92,11 +95,11 @@
|
||||
/sbin
|
||||
)
|
||||
|
||||
if(NOT GZIP_NOTFOUND)
|
||||
execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/manpage/front-end-cal-manpage
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/front-end-cal.1.gz")
|
||||
if(NOT GZIP_NOTFOUND)
|
||||
execute_process(COMMAND gzip -9 -c ${CMAKE_SOURCE_DIR}/docs/manpage/front-end-cal-manpage
|
||||
WORKING_DIRECTORY ${CMAKE_BINARY_DIR} OUTPUT_FILE "${CMAKE_BINARY_DIR}/front-end-cal.1.gz")
|
||||
|
||||
install(FILES ${CMAKE_BINARY_DIR}/front-end-cal.1.gz DESTINATION share/man/man1)
|
||||
endif(NOT GZIP_NOTFOUND)
|
||||
|
||||
install(FILES ${CMAKE_BINARY_DIR}/front-end-cal.1.gz DESTINATION share/man/man1)
|
||||
endif(NOT GZIP_NOTFOUND)
|
||||
|
||||
#endif(ENABLE_OSMOSDR)
|
||||
|
Loading…
Reference in New Issue
Block a user