]> granicus.if.org Git - graphviz/commitdiff
prep for php7 support in swig-3.0.11 untagged-21ff5f4411678e44e72c
authorJohn Ellson <john.ellson@comcast.net>
Sun, 4 Dec 2016 22:03:38 +0000 (17:03 -0500)
committerJohn Ellson <john.ellson@comcast.net>
Sun, 4 Dec 2016 22:03:38 +0000 (17:03 -0500)
configure.ac

index 6076ceb6976ea1ec744ad9c76b0281b0ac1e4c84..99dc924253bb0d7976a45eb5670802897d2e85e7 100644 (file)
@@ -1087,22 +1087,30 @@ else
   if test "x$use_swig" != "xYes"; then
     use_php="No (swig not available)"
   else
-    if test `$SWIG -php5 2>&1 | $EGREP -c 'Unable'` -eq 1; then
-      SWIG_PHP_OPT='-php'
+    if test `$SWIG -php7 2>&1 | $EGREP -c 'Unable'` -eq 1; then
+      if test `$SWIG -php5 2>&1 | $EGREP -c 'Unable'` -eq 1; then
+        SWIG_PHP_OPT='-php'
+      else
+        SWIG_PHP_OPT='-php5'
+      fi
     else
-      SWIG_PHP_OPT='-php5'
+      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)"
     else
-      AC_CHECK_PROGS(PHP,php5 php)
+      AC_CHECK_PROGS(PHP,php7,php,php5)
       if test "x$PHP" = "x"; then
         use_php="No (php not available)"
       else
-        if test -d /usr/include/php5; then
-          PHP_INCLUDES="-I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/Zend -I/usr/include/php5/TSRM"
+        if test -d /usr/include/php7; then
+          PHP_INCLUDES="-I/usr/include/php7 -I/usr/include/php7/main -I/usr/include/php7/Zend -I/usr/include/php7/TSRM"
         else
-          PHP_INCLUDES="-I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib"
+          if test -d /usr/include/php5; then
+            PHP_INCLUDES="-I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/Zend -I/usr/include/php5/TSRM"
+          else
+            PHP_INCLUDES="-I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib"
+          fi
         fi
         PHP_INSTALL_DIR="/usr/lib${LIBPOSTFIX}/php/modules"
         PHP_INSTALL_DATADIR="/usr/share/php"