Issue 0020692: Duplicate check_*.m4 between modules.

This commit is contained in:
ouv 2010-02-11 10:13:13 +00:00
parent a81a21ed79
commit f56f0abee7
4 changed files with 1 additions and 901 deletions

View File

@ -23,7 +23,4 @@ include $(top_srcdir)/adm_local/unix/make_common_starter.am
dist_admlocalm4_DATA = \ dist_admlocalm4_DATA = \
check_GEOM.m4 \ check_GEOM.m4 \
check_GUI.m4 \ check_GUI.m4
check_qt.m4 \
check_opengl.m4 \
check_vtk.m4

View File

@ -1,230 +0,0 @@
dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
AC_DEFUN([CHECK_OPENGL],[
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
AC_REQUIRE([AC_LINKER_OPTIONS])dnl
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_ARG_WITH(opengl,
[AC_HELP_STRING([--with-opengl=DIR],[root directory path of OpenGL installation])],
[opengl_dir="$withval"],
[dirs="/usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib /opt/graphics/OpenGL/lib64 /opt/graphics/OpenGL/lib /usr/openwin/lib64 /usr/openwin/lib /usr/X11R6/lib64 /usr/X11R6/lib"])dnl
AC_CHECKING(for OpenGL)
AC_CHECKING(for OpenGL headers)
OGL_INCLUDES=""
OGL_LIBS=""
GL_LIB_PATH=""
GLU_LIB_PATH=""
OpenGL_ok=no
OpenGL_libs_ok=no
OpenGL_headers_ok=no
dnl openGL headers
# by default
if test "x${opengl_dir}" != "x" ; then
AC_MSG_RESULT(for opengl_dir: $opengl_dir)
AC_CHECK_HEADER([${opengl_dir}/include/GL/gl.h],
[OpenGL_headers_ok=yes; OGL_INCLUDES="-I${opengl_dir}/include"],
[OpenGL_headers_ok=no])
if test "x${OpenGL_headers_ok}" = "xyes" ; then
AC_CHECKING(for default OpenGL library)
if test "x${opengl_dir}" = "x/usr" ; then
OGL_LIBS=""
else
OGL_LIBS="-L${opengl_dir}/lib"
fi
LDFLAGS_old="$LDFLAGS"
LDFLAGS="$LDFLAGS $OGL_LIBS"
AC_CHECK_LIB([GL],
[glBegin],
[OpenGL_libs_ok=yes],
[OpenGL_libs_ok=no])
if test "x${OpenGL_libs_ok}" = "xyes" ; then
AC_TRY_LINK([],
[],
[OpenGL_libs_ok=yes ; OpenGL_ok=yes; OGL_LIBS="$OGL_LIBS -lGL"],
[OpenGL_libs_ok=no])
fi
LDFLAGS="$LDFLAGS_old"
fi
fi
if test "x${OpenGL_headers_ok}" = "xno" ; then
AC_CHECK_HEADER(GL/gl.h,
[OpenGL_headers_ok=yes],
[OpenGL_headers_ok=no])
fi
# under SunOS ?
if test "x${OpenGL_headers_ok}" = "xno" ; then
AC_CHECK_HEADERS(/usr/openwin/share/include/GL/glxmd.h,
[OpenGL_headers_ok=yes; OGL_INCLUDES="-I/usr/openwin/share/include/"],
[OpenGL_headers_ok=no])
fi
# under IRIX ?
if test "x${OpenGL_headers_ok}" = "xno" ; then
AC_CHECK_HEADERS(/opt/graphics/OpenGL/include/GL/glxmd.h,
[OpenGL_headers_ok=yes; OGL_INCLUDES="-I/opt/graphics/OpenGL/include"],
[OpenGL_headers_ok=no])
fi
# some linux OpenGL servers hide the includes in /usr/X11R6/include/GL
if test "x${OpenGL_headers_ok}" = "xno" ; then
AC_CHECK_HEADERS(/usr/X11R6/include/GL/gl.h,
[OpenGL_headers_ok=yes; OGL_INCLUDES="-I/usr/X11R6/include"],
[OpenGL_headers_ok=no])
fi
if test "x${OpenGL_headers_ok}" = "xyes" ; then
AC_CHECKING(for OpenGL library)
for idir in $dirs; do
if test -r "${idir}/libGL.so"; then
AC_MSG_RESULT(in ${idir})
if test "x${idir}" = "x/usr/lib64" -o "x${idir}" = "x/usr/lib" ; then
GL_LIB_PATH=""
else
GL_LIB_PATH="-L${idir}"
fi
break
fi
# under IRIX ?
if test -r "${idir}/libGL.sl"; then
AC_MSG_RESULT(in ${idir})
if test "x${idir}" = "x/usr/lib64" -o "x${idir}" = "x/usr/lib" ; then
GL_LIB_PATH=""
else
GL_LIB_PATH="-L${idir}"
fi
break
fi
done
LDFLAGS_old="${LDFLAGS}"
LDFLAGS="${LDFLAGS} ${GL_LIB_PATH}"
AC_CHECK_LIB([GL],
[glBegin],
[OpenGL_libs_ok=yes],
[OpenGL_libs_ok=no])
if test "x${OpenGL_libs_ok}" = "xyes" ; then
AC_TRY_LINK([],
[],
[OpenGL_libs_ok=yes ; OGL_LIBS="${OGL_LIBS} ${GL_LIB_PATH} -lGL"],
[OpenGL_libs_ok=no])
fi
LDFLAGS="$LDFLAGS_old"
fi
if test "x${OpenGL_libs_ok}" = "xyes" ; then
for idir in $dirs; do
if test -r "${idir}/libGLU.so"; then
AC_MSG_RESULT(in ${idir})
if test "x${idir}" = "x/usr/lib64" -o "x${idir}" = "x/usr/lib" ; then
GLU_LIB_PATH=""
else
GLU_LIB_PATH="-L${idir}"
fi
break
fi
# under IRIX ?
if test -r "${idir}/libGLU.sl"; then
AC_MSG_RESULT(in ${idir})
if test "x${idir}" = "x/usr/lib64" -o "x${idir}" = "x/usr/lib" ; then
GLU_LIB_PATH=""
else
GLU_LIB_PATH="-L${idir}"
fi
break
fi
done
# workaround a problem with libGL library location
for idir in $dirs; do
if test -r "${idir}/libGLU.la"; then
GLU_LA_PATH="${idir}/libGLU.la"
GL_LA_PATH_TO_CHECK=`cat ${GLU_LA_PATH} | awk '{ for(i=1;i<NF;i++){ if(gsub("libGL.la","&",$i)>0) print $i } }'`
if test -z ${GL_LA_PATH_TO_CHECK} || test -r ${GL_LA_PATH_TO_CHECK}; then
# nothing to do
break
fi
for jdir in $dirs; do
if test -r "${jdir}/libGL.la"; then
GL_LA_PATH="${jdir}/libGL.la"
# copy the libGLU.la file and set correct libGL.la path in it
NEW_GLU_LA_PATH=${ROOT_BUILDDIR}
NEW_GLU_LA_FILE="${NEW_GLU_LA_PATH}/libGLU.la"
sed -e "s%${GL_LA_PATH_TO_CHECK}%${GL_LA_PATH}%" ${GLU_LA_PATH} > "${NEW_GLU_LA_FILE}"
chmod -f --reference=${GLU_LA_PATH} "${NEW_GLU_LA_FILE}"
# set a new libGLU.la path
GLU_LIB_PATH="-L${NEW_GLU_LA_PATH}"
# create a simbolic link to libGLU.so
for kdir in $dirs; do
if test -r "${kdir}/libGLU.so"; then
cp -fs "${kdir}/libGLU.so" "${NEW_GLU_LA_PATH}/libGLU.so"
break
fi
done
break
fi
done
break
fi
done
LDFLAGS_old="${LDFLAGS}"
LDFLAGS="${LDFLAGS} ${OGL_LIBS} ${GLU_LIB_PATH}"
AC_CHECK_LIB([GLU],
[gluBeginSurface],
[OpenGL_libs_ok=yes],
[OpenGL_libs_ok=no])
if test "x${OpenGL_libs_ok}" = "xyes" ; then
AC_TRY_LINK([],
[],
[OpenGL_libs_ok=yes ; OGL_LIBS="${OGL_LIBS} ${GLU_LIB_PATH} -lGLU"],
[OpenGL_libs_ok=no])
fi
LDFLAGS="$LDFLAGS_old"
fi
if test "x${OpenGL_headers_ok}" = "xyes" ; then
if test "x${OpenGL_libs_ok}" = "xyes" ; then
OpenGL_ok=yes
fi
fi
AC_MSG_RESULT(for OpenGL_headers_ok: $OpenGL_headers_ok)
AC_MSG_RESULT(for OpenGL_libs_ok: $OpenGL_libs_ok)
AC_MSG_RESULT(for OpenGL_ok: $OpenGL_ok)
AC_SUBST(OGL_INCLUDES)
AC_SUBST(OGL_LIBS)
AC_LANG_RESTORE
])dnl

