]> SALOME platform Git repositories - tools/install.git/commitdiff
Salome HOME
Initial version
authoradmin <salome-admin@opencascade.com>
Thu, 11 Mar 2004 07:58:05 +0000 (07:58 +0000)
committeradmin <salome-admin@opencascade.com>
Thu, 11 Mar 2004 07:58:05 +0000 (07:58 +0000)
config_files/SWIG-1.3.17.sh [new file with mode: 0755]

diff --git a/config_files/SWIG-1.3.17.sh b/config_files/SWIG-1.3.17.sh
new file mode 100755 (executable)
index 0000000..4b6a366
--- /dev/null
@@ -0,0 +1,98 @@
+#!/bin/sh
+
+check_version(){
+if [ -n "`which swig 2>/dev/null`" ]; then
+    ver=`swig -version 2>&1`
+    ver=`echo $ver | awk '{print $3}' | grep "1.3.17"`
+    if [ -n "$ver" ] ;  then 
+       return 0;
+    fi
+fi
+return 1;
+}
+
+print_env()
+{
+cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
+#$DELIM ${PRODUCT_TYPE} $DELIM 
+export SWIG_ROOT=\${INSTALL_ROOT}/${PRODUCT}
+export PATH=\${SWIG_ROOT}/bin:\${PATH}
+export LD_LIBRARY_PATH=\${SWIG_ROOT}/lib:\${LD_LIBRARY_PATH}
+##
+EOF
+(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+}
+
+# looks for the native product and collects it's environment (used by make_env())
+try_native(){
+swig_root="`find_in_path swig ${PATH}`"
+if [ -z "${swig_root}" ] ; then
+    swig_root="`find_in_path swig /usr/bin`"
+fi
+if [ -n "${swig_root}" ] ; then
+    swig_root=`cd ${swig_root}/..; pwd`
+    ver=`${swig_root}/bin/swig -version 2>&1`
+    ver=`echo $ver | awk '{print $3}' | grep "1.3.17"`
+    if [ -n "$ver" ] ;  then 
+       tmp="\${SWIG_ROOT}/bin ${swig_root}/bin \${PATH} ${PATH}";
+       path=`sort_path ${tmp}`
+       tmp="\${SWIG_ROOT}/lib ${swig_root}/lib \${LD_LIBRARY_PATH} ${LD_LIBRARY_PATH}";  
+       ld_library_path=`sort_path ${tmp}`
+       cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF 
+#$DELIM ${PRODUCT_TYPE} $DELIM 
+export SWIG_ROOT=${swig_root}
+export PATH=${path}
+export LD_LIBRARY_PATH=${ld_library_path}
+##
+EOF
+       make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}"
+       return 0;
+    fi
+fi
+return 1
+}
+
+try_preinstalled(){
+try_existing ${PRODUCT_DIR} ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+return $?
+}
+
+install_source()
+{
+make_env ${INSTALL_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" ${PRODUCT_TYPE}
+source ${INSTALL_WORK}/$SHRC
+
+check_jb tar xfz ${SOURCE_DIR}/swig-1.3.17.tar.gz -C ${INSTALL_WORK}
+cd ${PRODUCT_WORK}
+makedir ${PRODUCT_DIR}
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
+  ./configure --prefix=${PRODUCT_DIR} 
+GCC=`which gcc`
+cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
+used gcc=$GCC
+EOF
+check_job ${PRODUCT_DIR}/MAKE.LOG make
+check_job ${PRODUCT_DIR}/MAKINSTALL.LOG make install 
+
+rm -fr ${PRODUCT_WORK}
+print_env
+}
+
+install_binary()
+{
+echo "It impossible to install SWIG from binaries, try install from sources."
+return 1
+}
+
+export PROCEDURE=$1;
+export INSTALL_WORK=$2;
+export SOURCE_DIR=$3;
+export INSTALL_ROOT=$4;
+export PRODUCT_SEQUENCE=$5;
+if [ $# == 6 ] ; then export PRODUCT_TYPE=$6 ; else export PRODUCT_TYPE="swig" ; fi
+export PRODUCT="SWIG-1.3.17"
+export PRODUCT_DIR=${INSTALL_ROOT}/${PRODUCT}
+export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
+source ./common.sh
+$PROCEDURE
\ No newline at end of file