Installing Wt on Solaris with Sun CC Compiler and stlport4¶
- Table of contents
- Installing Wt on Solaris with Sun CC Compiler and stlport4
Overview¶
Installing Wt on Solaris with Sun CC Compiler compiled and linked with stlport4.
successful builded on Solaris 10 sparc with Sun C compiler 5.9
Dependencies¶
- SUN Studio 12 (C Compiler 5.9): http://developers.sun.com/sunstudio/index.jsp
- SUN Studio 12 the latest patches: http://developers.sun.com/sunstudio/downloads/patches/ss12_patches.jsp
- GNU make (named as gmake in this document): http://ftp.gnu.org/pub/gnu/make/make-3.81.tar.gz
- GNU patch (named as gpatch in this document): ftp://ftp.gnu.org/gnu/patch/patch-2.5.9.tar.gz
- cmake: http://www.cmake.org/files/v2.6/cmake-2.6.3.tar.gz
install this programs for example into the $WT_ROOT path (see below).
prepare the install directory¶
We don't need to build and install the libraries as root.
You need only run this two commands as root (or ask your system admin to do that):
mkdir /opt/WT
chown <user>:<group> /opt/WT
chmod 755 /opt/WT
and have to be a valid system user and group
Now you can build and install the libs as . Loggin as
set environment¶
WT_ROOT=/opt/WT
BUILD_DIR=$WT_ROOT/build
ZLIB_ROOT=$WT_ROOT
SSL_ROOT=$WT_ROOT
BOOST_CFG=sw-mt
BOOST_COMPILER=sw
BOOST_ROOT=$WT_ROOT
BOOST_VERSION=1_39
FCGI_ROOT=$WT_ROOT
PATH=$WT_ROOT/bin:$PATH
LD_LIBRARY_PATH=$WT_ROOT/lib:$LD_LIBRARY_PATH
mkdir $BUILD_DIR
mkdir $WT_ROOT/bin
mkdir $WT_ROOT/lib
export WT_ROOT BUILD_DIR ZLIB_ROOT SSL_ROOT BOOST_CFG BOOST_COMPILER BOOST_ROOT BOOST_VERSION FCGI_ROOT PATH LD_LIBRARY_PATH
download sources to $BUILD_DIR as example with wget¶
cd $BUILD_DIR
wget http://www.zlib.net/zlib-1.2.3.tar.gz
wget http://www.openssl.org/source/openssl-0.9.8k.tar.gz
wget http://switch.dl.sourceforge.net/sourceforge/boost/boost-jam-3.1.17.tgz
wget http://switch.dl.sourceforge.net/sourceforge/boost/boost_1_39_0.tar.gz
wget http://ftp.de.debian.org/debian/pool/main/libf/libfcgi/libfcgi_2.4.0.orig.tar.gz
wget http://ftp.de.debian.org/debian/pool/main/libf/libfcgi/libfcgi_2.4.0-7.diff.gz
wget http://switch.dl.sourceforge.net/sourceforge/witty/wt-2.2.4.tar.gz
build libs¶
zlib¶
cd $BUILD_DIR
gzip -dc zlib-1.2.3.tar.gz | tar xpf -
cd zlib-1.2.3
gmake all install
openssl¶
cd $BUILD_DIR
gzip -dc openssl-0.9.8k.tar.gz | tar xpf -
cd openssl-0.9.8k
./config --prefix=$SSL_ROOT --openssldir=$SSL_ROOT/share/ssl shared threads zlib
gmake all install
bjam¶
cd $BUILD_DIR
gzip -dc boost-jam-3.1.17.tgz | tar xpf -
cd boost-jam-3.1.17
./build.sh sunpro
cp $WT_ROOT/bin
boost¶
cd $BUILD_DIR
gzip -dc boost_1_39_0.tar.gz | tar xpf -
cd boost_1_39_0
echo "import toolset : using ;" >tools/build/v2/user-config.jam
echo "using sun : : CC : <stdlib>sun-stlport <cxxflags>\"-library=stlport4 \
-xcode=pic32 -erroff=wvarhidemem,hidevf,hidevfinvb -errtags=yes\" <linkflags>\"-library=stlport4 \
-xcode=pic32\" ;" >> tools/build/v2/user-config.jam
gpatch boost/thread/detail/thread.hpp <<EOF
107c107
< private:
---
> public:
108a109,110
> private:
> // need to be public: thread(thread&);
EOF
bjam install -d2 --prefix=$BOOST_ROOT \
toolset=sun stdlib=sun-stlport \
variant=release,debug threading=multi link=shared \
-sNO_COMPRESSION=0 -sNO_BZIP2=1 -sNO_ZLIB=0 \
-sZLIB_INCLUDE=$ZLIB_ROOT/include -sZLIB_LIBPATH=$ZLIB_ROOT/lib -sZLIB_BINARY=z
fcgi¶
To build fcgi we use sources and patches from debian http://packages.debian.org/stable/libfcgi-dev, which is working well.
The orginal source file from http://www.fastcgi.com/dist will not build on solaris.
cd $BUILD_DIR
gzip -dc libfcgi_2.4.0.orig.tar.gz | tar xpf -
mv libfcgi-2.4.0.orig libfcgi-2.4.0
cd libfcgi-2.4.0
gzip -dc ../libfcgi_2.4.0-7.diff.gz | gpatch -p1
CXXFLAGS=-library=stlport4 ./configure --prefix=$WT_ROOT --disable-static
gmake all install
wt¶
cd $BUILD_DIR
gzip -dc wt-2.2.4.tar.gz | tar xpf -
cd wt-2.2.4
gpatch -p1 <<EOF
diff -Nurp wt-2.2.4.org/src/Wt/WAbstractItemModel.C wt-2.2.4/src/Wt/WAbstractItemModel.C
--- wt-2.2.4.org/src/Wt/WAbstractItemModel.C 2009-03-04 12:00:30.000000000 +0100
+++ wt-2.2.4/src/Wt/WAbstractItemModel.C 2009-05-03 14:22:46.993329000 +0200
@@ -4,6 +4,7 @@
* See the LICENSE file for terms of use.
*/
+#include <stdio.h>
#include <boost/lexical_cast.hpp>
#include <boost/algorithm/string/predicate.hpp>
diff -Nurp wt-2.2.4.org/src/Wt/WModelIndex.C wt-2.2.4/src/Wt/WModelIndex.C
--- wt-2.2.4.org/src/Wt/WModelIndex.C 2009-03-04 12:00:30.000000000 +0100
+++ wt-2.2.4/src/Wt/WModelIndex.C 2009-05-03 14:48:04.304612000 +0200
@@ -3,6 +3,7 @@
*
* See the LICENSE file for terms of use.
*/
+#include <string.h>
#include <iostream>
#include "Wt/WModelIndex"
diff -Nurp wt-2.2.4.org/src/http/WServer.C wt-2.2.4/src/http/WServer.C
--- wt-2.2.4.org/src/http/WServer.C 2009-03-04 12:00:30.000000000 +0100
+++ wt-2.2.4/src/http/WServer.C 2009-05-03 17:26:09.978681000 +0200
@@ -11,6 +11,9 @@
#include <string>
#if !defined(_WIN32)
+#ifdef __SUNPRO_CC
+# define _POSIX_PTHREAD_SEMANTICS
+#endif
#include <signal.h>
#include <sys/types.h>
#include <sys/wait.h>
EOF
mkdir build
cd build
cmake \
-DCMAKE_CXX_FLAGS:STRING=-library=stlport4 \
-DCMAKE_EXE_LINKER_FLAGS:STRING=-library=stlport4 \
-DCMAKE_MODULE_LINKER_FLAGS:STRING=-library=stlport4 \
-DCMAKE_SHARED_LINKER_FLAGS:STRING=-library=stlport4 \
-DBOOST_COMPILER=$BOOST_COMPILER \
-DBOOST_DIR=$BOOST_ROOT \
-DBOOST_VERSION=$BOOST_VERSION \
-DCMAKE_INSTALL_PREFIX=$WT_ROOT \
-DCMAKE_VERBOSE_MAKEFILE=TRUE \
-DCONFIGDIR=$WT_ROOT/etc \
-DCONFIGURATION=$WT_ROOT/etc/wt_config.xml \
-DCONNECTOR_FCGI=ON \
-DCONNECTOR_HTTP=ON \
-DDEPLOYROOT=$WT_ROOT/deploy \
-DEXAMPLES_CONNECTOR=wtfcgi \
-DFCGIPP_LIB=$FCGI_ROOT/lib/libfcgi++.so \
-DFCGI_INCLUDE_DIR=$FCGI_ROOT/include \
-DFCGI_LIB=$FCGI_ROOT/lib/libfcgi.so \
-DMULTI_THREADED=ON \
-DRUNDIR=$WT_ROOT/run \
-DUSERLIB_ROOT=$WT_ROOT/lib \
-DSSL_INCLUDE_DIRS=$SSL_ROOT/include \
-DSSL_LIB=$SSL_ROOT/lib/libssl.so \
-DZLIB_INCLUDE=$ZLIB_ROOT/include \
-DZLIB_LIB=$ZLIB_ROOT/lib/libz.so \
-DWTHTTP_CONFIGURATION=$WT_ROOT/etc ..
gmake
gmake -C examples
gmake install
thanks Koen Deforche for the CMAKE_CXX_FLAGS help: http://sourceforge.net/mailarchive/message.php?msg_name=205a79980904172331u167bd2derc0f56d85954a0165%40mail.gmail.com
Updated by Wim Dumon over 13 years ago ยท 10 revisions