if test "x$use_swig" != "xYes"; then
use_perl="No (swig not available)"
else
- if test `$SWIG -help 2>&1 | $EGREP -c '\-perl *- Generate'` = 0; then
- use_perl="No (swig does not support -perl option)"
+ if test `$SWIG -perl5 2>&1 | $EGREP -c '(Unable|No target)'` -eq 1; then
+ SWIG_PERL_OPT='-perl'
+ else
+ SWIG_PERL_OPT='-perl5'
+ fi
+ if test `$SWIG -help 2>&1 | $EGREP -c "(-perl|-perl5) *- Generate"` = 0; then
+ use_perl="No (swig does not support -perl or -perl5 option)"
else
AC_CHECK_PROG(PERL,perl,perl)
if test "x$PERL" = "x"; then
AC_SUBST([PERL_INCLUDES])
AC_SUBST([PERL_LIBS])
AC_SUBST([PERL_INSTALL_DIR])
+ AC_SUBST([SWIG_PERL_OPT])
fi
fi
fi
if test "x$use_swig" != "xYes"; then
use_php="No (swig not available)"
else
- if test `$SWIG -php7 2>&1 | $EGREP -c 'Unable'` -eq 1; then
- if test `$SWIG -php5 2>&1 | $EGREP -c 'Unable'` -eq 1; then
+ if test `$SWIG -php7 2>&1 | $EGREP -c '(Unable|No target)'` -eq 1; then
+ if test `$SWIG -php5 2>&1 | $EGREP -c '(Unable|No target)'` -eq 1; then
SWIG_PHP_OPT='-php'
else
SWIG_PHP_OPT='-php5'
else
SWIG_PHP_OPT='-php7'
fi
- if test `$SWIG -help 2>&1 | $EGREP -c '\-php5* *- Generate'` = 0 ; then
- use_php="No (swig does not support -php or -php5 option)"
+ if test `$SWIG -help 2>&1 | $EGREP -c "(-php|-php5|-php7) *- Generate"` = 0 ; then
+ use_php="No (swig does not support -php or -php5 or -php7 option)"
else
AC_CHECK_PROGS(PHP,php7.2,php7,php,php5)
if test "x$PHP" = "x"; then
libgv_perl_la_CPPFLAGS = $(BASECPPFLAGS) $(PERL_CC)
$(PERL_data): gv_perl.cpp
gv_perl.cpp: gv.i
- $(SWIG) -c++ -perl -o gv_perl.cpp $(srcdir)/gv.i
+ $(SWIG) -c++ $(SWIG_PERL_OPT) -o gv_perl.cpp $(srcdir)/gv.i
pkgphpdir = $(pkglibdir)/php
PHP_data = gv.php