ads

How to compile minisip for windows

search

Google

Wednesday, December 5, 2007

minisip compilation for linux

this script has the complete solution or step by step solutions compilation of minisip on linux. please read the script care fully and don't run the script beside runnig the script follow the steps given in script..

#/bin/sh

echo "Exporting some system variables needed"

export LD_LIBRARY_PATH=/usr/local/lib/

export PKG_CONFIG_PATH=/usr/lib/pkgconfig:/usr/local/lib/pkgconfig

echo "Installing Initial Dependencies"

cd dependencies

echo "Installing cairo"

tar xvfz cairo*.tar.gz

cd cairo*

./configure --prefix=/usr

make

make install

cd ..

echo "DONE WITH CAIRO"

echo "Installing jpeg"

tar xvfz jpegsrc*.tar.gz

cd jpeg-*

./configure --prefix=/usr

make

make install

cd ..

echo "DONE WITH JPEG"

echo "Installing tiff"

tar xvfz tiff-*.tar.gz

cd tiff-*

./configure --prefix=/usr

make

make install

cd ..

echo "DONE WITH TIFF"

echo "Installing pkg-config"

tar xvfz pkg-config*.tar.gz

cd pkg-config*

./configure --prefix=/usr

make

make install

cd ..

echo "DONE WITH PKG-CONFIG"

echo "Installing pango"

tar xvfz pango*.tar.gz

cd pango*

./configure --prefix=/usr

make

make install

cd ..

echo "DONE WITH PANGO"

echo "Installing atk"

tar xvfz atk*.tar.gz

cd atk*

./configure --prefix=/usr

make

make install

cd ..

echo "DONE WITH ATK"

echo "Installing glib-"

tar xvfz glib-*.tar.gz

cd glib-*

./configure --prefix=/usr

make

make install

cd ..

echo "DONE WITH GLIB"

echo "Installing libsigc"

tar xvfz libsigc*.tar.gz

cd libsigc*

./configure --prefix=/usr

make

make install

cd ..

echo "DONE WITH libsigc"

echo "Installing gtk+"

tar xvfz gtk+*.tar.gz

cd gtk+*

./configure --prefix=/usr

make

make install

cd ..

echo "DONE WITH gtk+"

echo "Installing glibmm-"

tar xvfz glibmm-*.tar.gz

cd glibmm-*

./configure --prefix=/usr

make

make install

cd ..

echo "DONE WITH glibmm-"

echo "Installing gtkmm-"

tar xvfz gtkmm-*.tar.gz

cd gtkmm-*

./configure --prefix=/usr

make

make install

cd ..

echo "DONE WITH gtkmm-"

echo "Installing libglademm"

tar xvfz libglademm-*.tar.gz

cd libglademm-*

./configure --prefix=/usr

make

make install

cd ..

echo "DONE WITH libglademm"

echo "DONE WITH DEPENDENCIES"

echo "Installing minisip libraries"

cd ..

cd minisip

echo "Installing libmutil-"

tar xvfz libmutil-*.tar.tar

cd libmutil-*

./configure --prefix=/usr

make

make install

cd ..

echo "DONE WITH libmutil-"

echo "Installing libmnetutil-"

tar xvfz libmnetutil-*.tar.tar

cd libmnetutil-*

./configure --prefix=/usr

make

make install

cd ..

echo "DONE WITH libmnetutil-"

echo "Installing libmikey-"

tar xvfz libmikey-*.tar.tar

cd libmikey-*

./configure --prefix=/usr

make

make install

cd ..

echo "DONE WITH libmikey-"

echo "Installing libmsip-"

tar xvfz libmsip-*.tar.tar

cd libmsip-*

./configure --prefix=/usr

make

make install

cd ..

echo "DONE WITH libmsip-"

echo "Done installing minisip libraries"

echo "Installing minisip"

tar xvfz minisip*.tar.tar

cd minisip*

./configure --prefix=/usr

make

make install

cd ..

