summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPiotr Galiszewski <piotr@galiszewski.pl>2010-07-08 18:18:19 +0200
committerPiotr Galiszewski <piotr@galiszewski.pl>2010-07-13 10:46:02 +0200
commitc082355be77e96fd6776ab7f86825e8dd14eeed0 (patch)
tree7b7fdd20052ce81c6edc5c8ac6ef3f6188e90c82 /configure.ac
parent381582bfb62fc7c8ed87ae2f9c19260c26b7bd02 (diff)
downloadaptitude-c082355be77e96fd6776ab7f86825e8dd14eeed0.tar.gz
Add build rules for aptitude-Qt
- add tests for Qt libraries to configure.ac - create "enable-qt" option for activating building of Qt frontend - add required Makefile.am - create a stab of frontend initialization and all required code to generic classes - rename gui variable in main.cc to use_gtk_gui and new_gui variable accordingly
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac66
1 files changed, 66 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 6b423fb0..8d52d871 100644
--- a/configure.ac
+++ b/configure.ac
@@ -539,6 +539,71 @@ fi
AC_DEFINE_UNQUOTED(SIGC_VERSION, ["$(pkg-config --modversion sigc++-2.0)"], [The version of libsigc++ with which the program was compiled])
+########################################################################
+
+WANT_HAVE_QT=0
+AC_ARG_ENABLE(qt,
+ AS_HELP_STRING(--enable-qt, [compile the Qt frontend if the appropriate libraries are available]),
+ [if test x$enableval = xyes
+ then
+ WANT_HAVE_QT=1
+ else
+ WANT_HAVE_QT=
+ fi])
+
+HAVE_QT=0
+if test x$WANT_HAVE_QT = x1
+then
+ AC_MSG_NOTICE([Testing for the libraries needed to build the Qt frontend.])
+
+ # required version of Qt libraries
+ QTCORE_REQUIRED=4.6.0
+ QTGUI_REQUIRED=4.6.0
+
+ HAVE_QT=1
+ PKG_CHECK_MODULES(QtCore, QtCore >= $QTCORE_REQUIRED, ,[HAVE_QT=])
+ PKG_CHECK_MODULES(QtGui, QtGui >= $QTGUI_REQUIRED, ,[HAVE_QT=])
+
+ # test for qt4-moc
+ AC_PATH_PROG(MOC, moc-qt4)
+ if test ! -x "$MOC"; then
+ AC_PATH_PROG(MOC, moc)
+ if test ! -x "$MOC"; then
+ AC_MSG_WARN([Qt MOC hasn't been found.])
+ HAVE_QT=0
+ else
+ AC_MSG_NOTICE([Qt MOC has been found.])
+ fi
+ fi
+else
+ AC_MSG_NOTICE([Qt frontend not enabled; use --enable-qt to enable it.])
+fi
+
+if test x$WANT_HAVE_QT = x1 && test x$HAVE_QT != x1
+then
+ AC_MSG_WARN([Unable to find the necessary Qt libraries; disabling Qt support.])
+fi
+
+if test x$HAVE_QT = x1
+then
+ AC_MSG_NOTICE([The Qt frontend will be built.])
+fi
+
+AM_CONDITIONAL([BUILD_QT], [test x$HAVE_QT = x1])
+if test x$HAVE_QT = x1
+then
+ AC_DEFINE([HAVE_QT], [], [Define if the Qt frontend is included in the build.])
+fi
+
+if test x$HAVE_QT = x1
+then
+ CXXFLAGS="$CXXFLAGS -DQT_NO_KEYWORDS $QtCore_CFLAGS $QtGui_CFLAGS"
+ LIBS="$LIBS $QtCore_LIBS $QtGui_LIBS"
+fi
+
+########################################################################
+
+
dnl Checks for header files.
AC_HEADER_STDC
@@ -821,6 +886,7 @@ AC_CONFIG_FILES([
src/gtk/toplevel/Makefile
src/gtk/util/Makefile
src/gtk/view-impls/Makefile
+ src/qt/Makefile
src/cmdline/Makefile
src/cmdline/mocks/Makefile
src/generic/Makefile