]> SALOME platform Git repositories - modules/kernel.git/blob - salome_adm/unix/config_files/check_swig.m4
Salome HOME
NRI : Merge from V1_2.
[modules/kernel.git] / salome_adm / unix / config_files / check_swig.m4
1
2 AC_DEFUN([CHECK_SWIG],[
3 AC_REQUIRE([CHECK_PYTHON])dnl
4
5 swig_ok=yes
6
7 AC_ARG_WITH(swig,
8     [  --with-swig=EXEC swig executable ],
9     [SWIG="$withval"
10       AC_MSG_RESULT("select $withval as swig executable")
11     ], [
12       AC_PATH_PROG(SWIG, swig)
13     ])
14
15 if test "x$SWIG" = "x"
16 then
17     swig_ok=no
18     AC_MSG_RESULT(swig not in PATH variable)
19 fi
20
21 if  test "x$swig_ok" = "xyes"
22 then
23    AC_MSG_CHECKING(python wrapper generation with swig)
24    cat > conftest.h << EOF
25 int f(double);
26 EOF
27
28    $SWIG -module conftest -python conftest.h >/dev/null 2>&1
29    if test -f conftest_wrap.c
30    then
31       SWIG_FLAGS="-c++ -python -shadow"
32    else
33       swig_ok=no  
34    fi
35    rm -f conftest*
36    AC_MSG_RESULT($swig_ok) 
37 fi
38
39 AC_SUBST(SWIG_FLAGS)
40 AC_SUBST(SWIG)
41
42 AC_MSG_RESULT(for swig: $swig_ok)
43
44 ])dnl
45 dnl