# build sources
test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
cd ${PRODUCT_SRC_DIR}
-cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
--------------------
-Build configure...
--------------------
-EOF
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./build_configure
-cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+
+check_job ${PRODUCT_DIR}/BUILD_CONFIGURE.LOG ./build_configure
+local CONFIGURE_OPTIONS="--prefix=${PRODUCT_DIR}"
+cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
-------------------
-Configure...
+Used options: ${CONFIGURE_OPTIONS}
-------------------
EOF
-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}/CONFIGURE.LOG ./configure ${CONFIGURE_OPTIONS}
check_job ${PRODUCT_DIR}/MAKE.LOG make
-
check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
#du -sk ${PRODUCT_SRC_DIR} > ${PRODUCT_DIR}/size.log
-cd ${PRODUCT_DIR};
+cd ${PRODUCT_DIR}
# remove sources and temporary files after building
if [ ${REMOVE_SRC_TMP} = "TRUE" ] ; then
# build_configure
-echo " +++++++++++ build_configure"
-
check_job ${PRODUCT_DIR}/BUILD_CONFIGURE.LOG ./build_configure
# configure
-echo " +++++++++++ configure"
-
-flags=""
+flags="--prefix=${PRODUCT_DIR}"
# ... tcl/tk options
if [ "${TCLHOME}" != "" ] ; then
# other options
flags="${flags} --disable-debug --enable-production"
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR} ${flags}
+cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${flags}
+-------------------
+EOF
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure ${flags}
# make
-echo " +++++++++++ make"
-
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
-EOF
check_job ${PRODUCT_DIR}/MAKE.LOG make -j4 install
# fix libGL dependencies
-echo " +++++++++++ fix libGL dependencies"
+
( cd ${PRODUCT_DIR}/lib && fix_gl_libs )
cd ${PRODUCT_DIR}
local patch_missing_headers=1
local patch_python_threads=0 # included to diff patch
local patch_vtk_math=0 # not needed for pv4.1
+local patch_kwprocess=1
# patch: apply general sources patch if present
if [ "${patch_sources}" = "1" ] ; then
( test -f patches/vtkMath.h.patch && cp patches/vtkMath.h.patch ${PRODUCT_SRC_DIR}/VTK/Common/Core && cd ${PRODUCT_SRC_DIR}/VTK/Common/Core && patch -p1 < vtkMath.h.patch )
fi
+# patch: fix long time compilation pb
+if [ "${patch_kwprocess}" = "1" ] ; then
+ sed -i "s%<< \"static const char\* \"%<< \"static const char* const \"%g" ${PRODUCT_SRC_DIR}/Utilities/ProcessXML/ProcessXML.cxx
+fi
+
# to generate environment scripts
try_preinstalled
}
### general compiler settings
#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DVTK_HAVE_GETSOCKNAME_WITH_SOCKLEN_T=1"
-#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER:STRING=`which g++`"
-#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_C_COMPILER:STRING=`which gcc`"
+#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_CXX_COMPILER:STRING=${CXX:-`which g++`}"
+#CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_C_COMPILER:STRING=${CC:-`which gcc`}"
### compiler settings for 64 bit platforms
if test `uname -m` = "x86_64" ; then
python : `which python`
tclsh : `which tclsh`
qmake : `which qmake`
-
-used ParaView configuration options:
-${CMAKE_OPTIONS}
+Used options: ${CMAKE_OPTIONS}
EOF
check_job ${PRODUCT_DIR}/CONFIGURE.LOG cmake ${PRODUCT_SRC_DIR} ${CMAKE_OPTIONS}
# make
-cat > ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=`which gcc`
-EOF
-check_job ${PRODUCT_DIR}/MAKE.LOG make
-# VERBOSE=1
+check_job ${PRODUCT_DIR}/MAKE.LOG make VERBOSE=1 -j4
# make install
-check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
+check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make VERBOSE=1 install
# patch: modify config files properly
if [ "${patch_vtkconfig}" = "1" ] ; then
# configure
PYQT_CONFIGURE_OPTIONS="-b ${PRODUCT_DIR}/bin -d ${PRODUCT_DIR} -v ${PRODUCT_DIR}/sip -p ${PRODUCT_DIR}/plugins --confirm-license"
-
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG python ./configure.py ${PYQT_CONFIGURE_OPTIONS}
-
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
+if [ "${CXX}" != "" ] ; then
+ # custom gcc
+ PYQT_CONFIGURE_OPTIONS="${PYQT_CONFIGURE_OPTIONS} CC=${CC} CXX=${CXX} LINK=${CXX} LINK_SHLIB=${CXX}"
+fi
+
+cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${PYQT_CONFIGURE_OPTIONS}
+-------------------
EOF
+gen_qmake_cache ${PRODUCT_SRC_DIR}
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG python ./configure.py ${PYQT_CONFIGURE_OPTIONS}
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/INSTALL.LOG make install
check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}
PYQT_CONFIGURE_OPTIONS="-b ${PRODUCT_DIR}/bin -d ${PRODUCT_DIR} -v ${PRODUCT_DIR}/sip -p ${PRODUCT_DIR}/plugins --confirm-license"
+if [ "${CXX}" != "" ] ; then
+ PYQT_CONFIGURE_OPTIONS="${PYQT_CONFIGURE_OPTIONS} CC=${CC} CXX=${CXX} LINK=${CXX} LINK_SHLIB=${CXX}"
+fi
# modify pyqtconfig.py file
if [ -n "${PYTHON_ROOT_DIR}" ] && [ -n "${QT4_ROOT_DIR}" ] ; then
cd ${PRODUCT_SRC_DIR}
export PYTHON_ARCHIVE_PREFIX=""
-PYTHON_CONFIGURE_OPTIONS="--with-threads --enable-shared --with-libs=-lstdc++ --without-pymalloc"
+PYTHON_CONFIGURE_OPTIONS="--prefix=${PRODUCT_DIR} --with-threads --enable-shared --with-libs=-lstdc++ --without-pymalloc"
if test `uname -m` = "x86_64" ; then
PYTHON_CONFIGURE_OPTIONS="${PYTHON_CONFIGURE_OPTIONS} CFLAGS=-m64 CXXFLAGS=-m64"
fi
-### --with-pydebug ### (for debug)
-
-TCL_INCDIR=
-TCL_LIBDIR=
+if [ "${FOR_DEBUG}" = "1" ] ; then
+ # to debug Python
+ PYTHON_CONFIGURE_OPTIONS="${PYTHON_CONFIGURE_OPTIONS} --with-pydebug"
+fi
tcl_dir=`where_tcl`
if [ "${tcl_dir}" != "" ] ; then
source ${tcl_dir}/tclConfig.sh
- TCL_INCDIR="${TCL_INCLUDE_SPEC}"
- TCL_LIBDIR="-L${TCL_PACKAGE_PATH}"
+ PYTHON_CONFIGURE_OPTIONS="${PYTHON_CONFIGURE_OPTIONS} CPPFLAGS=${TCL_INCLUDE_SPEC} LDFLAGS=-L${TCL_PACKAGE_PATH}"
fi
-#tk_dir=`where_tk`
-#if [ "${tk_dir}" != "" ] ; then
-# source ${tk_dir}/tkConfig.sh
-# TCL_INCDIR="${TCL_INCDIR} ${TK_INCLUDE_SPEC}"
-# TCL_LIBDIR="${TCL_LIBDIR} -L${TCL_PACKAGE_PATH}"
-#fi
-
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR} ${PYTHON_CONFIGURE_OPTIONS} CPPFLAGS="${TCL_INCDIR}" LDFLAGS="${TCL_LIBDIR}"
-
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
+
+cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${PYTHON_CONFIGURE_OPTIONS}
+-------------------
EOF
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure ${PYTHON_CONFIGURE_OPTIONS}
+
unset PYTHONPATH PYTHONHOME
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/MAKINSTALL.LOG make install
export PYTHONDONTWRITEBYTECODE=
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
+# - install docutils
+
+cd ${PRODUCT_SRC_DIR}/docutils-${VERSION_DOCUTILS}_SRC
+local DOCUTILS_SETUP_OPTIONS="--prefix=${PRODUCT_DIR}"
+cat > ${PRODUCT_DIR}/INSTALL_DOCUTILS.LOG <<EOF
+-------------------
+Used options: ${DOCUTILS_SETUP_OPTIONS}
+-------------------
EOF
-# install docutils
-cd ${PRODUCT_SRC_DIR}/docutils-${VERSION_DOCUTILS}_SRC ; check_job ${PRODUCT_DIR}/MAKE.LOG python ./setup.py install --prefix=${PRODUCT_DIR}
+check_job ${PRODUCT_DIR}/INSTALL_DOCUTILS.LOG python ./setup.py install ${DOCUTILS_SETUP_OPTIONS}
cd ${PRODUCT_DIR}/bin
for f in X `find . -name "*.py" -exec basename {} ";" | awk -F. '{print $1}'` ; do
case ${f} in
esac
done
-# install setuptools
-cd ${PRODUCT_SRC_DIR}/setuptools-${VERSION_SETUPTOOLS}_SRC ; check_job ${PRODUCT_DIR}/MAKE.LOG python ./setup.py install --prefix=${PRODUCT_DIR}
+# - install setuptools
-# install Pygments
-cd ${PRODUCT_SRC_DIR}/Pygments-${VERSION_PYGMENTS}_SRC ; check_job ${PRODUCT_DIR}/MAKE.LOG python ./setup.py install --prefix=${PRODUCT_DIR}
+cd ${PRODUCT_SRC_DIR}/setuptools-${VERSION_SETUPTOOLS}_SRC
+local SETUPTOOLS_SETUP_OPTIONS="--prefix=${PRODUCT_DIR}"
+cat > ${PRODUCT_DIR}/INSTALL_SETUPTOOLS.LOG <<EOF
+-------------------
+Used options: ${SETUPTOOLS_SETUP_OPTIONS}
+-------------------
+EOF
+check_job ${PRODUCT_DIR}/INSTALL_SETUPTOOLS.LOG python ./setup.py install ${SETUPTOOLS_SETUP_OPTIONS}
+
+# - install Pygments
+
+cd ${PRODUCT_SRC_DIR}/Pygments-${VERSION_PYGMENTS}_SRC
+local PYGMENTS_SETUP_OPTIONS="--prefix=${PRODUCT_DIR}"
+cat > ${PRODUCT_DIR}/INSTALL_PYGMENTS.LOG <<EOF
+-------------------
+Used options: ${PYGMENTS_SETUP_OPTIONS}
+-------------------
+EOF
+check_job ${PRODUCT_DIR}/INSTALL_PYGMENTS.LOG python ./setup.py install ${PYGMENTS_SETUP_OPTIONS}
-# install Jinja2
-cd ${PRODUCT_SRC_DIR}/Jinja2-${VERSION_JINJA2}_SRC ; check_job ${PRODUCT_DIR}/MAKE.LOG python ./setup.py install --prefix=${PRODUCT_DIR}
+# - install Jinja2
+
+cd ${PRODUCT_SRC_DIR}/Jinja2-${VERSION_JINJA2}_SRC
+local JINJA2_SETUP_OPTIONS="--prefix=${PRODUCT_DIR}"
+cat > ${PRODUCT_DIR}/INSTALL_JINJA2.LOG <<EOF
+-------------------
+Used options: ${JINJA2_SETUP_OPTIONS}
+-------------------
+EOF
+check_job ${PRODUCT_DIR}/INSTALL_JINJA2.LOG python ./setup.py install ${JINJA2_SETUP_OPTIONS}
# install Sphinx
-cd ${PRODUCT_SRC_DIR}/Sphinx-${VERSION_SPHINX}_SRC ; check_job ${PRODUCT_DIR}/MAKE.LOG python ./setup.py install --prefix=${PRODUCT_DIR}
+cd ${PRODUCT_SRC_DIR}/Sphinx-${VERSION_SPHINX}_SRC
+local SPHINX_SETUP_OPTIONS="--prefix=${PRODUCT_DIR}"
+cat > ${PRODUCT_DIR}/INSTALL_SPHINX.LOG <<EOF
+-------------------
+Used options: ${SPHINX_SETUP_OPTIONS}
+-------------------
+EOF
+check_job ${PRODUCT_DIR}/INSTALL_SPHINX.LOG python ./setup.py install ${SPHINX_SETUP_OPTIONS}
# fix Python exec path
cd ${PRODUCT_DIR}/bin
# build sources
test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/BUILD.LOG <<EOF
-used gcc=${GCC}
-EOF
-
# configure
cd ${PRODUCT_SRC_DIR}
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./bootstrap.sh --with-toolset=gcc --with-python=`which python` --prefix=${PRODUCT_DIR}
+
+local BOOST_CONFIGURE_OPTIONS="--prefix=${PRODUCT_DIR} --with-toolset=gcc --with-python=`which python`"
+cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${BOOST_CONFIGURE_OPTIONS}
+-------------------
+EOF
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./bootstrap.sh ${BOOST_CONFIGURE_OPTIONS}
# make & install
cd ${PRODUCT_SRC_DIR}
PRODUCT_BUILD_DIR=${PRODUCT_DIR}_build
mkdir -p ${PRODUCT_BUILD_DIR} >& /dev/null
-./b2 --prefix=${PRODUCT_DIR} --layout=tagged toolset=gcc variant=release runtime-link=shared threading=multi --build-dir=${PRODUCT_BUILD_DIR} install >& ${PRODUCT_DIR}/INSTALL.LOG
+if [ "${CXX}" != "" ] ; then
+ # custom gcc
+ local gcc_ver=`${CXX} -dumpversion | awk -F. '{a1=0;a2=0;if(NF>0)a1=$1;if(NF>1)a2=$2;printf("%d.%d",a1,a2);}'`
+ sed -i "s%# using gcc : .* ;%using gcc : ${gcc_ver} : ${CXX} ;%g" ${PRODUCT_SRC_DIR}/tools/build/v2/user-config.jam
+fi
+
+local BJAM_OPTIONS="--prefix=${PRODUCT_DIR} --build-dir=${PRODUCT_BUILD_DIR} -d+2 --layout=tagged toolset=gcc variant=release runtime-link=shared threading=multi"
+cat >> ${PRODUCT_DIR}/INSTALL.LOG <<EOF
+-------------------
+Used options: ${BJAM_OPTIONS}
+-------------------
+EOF
+check_job ${PRODUCT_DIR}/INSTALL.LOG ./b2 ${BJAM_OPTIONS} install
if [ "$?" -ne "0" ] ; then
cat ${PRODUCT_DIR}/INSTALL.LOG
cd ${PRODUCT_BUILD_DIR}
CMAKE_OPTIONS=""
-
-### common settings
+# - common settings
CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DCMAKE_INSTALL_PREFIX:STRING=${PRODUCT_DIR}"
CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DCMAKE_BUILD_TYPE:STRING=Release"
CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DBUILD_SHARED_LIBS:BOOL=ON"
-### HDF5 settings
+# - HDF5 settings
if [ "${HDF5_ROOT_DIR}" != "" ]; then
CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DENABLE_HDF5:BOOL=ON"
CMAKE_OPTIONS=${CMAKE_OPTIONS}" -DHDF5_INCLUDE_PATH:PATH=${HDF5_ROOT_DIR}/include"
fi
cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
-cmake : `which cmake`
-
-used settings:
-${CMAKE_OPTIONS}
+-------------------
+Used options: ${CMAKE_OPTIONS}
+-------------------
EOF
check_job ${PRODUCT_DIR}/CONFIGURE.LOG cmake ${PRODUCT_SRC_DIR} ${CMAKE_OPTIONS}
-cat > ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=`which gcc`
-EOF
-check_job ${PRODUCT_DIR}/MAKE.LOG make -j4
-check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
+check_job ${PRODUCT_DIR}/MAKE.LOG make VERBOSE=1 -j4
+check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make VERBOSE=1 install
cd ${PRODUCT_DIR}
cd ${PRODUCT_SRC_DIR}
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR}
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
+local CMAKE_CONFIGURE_OPTIONS="--prefix=${PRODUCT_DIR}"
+cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${CMAKE_CONFIGURE_OPTIONS}
+-------------------
EOF
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure ${CMAKE_CONFIGURE_OPTIONS}
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
shift
errfile=/tmp/errlog
if [ -n "${INSTALL_WORK}" ] ; then errfile=${INSTALL_WORK}/errlog; fi
- cmd="`pwd` -> $*"
+ cmd="`pwd` -> $@"
if [ "${out}" != "1" ] ; then cmd="${cmd} >> ${out}" ; fi
echo -e ${cmd}
if [ "${out}" != "1" ] ; then
- $* >> ${out} 2>${errfile}
+ "$@" >> ${out} 2>${errfile}
else
- $*
+ "$@"
fi
if [ "$?" -ne "0" ] ; then
if [ ${out} != "1" ] ; then
#all output will be put into terminal
check_jb()
{
- check_job 1 $*
+ check_job 1 "$@"
return
}
return ${to_tail}
}
-where_gcc(){
-maj_ver=`echo $1 | awk -F. '{if(NF>0) print $1; else print 0}'`
-min_ver=`echo $1 | awk -F. '{if(NF>1) print $2; else print 0}'`
-rel_ver=`echo $1 | awk -F. '{if(NF>2) print $3; else print 0}'`
-let ver=${maj_ver}*10000+${min_ver}*100+${rel_ver}
-newer=""
-newerver=0
-for i in `echo ${PATH}:/usr/bin:/usr/local/bin | sed -e"s%:% %g"` ; do
- ret=`find ${i} -name gcc -maxdepth 1 2>/dev/null`
- if [ -n "${ret}" ] ; then
- maj_ver=`${ret} -dumpversion | awk -F. '{if(NF>0) print $1; else print 0}'`
- min_ver=`${ret} -dumpversion | awk -F. '{if(NF>1) print $2; else print 0}'`
- rel_ver=`${ret} -dumpversion | awk -F. '{if(NF>2) print $3; else print 0}'`
- let ver1=${maj_ver}*10000+${min_ver}*100+${rel_ver}
- if [ ${ver1} -eq ${ver} ] ; then
- ret=`echo ${ret} | sed -e"s%/gcc$%%g"`
- echo ${ret}
- return 0
- fi
- if [ ${ver1} -gt ${ver} ] && [ ${ver1} -gt ${newerver} ] ; then
- let newerver=${ver1}
- newer=`echo ${ret} | sed -e"s%/gcc$%%g"`
- fi
- fi
-done
-if [ -n "${newer}" ] ; then
- echo ${newer}
- return 0
-fi
-return 1
-}
-
where_tcl(){
if test -z "${TCLHOME}"; then
TCLHOME=/usr
}
##
-# function: workaround on some platforms to use latest available version of gcc (e.g. gcc44 on CentOS 5.5)
+# function: create .qmake.cache file for compilation of custom gcc compiler
+# usage: gen_qmake_cache <dir>
+# <dir> is a directory to put .qmake.cache
##
-use_latest_gcc(){
- local gcc_min=$1
- local gcc_ver=`gcc -dumpversion | awk -F. '{a1=0;a2=0;a3=0;if(NF>0)a1=$1;if(NF>1)a2=$2;if(NF>2)a3=$3;printf("%02d%02d%02d",a1,a2,a3);}'`
- local gcc_found
- local gxx_found
- if [ ${gcc_ver} -le ${gcc_min} ] ; then
- local wheregcc=$(dirname `which gcc`)
- local all_gcc=$(find ${wheregcc}/gcc*)
- local gcc_alt
- local gcc_max=0
- for gcc_alt in ${all_gcc} XXX ; do
- if [ ${gcc_alt} = "XXX" ] ; then continue ; fi
- gcc_ver=`${gcc_alt} -dumpversion 2>/dev/null | awk -F. '{a1=0;a2=0;a3=0;if(NF>0)a1=$1;if(NF>1)a2=$2;if(NF>2)a3=$3;printf("%02d%02d%02d",a1,a2,a3);}'`
- if [ "${gcc_ver}" = "" ] ; then continue ; fi
- if [ ${gcc_ver} -gt ${gcc_min} ] && [ ${gcc_ver} -gt ${gcc_max} ] ; then
- gcc_max=${gcc_ver}
- gcc_found=${gcc_alt}
- gxx_found=`echo ${gcc_found} | sed -e "s%gcc%g++%"`
- fi
- done
- if [ "${gcc_found}" != "" ] ; then
- echo "CC=${gcc_found} CXX=${gxx_found} LD=${gxx_found}"
+
+gen_qmake_cache()
+{
+ local d=$1
+ if [ "${d}" != "" ] && [ -d ${d} ] && [ "${CXX}" != "" ] ; then
+ touch ${d}/.qmake.cache >& /dev/null
+ if [ "$?" != "0" ] ; then
+ return 1
fi
+ cat > ${d}/.qmake.cache <<EOF
+QMAKE_CXX = ${CXX}
+QMAKE_LINK = ${CXX}
+QMAKE_LINK_SHLIB = ${CXX}
+QMAKE_CC = ${CC}
+QMAKE_LINK_C = ${CC}
+QMAKE_LINK_C_SHLIB = ${CC}
+EOF
fi
+ return 0
}
modif_la_files(){
# build sources
test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
-cd ${PRODUCT_SRC_DIR} ; check_job ${PRODUCT_DIR}/BUILD.LOG python setup.py install --prefix=${PRODUCT_DIR}
+
+cd ${PRODUCT_SRC_DIR}
+
+local DOCUTILS_OPTIONS="--prefix=${PRODUCT_DIR}"
+cat > ${PRODUCT_DIR}/INSTALL.LOG <<EOF
+-------------------
+Used options: ${DOCUTILS_OPTIONS}
+-------------------
+EOF
+check_job ${PRODUCT_DIR}/INSTALL.LOG python setup.py install ${DOCUTILS_OPTIONS}
cd ${PRODUCT_DIR}/bin
for f in X `find . -name "*.py" -exec basename {} ";" | awk -F. '{print $1}'` ; do
fi
fi
+if [ "${CXX}" != "" ] ; then
+ # custom compiler
+ for d in ${PRODUCT_SRC_DIR}/tmake/lib/linux-g++ ${PRODUCT_SRC_DIR}/tmake/lib/linux-64 ; do
+ sed -i "s%\(^TMAKE_CC[[:space:]]*=[[:space:]]*\).*$%\1${CC}%g" ${d}/tmake.conf
+ sed -i "s%\(^TMAKE_CXX[[:space:]]*=[[:space:]]*\).*$%\1${CXX}%g" ${d}/tmake.conf
+ sed -i "s%\(^TMAKE_LINK[[:space:]]*=[[:space:]]*\).*$%\1${CXX}%g" ${d}/tmake.conf
+ sed -i "s%\(^TMAKE_LINK_SHLIB[[:space:]]*=[[:space:]]*\).*$%\1${CXX}%g" ${d}/tmake.conf
+ sed -i "s%\(^TMAKE_MOC[[:space:]]*=[[:space:]]*\).*$%\1`which moc`%g" ${d}/tmake.conf
+ done
+fi
+
if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.src.size
fi
cd ${PRODUCT_SRC_DIR}
test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix ${PRODUCT_DIR}
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
+local CONFIGURE_OPTIONS="--prefix ${PRODUCT_DIR}"
+cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${CONFIGURE_OPTIONS}
+-------------------
EOF
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure ${CONFIGURE_OPTIONS}
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
# build sources
test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
-# install
cd ${PRODUCT_SRC_DIR}
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR}
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
+
+# install
+local CONFIGURE_OPTIONS="--prefix=${PRODUCT_DIR}"
+cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${CONFIGURE_OPTIONS}
+-------------------
EOF
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure ${CONFIGURE_OPTIONS}
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/MAKE.LOG make install
# patch sources
+# [-] general patch for sources
+local patch_sources=1
# [-] patch for build procedure
local patch_build_procedure=1
# [-] patch for gcc 4.7 compatibility
local patch_gcc47_compat=1
+if [ "${patch_sources}" = "1" ] ; then
+ ( test -f patches/${PRODUCT}.patch && cp patches/${PRODUCT}.patch ${PRODUCT_SRC_DIR} && cd ${PRODUCT_SRC_DIR} && patch -p1 < ${PRODUCT}.patch )
+fi
+
if [ "${patch_build_procedure}" = "1" ] ; then
sed -i "s%DESTDIR ?= /%DESTDIR ?= /usr%g;s%INCDIR ?= \$(DESTDIR)/usr/include%INCDIR ?= \$(DESTDIR)/include%g;s%INSTALLDIR ?= \$(DESTDIR)/usr/lib%INSTALLDIR ?= \$(DESTDIR)/lib%g;s%-o root -g root %%g" ${PRODUCT_SRC_DIR}/Makefile.gnu
sed -i "s%DESTDIR ?= /%DESTDIR ?= /usr%g;s%INCDIR ?= \$(DESTDIR)/usr/include%INCDIR ?= \$(DESTDIR)/include%g;s%INSTALLDIR ?= \$(DESTDIR)/usr/lib%INSTALLDIR ?= \$(DESTDIR)/lib%g;s%-o root -g root %%g" ${PRODUCT_SRC_DIR}/Makefile.fip
## building FreeImage library
-# workaround for CentOS 5.5: FreeImage 3.16.0 is not compiled with gcc 4.2 and older :(
-local workaround_gcc42_pb=1
-gcc_found=""
-if [ "${workaround_gcc42_pb}" = "1" ] ; then
- gcc_found="`use_latest_gcc 040200`"
-fi
-
# compile
-check_job ${PRODUCT_DIR}/MAKE.LOG make ${gcc_found} -f Makefile.gnu
+check_job ${PRODUCT_DIR}/MAKE.LOG make -f Makefile.gnu
# install
-check_job ${PRODUCT_DIR}/INSTALL.LOG make ${gcc_found} -f Makefile.gnu DESTDIR=${PRODUCT_DIR} install
+check_job ${PRODUCT_DIR}/INSTALL.LOG make -f Makefile.gnu DESTDIR=${PRODUCT_DIR} install
# clean temporary files
###make -f Makefile.gnu clean
## building FreeImagePlus library
# compile
-check_job ${PRODUCT_DIR}/MAKEPLUS.LOG make ${gcc_found} -f Makefile.fip
+check_job ${PRODUCT_DIR}/MAKEPLUS.LOG make -f Makefile.fip
# install
-check_job ${PRODUCT_DIR}/INSTALLPLUS.LOG make ${gcc_found} -f Makefile.fip DESTDIR=${PRODUCT_DIR} install
+check_job ${PRODUCT_DIR}/INSTALLPLUS.LOG make -f Makefile.fip DESTDIR=${PRODUCT_DIR} install
# clean temporary files
###make -f Makefile.fip clean
+++ /dev/null
-#!/bin/bash -noprofile
-
-####################################################################################
-# File : freeimage.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-2014 CEA
-#
-# This script is the part of the SALOME installation procedure.
-#
-####################################################################################
-
-#
-# freeimage version
-#
-VERSION_FREEIMAGE=3.15.4
-
-check_version()
-{
-# check existance of freeimage and its version
-if [ "${FREEIMAGE_ROOT_DIR}" != "" ] && [ -f ${FREEIMAGE_ROOT_DIR}/include/FreeImage.h ] ; then
- ver_major=`grep "#define FREEIMAGE_MAJOR_VERSION" ${FREEIMAGE_ROOT_DIR}/include/FreeImage.h | awk '{print $3}'`
- ver_minor=`grep "#define FREEIMAGE_MINOR_VERSION" ${FREEIMAGE_ROOT_DIR}/include/FreeImage.h | awk '{print $3}'`
- ver_maint=`grep "#define FREEIMAGE_RELEASE_SERIAL" ${FREEIMAGE_ROOT_DIR}/include/FreeImage.h | awk '{print $3}'`
- ver="${ver_major}.${ver_minor}.${ver_maint}"
- if [ "${ver}" = "${VERSION_FREEIMAGE}" ] ; then
- return 0
- fi
-fi
-return 1
-}
-
-print_env_bin()
-{
-cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
-#${DELIM} ${PRODUCT_TYPE} ${DELIM}
-export FREEIMAGE_ROOT_DIR=\${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
-export PATH=\${FREEIMAGE_ROOT_DIR}/bin:\${PATH}
-export LD_LIBRARY_PATH=\${FREEIMAGE_ROOT_DIR}/lib:\${LD_LIBRARY_PATH}
-##
-EOF
-(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
-}
-
-print_env_src()
-{
-cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh <<EOF
-#${DELIM} ${PRODUCT_TYPE}_src ${DELIM}
-# nothing to do
-##
-EOF
-(test -w ${PRODUCT_SRC_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}_src.sh ${PRODUCT_SRC_DIR})
-make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
-}
-
-try_preinstalled(){
-try_existing ${PRODUCT_DIR} ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
-try_existing ${PRODUCT_SRC_DIR} ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
-return $?
-}
-
-install_source()
-{
-make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}_src
-source ${INSTALL_WORK}/${SHRC}
-
-# unpack
-check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INST_ROOT}
-
-# patch sources
-
-# [-] patch for build procedure
-local patch_build_procedure=1
-# [-] patch for gcc 4.7 compatibility
-local patch_gcc47_compat=1
-
-if [ "${patch_build_procedure}" = "1" ] ; then
- sed -i "s%DESTDIR ?= /%DESTDIR ?= /usr%g;s%INCDIR ?= \$(DESTDIR)/usr/include%INCDIR ?= \$(DESTDIR)/include%g;s%INSTALLDIR ?= \$(DESTDIR)/usr/lib%INSTALLDIR ?= \$(DESTDIR)/lib%g;s%-o root -g root %%g" ${PRODUCT_SRC_DIR}/Makefile.gnu
- sed -i "s%DESTDIR ?= /%DESTDIR ?= /usr%g;s%INCDIR ?= \$(DESTDIR)/usr/include%INCDIR ?= \$(DESTDIR)/include%g;s%INSTALLDIR ?= \$(DESTDIR)/usr/lib%INSTALLDIR ?= \$(DESTDIR)/lib%g;s%-o root -g root %%g" ${PRODUCT_SRC_DIR}/Makefile.fip
- sed -i "s%\(^[[:space:]]*\)\(install -m 755 \$(SHAREDLIB) \$(INSTALLDIR)\)%\1\2\n\1ln -sf \$(SHAREDLIB) \$(INSTALLDIR)/\$(VERLIBNAME)\n\1ln -sf \$(VERLIBNAME) \$(INSTALLDIR)/\$(LIBNAME)%g" ${PRODUCT_SRC_DIR}/Makefile.fip
-fi
-
-if [ "${patch_gcc47_compat}" = "1" ] ; then
- sed -i 's%\(#include "OpenEXRConfig.h"\)%\1\n#include <string.h>%g' ${PRODUCT_SRC_DIR}/Source/OpenEXR/IlmImf/ImfAutoArray.h
-fi
-
-if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
- du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.src.size
-fi
-
-# to generate environment scripts
-try_preinstalled
-}
-
-install_source_and_build()
-{
-# install sources
-install_source
-
-# build sources
-test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
-
-cd ${PRODUCT_SRC_DIR}
-
-## building FreeImage library
-
-# workaround for CentOS 5.5: FreeImage 3.16.0 is not compiled with gcc 4.2 and older :(
-local workaround_gcc42_pb=0
-gcc_found=""
-if [ "${workaround_gcc42_pb}" = "1" ] ; then
- gcc_found="`use_latest_gcc 040200`"
-fi
-
-# compile
-check_job ${PRODUCT_DIR}/MAKE.LOG make ${gcc_found} -f Makefile.gnu
-
-# install
-check_job ${PRODUCT_DIR}/INSTALL.LOG make ${gcc_found} -f Makefile.gnu DESTDIR=${PRODUCT_DIR} install
-
-# clean temporary files
-###make -f Makefile.gnu clean
-
-## building FreeImagePlus library
-
-# compile
-check_job ${PRODUCT_DIR}/MAKEPLUS.LOG make ${gcc_found} -f Makefile.fip
-
-# install
-check_job ${PRODUCT_DIR}/INSTALLPLUS.LOG make ${gcc_found} -f Makefile.fip DESTDIR=${PRODUCT_DIR} install
-
-# clean temporary files
-###make -f Makefile.fip clean
-
-cd ${PRODUCT_DIR}
-
-if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
- du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.build.size
- du -sk ${PRODUCT_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.bin.size
-fi
-
-# remove sources and temporary files after building
-if [ ${REMOVE_SRC_TMP} = "TRUE" ] ; then
- test -d ${PRODUCT_SRC_DIR} && rm -fr ${PRODUCT_SRC_DIR}
-fi
-
-# to generate environment scripts
-try_preinstalled
-}
-
-install_binary()
-{
-make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
-source ${INSTALL_WORK}/${SHRC}
-
-# create a product directory
-test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
-
-check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${PRODUCT_DIR}
-
-# to generate environment script for sources
-try_preinstalled
-}
-
-export PROCEDURE=$1;
-export INSTALL_WORK=$2;
-export SOURCE_DIR=$3;
-export INST_ROOT=$4;
-export PRODUCT_SEQUENCE=$5;
-export PRODUCT_TYPE=$6;
-export INSTALL_PRODUCTS=$7;
-shift
-REMOVE_SRC_TMP=$8;
-test $# = 10 && shift && SINGLE_DIR=$9
-export PRODUCT="freeimage-${VERSION_FREEIMAGE}"
-export PRODUCT_DIR=${INST_ROOT}/${SINGLE_DIR:-${PRODUCT}}
-export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
-export PRODUCT_SRC_DIR=${INST_ROOT}/${PRODUCT}_SRC
-source ./common.sh
-${PROCEDURE}
cd ${PRODUCT_SRC_DIR}
-FREETYPE_CONFIGURE_OPTIONS=
+local FREETYPE_CONFIGURE_OPTIONS="--prefix=${PRODUCT_DIR}"
if test `uname -m` = "x86_64" ; then
FREETYPE_CONFIGURE_OPTIONS="${FREETYPE_CONFIGURE_OPTIONS} CFLAGS='-m64 -fPIC' CPPFLAGS='-m64 -fPIC'"
fi
-# congigure
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR} ${FREETYPE_CONFIGURE_OPTIONS}
+# configure
+cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${FREETYPE_CONFIGURE_OPTIONS}
+-------------------
+EOF
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure ${FREETYPE_CONFIGURE_OPTIONS}
# compile
check_job ${PRODUCT_DIR}/MAKE.LOG make
cd ${PRODUCT_SRC_DIR}
-FTGL_CONFIGURE_OPTIONS=""
+FTGL_CONFIGURE_OPTIONS="--prefix=${PRODUCT_DIR}"
FTGL_CONFIGURE_OPTIONS="${FTGL_CONFIGURE_OPTIONS} --enable-shared=yes"
FTGL_CONFIGURE_OPTIONS="${FTGL_CONFIGURE_OPTIONS} --with-ft-prefix=${FREETYPE_ROOT_DIR}"
FTGL_CONFIGURE_OPTIONS="${FTGL_CONFIGURE_OPTIONS} --with-gl-inc=/usr/include"
fi
# congigure
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR} ${FTGL_CONFIGURE_OPTIONS}
+cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${FTGL_CONFIGURE_OPTIONS}
+-------------------
+EOF
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure ${FTGL_CONFIGURE_OPTIONS}
# compile
check_job ${PRODUCT_DIR}/MAKE.LOG make
+++ /dev/null
-#!/bin/bash -noprofile
-
-####################################################################################
-# File : gcc-common.sh
-# Created : Mon Jan 22 14:23:10 2007
-# Author : Vadim SANDLER, Open CASCADE SAS (vadim.sandler@opencascade.com)
-# Project : SALOME
-# Module : Installation Wizard
-# Copyright : 2002-2014 CEA
-#
-# This script is the part of the SALOME installation procedure.
-#
-####################################################################################
-
-if [ "x${GCC_VERSION}" = "x" ] ; then
- GCC_VERSION="3.2"
-fi
-GCC_VERSION_MAJ=`echo ${GCC_VERSION} | awk -F[.-] '{if(NF>0) print $1; else print 0}'`
-GCC_VERSION_MIN=`echo ${GCC_VERSION} | awk -F[.-] '{if(NF>1) print $2; else print 0}'`
-GCC_VERSION_REL=`echo ${GCC_VERSION} | awk -F[.-] '{if(NF>2) print $3; else print 0}'`
-let GCC_VERSION_ID=${GCC_VERSION_MAJ}*10000+${GCC_VERSION_MIN}*100+${GCC_VERSION_REL}
-
-check_version()
-{
-# version number is calculated as: <major>*10000+<minor>*100+<release>
-# e.g. for gcc 3.2 it is equal to 30200, for gcc 3.3.2 - 30202
-gcc_ver=`gcc -dumpversion | awk -F[.-] '{v1=0;v2=0;v3=0;if(NF>0)v1=$1;if(NF>1)v2=$2;if(NF>2)v3=$3;print v1*10000+v2*100+v3}'`
-if [ ${gcc_ver} -eq ${GCC_VERSION_ID} ] ; then
- return 0
-fi
-return 1
-}
-
-# looks for the native product and collects it's environment (used by make_env())
-try_native(){
-gcc_root="`where_gcc ${GCC_VERSION}`"
-if [ -n "${gcc_root}" ] ; then
- gcc_root=`cd ${gcc_root}/..; pwd`
- # get version number: <major>, <minor> and <release>
- # <major> and <minor> numbers are checked strickly, but <release> number can be larger than required one
- # version number is calculated as: <major>*10000+<minor>*100+<release>
- # e.g. for gcc 3.2 it is equal to 30200, for gcc 3.3.2 - 30202
- maj_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F[.-] '{if(NF>0) print $1; else print 0}'`
- min_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F[.-] '{if(NF>1) print $2; else print 0}'`
- rel_ver=`${gcc_root}/bin/gcc -dumpversion | awk -F[.-] '{if(NF>2) print $3; else print 0}'`
- let gcc_ver=${maj_ver}*10000+${min_ver}*100+${rel_ver}
- if [ ${gcc_ver} -ge ${GCC_VERSION_ID} ] ; then
- tmp="\${GCC_ROOT}/bin ${gcc_root}/bin \${PATH} ${PATH}";
- path=`sort_path ${tmp}`
- tmp="\${GCC_ROOT}/lib ${gcc_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 GCC_ROOT=${gcc_root}
-#export CXX=\${GCC_ROOT}/bin/g++
-#export CC=\${GCC_ROOT}/bin/gcc
-#export PATH=${path}
-#export LD_LIBRARY_PATH=${ld_library_path}
-##
-EOF
- make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
-####### THIS COULD BE USED FOR STRICT COMPARISON ##############################
-# if [ ${maj_ver} -eq 3 ] && [ ${min_ver} -eq 2 ] && [ ${rel_ver} -eq 0 ] ; then
-######################################################################################
- if [ ${maj_ver} -eq ${GCC_VERSION_MAJ} ] && [ ${min_ver} -eq ${GCC_VERSION_MIN} ] && [ ${rel_ver} -ge ${GCC_VERSION_REL} ] ; then
- return 0
- else
- return 2
- fi
- fi
-fi
-return 1
-}
-
-try_preinstalled(){
-#echo "It is impossible to install gcc from binaries or sources! So native gcc will be used."
-try_native
-}
-
-export PROCEDURE=$1;
-export INSTALL_WORK=$2;
-export SOURCE_DIR=$3;
-export INST_ROOT=$4;
-export PRODUCT_SEQUENCE=$5;
-export PRODUCT_TYPE=$6;
-export INSTALL_PRODUCTS=$7;
-export PRODUCT="gcc-${GCC_VERSION}"
-export PRODUCT_DIR=${INST_ROOT}/${PRODUCT}
-export PRODUCT_WORK=${INSTALL_WORK}/${PRODUCT}
-source ./common.sh
-${PROCEDURE}
#
####################################################################################
+# minimal supported version
+
+GCC_MIN_VERSION=4.2.0
+
check_version()
{
-return 0
+ return 0
}
print_env_bin()
{
-echo "print_env_bin()"
-gcc_found="`use_latest_gcc 040200`"
-if [ "${gcc_found}" != "" ] ; then
-cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
+ # check gcc available alternatives, to use version > GCC_MIN_VERSION if possible
+ local gcc_min=`echo ${GCC_MIN_VERSION} | awk -F. '{a1=0;a2=0;a3=0;if(NF>0)a1=$1;if(NF>1)a2=$2;if(NF>2)a3=$3;printf("%02d%02d%02d",a1,a2,a3);}'`
+ local gcc_ver=`gcc -dumpversion | awk -F. '{a1=0;a2=0;a3=0;if(NF>0)a1=$1;if(NF>1)a2=$2;if(NF>2)a3=$3;printf("%02d%02d%02d",a1,a2,a3);}'`
+ local gcc_found
+ local gxx_found
+ local fc_found
+ if [ ${gcc_ver} -le ${gcc_min} ] ; then
+ # search gcc
+ local wheregcc=$(dirname `which gcc`)
+ local all_gcc=$(find ${wheregcc}/gcc*)
+ local gcc_alt
+ local gcc_max=0
+ for gcc_alt in ${all_gcc} XXX ; do
+ if [ ${gcc_alt} = "XXX" ] ; then continue ; fi
+ gcc_ver=`${gcc_alt} -dumpversion 2>/dev/null | awk -F. '{a1=0;a2=0;a3=0;if(NF>0)a1=$1;if(NF>1)a2=$2;if(NF>2)a3=$3;printf("%02d%02d%02d",a1,a2,a3);}'`
+ if [ "${gcc_ver}" = "" ] ; then continue ; fi
+ if [ ${gcc_ver} -gt ${gcc_min} ] && [ ${gcc_ver} -gt ${gcc_max} ] ; then
+ gcc_max=${gcc_ver}
+ gcc_found=${gcc_alt}
+ gxx_found=`echo ${gcc_found} | sed -e "s%gcc%g++%"`
+ test -e ${gxx_found} || gxx_found=
+ fc_found=`echo ${gcc_found} | sed -e "s%gcc%gfortran%"`
+ test -e ${fc_found} || fc_found=
+ fi
+ done
+ fi
+ if [ "${gcc_found}" != "" ] && [ "${gxx_found}" != "" ] && [ "${fc_found}" != "" ] ; then
+ cat > ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh <<EOF
#${DELIM} ${PRODUCT_TYPE} ${DELIM}
-`echo ${gcc_found} | tr " " "\n" | sed -e "s%\(.*\)=%export \1=%g"`
+export CC=${gcc_found}
+export CXX=${gxx_found}
+export FC=${fc_found}
##
EOF
-fi
-(test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
-make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
+ fi
+ (test -w ${PRODUCT_DIR} && cp ${INSTALL_WORK}/env_${PRODUCT_TYPE}.sh ${PRODUCT_DIR})
+ make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
}
print_env_src()
{
-echo "print_env_src()"
-return
+ return 0
}
# looks for the native product and collects it's environment (used by make_env())
try_native()
{
- echo "try_native()"
-make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
-return 0
+ make_env ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}"
+ return 0
}
install_source()
{
- echo "install_source()"
-try_existing ${PRODUCT_DIR} ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+ try_existing ${PRODUCT_DIR} ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
}
install_source_and_build()
{
-install_source
+ install_source
}
install_binary()
{
- echo "install_binary()"
-try_existing ${PRODUCT_DIR} ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+ try_existing ${PRODUCT_DIR} ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
}
try_preinstalled()
{
- echo "try_preinstalled()"
-try_existing ${PRODUCT_DIR} ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
+ try_existing ${PRODUCT_DIR} ${INST_ROOT} ${INSTALL_WORK} "${PRODUCT_SEQUENCE}" "${INSTALL_PRODUCTS}" ${PRODUCT_TYPE}
}
export PROCEDURE=$1;
cd ${PRODUCT_SRC_DIR}
# configure
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG cmake -DCMAKE_INSTALL_PREFIX=${PRODUCT_DIR} -DCMAKE_BUILD_TYPE=Release
+local CMAKE_OPTIONS=""
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX=${PRODUCT_DIR}"
+CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_BUILD_TYPE=Release"
+
+cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${CMAKE_OPTIONS}
+-------------------
+EOF
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG cmake ${CMAKE_OPTIONS}
# compile
-check_job ${PRODUCT_DIR}/MAKE.LOG make
+check_job ${PRODUCT_DIR}/MAKE.LOG make VERBOSE=1
# install
-check_job ${PRODUCT_DIR}/INSTALL.LOG make install
+check_job ${PRODUCT_DIR}/INSTALL.LOG make VERBOSE=1 install
cd ${PRODUCT_DIR}
sed -i "s%echo 'puts \[info tclversion\]' | \$TCLSH%echo 'puts \[info tclversion\]' | \$TCLSH 2>/dev/null | grep -E '^[0-9.]+$'%g" configure
fi
-CONFIGURE_FLAGS="--disable-rpath --disable-tcl --without-qt"
+CONFIGURE_FLAGS="--prefix=${PRODUCT_DIR} --disable-rpath --disable-tcl --without-qt"
if [ "${EXPAT_ROOT_DIR}" != "" ] ; then
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-expat --with-expatincludedir=${EXPAT_ROOT_DIR}/include --with-expatlibdir=${EXPAT_ROOT_DIR}/lib --enable-perl=no "
fi
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} --with-cgraph=no"
fi
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG configure --prefix=${PRODUCT_DIR} ${CONFIGURE_FLAGS}
-
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
+cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${CONFIGURE_FLAGS}
+-------------------
EOF
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG configure ${CONFIGURE_FLAGS}
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
cd ${PRODUCT_BUILD_DIR}
# build options
-CMAKE_OPTIONS=""
+local CMAKE_OPTIONS=""
CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX=${PRODUCT_DIR}"
CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_BUILD_TYPE=Release -DHDF5_ENABLE_THREADSAFE=ON -DBUILD_SHARED_LIBS=ON"
CMAKE_OPTIONS="${CMAKE_OPTIONS} -DHDF5_BUILD_TOOLS=ON -DHDF5_BUILD_HL_LIB=ON -DHDF5_ENABLE_Z_LIB_SUPPORT=ON"
fi
cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
-cmake : `which cmake`
-
-used settings:
-${CMAKE_OPTIONS}
+-------------------
+Used options: ${CMAKE_OPTIONS}
+-------------------
EOF
check_job ${PRODUCT_DIR}/CONFIGURE.LOG cmake ${PRODUCT_SRC_DIR} ${CMAKE_OPTIONS}
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=`which gcc`
-EOF
-check_job ${PRODUCT_DIR}/MAKE.LOG make
-check_job ${PRODUCT_DIR}/INSTALL.LOG make install
+check_job ${PRODUCT_DIR}/MAKE.LOG make VERBOSE=1
+check_job ${PRODUCT_DIR}/INSTALL.LOG make VERBOSE=1 install
cd ${PRODUCT_DIR}
cd ${PRODUCT_SRC_DIR}
test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG cmake -DCMAKE_INSTALL_PREFIX=${PRODUCT_DIR}
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
+local CMAKE_OPTIONS="-DCMAKE_INSTALL_PREFIX=${PRODUCT_DIR}"
+cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${CMAKE_OPTIONS}
+-------------------
EOF
-check_job ${PRODUCT_DIR}/MAKE.LOG make
-check_job ${PRODUCT_DIR}/INSTALL.LOG make install
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG cmake ${CMAKE_OPTIONS}
+check_job ${PRODUCT_DIR}/MAKE.LOG make VERBOSE=1
+check_job ${PRODUCT_DIR}/INSTALL.LOG make VERBOSE=1 install
cd ${PRODUCT_DIR};
cd ${PRODUCT_SRC_DIR}
test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR}
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
+local CONFIGURE_OPTIONS="--prefix=${PRODUCT_DIR}"
+cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${CONFIGURE_OPTIONS}
+-------------------
EOF
-check_job ${PRODUCT_DIR}/MAKE.LOG make
-check_job ${PRODUCT_DIR}/INSTALL.LOG make install
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure ${CONFIGURE_OPTIONS}
+check_job ${PRODUCT_DIR}/MAKE.LOG make AM_DEFAULT_VERBOSITY=1
+check_job ${PRODUCT_DIR}/INSTALL.LOG make AM_DEFAULT_VERBOSITY=1 install
cd ${PRODUCT_DIR}
# -DMEDFILE_BUILD_STATIC_LIBS=ON
cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
-cmake : `which cmake`
-
-used settings:
-${CMAKE_OPTIONS}
+-------------------
+Used options: ${CMAKE_OPTIONS}
+-------------------
EOF
check_job ${PRODUCT_DIR}/CONFIGURE.LOG cmake ${PRODUCT_SRC_DIR} ${CMAKE_OPTIONS}
-cat > ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=`which gcc`
-EOF
-check_job ${PRODUCT_DIR}/MAKE.LOG make
-check_job ${PRODUCT_DIR}/INSTALL.LOG make install
+check_job ${PRODUCT_DIR}/MAKE.LOG make VERBOSE=1
+check_job ${PRODUCT_DIR}/INSTALL.LOG make VERBOSE=1 install
cd ${PRODUCT_DIR}
check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INST_ROOT}
+if [ "${METIS_MAJOR_VERSION}" = "4" ] ; then
+ # patch for 64bit platforms
+ local patch_64bits=1
+ if [ "${patch_64bits}" = "1" ] ; then
+ if test `uname -m` = "x86_64" ; then
+ sed -i "s%COPTIONS[[:space:]]*=[[:space:]]*\(.*\)%COPTIONS = -fPIC \1%g" ${PRODUCT_SRC_DIR}/Makefile.in
+ fi
+ fi
+ if [ "${CC}" != "" ] ; then
+ # custom compiler
+ sed -i "s%\(^CC[[:space:]]*=[[:space:]]*\).*$%\1${CC}%g" ${PRODUCT_SRC_DIR}/Makefile.in
+ fi
+fi
+
+
if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.src.size
fi
else
# for version 4
- # patch for 64bit platforms
- local patch_64bits=1
- if [ "${patch_64bits}" = "1" ] ; then
- if test `uname -m` = "x86_64" ; then
- sed -i "s%COPTIONS[[:space:]]*=[[:space:]]*\(.*\)%COPTIONS = -fPIC \1%g" Makefile.in
- fi
- fi
-
# make
check_job ${PRODUCT_DIR}/MAKE.LOG make
cd ${PRODUCT_SRC_DIR}
# configure
-NETGEN_CONFIGURE_OPTIONS="--with-occ=${CAS_ROOT_DIR} --with-tcl=${TCLHOME}/lib --with-tk=${TCLHOME}/lib --with-tclinclude=${TCLHOME}/include"
+local NETGEN_CONFIGURE_OPTIONS="--prefix=${PRODUCT_DIR}"
+NETGEN_CONFIGURE_OPTIONS="${NETGEN_CONFIGURE_OPTIONS} --with-occ=${CAS_ROOT_DIR}"
+NETGEN_CONFIGURE_OPTIONS="${NETGEN_CONFIGURE_OPTIONS} --with-tcl=${TCLHOME}/lib --with-tk=${TCLHOME}/lib --with-tclinclude=${TCLHOME}/include"
if test `uname -m` = "x86_64" ; then
- ./configure --prefix=${PRODUCT_DIR} ${NETGEN_CONFIGURE_OPTIONS} CXXFLAGS='-O2 -m64' >> ${PRODUCT_DIR}/CONFIGURE.LOG
+ NETGEN_CXXFLAGS="-O2 -m64"
else
- ./configure --prefix=${PRODUCT_DIR} ${NETGEN_CONFIGURE_OPTIONS} CXXFLAGS=-O0 >> ${PRODUCT_DIR}/CONFIGURE.LOG
+ NETGEN_CXXFLAGS="-O0"
fi
+cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${NETGEN_CONFIGURE_OPTIONS} CXXFLAGS=${NETGEN_CXXFLAGS}
+-------------------
+EOF
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure ${NETGEN_CONFIGURE_OPTIONS} CXXFLAGS="${NETGEN_CXXFLAGS}"
# compile
check_job ${PRODUCT_DIR}/MAKE.LOG make
# build sources
test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
+cd ${PRODUCT_SRC_DIR}/lapack-${VERSION_LAPACK}_SRC
+
# lapack cmake options
-CMAKE_OPTIONS=""
+local CMAKE_OPTIONS=""
CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_INSTALL_PREFIX=${PRODUCT_DIR}"
CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS:BOOL=ON"
CMAKE_OPTIONS="${CMAKE_OPTIONS} -DCMAKE_CXX_FLAGS=-fPIC -DCMAKE_C_FLAGS=-fPIC"
# install lapack
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
+cat > ${PRODUCT_DIR}/CONFIGURE_LAPACK.LOG <<EOF
+-------------------
+Used options: ${CMAKE_OPTIONS}
+-------------------
EOF
-cd ${PRODUCT_SRC_DIR}/lapack-${VERSION_LAPACK}_SRC
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG cmake . ${CMAKE_OPTIONS}
-check_job ${PRODUCT_DIR}/MAKE.LOG make
-check_job ${PRODUCT_DIR}/INSTALL.LOG make install
+check_job ${PRODUCT_DIR}/CONFIGURE_LAPACK.LOG cmake . ${CMAKE_OPTIONS}
+check_job ${PRODUCT_DIR}/MAKE_LAPACK.LOG make VERBOSE=1
+check_job ${PRODUCT_DIR}/INSTALL_LAPACK.LOG make VERBOSE=1 install
# install numpy
cd ${PRODUCT_SRC_DIR}/numpy-${VERSION_NUMPY}_SRC
-check_job ${PRODUCT_DIR}/MAKE.LOG python setup.py install --prefix=${PRODUCT_DIR}
+local NUMPY_OPTIONS="--prefix=${PRODUCT_DIR}"
+cat > ${PRODUCT_DIR}/INSTALL_NUMPY.LOG <<EOF
+-------------------
+Used options: ${NUMPY_OPTIONS}
+-------------------
+EOF
+check_job ${PRODUCT_DIR}/INSTALL_NUMPY.LOG python setup.py install ${NUMPY_OPTIONS}
cd ${PRODUCT_DIR}
mkdir build
cd build
-check_job ${PRODUCT_DIR}/CONFIGURE_OMNIORB.LOG ../configure --prefix=${PRODUCT_DIR}
-
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE_OMNIORB.LOG <<EOF
-used gcc=${GCC}
+local OMNIORB_CONFIGURE_OPTIONS="--prefix=${PRODUCT_DIR}"
+cat >> ${PRODUCT_DIR}/CONFIGURE_OMNIORB.LOG <<EOF
+-------------------
+Used options: ${OMNIORB_CONFIGURE_OPTIONS}
+-------------------
EOF
+check_job ${PRODUCT_DIR}/CONFIGURE_OMNIORB.LOG ../configure ${OMNIORB_CONFIGURE_OPTIONS}
check_job ${PRODUCT_DIR}/MAKE_OMNIORB.LOG make
check_job ${PRODUCT_DIR}/INSTALL_OMNIORB.LOG make install
mkdir build
cd build
-check_job ${PRODUCT_DIR}/CONFIGURE_OMNIORBPY.LOG ../configure --prefix=${PRODUCT_DIR}
-
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE_OMNIORBPY.LOG <<EOF
-used gcc=${GCC}
+local OMNIORBPY_CONFIGURE_OPTIONS="--prefix=${PRODUCT_DIR}"
+cat >> ${PRODUCT_DIR}/CONFIGURE_OMNIORBPY.LOG <<EOF
+-------------------
+Used options: ${OMNIORBPY_CONFIGURE_OPTIONS}
+-------------------
EOF
+check_job ${PRODUCT_DIR}/CONFIGURE_OMNIORBPY.LOG ../configure ${OMNIORBPY_CONFIGURE_OPTIONS}
check_job ${PRODUCT_DIR}/MAKE_OMNIORBPY.LOG make
check_job ${PRODUCT_DIR}/INSTALL_OMNIORBPY.LOG make install
mkdir build
cd build
-check_job ${PRODUCT_DIR}/CONFIGURE_OMNINOTIFY.LOG ../configure --prefix=${PRODUCT_DIR}
-
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE_OMNINOTIFY.LOG <<EOF
-used gcc=${GCC}
+local OMNINOTIFY_CONFIGURE_OPTIONS="--prefix=${PRODUCT_DIR}"
+cat >> ${PRODUCT_DIR}/CONFIGURE_OMNINOTIFY.LOG <<EOF
+-------------------
+Used options: ${OMNINOTIFY_CONFIGURE_OPTIONS}
+-------------------
EOF
+check_job ${PRODUCT_DIR}/CONFIGURE_OMNINOTIFY.LOG ../configure ${OMNINOTIFY_CONFIGURE_OPTIONS}
check_job ${PRODUCT_DIR}/MAKE_OMNINOTIFY.LOG make
check_job ${PRODUCT_DIR}/INSTALL_OMNINOTIFY.LOG make install
--- /dev/null
+diff -Naur --exclude=CVS freeimage-3.16.0_orig/Source/LibWebP/src/utils/bit_writer.c freeimage-3.16.0_patch/Source/LibWebP/src/utils/bit_writer.c
+--- freeimage-3.16.0_orig/Source/LibWebP/src/utils/bit_writer.c 2014-03-08 19:31:50.000000000 +0400
++++ freeimage-3.16.0_patch/Source/LibWebP/src/utils/bit_writer.c 2014-06-10 12:16:20.000000000 +0400
+@@ -226,6 +226,21 @@
+ #define htole16(x) (x)\r
+ #else // pretty much all linux and/or glibc\r
+ #include <endian.h>\r
++#if !defined(htole32)
++# include <byteswap.h>
++# ifdef __USE_BSD
++/* Conversion interfaces. */
++#if __BYTE_ORDER == __LITTLE_ENDIAN
++#define htole16(x) (x)
++#define htole32(x) (x)
++#define htole64(x) (x)
++#else
++#define htole16(x) __bswap_16 (x)
++#define htole32(x) __bswap_32 (x)
++#define htole64(x) __bswap_64 (x)
++#endif
++#endif
++#endif
+ #endif\r
+ \r
+ // Returns 1 on success.\r
cd ${PRODUCT_SRC_DIR}/Qt4Qt5
+gen_qmake_cache ${PRODUCT_SRC_DIR}/Qt4Qt5
qmake -o Makefile qscintilla.pro
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
if [ "${PYQT4_ROOT_DIR}" != "" ] ; then
# install Python wrapping for QScintilla only if pre-installed version of PyQt is used
+ local QSCI_PY_CONFIGURE_OPTIONS="-a ${PRODUCT_DIR}/qsci -n ${PRODUCT_DIR}/include -o ${PRODUCT_DIR}/lib -p 4 -d ${PYQT4_ROOT_DIR}/PyQt4 -v ${PYQT4_ROOT_DIR}/sip"
+ if [ "${CXX}" != "" ] ; then
+ # custom gcc
+ false && QSCI_PY_CONFIGURE_OPTIONS="${QSCI_PY_CONFIGURE_OPTIONS} CC=${CC} CXX=${CXX} LINK=${CXX} LINK_SHLIB=${CXX}"
+ fi
cd ${PRODUCT_SRC_DIR}/Python
- check_job ${PRODUCT_DIR}/PYCONFIGURE.LOG python configure.py -a ${PRODUCT_DIR}/qsci \
- -n ${PRODUCT_DIR}/include -o ${PRODUCT_DIR}/lib -p 4 \
- -d ${PYQT4_ROOT_DIR}/PyQt4 -v ${PYQT4_ROOT_DIR}/sip
+ cat >> ${PRODUCT_DIR}/PYCONFIGURE.LOG <<EOF
+-------------------
+Used options: ${QSCI_PY_CONFIGURE_OPTIONS}
+-------------------
+EOF
+ check_job ${PRODUCT_DIR}/PYCONFIGURE.LOG python configure.py ${QSCI_PY_CONFIGURE_OPTIONS}
check_job ${PRODUCT_DIR}/PYMAKE.LOG make
check_job ${PRODUCT_DIR}/PYMAKEINSTALL.LOG make install
fi
cd ${PRODUCT_SRC_DIR}
-# configure
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure -prefix ${PRODUCT_DIR} -no-separate-debug-info -release -opensource -confirm-license
+# workaround for custom gcc
+if [ "${CXX}" != "" ] ; then
+ QMAKE_LD=${CXX}
+fi
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
+# configure
+local QT_CONFIGURE_OPTIONS="-prefix ${PRODUCT_DIR} -no-separate-debug-info -opensource -confirm-license"
+if [ "${FOR_DEBUG}" = "1" ] ; then
+ # to debug Qt
+ QT_CONFIGURE_OPTIONS="${QT_CONFIGURE_OPTIONS} -debug"
+else
+ QT_CONFIGURE_OPTIONS="${QT_CONFIGURE_OPTIONS} -release"
+fi
+cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${QT_CONFIGURE_OPTIONS}
+-------------------
EOF
-
+# VSR: we pass custom LD (specified previously via QMAKE_LD variable) to the configure command
+# using env program; this is actually only needed when install scripts for all products are executed
+# in the same shell process, so we might just set directly LD environment variable instead of this;
+# this code is here just for possible future redesign of install procedure.
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG env LD=${QMAKE_LD} ./configure ${QT_CONFIGURE_OPTIONS}
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/MAKEINSTALL.LOG make install
-#if test `uname -m` = "x86_64" ; then
-# ( cd ${PRODUCT_DIR} && ln -sf lib lib64 )
-#fi
-
# patch binaries
local patch_webkit_deps=1
if [ "${patch_webkit_deps}" = "1" ] ; then
# configure with qmake
+gen_qmake_cache ${PRODUCT_SRC_DIR}
+
qmake
# make
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
-EOF
-
check_job ${PRODUCT_DIR}/MAKE.LOG make
# make install
check_jb tar xfz ${SOURCE_DIR}/${PRODUCT}.tar.gz -C ${INST_ROOT}
+if test `uname -m` = "x86_64" ; then
+ # create Makefile for Linux 64bit platforms
+ cd ${PRODUCT_SRC_DIR}/src && \
+ sed -e "s%CFLAGS\([[:space:]]*\)=\([[:space:]]*\)\(.*\)%CFLAGS\1=\2-fPIC \3%g" Make.inc/Makefile.inc.i686_pc_linux2.prof > Make.inc/Makefile.inc.x86-64_pc_linux2.prof && \
+ ln -sf Make.inc/Makefile.inc.x86-64_pc_linux2.prof Makefile.inc
+else
+ cd ${PRODUCT_SRC_DIR}/src && \
+ ln -sf Make.inc/Makefile.inc.i686_pc_linux2.prof Makefile.inc
+fi
+
+local patch_pthread=1
+if [ "${patch_pthread}" = "1" ] ; then
+ # add missing link agains pthread library
+ cd ${PRODUCT_SRC_DIR}/src && sed -i "s%^\(LDFLAGS.*\)%\1 -lpthread%g" $(readlink Makefile.inc)
+fi
+
+if [ "${CC}" != "" ] ; then
+ # custom compiler
+ sed -i "s%\(^CCS[[:space:]]*=[[:space:]]*\).*$%\1${CC}%;s%\(^CCD[[:space:]]*=[[:space:]]*\).*$%\1${CC}%;" ${PRODUCT_SRC_DIR}/src/Makefile.inc
+fi
+
if [ "${SALOME_IW_COMPSIZE}" = "1" ] ; then
du -sk ${PRODUCT_SRC_DIR} > ${INST_ROOT}/${PRODUCT_TYPE}.src.size
fi
install_source
# build sources
-cd ${PRODUCT_SRC_DIR}
test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
-cd src
+cd ${PRODUCT_SRC_DIR}/src
-if test `uname -m` = "x86_64" ; then
- # create Makefile for Linux 64bit platforms
- sed -e "s%CFLAGS\([[:space:]]*\)=\([[:space:]]*\)\(.*\)%CFLAGS\1=\2-fPIC \3%g" \
- Make.inc/Makefile.inc.i686_pc_linux2.prof > Make.inc/Makefile.inc.x86-64_pc_linux2.prof
- ln -sf Make.inc/Makefile.inc.x86-64_pc_linux2.prof Makefile.inc
-else
- ln -sf Make.inc/Makefile.inc.i686_pc_linux2.prof Makefile.inc
-fi
+local MAKE_OPTIONS="prefix=${PRODUCT_DIR}"
-local patch_pthread=1
-if [ "${patch_pthread}" = "1" ] ; then
- cd ${PRODUCT_SRC_DIR}/src
- sed -i "s%^\(LDFLAGS.*\)%\1 -lpthread%g" $(readlink Makefile.inc)
-fi
+cat > ${PRODUCT_DIR}/MAKE.LOG <<EOF
+-------------------
+Used options: ${MAKE_OPTIONS}
+-------------------
+EOF
# make
-check_job ${PRODUCT_DIR}/MAKE.LOG make prefix=${PRODUCT_DIR}
+check_job ${PRODUCT_DIR}/MAKE.LOG make ${MAKE_OPTIONS}
# make install
-check_job ${PRODUCT_DIR}/INSTALL.LOG make prefix=${PRODUCT_DIR} install
+check_job ${PRODUCT_DIR}/INSTALL.LOG make ${MAKE_OPTIONS} install
cd ${PRODUCT_DIR}
cd ${PRODUCT_SRC_DIR}
test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG cmake -DCMAKE_INSTALL_PREFIX=${PRODUCT_DIR} -DCMAKE_BUILD_TYPE=Release
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
+local CMAKE_OPTIONS="-DCMAKE_INSTALL_PREFIX=${PRODUCT_DIR} -DCMAKE_BUILD_TYPE=Release"
+cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${CMAKE_OPTIONS}
+-------------------
EOF
-check_job ${PRODUCT_DIR}/MAKE.LOG make
-check_job ${PRODUCT_DIR}/INSTALL.LOG make install
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG cmake ${CMAKE_OPTIONS}
+check_job ${PRODUCT_DIR}/MAKE.LOG make VERBOSE=1
+check_job ${PRODUCT_DIR}/INSTALL.LOG make VERBOSE=1 install
cd ${PRODUCT_DIR}
if test `uname -m` = "x86_64" ; then
SIP_CONFIGURE_OPTIONS="${SIP_CONFIGURE_OPTIONS} -p linux-g++-64"
fi
+if [ "${CXX}" != "" ] ; then
+ # custom gcc
+ SIP_CONFIGURE_OPTIONS="${SIP_CONFIGURE_OPTIONS} CC=${CC} CXX=${CXX} LINK=${CXX} LINK_SHLIB=${CXX}"
+fi
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG python ./configure.py ${SIP_CONFIGURE_OPTIONS}
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
+cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${SIP_CONFIGURE_OPTIONS}
+-------------------
EOF
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG python ./configure.py ${SIP_CONFIGURE_OPTIONS}
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/INSTALL.LOG make install
if test `uname -m` = "x86_64" ; then
SIP_CONFIGURE_OPTIONS="${SIP_CONFIGURE_OPTIONS} -p linux-g++-64"
fi
+if [ "${CXX}" != "" ] ; then
+ SIP_CONFIGURE_OPTIONS="${SIP_CONFIGURE_OPTIONS} CC=${CC} CXX=${CXX} LINK=${CXX} LINK_SHLIB=${CXX}"
+fi
# modify sipconfig.py file
if [ -n "${PYTHON_ROOT_DIR}" ] && [ -n "${QT4_ROOT_DIR}" ] ; then
# build sources
cd ${PRODUCT_SRC_DIR}
-SWIG_CONFIGURE_FLAGS="--with-boost=${BOOST_ROOT_DIR} --with-python=${PYTHON_ROOT_DIR}/bin/python --without-octave --with-tcl=${TCLHOME} --program-suffix=${SWIG_VERSION_SUFFIX}"
+SWIG_CONFIGURE_FLAGS="--prefix=${PRODUCT_DIR} --with-boost=${BOOST_ROOT_DIR} --with-python=${PYTHON_ROOT_DIR}/bin/python --without-octave --with-tcl=${TCLHOME} --program-suffix=${SWIG_VERSION_SUFFIX}"
if test `uname -m` = "x86_64" ; then
SWIG_CONFIGURE_FLAGS="${SWIG_CONFIGURE_FLAGS} CFLAGS=-m64 CXXFLAGS=-m64"
fi
test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR} ${SWIG_CONFIGURE_FLAGS}
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
+cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${SWIG_CONFIGURE_FLAGS}
+-------------------
EOF
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure ${SWIG_CONFIGURE_FLAGS}
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/INSTALL.LOG make install
# build sources
test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
+# ... tcl
+
cd ${PRODUCT_SRC_DIR}/tcl-${VERSION_TCL}_SRC/unix
+
+local TCL_CONFIGURE_FLAGS="--prefix=${PRODUCT_DIR} --enable-gcc --enable-shared --enable-threads"
+if test `uname -m` = "x86_64" ; then
+ TCL_CONFIGURE_FLAGS="${TCL_CONFIGURE_FLAGS} --enable-64bit"
+fi
+
cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
-------------------
Configuring tcl...
+Used options: ${TCL_CONFIGURE_FLAGS}
-------------------
EOF
-local TCL_CONFIGURE_FLAGS="--enable-gcc --enable-shared --enable-threads"
-if test `uname -m` = "x86_64" ; then
- TCL_CONFIGURE_FLAGS="${TCL_CONFIGURE_FLAGS} --enable-64bit"
-fi
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR} ${TCL_CONFIGURE_FLAGS}
-GCC=`which gcc`
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure ${TCL_CONFIGURE_FLAGS}
+
cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
-------------------
Making tcl...
-------------------
EOF
check_job ${PRODUCT_DIR}/MAKE.LOG make
+
cat >> ${PRODUCT_DIR}/MAKEINSTALL.LOG <<EOF
-------------------
Installing tcl...
(cd ${PRODUCT_DIR}/lib && ln -fs libtcl${TCL_LIBVERSION}.so libtcl.so)
(cd ${PRODUCT_DIR}/lib && ln -fs libtclstub${TCL_LIBVERSION}.a libtclstub.a)
+# ... tk
+
cd ${PRODUCT_SRC_DIR}/tk-${VERSION_TK}_SRC/unix
+
+local TK_CONFIGURE_FLAGS="--prefix=${PRODUCT_DIR} --enable-gcc --enable-shared --enable-threads --with-tcl=${PRODUCT_DIR}/lib"
+if test `uname -m` = "x86_64" ; then
+ TK_CONFIGURE_FLAGS="${TK_CONFIGURE_FLAGS} --enable-64bit"
+fi
+
cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
-------------------
Configuring tk...
+Used options: ${TK_CONFIGURE_FLAGS}
-------------------
EOF
-local TK_CONFIGURE_FLAGS="--enable-gcc --enable-shared --enable-threads --with-tcl=${PRODUCT_DIR}/lib"
-if test `uname -m` = "x86_64" ; then
- TK_CONFIGURE_FLAGS="${TK_CONFIGURE_FLAGS} --enable-64bit"
-fi
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR} ${TK_CONFIGURE_FLAGS}
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure ${TK_CONFIGURE_FLAGS}
+
cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-------------------
Making tk...
-------------------
EOF
check_job ${PRODUCT_DIR}/MAKE.LOG make
+
cat >> ${PRODUCT_DIR}/MAKEINSTALL.LOG <<EOF
-------------------
Installing tk...
(cd ${PRODUCT_DIR}/lib && ln -fs libtk${TK_LIBVERSION}.so libtk.so)
(cd ${PRODUCT_DIR}/lib && ln -fs libtkstub${TK_LIBVERSION}.a libtkstub.a)
+# ... tclX
+
+cd ${PRODUCT_SRC_DIR}/tclx-${VERSION_TCLX}_SRC
+
+local TCLX_CONFIGURE_FLAGS="--prefix=${PRODUCT_DIR} --enable-gcc --enable-shared --enable-threads --with-tcl=${PRODUCT_DIR}/lib --with-tk=${PRODUCT_DIR}/lib"
+if test `uname -m` = "x86_64" ; then
+ TCLX_CONFIGURE_FLAGS="${TCLX_CONFIGURE_FLAGS} --enable-64bit"
+fi
+
cat >> ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
-------------------
Configuring tclx...
+Used options: ${TCLX_CONFIGURE_FLAGS}
-------------------
EOF
-local TCLX_CONFIGURE_FLAGS="--enable-gcc --enable-shared --enable-threads --with-tcl=${PRODUCT_DIR}/lib --with-tk=${PRODUCT_DIR}/lib"
-if test `uname -m` = "x86_64" ; then
- TCLX_CONFIGURE_FLAGS="${TCLX_CONFIGURE_FLAGS} --enable-64bit"
-fi
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR} ${TCLX_CONFIGURE_FLAGS}
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure ${TCLX_CONFIGURE_FLAGS}
+
cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-------------------
Making tclx...
-------------------
EOF
check_job ${PRODUCT_DIR}/MAKE.LOG make
+
cat >> ${PRODUCT_DIR}/MAKEINSTALL.LOG <<EOF
-------------------
Installing tclx...
(cd ${PRODUCT_DIR}/lib && ln -fs tclx${TCLX_LIBVERSION}/libtclx${TCLX_LIBVERSION}.so .)
(cd ${PRODUCT_DIR}/lib && ln -fs libtclx${TCLX_LIBVERSION}.so libtclx.so)
-###(cd ${PRODUCT_DIR} && test `uname -m` = "x86_64" && test ! -e lib64 && ln -sf lib lib64)
cd ${PRODUCT_DIR}
# build sources
cd ${PRODUCT_SRC_DIR}
-CONFIGURE_FLAGS=
+local CONFIGURE_FLAGS="--prefix=${PRODUCT_DIR} "
if test `uname -m` = "x86_64" ; then
CONFIGURE_FLAGS="${CONFIGURE_FLAGS} CFLAGS=-m64 CXXFLAGS=-m64"
fi
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR} ${CONFIGURE_FLAGS}
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
+cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${CONFIGURE_FLAGS}
+-------------------
EOF
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure ${CONFIGURE_FLAGS}
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/INSTALL.LOG make install
cd ${PRODUCT_SRC_DIR}
test -z ${SINGLE_DIR} && makedir ${PRODUCT_DIR} || mkdir -p ${PRODUCT_DIR}
-check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure --prefix=${PRODUCT_DIR}
-GCC=`which gcc`
-cat >> ${PRODUCT_DIR}/MAKE.LOG <<EOF
-used gcc=${GCC}
+local CONFIGURE_OPTIONS="--prefix=${PRODUCT_DIR}"
+cat > ${PRODUCT_DIR}/CONFIGURE.LOG <<EOF
+-------------------
+Used options: ${CONFIGURE_OPTIONS}
+-------------------
EOF
+check_job ${PRODUCT_DIR}/CONFIGURE.LOG ./configure ${CONFIGURE_OPTIONS}
check_job ${PRODUCT_DIR}/MAKE.LOG make
check_job ${PRODUCT_DIR}/INSTALL.LOG make install
pass
self.products.extend( req_prods_list )
self.products.extend( sal_prods_list )
- if False and len(self.products) != 0: # VSR 2014-05-21 : not needed anymore
- gcc_product = Product("gcc",
- __CTX__PREREQUISITE__,
- self.products[0].os,
- "",
- [],
- None,
- "0,0,0",
- "gcc-common.sh",
- "")
- gcc_product.setMode(__PREINSTALL__)
- self.products.insert(0, gcc_product)
- prereqs_list.insert(0, gcc_product.name)
- pass
self.full_prods_list.extend( prereqs_list )
self.full_prods_list.extend( modules_list )
pass
}
// add extra products to install list
extraProducts.clear();
- //extraProducts.insert( "gcc", "gcc-common.sh" );
if ( refPlatform == commonPlatform && installType == Binaries )
extraProducts.insert( "DebianLibsForSalome", "DEBIANFORSALOME-3.1.sh" );
}