#!/bin/sh # # The following environment variables should be set. # # OMNIORB_SRC (= http://.....) # PYTHON_DIR (= /cygdrive/c/Python27) # VC_VERSION (= 10) # ARCH (= win32, win64) # export PATH=/cygdrive/c/cygwin64/bin:$PATH echo `pwd` check_env() { echo "preset OMNIORB_SRC: " $OMNIORB_SRC echo "preset ARCH: " $ARCH OMNIORB_SRC=`echo $OMNIORB_SRC | sed 's/\"//g'` if test "x$OMNIORB_SRC" = "x" ; then OMNIORB_SRC="http://cznic.dl.sourceforge.net/project/omniorb/omniORB/omniORB-4.1.7/omniORB-4.1.7.tar.bz2" fi OMNIORB_TAR=`basename $OMNIORB_SRC` OMNIORB_DIR=`basename $OMNIORB_SRC .tar.bz2` if test "x$PYTHON_DIR" = "x" ; then if test "x$ARCH" = "xx86" ;then PYTHON_DIR="/cygdrive/c/Python27" elif test "x$ARCH" = "xx86_64" ;then PYTHON_DIR="/cygdrive/c/Python27_x64" else echo "ARCH not defined" exit -1 fi fi if test "x$VC_VERSION" = "x" ; then VC_VERSION="10" fi if test "x$ARCH" = "xx86" ;then WIN_ARCH="win32" elif test "x$ARCH" = "xx86_64" ;then WIN_ARCH="win64" else echo "ARCH not defined" exit -1 fi } setup_omnisrc() { # getting omniORB-4.1.7.tar.bz2 if test ! -f $OMNIORB_TAR ; then wget $OMNIORB_SRC fi tar xjf $OMNIORB_TAR TOOL_PATH=`pwd`/bin/x86_win32 export PATH=$TOOL_PATH:$PATH cd $OMNIORB_DIR } update_configmk() { # ex. x86_win32_vc_10 PLATFORM=x86_${WIN_ARCH}_vs_${VC_VERSION} TMP=`grep '^platform =' config/config.mk` if test "x$TMP" = "x"; then mv config/config.mk config/config.mk.tmp echo "platform = $PLATFORM" > config/config.mk cat config/config.mk.tmp >> config/config.mk rm config/config.mk.tmp fi } update_platformmk() { PLATFORM=x86_${WIN_ARCH}_vs_${VC_VERSION} PF_DIR=mk/platforms if test ${VC_VERSION} -gt 10; then # currently omniORB has mk file up to for vc10 cp $PF_DIR/x86_win32_vs_10.mk $PF_DIR/x86_win32_vs_${VC_VERSION}.mk fi if test "x$WIN_ARCH" = "xwin64" ; then ORG_MK=x86_win32_vs_${VC_VERSION}.mk TGT_MK=${PLATFORM}.mk cp $PF_DIR/$ORG_MK $PF_DIR/$TGT_MK sed -i 's/ -DEBUG/ -DEBUG -MACHINE:X64/g' $PF_DIR/$TGT_MK sed -i 's/ -MT/ -MD/g' $PF_DIR/$TGT_MK fi echo "PYTHON = ${PYTHON_DIR}/python" >> $PF_DIR/${PLATFORM}.mk } update_dirmk() { if test $VC_VERSION -gt 10; then sed -i 's/rebase.exe -b 0x68000000 -d/editbin.exe \/REBASE\[:\[BASE=0x68000000\]\[,DOWN\]\]/g' src/lib/dir.mk fi } check_env setup_omnisrc update_configmk update_platformmk update_dirmk