aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-24 08:51:38 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-07-24 08:51:38 +0000
commite8e00d80489ea73dbba740b5fd4972fddd2dd7f3 (patch)
treee327c3bd76188efe36396ddc0c84657c5b77ad06
parentc5ecf6a54783a2f9f2b5da27a28b353eb7a05464 (diff)
downloadpaludis-e8e00d80489ea73dbba740b5fd4972fddd2dd7f3.tar.gz
paludis-e8e00d80489ea73dbba740b5fd4972fddd2dd7f3.tar.xz
Change how we handle CXXFLAGS, to allow configure-detected warning flags to be overridden in subdirectories. Start work on a Gtk+ interface.
-rw-r--r--configure.ac36
-rw-r--r--ebuild/digests/Makefile.am3
-rw-r--r--ebuild/fetchers/Makefile.am2
-rw-r--r--ebuild/utils/Makefile.am2
-rw-r--r--paludis/Makefile.am.m42
-rw-r--r--paludis/args/Makefile.am2
-rw-r--r--paludis/digests/Makefile.am2
-rw-r--r--paludis/qa/Makefile.am.m42
-rw-r--r--paludis/repositories/fake/Makefile.am2
-rw-r--r--paludis/repositories/nothing/Makefile.am2
-rw-r--r--paludis/repositories/portage/Makefile.am2
-rw-r--r--paludis/repositories/vdb/Makefile.am2
-rw-r--r--paludis/selinux/Makefile.am2
-rw-r--r--paludis/tasks/Makefile.am2
-rw-r--r--paludis/util/Makefile.am.m42
-rw-r--r--src/Makefile.am2
-rw-r--r--src/gtkpaludis/Makefile.am38
-rw-r--r--src/gtkpaludis/browse_tree.cc345
-rw-r--r--src/gtkpaludis/browse_tree.hh42
-rw-r--r--src/gtkpaludis/command_line.cc68
-rw-r--r--src/gtkpaludis/command_line.hh98
-rw-r--r--src/gtkpaludis/gtkpaludis.cc202
-rw-r--r--src/gtkpaludis/information_tree.hh58
-rw-r--r--src/gtkpaludis/main_window.hh38
-rw-r--r--src/paludis/Makefile.am2
-rw-r--r--src/qualudis/Makefile.am2
-rw-r--r--test/Makefile.am2
27 files changed, 940 insertions, 22 deletions
diff --git a/configure.ac b/configure.ac
index 1632839..f1141c7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -232,6 +232,9 @@ AC_CHECK_FUNCS([popen], [], [AC_MSG_ERROR([I need popen])])
dnl }}}
dnl {{{ check for cxxflags
+PALUDIS_CXXFLAGS=
+PALUDIS_CXXFLAGS_NO_WOLD_STYLE_CAST=
+PALUDIS_CXXFLAGS_NO_WREDUNDANT_DECLS=
AC_MSG_CHECKING([whether our compiler is iccy])
AC_COMPILE_IFELSE([
#ifndef __ICC
@@ -241,10 +244,9 @@ AC_COMPILE_IFELSE([
[cxx_compiler_icc=yes],
[cxx_compiler_icc=no])
AC_MSG_RESULT([${cxx_compiler_icc}])
-
AC_DEFUN([CHECK_CXXFLAG], [
save_CXXFLAGS=$CXXFLAGS
- CXXFLAGS="$CXXFLAGS $1 -Werror"
+ CXXFLAGS="$CXXFLAGS $PALUDIS_CXXFLAGS $1 -Werror"
AC_COMPILE_IFELSE([
#include <string>
#include <iostream>
@@ -258,11 +260,10 @@ int main(int, char **)
[cxxflag_success=no])
CXXFLAGS="$save_CXXFLAGS"
if test "x$cxxflag_success" = "xyes" ; then
- CXXFLAGS="$CXXFLAGS $1"
+ PALUDIS_CXXFLAGS="$PALUDIS_CXXFLAGS $1"
cxxflags_message="${cxxflags_message} $1"
fi
])
-
AC_MSG_CHECKING([for appropriate compiler flags])
if test "x${cxx_compiler_icc}" = "xyes" ; then
CHECK_CXXFLAG([-Wall])
@@ -281,7 +282,13 @@ elif test "x${ac_cv_cxx_compiler_gnu}" = "xyes" ; then
CHECK_CXXFLAG([-W])
fi
CHECK_CXXFLAG([-Wold-style-cast])
+ if test "x$cxxflag_success" = "xyes" ; then
+ PALUDIS_CXXFLAGS_NO_WOLD_STYLE_CAST=-Wno-old-style-cast
+ fi
CHECK_CXXFLAG([-Wredundant-decls])
+ if test "x$cxxflag_success" = "xyes" ; then
+ PALUDIS_CXXFLAGS_NO_WREDUNDANT_DECLS=-Wno-redundant-decls
+ fi
CHECK_CXXFLAG([-Wstrict-null-sentinel])
CHECK_CXXFLAG([-Wmissing-noreturn])
CHECK_CXXFLAG([-Woverloaded-virtual])
@@ -290,6 +297,9 @@ else
CHECK_CXXFLAG([-Wall])
fi
AC_MSG_RESULT([${cxxflags_message}])
+AC_SUBST([PALUDIS_CXXFLAGS])
+AC_SUBST([PALUDIS_CXXFLAGS_NO_WOLD_STYLE_CAST])
+AC_SUBST([PALUDIS_CXXFLAGS_NO_WREDUNDANT_DECLS])
dnl }}}
dnl {{{ sandbox
@@ -413,6 +423,23 @@ if test "x$found_selinux" = "xyes"; then
fi
dnl }}}
+dnl {{{ gtk support
+AC_MSG_CHECKING([whether to build the gtk+ client])
+AC_ARG_ENABLE([gtk],
+ AS_HELP_STRING([--enable-gtk], [Enable gtk+ client (default: disable)]),
+ enable_gtk=$enableval,
+ enable_gtk=no)
+AC_MSG_RESULT($enable_gtk)
+
+if test "x$enable_gtk" = "xyes"; then
+ PKG_CHECK_MODULES(DEPS, [gtkmm-2.4 >= 2.6.0])
+ AC_SUBST(DEPS_CFLAGS)
+ AC_SUBST(DEPS_LIBS)
+fi
+
+AM_CONDITIONAL([ENABLE_GTK], test "x$enable_gtk" = "xyes")
+dnl }}}
+
dnl {{{ is sed gnu sed
AC_MSG_CHECKING([if we need a sed wrapper])
AC_SUBST([NEED_SED_WRAPPER])
@@ -475,6 +502,7 @@ AC_OUTPUT(
paludis/util/Makefile
src/Makefile
src/paludis/Makefile
+ src/gtkpaludis/Makefile
src/qualudis/Makefile
test/Makefile
)
diff --git a/ebuild/digests/Makefile.am b/ebuild/digests/Makefile.am
index fbe7e9d..8ac62ca 100644
--- a/ebuild/digests/Makefile.am
+++ b/ebuild/digests/Makefile.am
@@ -23,4 +23,5 @@ TESTS_ENVIRONMENT = env \
TEST_SCRIPT_DIR="$(srcdir)/" \
bash $(top_srcdir)/test/run_test.sh
-AM_CXXFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
+
diff --git a/ebuild/fetchers/Makefile.am b/ebuild/fetchers/Makefile.am
index 4b57221..8a4dd4f 100644
--- a/ebuild/fetchers/Makefile.am
+++ b/ebuild/fetchers/Makefile.am
@@ -21,7 +21,7 @@ EXTRA_DIST = $(libexecprog_SCRIPTS) dowget.in
check_SCRIPTS =
check_PROGRAMS = $(TESTS)
-AM_CXXFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
dohttp dohttps doftp : dowget.in
cat $< > $@
diff --git a/ebuild/utils/Makefile.am b/ebuild/utils/Makefile.am
index 7a8cd3c..6e0a313 100644
--- a/ebuild/utils/Makefile.am
+++ b/ebuild/utils/Makefile.am
@@ -54,7 +54,7 @@ libexecprog_SCRIPTS = \
$(libexecprog_SCRIPTS_extra)
libexecprog_PROGRAMS = merge unmerge
-AM_CXXFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
merge_SOURCES = merge.cc merge_common.cc merge_common.hh
merge_LDADD = \
diff --git a/paludis/Makefile.am.m4 b/paludis/Makefile.am.m4
index 1674e16..ffbf3de 100644
--- a/paludis/Makefile.am.m4
+++ b/paludis/Makefile.am.m4
@@ -38,7 +38,7 @@ include(`paludis/files.m4')
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda ihateautomake.cc ihateautomake.o
MAINTAINERCLEANFILES = Makefile.in Makefile.am about.hh paludis.hh \
hashed_containers.hh
-AM_CXXFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
DEFS= \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
diff --git a/paludis/args/Makefile.am b/paludis/args/Makefile.am
index a112ff4..9ca9716 100644
--- a/paludis/args/Makefile.am
+++ b/paludis/args/Makefile.am
@@ -1,6 +1,6 @@
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
MAINTAINERCLEANFILES = Makefile.in
-AM_CXXFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
TESTS = \
args_TEST
diff --git a/paludis/digests/Makefile.am b/paludis/digests/Makefile.am
index 195988b..5871029 100644
--- a/paludis/digests/Makefile.am
+++ b/paludis/digests/Makefile.am
@@ -26,7 +26,7 @@ EXTRA_DIST = sha256_TEST.cc rmd160_TEST.cc md5_TEST.cc
check_PROGRAMS = $(TESTS)
-AM_CXXFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
sha256_TEST_SOURCES = sha256_TEST.cc
sha256_TEST_CXXFLAGS = -I$(top_srcdir)
diff --git a/paludis/qa/Makefile.am.m4 b/paludis/qa/Makefile.am.m4
index 22e12a2..5034410 100644
--- a/paludis/qa/Makefile.am.m4
+++ b/paludis/qa/Makefile.am.m4
@@ -57,7 +57,7 @@ qa.hh : qa.hh.m4 files.m4
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
MAINTAINERCLEANFILES = Makefile.in Makefile.am qa.hh
-AM_CXXFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
DEFS= \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
diff --git a/paludis/repositories/fake/Makefile.am b/paludis/repositories/fake/Makefile.am
index adefe8d..20be5bc 100644
--- a/paludis/repositories/fake/Makefile.am
+++ b/paludis/repositories/fake/Makefile.am
@@ -1,7 +1,7 @@
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
MAINTAINERCLEANFILES = Makefile.in
-AM_CXXFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
DEFS= \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
diff --git a/paludis/repositories/nothing/Makefile.am b/paludis/repositories/nothing/Makefile.am
index 10a26ca..cad77cc 100644
--- a/paludis/repositories/nothing/Makefile.am
+++ b/paludis/repositories/nothing/Makefile.am
@@ -1,7 +1,7 @@
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
MAINTAINERCLEANFILES = Makefile.in
-AM_CXXFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
DEFS= \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
diff --git a/paludis/repositories/portage/Makefile.am b/paludis/repositories/portage/Makefile.am
index a2615f0..85af0c2 100644
--- a/paludis/repositories/portage/Makefile.am
+++ b/paludis/repositories/portage/Makefile.am
@@ -1,7 +1,7 @@
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
MAINTAINERCLEANFILES = Makefile.in
-AM_CXXFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
DEFS= \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
diff --git a/paludis/repositories/vdb/Makefile.am b/paludis/repositories/vdb/Makefile.am
index 8a566cf..d102b8d 100644
--- a/paludis/repositories/vdb/Makefile.am
+++ b/paludis/repositories/vdb/Makefile.am
@@ -1,7 +1,7 @@
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
MAINTAINERCLEANFILES = Makefile.in
-AM_CXXFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
DEFS= \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
diff --git a/paludis/selinux/Makefile.am b/paludis/selinux/Makefile.am
index d455143..c17d410 100644
--- a/paludis/selinux/Makefile.am
+++ b/paludis/selinux/Makefile.am
@@ -20,6 +20,6 @@ EXTRA_DIST =
check_PROGRAMS = $(TESTS)
-AM_CXXFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
diff --git a/paludis/tasks/Makefile.am b/paludis/tasks/Makefile.am
index f4a7842..dbbb445 100644
--- a/paludis/tasks/Makefile.am
+++ b/paludis/tasks/Makefile.am
@@ -1,6 +1,6 @@
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
MAINTAINERCLEANFILES = Makefile.in
-AM_CXXFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
DEFS= \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
diff --git a/paludis/util/Makefile.am.m4 b/paludis/util/Makefile.am.m4
index bfec909..dd98391 100644
--- a/paludis/util/Makefile.am.m4
+++ b/paludis/util/Makefile.am.m4
@@ -32,7 +32,7 @@ include(`paludis/util/files.m4')
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
MAINTAINERCLEANFILES = Makefile.in Makefile.am paludis.hh smart_record.hh \
hashed_containers.hh util.hh
-AM_CXXFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
DEFS=\
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\"
diff --git a/src/Makefile.am b/src/Makefile.am
index 3077737..b1fde1f 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,4 +1,4 @@
-SUBDIRS = paludis qualudis
+SUBDIRS = paludis gtkpaludis qualudis
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
MAINTAINERCLEANFILES = Makefile.in
diff --git a/src/gtkpaludis/Makefile.am b/src/gtkpaludis/Makefile.am
new file mode 100644
index 0000000..75ddbbc
--- /dev/null
+++ b/src/gtkpaludis/Makefile.am
@@ -0,0 +1,38 @@
+AM_CXXFLAGS = -I$(top_srcdir) \
+ @PALUDIS_CXXFLAGS@ \
+ @PALUDIS_CXXFLAGS_NO_WOLD_STYLE_CAST@ \
+ @PALUDIS_CXXFLAGS_NO_WREDUNDANT_DECLS@
+
+DEFS= \
+ -DSYSCONFDIR=\"$(sysconfdir)\" \
+ -DLIBEXECDIR=\"$(libexecdir)\"
+SUBDIRS = .
+
+if ENABLE_GTK
+
+bin_PROGRAMS = gtkpaludis
+
+gtkpaludis_SOURCES = \
+ command_line.cc command_line.hh \
+ browse_tree.cc browse_tree.hh \
+ information_tree.cc information_tree.hh \
+ main_window.cc main_window.hh \
+ gtkpaludis.cc
+
+gtkpaludis_LDADD = \
+ $(top_builddir)/paludis/repositories/nothing/libpaludisnothingrepository.la \
+ $(top_builddir)/paludis/repositories/portage/libpaludisportagerepository.la \
+ $(top_builddir)/paludis/repositories/vdb/libpaludisvdbrepository.la \
+ $(top_builddir)/paludis/tasks/libpaludistasks.a \
+ $(top_builddir)/paludis/libpaludis.la \
+ $(top_builddir)/paludis/args/libpaludisargs.la \
+ $(top_builddir)/paludis/util/libpaludisutil.la \
+ $(DEPS_LIBS)
+
+INCLUDES = $(DEPS_CFLAGS)
+
+CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
+MAINTAINERCLEANFILES = Makefile.in
+
+endif
+
diff --git a/src/gtkpaludis/browse_tree.cc b/src/gtkpaludis/browse_tree.cc
new file mode 100644
index 0000000..2a91ec2
--- /dev/null
+++ b/src/gtkpaludis/browse_tree.cc
@@ -0,0 +1,345 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "browse_tree.hh"
+#include "information_tree.hh"
+#include <gtkmm/treestore.h>
+#include <paludis/default_environment.hh>
+
+using namespace paludis;
+
+namespace
+{
+ class BrowseTreeColumns;
+
+ class BrowseTreeDisplayData :
+ public InternalCounted<BrowseTreeDisplayData>
+ {
+ private:
+ bool _has_children;
+
+ protected:
+ BrowseTreeDisplayData();
+
+ virtual void load_children(
+ Glib::RefPtr<Gtk::TreeStore>,
+ const BrowseTreeColumns & columns,
+ Gtk::TreeModel::iterator) const = 0;
+
+ public:
+ virtual ~BrowseTreeDisplayData();
+
+ virtual void display(InformationTree * const information_tree) const = 0;
+
+ virtual void need_children(
+ Glib::RefPtr<Gtk::TreeStore> model,
+ const BrowseTreeColumns & columns,
+ Gtk::TreeModel::iterator us)
+ {
+ if (! _has_children)
+ {
+ load_children(model, columns, us);
+ _has_children = true;
+ }
+ }
+
+ class DefaultablePointer :
+ public Pointer
+ {
+ public:
+ DefaultablePointer() :
+ Pointer(0)
+ {
+ }
+
+ template <typename T_>
+ DefaultablePointer(T_ v) :
+ Pointer(v)
+ {
+ }
+ };
+ };
+
+ class BrowseTreeColumns :
+ public Gtk::TreeModel::ColumnRecord
+ {
+ public:
+ BrowseTreeColumns();
+ ~BrowseTreeColumns();
+
+ Gtk::TreeModelColumn<Glib::ustring> col_item;
+ Gtk::TreeModelColumn<BrowseTreeDisplayData::DefaultablePointer> col_data;
+ };
+
+ class BrowseTreeDisplayTopData :
+ public BrowseTreeDisplayData
+ {
+ protected:
+ virtual void load_children(
+ Glib::RefPtr<Gtk::TreeStore>,
+ const BrowseTreeColumns &,
+ Gtk::TreeModel::iterator) const
+ {
+ }
+
+ public:
+ virtual void display(InformationTree * const information_tree) const
+ {
+ information_tree->show_top();
+ }
+ };
+
+ class BrowseTreeDisplayVersionData :
+ public BrowseTreeDisplayData
+ {
+ private:
+ RepositoryName _r;
+ QualifiedPackageName _q;
+ VersionSpec _v;
+
+ protected:
+ virtual void load_children(
+ Glib::RefPtr<Gtk::TreeStore>,
+ const BrowseTreeColumns &,
+ Gtk::TreeModel::iterator) const
+ {
+ }
+
+ public:
+ BrowseTreeDisplayVersionData(const RepositoryName & r,
+ const QualifiedPackageName q, const VersionSpec & v) :
+ _r(r),
+ _q(q),
+ _v(v)
+ {
+ }
+
+ virtual void display(InformationTree * const information_tree) const
+ {
+ information_tree->show_version(_r, _q, _v);
+ }
+ };
+
+ class BrowseTreeDisplayPackageData :
+ public BrowseTreeDisplayData
+ {
+ private:
+ RepositoryName _r;
+ QualifiedPackageName _q;
+
+ protected:
+ virtual void load_children(
+ Glib::RefPtr<Gtk::TreeStore> model,
+ const BrowseTreeColumns & columns,
+ Gtk::TreeModel::iterator us) const
+ {
+ Repository::ConstPointer repo(
+ DefaultEnvironment::get_instance()->package_database()->fetch_repository(_r));
+
+ VersionSpecCollection::ConstPointer vers(repo->version_specs(_q));
+ for (VersionSpecCollection::Iterator ver(vers->begin()), ver_end(vers->end()) ;
+ ver != ver_end ; ++ver)
+ {
+ Gtk::TreeModel::Row ver_row = *(model->append(us->children()));
+ ver_row[columns.col_item] = stringify(*ver);
+ ver_row[columns.col_data] = BrowseTreeDisplayData::Pointer(
+ new BrowseTreeDisplayVersionData(_r, _q, *ver));
+ }
+ }
+
+ public:
+ BrowseTreeDisplayPackageData(const RepositoryName & r,
+ const QualifiedPackageName q) :
+ _r(r),
+ _q(q)
+ {
+ }
+
+ virtual void display(InformationTree * const information_tree) const
+ {
+ information_tree->show_package(_r, _q);
+ }
+ };
+
+ class BrowseTreeDisplayCategoryData :
+ public BrowseTreeDisplayData
+ {
+ private:
+ RepositoryName _r;
+ CategoryNamePart _c;
+
+ protected:
+ virtual void load_children(
+ Glib::RefPtr<Gtk::TreeStore> model,
+ const BrowseTreeColumns & columns,
+ Gtk::TreeModel::iterator us) const
+ {
+ Repository::ConstPointer repo(
+ DefaultEnvironment::get_instance()->package_database()->fetch_repository(_r));
+
+ QualifiedPackageNameCollection::ConstPointer pkgs(repo->package_names(_c));
+ for (QualifiedPackageNameCollection::Iterator pkg(pkgs->begin()), pkg_end(pkgs->end()) ;
+ pkg != pkg_end ; ++pkg)
+ {
+ Gtk::TreeModel::Row pkg_row = *(model->append(us->children()));
+ pkg_row[columns.col_item] = stringify(pkg->get<qpn_package>());
+ pkg_row[columns.col_data] = BrowseTreeDisplayData::Pointer(
+ new BrowseTreeDisplayPackageData(_r, *pkg));
+ }
+ }
+
+ public:
+ BrowseTreeDisplayCategoryData(const RepositoryName & r,
+ const CategoryNamePart c) :
+ _r(r),
+ _c(c)
+ {
+ }
+
+ virtual void display(InformationTree * const information_tree) const
+ {
+ information_tree->show_category(_r, _c);
+ }
+ };
+
+ class BrowseTreeDisplayRepositoryData :
+ public BrowseTreeDisplayData
+ {
+ private:
+ RepositoryName _r;
+
+ protected:
+ virtual void load_children(
+ Glib::RefPtr<Gtk::TreeStore> model,
+ const BrowseTreeColumns & columns,
+ Gtk::TreeModel::iterator us) const
+ {
+ Repository::ConstPointer repo(
+ DefaultEnvironment::get_instance()->package_database()->fetch_repository(_r));
+
+ CategoryNamePartCollection::ConstPointer cats(repo->category_names());
+ for (CategoryNamePartCollection::Iterator cat(cats->begin()), cat_end(cats->end()) ;
+ cat != cat_end ; ++cat)
+ {
+ Gtk::TreeModel::Row cat_row = *(model->append(us->children()));
+ cat_row[columns.col_item] = stringify(*cat);
+ cat_row[columns.col_data] = BrowseTreeDisplayData::Pointer(
+ new BrowseTreeDisplayCategoryData(_r, *cat));
+ }
+ }
+
+ public:
+ BrowseTreeDisplayRepositoryData(const RepositoryName & r) :
+ _r(r)
+ {
+ }
+
+ virtual void display(InformationTree * const information_tree) const
+ {
+ information_tree->show_repository(_r);
+ }
+ };
+}
+
+BrowseTreeDisplayData::BrowseTreeDisplayData() :
+ _has_children(false)
+{
+}
+
+BrowseTreeDisplayData::~BrowseTreeDisplayData()
+{
+}
+
+
+BrowseTreeColumns::BrowseTreeColumns()
+{
+ add(col_item);
+ add(col_data);
+}
+
+BrowseTreeColumns::~BrowseTreeColumns()
+{
+}
+
+namespace paludis
+{
+ template<>
+ struct Implementation<BrowseTree> :
+ InternalCounted<Implementation<BrowseTree> >
+ {
+ InformationTree * const information_tree;
+
+ BrowseTreeColumns columns;
+ Glib::RefPtr<Gtk::TreeStore> model;
+
+ Implementation(InformationTree * const i) :
+ information_tree(i)
+ {
+ }
+
+ virtual ~Implementation()
+ {
+ }
+ };
+}
+
+BrowseTree::BrowseTree(InformationTree * const information_tree) :
+ PrivateImplementationPattern<BrowseTree>(new Implementation<BrowseTree>(information_tree))
+{
+ _imp->model = Gtk::TreeStore::create(_imp->columns);
+ set_model(_imp->model);
+
+ Gtk::TreeModel::Row repositories_row = *(_imp->model->append());
+ repositories_row[_imp->columns.col_item] = "Repositories";
+ repositories_row[_imp->columns.col_data] = BrowseTreeDisplayData::DefaultablePointer(
+ new BrowseTreeDisplayTopData);
+
+ for (PackageDatabase::RepositoryIterator
+ r(DefaultEnvironment::get_instance()->package_database()->begin_repositories()),
+ r_end(DefaultEnvironment::get_instance()->package_database()->end_repositories()) ;
+ r != r_end ; ++r)
+ {
+ Gtk::TreeModel::Row repository_row = *(_imp->model->append(repositories_row.children()));
+ repository_row[_imp->columns.col_item] = stringify((*r)->name());
+ repository_row[_imp->columns.col_data] = BrowseTreeDisplayData::Pointer(
+ new BrowseTreeDisplayRepositoryData((*r)->name()));
+ }
+
+ append_column("Item", _imp->columns.col_item);
+ get_selection()->signal_changed().connect(sigc::mem_fun(*this, &BrowseTree::on_treeview_changed));
+}
+
+BrowseTree::~BrowseTree()
+{
+}
+
+void
+BrowseTree::on_treeview_changed()
+{
+ Gtk::TreeModel::iterator i(get_selection()->get_selected());
+ if (i)
+ {
+ Gtk::TreeModel::Row row(*i);
+ BrowseTreeDisplayData::Pointer(row[_imp->columns.col_data])->need_children(_imp->model,
+ _imp->columns, i);
+ BrowseTreeDisplayData::Pointer(row[_imp->columns.col_data])->display(
+ _imp->information_tree);
+ }
+}
+
diff --git a/src/gtkpaludis/browse_tree.hh b/src/gtkpaludis/browse_tree.hh
new file mode 100644
index 0000000..14cd87f
--- /dev/null
+++ b/src/gtkpaludis/browse_tree.hh
@@ -0,0 +1,42 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_SRC_GTKPALUDIS_BROWSE_TREE_HH
+#define PALUDIS_GUARD_SRC_GTKPALUDIS_BROWSE_TREE_HH 1
+
+#include <gtkmm/treeview.h>
+#include <paludis/util/private_implementation_pattern.hh>
+
+namespace paludis
+{
+ class InformationTree;
+
+ class BrowseTree :
+ public Gtk::TreeView,
+ private PrivateImplementationPattern<BrowseTree>
+ {
+ public:
+ BrowseTree(InformationTree * const);
+ ~BrowseTree();
+
+ virtual void on_treeview_changed();
+ };
+}
+
+#endif
diff --git a/src/gtkpaludis/command_line.cc b/src/gtkpaludis/command_line.cc
new file mode 100644
index 0000000..605d342
--- /dev/null
+++ b/src/gtkpaludis/command_line.cc
@@ -0,0 +1,68 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include "command_line.hh"
+
+CommandLine::CommandLine() :
+ ArgsHandler(),
+
+ action_args(this, "Actions",
+ "Selects which basic action to perform. Up to one action should "
+ "be specified."),
+ a_version(&action_args, "version", 'V', "Display program version"),
+ a_help(&action_args, "help", 'h', "Display program help"),
+
+ general_args(this, "General options",
+ "Options which are relevant for most or all actions."),
+ a_log_level(&general_args, "log-level", '\0', "Specify the log level",
+ paludis::args::EnumArg::EnumArgOptions("debug", "Show debug output (noisy)")
+ ("qa", "Show QA messages and warnings only")
+ ("warning", "Show warnings only")
+ ("silent", "Suppress all log messages"),
+ "qa"),
+ a_config_suffix(&general_args, "config-suffix", 'c', "Config directory suffix")
+{
+ add_usage_line("[ general options ]");
+ add_usage_line("--version");
+ add_usage_line("--help");
+}
+
+std::string
+CommandLine::app_name() const
+{
+ return "gtkpaludis";
+}
+
+std::string
+CommandLine::app_synopsis() const
+{
+ return "A graphical interface for the other package mangler";
+}
+
+std::string
+CommandLine::app_description() const
+{
+ return
+ "A graphical interface for the paludis package manager.";
+}
+
+CommandLine::~CommandLine()
+{
+}
+
diff --git a/src/gtkpaludis/command_line.hh b/src/gtkpaludis/command_line.hh
new file mode 100644
index 0000000..f4c0aff
--- /dev/null
+++ b/src/gtkpaludis/command_line.hh
@@ -0,0 +1,98 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_SRC_COMMAND_LINE_HH
+#define PALUDIS_GUARD_SRC_COMMAND_LINE_HH 1
+
+#include <paludis/args/args.hh>
+#include <paludis/util/instantiation_policy.hh>
+
+/** \file
+ * Declarations for the CommandLine class.
+ */
+
+/**
+ * Our command line.
+ */
+class CommandLine :
+ public paludis::args::ArgsHandler,
+ public paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonAsNeededTag>
+{
+ friend class paludis::InstantiationPolicy<CommandLine, paludis::instantiation_method::SingletonAsNeededTag>;
+
+ private:
+ /// Constructor.
+ CommandLine();
+
+ /// Destructor.
+ ~CommandLine();
+
+ public:
+ ///\name Program information
+ ///\{
+
+ virtual std::string app_name() const;
+ virtual std::string app_synopsis() const;
+ virtual std::string app_description() const;
+
+ ///\}
+
+ /// \name Action arguments
+ ///\{
+
+ /// Action arguments.
+ paludis::args::ArgsGroup action_args;
+
+ /// --version
+ paludis::args::SwitchArg a_version;
+
+ /// --help
+ paludis::args::SwitchArg a_help;
+
+ ///\}
+
+ /// \name General arguments
+ ///\{
+
+ /// General arguments.
+ paludis::args::ArgsGroup general_args;
+
+ /// --log-level
+ paludis::args::EnumArg a_log_level;
+
+ /// --config-suffix
+ paludis::args::StringArg a_config_suffix;
+
+ ///\}
+};
+
+/**
+ * Show the help message.
+ */
+struct DoHelp
+{
+ const std::string message;
+
+ DoHelp(const std::string & m = "") :
+ message(m)
+ {
+ }
+};
+
+#endif
diff --git a/src/gtkpaludis/gtkpaludis.cc b/src/gtkpaludis/gtkpaludis.cc
new file mode 100644
index 0000000..ade5842
--- /dev/null
+++ b/src/gtkpaludis/gtkpaludis.cc
@@ -0,0 +1,202 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#include <paludis/paludis.hh>
+#include <paludis/util/log.hh>
+
+#include <libebt/libebt_version.hh>
+
+#include <libwrapiter/libwrapiter_version.hh>
+
+#include <gtkmm/main.h>
+#include <gtkmm/messagedialog.h>
+
+#include <iostream>
+
+#include "command_line.hh"
+#include "main_window.hh"
+
+using namespace paludis;
+using std::cout;
+using std::cerr;
+using std::endl;
+
+namespace
+{
+ struct DoVersion
+ {
+ };
+
+ void display_version()
+ {
+ cout << "gtkpaludis " << PALUDIS_VERSION_MAJOR << "."
+ << PALUDIS_VERSION_MINOR << "." << PALUDIS_VERSION_MICRO;
+ if (! std::string(PALUDIS_SUBVERSION_REVISION).empty())
+ cout << " svn " << PALUDIS_SUBVERSION_REVISION;
+ cout << endl << endl;
+ cout << "Built by " << PALUDIS_BUILD_USER << "@" << PALUDIS_BUILD_HOST
+ << " on " << PALUDIS_BUILD_DATE << endl;
+ cout << "CXX: " << PALUDIS_BUILD_CXX
+#if defined(__ICC)
+ << " " << __ICC
+#elif defined(__VERSION__)
+ << " " << __VERSION__
+#endif
+ << endl;
+ cout << "CXXFLAGS: " << PALUDIS_BUILD_CXXFLAGS << endl;
+ cout << "LDFLAGS: " << PALUDIS_BUILD_LDFLAGS << endl;
+ cout << "SYSCONFDIR: " << SYSCONFDIR << endl;
+ cout << "LIBEXECDIR: " << LIBEXECDIR << endl;
+ cout << "stdlib: "
+#if defined(__GLIBCXX__)
+# define XSTRINGIFY(x) #x
+# define STRINGIFY(x) XSTRINGIFY(x)
+ << "GNU libstdc++ " << STRINGIFY(__GLIBCXX__)
+#endif
+ << endl;
+
+ cout << "libebt: " << LIBEBT_VERSION_MAJOR << "." << LIBEBT_VERSION_MINOR
+ << "." << LIBEBT_VERSION_MICRO << endl;
+ cout << "libwrapiter: " << LIBWRAPITER_VERSION_MAJOR << "." << LIBWRAPITER_VERSION_MINOR
+ << "." << LIBWRAPITER_VERSION_MICRO << endl;
+#if HAVE_SANDBOX
+ cout << "sandbox: enabled" << endl;
+#else
+ cout << "sandbox: disabled" << endl;
+#endif
+ }
+}
+
+int
+main(int argc, char * argv[])
+{
+ Context context("In main program:");
+ Gtk::Main gui_kit(argc, argv);
+
+ try
+ {
+ {
+ Context context_local("When handling command line:");
+ CommandLine::get_instance()->run(argc, argv);
+
+ if (CommandLine::get_instance()->a_help.specified())
+ throw DoHelp();
+
+ if (CommandLine::get_instance()->a_version.specified())
+ throw DoVersion();
+
+ if (! CommandLine::get_instance()->a_log_level.specified())
+ Log::get_instance()->set_log_level(ll_qa);
+ else if (CommandLine::get_instance()->a_log_level.argument() == "debug")
+ Log::get_instance()->set_log_level(ll_debug);
+ else if (CommandLine::get_instance()->a_log_level.argument() == "qa")
+ Log::get_instance()->set_log_level(ll_qa);
+ else if (CommandLine::get_instance()->a_log_level.argument() == "warning")
+ Log::get_instance()->set_log_level(ll_warning);
+ else if (CommandLine::get_instance()->a_log_level.argument() == "silent")
+ Log::get_instance()->set_log_level(ll_silent);
+ else
+ throw DoHelp("bad value for --log-level");
+ }
+
+ {
+ Context context_local("When loading configuration:");
+
+ std::string paludis_command(argv[0]);
+ std::string::size_type last_slash(paludis_command.rfind('/'));
+ if (std::string::npos == last_slash)
+ last_slash = 0;
+ if (0 == paludis_command.compare(last_slash, 3, "gtk"))
+ paludis_command.erase(last_slash, 3);
+
+ if (CommandLine::get_instance()->a_config_suffix.specified())
+ {
+ DefaultConfig::set_config_suffix(CommandLine::get_instance()->a_config_suffix.argument());
+ paludis_command.append(" --config-suffix " +
+ CommandLine::get_instance()->a_config_suffix.argument());
+ }
+
+ paludis_command.append(" --log-level " + CommandLine::get_instance()->a_log_level.argument());
+ DefaultConfig::get_instance()->set_paludis_command(paludis_command);
+ }
+
+ {
+ Context context_local("When displaying main window:");
+ MainWindow main_window;
+ Gtk::Main::run(main_window);
+ }
+ }
+ catch (const DoVersion &)
+ {
+ display_version();
+ cout << endl;
+ cout << "Paludis comes with ABSOLUTELY NO WARRANTY. Paludis is free software, and you" << endl;
+ cout << "are welcome to redistribute it under the terms of the GNU General Public" << endl;
+ cout << "License, version 2." << endl;
+
+ return EXIT_SUCCESS;
+ }
+ catch (const paludis::args::ArgsError & e)
+ {
+ cerr << "Usage error: " << e.message() << endl;
+ cerr << "Try " << argv[0] << " --help" << endl;
+ return EXIT_FAILURE;
+ }
+ catch (const DoHelp & h)
+ {
+ if (h.message.empty())
+ {
+ cout << "Usage: " << argv[0] << " [options]" << endl;
+ cout << endl;
+ cout << *CommandLine::get_instance();
+ return EXIT_SUCCESS;
+ }
+ else
+ {
+ cerr << "Usage error: " << h.message << endl;
+ cerr << "Try " << argv[0] << " --help" << endl;
+ return EXIT_FAILURE;
+ }
+ }
+ catch (const Exception & e)
+ {
+ Gtk::MessageDialog dialog("Unhandled exception", false, Gtk::MESSAGE_ERROR);
+ dialog.set_secondary_text(
+ "- " + e.backtrace("\n- ") + e.message() + " (" + e.what() + ")");
+ dialog.run();
+ return EXIT_FAILURE;
+ }
+ catch (const std::exception & e)
+ {
+ Gtk::MessageDialog dialog("Unhandled exception", false, Gtk::MESSAGE_ERROR);
+ dialog.set_secondary_text("Unhandled exception (" + stringify(e.what()) + ")");
+ dialog.run();
+ return EXIT_FAILURE;
+ }
+ catch (...)
+ {
+ Gtk::MessageDialog dialog("Unhandled exception", false, Gtk::MESSAGE_ERROR);
+ dialog.set_secondary_text("Unhandled exception (unknown type)");
+ dialog.run();
+ return EXIT_FAILURE;
+ }
+
+ return EXIT_SUCCESS;
+}
+
diff --git a/src/gtkpaludis/information_tree.hh b/src/gtkpaludis/information_tree.hh
new file mode 100644
index 0000000..4120484
--- /dev/null
+++ b/src/gtkpaludis/information_tree.hh
@@ -0,0 +1,58 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_SRC_GTKPALUDIS_INFORMATION_TREE_HH
+#define PALUDIS_GUARD_SRC_GTKPALUDIS_INFORMATION_TREE_HH 1
+
+#include <gtkmm/treeview.h>
+#include <paludis/util/private_implementation_pattern.hh>
+#include <paludis/name.hh>
+#include <paludis/version_spec.hh>
+
+namespace paludis
+{
+ class InformationTreeColumns :
+ public Gtk::TreeModel::ColumnRecord
+ {
+ public:
+ InformationTreeColumns();
+ ~InformationTreeColumns();
+
+ Gtk::TreeModelColumn<Glib::ustring> col_key;
+ Gtk::TreeModelColumn<Glib::ustring> col_value;
+ };
+
+ class InformationTree :
+ public Gtk::TreeView,
+ private PrivateImplementationPattern<InformationTree>
+ {
+ public:
+ InformationTree();
+ ~InformationTree();
+
+ void show_top();
+ void show_repository(const RepositoryName &);
+ void show_category(const RepositoryName &, const CategoryNamePart &);
+ void show_package(const RepositoryName &, const QualifiedPackageName &);
+ void show_version(const RepositoryName &, const QualifiedPackageName &,
+ const VersionSpec &);
+ };
+}
+
+#endif
diff --git a/src/gtkpaludis/main_window.hh b/src/gtkpaludis/main_window.hh
new file mode 100644
index 0000000..9c7ef58
--- /dev/null
+++ b/src/gtkpaludis/main_window.hh
@@ -0,0 +1,38 @@
+/* vim: set sw=4 sts=4 et foldmethod=syntax : */
+
+/*
+ * Copyright (c) 2006 Ciaran McCreesh <ciaran.mccreesh@blueyonder.co.uk>
+ *
+ * This file is part of the Paludis package manager. Paludis is free software;
+ * you can redistribute it and/or modify it under the terms of the GNU General
+ * Public License version 2, as published by the Free Software Foundation.
+ *
+ * Paludis is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
+ * details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+ * Place, Suite 330, Boston, MA 02111-1307 USA
+ */
+
+#ifndef PALUDIS_GUARD_SRC_GTKPALUDIS_MAIN_WINDOW_HH
+#define PALUDIS_GUARD_SRC_GTKPALUDIS_MAIN_WINDOW_HH 1
+
+#include <gtkmm/window.h>
+#include <paludis/util/private_implementation_pattern.hh>
+
+namespace paludis
+{
+ class MainWindow :
+ public Gtk::Window,
+ private PrivateImplementationPattern<MainWindow>
+ {
+ public:
+ MainWindow();
+ virtual ~MainWindow();
+ };
+}
+
+#endif
diff --git a/src/paludis/Makefile.am b/src/paludis/Makefile.am
index 95194da..9d2ca27 100644
--- a/src/paludis/Makefile.am
+++ b/src/paludis/Makefile.am
@@ -1,4 +1,4 @@
-AM_CXXFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
DEFS= \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\"
diff --git a/src/qualudis/Makefile.am b/src/qualudis/Makefile.am
index ddb2562..ac12ad4 100644
--- a/src/qualudis/Makefile.am
+++ b/src/qualudis/Makefile.am
@@ -1,4 +1,4 @@
-AM_CXXFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
DEFS= \
-DSYSCONFDIR=\"$(sysconfdir)\" \
-DLIBEXECDIR=\"$(libexecdir)\" \
diff --git a/test/Makefile.am b/test/Makefile.am
index 6d7aff8..90724b0 100644
--- a/test/Makefile.am
+++ b/test/Makefile.am
@@ -1,6 +1,6 @@
CLEANFILES = *~ gmon.out *.gcov *.gcno *.gcda
MAINTAINERCLEANFILES = Makefile.in
-AM_CXXFLAGS = -I$(top_srcdir)
+AM_CXXFLAGS = -I$(top_srcdir) @PALUDIS_CXXFLAGS@
EXTRA_DIST = run_test.sh
libtest_a_SOURCES = \