]> granicus.if.org Git - graphviz/commitdiff
apply graphviz-2.40.1-swig4-updated-language-options.patch
authorJohn Ellson <ellson@research.att.com>
Mon, 18 Mar 2019 18:39:36 +0000 (14:39 -0400)
committerJohn Ellson <ellson@research.att.com>
Mon, 18 Mar 2019 18:39:36 +0000 (14:39 -0400)
configure.ac
tclpkg/gv/Makefile.am

index 811f453d11be1c1d587d4a18516050154190b03c..b0762993c299fcd3d9040aec19d99425132b42f2 100644 (file)
@@ -1031,8 +1031,13 @@ else
   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
@@ -1065,6 +1070,7 @@ else
          AC_SUBST([PERL_INCLUDES])
           AC_SUBST([PERL_LIBS])
          AC_SUBST([PERL_INSTALL_DIR])
+         AC_SUBST([SWIG_PERL_OPT])
         fi
       fi
     fi
@@ -1085,8 +1091,8 @@ else
   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'
@@ -1094,8 +1100,8 @@ else
     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
index 02d886c1ef3142d884cef56475e13978154e9a65..70469f4e8abfc4996714285a25a5e2ef55374993 100644 (file)
@@ -171,7 +171,7 @@ libgv_perl_la_LDFLAGS = -module -avoid-version $(PERL_LD)
 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