4 if [ -n "`which swig 2>/dev/null`" ]; then
5 ver=`swig -version 2>&1`
6 ver=`echo $ver | awk '{print $3}' | grep "1.3.17"`
7 if [ -n "$ver" ] ; then
16 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
17 #$DELIM ${PRODUCT_TYPE} $DELIM
18 export SWIG_ROOT=\${INSTALL_ROOT}/${PRODUCT}
19 export PATH=\${SWIG_ROOT}/bin:\${PATH}
20 export LD_LIBRARY_PATH=\${SWIG_ROOT}/lib:\${LD_LIBRARY_PATH}
23 (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
24 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
27 # looks for the native product and collects it's environment (used by make_env())
29 swig_root="`find_in_path swig ${PATH}`"
30 if [ -z "${swig_root}" ] ; then
31 swig_root="`find_in_path swig /usr/bin`"
33 if [ -n "${swig_root}" ] ; then
34 swig_root=`cd ${swig_root}/..; pwd`
35 ver=`${swig_root}/bin/swig -version 2>&1`
36 ver=`echo $ver | awk '{print $3}' | grep "1.3.17"`
37 if [ -n "$ver" ] ; then
38 tmp="\${SWIG_ROOT}/bin ${swig_root}/bin \${PATH} ${PATH}";
39 path=`sort_path ${tmp}`
40 tmp="\${SWIG_ROOT}/lib ${swig_root}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";
41 ld_library_path=`sort_path ${tmp}`
42 cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
43 #$DELIM ${PRODUCT_TYPE} $DELIM
44 export SWIG_ROOT=${swig_root}
46 export LD_LIBRARY_PATH=${ld_library_path}
49 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
57 try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
63 make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
64 source ${INSTALL_WORK}/$SHRC
66 check_jb tar xfz ${SOURCE_DIR}/swig-1.3.17.tar.gz -C ${INSTALL_WORK}
68 makedir ${PRODUCT_DIR}
69 check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
70 ./configure --prefix=${PRODUCT_DIR}
72 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
75 check_job ${PRODUCT_DIR}/MAKE.LOG make
76 check_job ${PRODUCT_DIR}/MAKINSTALL.LOG make install
78 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
79 cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
85 echo "It impossible to install SWIG from binaries, try install from sources."
90 export INSTALL_WORK=$2;
92 export INSTALL_ROOT=$4;
93 export PRODUCT_SEQUENCE=$5;
94 if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="swig" ; fi
95 export PRODUCT="SWIG-1.3.17"
96 export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
97 export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}