commit dd2a8b616e36118d16d0b196d18f9fadea1f3802
Author: Enrico Forestieri <for...@lyx.org>
Date:   Sun Jan 4 18:07:11 2015 +0100

    Adjust autotools default configure options for Qt5.
    
    * Disable concept-checks unless explicitly required (errors out with Qt5).
    * Add -fPIC to CPPFLAGS for elf targets (required with Qt5).

diff --git a/config/lyxinclude.m4 b/config/lyxinclude.m4
index 33c5979..f8f01c0 100644
--- a/config/lyxinclude.m4
+++ b/config/lyxinclude.m4
@@ -62,6 +62,18 @@ AC_MSG_RESULT([$withval])
 ])
 
 
+dnl Check whether to configure for Qt5. Default is Qt4.
+dnl
+AC_DEFUN([LYX_CHECK_QT5],[
+AC_MSG_CHECKING([whether Qt5 is requested])
+AC_ARG_ENABLE([qt5],
+  [  --enable-qt5            use Qt5 for building],
+  USE_QT5=$enableval, USE_QT5=no)
+AC_MSG_RESULT([$USE_QT5])
+AC_SUBST([USE_QT5])
+])
+
+
 dnl Usage: LYX_WARNING(message)  Displays the warning "message" and sets the
 dnl flag lyx_warning to yes.
 AC_DEFUN([LYX_WARNING],[
@@ -219,6 +231,9 @@ AC_ARG_ENABLE(concept-checks,
   AC_HELP_STRING([--enable-concept-checks],[enable concept checks]),,
   [AS_CASE([$build_type], [dev*|pre*], [enable_concept_checks=yes], 
          [enable_concept_checks=no])]
+  if test x$USE_QT5 = xyes ; then
+      enable_concept_checks=no
+  fi
 )
 
 ### set up optimization
@@ -285,6 +300,9 @@ if test x$GXX = xyes; then
     fi
   fi
   if test "$ac_env_CPPFLAGS_set" != set; then
+    if test x$USE_QT5 = xyes ; then
+        AS_CASE([$host], [*mingw*|*cygwin*], [], [CPPFLAGS="-fPIC $CPPFLAGS"])
+    fi
     if test x$enable_warnings = xyes ; then
         case $gxx_version in
             3.1*|3.2*|3.3*)
diff --git a/config/qt4.m4 b/config/qt4.m4
index 7852c8a..1346146 100644
--- a/config/qt4.m4
+++ b/config/qt4.m4
@@ -112,14 +112,6 @@ EOF
 dnl start here
 AC_DEFUN([QT_DO_IT_ALL],
 [
-       AC_MSG_CHECKING([whether Qt5 is requested])
-       dnl Default is Qt4
-       AC_ARG_ENABLE([qt5],
-         [  --enable-qt5            use Qt5 for building],
-         USE_QT5=$enableval, USE_QT5=no)
-       AC_MSG_RESULT([$USE_QT5])
-       AC_SUBST([USE_QT5])
-
        dnl this variable is precious
        AC_ARG_VAR(QTDIR, [the place where the Qt files are, e.g. /usr/lib/qt4])
 
diff --git a/configure.ac b/configure.ac
index 77fe598..e2e7fb4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,6 +13,7 @@ AC_CONFIG_AUX_DIR(config)
 # First check the version
 LYX_CHECK_VERSION
 LYX_VERSION_SUFFIX
+LYX_CHECK_QT5
 # Check how the files should be packaged
 AC_CANONICAL_TARGET
 LYX_USE_PACKAGING

Reply via email to