echo "DONE WITH minisip"

echo '/usr/local/lib' >> /etc/ld.so.conf

echo "export LD_PRELOAD=\"/lib/libc.so.6 /lib/libpthread-0.10.so\"" > ~/runminisip

echo 'minisip' >> ~/runminisip

chmod 755 ~/runminisip

echo "DONE"

Wednesday, November 21, 2007

Cross Compilation of Minisip

Tools:
1. A debian box(kubuntu recommended) and upgrade fully this debian box.
2. Mingw32 : Minimalist GNU win32 (cross) compiler ( latest version)
3. Openssl minimum 0.9.8a
4. Gtk and gtkmm for windows both runtime and devel (latest version)
5. Directx Header : download from http://alleg.sourceforge.net/files/dx80_mgw.zip
6. A cross compiler folder on debian box ( i use /usr/local/cross as a CCF)

Step 1: Preparation of CCF(Cross Compiler Folder)
1. Install gtk and gtkmm on windows and install both in a same folder say c:/GTK. Now copy all the stuff of c:/GTK in CCF
2. unzip the dx80_mgw.zip and after unzippinf two folder appears copy these two folder in CCF and CCF/include/directx.

Step 2 : Openssl Now untar the openssl
--> tar xvzf opes*.tar.gz
after that copy openssl mingw patch into openssl directory u can find patch into minisip source code directory ~minisip/documentation/cross-compile/windows_mingw32/patch-openssl-0.9.8a-mingwx-mikma.diff After copying this patch apply this
--> patch -p1 < patch-op*.diff
Now set CROSS_COMPILE_FOLDER path( exportCROSS_COMPILE_FOLDE=/usr/local/cross) Now configure and build openssl
./Configure --prefix=$CROSS_COMPILE_FOLDER threads shared mingwx
make && make install
After this stay in this folder run the following command one by one
cp libeay32.lib.a $CROSS_COMPILE_FOLDER/lib/libcrypto.a
cp libeay32.dll $CROSS_COMPILE_FOLDER/lib/libcrypto.dll
cp libeay32.dll $CROSS_COMPILE_FOLDER/lib/libcrypto.dll.a
cp ssleay32.lib.a $CROSS_COMPILE_FOLDER/lib/libssl.a
cp ssleay32.dll $CROSS_COMPILE_FOLDER/lib/libssl.dll
cp ssleay32.dll $CROSS_COMPILE_FOLDER/lib/libssl.dll.a

Step 3 : pkg-config ( don't ask me when this script is use but this step is useful sometime) Run the following script
cat <<> /usr/local/bin/i586-mingw32msvc-pkg-config
#!/bin/sh oldprefix=/target prefix=$CROSS_COMPILE_FOLDER output=`PKG_CONFIG_LIBDIR=${prefix}/lib/pkgconfig "$@"` result=$? echo -n ${output} sed -e "s-\([IL]\)${oldprefix}\-\1${prefix}g" exit $result EOF

Step 4 : building minisip
to build the minisip following step are used(let say ur minisip source code is on Desktop so go to ur Desktop)
1. cd minisip
2. cd libmutil
3. dos2unix *
4. vi bootstrap (change the libtoolize line in the end of line add one more parameter "--foreign")5. ./bootstrap
6. ./configure CONFIGURE PARAMETERS
7. make && make install
8. echo $CROSS_COMPILE_FOLDER/share/aclocal >> /usr/share/aclocal/dirlist
9. echo $CROSS_COMPILE_FOLDER/share/aclocal >> /usr/share/aclocal/dirlist
10. export PKG_CONFIG_PATH=/usr/local/cross/lib/pkg*
11. cd .. Now follow step 2 to step 7 for all lib* folder and minisip folder only diffrence is that of CONFIGURE PARAMETERS here are the CONFIGURE PARAMETERS

CONFIGURE PARAMETERS
1.default parameters are:
./configure --host=i586-mingw32msvc --build=i686-pc-linux-gnu --disable-static --enable-debug prefix=$CROSS_COMPILE_FOLDER CPPFLAGS=-I$CROSS_COMPILE_FOLDER/include LDFLAGS=-L$CROSS_COMPILE_FOLDER/lib
2.special parameters ( add these parameters with default parameters)
a)libmutil : --enable-memdebug
b)libminisip : --enable-dsound --disable-alsa --disable-gconf
c)minisip : --enable-gtk (if u got linking error in the last then add one more parameter --disable-shared)

