--- /dev/null
+dnl Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+dnl
+dnl
+dnl
+dnl @synopsis AC_CXX_OPTION(-option,variable where we add option if ok,action if ok; action if not ok)
+dnl
+dnl Check options for C++ compiler
+dnl
+dnl @author Bernard Secher - 15/01/2004
+dnl
+AC_DEFUN([AC_CXX_OPTION], [
+ AC_MSG_CHECKING(wether $CXX accepts $1)
+ cat > conftest.cxx <<EOF
+int main() { return 0; }
+EOF
+ $CXX $1 conftest.cxx > conftest.log 2>&1
+ var=`echo $1 | sed -e "s, .*$,," | sed -e "s,^-,,"`
+#CCRT if ! grep -e $var conftest.log > /dev/null 2>&1 ; then
+ if grep -e $var conftest.log > /dev/null 2>&1 ; then
+ AC_MSG_RESULT(no)
+ eval $4
+ else
+ AC_MSG_RESULT(yes)
+ $2="${$2} $1"
+ eval $3
+ fi
+])
+
+
--- /dev/null
+dnl Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+dnl
+dnl
+dnl
+dnl @synopsis AC_LINKER_OPTIONS
+dnl
+dnl Check warning flags for C++ compiler to control warning messages
+dnl
+dnl @author Bernard Secher (CEA) - 04/12/2003
+dnl
+AC_DEFUN([AC_LINKER_OPTIONS],[
+
+ AC_CHECKING(for LIB_LOCATION_SUFFIX)
+ LIB_LOCATION_SUFFIX=""
+ case "$build_cpu" in
+ x86_64*) LIB_LOCATION_SUFFIX="64" ;;
+ *) LIB_LOCATION_SUFFIX="" ;;
+ esac
+ AC_SUBST(LIB_LOCATION_SUFFIX)
+ AC_MSG_RESULT(LIB_LOCATION_SUFFIX is $LIB_LOCATION_SUFFIX)
+
+ for opt in "-Xlinker -export-dynamic" -transitive_link; do
+ AC_CXX_OPTION($opt,LDEXPDYNFLAGS,flag=yes,flag=no)
+ if test "$flag" = "yes"; then
+ break
+ fi
+ done
+ AC_SUBST(LDEXPDYNFLAGS)
+
+dnl
+ case $host_os in
+ osf*)
+ STDLIB="-lcxxstd"
+ ;;
+ *)
+ STDLIB="-lstdc++"
+ ;;
+ esac
+ AC_SUBST(STDLIB)
+])
--- /dev/null
+dnl Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+dnl
+dnl
+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/lib${LIB_LOCATION_SUFFIX} /usr/local/lib${LIB_LOCATION_SUFFIX} /opt/graphics/OpenGL/lib${LIB_LOCATION_SUFFIX} /usr/openwin/lib${LIB_LOCATION_SUFFIX} /usr/X11R6/lib${LIB_LOCATION_SUFFIX}"])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/lib${LIB_LOCATION_SUFFIX}" ; 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/lib${LIB_LOCATION_SUFFIX}" ; 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/lib${LIB_LOCATION_SUFFIX}" ; 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/lib${LIB_LOCATION_SUFFIX}" ; then
+ GLU_LIB_PATH=""
+ else
+ GLU_LIB_PATH="-L${idir}"
+ fi
+ 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
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_CHECKING(for Qt)
+
+if test "x$OpenGL_ok" != "xyes" ; then
+ AC_MSG_WARN(Qt needs OpenGL correct configuration, check configure output)
+fi
-AC_CHECKING(for QT)
qt_ok=yes
AC_LANG_SAVE
qt_ok=no
else
AC_MSG_RESULT(QTDIR is $QTDIR)
- QT_VERS=`grep "QT_VERSION_STR" ${QTDIR}/include/qglobal.h | sed -e 's%^#define QT_VERSION_STR\([[:space:]]*\)%%g' -e 's%\"%%g'`
+ qt_inc_ok=no
+ QTINC=""
+ AC_CHECK_FILE(${QTDIR}/include/qt3/qglobal.h,QTINC="/qt3",QTINC="")
+ QT_VERS=`grep "QT_VERSION_STR" ${QTDIR}/include${QTINC}/qglobal.h | sed -e 's%^#define QT_VERSION_STR\([[:space:]]*\)%%g' -e 's%\"%%g'`
AC_MSG_RESULT(Qt version is $QT_VERS)
QT_VERS="Qt_"`echo $QT_VERS | sed -e 's%\"%%g' -e 's%\.%_%g'`
fi
if test "x$qt_ok" = "xyes"
then
CPPFLAGS_old=$CPPFLAGS
- CPPFLAGS="$CPPFLAGS -I$QTDIR/include"
+ CPPFLAGS="$CPPFLAGS -I$QTDIR/include${QTINC}"
AC_LANG_CPLUSPLUS
AC_CHECK_HEADER(qaction.h,qt_ok=yes ,qt_ok=no)
AC_MSG_RESULT(QTDIR environment variable may be wrong)
else
AC_MSG_RESULT(yes)
- QT_INCLUDES="-I${QT_ROOT}/include -DQT_THREAD_SUPPORT"
- QT_MT_INCLUDES="-I${QT_ROOT}/include -DQT_THREAD_SUPPORT"
+ QT_INCLUDES="-I${QT_ROOT}/include${QTINC} -DQT_THREAD_SUPPORT -DQT_CLEAN_NAMESPACE"
+ QT_MT_INCLUDES="-I${QT_ROOT}/include${QTINC} -DQT_THREAD_SUPPORT -DQT_CLEAN_NAMESPACE"
fi
fi
then
AC_MSG_CHECKING(linking qt library)
LIBS_old=$LIBS
- LIBS="$LIBS -L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt $OGL_LIBS"
+ if test "x$QTDIR" = "x/usr"
+ then
+ LIBS="$LIBS -lqt-mt $OGL_LIBS"
+ else
+ LIBS="$LIBS -L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt $OGL_LIBS"
+ fi
CXXFLAGS_old=$CXXFLAGS
- CXXFLAGS="$CXXFLAGS -I$QTDIR/include"
+ CXXFLAGS="$CXXFLAGS $QT_INCLUDES"
AC_CACHE_VAL(salome_cv_lib_qt,[
AC_TRY_LINK(
AC_MSG_RESULT(QTDIR environment variable may be wrong)
else
AC_MSG_RESULT(yes)
- QT_LIBS="-L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt"
- QT_MT_LIBS="-L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt"
+ if test "x$QTDIR" = "x/usr"
+ then
+ QT_LIBS=" -lqt-mt"
+ QT_MT_LIBS=" -lqt-mt"
+ else
+ QT_LIBS="-L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt"
+ QT_MT_LIBS="-L$QTDIR/lib${LIB_LOCATION_SUFFIX} -lqt-mt"
+ fi
fi
LIBS=$LIBS_old
AC_SUBST(QT_ROOT)
AC_SUBST(QT_INCLUDES)
+AC_SUBST(QT_MT_INCLUDES)
AC_SUBST(QT_LIBS)
AC_SUBST(QT_MT_LIBS)
AC_SUBST(QT_VERS)
AC_LANG_RESTORE
-AC_MSG_RESULT(for qt: $qt_ok)
+AC_MSG_RESULT(for Qt: $qt_ok)
# Save cache
AC_CACHE_SAVE
bin_PROGRAMS = ghxx2salome
-AM_CPPFLAGS = -I ${QTDIR}/include -DBINDIR="\"${bindir}\""
+AM_CPPFLAGS = -I ${QTDIR}/include${QTINC} -DBINDIR="\"${bindir}\""
LDADD = -L${QTDIR}/lib${LIB_LOCATION_SUFFIX} -lqt-mt
CLEANFILES = hxx2salome_moc.cpp hxx2salome.h hxx2salome.cpp