]> granicus.if.org Git - graphviz/commitdiff
attempt to support older swig without -php5 option
authorJohn Ellson <ellson@research.att.com>
Wed, 19 Feb 2014 16:33:31 +0000 (11:33 -0500)
committerJohn Ellson <ellson@research.att.com>
Wed, 19 Feb 2014 16:33:31 +0000 (11:33 -0500)
configure.ac
tclpkg/gv/Makefile.am

index 637245ce503a05634cb0bbceb191658f3252d7e6..0576c9ba6310409d7fb56daea122e65a3bed8896 100644 (file)
@@ -1093,6 +1093,11 @@ else
   if test "x$use_swig" != "xYes"; then
     use_php="No (swig not available)"
   else
+    if test `$SWIG -php5 2>&1 | $EGREP -c 'Unable` = 1; then
+      SWIG_PHP_OPT='-php'
+    else
+      SWIG_PHP_OPT='-php5'
+    fi
     if test `$SWIG -help 2>&1 | $EGREP -c '\-php5* *- Generate'` = 0 ; then
       use_php="No (swig does not support -php or -php5 option)"
     else
@@ -1121,6 +1126,7 @@ else
           AC_SUBST([PHP_INSTALL_DIR])
           AC_SUBST([PHP_INCLUDES])
           AC_SUBST([PHP_LIBS])
+          AC_SUBST([SWIG_PHP_OPT])
         fi
       fi
     fi
index 53d2bb36446f75ed6b09a6389579bc5ab9119de6..3fdc77533ee0390636690ab305be0908592a336d 100644 (file)
@@ -168,7 +168,7 @@ libgv_php_la_CPPFLAGS = $(BASECPPFLAGS) $(PHP_INCLUDES)
 gv.php: gv_php.cpp
 php_gv.h: gv_php.cpp
 gv_php.cpp: gv.i
-       $(SWIG) -c++ -php5 -o gv_php.cpp $(srcdir)/gv.i
+       $(SWIG) -c++ $(SWIG_PHP_OPT) -o gv_php.cpp $(srcdir)/gv.i
 
 pkgpythondir = $(pkglibdir)/python
 PYTHON_data = gv.py