4841
# Old SWIG doesn't like libc++, see https://github.com/swig/swig/issues/73
4845
if test -n "2.0.12"; then
4846
# Calculate the required version number components
4848
required_major=`echo $required | sed 's/[^0-9].*//'`
4849
if test -z "$required_major" ; then
4852
required=`echo $required | sed 's/[0-9]*[^0-9]//'`
4853
required_minor=`echo $required | sed 's/[^0-9].*//'`
4854
if test -z "$required_minor" ; then
4857
required=`echo $required | sed 's/[0-9]*[^0-9]//'`
4858
required_patch=`echo $required | sed 's/[^0-9].*//'`
4859
if test -z "$required_patch" ; then
4864
# for "python 3 abc set" and "PyInt_FromSize_t in python3" checks
4866
cat <<-END > conftest-python.i
4869
%include <std_set.i>
4870
%template(SInt) std::set<int>;
4873
# check if perl has std::...::size_type defined. Don't add new tests to this .i; it'll break this test due to check for "NewPointerObj(("
4875
cat <<-END > conftest-perl.i
4877
%include <std_vector.i>
4878
%include <std_list.i>
4879
%include <std_deque.i>
4880
%template() std::vector<int>;
4881
%template() std::list<int>;
4882
%template() std::deque<int>;
4883
std::vector<int>::size_type checkVector();
4884
std::list<int>::size_type checkList();
4885
std::deque<int>::size_type checkDeque();
4887
SWIG_installed_versions=""
4888
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for SWIG >= 2.0.12" >&5
4889
$as_echo_n "checking for SWIG >= 2.0.12... " >&6; }
4890
if ${znc_cv_path_SWIG+:} false; then :
4891
$as_echo_n "(cached) " >&6
4894
if test -z "$SWIG"; then
4895
ac_path_SWIG_found=false
4896
# Loop through the user's path and test for each of PROGNAME-LIST
4897
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
4901
test -z "$as_dir" && as_dir=.
4902
for ac_prog in swig swig2.0; do
4903
for ac_exec_ext in '' $ac_executable_extensions; do
4904
ac_path_SWIG="$as_dir/$ac_prog$ac_exec_ext"
4905
as_fn_executable_p "$ac_path_SWIG" || continue
4907
echo trying $ac_path_SWIG >&5
4908
$ac_path_SWIG -version >&5
4909
swig_version=`$ac_path_SWIG -version 2>&1 | grep 'SWIG Version' | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`
4910
if test -n "$swig_version"; then
4911
swig_right_version=1
4913
SWIG_installed_versions="$SWIG_installed_versions $swig_version "
4915
if test -n "$required"; then
4916
# Calculate the available version number components
4917
available=$swig_version
4919
available_major=`echo $available | sed 's/[^0-9].*//'`
4920
if test -z "$available_major" ; then
4923
available=`echo $available | sed 's/[0-9]*[^0-9]//'`
4924
available_minor=`echo $available | sed 's/[^0-9].*//'`
4925
if test -z "$available_minor" ; then
4928
available=`echo $available | sed 's/[0-9]*[^0-9]//'`
4929
available_patch=`echo $available | sed 's/[^0-9].*//'`
4930
if test -z "$available_patch" ; then
4934
if test $available_major -lt $required_major; then
4935
swig_right_version=0
4936
elif test $available_major -eq $required_major; then
4937
if test $available_minor -lt $required_minor; then
4938
swig_right_version=0
4939
elif test $available_minor -eq $required_minor; then
4940
if test $available_patch -lt $required_patch; then
4941
swig_right_version=0
4947
if test $swig_right_version -eq 1; then
4948
# "python 3 abc set", "PyInt_FromSize_t in python3" and "perl size_type" checks
4949
echo "checking behavior of this SWIG" >&5
4951
$ac_path_SWIG -python -py3 -c++ -shadow conftest-python.i >&5 && \
4952
echo "python wrapper created" >&5 && \
4953
echo "testing std::set... ">&5 && \
4954
grep SInt_discard conftest.py > /dev/null 2>&1 && \
4955
echo "std::set works" >&5 && \
4956
echo "testing PyInt_FromSize_t..." >&5 && \
4957
grep '#define PyInt_FromSize_t' conftest-python_wrap.cxx > /dev/null 2>&1 && \
4958
echo "PyInt_FromSize_t is defined" >&5 && \
4959
$ac_path_SWIG -perl -c++ -shadow conftest-perl.i >&5 && \
4960
echo "perl wrapper created" >&5 && \
4961
echo "testing size_type..." >&5 && \
4962
test 0 -eq `grep -c 'NewPointerObj((' conftest-perl_wrap.cxx` && \
4963
echo "size_type work" >&5 && \
4964
znc_cv_path_SWIG=$ac_path_SWIG \
4965
ac_path_SWIG_found=:
4966
if test "x$ac_path_SWIG_found" != "x:"; then
4969
rm -f conftest-python_wrap.cxx conftest.py
4970
rm -f conftest-perl_wrap.cxx conftest.pm
4974
echo "SWIG version >= 2.0.12 is required. You have '$swig_version'" >&5
4977
echo end trying $ac_path_SWIG >&5
4979
$ac_path_SWIG_found && break 3
4984
if test -z "$ac_cv_path_SWIG"; then
4988
ac_cv_path_SWIG=$SWIG
4993
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $znc_cv_path_SWIG" >&5
4994
$as_echo "$znc_cv_path_SWIG" >&6; }
4995
rm -f conftest-python.i conftest-perl.i
4996
if test -n "$SWIG_installed_versions"; then
4997
{ $as_echo "$as_me:${as_lineno-$LINENO}: Following SWIG versions are found:$SWIG_installed_versions" >&5
4998
$as_echo "$as_me: Following SWIG versions are found:$SWIG_installed_versions" >&6;}
5001
SWIG=$znc_cv_path_SWIG
5003
if test -n "$SWIG"; then
5004
SWIG_LIB=`$SWIG -swiglib`
4804
5009
test -z "$SWIG" && USESWIG=no
4805
5010
if test "x$USESWIG" = xno -a "x$old_USESWIG" = yes; then
4806
5011
as_fn_error $? "Could not found appropriate SWIG installation. Check config.log for details." "$LINENO" 5