1 dnl Copyright (C) 2007-2012 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
23 AC_DEFUN([CHECK_SIP],[
24 AC_REQUIRE([CHECK_PYTHON])dnl
25 AC_REQUIRE([CHECK_QT])dnl
26 AC_REQUIRE([AC_LINKER_OPTIONS])dnl
31 [ --with-sip=EXEC sip executable ],
33 AC_MSG_RESULT([Try $withval as sip executable])
35 AC_PATH_PROG(SIP, sip)
38 if test "x$SIP" = "x" ; then
40 AC_MSG_RESULT(sip is not in the PATH variable)
42 AC_MSG_CHECKING(whether sip version >= 4.6)
43 SIP_VERSION=`$SIP -V | awk '{print $[1]}'`
44 SIP_VERSION_ID=`echo $SIP_VERSION | awk -F. '{v=$[1]*10000+$[2]*100+$[3];print v}'`
45 if test $SIP_VERSION_ID -ge 40600 ; then
47 AC_MSG_RESULT(sip version is $SIP_VERSION)
50 AC_MSG_RESULT(WARNING! sip version $SIP_VERSION is not supported (at least 4.6 is required)!)
55 if test "x$sip_ok" = "xyes" ; then
56 if test "x$SIPDIR" = "x" ; then
58 SIPDIR=`dirname $SIPDIR`
63 if test "x${SIPDIR}" != "x" ; then
64 TEST_INC_DIRS="${TEST_INC_DIRS} ${SIPDIR} ${SIPDIR}/include"
65 TEST_INC_DIRS="${TEST_INC_DIRS} ${SIPDIR}/include/python${PYTHON_VERSION}"
66 TEST_LIB_DIRS="${TEST_LIB_DIRS} ${SIPDIR} ${SIPDIR}/lib"
67 TEST_LIB_DIRS="${TEST_LIB_DIRS} ${SIPDIR}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
69 if test "x${PYTHONHOME}" != "x" ; then
70 TEST_INC_DIRS="${TEST_INC_DIRS} ${PYTHONHOME}/include/python${PYTHON_VERSION}"
71 TEST_LIB_DIRS="${TEST_LIB_DIRS} ${PYTHONHOME}/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
73 TEST_INC_DIRS="${TEST_INC_DIRS} /usr/include /usr/include/python${PYTHON_VERSION}"
74 TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX} /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/site-packages"
75 TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/dist-packages"
76 TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX}/python${PYTHON_VERSION}/dist-packages/PyQt4"
77 TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib${LIB_LOCATION_SUFFIX}/pymodules/python${PYTHON_VERSION}"
78 if test "${build_cpu::6}" = "x86_64" ; then
79 TEST_LIB_DIRS="${TEST_LIB_DIRS} /usr/lib64/python${PYTHON_VERSION}/site-packages"
83 for d in ${TEST_INC_DIRS} ; do
85 AC_CHECK_FILE(${d}/sip.h,sip_ok=yes,sip_ok=no)
86 if test "x$sip_ok" == "xyes" ; then
93 if test "x$sip_ok" == "xyes" ; then
94 dnl Search sip.so file
96 for d in ${TEST_LIB_DIRS} ; do
98 AC_CHECK_FILE(${d}/sip.so,sip_ok=yes,sip_ok=no)
99 if test "x$sip_ok" == "xyes" ; then
100 if test "x${d}" = "x/usr/lib${LIB_LOCATION_SUFFIX}" ; then
113 AC_SUBST(SIP_INCLUDES)
115 AC_SUBST(SIP_VERSION)
116 AC_SUBST(SIP_VERSION_ID)
118 AC_MSG_RESULT(for sip: $sip_ok)