diff -ru -X autoconf_exclude.txt oprofile-0.9.6/configure.in oprofile-0.9.6.new/configure.in --- oprofile-0.9.6/configure.in 2009-11-24 16:25:17.000000000 +0100 +++ oprofile-0.9.6.new/configure.in 2010-10-20 00:27:31.000000000 +0200 @@ -131,7 +131,16 @@ LIBS="$X_PRE_LIBS $LIBS $X_LIBS -lX11 $X_EXTRA_LIBS" X_LIBS="$LIBS" AC_SUBST(X_LIBS) -QT_DO_IT_ALL + + +AC_ARG_ENABLE(qt4,[ --enable-qt4 compile with gui component (qt4 using qt3support)]) +if test "x$enable_qt4" = "xyes"; then + PKG_CHECK_MODULES(QT, Qt3Support QtGui,,exit) + AC_CHECK_PROG(MOC, moc, moc) + AC_CHECK_PROG(UIC3, uic3, uic3) +fi + + LIBS="$ORIG_X_SAVE_LIBS" dnl enable pch for c++ @@ -155,7 +164,7 @@ # do NOT put tests here, they will fail in the case X is not installed ! -AM_CONDITIONAL(have_qt, test -n "$QT_LIB") +AM_CONDITIONAL(have_qt, test -n "$QT_LIBS") AX_CFLAGS_OPTION(OP_CFLAGS,[-W]) AX_CXXFLAGS_OPTION(OP_CXXFLAGS,[-W]) @@ -268,8 +277,8 @@ AX_COPY_IF_CHANGE(doc/xsl/catalog-1.xml, doc/xsl/catalog.xml) -if test -z "$QT_LIB"; then - echo "Warning: a working Qt not found; no GUI will be built" +if test -z "$QT_LIBS"; then + echo "Warning: a working Qt not found or GUI disabled; no GUI will be built" fi if test "`getent passwd oprofile 2>/dev/null`" == "" || \ diff -ru -X autoconf_exclude.txt oprofile-0.9.6/gui/Makefile.am oprofile-0.9.6.new/gui/Makefile.am --- oprofile-0.9.6/gui/Makefile.am 2009-11-24 16:25:17.000000000 +0100 +++ oprofile-0.9.6.new/gui/Makefile.am 2010-10-20 00:08:25.000000000 +0200 @@ -14,7 +14,8 @@ if have_qt AM_CPPFLAGS = \ - @QT_INCLUDES@ \ + @QT_CFLAGS@ \ + -DQT3_SUPPORT \ -I ${top_srcdir}/libop \ -I ${top_srcdir}/libutil++ \ -I ${top_srcdir}/libutil @@ -30,8 +31,7 @@ ../libop/libop.a \ ../libutil/libutil.a \ ui/liboprof_start.a \ - @QT_LDFLAGS@ \ - @QT_LIB@ \ + @QT_LIBS@ \ @X_LIBS@ oprof_start.moc.cpp: ${top_srcdir}/gui/oprof_start.h diff -ru -X autoconf_exclude.txt oprofile-0.9.6/gui/oprof_start.cpp oprofile-0.9.6.new/gui/oprof_start.cpp --- oprofile-0.9.6/gui/oprof_start.cpp 2009-11-24 16:25:17.000000000 +0100 +++ oprofile-0.9.6.new/gui/oprof_start.cpp 2010-10-19 23:49:12.000000000 +0200 @@ -20,19 +20,19 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "config.h" #include "oprof_start.h" @@ -268,10 +268,10 @@ namespace { /// find the first item with the given text in column 0 or return NULL -QListViewItem * findItem(QListView * view, char const * name) +Q3ListViewItem * findItem(Q3ListView * view, char const * name) { // Qt 2.3.1 does not have QListView::findItem() - QListViewItem * item = view->firstChild(); + Q3ListViewItem * item = view->firstChild(); while (item && strcmp(item->text(0).latin1(), name)) item = item->nextSibling(); @@ -292,7 +292,7 @@ event_cfgs[descr.name].user_ring_count = 1; event_cfgs[descr.name].os_ring_count = 1; - QListViewItem * item = findItem(events_list, descr.name); + Q3ListViewItem * item = findItem(events_list, descr.name); if (item) item->setSelected(true); } @@ -349,7 +349,7 @@ event_cfgs[ev_name].os_ring_count = 1; } - QListViewItem * item = findItem(events_list, ev_name.c_str()); + Q3ListViewItem * item = findItem(events_list, ev_name.c_str()); if (item) item->setSelected(true); } @@ -436,7 +436,7 @@ for (vector::reverse_iterator cit = v_events.rbegin(); cit != v_events.rend(); ++cit) { - new QListViewItem(events_list, cit->name.c_str()); + new Q3ListViewItem(events_list, cit->name.c_str()); } setUpdatesEnabled(true); @@ -467,7 +467,7 @@ } -bool oprof_start::is_selectable_event(QListViewItem * item) +bool oprof_start::is_selectable_event(Q3ListViewItem * item) { if (item->isSelected()) return true; @@ -486,7 +486,7 @@ void oprof_start::draw_event_list() { - QListViewItem * cur; + Q3ListViewItem * cur; for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) { if (is_selectable_event(cur)) cur->setPixmap(0, *green_pixmap); @@ -500,7 +500,7 @@ { vector events; - set::const_iterator it; + set::const_iterator it; for (it = selected_events.begin(); it != selected_events.end(); ++it) events.push_back(find_event_by_name((*it)->text(0).latin1(),0,0)); @@ -520,24 +520,24 @@ // (de)selected item so we record a set of selected items and diff // it in the appropriate way with the previous list of selected items. - set current_selection; - QListViewItem * cur; + set current_selection; + Q3ListViewItem * cur; for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) { if (cur->isSelected()) current_selection.insert(cur); } // First remove the deselected item. - vector new_deselected; + vector new_deselected; set_difference(selected_events.begin(), selected_events.end(), current_selection.begin(), current_selection.end(), back_inserter(new_deselected)); - vector::const_iterator it; + vector::const_iterator it; for (it = new_deselected.begin(); it != new_deselected.end(); ++it) selected_events.erase(*it); // Now try to add the newly selected item if enough HW resource exists - vector new_selected; + vector new_selected; set_difference(current_selection.begin(), current_selection.end(), selected_events.begin(), selected_events.end(), back_inserter(new_selected)); @@ -558,7 +558,7 @@ } -void oprof_start::event_over(QListViewItem * item) +void oprof_start::event_over(Q3ListViewItem * item) { op_event_descr const & descr = locate_event(item->text(0).latin1()); @@ -566,10 +566,10 @@ if (!is_selectable_event(item)) { help_str += " conflicts with:"; - set::const_iterator it; + set::const_iterator it; for (it = selected_events.begin(); it != selected_events.end(); ) { - QListViewItem * temp = *it; + Q3ListViewItem * temp = *it; selected_events.erase(it++); if (is_selectable_event(item)) { help_str += " "; @@ -844,7 +844,7 @@ bool one_enable = false; - QListViewItem * cur; + Q3ListViewItem * cur; for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) { if (!cur->isSelected()) continue; @@ -946,7 +946,7 @@ vector tmpargs; tmpargs.push_back("--setup"); - QListViewItem * cur; + Q3ListViewItem * cur; for (cur = events_list->firstChild(); cur; cur = cur->nextSibling()) { if (!cur->isSelected()) continue; diff -ru -X autoconf_exclude.txt oprofile-0.9.6/gui/oprof_start.h oprofile-0.9.6.new/gui/oprof_start.h --- oprofile-0.9.6/gui/oprof_start.h 2009-11-24 16:25:17.000000000 +0100 +++ oprofile-0.9.6.new/gui/oprof_start.h 2010-10-19 23:50:41.000000000 +0200 @@ -62,7 +62,7 @@ /// events selection change void event_selected(); /// the mouse is over an event - void event_over(QListViewItem *); + void event_over(Q3ListViewItem *); /// state of separate_kernel_cb changed void on_separate_kernel_cb_changed(int); /// reset sample files @@ -121,7 +121,7 @@ void draw_event_list(); /// return true if item is selectable or already selected - bool is_selectable_event(QListViewItem * item); + bool is_selectable_event(Q3ListViewItem * item); /// try to alloc counters for the selected_events bool alloc_selected_events() const; @@ -139,8 +139,8 @@ /// The currently selected events. We must track this because /// with multiple selection listbox QT doesn't allow to know /// what is the last selected item. events_selected() update it - std::set selected_events; - QListViewItem * current_event; + std::set selected_events; + Q3ListViewItem * current_event; /// current config config_setting config; diff -ru -X autoconf_exclude.txt oprofile-0.9.6/gui/ui/Makefile.am oprofile-0.9.6.new/gui/ui/Makefile.am --- oprofile-0.9.6/gui/ui/Makefile.am 2009-11-24 16:25:17.000000000 +0100 +++ oprofile-0.9.6.new/gui/ui/Makefile.am 2010-10-20 00:08:15.000000000 +0200 @@ -2,18 +2,18 @@ if have_qt -AM_CPPFLAGS = @QT_INCLUDES@ +AM_CPPFLAGS = @QT_CFLAGS@ -AM_CXXFLAGS = @OP_CXXFLAGS@ +AM_CXXFLAGS = @OP_CXXFLAGS@ -DQT3_SUPPORT noinst_LIBRARIES = liboprof_start.a nodist_liboprof_start_a_SOURCES = oprof_start.base.cpp oprof_start.base.moc.cpp oprof_start.base.h: oprof_start.base.ui - $(UIC) -o $@ $< + $(UIC3) -o $@ $< oprof_start.base.cpp: oprof_start.base.h oprof_start.base.ui - $(UIC) -o $@ -impl $^ + $(UIC3) -o $@ -impl $^ oprof_start.base.moc.cpp: oprof_start.base.h $(MOC) -o $@ $< Only in oprofile-0.9.6.new/m4: libtool.m4 Only in oprofile-0.9.6.new/m4: ltoptions.m4 Only in oprofile-0.9.6.new/m4: ltsugar.m4 Only in oprofile-0.9.6.new/m4: ltversion.m4 Only in oprofile-0.9.6.new/m4: lt~obsolete.m4