红联Linux门户
Linux帮助

Ubuntu编译环境构建(openssl)

发布时间:2015-09-03 21:27:24来源:linux网站作者:mutex73

1、基础构建

sudo apt-get install subversion git-core git-svn

sudo apt-get install make gcc g++ libX11-dev libXt-dev libgl1-mesa-dev libosmesa6-dev libglu1-mesa-dev libfontconfig-dev libxrender-dev libncurses5-dev

libtiff4-dev libwrap0-dev (MITK needed)

sudo apt-get install cmake


2、cmake

(ln -s 命名为cmake-ssl)

sudo apt-get install openssl libssl-dev

mkdir ~/Support && cd Support 

cmake_package="cmake-3.0.0"; \
wget http://www.cmake.org/files/v3.0/$cmake_package.tar.gz -v -O $cmake_package.tar.gz && \
tar -xzvf $cmake_package.tar.gz; \
cd $cmake_package && \
cmake -DCMAKE_USE_OPENSSL:BOOL=ON && \
make -j4

for tool in cmake ccmake ctest cpack; do sudo ln -s ~/Support/$cmake_package/bin/$tool /usr/local/bin/$tool; done


3、QT

(不用openssl可以省略中间步骤,configure时删除openssl参数)

cd ~/Support  

cwd=$(pwd)

rm -f get-and-build-openssl-for-slicer.sh
wget https://gist.githubusercontent.com/jcfr/9513568/raw/21f4e4cabca5ad03435ecc17ab546dab5e2c1a2f/get-and-build-openssl-for-slicer.sh
chmod u+x get-and-build-openssl-for-slicer.sh
./get-and-build-openssl-for-slicer.sh

wget http://packages.kitware.com/download/item/6175/qt-everywhere-opensource-src-4.8.6.tar.gz
md5=`md5sum ./qt-everywhere-opensource-src-4.8.6.tar.gz | awk '{ print $1 }'` &&
[ $md5 == "2edbe4d6c2eff33ef91732602f3518eb" ] || echo "MD5 mismatch. Problem downloading Qt"

tar -xzvf qt-everywhere-opensource-src-4.8.6.tar.gz
mv qt-everywhere-opensource-src-4.8.6 qt-everywhere-opensource-release-src-4.8.6
mkdir qt-everywhere-opensource-release-build-4.8.6
cd qt-everywhere-opensource-release-src-4.8.6
./configure -prefix $cwd/qt-everywhere-opensource-release-build-4.8.6/\
-release \
-opensource -confirm-license \
-no-qt3support \
-webkit \
-nomake examples -nomake demos \
-openssl -I $cwd/openssl-1.0.1e/include   -L $cwd/openssl-1.0.1e \
&& make -j7 && make install


Tips

用QTCREATOR时记得cmake别选错了,现在有两个版本的cmake,而且cmake-gui版本应该较低
QT库默认是找不到的,自行输入qmake的位置
带有Superbuild的工程,用qtcreator打开时不要打开CMakeLists.txt


Linux下使用OpenSSL生成证书:http://www.linuxdiyf.com/linux/11951.html

Linux下OpenSSL安装图文详解:http://www.linuxdiyf.com/linux/8744.html