Improve OpenSSL detection in Homebrew and messages if it fails

This commit is contained in:
Carles Fernandez 2019-03-23 12:57:45 +01:00
parent b0f971fc56
commit 28ade25157
No known key found for this signature in database
GPG Key ID: 4C583C52B0C3877D
2 changed files with 17 additions and 15 deletions

View File

@ -1545,7 +1545,13 @@ find_library(GNUTLS_OPENSSL_LIBRARY NAMES gnutls-openssl libgnutls-openssl.so.27
/usr/lib/sh4-linux-gnu /usr/lib/sh4-linux-gnu
) )
if(NOT GNUTLS_OPENSSL_LIBRARY) if(NOT GNUTLS_OPENSSL_LIBRARY)
message(STATUS "Looking for OpenSSL instead...") if(GnuTLS_FOUND)
message(STATUS " But it was not built with openssl compatibility.")
endif()
message(STATUS " Looking for OpenSSL instead...")
if(OS_IS_MACOSX)
set(OPENSSL_ROOT_DIR /usr/local/opt/openssl) # Trick for Homebrew
endif()
find_package(OpenSSL) find_package(OpenSSL)
set_package_properties(OpenSSL PROPERTIES set_package_properties(OpenSSL PROPERTIES
URL "https://www.openssl.org" URL "https://www.openssl.org"
@ -1567,11 +1573,12 @@ if(NOT GNUTLS_OPENSSL_LIBRARY)
if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat") if(${LINUX_DISTRIBUTION} MATCHES "Fedora" OR ${LINUX_DISTRIBUTION} MATCHES "Red Hat")
message(" sudo yum install openssl-devel") message(" sudo yum install openssl-devel")
else() else()
message(" sudo apt-get install libgnutls-openssl-dev") message(" sudo apt-get install libgnutls28-dev")
endif() endif()
endif() endif()
if(OS_IS_MACOSX) if(OS_IS_MACOSX)
message(" sudo port install gnutls") message(" 'sudo port install gnutls', if you are using Macports, or")
message(" 'brew install openssl', if you are using Homebrew.")
endif() endif()
message(FATAL_ERROR "GnuTLS libraries with openssl compatibility are required to build gnss-sdr") message(FATAL_ERROR "GnuTLS libraries with openssl compatibility are required to build gnss-sdr")
endif() endif()

View File

@ -563,16 +563,16 @@ In a terminal, type:
~~~~~~ ~~~~~~
$ sudo port selfupdate $ sudo port selfupdate
$ sudo port upgrade outdated $ sudo port upgrade outdated
$ sudo port install doxygen +docs
$ sudo port install gnuradio $ sudo port install gnuradio
$ sudo port install lapack $ sudo port install lapack
$ sudo port install armadillo $ sudo port install armadillo
$ sudo port install gnutls $ sudo port install gnutls
$ sudo port install google-glog +gflags $ sudo port install google-glog +gflags
$ sudo port install py27-mako
$ sudo port install py27-six
$ sudo port install matio $ sudo port install matio
$ sudo port install pugixml $ sudo port install pugixml
$ sudo port install py27-mako
$ sudo port install py27-six
$ sudo port install doxygen +docs
~~~~~~ ~~~~~~
You also might need to activate a Python installation. The list of installed versions can be retrieved with: You also might need to activate a Python installation. The list of installed versions can be retrieved with:
@ -609,23 +609,18 @@ Install the required dependencies:
$ brew install cmake $ brew install cmake
$ brew install hdf5 $ brew install hdf5
$ brew install lapack $ brew install lapack
$ brew install arpack superlu armadillo $ brew install armadillo
$ brew install glog gflags $ brew install gflags
$ brew install glog
$ brew install gnuradio $ brew install gnuradio
$ brew install libmatio $ brew install libmatio
$ brew install log4cpp $ brew install log4cpp
$ brew install openssl
$ brew install pugixml $ brew install pugixml
$ pip install mako $ pip install mako
$ pip install six $ pip install six
$ brew install openssl
~~~~~~ ~~~~~~
In the last step, Homebrew installs OpenSSL but it does not link it to `/usr/local`. Thus, you must manually link it instead:
~~~~~~
$ ln -s /usr/local/opt/openssl/include/openssl /usr/local/include
$ ln -s /usr/local/opt/openssl/lib/libssl.1.0.0.dylib /usr/local/lib/
~~~~~~
#### Build GNSS-SDR #### Build GNSS-SDR