View File

@ -1,432 +0,0 @@
dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
dnl OPTIONS_QT
dnl ------------------------------------------------------------------------
dnl Adds the --with-qt=path
dnl
AC_DEFUN([OPTIONS_QT], [
AC_ARG_WITH([qt],
[AC_HELP_STRING([--with-qt], [Possible usage:
"Qt_Install_Path" - prefix to path where Qt was installd;
"" or "yes" or "auto" - means seaching installed Qt product in the system (checking $QTDIR and then - standard system paths );
"no" - not use Qt product (is not supported)
By default "" option is used)])],
[with_qt=$withval], [with_qt=""])
])
AC_DEFUN([CHECK_QT],[
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CXX])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
AC_REQUIRE([AC_PROG_CXXCPP])dnl
AC_REQUIRE([CHECK_OPENGL])dnl
AC_REQUIRE([AC_LINKER_OPTIONS])dnl
AC_REQUIRE([OPTIONS_QT])dnl
AC_CHECKING(for Qt)
if test "x$OpenGL_ok" != "xyes" ; then
AC_MSG_WARN(Qt needs OpenGL correct configuration, check configure output)
fi
qt_ok=yes
QTDIR=$(echo $QTDIR | sed 's%[/]\+$%%')
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
dnl QT install dir
if test -z $with_qt ; then
with_qt=""
fi
if test "x$with_qt" = "xyes" ; then
dnl in case user wrote --with-qt=yes
with_qt=""
fi
if test "x$with_qt" = "xauto" ; then
dnl in case user wrote --with-qt=auto
with_qt=""
fi
if test "x$with_qt" = "xno" ; then
dnl in case user wrote --with-qt=no
with_qt=""
AC_MSG_WARN(Value no, specified for option --with-qt, is not supported)
fi
if test "x$with_qt" != "x" ; then
dnl Using "--with-qt" prefix path
QTDIR="$with_qt"
elif test "$QTDIR" = "/usr/lib/qt3" ; then
dnl Using QTDIR environment variable
AC_MSG_RESULT(current QTDIR is $QTDIR)
dnl
if test -d /usr/lib/qt4 ; then
AC_MSG_RESULT(it is strange for a qt4 installation !)
AC_MSG_RESULT(/usr/lib/qt4 is present)
AC_MSG_RESULT(replacing QTDIR by /usr/lib/qt4)
QTDIR=/usr/lib/qt4
fi
elif test -z $QTDIR ; then
AC_MSG_WARN(undefined QTDIR variable which specify where Qt product was installed)
for d in /usr/local/lib/qt4 /usr/lib/qt4 /usr ; do
if test -f ${d}/lib/libQtCore.so ; then
AC_MSG_RESULT(trying ${d})
QTDIR="${d}"
break
elif test -f ${d}/lib64/libQtCore.so ; then
AC_MSG_RESULT(trying ${d})
QTDIR="${d}"
break
elif test -f ${d}/libQtCore.so ; then
AC_MSG_RESULT(trying ${d})
QTDIR="${d}"
break
fi
done
fi
#
# check QTDIR environment variable
#
if test "x$QTDIR" = "x"
then
AC_MSG_RESULT(Please define correct path in "--with-qt" option or use correct $QTDIR variable)
qt_ok=no
fi
#
# check Qt version
#
if test "x$qt_ok" = "xyes"
then
qt_inc_ok=no
QTINC=""
AC_CHECK_FILE(${QTDIR}/include/qt4/QtCore/qglobal.h,QTINC="/qt4",QTINC="")
if test "x$QTINC" = "x"
then
AC_CHECK_FILE(${QTDIR}/include${QTINC}/QtCore/qglobal.h,qt_inc_ok=yes,qt_inc_ok=no)
else
qt_inc_ok=yes
fi
if test "x$qt_inc_ok" = "xyes"
then
AC_MSG_CHECKING(whether Qt version >= 4.0)
QT_VERSION=`grep "QT_VERSION_STR" ${QTDIR}/include${QTINC}/QtCore/qglobal.h | sed -e 's%^#define QT_VERSION_STR[[:space:]]*\"\([[:digit:]\.]*\)\"%\1%g'`
QT_VERSION_ID=`echo $QT_VERSION | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
if test $QT_VERSION_ID -ge 40000
then
AC_MSG_RESULT(yes)
else
AC_MSG_RESULT(no)
qt_ok=no
fi
AC_MSG_CHECKING(Qt version)
AC_MSG_RESULT($QT_VERSION)
else
qt_ok=no
fi
fi
#
# check moc presence (meta-object compiler)
#
if test "x$qt_ok" = "xyes"
then
if test -f ${QTDIR}/bin/moc
then
MOC=${QTDIR}/bin/moc
else
AC_PATH_PROG(MOC, moc)
fi
if test "x$MOC" = "x"
then
qt_ok=no
AC_MSG_RESULT(moc (Qt meta-object compiler) is not in the PATH variable)
else
qt_ok=yes
AC_MSG_RESULT(moc (Qt meta-object compiler) is found)
fi
if test "x$qt_ok" = "xyes"
then
dnl check moc version
AC_MSG_CHECKING(cheching equality Qt and moc tool version)
MOC_VERSION=`$MOC -v 2>&1 | awk 'BEGIN{FS="[[ ()]]"};{print $(NF-1)}'`
if test "x$QT_VERSION" = "x$MOC_VERSION"
then
AC_MSG_RESULT(yes)
qt_ok=yes
else
AC_MSG_RESULT(moc tool and Qt product are incompatible $MOC_VERSION)
qt_ok=no
fi
fi
fi
#
# check uic presence (user interface compiler)
#
if test "x$qt_ok" = "xyes"
then
if test -f ${QTDIR}/bin/uic
then
UIC=${QTDIR}/bin/uic
else
AC_PATH_PROG(UIC, uic)
fi
if test "x$UIC" = "x"
then
qt_ok=no
AC_MSG_RESULT(uic (Qt user interface compiler) is not in the PATH variable)
else
qt_ok=yes
AC_MSG_RESULT(uic (Qt user interface compiler) is found)
fi
fi
#
# check rcc presence (resources compiler)
#
if test "x$qt_ok" = "xyes"
then
if test -f ${QTDIR}/bin/rcc
then
QRCC=${QTDIR}/bin/rcc
else
AC_PATH_PROG(QRCC, rcc)
fi
if test "x$QRCC" = "x"
then
qt_ok=no
AC_MSG_RESULT(rcc (Qt resources compiler) is not in the PATH variable)
else
qt_ok=yes
AC_MSG_RESULT(rcc (Qt resources compiler) is found)
fi
if test "x$qt_ok" = "xyes"
then
dnl check rcc version
AC_MSG_CHECKING(cheching equality Qt and rcc tool version)
QRCC_VERSION=`$QRCC -v 2>&1 | awk '{print $NF}'`
if test "x$QT_VERSION" = "x$QRCC_VERSION"
then
AC_MSG_RESULT(yes)
qt_ok=yes
else
AC_MSG_RESULT(rcc tool and Qt product are incompatible)
qt_ok=no
fi
fi
fi
#
# check lrelease presence (translation files compiler)
#
if test "x$qt_ok" = "xyes"
then
if test -f ${QTDIR}/bin/lrelease
then
LRELEASE=${QTDIR}/bin/lrelease
else
AC_PATH_PROG(LRELEASE, lrelease)
fi
if test "x$LRELEASE" = "x"
then
qt_ok=no
AC_MSG_RESULT(lrelease (Qt translation files compiler) is not in the PATH variable)
else
qt_ok=yes
AC_MSG_RESULT(lrelease (Qt translation files compiler) is found)
fi
if test "x$qt_ok" = "xyes"
then
dnl check lrelease version
AC_MSG_CHECKING( equality of Qt and lrelease tool version)
LRELEASE_VERSION=`$LRELEASE -version 2>&1 | awk '{print $NF}'`
if test "x$QT_VERSION" = "x$LRELEASE_VERSION"
then
AC_MSG_RESULT(yes)
qt_ok=yes
else
AC_MSG_RESULT(lrelease tool and Qt product are incompatible)
qt_ok=no
fi
fi
fi
QT_ROOT=$QTDIR
#
# check Qt header files
#
if test "x$qt_ok" = "xyes"
then
AC_CHECKING(include Qt header files)
CPPFLAGS_old=$CPPFLAGS
CPPFLAGS="$CPPFLAGS -I${QTDIR}/include${QTINC} -I${QTDIR}/include${QTINC}/QtCore"
AC_CHECK_HEADER(QObject,qt_ok=yes,qt_ok=no)
CPPFLAGS=$CPPFLAGS_old
if test "x$qt_ok" = "xno"
then
AC_MSG_RESULT(qt header files are not found in $QTDIR/include${QTINC}/QtCore)
AC_MSG_RESULT(QTDIR environment variable may be wrong (probably too old Qt version))
else
AC_MSG_RESULT(qt header files seem to be OK)
QT_INCLUDES="-I${QTDIR}/include${QTINC}"
# user header files
QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtCore"
QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtGui"
QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtOpenGL"
QT_INCLUDES="${QT_INCLUDES} -I${QTDIR}/include${QTINC}/QtXml"
# not used currently header files (uncomment if required)
#QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtAssistant"
#QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtDBus"
#QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtDesigner"
#QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtNetwork"
#QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtSql"
#QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtSvg"
#QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtTest"
#QT_INCLUDES="${QT_INCLUDES} -I$(QTDIR)/include${QTINC}/QtUiTools"
QT_ASSISTANT_INCLUDES="${QT_ASSISTANT_INCLUDES} -I${QTDIR}/include${QTINC}/QtAssistant"
QT_ASSISTANT_INCLUDES="${QT_ASSISTANT_INCLUDES} -I${QTDIR}/include${QTINC}/QtNetwork"
# this flag is obsolete with Qt 4
QT_MT_INCLUDES="$QT_INCLUDES"
fi
fi
#
# test Qt libraries
#
if test "x$qt_ok" = "xyes"
then
AC_MSG_CHECKING(linking against Qt library)
CXXFLAGS_old=$CXXFLAGS
CXXFLAGS="$CXXFLAGS $QT_INCLUDES"
LIBS_old=$LIBS
if test "x$QTDIR" = "x/usr" ; then
QT_LIB_DIR=""
elif test -d ${QTDIR}/lib; then
QT_LIB_DIR="-L$QTDIR/lib"
elif test -d ${QTDIR}/lib64; then
QT_LIB_DIR="-L$QTDIR/lib64"
elif test "x$QTDIR" = "x/usr/lib/qt4" ; then
QT_LIB_DIR=""
else
AC_MSG_ERROR(Can't detect of Qt library directory )
qt_ok=no
fi
LIBS="$LIBS $QT_LIB_DIR -lQtCore"
AC_CACHE_VAL(salome_cv_lib_qt,[
AC_TRY_LINK(
#include <QCoreApplication>
, int n;
char **s;
QCoreApplication a(n, s);
a.exec();,
eval "salome_cv_lib_qt=yes",eval "salome_cv_lib_qt=no")
])
qt_ok="$salome_cv_lib_qt"
# BEGIN: for CCRT (installation of qt have only a "lib" directory)
if test "x$qt_ok" = "xno"
then
QT_LIB_DIR="-L$QTDIR/lib"
LIBS="$LIBS_old $QT_LIB_DIR -lQtCore"
AC_CACHE_VAL(salome_cv_lib_qt,[
AC_TRY_LINK(
#include <QCoreApplication>
, int n;
char **s;
QCoreApplication a(n, s);
a.exec();,
eval "salome_cv_lib_qt=yes",eval "salome_cv_lib_qt=no")
])
qt_ok="$salome_cv_lib_qt"
fi
# END: for CCRT
if test "x$qt_ok" = "xno"
then
AC_MSG_RESULT(no)
AC_MSG_RESULT(unable to link with qt library)
AC_MSG_RESULT(QTDIR environment variable may be wrong (probably too old Qt version))
else
AC_MSG_RESULT(yes)
# core libs
QT_CORE_LIBS="$QT_LIB_DIR -lQtCore -lQtXml"
# gui libs
QT_GUI_LIBS="$QT_LIB_DIR -lQtGui -lQtOpenGL"
# other libs (currently not used)
QT_OTHER_LIBS="$QT_LIB_DIR"
# other libs (can be used if necessary)
#QT_OTHER_LIBS="$QT_LIB_DIR -lQt3Support -lQtAssistantClient -lQtDesigner -lQtNetwork -lQtSql -lQtSvg -lQtTest -ltQtUiTools"
QT_ASSISTANT_LIBS="$QT_LIB_DIR -lQtAssistantClient -lQtNetwork"
# all libs
QT_LIBS="$QT_CORE_LIBS $QT_GUI_LIBS $QT_OTHER_LIBS"
# this flag is obsolete with Qt 4
QT_MT_LIBS="$QT_LIBS"
fi
LIBS=$LIBS_old
CXXFLAGS=$CXXFLAGS_old
fi
AC_SUBST(QTDIR)
AC_SUBST(MOC)
AC_SUBST(UIC)
AC_SUBST(QRCC)
AC_SUBST(LRELEASE)
AC_SUBST(QT_ROOT)
AC_SUBST(QT_INCLUDES)
AC_SUBST(QT_MT_INCLUDES)
AC_SUBST(QT_ASSISTANT_INCLUDES)
AC_SUBST(QT_LIB_DIR)
AC_SUBST(QT_CORE_LIBS)
AC_SUBST(QT_GUI_LIBS)
AC_SUBST(QT_OTHER_LIBS)
AC_SUBST(QT_LIBS)
AC_SUBST(QT_MT_LIBS)
AC_SUBST(QT_ASSISTANT_LIBS)
AC_SUBST(QT_VERSION)
AC_SUBST(QT_VERSION_ID)
AC_LANG_RESTORE
AC_MSG_RESULT(for Qt: $qt_ok)
# Save cache
AC_CACHE_SAVE
])dnl
dnl

View File

@ -1,235 +0,0 @@
dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
dnl
dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
dnl
dnl This library is free software; you can redistribute it and/or
dnl modify it under the terms of the GNU Lesser General Public
dnl License as published by the Free Software Foundation; either
dnl version 2.1 of the License.
dnl
dnl This library is distributed in the hope that it will be useful,
dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
dnl Lesser General Public License for more details.
dnl
dnl You should have received a copy of the GNU Lesser General Public
dnl License along with this library; if not, write to the Free Software
dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
dnl
dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
dnl
dnl OPTIONS_VTK
dnl ------------------------------------------------------------------------
dnl Adds the --with-vtk=path and --with-vtk-version configure options
dnl
AC_DEFUN([OPTIONS_VTK], [
AC_ARG_WITH([vtk],
[AC_HELP_STRING([--with-vtk], [The prefix where VTK is installed (default "" means taking from environment variable)])],
[with_vtk=$withval], [with_vtk=""])
AC_ARG_WITH([vtk-version],
[AC_HELP_STRING([--with-vtk-version], [VTK include directory name is vtk-suffix, e.g. vtk-5.0/. What is the suffix? (Default "yes" means taking from environment variable)])],
[vtk_suffix=$withval], [vtk_suffix="yes"])
AC_ARG_WITH([paraview],
[AC_HELP_STRING([--with-paraview], [ParaView from the specified location is used instead of VTK (default "" means ParaView should not be used)])])
])
dnl
dnl CHECK_VTK
dnl ------------------------------------------------------------------------
dnl
AC_DEFUN([CHECK_VTK], [
AC_REQUIRE([AC_PROG_CC])dnl
AC_REQUIRE([AC_PROG_CXX])dnl
AC_REQUIRE([AC_PROG_CPP])dnl
AC_REQUIRE([AC_PROG_CXXCPP])dnl
AC_REQUIRE([AC_LINKER_OPTIONS])dnl
AC_REQUIRE([OPTIONS_VTK])dnl
AC_CHECKING(for VTK)
AC_LANG_SAVE
AC_LANG_CPLUSPLUS
AC_SUBST(VTK_INCLUDES)
AC_SUBST(VTK_LIBS)
AC_SUBST(VTKPY_MODULES)
VTK_INCLUDES=""
VTK_LIBS=""
VTKPY_MODULES=""
vtk_ok=no
if test "x$OpenGL_ok" != "xyes" ; then
AC_MSG_WARN(VTK needs OpenGL correct configuration, check configure output)
fi
AC_PATH_X
if test "x$x_libraries" != "x"
then
LXLIB="-L$x_libraries"
else
LXLIB=""
fi
if test "x$x_libraries" = "x/usr/lib"
then
LXLIB=""
fi
if test "x$x_libraries" = "x/usr/lib${LIB_LOCATION_SUFFIX}"
then
LXLIB=""
fi
LOCAL_INCLUDES="$OGL_INCLUDES"
LOCAL_LIBS="-lvtkCommon -lvtkGraphics -lvtkImaging -lvtkFiltering -lvtkIO -lvtkRendering -lvtkHybrid -lvtkParallel -lvtkWidgets $LXLIB -lX11 -lXt"
TRY_LINK_LIBS="-lvtkCommon $LXLIB -lX11 -lXt"
dnl VTK version suffix
if test -z $vtk_suffix ; then
vtk_suffix="yes"
fi
if test "x$vtk_suffix" == "xno" ; then
dnl in case user wrote --with-vtk-version=no, use empty suffix
vtk_suffix=""
fi
if test "x$vtk_suffix" != "xyes" ; then
VTKSUFFIX="$vtk_suffix"
else
dnl in case user wrote --with-vtk-version=yes, get the suffix from env
if test -z $VTKSUFFIX ; then
VTKSUFFIX="-5.0"
fi
fi
dnl VTK install dir
if test -z $with_vtk ; then
with_vtk=""
fi
if test "x$with_vtk" = "xyes" ; then
dnl in case user wrote --with-vtk=yes
with_vtk=""
fi
if test "x$with_vtk" = "xno" ; then
dnl in case user wrote --with-vtk=no
with_vtk=""
AC_MSG_WARN(Value "no", specified for option --with-vtk, is not supported)
fi
if test "x$with_vtk" != "x" ; then
VTKHOME="$with_vtk"
else
if test -z $VTKHOME ; then
AC_MSG_WARN(undefined VTKHOME variable which specify where vtk was compiled)
for d in /usr/local /usr ; do
if test -f ${d}/include/vtk${VTKSUFFIX}/vtkPlane.h ; then
AC_MSG_RESULT(trying ${d})
VTKHOME="${d}"
break
fi
if test -f ${d}/include/vtk-5.0/vtkPlane.h ; then
AC_MSG_RESULT(trying ${d})
VTKHOME="${d}"
VTKSUFFIX="-5.0"
break
fi
if test -f ${d}/include/vtk-5.2/vtkPlane.h ; then
AC_MSG_RESULT(trying ${d})
VTKHOME="${d}"
VTKSUFFIX="-5.2"
break
fi
if test -f ${d}/include/vtk/vtkPlane.h ; then
AC_MSG_RESULT(trying ${d})
VTKHOME="${d}"
VTKSUFFIX=""
break
fi
done
fi
fi
# Using regular VTK installation
if test "x$with_paraview" = "x" ; then
LOCAL_INCLUDES="-I$VTKHOME/include/vtk${VTKSUFFIX} $LOCAL_INCLUDES"
LOCAL_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX}/vtk${VTKSUFFIX} $LOCAL_LIBS"
TRY_LINK_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX} -L$VTKHOME/lib${LIB_LOCATION_SUFFIX}/vtk${VTKSUFFIX} $TRY_LINK_LIBS"
if test "x$VTKHOME" != "x/usr" ; then
LOCAL_LIBS="-L$VTKHOME/lib${LIB_LOCATION_SUFFIX} $LOCAL_LIBS"
fi
else
# VTK from ParaView overrides other VTK versions
if test "${with_paraview}" = "yes" ; then
if test -z $PVHOME ; then
PVHOME="/usr"
fi
else
PVHOME=${with_paraview}
fi
LOCAL_INCLUDES="-I$PVHOME/include/paraview-$PVVERSION $LOCAL_INCLUDES"
LOCAL_LIBS="-L$PVHOME/lib/paraview-$PVVERSION -lvtksys -lvtkzlib -lvtkpng -lvtkjpeg -lvtktiff -lvtkexpat -lvtksqlite -lvtkmetaio -lvtkverdict -lvtkNetCDF -lvtkDICOMParser -lvtkfreetype -lvtkftgl -lvtkexoIIc $LOCAL_LIBS"
TRY_LINK_LIBS="-L$PVHOME/lib/paraview-$PVVERSION -lvtksys $TRY_LINK_LIBS"
fi
dnl vtk headers
CPPFLAGS_old="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $LOCAL_INCLUDES"
AC_CHECK_HEADER(vtkPlane.h,vtk_ok="yes",vtk_ok="no")
CPPFLAGS="$CPPFLAGS_old"
if test "x$vtk_ok" = "xyes"
then
VTK_INCLUDES="$LOCAL_INCLUDES"
dnl vtk libraries
AC_MSG_CHECKING(linking VTK library)
LIBS_old="$LIBS"
LIBS="$LIBS $TRY_LINK_LIBS"
#LIBS="$LIBS $LOCAL_LIBS"
CPPFLAGS_old="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $VTK_INCLUDES"
dnl VTKPY_MODULES="$VTKHOME/python"
AC_CACHE_VAL(salome_cv_lib_vtk,[
AC_TRY_LINK([#include "vtkPlane.h"
],
[vtkPlane::New()],
[salome_cv_lib_vtk=yes],
[salome_cv_lib_vtk=no])
])
vtk_ok="$salome_cv_lib_vtk"
LIBS="$LIBS_old"
CPPFLAGS="$CPPFLAGS_old"
fi
if test "x$vtk_ok" = "xno"
then
AC_MSG_RESULT(no)
AC_MSG_WARN(unable to link with vtk library)
else
AC_MSG_RESULT(yes)
VTK_LIBS="$LOCAL_LIBS"
VTK_MT_LIBS="$LOCAL_LIBS"
fi
AC_MSG_RESULT(for VTK: $vtk_ok)
AC_LANG_RESTORE
# Save cache
AC_CACHE_SAVE
])dnl