Salome HOME
Fix CASCADE compilation problem
[tools/install.git] / config_files / Python-2.3.4.sh
index b0ac8802095d33612513b926f280d2fdcd7aee31..f3e02be46e3f10cc3dadb176465b5d14155e54ee 100755 (executable)
@@ -1,4 +1,16 @@
-#!/bin/sh
+#!/bin/bash -noprofile
+
+####################################################################################
+#  File      : Python-2.3.4.sh
+#  Created   : Thu Dec 18 12:01:00 2002
+#  Author    : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
+#  Project   : SALOME
+#  Module    : Installation Wizard
+#  Copyright : 2002-2006 CEA
+#
+#  This script is the part of the SALOME installation procedure.
+#
+####################################################################################
 
 check_version()
 {
@@ -99,12 +111,9 @@ cd ${PRODUCT_WORK}
 
 check_job ${PRODUCT_DIR}/CONFIGURE.LOG \
     ./configure --prefix=${PRODUCT_DIR} --with-threads --with-cxx=`which g++` --enable-shared
-# vsr: not compiled on RedHat8.0 without libstdc++.so
-sed -e 's%LIBS=                -ldl  -lpthread -lutil%LIBS=            -ldl  -lpthread -lutil -lstdc++%g' Makefile > _Makefile
+# vsr: force linking to libstdc++.so
+sed -e 's%\(^LIBS=.*\)%\1 -lstdc++%g' Makefile > _Makefile
 mv -f _Makefile Makefile
-# vsr: socket module is not compiled on RedHat9 because of absent KERBEROS include/libs flags
-sed -e "s%\[('USE_SSL',1)\]%\[('USE_SSL',1),('OPENSSL_NO_KRB5',None)\]%g" setup.py > _setup.py
-mv -f _setup.py setup.py
 GCC=`which gcc`
 cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
 used gcc=$GCC
@@ -112,13 +121,16 @@ EOF
 
 check_job ${PRODUCT_DIR}/MAKE.LOG make 
 check_job ${PRODUCT_DIR}/MAKINSTALL.LOG make install
-(cd ${PRODUCT_DIR}/lib/python2.3/config; ln -s ../../libpython2.3.so.1.0 libpython2.3.so)
+(cd ${PRODUCT_DIR}/lib/python2.3/config; ln -fs ../../libpython2.3.so.1.0 libpython2.3.so)
 
 cd ${PRODUCT_DIR}/bin
-sed -e "s%#\!.*python%#\!/usr/bin/env python%" pydoc > _pydoc
-mv -f _pydoc pydoc
-chmod a+x pydoc
-
+for sc in idle pydoc smtpd.py ; do
+    if [ -e $sc ] ; then
+       sed -e "s%#\!.*python%#\!/usr/bin/env python%" "$sc" > _"$sc"
+       mv -f _"$sc" "$sc"
+       chmod a+x "$sc"
+    fi
+done
 #du -sk ${PRODUCT_WORK} > ${PRODUCT_DIR}/size.log
 cd ${PRODUCT_DIR}; rm -fr ${PRODUCT_WORK}
 print_env
@@ -131,10 +143,16 @@ source ${INSTALL_WORK}/$SHRC
 
 check_jb tar xfz ${SOURCE_DIR}/Python-2.3.4.tar.gz -C ${INSTALL_ROOT}
 
+(cd ${PRODUCT_DIR}/lib/python2.3/config; ln -fs ../../libpython2.3.so.1.0 libpython2.3.so)
+
 cd ${PRODUCT_DIR}/bin
-sed -e "s%#\!.*python%#\!/usr/bin/env python%" pydoc > _pydoc
-mv -f _pydoc pydoc
-chmod a+x pydoc
+for sc in idle pydoc smtpd.py ; do
+    if [ -e $sc ] ; then
+       sed -e "s%#\!.*python%#\!/usr/bin/env python%" "$sc" > _"$sc"
+       mv -f _"$sc" "$sc"
+       chmod a+x "$sc"
+    fi
+done
 
 print_env
 }