Alternate way: skip step 4 and run buildall_mingw script in minisip folder. this script generate compiled_files folder.Before run this script set the path of CCF.

Step 5 : Install on windows
Install Gtk+ (runtime is enough, no need for devel).
Install Gtkmm (runtime is enough, no need for devel).
copy compiled_files folder in windows system and copy libeay32.dll and ssleay32.dll in system32. modify c:/document and setting/user name/application data/MinisipOrg/Minisip/minisip.conf

dsound:xyz

change xyz into 0
so this look like this

dsound:0
and run minisip_gtkgui.exe


Here is buildall_mingw script

#! /usr/bin/env bash
#
#This scripts is a modified version of the buildall.script.
#Thi script compiles and install all the minisip libraries and GTK GUI
# for a win32 system.
#Modify the parameters (basically the prefix_*) to adapt to your cross-compile environment.
#It is not really good if you are developing or debugging, as everytime you run the script it
# recompiles ALL the source code.
#This options are added for the w32 compilation ... modify if needed, specially the cross-compile folder
#This is the CROSS_COMPILE_FOLDER
prefix_cross="/usr/local/cross"
prefix_cross_include="$prefix_cross/include"
prefix_cross_lib="$prefix_cross/lib"
host_type_name="i586-mingw32msvc"
host_option="--host=$host_type_name"
build_option="--build=i686-pc-linux-gnu"
strip_bin="i586-mingw32msvc-strip"
#strip_generated_files="yes"
# Simple script to build minisip.
#
# This script needs to be executed at the root of the repository trunk. It
# will build minisip and with all the associated libraries. The build will be
# done "in place", that is, no files will be installed on your system.
#
# Instructions:
# Use buildall.sh script the first time you get the sources of minisip. It will
# create all files needed and compile all the sources.
# Then, if you modify a file in the sources and do not want to recompile all
# MiniSIP again, use the "buildonly.sh" script
# Note that you con modify the configuration of minisip by editing the
# configure_params variable in this script. Some useful options are commented
# out by default, but feel free to use them.
SUBDIRS="${SUBDIRS} libmutil"
SUBDIRS="${SUBDIRS} libmnetutil"
SUBDIRS="${SUBDIRS} libmcrypto"
SUBDIRS="${SUBDIRS} libmikey"
SUBDIRS="${SUBDIRS} libmstun"
SUBDIRS="${SUBDIRS} libmsip"
SUBDIRS="${SUBDIRS} libzrtpcpp"
SUBDIRS="${SUBDIRS} libminisip"
SUBDIRS="${SUBDIRS} minisip"
#If you are debugging, you probably want to build with "g++ -g", to build
#with all debug symbols, useful for coredumps with gdb.
#Comment this line if you don't want to build with debug code
compiler_debug="-ggdb"
#Also useful, you may want to call make with some options ... supply them
#here.
#For example, -k forces make to keep compiling even there are errors in the
# sources. I like this one.
make_options="-k"
#Possible configure commands are shown in: ./configure --help
# check each folder for more details.
#This are common params, usable in all folders
base_configure_params=""
base_configure_params="$base_configure_params --enable-debug"
base_configure_params="$base_configure_params --disable-static"
#base_configure_params="$base_configure_params --disable-shared"
#set special options for libmutil
libmutil_configure_params=""
libmutil_configure_params="$libmutil_configure_params --enable-memdebug"
#set special options for libminisip
# do a ./configure --help to see ALL available options ... here
# show just a sample
libminisip_configure_params=""
libminisip_configure_params="$libminisip_configure_params --enable-dsound"
libminisip_configure_params="$libminisip_configure_params --disable-alsa"
libminisip_configure_params="$libminisip_configure_params --disable-gconf"
#--enable-autocall enables automatic calling for debug purposes (default disabled)
#--enable-ipaq enables various fixes for the iPAQ (default disabled)
#--enable-ipsec-enable enables ipsec features (default disabled)
#--enable-aec enables push-2-talk features (default enabled)
#--enable-video enables video features (default disabled)
#--enable-buzzer enables IPAQ buzzer (default disabled)
#--enable-dsound enables DirectSound sound support (default disabled)
#--enable-portaudio enable PortAudio V19 support (default auto).
#--enable-gconf enables support for GConf (default enabled).
#--enable-sdl enables SDL video output if the required library is found
#--enable-video enables video features (default disabled)
#set special options for minisip
# do a ./configure --help to see ALL available options ... here
# show just a sample
minisip_configure_params=""
minisip_configure_params="$minisip_configure_params --enable-gtk"
minisip_configure_params="$minisip_configure_params --disable-shared"
#minisip_configure_params="$minisip_configure_params --enable-textui"
#Here you could have per gui-specific parameters ...
for subdir in ${SUBDIRS}
do
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
echo "Building ${subdir} ... "
echo "+++++++++++++++++++++++++++++++++++++"
cd ${subdir}
./bootstrap
configure_params="$base_configure_params"
if [ ${subdir} = "libmutil" ]; then
LOC_MUTIL_LIBS=-L$PWD/.libs
#${subdir}.$LIBS_EXTENSION
LOC_MUTIL_CFLAGS=-I$PWD/include
echo libmutil can use special params
configure_params="$configure_params $libmutil_configure_params"
MUTIL_LIBS="$LOC_MUTIL_LIBS -lmutil" \
MUTIL_CFLAGS=$LOC_MUTIL_CFLAGS \
CPPFLAGS="-I$prefix_cross_include " \
CXXFLAGS="-Wall $compiler_debug" \
LDFLAGS="-L$prefix_cross_lib" \
./configure $host_option $build_option prefix=$prefix_cross $configure_params
fi
if [ ${subdir} = "libmnetutil" ]; then
LOC_MNETUTIL_LIBS=-L$PWD/.libs
LOC_MNETUTIL_CFLAGS=-I$PWD/include
MUTIL_LIBS="$LOC_MUTIL_LIBS -lmutil" \
MUTIL_CFLAGS=$LOC_MUTIL_CFLAGS \
CPPFLAGS="-I$prefix_cross_include " \
CXXFLAGS="-Wall $compiler_debug" \
LDFLAGS="-L$prefix_cross_lib" \
./configure $host_option $build_option prefix=$prefix_cross $configure_params
fi
if [ ${subdir} = "libmcrypto" ]; then
LOC_MCRYPTO_LIBS=-L$PWD/.libs
LOC_MCRYPTO_CFLAGS=-I$PWD/include
MUTIL_LIBS="$LOC_MUTIL_LIBS -lmutil" \
MUTIL_CFLAGS=$LOC_MUTIL_CFLAGS \
CPPFLAGS="-I$prefix_cross_include " \
CXXFLAGS="-Wall $compiler_debug" \
LDFLAGS="-L$prefix_cross_lib" \
./configure $host_option $build_option prefix=$prefix_cross $configure_params
fi
if [ ${subdir} = "libmikey" ]; then
LOC_MIKEY_LIBS=-L$PWD/.libs
LOC_MIKEY_CFLAGS=-I$PWD/include
MUTIL_LIBS="$LOC_MUTIL_LIBS -lmutil" \
MUTIL_CFLAGS=$LOC_MUTIL_CFLAGS \
MNETUTIL_LIBS="$LOC_MNETUTIL_LIBS -lmnetutil" \
MNETUTIL_CFLAGS=$LOC_MNETUTIL_CFLAGS \
CPPFLAGS="-I$prefix_cross_include " \
CXXFLAGS="-Wall $compiler_debug" \
LDFLAGS="-L$prefix_cross_lib" \
./configure $host_option $build_option prefix=$prefix_cross $configure_params
fi
if [ ${subdir} = "libmstun" ]; then
LOC_MSTUN_LIBS=-L$PWD/.libs
LOC_MSTUN_CFLAGS=-I$PWD/include
MUTIL_LIBS="$LOC_MUTIL_LIBS -lmutil" \
MUTIL_CFLAGS=$LOC_MUTIL_CFLAGS \
MNETUTIL_LIBS="$LOC_MNETUTIL_LIBS -lmnetutil" \
MNETUTIL_CFLAGS=$LOC_MNETUTIL_CFLAGS \
CPPFLAGS="-I$prefix_cross_include " \
CXXFLAGS="-Wall $compiler_debug" \
LDFLAGS="-L$prefix_cross_lib" \
./configure $host_option $build_option prefix=$prefix_cross $configure_params
fi
if [ ${subdir} = "libmsip" ]; then
LOC_MSIP_LIBS=-L$PWD/.libs
LOC_MSIP_CFLAGS=-I$PWD/include
MUTIL_LIBS="$LOC_MUTIL_LIBS -lmutil" \
MUTIL_CFLAGS=$LOC_MUTIL_CFLAGS \
MNETUTIL_LIBS="$LOC_MNETUTIL_LIBS -lmnetutil" \
MNETUTIL_CFLAGS=$LOC_MNETUTIL_CFLAGS \
CPPFLAGS="-I$prefix_cross_include " \
CXXFLAGS="-Wall $compiler_debug" \
LDFLAGS="-L$prefix_cross_lib" \
./configure $host_option $build_option prefix=$prefix_cross $configure_params
fi
if [ ${subdir} = "libzrtpcpp" ]; then
LOC_ZRTPCPP_LIBS=-L$PWD/.libs
LOC_ZRTPCPP_CFLAGS=-I$PWD/include
MUTIL_LIBS="$LOC_MUTIL_LIBS -lmutil" \
MUTIL_CFLAGS=$LOC_MUTIL_CFLAGS \
MNETUTIL_LIBS="$LOC_MNETUTIL_LIBS -lmnetutil" \
MNETUTIL_CFLAGS=$LOC_MNETUTIL_CFLAGS \
CPPFLAGS="-I$prefix_cross_include " \
CXXFLAGS="-Wall $compiler_debug" \
LDFLAGS="-L$prefix_cross_lib" \
./configure $host_option $build_option prefix=$prefix_cross $configure_params
fi
if [ ${subdir} = "libminisip" ] ; then
LOC_LIBMINISIP_LIBS=-L$PWD/.libs
LOC_LIBMINISIP_CFLAGS=-I$PWD/include
configure_params_libminisip="$configure_params $libminisip_configure_params"
echo libminisip can also have special config params
configure_params="$configure_params $minisip_configure_params"
MUTIL_LIBS="$LOC_MUTIL_LIBS -lmutil" \
MUTIL_CFLAGS=$LOC_MUTIL_CFLAGS \
MNETUTIL_LIBS="$LOC_MNETUTIL_LIBS -lmnetutil" \
MNETUTIL_CFLAGS=$LOC_MNETUTIL_CFLAGS \
MIKEY_LIBS="$LOC_MIKEY_LIBS -lmikey" \
MIKEY_CFLAGS=$LOC_MIKEY_CFLAGS \
MSIP_LIBS="$LOC_MSIP_LIBS -lmsip" \
MSIP_CFLAGS=$LOC_MSIP_CFLAGS \
CPPFLAGS="-I$prefix_cross_include " \
CXXFLAGS="-Wall $compiler_debug" \
LDFLAGS="-L$prefix_cross_lib" \
./configure $host_option $build_option prefix=$prefix_cross $configure_params_libminisip
fi
if [ ${subdir} = "minisip" ]; then
echo minisip can also have special config params
configure_params_minisip="$configure_params $minisip_configure_params"
MUTIL_LIBS="$LOC_MUTIL_LIBS -lmutil" \
MUTIL_CFLAGS=$LOC_MUTIL_CFLAGS \
MNETUTIL_LIBS="$LOC_MNETUTIL_LIBS -lmnetutil" \
MNETUTIL_CFLAGS=$LOC_MNETUTIL_CFLAGS \
MIKEY_LIBS="$LOC_MIKEY_LIBS -lmikey" \
MIKEY_CFLAGS=$LOC_MIKEY_CFLAGS \
MSIP_LIBS="$LOC_MSIP_LIBS -lmsip" \
MSIP_CFLAGS=$LOC_MSIP_CFLAGS \
LIBMINISIP_LIBS="$LOC_LIBMINISIP_LIBS -lminisip" \
LIBMINISIP_CFLAGS=$LOC_LIBMINISIP_CFLAGS \
CPPFLAGS="-I$prefix_cross_include " \
CXXFLAGS="-Wall $compiler_debug" \
LDFLAGS="-L$prefix_cross_lib" \
./configure $host_option $build_option prefix=$prefix_cross $configure_params_minisip
fi
echo "=========================================================="
echo "configure_params (${subdir})= $configure_params"
echo "=========================================================="
make clean
make
make install
export PKG_CONFIG_PATH=$prefix_cross/lib/pkgconfig/
echo $prefix_cross/share/aclocal >> /usr/share/aclocal/dirlist
echo $prefix_cross/share/aclocal >> /usr/local/share/aclocal/dirlist
cd ..
done
mkdir -p compiled_files
mkdir -p compiled_files/bin
mkdir -p compiled_files/lib
mkdir -p compiled_files/share
mkdir -p compiled_files/share/minisip
mkdir -p compiled_files/lib/libminisip
mkdir -p compiled_files/lib/libminisip/plugins
tmp_lib="libmutil"
cp -f $tmp_lib/.libs/$tmp_lib-0.dll compiled_files/bin
tmp_lib="libmnetutil"
cp -f $tmp_lib/.libs/$tmp_lib-0.dll compiled_files/bin
tmp_lib="libmcrypto"
cp -f $tmp_lib/.libs/$tmp_lib-0.dll compiled_files/bin
tmp_lib="libmikey"
cp -f $tmp_lib/.libs/$tmp_lib-0.dll compiled_files/bin
tmp_lib="libzrtpcpp"
cp -f $tmp_lib/.libs/$tmp_lib-0.dll compiled_files/bin
tmp_lib="libmsip"
cp -f $tmp_lib/.libs/$tmp_lib-0.dll compiled_files/bin
tmp_lib="libmstun"
cp -f $tmp_lib/.libs/$tmp_lib-0.dll compiled_files/bin
tmp_lib="libminisip"
cp -f $tmp_lib/.libs/$tmp_lib-0.dll compiled_files/bin
cp -f $tmp_lib/.libs/mdsound.dll compiled_files/lib/libminisip/plugins
cp -f $tmp_lib/.libs/mdsound.la compiled_files/lib/libminisip/plugins
cp -f minisip/minisip/gui/gtkgui/minisip_gtkgui.exe compiled_files/bin
cp -f $prefix_cross/lib/libcrypto.dll compiled_files/bin/libeay32.dll
cp -f $prefix_cross/lib/libssl.dll compiled_files/bin/ssleay32.dll
cp -f $prefix_cross/share/minisip/* compiled_files/share/minisip
#find minisip/ -name minisip_gtkgui.exe -size +200k -exec cp -f {} compilied_files/ \;
# echo 3
#find minisip/ -name minisip_textui.exe -size +200k -exec cp -f {} compilied_files/ \;
$strip_bin -R compiled_files/*