From 111162e08902b2c0f564bd077396d116acedfdb9 Mon Sep 17 00:00:00 2001 From: vsr Date: Sat, 24 May 2008 16:36:24 +0000 Subject: [PATCH] Support Scientific Linux 5.1 64bit --- config_files/VTK-4.4.2.sh | 37 ++++++++++++++++------- config_files/common.sh | 62 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 88 insertions(+), 11 deletions(-) diff --git a/config_files/VTK-4.4.2.sh b/config_files/VTK-4.4.2.sh index f9781d4..e448514 100755 --- a/config_files/VTK-4.4.2.sh +++ b/config_files/VTK-4.4.2.sh @@ -150,8 +150,8 @@ VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_LIBRARY:STRING=${tcl_libs}/libtk${tcl VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_STUB_LIBRARY:STRING=${tcl_libs}/libtkstub${tcl_version}.a" VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DTK_WISH:STRING=${TCLHOME}/bin/wish${tcl_version}" fi -### if Mesa is pre-installed if [ -n "$MESA_HOME" ]; then + ### if Mesa is pre-installed VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_INCLUDE_DIR:STRING=${MESA_HOME}/include" if test `uname -m` = "x86_64" ; then VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_gl_LIBRARY:STRING=${MESA_HOME}/lib64/libGL.so" @@ -161,6 +161,16 @@ if [ -n "$MESA_HOME" ]; then VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_glu_LIBRARY:STRING=${MESA_HOME}/lib/libGLU.so" fi VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_xmesa_INCLUDE_DIR:STRING=${MESA_HOME}/include" +else + ### else force path to the OpenGL libs + gllib="`find_gl_lib`" + if [ "$gllib" != "" ] ; then + VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_gl_LIBRARY:STRING=$gllib" + fi + glulib="`find_glu_lib`" + if [ "$glulib" != "" ] ; then + VTK_CMAKE_OPTIONS=$VTK_CMAKE_OPTIONS" -DOPENGL_glu_LIBRARY:STRING=$glulib" + fi fi cat > ${PRODUCT_DIR}/CONFIGURE.LOG < ${PRODUCT_DIR}/size.log #du -sk ${INSTALL_WORK}/cmake-1.6.6 >> ${PRODUCT_DIR}/size.log diff --git a/config_files/common.sh b/config_files/common.sh index 41821f7..4599f84 100755 --- a/config_files/common.sh +++ b/config_files/common.sh @@ -607,6 +607,68 @@ echo "" return 1 } +where_glu_libs(){ +# search libGLU.so* file and correct libGLU.la in the same directory +for d in /usr/X11R6/lib64 /usr/lib64 /usr/X11R6/lib /usr/lib ; do + if [ "`ls ${d}/libGLU.so* 2>/dev/null`" ] && [ -f ${d}/libGLU.la ]; then + libdir=`grep "libdir=" ${d}/libGLU.la | sed -e "s%libdir='\(.*\)'%\1%" -e "s%/*$%%g"` + if [ "$libdir" == "$d" ] ; then + echo "$d" + return 0 + fi + fi +done +# search libGLU.la file and check if this file is correct +for d in /usr/X11R6/lib64 /usr/lib64 /usr/X11R6/lib /usr/lib ; do + if [ -f ${d}/libGLU.la ] ; then + libdir=`grep "libdir=" ${d}/libGLU.la | sed -e "s%libdir='\(.*\)'%\1%"` + if [ "`ls $libdir/libGLU.so* 2>/dev/null`" ] ; then + echo "$d" + return 0 + fi + fi +done +# then search libGLU.so* file +for d in /usr/X11R6/lib64 /usr/lib64 /usr/X11R6/lib /usr/lib ; do + if [ "`ls ${d}/libGLU.so* 2>/dev/null`" ] ; then + echo "$d" + return 0 + fi +done +echo "" +return 1 +} + +find_gl_lib(){ +# get path to the libGL.so* library +gllibdir="`where_gl_libs`" +if [ "$gllibdir" != "" ] ; then + files=`ls ${gllibdir}/libGL.so* 2>/dev/null` + files=`echo $files | awk '{print $1}'` + if [ "$files" != "" ] ; then + echo $files + return 0 + fi +fi +echo "" +return 1 +} + +find_glu_lib(){ +# get path to the libGLU.so* library +glulibdir="`where_glu_libs`" +if [ "$glulibdir" != "" ] ; then + files=`ls ${glulibdir}/libGLU.so* 2>/dev/null` + files=`echo $files | awk '{print $1}'` + if [ "$files" != "" ] ; then + echo $files + return 0 + fi +fi +echo "" +return 1 +} + where_xmu_includes(){ # search Xmu.h for d in /usr/X11R6/include/X11 /usr/include/X11 ; do -- 2.39.2