1 dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 dnl This library is free software; you can redistribute it and/or
7 dnl modify it under the terms of the GNU Lesser General Public
8 dnl License as published by the Free Software Foundation; either
9 dnl version 2.1 of the License.
11 dnl This library is distributed in the hope that it will be useful,
12 dnl but WITHOUT ANY WARRANTY; without even the implied warranty of
13 dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 dnl Lesser General Public License for more details.
16 dnl You should have received a copy of the GNU Lesser General Public
17 dnl License along with this library; if not, write to the Free Software
18 dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 AC_DEFUN([CHECK_SIP],[
23 AC_REQUIRE([CHECK_PYTHON])dnl
24 AC_REQUIRE([CHECK_QT])dnl
25 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
30 [ --with-sip=EXEC sip executable ],
32 AC_MSG_RESULT([Try $withval as sip executable])
34 AC_PATH_PROG(SIP, sip)
37 if test "x$SIP" = "x" ; then
39 AC_MSG_RESULT(sip is not in the PATH variable)
41 AC_MSG_CHECKING(whether sip version >= 4.6)
42 SIP_VERSION=`$SIP -V | awk '{print $[1]}'`
43 SIP_VERSION_ID=`echo $SIP_VERSION | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
44 if test $SIP_VERSION_ID -ge 40600 ; then
46 AC_MSG_RESULT(sip version is $SIP_VERSION)
49 AC_MSG_RESULT(WARNING! sip version $SIP_VERSION is not supported (at least 4.6 is required)!)
54 if test "x$sip_ok" = "xyes" ; then
55 if test "x$SIPDIR" = "x" ; then
57 SIPDIR=`dirname $SIPDIR`
62 if test "x${SIPDIR}" != "x" ; then
63 TEST_INC_DIRS="${TEST_INC_DIRS} ${SIPDIR} ${SIPDIR}/include"
64 TEST_INC_DIRS="${TEST_INC_DIRS} ${SIPDIR}/include/python${PYTHON_VERSION}"
65 TEST_LIB_DIRS="${TEST_LIB_DIRS} ${SIPDIR} ${SIPDIR}/lib"
66 TEST_LIB_DIRS="${TEST_LIB_DIRS} ${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
68 if test "x${PYTHONHOME}" != "x" ; then
69 TEST_INC_DIRS="${TEST_INC_DIRS} ${PYTHONHOME}/include/python${PYTHON_VERSION}"
70 TEST_LIB_DIRS="${TEST_LIB_DIRS} ${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
72 TEST_INC_DIRS="${TEST_INC_DIRS} /usr/include /usr/include/python${PYTHON_VERSION}"
73 TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX} /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
77 for d in ${TEST_INC_DIRS} ; do
79 AC_CHECK_FILE(${d}/sip.h,sip_ok=yes,sip_ok=no)
80 if test "x$sip_ok" == "xyes" ; then
87 if test "x$sip_ok" == "xyes" ; then
88 dnl Search sip.so file
90 for d in ${TEST_LIB_DIRS} ; do
92 AC_CHECK_FILE(${d}/sip.so,sip_ok=yes,sip_ok=no)
93 if test "x$sip_ok" == "xyes" ; then
94 if test "x${d}" = "x/usr/lib${LIB_LOCATION_SUFFIX}" ; then
107 AC_SUBST(SIP_INCLUDES)
109 AC_SUBST(SIP_VERSION)
110 AC_SUBST(SIP_VERSION_ID)
112 AC_MSG_RESULT(for sip: $sip_ok)