Author: cazfi
Date: Sun Apr 10 10:17:12 2016
New Revision: 32331

URL: http://svn.gna.org/viewcvs/freeciv?rev=32331&view=rev
Log:
Configure to check existence of qtpaths command before trying to run it in OS X.

See bug #24567

Modified:
    branches/S2_5/m4/qt5-darwin.m4

Modified: branches/S2_5/m4/qt5-darwin.m4
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_5/m4/qt5-darwin.m4?rev=32331&r1=32330&r2=32331&view=diff
==============================================================================
--- branches/S2_5/m4/qt5-darwin.m4      (original)
+++ branches/S2_5/m4/qt5-darwin.m4      Sun Apr 10 10:17:12 2016
@@ -2,44 +2,47 @@
 
 AC_DEFUN([FC_QT5_DARWIN],
 [
-
-  AC_MSG_CHECKING([Qt5 framework])
-
   AC_ARG_WITH([qt5_framework_bin],
     AS_HELP_STRING([--with-qt5-framework-bin], [path to binares of Qt5 
framework (MacOS X, autodetected if wasn't specified)]))
-  
-  if test "x$qt5_framework_bin" = "x" ; then
-    qt5_framework_bin="$(qtpaths --binaries-dir)"
-  fi
-  qt5_path="$(qtpaths --install-prefix)"
 
-  if test "x$qt5_path" != "x" ; then
-    AC_LANG_PUSH([C++])
-    FC_QT5_DARWIN_COMPILETEST([$qt5_path])
-    if test "x$qt5_headers" = "xyes" ; then
-      FC_QT5_DARWIN_LINKTEST([$qt5_path])
+  AC_CHECK_PROG([QTPATHS], [qtpaths], [qtpaths], [no])
+
+  if test "x$QTPATHS" != "xno" ; then
+
+    AC_MSG_CHECKING([Qt5 framework])
+
+    if test "x$qt5_framework_bin" = "x" ; then
+      qt5_framework_bin="$($QTPATHS --binaries-dir)"
+    fi
+    qt5_path="$($QTPATHS --install-prefix)"
+
+    if test "x$qt5_path" != "x" ; then
+      AC_LANG_PUSH([C++])
+      FC_QT5_DARWIN_COMPILETEST([$qt5_path])
+      if test "x$qt5_headers" = "xyes" ; then
+        FC_QT5_DARWIN_LINKTEST([$qt5_path])
+      else
+        fc_qt5_usable=false
+      fi
+      AC_LANG_POP([C++])
+
+      if test "x$qt5_libs" = "xyes" ; then
+        MOCCMD="$qt5_framework_bin/moc"
+        AS_IF([test -x $MOCCMD], [fc_qt5_usable=true], [fc_qt5_usable=false])
+      else
+        fc_qt5_usable=false
+      fi
+    fi
+
+    if test "x$fc_qt5_usable" = "xtrue" ; then
+      AC_MSG_RESULT([found])
     else
-      fc_qt5_usable=false
-    fi
-    AC_LANG_POP([C++])
-
-    if test "x$qt5_libs" = "xyes" ; then
-      MOCCMD="$qt5_framework_bin/moc"
-      AS_IF([test -x $MOCCMD], [fc_qt5_usable=true], [fc_qt5_usable=false])
-    else
-      fc_qt5_usable=false
+      AC_MSG_RESULT([not found])
     fi
   fi
-  
-  if test "x$fc_qt5_usable" = "xtrue" ; then
-    AC_MSG_RESULT([found])
-  else
-    AC_MSG_RESULT([not found])
-  fi
-  
 ])
 
-dnl Test if Qt headers are found from given path
+dnl Test if Qt5 headers are found from given path
 AC_DEFUN([FC_QT5_DARWIN_COMPILETEST],
 [
   CPPFADD=" -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB 
-I$1/lib/QtWidgets.framework/Versions/5/Headers 
-I$1/lib/QtGui.framework/Versions/5/Headers 
-I$1/lib/QtCore.framework/Versions/5/Headers -I. -I$1/mkspecs/macx-clang 
-F$1/lib "
@@ -81,4 +84,3 @@
  CPPFLAGS="${CPPFLAGS_SAVE}"
  CXXFLAGS="${CXXFLAGS_SAVE}"
 ])
-


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to