aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2016-04-11 13:01:07 +0200
committerDaniel Lange <DLange@git.local>2016-04-11 13:01:07 +0200
commitff9409b1737627857eb47f64f536a3f66b6a09a4 (patch)
tree61b631ba551e68a4f656b8b76ff7bd0d9955fc64
parentf75ab6d2c11e8a8e18191b087564aedebbeb96c5 (diff)
downloaddebian_htop-ff9409b1737627857eb47f64f536a3f66b6a09a4.tar.gz
debian_htop-ff9409b1737627857eb47f64f536a3f66b6a09a4.tar.bz2
debian_htop-ff9409b1737627857eb47f64f536a3f66b6a09a4.zip
Imported Upstream version 2.0.0upstream/2.0.0
-rw-r--r--Action.c574
-rw-r--r--Action.h56
-rw-r--r--Affinity.c77
-rw-r--r--Affinity.h22
-rw-r--r--AffinityPanel.c12
-rw-r--r--AffinityPanel.h2
-rw-r--r--AvailableColumnsPanel.c32
-rw-r--r--AvailableColumnsPanel.h7
-rw-r--r--AvailableMetersPanel.c46
-rw-r--r--AvailableMetersPanel.h6
-rw-r--r--BatteryMeter.c281
-rw-r--r--BatteryMeter.h1
-rw-r--r--CPUMeter.c93
-rw-r--r--CPUMeter.h13
-rw-r--r--CRT.c896
-rw-r--r--CRT.h73
-rw-r--r--CategoriesPanel.c58
-rw-r--r--CategoriesPanel.h7
-rw-r--r--ChangeLog30
-rw-r--r--CheckItem.c12
-rw-r--r--CheckItem.h4
-rw-r--r--ClockMeter.c2
-rw-r--r--ColorsPanel.c19
-rw-r--r--ColorsPanel.h2
-rw-r--r--ColumnsPanel.c77
-rw-r--r--ColumnsPanel.h5
-rw-r--r--DisplayOptionsPanel.c40
-rw-r--r--EnvScreen.c67
-rw-r--r--EnvScreen.h22
-rw-r--r--FunctionBar.c35
-rw-r--r--FunctionBar.h9
-rw-r--r--Hashtable.c7
-rw-r--r--Header.c219
-rw-r--r--Header.h40
-rw-r--r--IncSet.c44
-rw-r--r--IncSet.h5
-rw-r--r--InfoScreen.c180
-rw-r--r--InfoScreen.h53
-rw-r--r--ListItem.c23
-rw-r--r--ListItem.h3
-rw-r--r--LoadAverageMeter.c34
-rw-r--r--MainPanel.c213
-rw-r--r--MainPanel.h47
-rw-r--r--Makefile.am84
-rw-r--r--Makefile.in1887
-rw-r--r--MemoryMeter.c46
-rw-r--r--Meter.c235
-rw-r--r--Meter.h32
-rw-r--r--MetersPanel.c118
-rw-r--r--MetersPanel.h12
-rw-r--r--Object.c5
-rw-r--r--Object.h5
-rw-r--r--OpenFilesScreen.c146
-rw-r--r--OpenFilesScreen.h16
-rw-r--r--Panel.c249
-rw-r--r--Panel.h30
-rw-r--r--Process.c812
-rw-r--r--Process.h211
-rw-r--r--ProcessList.c932
-rw-r--r--ProcessList.h134
-rw-r--r--README32
-rw-r--r--RichString.c44
-rw-r--r--RichString.h20
-rw-r--r--ScreenManager.c258
-rw-r--r--ScreenManager.h10
-rw-r--r--Settings.c367
-rw-r--r--Settings.h47
-rw-r--r--SignalsPanel.c54
-rw-r--r--StringUtils.c (renamed from String.c)21
-rw-r--r--StringUtils.h (renamed from String.h)6
-rw-r--r--SwapMeter.c34
-rw-r--r--SwapMeter.h5
-rw-r--r--TasksMeter.c38
-rw-r--r--TraceScreen.c269
-rw-r--r--TraceScreen.h25
-rw-r--r--UptimeMeter.c15
-rw-r--r--UsersTable.c5
-rw-r--r--Vector.c11
-rw-r--r--XAlloc.c52
-rw-r--r--XAlloc.h20
-rw-r--r--aclocal.m4721
-rwxr-xr-xautogen.sh10
-rw-r--r--config.h25
-rw-r--r--config.h.in19
-rwxr-xr-xconfigure2750
-rw-r--r--configure.ac152
-rw-r--r--darwin/Battery.c75
-rw-r--r--darwin/Battery.h9
-rw-r--r--darwin/DarwinCRT.c35
-rw-r--r--darwin/DarwinCRT.h15
-rw-r--r--darwin/DarwinProcess.c344
-rw-r--r--darwin/DarwinProcess.h41
-rw-r--r--darwin/DarwinProcessList.c184
-rw-r--r--darwin/DarwinProcessList.h45
-rw-r--r--darwin/Platform.c295
-rw-r--r--darwin/Platform.h53
-rw-r--r--freebsd/Battery.c15
-rw-r--r--freebsd/Battery.h15
-rw-r--r--freebsd/FreeBSDCRT.c21
-rw-r--r--freebsd/FreeBSDCRT.h15
-rw-r--r--freebsd/FreeBSDProcess.c164
-rw-r--r--freebsd/FreeBSDProcess.h54
-rw-r--r--freebsd/FreeBSDProcessList.c532
-rw-r--r--freebsd/FreeBSDProcessList.h69
-rw-r--r--freebsd/Platform.c206
-rw-r--r--freebsd/Platform.h51
-rw-r--r--htop.1164
-rw-r--r--htop.1.in164
-rw-r--r--htop.c899
-rw-r--r--htop.desktop52
-rw-r--r--htop.h5
-rw-r--r--linux/Battery.c331
-rw-r--r--linux/Battery.h41
-rw-r--r--linux/IOPriority.c (renamed from IOPriority.c)0
-rw-r--r--linux/IOPriority.h (renamed from IOPriority.h)0
-rw-r--r--linux/IOPriorityPanel.c (renamed from IOPriorityPanel.c)3
-rw-r--r--linux/IOPriorityPanel.h (renamed from IOPriorityPanel.h)1
-rw-r--r--linux/LinuxCRT.c36
-rw-r--r--linux/LinuxCRT.h17
-rw-r--r--linux/LinuxProcess.c413
-rw-r--r--linux/LinuxProcess.h161
-rw-r--r--linux/LinuxProcessList.c775
-rw-r--r--linux/LinuxProcessList.h94
-rw-r--r--linux/Platform.c239
-rw-r--r--linux/Platform.h48
-rw-r--r--[-rwxr-xr-x]ltmain.sh2434
-rw-r--r--m4/libtool.m41305
-rw-r--r--m4/ltoptions.m419
-rw-r--r--m4/ltversion.m412
-rw-r--r--openbsd/Battery.c16
-rw-r--r--openbsd/Battery.h16
-rw-r--r--openbsd/OpenBSDCRT.c22
-rw-r--r--openbsd/OpenBSDCRT.h16
-rw-r--r--openbsd/OpenBSDProcess.c234
-rw-r--r--openbsd/OpenBSDProcess.h48
-rw-r--r--openbsd/OpenBSDProcessList.c266
-rw-r--r--openbsd/OpenBSDProcessList.h48
-rw-r--r--openbsd/Platform.c302
-rw-r--r--openbsd/Platform.h73
-rwxr-xr-xscripts/MakeHeader.py4
-rw-r--r--unsupported/Battery.c8
-rw-r--r--unsupported/Battery.h9
-rw-r--r--unsupported/Platform.c136
-rw-r--r--unsupported/Platform.h46
-rw-r--r--unsupported/UnsupportedCRT.c21
-rw-r--r--unsupported/UnsupportedCRT.h15
-rw-r--r--unsupported/UnsupportedProcess.c33
-rw-r--r--unsupported/UnsupportedProcess.h22
-rw-r--r--unsupported/UnsupportedProcessList.c75
-rw-r--r--unsupported/UnsupportedProcessList.h22
150 files changed, 17180 insertions, 7115 deletions
diff --git a/Action.c b/Action.c
new file mode 100644
index 0000000..4ef06f4
--- /dev/null
+++ b/Action.c
@@ -0,0 +1,574 @@
+/*
+htop - Action.c
+(C) 2015 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "config.h"
+
+#include "Action.h"
+#include "Affinity.h"
+#include "AffinityPanel.h"
+#include "CategoriesPanel.h"
+#include "CRT.h"
+#include "EnvScreen.h"
+#include "MainPanel.h"
+#include "OpenFilesScreen.h"
+#include "Process.h"
+#include "ScreenManager.h"
+#include "SignalsPanel.h"
+#include "StringUtils.h"
+#include "TraceScreen.h"
+#include "Platform.h"
+
+#include <ctype.h>
+#include <math.h>
+#include <pwd.h>
+#include <stdlib.h>
+#include <stdbool.h>
+#include <sys/param.h>
+#include <sys/time.h>
+
+/*{
+
+#include "IncSet.h"
+#include "Settings.h"
+#include "Header.h"
+#include "UsersTable.h"
+#include "ProcessList.h"
+#include "Panel.h"
+
+typedef enum {
+ HTOP_OK = 0x00,
+ HTOP_REFRESH = 0x01,
+ HTOP_RECALCULATE = 0x03, // implies HTOP_REFRESH
+ HTOP_SAVE_SETTINGS = 0x04,
+ HTOP_KEEP_FOLLOWING = 0x08,
+ HTOP_QUIT = 0x10,
+ HTOP_REDRAW_BAR = 0x20,
+ HTOP_UPDATE_PANELHDR = 0x41, // implies HTOP_REFRESH
+} Htop_Reaction;
+
+typedef Htop_Reaction (*Htop_Action)();
+
+typedef struct State_ {
+ Settings* settings;
+ UsersTable* ut;
+ ProcessList* pl;
+ Panel* panel;
+ Header* header;
+} State;
+
+}*/
+
+Object* Action_pickFromVector(State* st, Panel* list, int x) {
+ Panel* panel = st->panel;
+ Header* header = st->header;
+ Settings* settings = st->settings;
+
+ int y = panel->y;
+ ScreenManager* scr = ScreenManager_new(0, header->height, 0, -1, HORIZONTAL, header, settings, false);
+ scr->allowFocusChange = false;
+ ScreenManager_add(scr, list, x - 1);
+ ScreenManager_add(scr, panel, -1);
+ Panel* panelFocus;
+ int ch;
+ bool unfollow = false;
+ int pid = MainPanel_selectedPid((MainPanel*)panel);
+ if (header->pl->following == -1) {
+ header->pl->following = pid;
+ unfollow = true;
+ }
+ ScreenManager_run(scr, &panelFocus, &ch);
+ if (unfollow) {
+ header->pl->following = -1;
+ }
+ ScreenManager_delete(scr);
+ Panel_move(panel, 0, y);
+ Panel_resize(panel, COLS, LINES-y-1);
+ if (panelFocus == list && ch == 13) {
+ Process* selected = (Process*)Panel_getSelected(panel);
+ if (selected && selected->pid == pid)
+ return Panel_getSelected(list);
+ else
+ beep();
+ }
+ return NULL;
+}
+
+// ----------------------------------------
+
+static void Action_runSetup(Settings* settings, const Header* header, ProcessList* pl) {
+ ScreenManager* scr = ScreenManager_new(0, header->height, 0, -1, HORIZONTAL, header, settings, true);
+ CategoriesPanel* panelCategories = CategoriesPanel_new(scr, settings, (Header*) header, pl);
+ ScreenManager_add(scr, (Panel*) panelCategories, 16);
+ CategoriesPanel_makeMetersPage(panelCategories);
+ Panel* panelFocus;
+ int ch;
+ ScreenManager_run(scr, &panelFocus, &ch);
+ ScreenManager_delete(scr);
+ if (settings->changed) {
+ Header_writeBackToSettings(header);
+ }
+}
+
+static bool changePriority(MainPanel* panel, int delta) {
+ bool anyTagged;
+ bool ok = MainPanel_foreachProcess(panel, (MainPanel_ForeachProcessFn) Process_changePriorityBy, delta, &anyTagged);
+ if (!ok)
+ beep();
+ return anyTagged;
+}
+
+static void addUserToVector(int key, void* userCast, void* panelCast) {
+ char* user = (char*) userCast;
+ Panel* panel = (Panel*) panelCast;
+ Panel_add(panel, (Object*) ListItem_new(user, key));
+}
+
+bool Action_setUserOnly(const char* userName, uid_t* userId) {
+ struct passwd* user = getpwnam(userName);
+ if (user) {
+ *userId = user->pw_uid;
+ return true;
+ }
+ *userId = -1;
+ return false;
+}
+
+static void tagAllChildren(Panel* panel, Process* parent) {
+ parent->tag = true;
+ pid_t ppid = parent->pid;
+ for (int i = 0; i < Panel_size(panel); i++) {
+ Process* p = (Process*) Panel_get(panel, i);
+ if (!p->tag && p->ppid == ppid) {
+ tagAllChildren(panel, p);
+ }
+ }
+}
+
+static bool expandCollapse(Panel* panel) {
+ Process* p = (Process*) Panel_getSelected(panel);
+ if (!p) return false;
+ p->showChildren = !p->showChildren;
+ return true;
+}
+
+Htop_Reaction Action_setSortKey(Settings* settings, ProcessField sortKey) {
+ settings->sortKey = sortKey;
+ settings->direction = 1;
+ settings->treeView = false;
+ return HTOP_REFRESH | HTOP_SAVE_SETTINGS | HTOP_UPDATE_PANELHDR | HTOP_KEEP_FOLLOWING;
+}
+
+static Htop_Reaction sortBy(State* st) {
+ Htop_Reaction reaction = HTOP_OK;
+ Panel* sortPanel = Panel_new(0, 0, 0, 0, true, Class(ListItem), FunctionBar_newEnterEsc("Sort ", "Cancel "));
+ Panel_setHeader(sortPanel, "Sort by");
+ ProcessField* fields = st->settings->fields;
+ for (int i = 0; fields[i]; i++) {
+ char* name = String_trim(Process_fields[fields[i]].name);
+ Panel_add(sortPanel, (Object*) ListItem_new(name, fields[i]));
+ if (fields[i] == st->settings->sortKey)
+ Panel_setSelected(sortPanel, i);
+ free(name);
+ }
+ ListItem* field = (ListItem*) Action_pickFromVector(st, sortPanel, 15);
+ if (field) {
+ reaction |= Action_setSortKey(st->settings, field->key);
+ }
+ Object_delete(sortPanel);
+ return reaction | HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR;
+}
+
+// ----------------------------------------
+
+static Htop_Reaction actionResize(State* st) {
+ Panel_resize(st->panel, COLS, LINES-(st->panel->y)-1);
+ return HTOP_REDRAW_BAR;
+}
+
+static Htop_Reaction actionSortByMemory(State* st) {
+ return Action_setSortKey(st->settings, PERCENT_MEM);
+}
+
+static Htop_Reaction actionSortByCPU(State* st) {
+ return Action_setSortKey(st->settings, PERCENT_CPU);
+}
+
+static Htop_Reaction actionSortByTime(State* st) {
+ return Action_setSortKey(st->settings, TIME);
+}
+
+static Htop_Reaction actionToggleKernelThreads(State* st) {
+ st->settings->hideKernelThreads = !st->settings->hideKernelThreads;
+ return HTOP_RECALCULATE | HTOP_SAVE_SETTINGS;
+}
+
+static Htop_Reaction actionToggleUserlandThreads(State* st) {
+ st->settings->hideUserlandThreads = !st->settings->hideUserlandThreads;
+ st->settings->hideThreads = st->settings->hideUserlandThreads;
+ return HTOP_RECALCULATE | HTOP_SAVE_SETTINGS;
+}
+
+static Htop_Reaction actionToggleProgramPath(State* st) {
+ st->settings->showProgramPath = !st->settings->showProgramPath;
+ return HTOP_REFRESH | HTOP_SAVE_SETTINGS;
+}
+
+static Htop_Reaction actionToggleTreeView(State* st) {
+ st->settings->treeView = !st->settings->treeView;
+ if (st->settings->treeView) st->settings->direction = 1;
+ ProcessList_expandTree(st->pl);
+ return HTOP_REFRESH | HTOP_SAVE_SETTINGS | HTOP_KEEP_FOLLOWING | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR;
+}
+
+static Htop_Reaction actionIncFilter(State* st) {
+ IncSet* inc = ((MainPanel*)st->panel)->inc;
+ IncSet_activate(inc, INC_FILTER, st->panel);
+ st->pl->incFilter = IncSet_filter(inc);
+ return HTOP_REFRESH | HTOP_KEEP_FOLLOWING;
+}
+
+static Htop_Reaction actionIncSearch(State* st) {
+ IncSet_activate(((MainPanel*)st->panel)->inc, INC_SEARCH, st->panel);
+ return HTOP_REFRESH | HTOP_KEEP_FOLLOWING;
+}
+
+static Htop_Reaction actionHigherPriority(State* st) {
+ bool changed = changePriority((MainPanel*)st->panel, -1);
+ return changed ? HTOP_REFRESH : HTOP_OK;
+}
+
+static Htop_Reaction actionLowerPriority(State* st) {
+ bool changed = changePriority((MainPanel*)st->panel, 1);
+ return changed ? HTOP_REFRESH : HTOP_OK;
+}
+
+static Htop_Reaction actionInvertSortOrder(State* st) {
+ Settings_invertSortOrder(st->settings);
+ return HTOP_REFRESH | HTOP_SAVE_SETTINGS;
+}
+
+static Htop_Reaction actionSetSortColumn(State* st) {
+ return sortBy(st);
+}
+
+static Htop_Reaction actionExpandOrCollapse(State* st) {
+ bool changed = expandCollapse(st->panel);
+ return changed ? HTOP_RECALCULATE : HTOP_OK;
+}
+
+static Htop_Reaction actionExpandCollapseOrSortColumn(State* st) {
+ return st->settings->treeView ? actionExpandOrCollapse(st) : actionSetSortColumn(st);
+}
+
+static Htop_Reaction actionQuit() {
+ return HTOP_QUIT;
+}
+
+static Htop_Reaction actionSetAffinity(State* st) {
+ if (st->pl->cpuCount == 1)
+ return HTOP_OK;
+#if (HAVE_LIBHWLOC || HAVE_NATIVE_AFFINITY)
+ Panel* panel = st->panel;
+
+ Process* p = (Process*) Panel_getSelected(panel);
+ if (!p) return HTOP_OK;
+ Affinity* affinity = Affinity_get(p, st->pl);
+ if (!affinity) return HTOP_OK;
+ Panel* affinityPanel = AffinityPanel_new(st->pl, affinity);
+ Affinity_delete(affinity);
+
+ void* set = Action_pickFromVector(st, affinityPanel, 15);
+ if (set) {
+ Affinity* affinity = AffinityPanel_getAffinity(affinityPanel, st->pl);
+ bool ok = MainPanel_foreachProcess((MainPanel*)panel, (MainPanel_ForeachProcessFn) Affinity_set, (size_t) affinity, NULL);
+ if (!ok) beep();
+ Affinity_delete(affinity);
+ }
+ Panel_delete((Object*)affinityPanel);
+#endif
+ return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR;
+}
+
+static Htop_Reaction actionKill(State* st) {
+ Panel* signalsPanel = (Panel*) SignalsPanel_new();
+ ListItem* sgn = (ListItem*) Action_pickFromVector(st, signalsPanel, 15);
+ if (sgn) {
+ if (sgn->key != 0) {
+ Panel_setHeader(st->panel, "Sending...");
+ Panel_draw(st->panel, true);
+ refresh();
+ MainPanel_foreachProcess((MainPanel*)st->panel, (MainPanel_ForeachProcessFn) Process_sendSignal, (size_t) sgn->key, NULL);
+ napms(500);
+ }
+ }
+ Panel_delete((Object*)signalsPanel);
+ return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR;
+}
+
+static Htop_Reaction actionFilterByUser(State* st) {
+ Panel* usersPanel = Panel_new(0, 0, 0, 0, true, Class(ListItem), FunctionBar_newEnterEsc("Show ", "Cancel "));
+ Panel_setHeader(usersPanel, "Show processes of:");
+ UsersTable_foreach(st->ut, addUserToVector, usersPanel);
+ Vector_insertionSort(usersPanel->items);
+ ListItem* allUsers = ListItem_new("All users", -1);
+ Panel_insert(usersPanel, 0, (Object*) allUsers);
+ ListItem* picked = (ListItem*) Action_pickFromVector(st, usersPanel, 20);
+ if (picked) {
+ if (picked == allUsers) {
+ st->pl->userId = -1;
+ } else {
+ Action_setUserOnly(ListItem_getRef(picked), &(st->pl->userId));
+ }
+ }
+ Panel_delete((Object*)usersPanel);
+ return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR;
+}
+
+static Htop_Reaction actionFollow(State* st) {
+ st->pl->following = MainPanel_selectedPid((MainPanel*)st->panel);
+ Panel_setSelectionColor(st->panel, CRT_colors[PANEL_SELECTION_FOLLOW]);
+ return HTOP_KEEP_FOLLOWING;
+}
+
+static Htop_Reaction actionSetup(State* st) {
+ Action_runSetup(st->settings, st->header, st->pl);
+ // TODO: shouldn't need this, colors should be dynamic
+ int headerHeight = Header_calculateHeight(st->header);
+ Panel_move(st->panel, 0, headerHeight);
+ Panel_resize(st->panel, COLS, LINES-headerHeight-1);
+ return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR;
+}
+
+static Htop_Reaction actionLsof(State* st) {
+ Process* p = (Process*) Panel_getSelected(st->panel);
+ if (!p) return HTOP_OK;
+ OpenFilesScreen* ofs = OpenFilesScreen_new(p);
+ InfoScreen_run((InfoScreen*)ofs);
+ OpenFilesScreen_delete((Object*)ofs);
+ clear();
+ CRT_enableDelay();
+ return HTOP_REFRESH | HTOP_REDRAW_BAR;
+}
+
+static Htop_Reaction actionStrace(State* st) {
+ Process* p = (Process*) Panel_getSelected(st->panel);
+ if (!p) return HTOP_OK;
+ TraceScreen* ts = TraceScreen_new(p);
+ bool ok = TraceScreen_forkTracer(ts);
+ if (ok) {
+ InfoScreen_run((InfoScreen*)ts);
+ }
+ TraceScreen_delete((Object*)ts);
+ clear();
+ CRT_enableDelay();
+ return HTOP_REFRESH | HTOP_REDRAW_BAR;
+}
+
+static Htop_Reaction actionTag(State* st) {
+ Process* p = (Process*) Panel_getSelected(st->panel);
+ if (!p) return HTOP_OK;
+ Process_toggleTag(p);
+ Panel_onKey(st->panel, KEY_DOWN);
+ return HTOP_OK;
+}
+
+static Htop_Reaction actionRedraw() {
+ clear();
+ return HTOP_REFRESH | HTOP_REDRAW_BAR;
+}
+
+static struct { const char* key; const char* info; } helpLeft[] = {
+ { .key = " Arrows: ", .info = "scroll process list" },
+ { .key = " Digits: ", .info = "incremental PID search" },
+ { .key = " F3 /: ", .info = "incremental name search" },
+ { .key = " F4 \\: ",.info = "incremental name filtering" },
+ { .key = " F5 t: ", .info = "tree view" },
+ { .key = " u: ", .info = "show processes of a single user" },
+ { .key = " H: ", .info = "hide/show user process threads" },
+ { .key = " K: ", .info = "hide/show kernel threads" },
+ { .key = " F: ", .info = "cursor follows process" },
+ { .key = " F6 + -: ", .info = "expand/collapse tree" },
+ { .key = " P M T: ", .info = "sort by CPU%, MEM% or TIME" },
+ { .key = " I: ", .info = "invert sort order" },
+ { .key = " F6 >: ", .info = "select sort column" },
+ { .key = NULL, .info = NULL }
+};
+
+static struct { const char* key; const char* info; } helpRight[] = {
+ { .key = " Space: ", .info = "tag process" },
+ { .key = " c: ", .info = "tag process and its children" },
+ { .key = " U: ", .info = "untag all processes" },
+ { .key = " F9 k: ", .info = "kill process/tagged processes" },
+ { .key = " F7 ]: ", .info = "higher priority (root only)" },
+ { .key = " F8 [: ", .info = "lower priority (+ nice)" },
+#if (HAVE_LIBHWLOC || HAVE_NATIVE_AFFINITY)
+ { .key = " a: ", .info = "set CPU affinity" },
+#endif
+ { .key = " e: ", .info = "show process environment" },
+ { .key = " i: ", .info = "set IO prority" },
+ { .key = " l: ", .info = "list open files with lsof" },
+ { .key = " s: ", .info = "trace syscalls with strace" },
+ { .key = " ", .info = "" },
+ { .key = " F2 S: ", .info = "setup" },
+ { .key = " F1 h: ", .info = "show this help screen" },
+ { .key = " F10 q: ", .info = "quit" },
+ { .key = NULL, .info = NULL }
+};
+
+static Htop_Reaction actionHelp(State* st) {
+ Settings* settings = st->settings;
+
+ clear();
+ attrset(CRT_colors[HELP_BOLD]);
+
+ for (int i = 0; i < LINES-1; i++)
+ mvhline(i, 0, ' ', COLS);
+
+ mvaddstr(0, 0, "htop " VERSION " - " COPYRIGHT);
+ mvaddstr(1, 0, "Released under the GNU GPL. See 'man' page for more info.");
+
+ attrset(CRT_colors[DEFAULT_COLOR]);
+ mvaddstr(3, 0, "CPU usage bar: ");
+ #define addattrstr(a,s) attrset(a);addstr(s)
+ addattrstr(CRT_colors[BAR_BORDER], "[");
+ if (settings->detailedCPUTime) {
+ addattrstr(CRT_colors[CPU_NICE_TEXT], "low"); addstr("/");
+ addattrstr(CRT_colors[CPU_NORMAL], "normal"); addstr("/");
+ addattrstr(CRT_colors[CPU_KERNEL], "kernel"); addstr("/");
+ addattrstr(CRT_colors[CPU_IRQ], "irq"); addstr("/");
+ addattrstr(CRT_colors[CPU_SOFTIRQ], "soft-irq"); addstr("/");
+ addattrstr(CRT_colors[CPU_STEAL], "steal"); addstr("/");
+ addattrstr(CRT_colors[CPU_GUEST], "guest"); addstr("/");
+ addattrstr(CRT_colors[CPU_IOWAIT], "io-wait");
+ addattrstr(CRT_colors[BAR_SHADOW], " used%");
+ } else {
+ addattrstr(CRT_colors[CPU_NICE_TEXT], "low-priority"); addstr("/");
+ addattrstr(CRT_colors[CPU_NORMAL], "normal"); addstr("/");
+ addattrstr(CRT_colors[CPU_KERNEL], "kernel"); addstr("/");
+ addattrstr(CRT_colors[CPU_STEAL], "virtualiz");
+ addattrstr(CRT_colors[BAR_SHADOW], " used%");
+ }
+ addattrstr(CRT_colors[BAR_BORDER], "]");
+ attrset(CRT_colors[DEFAULT_COLOR]);
+ mvaddstr(4, 0, "Memory bar: ");
+ addattrstr(CRT_colors[BAR_BORDER], "[");
+ addattrstr(CRT_colors[MEMORY_USED], "used"); addstr("/");
+ addattrstr(CRT_colors[MEMORY_BUFFERS_TEXT], "buffers"); addstr("/");
+ addattrstr(CRT_colors[MEMORY_CACHE], "cache");
+ addattrstr(CRT_colors[BAR_SHADOW], " used/total");
+ addattrstr(CRT_colors[BAR_BORDER], "]");
+ attrset(CRT_colors[DEFAULT_COLOR]);
+ mvaddstr(5, 0, "Swap bar: ");
+ addattrstr(CRT_colors[BAR_BORDER], "[");
+ addattrstr(CRT_colors[SWAP], "used");
+ addattrstr(CRT_colors[BAR_SHADOW], " used/total");
+ addattrstr(CRT_colors[BAR_BORDER], "]");
+ attrset(CRT_colors[DEFAULT_COLOR]);
+ mvaddstr(6,0, "Type and layout of header meters are configurable in the setup screen.");
+ if (CRT_colorScheme == COLORSCHEME_MONOCHROME) {
+ mvaddstr(7, 0, "In monochrome, meters display as different chars, in order: |#*@$%&.");
+ }
+ mvaddstr( 8, 0, " Status: R: running; S: sleeping; T: traced/stopped; Z: zombie; D: disk sleep");
+ for (int i = 0; helpLeft[i].info; i++) { mvaddstr(9+i, 9, helpLeft[i].info); }
+ for (int i = 0; helpRight[i].info; i++) { mvaddstr(9+i, 49, helpRight[i].info); }
+ attrset(CRT_colors[HELP_BOLD]);
+ for (int i = 0; helpLeft[i].key; i++) { mvaddstr(9+i, 0, helpLeft[i].key); }
+ for (int i = 0; helpRight[i].key; i++) { mvaddstr(9+i, 40, helpRight[i].key); }
+ attrset(CRT_colors[PROCESS_THREAD]);
+ mvaddstr(15, 32, "threads");
+ mvaddstr(16, 26, "threads");
+ attrset(CRT_colors[DEFAULT_COLOR]);
+
+ attrset(CRT_colors[HELP_BOLD]);
+ mvaddstr(23,0, "Press any key to return.");
+ attrset(CRT_colors[DEFAULT_COLOR]);
+ refresh();
+ CRT_readKey();
+ clear();
+
+ return HTOP_RECALCULATE | HTOP_REDRAW_BAR;
+}
+
+static Htop_Reaction actionUntagAll(State* st) {
+ for (int i = 0; i < Panel_size(st->panel); i++) {
+ Process* p = (Process*) Panel_get(st->panel, i);
+ p->tag = false;
+ }
+ return HTOP_REFRESH;
+}
+
+static Htop_Reaction actionTagAllChildren(State* st) {
+ Process* p = (Process*) Panel_getSelected(st->panel);
+ if (!p) return HTOP_OK;
+ tagAllChildren(st->panel, p);
+ return HTOP_OK;
+}
+
+static Htop_Reaction actionShowEnvScreen(State* st) {
+ Process* p = (Process*) Panel_getSelected(st->panel);
+ if (!p) return HTOP_OK;
+ EnvScreen* es = EnvScreen_new(p);
+ InfoScreen_run((InfoScreen*)es);
+ EnvScreen_delete((Object*)es);
+ clear();
+ CRT_enableDelay();
+ return HTOP_REFRESH | HTOP_REDRAW_BAR;
+}
+
+
+void Action_setBindings(Htop_Action* keys) {
+ keys[KEY_RESIZE] = actionResize;
+ keys['M'] = actionSortByMemory;
+ keys['T'] = actionSortByTime;
+ keys['P'] = actionSortByCPU;
+ keys['H'] = actionToggleUserlandThreads;
+ keys['K'] = actionToggleKernelThreads;
+ keys['p'] = actionToggleProgramPath;
+ keys['t'] = actionToggleTreeView;
+ keys[KEY_F(5)] = actionToggleTreeView;
+ keys[KEY_F(4)] = actionIncFilter;
+ keys['\\'] = actionIncFilter;
+ keys[KEY_F(3)] = actionIncSearch;
+ keys['/'] = actionIncSearch;
+
+ keys[']'] = actionHigherPriority;
+ keys[KEY_F(7)] = actionHigherPriority;
+ keys['['] = actionLowerPriority;
+ keys[KEY_F(8)] = actionLowerPriority;
+ keys['I'] = actionInvertSortOrder;
+ keys[KEY_F(6)] = actionExpandCollapseOrSortColumn;
+ keys[KEY_F(18)] = actionExpandCollapseOrSortColumn;
+ keys['<'] = actionSetSortColumn;
+ keys[','] = actionSetSortColumn;
+ keys['>'] = actionSetSortColumn;
+ keys['.'] = actionSetSortColumn;
+ keys[KEY_F(10)] = actionQuit;
+ keys['q'] = actionQuit;
+ keys['a'] = actionSetAffinity;
+ keys[KEY_F(9)] = actionKill;
+ keys['k'] = actionKill;
+ keys[KEY_RECLICK] = actionExpandOrCollapse;
+ keys['+'] = actionExpandOrCollapse;
+ keys['='] = actionExpandOrCollapse;
+ keys['-'] = actionExpandOrCollapse;
+ keys['u'] = actionFilterByUser;
+ keys['F'] = actionFollow;
+ keys['S'] = actionSetup;
+ keys['C'] = actionSetup;
+ keys[KEY_F(2)] = actionSetup;
+ keys['l'] = actionLsof;
+ keys['s'] = actionStrace;
+ keys[' '] = actionTag;
+ keys['\014'] = actionRedraw; // Ctrl+L
+ keys[KEY_F(1)] = actionHelp;
+ keys['h'] = actionHelp;
+ keys['?'] = actionHelp;
+ keys['U'] = actionUntagAll;
+ keys['c'] = actionTagAllChildren;
+ keys['e'] = actionShowEnvScreen;
+}
+
diff --git a/Action.h b/Action.h
new file mode 100644
index 0000000..34fc298
--- /dev/null
+++ b/Action.h
@@ -0,0 +1,56 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_Action
+#define HEADER_Action
+/*
+htop - Action.h
+(C) 2015 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+
+#include "IncSet.h"
+#include "Settings.h"
+#include "Header.h"
+#include "UsersTable.h"
+#include "ProcessList.h"
+#include "Panel.h"
+
+typedef enum {
+ HTOP_OK = 0x00,
+ HTOP_REFRESH = 0x01,
+ HTOP_RECALCULATE = 0x03, // implies HTOP_REFRESH
+ HTOP_SAVE_SETTINGS = 0x04,
+ HTOP_KEEP_FOLLOWING = 0x08,
+ HTOP_QUIT = 0x10,
+ HTOP_REDRAW_BAR = 0x20,
+ HTOP_UPDATE_PANELHDR = 0x41, // implies HTOP_REFRESH
+} Htop_Reaction;
+
+typedef Htop_Reaction (*Htop_Action)();
+
+typedef struct State_ {
+ Settings* settings;
+ UsersTable* ut;
+ ProcessList* pl;
+ Panel* panel;
+ Header* header;
+} State;
+
+
+Object* Action_pickFromVector(State* st, Panel* list, int x);
+
+// ----------------------------------------
+
+bool Action_setUserOnly(const char* userName, uid_t* userId);
+
+Htop_Reaction Action_setSortKey(Settings* settings, ProcessField sortKey);
+
+// ----------------------------------------
+
+
+void Action_setBindings(Htop_Action* keys);
+
+
+#endif
diff --git a/Affinity.c b/Affinity.c
index 3b1e311..471e102 100644
--- a/Affinity.c
+++ b/Affinity.c
@@ -9,9 +9,18 @@ in the source distribution for its full text.
#include <stdlib.h>
+#ifdef HAVE_LIBHWLOC
+#include <hwloc/linux.h>
+#elif HAVE_NATIVE_AFFINITY
+#include <sched.h>
+#endif
+
/*{
+#include "Process.h"
+#include "ProcessList.h"
typedef struct Affinity_ {
+ ProcessList* pl;
int size;
int used;
int* cpus;
@@ -19,10 +28,11 @@ typedef struct Affinity_ {
}*/
-Affinity* Affinity_new() {
- Affinity* this = calloc(1, sizeof(Affinity));
+Affinity* Affinity_new(ProcessList* pl) {
+ Affinity* this = xCalloc(1, sizeof(Affinity));
this->size = 8;
- this->cpus = calloc(this->size, sizeof(int));
+ this->cpus = xCalloc(this->size, sizeof(int));
+ this->pl = pl;
return this;
}
@@ -34,9 +44,68 @@ void Affinity_delete(Affinity* this) {
void Affinity_add(Affinity* this, int id) {
if (this->used == this->size) {
this->size *= 2;
- this->cpus = realloc(this->cpus, sizeof(int) * this->size);
+ this->cpus = xRealloc(this->cpus, sizeof(int) * this->size);
}
this->cpus[this->used] = id;
this->used++;
}
+
+#ifdef HAVE_LIBHWLOC
+
+Affinity* Affinity_get(Process* proc, ProcessList* pl) {
+ hwloc_cpuset_t cpuset = hwloc_bitmap_alloc();
+ bool ok = (hwloc_linux_get_tid_cpubind(pl->topology, proc->pid, cpuset) == 0);
+ Affinity* affinity = NULL;
+ if (ok) {
+ affinity = Affinity_new(pl);
+ if (hwloc_bitmap_last(cpuset) == -1) {
+ for (int i = 0; i < pl->cpuCount; i++) {
+ Affinity_add(affinity, i);
+ }
+ } else {
+ unsigned int id;
+ hwloc_bitmap_foreach_begin(id, cpuset);
+ Affinity_add(affinity, id);
+ hwloc_bitmap_foreach_end();
+ }
+ }
+ hwloc_bitmap_free(cpuset);
+ return affinity;
+}
+
+bool Affinity_set(Process* proc, Affinity* this) {
+ hwloc_cpuset_t cpuset = hwloc_bitmap_alloc();
+ for (int i = 0; i < affinity->used; i++) {
+ hwloc_bitmap_set(cpuset, affinity->cpus[i]);
+ }
+ bool ok = (hwloc_linux_set_tid_cpubind(this->pl->topology, proc->pid, cpuset) == 0);
+ hwloc_bitmap_free(cpuset);
+ return ok;
+}
+
+#elif HAVE_NATIVE_AFFINITY
+
+Affinity* Affinity_get(Process* proc, ProcessList* pl) {
+ cpu_set_t cpuset;
+ bool ok = (sched_getaffinity(proc->pid, sizeof(cpu_set_t), &cpuset) == 0);
+ if (!ok) return NULL;
+ Affinity* affinity = Affinity_new(pl);
+ for (int i = 0; i < pl->cpuCount; i++) {
+ if (CPU_ISSET(i, &cpuset))
+ Affinity_add(affinity, i);
+ }
+ return affinity;
+}
+
+bool Affinity_set(Process* proc, Affinity* this) {
+ cpu_set_t cpuset;
+ CPU_ZERO(&cpuset);
+ for (int i = 0; i < this->used; i++) {
+ CPU_SET(this->cpus[i], &cpuset);
+ }
+ bool ok = (sched_setaffinity(proc->pid, sizeof(unsigned long), &cpuset) == 0);
+ return ok;
+}
+
+#endif
diff --git a/Affinity.h b/Affinity.h
index 3a19ea4..8f8dde9 100644
--- a/Affinity.h
+++ b/Affinity.h
@@ -9,19 +9,39 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
+#ifdef HAVE_LIBHWLOC
+#elif HAVE_NATIVE_AFFINITY
+#endif
+
+#include "Process.h"
+#include "ProcessList.h"
typedef struct Affinity_ {
+ ProcessList* pl;
int size;
int used;
int* cpus;
} Affinity;
-Affinity* Affinity_new();
+Affinity* Affinity_new(ProcessList* pl);
void Affinity_delete(Affinity* this);
void Affinity_add(Affinity* this, int id);
+#ifdef HAVE_LIBHWLOC
+
+Affinity* Affinity_get(Process* proc, ProcessList* pl);
+
+bool Affinity_set(Process* proc, Affinity* this);
+
+#elif HAVE_NATIVE_AFFINITY
+
+Affinity* Affinity_get(Process* proc, ProcessList* pl);
+
+bool Affinity_set(Process* proc, Affinity* this);
+
+#endif
#endif
diff --git a/AffinityPanel.c b/AffinityPanel.c
index 094a010..03bfa75 100644
--- a/AffinityPanel.c
+++ b/AffinityPanel.c
@@ -6,6 +6,7 @@ in the source distribution for its full text.
*/
#include "AffinityPanel.h"
+#include "CRT.h"
#include "CheckItem.h"
@@ -23,6 +24,7 @@ static HandlerResult AffinityPanel_eventHandler(Panel* this, int ch) {
CheckItem* selected = (CheckItem*) Panel_getSelected(this);
switch(ch) {
case KEY_MOUSE:
+ case KEY_RECLICK:
case ' ':
CheckItem_set(selected, ! (CheckItem_get(selected)) );
return HANDLED;
@@ -43,14 +45,14 @@ PanelClass AffinityPanel_class = {
};
Panel* AffinityPanel_new(ProcessList* pl, Affinity* affinity) {
- Panel* this = Panel_new(1, 1, 1, 1, true, Class(CheckItem));
+ Panel* this = Panel_new(1, 1, 1, 1, true, Class(CheckItem), FunctionBar_newEnterEsc("Set ", "Cancel "));
Object_setClass(this, Class(AffinityPanel));
Panel_setHeader(this, "Use CPUs:");
int curCpu = 0;
for (int i = 0; i < pl->cpuCount; i++) {
char number[10];
- snprintf(number, 9, "%d", ProcessList_cpuId(pl, i));
+ snprintf(number, 9, "%d", Settings_cpuId(pl->settings, i));
bool mode;
if (curCpu < affinity->used && affinity->cpus[curCpu] == i) {
mode = true;
@@ -58,13 +60,13 @@ Panel* AffinityPanel_new(ProcessList* pl, Affinity* affinity) {
} else {
mode = false;
}
- Panel_add(this, (Object*) CheckItem_new(strdup(number), NULL, mode));
+ Panel_add(this, (Object*) CheckItem_newByVal(xStrdup(number), mode));
}
return this;
}
-Affinity* AffinityPanel_getAffinity(Panel* this) {
- Affinity* affinity = Affinity_new();
+Affinity* AffinityPanel_getAffinity(Panel* this, ProcessList* pl) {
+ Affinity* affinity = Affinity_new(pl);
int size = Panel_size(this);
for (int i = 0; i < size; i++) {
if (CheckItem_get((CheckItem*)Panel_get(this, i)))
diff --git a/AffinityPanel.h b/AffinityPanel.h
index 63283c5..2b6059b 100644
--- a/AffinityPanel.h
+++ b/AffinityPanel.h
@@ -18,6 +18,6 @@ extern PanelClass AffinityPanel_class;
Panel* AffinityPanel_new(ProcessList* pl, Affinity* affinity);
-Affinity* AffinityPanel_getAffinity(Panel* this);
+Affinity* AffinityPanel_getAffinity(Panel* this, ProcessList* pl);
#endif
diff --git a/AvailableColumnsPanel.c b/AvailableColumnsPanel.c
index d954da8..6865b8b 100644
--- a/AvailableColumnsPanel.c
+++ b/AvailableColumnsPanel.c
@@ -6,6 +6,7 @@ in the source distribution for its full text.
*/
#include "AvailableColumnsPanel.h"
+#include "Platform.h"
#include "Header.h"
#include "ColumnsPanel.h"
@@ -13,22 +14,20 @@ in the source distribution for its full text.
#include <assert.h>
#include <stdlib.h>
#include <ctype.h>
+#include <string.h>
/*{
#include "Panel.h"
-#include "Settings.h"
-#include "ScreenManager.h"
typedef struct AvailableColumnsPanel_ {
Panel super;
Panel* columns;
-
- Settings* settings;
- ScreenManager* scr;
} AvailableColumnsPanel;
}*/
+static const char* AvailableColumnsFunctions[] = {" ", " ", " ", " ", "Add ", " ", " ", " ", " ", "Done ", NULL};
+
static void AvailableColumnsPanel_delete(Object* object) {
Panel* super = (Panel*) object;
AvailableColumnsPanel* this = (AvailableColumnsPanel*) object;
@@ -38,7 +37,7 @@ static void AvailableColumnsPanel_delete(Object* object) {
static HandlerResult AvailableColumnsPanel_eventHandler(Panel* super, int ch) {
AvailableColumnsPanel* this = (AvailableColumnsPanel*) super;
- char* text = ((ListItem*) Panel_getSelected(super))->value;
+ int key = ((ListItem*) Panel_getSelected(super))->key;
HandlerResult result = IGNORED;
switch(ch) {
@@ -47,7 +46,7 @@ static HandlerResult AvailableColumnsPanel_eventHandler(Panel* super, int ch) {
case KEY_F(5):
{
int at = Panel_getSelectedIndex(this->columns);
- Panel_insert(this->columns, at, (Object*) ListItem_new(text, 0));
+ Panel_insert(this->columns, at, (Object*) ListItem_new(Process_fields[key].name, key));
Panel_setSelected(this->columns, at+1);
ColumnsPanel_update(this->columns);
result = HANDLED;
@@ -55,7 +54,7 @@ static HandlerResult AvailableColumnsPanel_eventHandler(Panel* super, int ch) {
}
default:
{
- if (isalpha(ch))
+ if (ch < 255 && isalpha(ch))
result = Panel_selectByTyping(super, ch);
break;
}
@@ -71,19 +70,20 @@ PanelClass AvailableColumnsPanel_class = {
.eventHandler = AvailableColumnsPanel_eventHandler
};
-AvailableColumnsPanel* AvailableColumnsPanel_new(Settings* settings, Panel* columns, ScreenManager* scr) {
+AvailableColumnsPanel* AvailableColumnsPanel_new(Panel* columns) {
AvailableColumnsPanel* this = AllocThis(AvailableColumnsPanel);
Panel* super = (Panel*) this;
- Panel_init(super, 1, 1, 1, 1, Class(ListItem), true);
-
- this->settings = settings;
- this->scr = scr;
+ FunctionBar* fuBar = FunctionBar_new(AvailableColumnsFunctions, NULL, NULL);
+ Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar);
Panel_setHeader(super, "Available Columns");
- for (int i = 1; i < LAST_PROCESSFIELD; i++) {
- if (i != COMM)
- Panel_add(super, (Object*) ListItem_new(Process_fieldNames[i], 0));
+ for (int i = 1; i < Platform_numberOfFields; i++) {
+ if (i != COMM && Process_fields[i].description) {
+ char description[256];
+ snprintf(description, sizeof(description), "%s - %s", Process_fields[i].name, Process_fields[i].description);
+ Panel_add(super, (Object*) ListItem_new(description, i));
+ }
}
this->columns = columns;
return this;
diff --git a/AvailableColumnsPanel.h b/AvailableColumnsPanel.h
index 0a29e6a..5a8371d 100644
--- a/AvailableColumnsPanel.h
+++ b/AvailableColumnsPanel.h
@@ -10,20 +10,15 @@ in the source distribution for its full text.
*/
#include "Panel.h"
-#include "Settings.h"
-#include "ScreenManager.h"
typedef struct AvailableColumnsPanel_ {
Panel super;
Panel* columns;
-
- Settings* settings;
- ScreenManager* scr;
} AvailableColumnsPanel;
extern PanelClass AvailableColumnsPanel_class;
-AvailableColumnsPanel* AvailableColumnsPanel_new(Settings* settings, Panel* columns, ScreenManager* scr);
+AvailableColumnsPanel* AvailableColumnsPanel_new(Panel* columns);
#endif
diff --git a/AvailableMetersPanel.c b/AvailableMetersPanel.c
index f582851..f5d1f2d 100644
--- a/AvailableMetersPanel.c
+++ b/AvailableMetersPanel.c
@@ -6,10 +6,12 @@ in the source distribution for its full text.
*/
#include "AvailableMetersPanel.h"
+#include "MetersPanel.h"
#include "CPUMeter.h"
#include "Header.h"
#include "ListItem.h"
+#include "Platform.h"
#include <assert.h>
#include <stdlib.h>
@@ -18,14 +20,16 @@ in the source distribution for its full text.
#include "Settings.h"
#include "Panel.h"
#include "ScreenManager.h"
+#include "ProcessList.h"
typedef struct AvailableMetersPanel_ {
Panel super;
+ ScreenManager* scr;
Settings* settings;
+ Header* header;
Panel* leftPanel;
Panel* rightPanel;
- ScreenManager* scr;
} AvailableMetersPanel;
}*/
@@ -37,39 +41,48 @@ static void AvailableMetersPanel_delete(Object* object) {
free(this);
}
-static inline void AvailableMetersPanel_addHeader(Header* header, Panel* panel, MeterClass* type, int param, HeaderSide side) {
- Meter* meter = (Meter*) Header_addMeter(header, type, param, side);
- Panel_add(panel, (Object*) Meter_toListItem(meter));
+static inline void AvailableMetersPanel_addMeter(Header* header, Panel* panel, MeterClass* type, int param, int column) {
+ Meter* meter = (Meter*) Header_addMeterByClass(header, type, param, column);
+ Panel_add(panel, (Object*) Meter_toListItem(meter, false));
+ Panel_setSelected(panel, Panel_size(panel) - 1);
+ MetersPanel_setMoving((MetersPanel*)panel, true);
+ FunctionBar_draw(panel->currentBar, NULL);
}
static HandlerResult AvailableMetersPanel_eventHandler(Panel* super, int ch) {
AvailableMetersPanel* this = (AvailableMetersPanel*) super;
- Header* header = this->settings->header;
+ Header* header = this->header;
ListItem* selected = (ListItem*) Panel_getSelected(super);
int param = selected->key & 0xff;
int type = selected->key >> 16;
HandlerResult result = IGNORED;
+ bool update = false;
switch(ch) {
case KEY_F(5):
case 'l':
case 'L':
{
- AvailableMetersPanel_addHeader(header, this->leftPanel, Meter_types[type], param, LEFT_HEADER);
+ AvailableMetersPanel_addMeter(header, this->leftPanel, Platform_meterTypes[type], param, 0);
result = HANDLED;
+ update = true;
break;
}
+ case 0x0a:
+ case 0x0d:
+ case KEY_ENTER:
case KEY_F(6):
case 'r':
case 'R':
{
- AvailableMetersPanel_addHeader(header, this->rightPanel, Meter_types[type], param, RIGHT_HEADER);
- result = HANDLED;
+ AvailableMetersPanel_addMeter(header, this->rightPanel, Platform_meterTypes[type], param, 1);
+ result = (KEY_LEFT << 16) | SYNTH_KEY;
+ update = true;
break;
}
}
- if (result == HANDLED) {
+ if (update) {
this->settings->changed = true;
Header_calculateHeight(header);
Header_draw(header);
@@ -86,25 +99,28 @@ PanelClass AvailableMetersPanel_class = {
.eventHandler = AvailableMetersPanel_eventHandler
};
-AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Panel* leftMeters, Panel* rightMeters, ScreenManager* scr) {
+AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Header* header, Panel* leftMeters, Panel* rightMeters, ScreenManager* scr, ProcessList* pl) {
AvailableMetersPanel* this = AllocThis(AvailableMetersPanel);
Panel* super = (Panel*) this;
- Panel_init(super, 1, 1, 1, 1, Class(ListItem), true);
+ FunctionBar* fuBar = FunctionBar_newEnterEsc("Add ", "Done ");
+ Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar);
this->settings = settings;
+ this->header = header;
this->leftPanel = leftMeters;
this->rightPanel = rightMeters;
this->scr = scr;
Panel_setHeader(super, "Available meters");
- for (int i = 1; Meter_types[i]; i++) {
- MeterClass* type = Meter_types[i];
+ for (int i = 1; Platform_meterTypes[i]; i++) {
+ MeterClass* type = Platform_meterTypes[i];
if (type != &CPUMeter_class) {
- Panel_add(super, (Object*) ListItem_new(type->uiName, i << 16));
+ const char* label = type->description ? type->description : type->uiName;
+ Panel_add(super, (Object*) ListItem_new(label, i << 16));
}
}
MeterClass* type = &CPUMeter_class;
- int cpus = settings->pl->cpuCount;
+ int cpus = pl->cpuCount;
if (cpus > 1) {
Panel_add(super, (Object*) ListItem_new("CPU average", 0));
for (int i = 1; i <= cpus; i++) {
diff --git a/AvailableMetersPanel.h b/AvailableMetersPanel.h
index 281e285..e9b949b 100644
--- a/AvailableMetersPanel.h
+++ b/AvailableMetersPanel.h
@@ -12,19 +12,21 @@ in the source distribution for its full text.
#include "Settings.h"
#include "Panel.h"
#include "ScreenManager.h"
+#include "ProcessList.h"
typedef struct AvailableMetersPanel_ {
Panel super;
+ ScreenManager* scr;
Settings* settings;
+ Header* header;
Panel* leftPanel;
Panel* rightPanel;
- ScreenManager* scr;
} AvailableMetersPanel;
extern PanelClass AvailableMetersPanel_class;
-AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Panel* leftMeters, Panel* rightMeters, ScreenManager* scr);
+AvailableMetersPanel* AvailableMetersPanel_new(Settings* settings, Header* header, Panel* leftMeters, Panel* rightMeters, ScreenManager* scr, ProcessList* pl);
#endif
diff --git a/BatteryMeter.c b/BatteryMeter.c
index f2dfa6a..5fda38b 100644
--- a/BatteryMeter.c
+++ b/BatteryMeter.c
@@ -9,14 +9,14 @@ This meter written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com).
#include "BatteryMeter.h"
+#include "Battery.h"
#include "ProcessList.h"
#include "CRT.h"
-#include "String.h"
+#include "StringUtils.h"
+#include "Platform.h"
#include <string.h>
#include <stdlib.h>
-#include <dirent.h>
-#include <unistd.h>
/*{
#include "Meter.h"
@@ -26,273 +26,22 @@ typedef enum ACPresence_ {
AC_PRESENT,
AC_ERROR
} ACPresence;
-
}*/
int BatteryMeter_attributes[] = {
BATTERY
};
-static unsigned long int parseUevent(FILE * file, const char *key) {
- char line[100];
- unsigned long int dValue = 0;
- char* saveptr;
-
- while (fgets(line, sizeof line, file)) {
- if (strncmp(line, key, strlen(key)) == 0) {
- char *value;
- strtok_r(line, "=", &saveptr);
- value = strtok_r(NULL, "=", &saveptr);
- dValue = atoi(value);
- break;
- }
- }
- return dValue;
-}
-
-static unsigned long int parseBatInfo(const char *fileName, const unsigned short int lineNum, const unsigned short int wordNum) {
- const char batteryPath[] = PROCDIR "/acpi/battery/";
- DIR* batteryDir = opendir(batteryPath);
- if (!batteryDir)
- return 0;
-
- #define MAX_BATTERIES 64
- char* batteries[MAX_BATTERIES];
- unsigned int nBatteries = 0;
- memset(batteries, 0, MAX_BATTERIES * sizeof(char*));
-
- struct dirent result;
- struct dirent* dirEntry;
- while (nBatteries < MAX_BATTERIES) {
- int err = readdir_r(batteryDir, &result, &dirEntry);
- if (err || !dirEntry)
- break;
- char* entryName = dirEntry->d_name;
- if (strncmp(entryName, "BAT", 3))
- continue;
- batteries[nBatteries] = strdup(entryName);
- nBatteries++;
- }
- closedir(batteryDir);
-
- unsigned long int total = 0;
- for (unsigned int i = 0; i < nBatteries; i++) {
- char infoPath[30];
- snprintf(infoPath, sizeof infoPath, "%s%s/%s", batteryPath, batteries[i], fileName);
-
- FILE* file = fopen(infoPath, "r");
- if (!file) {
- break;
- }
-
- char line[50] = "";
- for (unsigned short int i = 0; i < lineNum; i++) {
- char* ok = fgets(line, sizeof line, file);
- if (!ok) break;
- }
-
- fclose(file);
-
- char *foundNumStr = String_getToken(line, wordNum);
- const unsigned long int foundNum = atoi(foundNumStr);
- free(foundNumStr);
-
- total += foundNum;
- }
-
- for (unsigned int i = 0; i < nBatteries; i++) {
- free(batteries[i]);
- }
-
- return total;
-}
-
-static ACPresence procAcpiCheck() {
- ACPresence isOn = AC_ERROR;
- const char *power_supplyPath = PROCDIR "/acpi/ac_adapter";
- DIR *power_supplyDir = opendir(power_supplyPath);
- if (!power_supplyDir) {
- return AC_ERROR;
- }
-
- struct dirent result;
- struct dirent* dirEntry;
- for (;;) {
- int err = readdir_r((DIR *) power_supplyDir, &result, &dirEntry);
- if (err || !dirEntry)
- break;
-
- char* entryName = (char *) dirEntry->d_name;
-
- if (entryName[0] != 'A')
- continue;
-
- char statePath[50];
- snprintf((char *) statePath, sizeof statePath, "%s/%s/state", power_supplyPath, entryName);
- FILE* file = fopen(statePath, "r");
-
- if (!file) {
- isOn = AC_ERROR;
- continue;
- }
-
- char line[100];
- fgets(line, sizeof line, file);
- line[sizeof(line) - 1] = '\0';
-
- fclose(file);
-
- const char *isOnline = String_getToken(line, 2);
-
- if (strcmp(isOnline, "on-line") == 0) {
- isOn = AC_PRESENT;
- } else {
- isOn = AC_ABSENT;
- }
- free((char *) isOnline);
- if (isOn == AC_PRESENT) {
- break;
- }
- }
-
- if (power_supplyDir)
- closedir(power_supplyDir);
- return isOn;
-}
-
-static ACPresence sysCheck() {
- ACPresence isOn = AC_ERROR;
- const char *power_supplyPath = "/sys/class/power_supply";
- DIR *power_supplyDir = opendir(power_supplyPath);
- if (!power_supplyDir) {
- return AC_ERROR;
- }
-
- struct dirent result;
- struct dirent* dirEntry;
- for (;;) {
- int err = readdir_r((DIR *) power_supplyDir, &result, &dirEntry);
- if (err || !dirEntry)
- break;
-
- char* entryName = (char *) dirEntry->d_name;
- if (strncmp(entryName, "A", 1)) {
- continue;
- }
- char onlinePath[50];
- snprintf((char *) onlinePath, sizeof onlinePath, "%s/%s/online", power_supplyPath, entryName);
- FILE* file = fopen(onlinePath, "r");
- if (!file) {
- isOn = AC_ERROR;
- } else {
- isOn = (fgetc(file) - '0');
- fclose(file);
- if (isOn == AC_PRESENT) {
- // If any AC adapter is being used then stop
- break;
- }
- }
- }
-
- if (power_supplyDir)
- closedir(power_supplyDir);
-
- return isOn;
-}
-
-static ACPresence chkIsOnline() {
- if (access(PROCDIR "/acpi/ac_adapter", F_OK) == 0) {
- return procAcpiCheck();
- } else if (access("/sys/class/power_supply", F_OK) == 0) {
- return sysCheck();
- } else {
- return AC_ERROR;
- }
-}
-
-static double getProcBatData() {
- const unsigned long int totalFull = parseBatInfo("info", 3, 4);
- if (totalFull == 0)
- return 0;
-
- const unsigned long int totalRemain = parseBatInfo("state", 5, 3);
- if (totalRemain == 0)
- return 0;
-
- return totalRemain * 100.0 / (double) totalFull;
-}
-
-static double getSysBatData() {
- const char *power_supplyPath = "/sys/class/power_supply/";
- DIR *power_supplyDir = opendir(power_supplyPath);
- if (!power_supplyDir)
- return 0;
-
- unsigned long int totalFull = 0;
- unsigned long int totalRemain = 0;
-
- struct dirent result;
- struct dirent* dirEntry;
- for (;;) {
- int err = readdir_r((DIR *) power_supplyDir, &result, &dirEntry);
- if (err || !dirEntry)
- break;
- char* entryName = (char *) dirEntry->d_name;
-
- if (strncmp(entryName, "BAT", 3)) {
- continue;
- }
-
- const char ueventPath[50];
-
- snprintf((char *) ueventPath, sizeof ueventPath, "%s%s/uevent", power_supplyPath, entryName);
-
- FILE *file;
- if ((file = fopen(ueventPath, "r")) == NULL) {
- closedir(power_supplyDir);
- return 0;
- }
-
- if ((totalFull += parseUevent(file, "POWER_SUPPLY_ENERGY_FULL="))) {
- totalRemain += parseUevent(file, "POWER_SUPPLY_ENERGY_NOW=");
- } else {
- //reset file pointer
- if (fseek(file, 0, SEEK_SET) < 0) {
- closedir(power_supplyDir);
- fclose(file);
- return 0;
- }
- }
-
- //Some systems have it as CHARGE instead of ENERGY.
- if ((totalFull += parseUevent(file, "POWER_SUPPLY_CHARGE_FULL="))) {
- totalRemain += parseUevent(file, "POWER_SUPPLY_CHARGE_NOW=");
- } else {
- //reset file pointer
- if (fseek(file, 0, SEEK_SET) < 0) {
- closedir(power_supplyDir);
- fclose(file);
- return 0;
- }
- }
-
- fclose(file);
- }
-
- const double percent = totalFull > 0 ? ((double) totalRemain * 100) / (double) totalFull : 0;
- closedir(power_supplyDir);
- return percent;
-}
-
static void BatteryMeter_setValues(Meter * this, char *buffer, int len) {
- double percent = getProcBatData();
-
- if (percent == 0) {
- percent = getSysBatData();
- if (percent == 0) {
- snprintf(buffer, len, "n/a");
- return;
- }
+ ACPresence isOnAC;
+ double percent;
+
+ Battery_getData(&percent, &isOnAC);
+
+ if (percent == -1) {
+ this->values[0] = 0;
+ snprintf(buffer, len, "n/a");
+ return;
}
this->values[0] = percent;
@@ -308,11 +57,9 @@ static void BatteryMeter_setValues(Meter * this, char *buffer, int len) {
onBatteryText = "%.1f%%(bat)";
}
- ACPresence isOnLine = chkIsOnline();
-
- if (isOnLine == AC_PRESENT) {
+ if (isOnAC == AC_PRESENT) {
snprintf(buffer, len, onAcText, percent);
- } else if (isOnLine == AC_ABSENT) {
+ } else if (isOnAC == AC_ABSENT) {
snprintf(buffer, len, onBatteryText, percent);
} else {
snprintf(buffer, len, unknownText, percent);
diff --git a/BatteryMeter.h b/BatteryMeter.h
index 25fd3c9..bf8d2e8 100644
--- a/BatteryMeter.h
+++ b/BatteryMeter.h
@@ -19,7 +19,6 @@ typedef enum ACPresence_ {
AC_ERROR
} ACPresence;
-
extern int BatteryMeter_attributes[];
extern MeterClass BatteryMeter_class;
diff --git a/CPUMeter.c b/CPUMeter.c
index 95b397f..7685f40 100644
--- a/CPUMeter.c
+++ b/CPUMeter.c
@@ -8,7 +8,8 @@ in the source distribution for its full text.
#include "CPUMeter.h"
#include "CRT.h"
-#include "ProcessList.h"
+#include "Settings.h"
+#include "Platform.h"
#include <assert.h>
#include <stdlib.h>
@@ -17,6 +18,19 @@ in the source distribution for its full text.
/*{
#include "Meter.h"
+
+typedef enum {
+ CPU_METER_NICE = 0,
+ CPU_METER_NORMAL = 1,
+ CPU_METER_KERNEL = 2,
+ CPU_METER_IRQ = 3,
+ CPU_METER_SOFTIRQ = 4,
+ CPU_METER_STEAL = 5,
+ CPU_METER_GUEST = 6,
+ CPU_METER_IOWAIT = 7,
+ CPU_METER_ITEMCOUNT = 8, // number of entries in this enum
+} CPUMeterValues;
+
}*/
int CPUMeter_attributes[] = {
@@ -34,7 +48,7 @@ static void CPUMeter_init(Meter* this) {
int cpu = this->param;
if (this->pl->cpuCount > 1) {
char caption[10];
- sprintf(caption, "%-3d", ProcessList_cpuId(this->pl, cpu - 1));
+ sprintf(caption, "%-3d", Settings_cpuId(this->pl->settings, cpu - 1));
Meter_setCaption(this, caption);
}
if (this->param == 0)
@@ -42,39 +56,13 @@ static void CPUMeter_init(Meter* this) {
}
static void CPUMeter_setValues(Meter* this, char* buffer, int size) {
- ProcessList* pl = this->pl;
int cpu = this->param;
if (cpu > this->pl->cpuCount) {
snprintf(buffer, size, "absent");
return;
}
- CPUData* cpuData = &(pl->cpus[cpu]);
- double total = (double) ( cpuData->totalPeriod == 0 ? 1 : cpuData->totalPeriod);
- double percent;
- double* v = this->values;
- v[0] = cpuData->nicePeriod / total * 100.0;
- v[1] = cpuData->userPeriod / total * 100.0;
- if (pl->detailedCPUTime) {
- v[2] = cpuData->systemPeriod / total * 100.0;
- v[3] = cpuData->irqPeriod / total * 100.0;
- v[4] = cpuData->softIrqPeriod / total * 100.0;
- v[5] = cpuData->stealPeriod / total * 100.0;
- v[6] = cpuData->guestPeriod / total * 100.0;
- v[7] = cpuData->ioWaitPeriod / total * 100.0;
- Meter_setItems(this, 8);
- if (pl->accountGuestInCPUMeter) {
- percent = v[0]+v[1]+v[2]+v[3]+v[4]+v[5]+v[6];
- } else {
- percent = v[0]+v[1]+v[2]+v[3]+v[4];
- }
- } else {
- v[2] = cpuData->systemAllPeriod / total * 100.0;
- v[3] = (cpuData->stealPeriod + cpuData->guestPeriod) / total * 100.0;
- Meter_setItems(this, 4);
- percent = v[0]+v[1]+v[2]+v[3];
- }
- percent = MIN(100.0, MAX(0.0, percent));
- if (isnan(percent)) percent = 0.0;
+ memset(this->values, 0, sizeof(double) * CPU_METER_ITEMCOUNT);
+ double percent = Platform_setCPUValues(this, cpu);
snprintf(buffer, size, "%5.1f%%", percent);
}
@@ -86,44 +74,44 @@ static void CPUMeter_display(Object* cast, RichString* out) {
RichString_append(out, CRT_colors[METER_TEXT], "absent");
return;
}
- sprintf(buffer, "%5.1f%% ", this->values[1]);
+ sprintf(buffer, "%5.1f%% ", this->values[CPU_METER_NORMAL]);
RichString_append(out, CRT_colors[METER_TEXT], ":");
RichString_append(out, CRT_colors[CPU_NORMAL], buffer);
- if (this->pl->detailedCPUTime) {
- sprintf(buffer, "%5.1f%% ", this->values[2]);
+ if (this->pl->settings->detailedCPUTime) {
+ sprintf(buffer, "%5.1f%% ", this->values[CPU_METER_KERNEL]);
RichString_append(out, CRT_colors[METER_TEXT], "sy:");
RichString_append(out, CRT_colors[CPU_KERNEL], buffer);
- sprintf(buffer, "%5.1f%% ", this->values[0]);
+ sprintf(buffer, "%5.1f%% ", this->values[CPU_METER_NICE]);
RichString_append(out, CRT_colors[METER_TEXT], "ni:");
RichString_append(out, CRT_colors[CPU_NICE_TEXT], buffer);
- sprintf(buffer, "%5.1f%% ", this->values[3]);
+ sprintf(buffer, "%5.1f%% ", this->values[CPU_METER_IRQ]);
RichString_append(out, CRT_colors[METER_TEXT], "hi:");
RichString_append(out, CRT_colors[CPU_IRQ], buffer);
- sprintf(buffer, "%5.1f%% ", this->values[4]);
+ sprintf(buffer, "%5.1f%% ", this->values[CPU_METER_SOFTIRQ]);
RichString_append(out, CRT_colors[METER_TEXT], "si:");
RichString_append(out, CRT_colors[CPU_SOFTIRQ], buffer);
- if (this->values[5]) {
- sprintf(buffer, "%5.1f%% ", this->values[5]);
+ if (this->values[CPU_METER_STEAL]) {
+ sprintf(buffer, "%5.1f%% ", this->values[CPU_METER_STEAL]);
RichString_append(out, CRT_colors[METER_TEXT], "st:");
RichString_append(out, CRT_colors[CPU_STEAL], buffer);
}
- if (this->values[6]) {
- sprintf(buffer, "%5.1f%% ", this->values[6]);
+ if (this->values[CPU_METER_GUEST]) {
+ sprintf(buffer, "%5.1f%% ", this->values[CPU_METER_GUEST]);
RichString_append(out, CRT_colors[METER_TEXT], "gu:");
RichString_append(out, CRT_colors[CPU_GUEST], buffer);
}
- sprintf(buffer, "%5.1f%% ", this->values[7]);
+ sprintf(buffer, "%5.1f%% ", this->values[CPU_METER_IOWAIT]);
RichString_append(out, CRT_colors[METER_TEXT], "wa:");
RichString_append(out, CRT_colors[CPU_IOWAIT], buffer);
} else {
- sprintf(buffer, "%5.1f%% ", this->values[2]);
+ sprintf(buffer, "%5.1f%% ", this->values[CPU_METER_KERNEL]);
RichString_append(out, CRT_colors[METER_TEXT], "sys:");
RichString_append(out, CRT_colors[CPU_KERNEL], buffer);
- sprintf(buffer, "%5.1f%% ", this->values[0]);
+ sprintf(buffer, "%5.1f%% ", this->values[CPU_METER_NICE]);
RichString_append(out, CRT_colors[METER_TEXT], "low:");
RichString_append(out, CRT_colors[CPU_NICE_TEXT], buffer);
- if (this->values[3]) {
- sprintf(buffer, "%5.1f%% ", this->values[3]);
+ if (this->values[CPU_METER_IRQ]) {
+ sprintf(buffer, "%5.1f%% ", this->values[CPU_METER_IRQ]);
RichString_append(out, CRT_colors[METER_TEXT], "vir:");
RichString_append(out, CRT_colors[CPU_GUEST], buffer);
}
@@ -152,7 +140,7 @@ static void AllCPUsMeter_getRange(Meter* this, int* start, int* count) {
static void AllCPUsMeter_init(Meter* this) {
int cpus = this->pl->cpuCount;
if (!this->drawData)
- this->drawData = calloc(cpus, sizeof(Meter*));
+ this->drawData = xCalloc(cpus, sizeof(Meter*));
Meter** meters = (Meter**) this->drawData;
int start, count;
AllCPUsMeter_getRange(this, &start, &count);
@@ -196,16 +184,17 @@ static void AllCPUsMeter_updateMode(Meter* this, int mode) {
static void DualColCPUsMeter_draw(Meter* this, int x, int y, int w) {
Meter** meters = (Meter**) this->drawData;
int start, count;
+ int pad = this->pl->settings->headerMargin ? 2 : 0;
AllCPUsMeter_getRange(this, &start, &count);
int height = (count+1)/2;
int startY = y;
for (int i = 0; i < height; i++) {
- meters[i]->draw(meters[i], x, y, (w-2)/2);
+ meters[i]->draw(meters[i], x, y, (w-pad)/2);
y += meters[i]->h;
}
y = startY;
for (int i = height; i < count; i++) {
- meters[i]->draw(meters[i], x+(w-1)/2+2, y, (w-2)/2);
+ meters[i]->draw(meters[i], x+(w-1)/2+1+(pad/2), y, (w-pad)/2);
y += meters[i]->h;
}
}
@@ -228,7 +217,7 @@ MeterClass CPUMeter_class = {
},
.setValues = CPUMeter_setValues,
.defaultMode = BAR_METERMODE,
- .maxItems = 8,
+ .maxItems = CPU_METER_ITEMCOUNT,
.total = 100.0,
.attributes = CPUMeter_attributes,
.name = "CPU",
@@ -248,6 +237,7 @@ MeterClass AllCPUsMeter_class = {
.attributes = CPUMeter_attributes,
.name = "AllCPUs",
.uiName = "CPUs (1/1)",
+ .description = "CPUs (1/1): all CPUs",
.caption = "CPU",
.draw = SingleColCPUsMeter_draw,
.init = AllCPUsMeter_init,
@@ -266,6 +256,7 @@ MeterClass AllCPUs2Meter_class = {
.attributes = CPUMeter_attributes,
.name = "AllCPUs2",
.uiName = "CPUs (1&2/2)",
+ .description = "CPUs (1&2/2): all CPUs in 2 shorter columns",
.caption = "CPU",
.draw = DualColCPUsMeter_draw,
.init = AllCPUsMeter_init,
@@ -284,6 +275,7 @@ MeterClass LeftCPUsMeter_class = {
.attributes = CPUMeter_attributes,
.name = "LeftCPUs",
.uiName = "CPUs (1/2)",
+ .description = "CPUs (1/2): first half of list",
.caption = "CPU",
.draw = SingleColCPUsMeter_draw,
.init = AllCPUsMeter_init,
@@ -302,6 +294,7 @@ MeterClass RightCPUsMeter_class = {
.attributes = CPUMeter_attributes,
.name = "RightCPUs",
.uiName = "CPUs (2/2)",
+ .description = "CPUs (2/2): second half of list",
.caption = "CPU",
.draw = SingleColCPUsMeter_draw,
.init = AllCPUsMeter_init,
@@ -319,6 +312,7 @@ MeterClass LeftCPUs2Meter_class = {
.total = 100.0,
.attributes = CPUMeter_attributes,
.name = "LeftCPUs2",
+ .description = "CPUs (1&2/4): first half in 2 shorter columns",
.uiName = "CPUs (1&2/4)",
.caption = "CPU",
.draw = DualColCPUsMeter_draw,
@@ -338,6 +332,7 @@ MeterClass RightCPUs2Meter_class = {
.attributes = CPUMeter_attributes,
.name = "RightCPUs2",
.uiName = "CPUs (3&4/4)",
+ .description = "CPUs (3&4/4): second half in 2 shorter columns",
.caption = "CPU",
.draw = DualColCPUsMeter_draw,
.init = AllCPUsMeter_init,
diff --git a/CPUMeter.h b/CPUMeter.h
index f91c759..2f16396 100644
--- a/CPUMeter.h
+++ b/CPUMeter.h
@@ -11,6 +11,19 @@ in the source distribution for its full text.
#include "Meter.h"
+typedef enum {
+ CPU_METER_NICE = 0,
+ CPU_METER_NORMAL = 1,
+ CPU_METER_KERNEL = 2,
+ CPU_METER_IRQ = 3,
+ CPU_METER_SOFTIRQ = 4,
+ CPU_METER_STEAL = 5,
+ CPU_METER_GUEST = 6,
+ CPU_METER_IOWAIT = 7,
+ CPU_METER_ITEMCOUNT = 8, // number of entries in this enum
+} CPUMeterValues;
+
+
extern int CPUMeter_attributes[];
#ifndef MIN
diff --git a/CRT.c b/CRT.c
index c0d1b82..2ab20c2 100644
--- a/CRT.c
+++ b/CRT.c
@@ -7,8 +7,7 @@ in the source distribution for its full text.
#include "CRT.h"
-#include "config.h"
-#include "String.h"
+#include "StringUtils.h"
#include "RichString.h"
#include <stdio.h>
@@ -16,19 +15,11 @@ in the source distribution for its full text.
#include <signal.h>
#include <stdlib.h>
#include <string.h>
-#ifdef HAVE_EXECINFO_H
-#include <execinfo.h>
-#endif
+#include <locale.h>
+#include <langinfo.h>
#define ColorPair(i,j) COLOR_PAIR((7-i)*8+j)
-#define COLORSCHEME_DEFAULT 0
-#define COLORSCHEME_MONOCHROME 1
-#define COLORSCHEME_BLACKONWHITE 2
-#define COLORSCHEME_BLACKONWHITE2 3
-#define COLORSCHEME_MIDNIGHT 4
-#define COLORSCHEME_BLACKNIGHT 5
-
#define Black COLOR_BLACK
#define Red COLOR_RED
#define Green COLOR_GREEN
@@ -38,11 +29,37 @@ in the source distribution for its full text.
#define Cyan COLOR_CYAN
#define White COLOR_WHITE
+#define KEY_WHEELUP KEY_F(20)
+#define KEY_WHEELDOWN KEY_F(21)
+#define KEY_RECLICK KEY_F(22)
+
//#link curses
/*{
#include <stdbool.h>
+typedef enum TreeStr_ {
+ TREE_STR_HORZ,
+ TREE_STR_VERT,
+ TREE_STR_RTEE,
+ TREE_STR_BEND,
+ TREE_STR_TEND,
+ TREE_STR_OPEN,
+ TREE_STR_SHUT,
+ TREE_STR_COUNT
+} TreeStr;
+
+typedef enum ColorSchemes_ {
+ COLORSCHEME_DEFAULT = 0,
+ COLORSCHEME_MONOCHROME = 1,
+ COLORSCHEME_BLACKONWHITE = 2,
+ COLORSCHEME_LIGHTTERMINAL = 3,
+ COLORSCHEME_MIDNIGHT = 4,
+ COLORSCHEME_BLACKNIGHT = 5,
+ COLORSCHEME_BROKENGRAY = 6,
+ LAST_COLORSCHEME = 7,
+} ColorSchemes;
+
typedef enum ColorElements_ {
RESET_COLOR,
DEFAULT_COLOR,
@@ -51,8 +68,9 @@ typedef enum ColorElements_ {
FAILED_SEARCH,
PANEL_HEADER_FOCUS,
PANEL_HEADER_UNFOCUS,
- PANEL_HIGHLIGHT_FOCUS,
- PANEL_HIGHLIGHT_UNFOCUS,
+ PANEL_SELECTION_FOCUS,
+ PANEL_SELECTION_FOLLOW,
+ PANEL_SELECTION_UNFOCUS,
LARGE_NUMBER,
METER_TEXT,
METER_VALUE,
@@ -67,6 +85,7 @@ typedef enum ColorElements_ {
PROCESS_MEGABYTES,
PROCESS_TREE,
PROCESS_R_STATE,
+ PROCESS_D_STATE,
PROCESS_BASENAME,
PROCESS_HIGH_PRIORITY,
PROCESS_LOW_PRIORITY,
@@ -76,13 +95,6 @@ typedef enum ColorElements_ {
BAR_SHADOW,
GRAPH_1,
GRAPH_2,
- GRAPH_3,
- GRAPH_4,
- GRAPH_5,
- GRAPH_6,
- GRAPH_7,
- GRAPH_8,
- GRAPH_9,
MEMORY_USED,
MEMORY_BUFFERS,
MEMORY_BUFFERS_TEXT,
@@ -111,48 +123,415 @@ typedef enum ColorElements_ {
void CRT_fatalError(const char* note) __attribute__ ((noreturn));
+void CRT_handleSIGSEGV(int sgn);
+
}*/
-// TODO: centralize these in Settings.
+const char *CRT_treeStrAscii[TREE_STR_COUNT] = {
+ "-", // TREE_STR_HORZ
+ "|", // TREE_STR_VERT
+ "`", // TREE_STR_RTEE
+ "`", // TREE_STR_BEND
+ ",", // TREE_STR_TEND
+ "+", // TREE_STR_OPEN
+ "-", // TREE_STR_SHUT
+};
+
+#ifdef HAVE_LIBNCURSESW
+
+const char *CRT_treeStrUtf8[TREE_STR_COUNT] = {
+ "\xe2\x94\x80", // TREE_STR_HORZ ─
+ "\xe2\x94\x82", // TREE_STR_VERT │
+ "\xe2\x94\x9c", // TREE_STR_RTEE ├
+ "\xe2\x94\x94", // TREE_STR_BEND └
+ "\xe2\x94\x8c", // TREE_STR_TEND ┌
+ "+", // TREE_STR_OPEN +
+ "\xe2\x94\x80", // TREE_STR_SHUT ─
+};
-static bool CRT_hasColors;
+bool CRT_utf8 = false;
-static int CRT_delay = 0;
+#endif
-int CRT_colorScheme = 0;
+const char **CRT_treeStr = CRT_treeStrAscii;
-bool CRT_utf8 = false;
+static bool CRT_hasColors;
-int CRT_colors[LAST_COLORELEMENT] = { 0 };
+int CRT_delay = 0;
+
+int* CRT_colors;
+
+int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT] = {
+ [COLORSCHEME_DEFAULT] = {
+ [RESET_COLOR] = ColorPair(White,Black),
+ [DEFAULT_COLOR] = ColorPair(White,Black),
+ [FUNCTION_BAR] = ColorPair(Black,Cyan),
+ [FUNCTION_KEY] = ColorPair(White,Black),
+ [PANEL_HEADER_FOCUS] = ColorPair(Black,Green),
+ [PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green),
+ [PANEL_SELECTION_FOCUS] = ColorPair(Black,Cyan),
+ [PANEL_SELECTION_FOLLOW] = ColorPair(Black,Yellow),
+ [PANEL_SELECTION_UNFOCUS] = ColorPair(Black,White),
+ [FAILED_SEARCH] = ColorPair(Red,Cyan),
+ [UPTIME] = A_BOLD | ColorPair(Cyan,Black),
+ [BATTERY] = A_BOLD | ColorPair(Cyan,Black),
+ [LARGE_NUMBER] = A_BOLD | ColorPair(Red,Black),
+ [METER_TEXT] = ColorPair(Cyan,Black),
+ [METER_VALUE] = A_BOLD | ColorPair(Cyan,Black),
+ [LED_COLOR] = ColorPair(Green,Black),
+ [TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black),
+ [PROCESS] = A_NORMAL,
+ [PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black),
+ [PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black),
+ [PROCESS_MEGABYTES] = ColorPair(Cyan,Black),
+ [PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan,Black),
+ [PROCESS_TREE] = ColorPair(Cyan,Black),
+ [PROCESS_R_STATE] = ColorPair(Green,Black),
+ [PROCESS_D_STATE] = A_BOLD | ColorPair(Red,Black),
+ [PROCESS_HIGH_PRIORITY] = ColorPair(Red,Black),
+ [PROCESS_LOW_PRIORITY] = ColorPair(Green,Black),
+ [PROCESS_THREAD] = ColorPair(Green,Black),
+ [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green,Black),
+ [BAR_BORDER] = A_BOLD,
+ [BAR_SHADOW] = A_BOLD | ColorPair(Black,Black),
+ [SWAP] = ColorPair(Red,Black),
+ [GRAPH_1] = A_BOLD | ColorPair(Cyan,Black),
+ [GRAPH_2] = ColorPair(Cyan,Black),
+ [MEMORY_USED] = ColorPair(Green,Black),
+ [MEMORY_BUFFERS] = ColorPair(Blue,Black),
+ [MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Blue,Black),
+ [MEMORY_CACHE] = ColorPair(Yellow,Black),
+ [LOAD_AVERAGE_FIFTEEN] = ColorPair(Cyan,Black),
+ [LOAD_AVERAGE_FIVE] = A_BOLD | ColorPair(Cyan,Black),
+ [LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(White,Black),
+ [LOAD] = A_BOLD,
+ [HELP_BOLD] = A_BOLD | ColorPair(Cyan,Black),
+ [CLOCK] = A_BOLD,
+ [CHECK_BOX] = ColorPair(Cyan,Black),
+ [CHECK_MARK] = A_BOLD,
+ [CHECK_TEXT] = A_NORMAL,
+ [HOSTNAME] = A_BOLD,
+ [CPU_NICE] = ColorPair(Blue,Black),
+ [CPU_NICE_TEXT] = A_BOLD | ColorPair(Blue,Black),
+ [CPU_NORMAL] = ColorPair(Green,Black),
+ [CPU_KERNEL] = ColorPair(Red,Black),
+ [CPU_IOWAIT] = A_BOLD | ColorPair(Black, Black),
+ [CPU_IRQ] = ColorPair(Yellow,Black),
+ [CPU_SOFTIRQ] = ColorPair(Magenta,Black),
+ [CPU_STEAL] = ColorPair(Cyan,Black),
+ [CPU_GUEST] = ColorPair(Cyan,Black),
+ },
+ [COLORSCHEME_MONOCHROME] = {
+ [RESET_COLOR] = A_NORMAL,
+ [DEFAULT_COLOR] = A_NORMAL,
+ [FUNCTION_BAR] = A_REVERSE,
+ [FUNCTION_KEY] = A_NORMAL,
+ [PANEL_HEADER_FOCUS] = A_REVERSE,
+ [PANEL_HEADER_UNFOCUS] = A_REVERSE,
+ [PANEL_SELECTION_FOCUS] = A_REVERSE,
+ [PANEL_SELECTION_FOLLOW] = A_REVERSE,
+ [PANEL_SELECTION_UNFOCUS] = A_BOLD,
+ [FAILED_SEARCH] = A_REVERSE | A_BOLD,
+ [UPTIME] = A_BOLD,
+ [BATTERY] = A_BOLD,
+ [LARGE_NUMBER] = A_BOLD,
+ [METER_TEXT] = A_NORMAL,
+ [METER_VALUE] = A_BOLD,
+ [LED_COLOR] = A_NORMAL,
+ [TASKS_RUNNING] = A_BOLD,
+ [PROCESS] = A_NORMAL,
+ [PROCESS_SHADOW] = A_DIM,
+ [PROCESS_TAG] = A_BOLD,
+ [PROCESS_MEGABYTES] = A_BOLD,
+ [PROCESS_BASENAME] = A_BOLD,
+ [PROCESS_TREE] = A_BOLD,
+ [PROCESS_R_STATE] = A_BOLD,
+ [PROCESS_D_STATE] = A_BOLD,
+ [PROCESS_HIGH_PRIORITY] = A_BOLD,
+ [PROCESS_LOW_PRIORITY] = A_DIM,
+ [PROCESS_THREAD] = A_BOLD,
+ [PROCESS_THREAD_BASENAME] = A_REVERSE,
+ [BAR_BORDER] = A_BOLD,
+ [BAR_SHADOW] = A_DIM,
+ [SWAP] = A_BOLD,
+ [GRAPH_1] = A_BOLD,
+ [GRAPH_2] = A_NORMAL,
+ [MEMORY_USED] = A_BOLD,
+ [MEMORY_BUFFERS] = A_NORMAL,
+ [MEMORY_BUFFERS_TEXT] = A_NORMAL,
+ [MEMORY_CACHE] = A_NORMAL,
+ [LOAD_AVERAGE_FIFTEEN] = A_DIM,
+ [LOAD_AVERAGE_FIVE] = A_NORMAL,
+ [LOAD_AVERAGE_ONE] = A_BOLD,
+ [LOAD] = A_BOLD,
+ [HELP_BOLD] = A_BOLD,
+ [CLOCK] = A_BOLD,
+ [CHECK_BOX] = A_BOLD,
+ [CHECK_MARK] = A_NORMAL,
+ [CHECK_TEXT] = A_NORMAL,
+ [HOSTNAME] = A_BOLD,
+ [CPU_NICE] = A_NORMAL,
+ [CPU_NICE_TEXT] = A_NORMAL,
+ [CPU_NORMAL] = A_BOLD,
+ [CPU_KERNEL] = A_BOLD,
+ [CPU_IOWAIT] = A_NORMAL,
+ [CPU_IRQ] = A_BOLD,
+ [CPU_SOFTIRQ] = A_BOLD,
+ [CPU_STEAL] = A_REVERSE,
+ [CPU_GUEST] = A_REVERSE,
+ },
+ [COLORSCHEME_BLACKONWHITE] = {
+ [RESET_COLOR] = ColorPair(Black,White),
+ [DEFAULT_COLOR] = ColorPair(Black,White),
+ [FUNCTION_BAR] = ColorPair(Black,Cyan),
+ [FUNCTION_KEY] = ColorPair(Black,White),
+ [PANEL_HEADER_FOCUS] = ColorPair(Black,Green),
+ [PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green),
+ [PANEL_SELECTION_FOCUS] = ColorPair(Black,Cyan),
+ [PANEL_SELECTION_FOLLOW] = ColorPair(Black,Yellow),
+ [PANEL_SELECTION_UNFOCUS] = ColorPair(Blue,White),
+ [FAILED_SEARCH] = ColorPair(Red,Cyan),
+ [UPTIME] = ColorPair(Yellow,White),
+ [BATTERY] = ColorPair(Yellow,White),
+ [LARGE_NUMBER] = ColorPair(Red,White),
+ [METER_TEXT] = ColorPair(Blue,White),
+ [METER_VALUE] = ColorPair(Black,White),
+ [LED_COLOR] = ColorPair(Green,White),
+ [TASKS_RUNNING] = ColorPair(Green,White),
+ [PROCESS] = ColorPair(Black,White),
+ [PROCESS_SHADOW] = A_BOLD | ColorPair(Black,White),
+ [PROCESS_TAG] = ColorPair(White,Blue),
+ [PROCESS_MEGABYTES] = ColorPair(Blue,White),
+ [PROCESS_BASENAME] = ColorPair(Blue,White),
+ [PROCESS_TREE] = ColorPair(Green,White),
+ [PROCESS_R_STATE] = ColorPair(Green,White),
+ [PROCESS_D_STATE] = A_BOLD | ColorPair(Red,White),
+ [PROCESS_HIGH_PRIORITY] = ColorPair(Red,White),
+ [PROCESS_LOW_PRIORITY] = ColorPair(Green,White),
+ [PROCESS_THREAD] = ColorPair(Blue,White),
+ [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue,White),
+ [BAR_BORDER] = ColorPair(Blue,White),
+ [BAR_SHADOW] = ColorPair(Black,White),
+ [SWAP] = ColorPair(Red,White),
+ [GRAPH_1] = A_BOLD | ColorPair(Blue,White),
+ [GRAPH_2] = ColorPair(Blue,White),
+ [MEMORY_USED] = ColorPair(Green,White),
+ [MEMORY_BUFFERS] = ColorPair(Cyan,White),
+ [MEMORY_BUFFERS_TEXT] = ColorPair(Cyan,White),
+ [MEMORY_CACHE] = ColorPair(Yellow,White),
+ [LOAD_AVERAGE_FIFTEEN] = ColorPair(Black,White),
+ [LOAD_AVERAGE_FIVE] = ColorPair(Black,White),
+ [LOAD_AVERAGE_ONE] = ColorPair(Black,White),
+ [LOAD] = ColorPair(Black,White),
+ [HELP_BOLD] = ColorPair(Blue,White),
+ [CLOCK] = ColorPair(Black,White),
+ [CHECK_BOX] = ColorPair(Blue,White),
+ [CHECK_MARK] = ColorPair(Black,White),
+ [CHECK_TEXT] = ColorPair(Black,White),
+ [HOSTNAME] = ColorPair(Black,White),
+ [CPU_NICE] = ColorPair(Cyan,White),
+ [CPU_NICE_TEXT] = ColorPair(Cyan,White),
+ [CPU_NORMAL] = ColorPair(Green,White),
+ [CPU_KERNEL] = ColorPair(Red,White),
+ [CPU_IOWAIT] = A_BOLD | ColorPair(Black, White),
+ [CPU_IRQ] = ColorPair(Blue,White),
+ [CPU_SOFTIRQ] = ColorPair(Blue,White),
+ [CPU_STEAL] = ColorPair(Cyan,White),
+ [CPU_GUEST] = ColorPair(Cyan,White),
+ },
+ [COLORSCHEME_LIGHTTERMINAL] = {
+ [RESET_COLOR] = ColorPair(Black,Black),
+ [DEFAULT_COLOR] = ColorPair(Black,Black),
+ [FUNCTION_BAR] = ColorPair(Black,Cyan),
+ [FUNCTION_KEY] = ColorPair(Black,Black),
+ [PANEL_HEADER_FOCUS] = ColorPair(Black,Green),
+ [PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green),
+ [PANEL_SELECTION_FOCUS] = ColorPair(Black,Cyan),
+ [PANEL_SELECTION_FOLLOW] = ColorPair(Black,Yellow),
+ [PANEL_SELECTION_UNFOCUS] = ColorPair(Blue,Black),
+ [FAILED_SEARCH] = ColorPair(Red,Cyan),
+ [UPTIME] = ColorPair(Yellow,Black),
+ [BATTERY] = ColorPair(Yellow,Black),
+ [LARGE_NUMBER] = ColorPair(Red,Black),
+ [METER_TEXT] = ColorPair(Blue,Black),
+ [METER_VALUE] = ColorPair(Black,Black),
+ [LED_COLOR] = ColorPair(Green,Black),
+ [TASKS_RUNNING] = ColorPair(Green,Black),
+ [PROCESS] = ColorPair(Black,Black),
+ [PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black),
+ [PROCESS_TAG] = ColorPair(White,Blue),
+ [PROCESS_MEGABYTES] = ColorPair(Blue,Black),
+ [PROCESS_BASENAME] = ColorPair(Green,Black),
+ [PROCESS_TREE] = ColorPair(Blue,Black),
+ [PROCESS_R_STATE] = ColorPair(Green,Black),
+ [PROCESS_D_STATE] = A_BOLD | ColorPair(Red,Black),
+ [PROCESS_HIGH_PRIORITY] = ColorPair(Red,Black),
+ [PROCESS_LOW_PRIORITY] = ColorPair(Green,Black),
+ [PROCESS_THREAD] = ColorPair(Blue,Black),
+ [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue,Black),
+ [BAR_BORDER] = ColorPair(Blue,Black),
+ [BAR_SHADOW] = ColorPair(Black,Black),
+ [SWAP] = ColorPair(Red,Black),
+ [GRAPH_1] = A_BOLD | ColorPair(Cyan,Black),
+ [GRAPH_2] = ColorPair(Cyan,Black),
+ [MEMORY_USED] = ColorPair(Green,Black),
+ [MEMORY_BUFFERS] = ColorPair(Cyan,Black),
+ [MEMORY_BUFFERS_TEXT] = ColorPair(Cyan,Black),
+ [MEMORY_CACHE] = ColorPair(Yellow,Black),
+ [LOAD_AVERAGE_FIFTEEN] = ColorPair(Black,Black),
+ [LOAD_AVERAGE_FIVE] = ColorPair(Black,Black),
+ [LOAD_AVERAGE_ONE] = ColorPair(Black,Black),
+ [LOAD] = ColorPair(White,Black),
+ [HELP_BOLD] = ColorPair(Blue,Black),
+ [CLOCK] = ColorPair(White,Black),
+ [CHECK_BOX] = ColorPair(Blue,Black),
+ [CHECK_MARK] = ColorPair(Black,Black),
+ [CHECK_TEXT] = ColorPair(Black,Black),
+ [HOSTNAME] = ColorPair(White,Black),
+ [CPU_NICE] = ColorPair(Cyan,Black),
+ [CPU_NICE_TEXT] = ColorPair(Cyan,Black),
+ [CPU_NORMAL] = ColorPair(Green,Black),
+ [CPU_KERNEL] = ColorPair(Red,Black),
+ [CPU_IOWAIT] = A_BOLD | ColorPair(Black, Black),
+ [CPU_IRQ] = A_BOLD | ColorPair(Blue,Black),
+ [CPU_SOFTIRQ] = ColorPair(Blue,Black),
+ [CPU_STEAL] = ColorPair(Black,Black),
+ [CPU_GUEST] = ColorPair(Black,Black),
+ },
+ [COLORSCHEME_MIDNIGHT] = {
+ [RESET_COLOR] = ColorPair(White,Blue),
+ [DEFAULT_COLOR] = ColorPair(White,Blue),
+ [FUNCTION_BAR] = ColorPair(Black,Cyan),
+ [FUNCTION_KEY] = A_NORMAL,
+ [PANEL_HEADER_FOCUS] = ColorPair(Black,Cyan),
+ [PANEL_HEADER_UNFOCUS] = ColorPair(Black,Cyan),
+ [PANEL_SELECTION_FOCUS] = ColorPair(Black,White),
+ [PANEL_SELECTION_FOLLOW] = ColorPair(Black,Yellow),
+ [PANEL_SELECTION_UNFOCUS] = A_BOLD | ColorPair(Yellow,Blue),
+ [FAILED_SEARCH] = ColorPair(Red,Cyan),
+ [UPTIME] = A_BOLD | ColorPair(Yellow,Blue),
+ [BATTERY] = A_BOLD | ColorPair(Yellow,Blue),
+ [LARGE_NUMBER] = A_BOLD | ColorPair(Red,Blue),
+ [METER_TEXT] = ColorPair(Cyan,Blue),
+ [METER_VALUE] = A_BOLD | ColorPair(Cyan,Blue),
+ [LED_COLOR] = ColorPair(Green,Blue),
+ [TASKS_RUNNING] = A_BOLD | ColorPair(Green,Blue),
+ [PROCESS] = ColorPair(White,Blue),
+ [PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Blue),
+ [PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Blue),
+ [PROCESS_MEGABYTES] = ColorPair(Cyan,Blue),
+ [PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan,Blue),
+ [PROCESS_TREE] = ColorPair(Cyan,Blue),
+ [PROCESS_R_STATE] = ColorPair(Green,Blue),
+ [PROCESS_D_STATE] = A_BOLD | ColorPair(Red,Blue),
+ [PROCESS_HIGH_PRIORITY] = ColorPair(Red,Blue),
+ [PROCESS_LOW_PRIORITY] = ColorPair(Green,Blue),
+ [PROCESS_THREAD] = ColorPair(Green,Blue),
+ [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green,Blue),
+ [BAR_BORDER] = A_BOLD | ColorPair(Yellow,Blue),
+ [BAR_SHADOW] = ColorPair(Cyan,Blue),
+ [SWAP] = ColorPair(Red,Blue),
+ [GRAPH_1] = A_BOLD | ColorPair(Cyan,Blue),
+ [GRAPH_2] = ColorPair(Cyan,Blue),
+ [MEMORY_USED] = A_BOLD | ColorPair(Green,Blue),
+ [MEMORY_BUFFERS] = A_BOLD | ColorPair(Cyan,Blue),
+ [MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Cyan,Blue),
+ [MEMORY_CACHE] = A_BOLD | ColorPair(Yellow,Blue),
+ [LOAD_AVERAGE_FIFTEEN] = A_BOLD | ColorPair(Black,Blue),
+ [LOAD_AVERAGE_FIVE] = A_NORMAL | ColorPair(White,Blue),
+ [LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(White,Blue),
+ [LOAD] = A_BOLD | ColorPair(White,Blue),
+ [HELP_BOLD] = A_BOLD | ColorPair(Cyan,Blue),
+ [CLOCK] = ColorPair(White,Blue),
+ [CHECK_BOX] = ColorPair(Cyan,Blue),
+ [CHECK_MARK] = A_BOLD | ColorPair(White,Blue),
+ [CHECK_TEXT] = A_NORMAL | ColorPair(White,Blue),
+ [HOSTNAME] = ColorPair(White,Blue),
+ [CPU_NICE] = A_BOLD | ColorPair(Cyan,Blue),
+ [CPU_NICE_TEXT] = A_BOLD | ColorPair(Cyan,Blue),
+ [CPU_NORMAL] = A_BOLD | ColorPair(Green,Blue),
+ [CPU_KERNEL] = A_BOLD | ColorPair(Red,Blue),
+ [CPU_IOWAIT] = A_BOLD | ColorPair(Blue,Blue),
+ [CPU_IRQ] = A_BOLD | ColorPair(Black,Blue),
+ [CPU_SOFTIRQ] = ColorPair(Black,Blue),
+ [CPU_STEAL] = ColorPair(White,Blue),
+ [CPU_GUEST] = ColorPair(White,Blue),
+ },
+ [COLORSCHEME_BLACKNIGHT] = {
+ [RESET_COLOR] = ColorPair(Cyan,Black),
+ [DEFAULT_COLOR] = ColorPair(Cyan,Black),
+ [FUNCTION_BAR] = ColorPair(Black,Green),
+ [FUNCTION_KEY] = ColorPair(Cyan,Black),
+ [PANEL_HEADER_FOCUS] = ColorPair(Black,Green),
+ [PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green),
+ [PANEL_SELECTION_FOCUS] = ColorPair(Black,Cyan),
+ [PANEL_SELECTION_FOLLOW] = ColorPair(Black,Yellow),
+ [PANEL_SELECTION_UNFOCUS] = ColorPair(Black,White),
+ [FAILED_SEARCH] = ColorPair(Red,Cyan),
+ [UPTIME] = ColorPair(Green,Black),
+ [BATTERY] = ColorPair(Green,Black),
+ [LARGE_NUMBER] = A_BOLD | ColorPair(Red,Black),
+ [METER_TEXT] = ColorPair(Cyan,Black),
+ [METER_VALUE] = ColorPair(Green,Black),
+ [LED_COLOR] = ColorPair(Green,Black),
+ [TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black),
+ [PROCESS] = ColorPair(Cyan,Black),
+ [PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black),
+ [PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black),
+ [PROCESS_MEGABYTES] = A_BOLD | ColorPair(Green,Black),
+ [PROCESS_BASENAME] = A_BOLD | ColorPair(Green,Black),
+ [PROCESS_TREE] = ColorPair(Cyan,Black),
+ [PROCESS_THREAD] = ColorPair(Green,Black),
+ [PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue,Black),
+ [PROCESS_R_STATE] = ColorPair(Green,Black),
+ [PROCESS_D_STATE] = A_BOLD | ColorPair(Red,Black),
+ [PROCESS_HIGH_PRIORITY] = ColorPair(Red,Black),
+ [PROCESS_LOW_PRIORITY] = ColorPair(Green,Black),
+ [BAR_BORDER] = A_BOLD | ColorPair(Green,Black),
+ [BAR_SHADOW] = ColorPair(Cyan,Black),
+ [SWAP] = ColorPair(Red,Black),
+ [GRAPH_1] = A_BOLD | ColorPair(Green,Black),
+ [GRAPH_2] = ColorPair(Green,Black),
+ [MEMORY_USED] = ColorPair(Green,Black),
+ [MEMORY_BUFFERS] = ColorPair(Blue,Black),
+ [MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Blue,Black),
+ [MEMORY_CACHE] = ColorPair(Yellow,Black),
+ [LOAD_AVERAGE_FIFTEEN] = ColorPair(Green,Black),
+ [LOAD_AVERAGE_FIVE] = ColorPair(Green,Black),
+ [LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(Green,Black),
+ [LOAD] = A_BOLD,
+ [HELP_BOLD] = A_BOLD | ColorPair(Cyan,Black),
+ [CLOCK] = ColorPair(Green,Black),
+ [CHECK_BOX] = ColorPair(Green,Black),
+ [CHECK_MARK] = A_BOLD | ColorPair(Green,Black),
+ [CHECK_TEXT] = ColorPair(Cyan,Black),
+ [HOSTNAME] = ColorPair(Green,Black),
+ [CPU_NICE] = ColorPair(Blue,Black),
+ [CPU_NICE_TEXT] = A_BOLD | ColorPair(Blue,Black),
+ [CPU_NORMAL] = ColorPair(Green,Black),
+ [CPU_KERNEL] = ColorPair(Red,Black),
+ [CPU_IOWAIT] = ColorPair(Yellow,Black),
+ [CPU_IRQ] = A_BOLD | ColorPair(Blue,Black),
+ [CPU_SOFTIRQ] = ColorPair(Blue,Black),
+ [CPU_STEAL] = ColorPair(Cyan,Black),
+ [CPU_GUEST] = ColorPair(Cyan,Black),
+ },
+ [COLORSCHEME_BROKENGRAY] = { 0 } // dynamically generated.
+};
int CRT_cursorX = 0;
int CRT_scrollHAmount = 5;
+int CRT_scrollWheelVAmount = 10;
+
char* CRT_termType;
-void *backtraceArray[128];
+// TODO move color scheme to Settings, perhaps?
-static void CRT_handleSIGSEGV(int sgn) {
- (void) sgn;
- CRT_done();
- #if __linux
- fprintf(stderr, "\n\nhtop " VERSION " aborting. Please report bug at http://hisham.hm/htop\n");
- #ifdef HAVE_EXECINFO_H
- size_t size = backtrace(backtraceArray, sizeof(backtraceArray) / sizeof(void *));
- fprintf(stderr, "\n Please include in your report the following backtrace: \n");
- backtrace_symbols_fd(backtraceArray, size, 2);
- fprintf(stderr, "\nAdditionally, in order to make the above backtrace useful,");
- fprintf(stderr, "\nplease also run the following command to generate a disassembly of your binary:");
- fprintf(stderr, "\n\n objdump -d `which htop` > ~/htop.objdump");
- fprintf(stderr, "\n\nand then attach the file ~/htop.objdump to your bug report.");
- fprintf(stderr, "\n\nThank you for helping to improve htop!\n\n");
- #endif
- #else
- fprintf(stderr, "\n\nhtop " VERSION " aborting. Unsupported platform.\n");
- #endif
- abort();
-}
+int CRT_colorScheme = 0;
+
+void *backtraceArray[128];
static void CRT_handleSIGTERM(int sgn) {
(void) sgn;
@@ -166,11 +545,22 @@ void CRT_init(int delay, int colorScheme) {
initscr();
noecho();
CRT_delay = delay;
+ if (CRT_delay == 0) {
+ CRT_delay = 1;
+ }
+ CRT_colors = CRT_colorSchemes[colorScheme];
CRT_colorScheme = colorScheme;
- halfdelay(CRT_delay/2);
+
+ for (int i = 0; i < LAST_COLORELEMENT; i++) {
+ unsigned int color = CRT_colorSchemes[COLORSCHEME_DEFAULT][i];
+ CRT_colorSchemes[COLORSCHEME_BROKENGRAY][i] = color == (A_BOLD | ColorPair(Black,Black)) ? ColorPair(White,Black) : color;
+ }
+
+ halfdelay(CRT_delay);
nonl();
intrflush(stdscr, false);
keypad(stdscr, true);
+ mouseinterval(0);
curs_set(0);
if (has_colors()) {
start_color();
@@ -207,7 +597,27 @@ void CRT_init(int delay, int colorScheme) {
CRT_colorScheme = 1;
CRT_setColors(CRT_colorScheme);
- mousemask(BUTTON1_CLICKED, NULL);
+ /* initialize locale */
+ setlocale(LC_CTYPE, "");
+
+#ifdef HAVE_LIBNCURSESW
+ if(strcmp(nl_langinfo(CODESET), "UTF-8") == 0)
+ CRT_utf8 = true;
+ else
+ CRT_utf8 = false;
+#endif
+
+ CRT_treeStr =
+#ifdef HAVE_LIBNCURSESW
+ CRT_utf8 ? CRT_treeStrUtf8 :
+#endif
+ CRT_treeStrAscii;
+
+#if NCURSES_MOUSE_VERSION > 1
+ mousemask(BUTTON1_RELEASED | BUTTON4_PRESSED | BUTTON5_PRESSED, NULL);
+#else
+ mousemask(BUTTON1_RELEASED, NULL);
+#endif
}
void CRT_done() {
@@ -227,7 +637,7 @@ int CRT_readKey() {
cbreak();
nodelay(stdscr, FALSE);
int ret = getch();
- halfdelay(CRT_delay/2);
+ halfdelay(CRT_delay);
return ret;
}
@@ -238,7 +648,7 @@ void CRT_disableDelay() {
}
void CRT_enableDelay() {
- halfdelay(CRT_delay/2);
+ halfdelay(CRT_delay);
}
void CRT_setColors(int colorScheme) {
@@ -252,385 +662,5 @@ void CRT_setColors(int colorScheme) {
for (int j = 0; j < 8; j++)
init_pair((7-i)*8+j, i, (j==0?-1:j));
}
-
- if (colorScheme == COLORSCHEME_MONOCHROME) {
- CRT_colors[RESET_COLOR] = A_NORMAL;
- CRT_colors[DEFAULT_COLOR] = A_NORMAL;
- CRT_colors[FUNCTION_BAR] = A_REVERSE;
- CRT_colors[FUNCTION_KEY] = A_NORMAL;
- CRT_colors[PANEL_HEADER_FOCUS] = A_REVERSE;
- CRT_colors[PANEL_HEADER_UNFOCUS] = A_REVERSE;
- CRT_colors[PANEL_HIGHLIGHT_FOCUS] = A_REVERSE;
- CRT_colors[PANEL_HIGHLIGHT_UNFOCUS] = A_BOLD;
- CRT_colors[FAILED_SEARCH] = A_REVERSE | A_BOLD;
- CRT_colors[UPTIME] = A_BOLD;
- CRT_colors[BATTERY] = A_BOLD;
- CRT_colors[LARGE_NUMBER] = A_BOLD;
- CRT_colors[METER_TEXT] = A_NORMAL;
- CRT_colors[METER_VALUE] = A_BOLD;
- CRT_colors[LED_COLOR] = A_NORMAL;
- CRT_colors[TASKS_RUNNING] = A_BOLD;
- CRT_colors[PROCESS] = A_NORMAL;
- CRT_colors[PROCESS_SHADOW] = A_DIM;
- CRT_colors[PROCESS_TAG] = A_BOLD;
- CRT_colors[PROCESS_MEGABYTES] = A_BOLD;
- CRT_colors[PROCESS_BASENAME] = A_BOLD;
- CRT_colors[PROCESS_TREE] = A_BOLD;
- CRT_colors[PROCESS_R_STATE] = A_BOLD;
- CRT_colors[PROCESS_HIGH_PRIORITY] = A_BOLD;
- CRT_colors[PROCESS_LOW_PRIORITY] = A_DIM;
- CRT_colors[PROCESS_THREAD] = A_BOLD;
- CRT_colors[PROCESS_THREAD_BASENAME] = A_REVERSE;
- CRT_colors[BAR_BORDER] = A_BOLD;
- CRT_colors[BAR_SHADOW] = A_DIM;
- CRT_colors[SWAP] = A_BOLD;
- CRT_colors[GRAPH_1] = A_BOLD;
- CRT_colors[GRAPH_2] = A_BOLD;
- CRT_colors[GRAPH_3] = A_BOLD;
- CRT_colors[GRAPH_4] = A_NORMAL;
- CRT_colors[GRAPH_5] = A_NORMAL;
- CRT_colors[GRAPH_6] = A_NORMAL;
- CRT_colors[GRAPH_7] = A_DIM;
- CRT_colors[GRAPH_8] = A_DIM;
- CRT_colors[GRAPH_9] = A_DIM;
- CRT_colors[MEMORY_USED] = A_BOLD;
- CRT_colors[MEMORY_BUFFERS] = A_NORMAL;
- CRT_colors[MEMORY_BUFFERS_TEXT] = A_NORMAL;
- CRT_colors[MEMORY_CACHE] = A_NORMAL;
- CRT_colors[LOAD_AVERAGE_FIFTEEN] = A_DIM;
- CRT_colors[LOAD_AVERAGE_FIVE] = A_NORMAL;
- CRT_colors[LOAD_AVERAGE_ONE] = A_BOLD;
- CRT_colors[LOAD] = A_BOLD;
- CRT_colors[HELP_BOLD] = A_BOLD;
- CRT_colors[CLOCK] = A_BOLD;
- CRT_colors[CHECK_BOX] = A_BOLD;
- CRT_colors[CHECK_MARK] = A_NORMAL;
- CRT_colors[CHECK_TEXT] = A_NORMAL;
- CRT_colors[HOSTNAME] = A_BOLD;
- CRT_colors[CPU_NICE] = A_NORMAL;
- CRT_colors[CPU_NICE_TEXT] = A_NORMAL;
- CRT_colors[CPU_NORMAL] = A_BOLD;
- CRT_colors[CPU_KERNEL] = A_BOLD;
- CRT_colors[CPU_IOWAIT] = A_NORMAL;
- CRT_colors[CPU_IRQ] = A_BOLD;
- CRT_colors[CPU_SOFTIRQ] = A_BOLD;
- CRT_colors[CPU_STEAL] = A_REVERSE;
- CRT_colors[CPU_GUEST] = A_REVERSE;
- } else if (CRT_colorScheme == COLORSCHEME_BLACKONWHITE) {
- CRT_colors[RESET_COLOR] = ColorPair(Black,White);
- CRT_colors[DEFAULT_COLOR] = ColorPair(Black,White);
- CRT_colors[FUNCTION_BAR] = ColorPair(Black,Cyan);
- CRT_colors[FUNCTION_KEY] = ColorPair(Black,White);
- CRT_colors[PANEL_HEADER_FOCUS] = ColorPair(Black,Green);
- CRT_colors[PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green);
- CRT_colors[PANEL_HIGHLIGHT_FOCUS] = ColorPair(Black,Cyan);
- CRT_colors[PANEL_HIGHLIGHT_UNFOCUS] = ColorPair(Blue,White);
- CRT_colors[FAILED_SEARCH] = ColorPair(Red,Cyan);
- CRT_colors[UPTIME] = ColorPair(Yellow,White);
- CRT_colors[BATTERY] = ColorPair(Yellow,White);
- CRT_colors[LARGE_NUMBER] = ColorPair(Red,White);
- CRT_colors[METER_TEXT] = ColorPair(Blue,White);
- CRT_colors[METER_VALUE] = ColorPair(Black,White);
- CRT_colors[LED_COLOR] = ColorPair(Green,White);
- CRT_colors[TASKS_RUNNING] = ColorPair(Green,White);
- CRT_colors[PROCESS] = ColorPair(Black,White);
- CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,White);
- CRT_colors[PROCESS_TAG] = ColorPair(White,Blue);
- CRT_colors[PROCESS_MEGABYTES] = ColorPair(Blue,White);
- CRT_colors[PROCESS_BASENAME] = ColorPair(Blue,White);
- CRT_colors[PROCESS_TREE] = ColorPair(Green,White);
- CRT_colors[PROCESS_R_STATE] = ColorPair(Green,White);
- CRT_colors[PROCESS_HIGH_PRIORITY] = ColorPair(Red,White);
- CRT_colors[PROCESS_LOW_PRIORITY] = ColorPair(Red,White);
- CRT_colors[PROCESS_THREAD] = ColorPair(Blue,White);
- CRT_colors[PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue,White);
- CRT_colors[BAR_BORDER] = ColorPair(Blue,White);
- CRT_colors[BAR_SHADOW] = ColorPair(Black,White);
- CRT_colors[SWAP] = ColorPair(Red,White);
- CRT_colors[GRAPH_1] = ColorPair(Yellow,White);
- CRT_colors[GRAPH_2] = ColorPair(Yellow,White);
- CRT_colors[GRAPH_3] = ColorPair(Yellow,White);
- CRT_colors[GRAPH_4] = ColorPair(Yellow,White);
- CRT_colors[GRAPH_5] = ColorPair(Yellow,White);
- CRT_colors[GRAPH_6] = ColorPair(Yellow,White);
- CRT_colors[GRAPH_7] = ColorPair(Yellow,White);
- CRT_colors[GRAPH_8] = ColorPair(Yellow,White);
- CRT_colors[GRAPH_9] = ColorPair(Yellow,White);
- CRT_colors[MEMORY_USED] = ColorPair(Green,White);
- CRT_colors[MEMORY_BUFFERS] = ColorPair(Cyan,White);
- CRT_colors[MEMORY_BUFFERS_TEXT] = ColorPair(Cyan,White);
- CRT_colors[MEMORY_CACHE] = ColorPair(Yellow,White);
- CRT_colors[LOAD_AVERAGE_FIFTEEN] = ColorPair(Black,White);
- CRT_colors[LOAD_AVERAGE_FIVE] = ColorPair(Black,White);
- CRT_colors[LOAD_AVERAGE_ONE] = ColorPair(Black,White);
- CRT_colors[LOAD] = ColorPair(Black,White);
- CRT_colors[HELP_BOLD] = ColorPair(Blue,White);
- CRT_colors[CLOCK] = ColorPair(Black,White);
- CRT_colors[CHECK_BOX] = ColorPair(Blue,White);
- CRT_colors[CHECK_MARK] = ColorPair(Black,White);
- CRT_colors[CHECK_TEXT] = ColorPair(Black,White);
- CRT_colors[HOSTNAME] = ColorPair(Black,White);
- CRT_colors[CPU_NICE] = ColorPair(Cyan,White);
- CRT_colors[CPU_NICE_TEXT] = ColorPair(Cyan,White);
- CRT_colors[CPU_NORMAL] = ColorPair(Green,White);
- CRT_colors[CPU_KERNEL] = ColorPair(Red,White);
- CRT_colors[CPU_IOWAIT] = A_BOLD | ColorPair(Black, White);
- CRT_colors[CPU_IRQ] = ColorPair(Blue,White);
- CRT_colors[CPU_SOFTIRQ] = ColorPair(Blue,White);
- CRT_colors[CPU_STEAL] = ColorPair(Cyan,White);
- CRT_colors[CPU_GUEST] = ColorPair(Cyan,White);
- } else if (CRT_colorScheme == COLORSCHEME_BLACKONWHITE2) {
- CRT_colors[RESET_COLOR] = ColorPair(Black,Black);
- CRT_colors[DEFAULT_COLOR] = ColorPair(Black,Black);
- CRT_colors[FUNCTION_BAR] = ColorPair(Black,Cyan);
- CRT_colors[FUNCTION_KEY] = ColorPair(Black,Black);
- CRT_colors[PANEL_HEADER_FOCUS] = ColorPair(Black,Green);
- CRT_colors[PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green);
- CRT_colors[PANEL_HIGHLIGHT_FOCUS] = ColorPair(Black,Cyan);
- CRT_colors[PANEL_HIGHLIGHT_UNFOCUS] = ColorPair(Blue,Black);
- CRT_colors[FAILED_SEARCH] = ColorPair(Red,Cyan);
- CRT_colors[UPTIME] = ColorPair(Yellow,Black);
- CRT_colors[BATTERY] = ColorPair(Yellow,Black);
- CRT_colors[LARGE_NUMBER] = ColorPair(Red,Black);
- CRT_colors[METER_TEXT] = ColorPair(Blue,Black);
- CRT_colors[METER_VALUE] = ColorPair(Black,Black);
- CRT_colors[LED_COLOR] = ColorPair(Green,Black);
- CRT_colors[TASKS_RUNNING] = ColorPair(Green,Black);
- CRT_colors[PROCESS] = ColorPair(Black,Black);
- CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black);
- CRT_colors[PROCESS_TAG] = ColorPair(White,Blue);
- CRT_colors[PROCESS_MEGABYTES] = ColorPair(Blue,Black);
- CRT_colors[PROCESS_BASENAME] = ColorPair(Green,Black);
- CRT_colors[PROCESS_TREE] = ColorPair(Blue,Black);
- CRT_colors[PROCESS_R_STATE] = ColorPair(Green,Black);
- CRT_colors[PROCESS_HIGH_PRIORITY] = ColorPair(Red,Black);
- CRT_colors[PROCESS_LOW_PRIORITY] = ColorPair(Red,Black);
- CRT_colors[PROCESS_THREAD] = ColorPair(Blue,Black);
- CRT_colors[PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue,Black);
- CRT_colors[BAR_BORDER] = ColorPair(Blue,Black);
- CRT_colors[BAR_SHADOW] = ColorPair(Black,Black);
- CRT_colors[SWAP] = ColorPair(Red,Black);
- CRT_colors[GRAPH_1] = ColorPair(Yellow,Black);
- CRT_colors[GRAPH_2] = ColorPair(Yellow,Black);
- CRT_colors[GRAPH_3] = ColorPair(Yellow,Black);
- CRT_colors[GRAPH_4] = ColorPair(Yellow,Black);
- CRT_colors[GRAPH_5] = ColorPair(Yellow,Black);
- CRT_colors[GRAPH_6] = ColorPair(Yellow,Black);
- CRT_colors[GRAPH_7] = ColorPair(Yellow,Black);
- CRT_colors[GRAPH_8] = ColorPair(Yellow,Black);
- CRT_colors[GRAPH_9] = ColorPair(Yellow,Black);
- CRT_colors[MEMORY_USED] = ColorPair(Green,Black);
- CRT_colors[MEMORY_BUFFERS] = ColorPair(Cyan,Black);
- CRT_colors[MEMORY_BUFFERS_TEXT] = ColorPair(Cyan,Black);
- CRT_colors[MEMORY_CACHE] = ColorPair(Yellow,Black);
- CRT_colors[LOAD_AVERAGE_FIFTEEN] = ColorPair(Black,Black);
- CRT_colors[LOAD_AVERAGE_FIVE] = ColorPair(Black,Black);
- CRT_colors[LOAD_AVERAGE_ONE] = ColorPair(Black,Black);
- CRT_colors[LOAD] = ColorPair(White,Black);
- CRT_colors[HELP_BOLD] = ColorPair(Blue,Black);
- CRT_colors[CLOCK] = ColorPair(White,Black);
- CRT_colors[CHECK_BOX] = ColorPair(Blue,Black);
- CRT_colors[CHECK_MARK] = ColorPair(Black,Black);
- CRT_colors[CHECK_TEXT] = ColorPair(Black,Black);
- CRT_colors[HOSTNAME] = ColorPair(White,Black);
- CRT_colors[CPU_NICE] = ColorPair(Cyan,Black);
- CRT_colors[CPU_NICE_TEXT] = ColorPair(Cyan,Black);
- CRT_colors[CPU_NORMAL] = ColorPair(Green,Black);
- CRT_colors[CPU_KERNEL] = ColorPair(Red,Black);
- CRT_colors[CPU_IOWAIT] = A_BOLD | ColorPair(Black, Black);
- CRT_colors[CPU_IRQ] = A_BOLD | ColorPair(Blue,Black);
- CRT_colors[CPU_SOFTIRQ] = ColorPair(Blue,Black);
- CRT_colors[CPU_STEAL] = ColorPair(Black,Black);
- CRT_colors[CPU_GUEST] = ColorPair(Black,Black);
- } else if (CRT_colorScheme == COLORSCHEME_MIDNIGHT) {
- CRT_colors[RESET_COLOR] = ColorPair(White,Blue);
- CRT_colors[DEFAULT_COLOR] = ColorPair(White,Blue);
- CRT_colors[FUNCTION_BAR] = ColorPair(Black,Cyan);
- CRT_colors[FUNCTION_KEY] = A_NORMAL;
- CRT_colors[PANEL_HEADER_FOCUS] = ColorPair(Black,Cyan);
- CRT_colors[PANEL_HEADER_UNFOCUS] = ColorPair(Black,Cyan);
- CRT_colors[PANEL_HIGHLIGHT_FOCUS] = ColorPair(Black,White);
- CRT_colors[PANEL_HIGHLIGHT_UNFOCUS] = A_BOLD | ColorPair(Yellow,Blue);
- CRT_colors[FAILED_SEARCH] = ColorPair(Red,Cyan);
- CRT_colors[UPTIME] = A_BOLD | ColorPair(Yellow,Blue);
- CRT_colors[BATTERY] = A_BOLD | ColorPair(Yellow,Blue);
- CRT_colors[LARGE_NUMBER] = A_BOLD | ColorPair(Red,Blue);
- CRT_colors[METER_TEXT] = ColorPair(Cyan,Blue);
- CRT_colors[METER_VALUE] = A_BOLD | ColorPair(Cyan,Blue);
- CRT_colors[LED_COLOR] = ColorPair(Green,Blue);
- CRT_colors[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Blue);
- CRT_colors[PROCESS] = ColorPair(White,Blue);
- CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Blue);
- CRT_colors[PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Blue);
- CRT_colors[PROCESS_MEGABYTES] = ColorPair(Cyan,Blue);
- CRT_colors[PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan,Blue);
- CRT_colors[PROCESS_TREE] = ColorPair(Cyan,Blue);
- CRT_colors[PROCESS_R_STATE] = ColorPair(Green,Blue);
- CRT_colors[PROCESS_HIGH_PRIORITY] = ColorPair(Red,Blue);
- CRT_colors[PROCESS_LOW_PRIORITY] = ColorPair(Red,Blue);
- CRT_colors[PROCESS_THREAD] = ColorPair(Green,Blue);
- CRT_colors[PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green,Blue);
- CRT_colors[BAR_BORDER] = A_BOLD | ColorPair(Yellow,Blue);
- CRT_colors[BAR_SHADOW] = ColorPair(Cyan,Blue);
- CRT_colors[SWAP] = ColorPair(Red,Blue);
- CRT_colors[GRAPH_1] = A_BOLD | ColorPair(Yellow,Blue);
- CRT_colors[GRAPH_2] = A_BOLD | ColorPair(Yellow,Blue);
- CRT_colors[GRAPH_3] = A_BOLD | ColorPair(Yellow,Blue);
- CRT_colors[GRAPH_4] = A_BOLD | ColorPair(Yellow,Blue);
- CRT_colors[GRAPH_5] = A_BOLD | ColorPair(Yellow,Blue);
- CRT_colors[GRAPH_6] = A_BOLD | ColorPair(Yellow,Blue);
- CRT_colors[GRAPH_7] = A_BOLD | ColorPair(Yellow,Blue);
- CRT_colors[GRAPH_8] = A_BOLD | ColorPair(Yellow,Blue);
- CRT_colors[GRAPH_9] = A_BOLD | ColorPair(Yellow,Blue);
- CRT_colors[MEMORY_USED] = A_BOLD | ColorPair(Green,Blue);
- CRT_colors[MEMORY_BUFFERS] = A_BOLD | ColorPair(Cyan,Blue);
- CRT_colors[MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Cyan,Blue);
- CRT_colors[MEMORY_CACHE] = A_BOLD | ColorPair(Yellow,Blue);
- CRT_colors[LOAD_AVERAGE_FIFTEEN] = A_BOLD | ColorPair(Black,Blue);
- CRT_colors[LOAD_AVERAGE_FIVE] = A_NORMAL | ColorPair(White,Blue);
- CRT_colors[LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(White,Blue);
- CRT_colors[LOAD] = A_BOLD | ColorPair(White,Blue);
- CRT_colors[HELP_BOLD] = A_BOLD | ColorPair(Cyan,Blue);
- CRT_colors[CLOCK] = ColorPair(White,Blue);
- CRT_colors[CHECK_BOX] = ColorPair(Cyan,Blue);
- CRT_colors[CHECK_MARK] = A_BOLD | ColorPair(White,Blue);
- CRT_colors[CHECK_TEXT] = A_NORMAL | ColorPair(White,Blue);
- CRT_colors[HOSTNAME] = ColorPair(White,Blue);
- CRT_colors[CPU_NICE] = A_BOLD | ColorPair(Cyan,Blue);
- CRT_colors[CPU_NICE_TEXT] = A_BOLD | ColorPair(Cyan,Blue);
- CRT_colors[CPU_NORMAL] = A_BOLD | ColorPair(Green,Blue);
- CRT_colors[CPU_KERNEL] = A_BOLD | ColorPair(Red,Blue);
- CRT_colors[CPU_IOWAIT] = A_BOLD | ColorPair(Blue,Blue);
- CRT_colors[CPU_IRQ] = A_BOLD | ColorPair(Black,Blue);
- CRT_colors[CPU_SOFTIRQ] = ColorPair(Black,Blue);
- CRT_colors[CPU_STEAL] = ColorPair(White,Blue);
- CRT_colors[CPU_GUEST] = ColorPair(White,Blue);
- } else if (CRT_colorScheme == COLORSCHEME_BLACKNIGHT) {
- CRT_colors[RESET_COLOR] = ColorPair(Cyan,Black);
- CRT_colors[DEFAULT_COLOR] = ColorPair(Cyan,Black);
- CRT_colors[FUNCTION_BAR] = ColorPair(Black,Green);
- CRT_colors[FUNCTION_KEY] = ColorPair(Cyan,Black);
- CRT_colors[PANEL_HEADER_FOCUS] = ColorPair(Black,Green);
- CRT_colors[PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green);
- CRT_colors[PANEL_HIGHLIGHT_FOCUS] = ColorPair(Black,Cyan);
- CRT_colors[PANEL_HIGHLIGHT_UNFOCUS] = ColorPair(Black,White);
- CRT_colors[FAILED_SEARCH] = ColorPair(Red,Cyan);
- CRT_colors[UPTIME] = ColorPair(Green,Black);
- CRT_colors[BATTERY] = ColorPair(Green,Black);
- CRT_colors[LARGE_NUMBER] = A_BOLD | ColorPair(Red,Black);
- CRT_colors[METER_TEXT] = ColorPair(Cyan,Black);
- CRT_colors[METER_VALUE] = ColorPair(Green,Black);
- CRT_colors[LED_COLOR] = ColorPair(Green,Black);
- CRT_colors[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black);
- CRT_colors[PROCESS] = ColorPair(Cyan,Black);
- CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black);
- CRT_colors[PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black);
- CRT_colors[PROCESS_MEGABYTES] = A_BOLD | ColorPair(Green,Black);
- CRT_colors[PROCESS_BASENAME] = A_BOLD | ColorPair(Green,Black);
- CRT_colors[PROCESS_TREE] = ColorPair(Cyan,Black);
- CRT_colors[PROCESS_THREAD] = ColorPair(Green,Black);
- CRT_colors[PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Blue,Black);
- CRT_colors[PROCESS_R_STATE] = ColorPair(Green,Black);
- CRT_colors[PROCESS_HIGH_PRIORITY] = ColorPair(Red,Black);
- CRT_colors[PROCESS_LOW_PRIORITY] = ColorPair(Red,Black);
- CRT_colors[BAR_BORDER] = A_BOLD | ColorPair(Green,Black);
- CRT_colors[BAR_SHADOW] = ColorPair(Cyan,Black);
- CRT_colors[SWAP] = ColorPair(Red,Black);
- CRT_colors[GRAPH_1] = A_BOLD | ColorPair(Red,Black);
- CRT_colors[GRAPH_2] = ColorPair(Red,Black);
- CRT_colors[GRAPH_3] = A_BOLD | ColorPair(Yellow,Black);
- CRT_colors[GRAPH_4] = A_BOLD | ColorPair(Green,Black);
- CRT_colors[GRAPH_5] = ColorPair(Green,Black);
- CRT_colors[GRAPH_6] = ColorPair(Cyan,Black);
- CRT_colors[GRAPH_7] = A_BOLD | ColorPair(Blue,Black);
- CRT_colors[GRAPH_8] = ColorPair(Blue,Black);
- CRT_colors[GRAPH_9] = A_BOLD | ColorPair(Black,Black);
- CRT_colors[MEMORY_USED] = ColorPair(Green,Black);
- CRT_colors[MEMORY_BUFFERS] = ColorPair(Blue,Black);
- CRT_colors[MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Blue,Black);
- CRT_colors[MEMORY_CACHE] = ColorPair(Yellow,Black);
- CRT_colors[LOAD_AVERAGE_FIFTEEN] = ColorPair(Green,Black);
- CRT_colors[LOAD_AVERAGE_FIVE] = ColorPair(Green,Black);
- CRT_colors[LOAD_AVERAGE_ONE] = A_BOLD | ColorPair(Green,Black);
- CRT_colors[LOAD] = A_BOLD;
- CRT_colors[HELP_BOLD] = A_BOLD | ColorPair(Cyan,Black);
- CRT_colors[CLOCK] = ColorPair(Green,Black);
- CRT_colors[CHECK_BOX] = ColorPair(Green,Black);
- CRT_colors[CHECK_MARK] = A_BOLD | ColorPair(Green,Black);
- CRT_colors[CHECK_TEXT] = ColorPair(Cyan,Black);
- CRT_colors[HOSTNAME] = ColorPair(Green,Black);
- CRT_colors[CPU_NICE] = ColorPair(Blue,Black);
- CRT_colors[CPU_NICE_TEXT] = A_BOLD | ColorPair(Blue,Black);
- CRT_colors[CPU_NORMAL] = ColorPair(Green,Black);
- CRT_colors[CPU_KERNEL] = ColorPair(Red,Black);
- CRT_colors[CPU_IOWAIT] = ColorPair(Yellow,Black);
- CRT_colors[CPU_IRQ] = A_BOLD | ColorPair(Blue,Black);
- CRT_colors[CPU_SOFTIRQ] = ColorPair(Blue,Black);
- CRT_colors[CPU_STEAL] = ColorPair(Cyan,Black);
- CRT_colors[CPU_GUEST] = ColorPair(Cyan,Black);
- } else {
- /* Default */
- CRT_colors[RESET_COLOR] = ColorPair(White,Black);
- CRT_colors[DEFAULT_COLOR] = ColorPair(White,Black);
- CRT_colors[FUNCTION_BAR] = ColorPair(Black,Cyan);
- CRT_colors[FUNCTION_KEY] = ColorPair(White,Black);
- CRT_colors[PANEL_HEADER_FOCUS] = ColorPair(Black,Green);
- CRT_colors[PANEL_HEADER_UNFOCUS] = ColorPair(Black,Green);
- CRT_colors[PANEL_HIGHLIGHT_FOCUS] = ColorPair(Black,Cyan);
- CRT_colors[PANEL_HIGHLIGHT_UNFOCUS] = ColorPair(Black,White);
- CRT_colors[FAILED_SEARCH] = ColorPair(Red,Cyan);
- CRT_colors[UPTIME] = A_BOLD | ColorPair(Cyan,Black);
- CRT_colors[BATTERY] = A_BOLD | ColorPair(Cyan,Black);
- CRT_colors[LARGE_NUMBER] = A_BOLD | ColorPair(Red,Black);
- CRT_colors[METER_TEXT] = ColorPair(Cyan,Black);
- CRT_colors[METER_VALUE] = A_BOLD | ColorPair(Cyan,Black);
- CRT_colors[LED_COLOR] = ColorPair(Green,Black);
- CRT_colors[TASKS_RUNNING] = A_BOLD | ColorPair(Green,Black);
- CRT_colors[PROCESS] = A_NORMAL;
- CRT_colors[PROCESS_SHADOW] = A_BOLD | ColorPair(Black,Black);
- CRT_colors[PROCESS_TAG] = A_BOLD | ColorPair(Yellow,Black);
- CRT_colors[PROCESS_MEGABYTES] = ColorPair(Cyan,Black);
- CRT_colors[PROCESS_BASENAME] = A_BOLD | ColorPair(Cyan,Black);
- CRT_colors[PROCESS_TREE] = ColorPair(Cyan,Black);
- CRT_colors[PROCESS_R_STATE] = ColorPair(Green,Black);
- CRT_colors[PROCESS_HIGH_PRIORITY] = ColorPair(Red,Black);
- CRT_colors[PROCESS_LOW_PRIORITY] = ColorPair(Red,Black);
- CRT_colors[PROCESS_THREAD] = ColorPair(Green,Black);
- CRT_colors[PROCESS_THREAD_BASENAME] = A_BOLD | ColorPair(Green,Black);
- CRT_colors[BAR_BORDER] = A_BOLD;
- CRT_colors[BAR_SHADOW] = A_BOLD | ColorPair(Black,Black);
- CRT_colors[SWAP] = ColorPair(Red,Black);
- CRT_colors[GRAPH_1] = A_BOLD | ColorPair(Red,Black);
- CRT_colors[GRAPH_2] = ColorPair(Red,Black);
- CRT_colors[GRAPH_3] = A_BOLD | ColorPair(Yellow,Black);
- CRT_colors[GRAPH_4] = A_BOLD | ColorPair(Green,Black);
- CRT_colors[GRAPH_5] = ColorPair(Green,Black);
- CRT_colors[GRAPH_6] = ColorPair(Cyan,Black);
- CRT_colors[GRAPH_7] = A_BOLD | ColorPair(Blue,Black);
- CRT_colors[GRAPH_8] = ColorPair(Blue,Black);
- CRT_colors[GRAPH_9] = A_BOLD | ColorPair(Black,Black);
- CRT_colors[MEMORY_USED] = ColorPair(Green,Black);
- CRT_colors[MEMORY_BUFFERS] = ColorPair(Blue,Black);
- CRT_colors[MEMORY_BUFFERS_TEXT] = A_BOLD | ColorPair(Blue,Black);
- CRT_colors[MEMORY_CACHE] = ColorPair(Yellow,Black);
- CRT_colors[LOAD_AVERAGE_FIFTEEN] = A_BOLD | ColorPair(Black,Black);
- CRT_colors[LOAD_AVERAGE_FIVE] = A_NORMAL;
- CRT_colors[LOAD_AVERAGE_ONE] = A_BOLD;
- CRT_colors[LOAD] = A_BOLD;
- CRT_colors[HELP_BOLD] = A_BOLD | ColorPair(Cyan,Black);
- CRT_colors[CLOCK] = A_BOLD;
- CRT_colors[CHECK_BOX] = ColorPair(Cyan,Black);
- CRT_colors[CHECK_MARK] = A_BOLD;
- CRT_colors[CHECK_TEXT] = A_NORMAL;
- CRT_colors[HOSTNAME] = A_BOLD;
- CRT_colors[CPU_NICE] = ColorPair(Blue,Black);
- CRT_colors[CPU_NICE_TEXT] = A_BOLD | ColorPair(Blue,Black);
- CRT_colors[CPU_NORMAL] = ColorPair(Green,Black);
- CRT_colors[CPU_KERNEL] = ColorPair(Red,Black);
- CRT_colors[CPU_IOWAIT] = A_BOLD | ColorPair(Black, Black);
- CRT_colors[CPU_IRQ] = ColorPair(Yellow,Black);
- CRT_colors[CPU_SOFTIRQ] = ColorPair(Magenta,Black);
- CRT_colors[CPU_STEAL] = ColorPair(Cyan,Black);
- CRT_colors[CPU_GUEST] = ColorPair(Cyan,Black);
- }
+ CRT_colors = CRT_colorSchemes[colorScheme];
}
diff --git a/CRT.h b/CRT.h
index 883c675..5aac217 100644
--- a/CRT.h
+++ b/CRT.h
@@ -9,18 +9,8 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
-#ifdef HAVE_EXECINFO_H
-#endif
-
#define ColorPair(i,j) COLOR_PAIR((7-i)*8+j)
-#define COLORSCHEME_DEFAULT 0
-#define COLORSCHEME_MONOCHROME 1
-#define COLORSCHEME_BLACKONWHITE 2
-#define COLORSCHEME_BLACKONWHITE2 3
-#define COLORSCHEME_MIDNIGHT 4
-#define COLORSCHEME_BLACKNIGHT 5
-
#define Black COLOR_BLACK
#define Red COLOR_RED
#define Green COLOR_GREEN
@@ -30,10 +20,36 @@ in the source distribution for its full text.
#define Cyan COLOR_CYAN
#define White COLOR_WHITE
+#define KEY_WHEELUP KEY_F(20)
+#define KEY_WHEELDOWN KEY_F(21)
+#define KEY_RECLICK KEY_F(22)
+
//#link curses
#include <stdbool.h>
+typedef enum TreeStr_ {
+ TREE_STR_HORZ,
+ TREE_STR_VERT,
+ TREE_STR_RTEE,
+ TREE_STR_BEND,
+ TREE_STR_TEND,
+ TREE_STR_OPEN,
+ TREE_STR_SHUT,
+ TREE_STR_COUNT
+} TreeStr;
+
+typedef enum ColorSchemes_ {
+ COLORSCHEME_DEFAULT = 0,
+ COLORSCHEME_MONOCHROME = 1,
+ COLORSCHEME_BLACKONWHITE = 2,
+ COLORSCHEME_LIGHTTERMINAL = 3,
+ COLORSCHEME_MIDNIGHT = 4,
+ COLORSCHEME_BLACKNIGHT = 5,
+ COLORSCHEME_BROKENGRAY = 6,
+ LAST_COLORSCHEME = 7,
+} ColorSchemes;
+
typedef enum ColorElements_ {
RESET_COLOR,
DEFAULT_COLOR,
@@ -42,8 +58,9 @@ typedef enum ColorElements_ {
FAILED_SEARCH,
PANEL_HEADER_FOCUS,
PANEL_HEADER_UNFOCUS,
- PANEL_HIGHLIGHT_FOCUS,
- PANEL_HIGHLIGHT_UNFOCUS,
+ PANEL_SELECTION_FOCUS,
+ PANEL_SELECTION_FOLLOW,
+ PANEL_SELECTION_UNFOCUS,
LARGE_NUMBER,
METER_TEXT,
METER_VALUE,
@@ -58,6 +75,7 @@ typedef enum ColorElements_ {
PROCESS_MEGABYTES,
PROCESS_TREE,
PROCESS_R_STATE,
+ PROCESS_D_STATE,
PROCESS_BASENAME,
PROCESS_HIGH_PRIORITY,
PROCESS_LOW_PRIORITY,
@@ -67,13 +85,6 @@ typedef enum ColorElements_ {
BAR_SHADOW,
GRAPH_1,
GRAPH_2,
- GRAPH_3,
- GRAPH_4,
- GRAPH_5,
- GRAPH_6,
- GRAPH_7,
- GRAPH_8,
- GRAPH_9,
MEMORY_USED,
MEMORY_BUFFERS,
MEMORY_BUFFERS_TEXT,
@@ -102,21 +113,39 @@ typedef enum ColorElements_ {
void CRT_fatalError(const char* note) __attribute__ ((noreturn));
+void CRT_handleSIGSEGV(int sgn);
-// TODO: centralize these in Settings.
-extern int CRT_colorScheme;
+extern const char *CRT_treeStrAscii[TREE_STR_COUNT];
+
+#ifdef HAVE_LIBNCURSESW
+
+extern const char *CRT_treeStrUtf8[TREE_STR_COUNT];
extern bool CRT_utf8;
-extern int CRT_colors[LAST_COLORELEMENT];
+#endif
+
+extern const char **CRT_treeStr;
+
+extern int CRT_delay;
+
+int* CRT_colors;
+
+extern int CRT_colorSchemes[LAST_COLORSCHEME][LAST_COLORELEMENT];
extern int CRT_cursorX;
extern int CRT_scrollHAmount;
+extern int CRT_scrollWheelVAmount;
+
char* CRT_termType;
+// TODO move color scheme to Settings, perhaps?
+
+extern int CRT_colorScheme;
+
void *backtraceArray[128];
// TODO: pass an instance of Settings instead.
diff --git a/CategoriesPanel.c b/CategoriesPanel.c
index bf6ee54..d67be86 100644
--- a/CategoriesPanel.c
+++ b/CategoriesPanel.c
@@ -21,27 +21,20 @@ in the source distribution for its full text.
#include "Panel.h"
#include "Settings.h"
#include "ScreenManager.h"
+#include "ProcessList.h"
typedef struct CategoriesPanel_ {
Panel super;
+ ScreenManager* scr;
Settings* settings;
- ScreenManager* scr;
+ Header* header;
+ ProcessList* pl;
} CategoriesPanel;
}*/
-static const char* MetersFunctions[] = {" ", " ", " ", "Type ", " ", " ", "MoveUp", "MoveDn", "Remove", "Done ", NULL};
-
-static const char* AvailableMetersFunctions[] = {" ", " ", " ", " ", "Add L ", "Add R ", " ", " ", " ", "Done ", NULL};
-
-static const char* DisplayOptionsFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL};
-
-static const char* ColumnsFunctions[] = {" ", " ", " ", " ", " ", " ", "MoveUp", "MoveDn", "Remove", "Done ", NULL};
-
-static const char* ColorsFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL};
-
-static const char* AvailableColumnsFunctions[] = {" ", " ", " ", " ", "Add ", " ", " ", " ", " ", "Done ", NULL};
+static const char* CategoriesFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL};
static void CategoriesPanel_delete(Object* object) {
Panel* super = (Panel*) object;
@@ -51,29 +44,31 @@ static void CategoriesPanel_delete(Object* object) {
}
void CategoriesPanel_makeMetersPage(CategoriesPanel* this) {
- Panel* leftMeters = (Panel*) MetersPanel_new(this->settings, "Left column", this->settings->header->leftMeters, this->scr);
- Panel* rightMeters = (Panel*) MetersPanel_new(this->settings, "Right column", this->settings->header->rightMeters, this->scr);
- Panel* availableMeters = (Panel*) AvailableMetersPanel_new(this->settings, leftMeters, rightMeters, this->scr);
- ScreenManager_add(this->scr, leftMeters, FunctionBar_new(MetersFunctions, NULL, NULL), 20);
- ScreenManager_add(this->scr, rightMeters, FunctionBar_new(MetersFunctions, NULL, NULL), 20);
- ScreenManager_add(this->scr, availableMeters, FunctionBar_new(AvailableMetersFunctions, NULL, NULL), -1);
+ MetersPanel* leftMeters = MetersPanel_new(this->settings, "Left column", this->header->columns[0], this->scr);
+ MetersPanel* rightMeters = MetersPanel_new(this->settings, "Right column", this->header->columns[1], this->scr);
+ leftMeters->rightNeighbor = rightMeters;
+ rightMeters->leftNeighbor = leftMeters;
+ Panel* availableMeters = (Panel*) AvailableMetersPanel_new(this->settings, this->header, (Panel*) leftMeters, (Panel*) rightMeters, this->scr, this->pl);
+ ScreenManager_add(this->scr, (Panel*) leftMeters, 20);
+ ScreenManager_add(this->scr, (Panel*) rightMeters, 20);
+ ScreenManager_add(this->scr, availableMeters, -1);
}
static void CategoriesPanel_makeDisplayOptionsPage(CategoriesPanel* this) {
Panel* displayOptions = (Panel*) DisplayOptionsPanel_new(this->settings, this->scr);
- ScreenManager_add(this->scr, displayOptions, FunctionBar_new(DisplayOptionsFunctions, NULL, NULL), -1);
+ ScreenManager_add(this->scr, displayOptions, -1);
}
static void CategoriesPanel_makeColorsPage(CategoriesPanel* this) {
Panel* colors = (Panel*) ColorsPanel_new(this->settings, this->scr);
- ScreenManager_add(this->scr, colors, FunctionBar_new(ColorsFunctions, NULL, NULL), -1);
+ ScreenManager_add(this->scr, colors, -1);
}
static void CategoriesPanel_makeColumnsPage(CategoriesPanel* this) {
- Panel* columns = (Panel*) ColumnsPanel_new(this->settings, this->scr);
- Panel* availableColumns = (Panel*) AvailableColumnsPanel_new(this->settings, columns, this->scr);
- ScreenManager_add(this->scr, columns, FunctionBar_new(ColumnsFunctions, NULL, NULL), 20);
- ScreenManager_add(this->scr, availableColumns, FunctionBar_new(AvailableColumnsFunctions, NULL, NULL), -1);
+ Panel* columns = (Panel*) ColumnsPanel_new(this->settings);
+ Panel* availableColumns = (Panel*) AvailableColumnsPanel_new(columns);
+ ScreenManager_add(this->scr, columns, 20);
+ ScreenManager_add(this->scr, availableColumns, -1);
}
static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) {
@@ -83,7 +78,7 @@ static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) {
int selected = Panel_getSelectedIndex(super);
switch (ch) {
- case EVENT_SETSELECTED:
+ case EVENT_SET_SELECTED:
result = HANDLED;
break;
case KEY_UP:
@@ -102,13 +97,12 @@ static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) {
break;
}
default:
- if (isalpha(ch))
+ if (ch < 255 && isalpha(ch))
result = Panel_selectByTyping(super, ch);
if (result == BREAK_LOOP)
result = IGNORED;
break;
}
-
if (result == HANDLED) {
int size = ScreenManager_size(this->scr);
for (int i = 1; i < size; i++)
@@ -128,7 +122,6 @@ static HandlerResult CategoriesPanel_eventHandler(Panel* super, int ch) {
break;
}
}
-
return result;
}
@@ -140,13 +133,16 @@ PanelClass CategoriesPanel_class = {
.eventHandler = CategoriesPanel_eventHandler
};
-CategoriesPanel* CategoriesPanel_new(Settings* settings, ScreenManager* scr) {
+CategoriesPanel* CategoriesPanel_new(ScreenManager* scr, Settings* settings, Header* header, ProcessList* pl) {
CategoriesPanel* this = AllocThis(CategoriesPanel);
Panel* super = (Panel*) this;
- Panel_init(super, 1, 1, 1, 1, Class(ListItem), true);
+ FunctionBar* fuBar = FunctionBar_new(CategoriesFunctions, NULL, NULL);
+ Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar);
- this->settings = settings;
this->scr = scr;
+ this->settings = settings;
+ this->header = header;
+ this->pl = pl;
Panel_setHeader(super, "Setup");
Panel_add(super, (Object*) ListItem_new("Meters", 0));
Panel_add(super, (Object*) ListItem_new("Display options", 0));
diff --git a/CategoriesPanel.h b/CategoriesPanel.h
index 9d30330..ccef0fa 100644
--- a/CategoriesPanel.h
+++ b/CategoriesPanel.h
@@ -12,12 +12,15 @@ in the source distribution for its full text.
#include "Panel.h"
#include "Settings.h"
#include "ScreenManager.h"
+#include "ProcessList.h"
typedef struct CategoriesPanel_ {
Panel super;
+ ScreenManager* scr;
Settings* settings;
- ScreenManager* scr;
+ Header* header;
+ ProcessList* pl;
} CategoriesPanel;
@@ -25,6 +28,6 @@ void CategoriesPanel_makeMetersPage(CategoriesPanel* this);
extern PanelClass CategoriesPanel_class;
-CategoriesPanel* CategoriesPanel_new(Settings* settings, ScreenManager* scr);
+CategoriesPanel* CategoriesPanel_new(ScreenManager* scr, Settings* settings, Header* header, ProcessList* pl);
#endif
diff --git a/ChangeLog b/ChangeLog
index 1aafc65..1bb2057 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,34 @@
+What's new in version 2.0.0
+
+* Platform abstraction layer
+* Initial FreeBSD support
+* Initial Mac OS X support
+ (thanks to David Hunt)
+* Swap meter for Mac OSX
+ (thanks to Ștefan Rusu)
+* OpenBSD port
+ (thanks to Michael McConville)
+* FreeBSD support improvements
+ (thanks to Martin Misuth)
+* Support for NCurses 6 ABI, including mouse wheel support
+* Much improved mouse responsiveness
+* Process environment variables screen
+ (thanks to Michael Klein)
+* Higher-resolution UTF-8 based Graph mode
+ (Thanks to James Hall from vtop for the idea!)
+* Show program path settings
+ (thanks to Tobias Geerinckx-Rice)
+* BUGFIX: Fix crash when scrolling an empty filtered list.
+* Use dynamic units for text display, and several fixes
+ (thanks to Christian Hesse)
+* BUGFIX: fix error caused by overflow in usertime calculation.
+ (thanks to Patrick Marlier)
+* Catch all memory allocation errors
+ (thanks to Michael McConville for the push)
+* Several tweaks and bugfixes
+ (See the Git log for details and contributors!)
+
What's new in version 1.0.3
* Tag all children ('c' key)
diff --git a/CheckItem.c b/CheckItem.c
index ea83e6f..b7ba6fe 100644
--- a/CheckItem.c
+++ b/CheckItem.c
@@ -49,14 +49,22 @@ ObjectClass CheckItem_class = {
.delete = CheckItem_delete
};
-CheckItem* CheckItem_new(char* text, bool* ref, bool value) {
+CheckItem* CheckItem_newByRef(char* text, bool* ref) {
CheckItem* this = AllocThis(CheckItem);
this->text = text;
- this->value = value;
+ this->value = false;
this->ref = ref;
return this;
}
+CheckItem* CheckItem_newByVal(char* text, bool value) {
+ CheckItem* this = AllocThis(CheckItem);
+ this->text = text;
+ this->value = value;
+ this->ref = NULL;
+ return this;
+}
+
void CheckItem_set(CheckItem* this, bool value) {
if (this->ref)
*(this->ref) = value;
diff --git a/CheckItem.h b/CheckItem.h
index 86d4aa5..5847d4b 100644
--- a/CheckItem.h
+++ b/CheckItem.h
@@ -21,7 +21,9 @@ typedef struct CheckItem_ {
extern ObjectClass CheckItem_class;
-CheckItem* CheckItem_new(char* text, bool* ref, bool value);
+CheckItem* CheckItem_newByRef(char* text, bool* ref);
+
+CheckItem* CheckItem_newByVal(char* text, bool value);
void CheckItem_set(CheckItem* this, bool value);
diff --git a/ClockMeter.c b/ClockMeter.c
index 25a1e2e..d702aa5 100644
--- a/ClockMeter.c
+++ b/ClockMeter.c
@@ -34,7 +34,7 @@ MeterClass ClockMeter_class = {
},
.setValues = ClockMeter_setValues,
.defaultMode = TEXT_METERMODE,
- .total = 100.0,
+ .total = 1440, /* 24*60 */
.attributes = ClockMeter_attributes,
.name = "Clock",
.uiName = "Clock",
diff --git a/ColorsPanel.c b/ColorsPanel.c
index 4e28d01..96199c1 100644
--- a/ColorsPanel.c
+++ b/ColorsPanel.c
@@ -16,7 +16,7 @@ in the source distribution for its full text.
// TO ADD A NEW SCHEME:
// * Increment the size of bool check in ColorsPanel.h
-// * Add the entry in the ColorSchemes array below in the file
+// * Add the entry in the ColorSchemeNames array below in the file
// * Add a define in CRT.h that matches the order of the array
// * Add the colors in CRT_setColors
@@ -34,13 +34,16 @@ typedef struct ColorsPanel_ {
}*/
-static const char* ColorSchemes[] = {
+static const char* ColorsFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL};
+
+static const char* ColorSchemeNames[] = {
"Default",
"Monochromatic",
"Black on White",
"Light Terminal",
"MC",
"Black Night",
+ "Broken Gray",
NULL
};
@@ -62,8 +65,9 @@ static HandlerResult ColorsPanel_eventHandler(Panel* super, int ch) {
case 0x0d:
case KEY_ENTER:
case KEY_MOUSE:
+ case KEY_RECLICK:
case ' ':
- for (int i = 0; ColorSchemes[i] != NULL; i++)
+ for (int i = 0; ColorSchemeNames[i] != NULL; i++)
CheckItem_set((CheckItem*)Panel_get(super, i), false);
CheckItem_set((CheckItem*)Panel_get(super, mark), true);
this->settings->colorScheme = mark;
@@ -72,7 +76,7 @@ static HandlerResult ColorsPanel_eventHandler(Panel* super, int ch) {
if (result == HANDLED) {
this->settings->changed = true;
- Header* header = this->settings->header;
+ const Header* header = this->scr->header;
CRT_setColors(mark);
Panel* menu = (Panel*) Vector_get(this->scr->panels, 0);
Header_draw(header);
@@ -94,14 +98,15 @@ PanelClass ColorsPanel_class = {
ColorsPanel* ColorsPanel_new(Settings* settings, ScreenManager* scr) {
ColorsPanel* this = AllocThis(ColorsPanel);
Panel* super = (Panel*) this;
- Panel_init(super, 1, 1, 1, 1, Class(CheckItem), true);
+ FunctionBar* fuBar = FunctionBar_new(ColorsFunctions, NULL, NULL);
+ Panel_init(super, 1, 1, 1, 1, Class(CheckItem), true, fuBar);
this->settings = settings;
this->scr = scr;
Panel_setHeader(super, "Colors");
- for (int i = 0; ColorSchemes[i] != NULL; i++) {
- Panel_add(super, (Object*) CheckItem_new(strdup(ColorSchemes[i]), NULL, false));
+ for (int i = 0; ColorSchemeNames[i] != NULL; i++) {
+ Panel_add(super, (Object*) CheckItem_newByVal(xStrdup(ColorSchemeNames[i]), false));
}
CheckItem_set((CheckItem*)Panel_get(super, settings->colorScheme), true);
return this;
diff --git a/ColorsPanel.h b/ColorsPanel.h
index 10dcb50..ee3111e 100644
--- a/ColorsPanel.h
+++ b/ColorsPanel.h
@@ -11,7 +11,7 @@ in the source distribution for its full text.
// TO ADD A NEW SCHEME:
// * Increment the size of bool check in ColorsPanel.h
-// * Add the entry in the ColorSchemes array below in the file
+// * Add the entry in the ColorSchemeNames array below in the file
// * Add a define in CRT.h that matches the order of the array
// * Add the colors in CRT_setColors
diff --git a/ColumnsPanel.c b/ColumnsPanel.c
index f4eed99..3ec9ee8 100644
--- a/ColumnsPanel.c
+++ b/ColumnsPanel.c
@@ -6,8 +6,11 @@ in the source distribution for its full text.
*/
#include "ColumnsPanel.h"
+#include "Platform.h"
-#include "String.h"
+#include "StringUtils.h"
+#include "ListItem.h"
+#include "CRT.h"
#include <assert.h>
#include <stdlib.h>
@@ -16,17 +19,18 @@ in the source distribution for its full text.
/*{
#include "Panel.h"
#include "Settings.h"
-#include "ScreenManager.h"
typedef struct ColumnsPanel_ {
Panel super;
Settings* settings;
- ScreenManager* scr;
+ bool moving;
} ColumnsPanel;
}*/
+static const char* ColumnsFunctions[] = {" ", " ", " ", " ", " ", " ", "MoveUp", "MoveDn", "Remove", "Done ", NULL};
+
static void ColumnsPanel_delete(Object* object) {
Panel* super = (Panel*) object;
ColumnsPanel* this = (ColumnsPanel*) object;
@@ -35,12 +39,34 @@ static void ColumnsPanel_delete(Object* object) {
}
static HandlerResult ColumnsPanel_eventHandler(Panel* super, int ch) {
+ ColumnsPanel* const this = (ColumnsPanel*) super;
int selected = Panel_getSelectedIndex(super);
HandlerResult result = IGNORED;
int size = Panel_size(super);
switch(ch) {
+ case 0x0a:
+ case 0x0d:
+ case KEY_ENTER:
+ case KEY_MOUSE:
+ case KEY_RECLICK:
+ {
+ if (selected < size - 1) {
+ this->moving = !(this->moving);
+ Panel_setSelectionColor(super, this->moving ? CRT_colors[PANEL_SELECTION_FOLLOW] : CRT_colors[PANEL_SELECTION_FOCUS]);
+ ((ListItem*)Panel_getSelected(super))->moving = this->moving;
+ result = HANDLED;
+ }
+ break;
+ }
+ case KEY_UP:
+ {
+ if (!this->moving) {
+ break;
+ }
+ /* else fallthrough */
+ }
case KEY_F(7):
case '[':
case '-':
@@ -50,6 +76,13 @@ static HandlerResult ColumnsPanel_eventHandler(Panel* super, int ch) {
result = HANDLED;
break;
}
+ case KEY_DOWN:
+ {
+ if (!this->moving) {
+ break;
+ }
+ /* else fallthrough */
+ }
case KEY_F(8):
case ']':
case '+':
@@ -70,7 +103,7 @@ static HandlerResult ColumnsPanel_eventHandler(Panel* super, int ch) {
}
default:
{
- if (isalpha(ch))
+ if (ch < 255 && isalpha(ch))
result = Panel_selectByTyping(super, ch);
if (result == BREAK_LOOP)
result = IGNORED;
@@ -90,47 +123,45 @@ PanelClass ColumnsPanel_class = {
.eventHandler = ColumnsPanel_eventHandler
};
-ColumnsPanel* ColumnsPanel_new(Settings* settings, ScreenManager* scr) {
+ColumnsPanel* ColumnsPanel_new(Settings* settings) {
ColumnsPanel* this = AllocThis(ColumnsPanel);
Panel* super = (Panel*) this;
- Panel_init(super, 1, 1, 1, 1, Class(ListItem), true);
+ FunctionBar* fuBar = FunctionBar_new(ColumnsFunctions, NULL, NULL);
+ Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar);
this->settings = settings;
- this->scr = scr;
+ this->moving = false;
Panel_setHeader(super, "Active Columns");
- ProcessField* fields = this->settings->pl->fields;
+ ProcessField* fields = this->settings->fields;
for (; *fields; fields++) {
- Panel_add(super, (Object*) ListItem_new(Process_fieldNames[*fields], 0));
+ if (Process_fields[*fields].name) {
+ Panel_add(super, (Object*) ListItem_new(Process_fields[*fields].name, *fields));
+ }
}
return this;
}
int ColumnsPanel_fieldNameToIndex(const char* name) {
- for (int j = 1; j <= LAST_PROCESSFIELD; j++) {
- if (String_eq(name, Process_fieldNames[j])) {
+ for (int j = 1; j <= Platform_numberOfFields; j++) {
+ if (String_eq(name, Process_fields[j].name)) {
return j;
}
}
- return 0;
+ return -1;
}
void ColumnsPanel_update(Panel* super) {
ColumnsPanel* this = (ColumnsPanel*) super;
int size = Panel_size(super);
this->settings->changed = true;
- // FIXME: this is crappily inefficient
- free(this->settings->pl->fields);
- this->settings->pl->fields = (ProcessField*) malloc(sizeof(ProcessField) * (size+1));
- this->settings->pl->flags = 0;
+ this->settings->fields = xRealloc(this->settings->fields, sizeof(ProcessField) * (size+1));
+ this->settings->flags = 0;
for (int i = 0; i < size; i++) {
- char* text = ((ListItem*) Panel_get(super, i))->value;
- int j = ColumnsPanel_fieldNameToIndex(text);
- if (j > 0) {
- this->settings->pl->fields[i] = j;
- this->settings->pl->flags |= Process_fieldFlags[j];
- }
+ int key = ((ListItem*) Panel_get(super, i))->key;
+ this->settings->fields[i] = key;
+ this->settings->flags |= Process_fields[key].flags;
}
- this->settings->pl->fields[size] = 0;
+ this->settings->fields[size] = 0;
}
diff --git a/ColumnsPanel.h b/ColumnsPanel.h
index 122d9f9..0da674a 100644
--- a/ColumnsPanel.h
+++ b/ColumnsPanel.h
@@ -11,19 +11,18 @@ in the source distribution for its full text.
#include "Panel.h"
#include "Settings.h"
-#include "ScreenManager.h"
typedef struct ColumnsPanel_ {
Panel super;
Settings* settings;
- ScreenManager* scr;
+ bool moving;
} ColumnsPanel;
extern PanelClass ColumnsPanel_class;
-ColumnsPanel* ColumnsPanel_new(Settings* settings, ScreenManager* scr);
+ColumnsPanel* ColumnsPanel_new(Settings* settings);
int ColumnsPanel_fieldNameToIndex(const char* name);
diff --git a/DisplayOptionsPanel.c b/DisplayOptionsPanel.c
index 6153313..0a32c44 100644
--- a/DisplayOptionsPanel.c
+++ b/DisplayOptionsPanel.c
@@ -8,6 +8,7 @@ in the source distribution for its full text.
#include "DisplayOptionsPanel.h"
#include "CheckItem.h"
+#include "CRT.h"
#include <assert.h>
#include <stdlib.h>
@@ -27,6 +28,8 @@ typedef struct DisplayOptionsPanel_ {
}*/
+static const char* DisplayOptionsFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL};
+
static void DisplayOptionsPanel_delete(Object* object) {
Panel* super = (Panel*) object;
DisplayOptionsPanel* this = (DisplayOptionsPanel*) object;
@@ -45,6 +48,7 @@ static HandlerResult DisplayOptionsPanel_eventHandler(Panel* super, int ch) {
case 0x0d:
case KEY_ENTER:
case KEY_MOUSE:
+ case KEY_RECLICK:
case ' ':
CheckItem_set(selected, ! (CheckItem_get(selected)) );
result = HANDLED;
@@ -52,9 +56,9 @@ static HandlerResult DisplayOptionsPanel_eventHandler(Panel* super, int ch) {
if (result == HANDLED) {
this->settings->changed = true;
- Header* header = this->settings->header;
- Header_calculateHeight(header);
- Header_reinit(header);
+ const Header* header = this->scr->header;
+ Header_calculateHeight((Header*) header);
+ Header_reinit((Header*) header);
Header_draw(header);
ScreenManager_resize(this->scr, this->scr->x1, header->height, this->scr->x2, this->scr->y2);
}
@@ -72,24 +76,26 @@ PanelClass DisplayOptionsPanel_class = {
DisplayOptionsPanel* DisplayOptionsPanel_new(Settings* settings, ScreenManager* scr) {
DisplayOptionsPanel* this = AllocThis(DisplayOptionsPanel);
Panel* super = (Panel*) this;
- Panel_init(super, 1, 1, 1, 1, Class(CheckItem), true);
+ FunctionBar* fuBar = FunctionBar_new(DisplayOptionsFunctions, NULL, NULL);
+ Panel_init(super, 1, 1, 1, 1, Class(CheckItem), true, fuBar);
this->settings = settings;
this->scr = scr;
Panel_setHeader(super, "Display options");
- Panel_add(super, (Object*) CheckItem_new(strdup("Tree view"), &(settings->pl->treeView), false));
- Panel_add(super, (Object*) CheckItem_new(strdup("Shadow other users' processes"), &(settings->pl->shadowOtherUsers), false));
- Panel_add(super, (Object*) CheckItem_new(strdup("Hide kernel threads"), &(settings->pl->hideKernelThreads), false));
- Panel_add(super, (Object*) CheckItem_new(strdup("Hide userland threads"), &(settings->pl->hideUserlandThreads), false));
- Panel_add(super, (Object*) CheckItem_new(strdup("Display threads in a different color"), &(settings->pl->highlightThreads), false));
- Panel_add(super, (Object*) CheckItem_new(strdup("Show custom thread names"), &(settings->pl->showThreadNames), false));
- Panel_add(super, (Object*) CheckItem_new(strdup("Highlight program \"basename\""), &(settings->pl->highlightBaseName), false));
- Panel_add(super, (Object*) CheckItem_new(strdup("Highlight large numbers in memory counters"), &(settings->pl->highlightMegabytes), false));
- Panel_add(super, (Object*) CheckItem_new(strdup("Leave a margin around header"), &(settings->header->margin), false));
- Panel_add(super, (Object*) CheckItem_new(strdup("Detailed CPU time (System/IO-Wait/Hard-IRQ/Soft-IRQ/Steal/Guest)"), &(settings->pl->detailedCPUTime), false));
- Panel_add(super, (Object*) CheckItem_new(strdup("Count CPUs from 0 instead of 1"), &(settings->pl->countCPUsFromZero), false));
- Panel_add(super, (Object*) CheckItem_new(strdup("Update process names on every refresh"), &(settings->pl->updateProcessNames), false));
- Panel_add(super, (Object*) CheckItem_new(strdup("Add guest time in CPU meter percentage"), &(settings->pl->accountGuestInCPUMeter), false));
+ Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Tree view"), &(settings->treeView)));
+ Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Shadow other users' processes"), &(settings->shadowOtherUsers)));
+ Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Hide kernel threads"), &(settings->hideKernelThreads)));
+ Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Hide userland process threads"), &(settings->hideUserlandThreads)));
+ Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Display threads in a different color"), &(settings->highlightThreads)));
+ Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Show custom thread names"), &(settings->showThreadNames)));
+ Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Show program path"), &(settings->showProgramPath)));
+ Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Highlight program \"basename\""), &(settings->highlightBaseName)));
+ Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Highlight large numbers in memory counters"), &(settings->highlightMegabytes)));
+ Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Leave a margin around header"), &(settings->headerMargin)));
+ Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Detailed CPU time (System/IO-Wait/Hard-IRQ/Soft-IRQ/Steal/Guest)"), &(settings->detailedCPUTime)));
+ Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Count CPUs from 0 instead of 1"), &(settings->countCPUsFromZero)));
+ Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Update process names on every refresh"), &(settings->updateProcessNames)));
+ Panel_add(super, (Object*) CheckItem_newByRef(xStrdup("Add guest time in CPU meter percentage"), &(settings->accountGuestInCPUMeter)));
return this;
}
diff --git a/EnvScreen.c b/EnvScreen.c
new file mode 100644
index 0000000..4414c39
--- /dev/null
+++ b/EnvScreen.c
@@ -0,0 +1,67 @@
+#include "EnvScreen.h"
+
+#include "config.h"
+#include "CRT.h"
+#include "IncSet.h"
+#include "ListItem.h"
+#include "Platform.h"
+#include "StringUtils.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+
+/*{
+#include "InfoScreen.h"
+
+typedef struct EnvScreen_ {
+ InfoScreen super;
+} EnvScreen;
+}*/
+
+InfoScreenClass EnvScreen_class = {
+ .super = {
+ .extends = Class(Object),
+ .delete = EnvScreen_delete
+ },
+ .scan = EnvScreen_scan,
+ .draw = EnvScreen_draw
+};
+
+EnvScreen* EnvScreen_new(Process* process) {
+ EnvScreen* this = xMalloc(sizeof(EnvScreen));
+ Object_setClass(this, Class(EnvScreen));
+ return (EnvScreen*) InfoScreen_init(&this->super, process, NULL, LINES-3, " ");
+}
+
+void EnvScreen_delete(Object* this) {
+ free(InfoScreen_done((InfoScreen*)this));
+}
+
+void EnvScreen_draw(InfoScreen* this) {
+ InfoScreen_drawTitled(this, "Environment of process %d - %s", this->process->pid, this->process->comm);
+}
+
+void EnvScreen_scan(InfoScreen* this) {
+ Panel* panel = this->display;
+ int idx = MAX(Panel_getSelectedIndex(panel), 0);
+
+ Panel_prune(panel);
+
+ uid_t euid = geteuid();
+ seteuid(getuid());
+ char *env = Platform_getProcessEnv(this->process->pid);
+ seteuid(euid);
+ if (env) {
+ for (char *p = env; *p; p = strrchr(p, 0)+1)
+ InfoScreen_addLine(this, p);
+ free(env);
+ }
+ else {
+ InfoScreen_addLine(this, "Could not read process environment.");
+ }
+
+ Vector_insertionSort(this->lines);
+ Vector_insertionSort(panel->items);
+ Panel_setSelected(panel, idx);
+}
diff --git a/EnvScreen.h b/EnvScreen.h
new file mode 100644
index 0000000..7cdbb86
--- /dev/null
+++ b/EnvScreen.h
@@ -0,0 +1,22 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_EnvScreen
+#define HEADER_EnvScreen
+
+#include "InfoScreen.h"
+
+typedef struct EnvScreen_ {
+ InfoScreen super;
+} EnvScreen;
+
+extern InfoScreenClass EnvScreen_class;
+
+EnvScreen* EnvScreen_new(Process* process);
+
+void EnvScreen_delete(Object* this);
+
+void EnvScreen_draw(InfoScreen* this);
+
+void EnvScreen_scan(InfoScreen* this);
+
+#endif
diff --git a/FunctionBar.c b/FunctionBar.c
index 1c6066a..659f410 100644
--- a/FunctionBar.c
+++ b/FunctionBar.c
@@ -6,19 +6,19 @@ in the source distribution for its full text.
*/
#include "FunctionBar.h"
-
#include "CRT.h"
+#include "RichString.h"
+#include "XAlloc.h"
#include <assert.h>
#include <string.h>
#include <stdlib.h>
-#include <stdbool.h>
/*{
-#include "Object.h"
+
+#include <stdbool.h>
typedef struct FunctionBar_ {
- Object super;
int size;
char** functions;
char** keys;
@@ -34,26 +34,30 @@ static const char* FunctionBar_FLabels[] = {" ", " ", " ", "
static int FunctionBar_FEvents[] = {KEY_F(1), KEY_F(2), KEY_F(3), KEY_F(4), KEY_F(5), KEY_F(6), KEY_F(7), KEY_F(8), KEY_F(9), KEY_F(10)};
-ObjectClass FunctionBar_class = {
- .delete = FunctionBar_delete
-};
+static const char* FunctionBar_EnterEscKeys[] = {"Enter", "Esc", NULL};
+static int FunctionBar_EnterEscEvents[] = {13, 27};
+
+FunctionBar* FunctionBar_newEnterEsc(const char* enter, const char* esc) {
+ const char* functions[] = {enter, esc, NULL};
+ return FunctionBar_new(functions, FunctionBar_EnterEscKeys, FunctionBar_EnterEscEvents);
+}
FunctionBar* FunctionBar_new(const char** functions, const char** keys, int* events) {
- FunctionBar* this = AllocThis(FunctionBar);
- this->functions = calloc(16, sizeof(char*));
+ FunctionBar* this = xCalloc(1, sizeof(FunctionBar));
+ this->functions = xCalloc(16, sizeof(char*));
if (!functions) {
functions = FunctionBar_FLabels;
}
for (int i = 0; i < 15 && functions[i]; i++) {
- this->functions[i] = strdup(functions[i]);
+ this->functions[i] = xStrdup(functions[i]);
}
if (keys && events) {
this->staticData = false;
- this->keys = malloc(sizeof(char*) * 15);
- this->events = malloc(sizeof(int) * 15);
+ this->keys = xCalloc(15, sizeof(char*));
+ this->events = xCalloc(15, sizeof(int));
int i = 0;
while (i < 15 && functions[i]) {
- this->keys[i] = strdup(keys[i]);
+ this->keys[i] = xStrdup(keys[i]);
this->events[i] = events[i];
i++;
}
@@ -67,8 +71,7 @@ FunctionBar* FunctionBar_new(const char** functions, const char** keys, int* eve
return this;
}
-void FunctionBar_delete(Object* cast) {
- FunctionBar* this = (FunctionBar*) cast;
+void FunctionBar_delete(FunctionBar* this) {
for (int i = 0; i < 15 && this->functions[i]; i++) {
free(this->functions[i]);
}
@@ -87,7 +90,7 @@ void FunctionBar_setLabel(FunctionBar* this, int event, const char* text) {
for (int i = 0; i < this->size; i++) {
if (this->events[i] == event) {
free(this->functions[i]);
- this->functions[i] = strdup(text);
+ this->functions[i] = xStrdup(text);
break;
}
}
diff --git a/FunctionBar.h b/FunctionBar.h
index 68e28f9..1975fa3 100644
--- a/FunctionBar.h
+++ b/FunctionBar.h
@@ -9,10 +9,10 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
-#include "Object.h"
+
+#include <stdbool.h>
typedef struct FunctionBar_ {
- Object super;
int size;
char** functions;
char** keys;
@@ -21,11 +21,12 @@ typedef struct FunctionBar_ {
} FunctionBar;
-extern ObjectClass FunctionBar_class;
+
+FunctionBar* FunctionBar_newEnterEsc(const char* enter, const char* esc);
FunctionBar* FunctionBar_new(const char** functions, const char** keys, int* events);
-void FunctionBar_delete(Object* cast);
+void FunctionBar_delete(FunctionBar* this);
void FunctionBar_setLabel(FunctionBar* this, int event, const char* text);
diff --git a/Hashtable.c b/Hashtable.c
index 0f61519..b3eac8d 100644
--- a/Hashtable.c
+++ b/Hashtable.c
@@ -6,6 +6,7 @@ in the source distribution for its full text.
*/
#include "Hashtable.h"
+#include "XAlloc.h"
#include <stdlib.h>
#include <assert.h>
@@ -63,7 +64,7 @@ int Hashtable_count(Hashtable* this) {
static HashtableItem* HashtableItem_new(unsigned int key, void* value) {
HashtableItem* this;
- this = (HashtableItem*) malloc(sizeof(HashtableItem));
+ this = xMalloc(sizeof(HashtableItem));
this->key = key;
this->value = value;
this->next = NULL;
@@ -73,10 +74,10 @@ static HashtableItem* HashtableItem_new(unsigned int key, void* value) {
Hashtable* Hashtable_new(int size, bool owner) {
Hashtable* this;
- this = (Hashtable*) malloc(sizeof(Hashtable));
+ this = xMalloc(sizeof(Hashtable));
this->items = 0;
this->size = size;
- this->buckets = (HashtableItem**) calloc(size, sizeof(HashtableItem*));
+ this->buckets = (HashtableItem**) xCalloc(size, sizeof(HashtableItem*));
this->owner = owner;
assert(Hashtable_isConsistent(this));
return this;
diff --git a/Header.c b/Header.c
index 5558684..929a6e0 100644
--- a/Header.c
+++ b/Header.c
@@ -8,16 +8,8 @@ in the source distribution for its full text.
#include "Header.h"
#include "CRT.h"
-#include "CPUMeter.h"
-#include "MemoryMeter.h"
-#include "SwapMeter.h"
-#include "TasksMeter.h"
-#include "LoadAverageMeter.h"
-#include "UptimeMeter.h"
-#include "BatteryMeter.h"
-#include "ClockMeter.h"
-#include "HostnameMeter.h"
-#include "String.h"
+#include "StringUtils.h"
+#include "Platform.h"
#include <assert.h>
#include <time.h>
@@ -25,21 +17,17 @@ in the source distribution for its full text.
#include <stdlib.h>
/*{
-#include "ProcessList.h"
#include "Meter.h"
-
-typedef enum HeaderSide_ {
- LEFT_HEADER,
- RIGHT_HEADER
-} HeaderSide;
+#include "Settings.h"
+#include "Vector.h"
typedef struct Header_ {
- Vector* leftMeters;
- Vector* rightMeters;
- ProcessList* pl;
- int height;
+ Vector** columns;
+ Settings* settings;
+ struct ProcessList_* pl;
+ int nrColumns;
int pad;
- bool margin;
+ int height;
} Header;
}*/
@@ -48,25 +36,73 @@ typedef struct Header_ {
#define MAX(a,b) ((a)>(b)?(a):(b))
#endif
-Header* Header_new(ProcessList* pl) {
- Header* this = calloc(1, sizeof(Header));
- this->leftMeters = Vector_new(Class(Meter), true, DEFAULT_SIZE);
- this->rightMeters = Vector_new(Class(Meter), true, DEFAULT_SIZE);
- this->margin = true;
+#ifndef Header_forEachColumn
+#define Header_forEachColumn(this_, i_) for (int i_=0; i_ < this->nrColumns; i_++)
+#endif
+
+Header* Header_new(struct ProcessList_* pl, Settings* settings, int nrColumns) {
+ Header* this = xCalloc(1, sizeof(Header));
+ this->columns = xCalloc(nrColumns, sizeof(Vector*));
+ this->settings = settings;
this->pl = pl;
+ this->nrColumns = nrColumns;
+ Header_forEachColumn(this, i) {
+ this->columns[i] = Vector_new(Class(Meter), true, DEFAULT_SIZE);
+ }
return this;
}
void Header_delete(Header* this) {
- Vector_delete(this->leftMeters);
- Vector_delete(this->rightMeters);
+ Header_forEachColumn(this, i) {
+ Vector_delete(this->columns[i]);
+ }
+ free(this->columns);
free(this);
}
-void Header_createMeter(Header* this, char* name, HeaderSide side) {
- Vector* meters = side == LEFT_HEADER
- ? this->leftMeters
- : this->rightMeters;
+void Header_populateFromSettings(Header* this) {
+ Header_forEachColumn(this, col) {
+ MeterColumnSettings* colSettings = &this->settings->columns[col];
+ for (int i = 0; i < colSettings->len; i++) {
+ Header_addMeterByName(this, colSettings->names[i], col);
+ if (colSettings->modes[i] != 0) {
+ Header_setMode(this, i, colSettings->modes[i], col);
+ }
+ }
+ }
+ Header_calculateHeight(this);
+}
+
+void Header_writeBackToSettings(const Header* this) {
+ Header_forEachColumn(this, col) {
+ MeterColumnSettings* colSettings = &this->settings->columns[col];
+
+ String_freeArray(colSettings->names);
+ free(colSettings->modes);
+
+ Vector* vec = this->columns[col];
+ int len = Vector_size(vec);
+
+ colSettings->names = xCalloc(len+1, sizeof(char*));
+ colSettings->modes = xCalloc(len, sizeof(int));
+ colSettings->len = len;
+
+ for (int i = 0; i < len; i++) {
+ Meter* meter = (Meter*) Vector_get(vec, i);
+ char* name = xCalloc(64, sizeof(char));
+ if (meter->param) {
+ snprintf(name, 63, "%s(%d)", As_Meter(meter)->name, meter->param);
+ } else {
+ snprintf(name, 63, "%s", As_Meter(meter)->name);
+ }
+ colSettings->names[i] = name;
+ colSettings->modes[i] = meter->mode;
+ }
+ }
+}
+
+MeterModeId Header_addMeterByName(Header* this, char* name, int column) {
+ Vector* meters = this->columns[column];
char* paren = strchr(name, '(');
int param = 0;
@@ -75,18 +111,20 @@ void Header_createMeter(Header* this, char* name, HeaderSide side) {
if (!ok) param = 0;
*paren = '\0';
}
- for (MeterClass** type = Meter_types; *type; type++) {
+ MeterModeId mode = TEXT_METERMODE;
+ for (MeterClass** type = Platform_meterTypes; *type; type++) {
if (String_eq(name, (*type)->name)) {
- Vector_add(meters, Meter_new(this->pl, param, *type));
+ Meter* meter = Meter_new(this->pl, param, *type);
+ Vector_add(meters, meter);
+ mode = meter->mode;
break;
}
}
+ return mode;
}
-void Header_setMode(Header* this, int i, MeterModeId mode, HeaderSide side) {
- Vector* meters = side == LEFT_HEADER
- ? this->leftMeters
- : this->rightMeters;
+void Header_setMode(Header* this, int i, MeterModeId mode, int column) {
+ Vector* meters = this->columns[column];
if (i >= Vector_size(meters))
return;
@@ -94,33 +132,26 @@ void Header_setMode(Header* this, int i, MeterModeId mode, HeaderSide side) {
Meter_setMode(meter, mode);
}
-Meter* Header_addMeter(Header* this, MeterClass* type, int param, HeaderSide side) {
- Vector* meters = side == LEFT_HEADER
- ? this->leftMeters
- : this->rightMeters;
+Meter* Header_addMeterByClass(Header* this, MeterClass* type, int param, int column) {
+ Vector* meters = this->columns[column];
Meter* meter = Meter_new(this->pl, param, type);
Vector_add(meters, meter);
return meter;
}
-int Header_size(Header* this, HeaderSide side) {
- Vector* meters = side == LEFT_HEADER
- ? this->leftMeters
- : this->rightMeters;
-
+int Header_size(Header* this, int column) {
+ Vector* meters = this->columns[column];
return Vector_size(meters);
}
-char* Header_readMeterName(Header* this, int i, HeaderSide side) {
- Vector* meters = side == LEFT_HEADER
- ? this->leftMeters
- : this->rightMeters;
+char* Header_readMeterName(Header* this, int i, int column) {
+ Vector* meters = this->columns[column];
Meter* meter = (Meter*) Vector_get(meters, i);
int nameLen = strlen(Meter_name(meter));
int len = nameLen + 100;
- char* name = malloc(len);
+ char* name = xMalloc(len);
strncpy(name, Meter_name(meter), nameLen);
name[nameLen] = '\0';
if (meter->param)
@@ -129,42 +160,20 @@ char* Header_readMeterName(Header* this, int i, HeaderSide side) {
return name;
}
-MeterModeId Header_readMeterMode(Header* this, int i, HeaderSide side) {
- Vector* meters = side == LEFT_HEADER
- ? this->leftMeters
- : this->rightMeters;
+MeterModeId Header_readMeterMode(Header* this, int i, int column) {
+ Vector* meters = this->columns[column];
Meter* meter = (Meter*) Vector_get(meters, i);
return meter->mode;
}
-void Header_defaultMeters(Header* this, int cpuCount) {
- if (cpuCount > 8) {
- Vector_add(this->leftMeters, Meter_new(this->pl, 0, (MeterClass*) Class(LeftCPUs2Meter)));
- Vector_add(this->rightMeters, Meter_new(this->pl, 0, (MeterClass*) Class(RightCPUs2Meter)));
- } else if (cpuCount > 4) {
- Vector_add(this->leftMeters, Meter_new(this->pl, 0, (MeterClass*) Class(LeftCPUsMeter)));
- Vector_add(this->rightMeters, Meter_new(this->pl, 0, (MeterClass*) Class(RightCPUsMeter)));
- } else {
- Vector_add(this->leftMeters, Meter_new(this->pl, 0, (MeterClass*) Class(AllCPUsMeter)));
- }
- Vector_add(this->leftMeters, Meter_new(this->pl, 0, (MeterClass*) Class(MemoryMeter)));
- Vector_add(this->leftMeters, Meter_new(this->pl, 0, (MeterClass*) Class(SwapMeter)));
- Vector_add(this->rightMeters, Meter_new(this->pl, 0, (MeterClass*) Class(TasksMeter)));
- Vector_add(this->rightMeters, Meter_new(this->pl, 0, (MeterClass*) Class(LoadAverageMeter)));
- Vector_add(this->rightMeters, Meter_new(this->pl, 0, (MeterClass*) Class(UptimeMeter)));
-}
-
void Header_reinit(Header* this) {
- for (int i = 0; i < Vector_size(this->leftMeters); i++) {
- Meter* meter = (Meter*) Vector_get(this->leftMeters, i);
- if (Meter_initFn(meter))
- Meter_init(meter);
- }
- for (int i = 0; i < Vector_size(this->rightMeters); i++) {
- Meter* meter = (Meter*) Vector_get(this->rightMeters, i);
- if (Meter_initFn(meter))
- Meter_init(meter);
+ Header_forEachColumn(this, col) {
+ for (int i = 0; i < Vector_size(this->columns[col]); i++) {
+ Meter* meter = (Meter*) Vector_get(this->columns[col], i);
+ if (Meter_initFn(meter))
+ Meter_init(meter);
+ }
}
}
@@ -175,32 +184,34 @@ void Header_draw(const Header* this) {
for (int y = 0; y < height; y++) {
mvhline(y, 0, ' ', COLS);
}
- for (int y = (pad / 2), i = 0; i < Vector_size(this->leftMeters); i++) {
- Meter* meter = (Meter*) Vector_get(this->leftMeters, i);
- meter->draw(meter, pad, y, COLS / 2 - (pad * 2 - 1) - 1);
- y += meter->h;
- }
- for (int y = (pad / 2), i = 0; i < Vector_size(this->rightMeters); i++) {
- Meter* meter = (Meter*) Vector_get(this->rightMeters, i);
- meter->draw(meter, COLS / 2 + pad, y, COLS / 2 - (pad * 2 - 1) - 1);
- y += meter->h;
+ int width = COLS / this->nrColumns - (pad * this->nrColumns - 1) - 1;
+ int x = pad;
+
+ Header_forEachColumn(this, col) {
+ Vector* meters = this->columns[col];
+ for (int y = (pad / 2), i = 0; i < Vector_size(meters); i++) {
+ Meter* meter = (Meter*) Vector_get(meters, i);
+ meter->draw(meter, x, y, width);
+ y += meter->h;
+ }
+ x += width + pad;
}
}
int Header_calculateHeight(Header* this) {
- int pad = this->margin ? 2 : 0;
- int leftHeight = pad;
- int rightHeight = pad;
-
- for (int i = 0; i < Vector_size(this->leftMeters); i++) {
- Meter* meter = (Meter*) Vector_get(this->leftMeters, i);
- leftHeight += meter->h;
- }
- for (int i = 0; i < Vector_size(this->rightMeters); i++) {
- Meter* meter = (Meter*) Vector_get(this->rightMeters, i);
- rightHeight += meter->h;
+ int pad = this->settings->headerMargin ? 2 : 0;
+ int maxHeight = pad;
+
+ Header_forEachColumn(this, col) {
+ Vector* meters = this->columns[col];
+ int height = pad;
+ for (int i = 0; i < Vector_size(meters); i++) {
+ Meter* meter = (Meter*) Vector_get(meters, i);
+ height += meter->h;
+ }
+ maxHeight = MAX(maxHeight, height);
}
+ this->height = maxHeight;
this->pad = pad;
- this->height = MAX(leftHeight, rightHeight);
- return this->height;
+ return maxHeight;
}
diff --git a/Header.h b/Header.h
index e778459..772e25d 100644
--- a/Header.h
+++ b/Header.h
@@ -9,21 +9,17 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
-#include "ProcessList.h"
#include "Meter.h"
-
-typedef enum HeaderSide_ {
- LEFT_HEADER,
- RIGHT_HEADER
-} HeaderSide;
+#include "Settings.h"
+#include "Vector.h"
typedef struct Header_ {
- Vector* leftMeters;
- Vector* rightMeters;
- ProcessList* pl;
- int height;
+ Vector** columns;
+ Settings* settings;
+ struct ProcessList_* pl;
+ int nrColumns;
int pad;
- bool margin;
+ int height;
} Header;
@@ -31,23 +27,29 @@ typedef struct Header_ {
#define MAX(a,b) ((a)>(b)?(a):(b))
#endif
-Header* Header_new(ProcessList* pl);
+#ifndef Header_forEachColumn
+#define Header_forEachColumn(this_, i_) for (int i_=0; i_ < this->nrColumns; i_++)
+#endif
+
+Header* Header_new(struct ProcessList_* pl, Settings* settings, int nrColumns);
void Header_delete(Header* this);
-void Header_createMeter(Header* this, char* name, HeaderSide side);
+void Header_populateFromSettings(Header* this);
+
+void Header_writeBackToSettings(const Header* this);
-void Header_setMode(Header* this, int i, MeterModeId mode, HeaderSide side);
+MeterModeId Header_addMeterByName(Header* this, char* name, int column);
-Meter* Header_addMeter(Header* this, MeterClass* type, int param, HeaderSide side);
+void Header_setMode(Header* this, int i, MeterModeId mode, int column);
-int Header_size(Header* this, HeaderSide side);
+Meter* Header_addMeterByClass(Header* this, MeterClass* type, int param, int column);
-char* Header_readMeterName(Header* this, int i, HeaderSide side);
+int Header_size(Header* this, int column);
-MeterModeId Header_readMeterMode(Header* this, int i, HeaderSide side);
+char* Header_readMeterName(Header* this, int i, int column);
-void Header_defaultMeters(Header* this, int cpuCount);
+MeterModeId Header_readMeterMode(Header* this, int i, int column);
void Header_reinit(Header* this);
diff --git a/IncSet.c b/IncSet.c
index 40aa923..0149382 100644
--- a/IncSet.c
+++ b/IncSet.c
@@ -6,7 +6,7 @@ in the source distribution for its full text.
*/
#include "IncSet.h"
-#include "String.h"
+#include "StringUtils.h"
#include "Panel.h"
#include "ListItem.h"
#include "CRT.h"
@@ -38,7 +38,6 @@ typedef struct IncMode_ {
typedef struct IncSet_ {
IncMode modes[2];
IncMode* active;
- FunctionBar* bar;
FunctionBar* defaultBar;
bool filtering;
} IncSet;
@@ -73,16 +72,15 @@ static inline void IncMode_initFilter(IncMode* filter) {
}
static inline void IncMode_done(IncMode* mode) {
- FunctionBar_delete((Object*)mode->bar);
+ FunctionBar_delete(mode->bar);
}
IncSet* IncSet_new(FunctionBar* bar) {
- IncSet* this = calloc(1, sizeof(IncSet));
+ IncSet* this = xCalloc(1, sizeof(IncSet));
IncMode_initSearch(&(this->modes[INC_SEARCH]));
IncMode_initFilter(&(this->modes[INC_FILTER]));
this->active = NULL;
this->filtering = false;
- this->bar = bar;
this->defaultBar = bar;
return this;
}
@@ -137,7 +135,7 @@ bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue
return true;
IncMode* mode = this->active;
int size = Panel_size(panel);
- bool filterChange = false;
+ bool filterChanged = false;
bool doSearch = true;
if (ch == KEY_F(3)) {
if (size == 0) return true;
@@ -153,27 +151,29 @@ bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue
}
}
doSearch = false;
- } else if (isprint((char)ch) && (mode->index < INCMODE_MAX)) {
+ } else if (ch < 255 && isprint((char)ch) && (mode->index < INCMODE_MAX)) {
mode->buffer[mode->index] = ch;
mode->index++;
mode->buffer[mode->index] = 0;
if (mode->isFilter) {
- filterChange = true;
+ filterChanged = true;
if (mode->index == 1) this->filtering = true;
}
} else if ((ch == KEY_BACKSPACE || ch == 127) && (mode->index > 0)) {
mode->index--;
mode->buffer[mode->index] = 0;
if (mode->isFilter) {
- filterChange = true;
+ filterChanged = true;
if (mode->index == 0) {
this->filtering = false;
IncMode_reset(mode);
}
}
+ } else if (ch == KEY_RESIZE) {
+ Panel_resize(panel, COLS, LINES-panel->y-1);
} else {
if (mode->isFilter) {
- filterChange = true;
+ filterChanged = true;
if (ch == 27) {
this->filtering = false;
IncMode_reset(mode);
@@ -182,17 +182,17 @@ bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue
IncMode_reset(mode);
}
this->active = NULL;
- this->bar = this->defaultBar;
+ Panel_setDefaultBar(panel);
FunctionBar_draw(this->defaultBar, NULL);
doSearch = false;
}
if (doSearch) {
search(mode, panel, getPanelValue);
}
- if (filterChange && lines) {
+ if (filterChanged && lines) {
updateWeakPanel(this, panel, lines);
}
- return filterChange;
+ return filterChanged;
}
const char* IncSet_getListItemValue(Panel* panel, int i) {
@@ -202,12 +202,24 @@ const char* IncSet_getListItemValue(Panel* panel, int i) {
return "";
}
-void IncSet_activate(IncSet* this, IncType type) {
+void IncSet_activate(IncSet* this, IncType type, Panel* panel) {
this->active = &(this->modes[type]);
- this->bar = this->active->bar;
FunctionBar_draw(this->active->bar, this->active->buffer);
+ panel->currentBar = this->active->bar;
}
void IncSet_drawBar(IncSet* this) {
- FunctionBar_draw(this->bar, this->active ? this->active->buffer : NULL);
+ if (this->active) {
+ FunctionBar_draw(this->active->bar, this->active->buffer);
+ } else {
+ FunctionBar_draw(this->defaultBar, NULL);
+ }
+}
+
+int IncSet_synthesizeEvent(IncSet* this, int x) {
+ if (this->active) {
+ return FunctionBar_synthesizeEvent(this->active->bar, x);
+ } else {
+ return FunctionBar_synthesizeEvent(this->defaultBar, x);
+ }
}
diff --git a/IncSet.h b/IncSet.h
index c528f18..db05ecc 100644
--- a/IncSet.h
+++ b/IncSet.h
@@ -33,7 +33,6 @@ typedef struct IncMode_ {
typedef struct IncSet_ {
IncMode modes[2];
IncMode* active;
- FunctionBar* bar;
FunctionBar* defaultBar;
bool filtering;
} IncSet;
@@ -49,8 +48,10 @@ bool IncSet_handleKey(IncSet* this, int ch, Panel* panel, IncMode_GetPanelValue
const char* IncSet_getListItemValue(Panel* panel, int i);
-void IncSet_activate(IncSet* this, IncType type);
+void IncSet_activate(IncSet* this, IncType type, Panel* panel);
void IncSet_drawBar(IncSet* this);
+int IncSet_synthesizeEvent(IncSet* this, int x);
+
#endif
diff --git a/InfoScreen.c b/InfoScreen.c
new file mode 100644
index 0000000..7ce9ca6
--- /dev/null
+++ b/InfoScreen.c
@@ -0,0 +1,180 @@
+#include "InfoScreen.h"
+
+#include "config.h"
+#include "Object.h"
+#include "CRT.h"
+#include "IncSet.h"
+#include "ListItem.h"
+#include "Platform.h"
+#include "StringUtils.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdarg.h>
+
+/*{
+#include "Process.h"
+#include "Panel.h"
+#include "FunctionBar.h"
+#include "IncSet.h"
+
+typedef struct InfoScreen_ InfoScreen;
+
+typedef void(*InfoScreen_Scan)(InfoScreen*);
+typedef void(*InfoScreen_Draw)(InfoScreen*);
+typedef void(*InfoScreen_OnErr)(InfoScreen*);
+typedef bool(*InfoScreen_OnKey)(InfoScreen*, int);
+
+typedef struct InfoScreenClass_ {
+ ObjectClass super;
+ const InfoScreen_Scan scan;
+ const InfoScreen_Draw draw;
+ const InfoScreen_OnErr onErr;
+ const InfoScreen_OnKey onKey;
+} InfoScreenClass;
+
+#define As_InfoScreen(this_) ((InfoScreenClass*)(((InfoScreen*)(this_))->super.klass))
+#define InfoScreen_scan(this_) As_InfoScreen(this_)->scan((InfoScreen*)(this_))
+#define InfoScreen_draw(this_) As_InfoScreen(this_)->draw((InfoScreen*)(this_))
+#define InfoScreen_onErr(this_) As_InfoScreen(this_)->onErr((InfoScreen*)(this_))
+#define InfoScreen_onKey(this_, ch_) As_InfoScreen(this_)->onKey((InfoScreen*)(this_), ch_)
+
+struct InfoScreen_ {
+ Object super;
+ Process* process;
+ Panel* display;
+ FunctionBar* bar;
+ IncSet* inc;
+ Vector* lines;
+};
+}*/
+
+static const char* InfoScreenFunctions[] = {"Search ", "Filter ", "Refresh", "Done ", NULL};
+
+static const char* InfoScreenKeys[] = {"F3", "F4", "F5", "Esc"};
+
+static int InfoScreenEvents[] = {KEY_F(3), KEY_F(4), KEY_F(5), 27};
+
+InfoScreen* InfoScreen_init(InfoScreen* this, Process* process, FunctionBar* bar, int height, char* panelHeader) {
+ this->process = process;
+ if (!bar) {
+ bar = FunctionBar_new(InfoScreenFunctions, InfoScreenKeys, InfoScreenEvents);
+ }
+ this->display = Panel_new(0, 1, COLS, height, false, Class(ListItem), bar);
+ this->inc = IncSet_new(bar);
+ this->lines = Vector_new(this->display->items->type, true, DEFAULT_SIZE);
+ Panel_setHeader(this->display, panelHeader);
+ return this;
+}
+
+InfoScreen* InfoScreen_done(InfoScreen* this) {
+ Panel_delete((Object*)this->display);
+ IncSet_delete(this->inc);
+ Vector_delete(this->lines);
+ return this;
+}
+
+void InfoScreen_drawTitled(InfoScreen* this, char* fmt, ...) {
+ va_list ap;
+ va_start(ap, fmt);
+ attrset(CRT_colors[METER_TEXT]);
+ mvhline(0, 0, ' ', COLS);
+ wmove(stdscr, 0, 0);
+ vw_printw(stdscr, fmt, ap);
+ attrset(CRT_colors[DEFAULT_COLOR]);
+ Panel_draw(this->display, true);
+ IncSet_drawBar(this->inc);
+ va_end(ap);
+}
+
+void InfoScreen_addLine(InfoScreen* this, const char* line) {
+ Vector_add(this->lines, (Object*) ListItem_new(line, 0));
+ const char* incFilter = IncSet_filter(this->inc);
+ if (!incFilter || String_contains_i(line, incFilter))
+ Panel_add(this->display, (Object*)Vector_get(this->lines, Vector_size(this->lines)-1));
+}
+
+void InfoScreen_appendLine(InfoScreen* this, const char* line) {
+ ListItem* last = (ListItem*)Vector_get(this->lines, Vector_size(this->lines)-1);
+ ListItem_append(last, line);
+ const char* incFilter = IncSet_filter(this->inc);
+ if (incFilter && Panel_get(this->display, Panel_size(this->display)-1) != (Object*)last && String_contains_i(line, incFilter))
+ Panel_add(this->display, (Object*)last);
+}
+
+void InfoScreen_run(InfoScreen* this) {
+ Panel* panel = this->display;
+
+ if (As_InfoScreen(this)->scan) InfoScreen_scan(this);
+ InfoScreen_draw(this);
+
+ bool looping = true;
+ while (looping) {
+
+ Panel_draw(panel, true);
+
+ if (this->inc->active)
+ move(LINES-1, CRT_cursorX);
+ int ch = getch();
+
+ if (ch == ERR) {
+ if (As_InfoScreen(this)->onErr) {
+ InfoScreen_onErr(this);
+ continue;
+ }
+ }
+
+ if (ch == KEY_MOUSE) {
+ MEVENT mevent;
+ int ok = getmouse(&mevent);
+ if (ok == OK)
+ if (mevent.y >= panel->y && mevent.y < LINES - 1) {
+ Panel_setSelected(panel, mevent.y - panel->y + panel->scrollV);
+ ch = 0;
+ } if (mevent.y == LINES - 1)
+ ch = IncSet_synthesizeEvent(this->inc, mevent.x);
+ }
+
+ if (this->inc->active) {
+ IncSet_handleKey(this->inc, ch, panel, IncSet_getListItemValue, this->lines);
+ continue;
+ }
+
+ switch(ch) {
+ case ERR:
+ continue;
+ case KEY_F(3):
+ case '/':
+ IncSet_activate(this->inc, INC_SEARCH, panel);
+ break;
+ case KEY_F(4):
+ case '\\':
+ IncSet_activate(this->inc, INC_FILTER, panel);
+ break;
+ case KEY_F(5):
+ clear();
+ if (As_InfoScreen(this)->scan) InfoScreen_scan(this);
+ InfoScreen_draw(this);
+ break;
+ case '\014': // Ctrl+L
+ clear();
+ InfoScreen_draw(this);
+ break;
+ case 'q':
+ case 27:
+ case KEY_F(10):
+ looping = false;
+ break;
+ case KEY_RESIZE:
+ Panel_resize(panel, COLS, LINES-2);
+ InfoScreen_draw(this);
+ break;
+ default:
+ if (As_InfoScreen(this)->onKey && InfoScreen_onKey(this, ch)) {
+ continue;
+ }
+ Panel_onKey(panel, ch);
+ }
+ }
+}
diff --git a/InfoScreen.h b/InfoScreen.h
new file mode 100644
index 0000000..2e1599f
--- /dev/null
+++ b/InfoScreen.h
@@ -0,0 +1,53 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_InfoScreen
+#define HEADER_InfoScreen
+
+#include "Process.h"
+#include "Panel.h"
+#include "FunctionBar.h"
+#include "IncSet.h"
+
+typedef struct InfoScreen_ InfoScreen;
+
+typedef void(*InfoScreen_Scan)(InfoScreen*);
+typedef void(*InfoScreen_Draw)(InfoScreen*);
+typedef void(*InfoScreen_OnErr)(InfoScreen*);
+typedef bool(*InfoScreen_OnKey)(InfoScreen*, int);
+
+typedef struct InfoScreenClass_ {
+ ObjectClass super;
+ const InfoScreen_Scan scan;
+ const InfoScreen_Draw draw;
+ const InfoScreen_OnErr onErr;
+ const InfoScreen_OnKey onKey;
+} InfoScreenClass;
+
+#define As_InfoScreen(this_) ((InfoScreenClass*)(((InfoScreen*)(this_))->super.klass))
+#define InfoScreen_scan(this_) As_InfoScreen(this_)->scan((InfoScreen*)(this_))
+#define InfoScreen_draw(this_) As_InfoScreen(this_)->draw((InfoScreen*)(this_))
+#define InfoScreen_onErr(this_) As_InfoScreen(this_)->onErr((InfoScreen*)(this_))
+#define InfoScreen_onKey(this_, ch_) As_InfoScreen(this_)->onKey((InfoScreen*)(this_), ch_)
+
+struct InfoScreen_ {
+ Object super;
+ Process* process;
+ Panel* display;
+ FunctionBar* bar;
+ IncSet* inc;
+ Vector* lines;
+};
+
+InfoScreen* InfoScreen_init(InfoScreen* this, Process* process, FunctionBar* bar, int height, char* panelHeader);
+
+InfoScreen* InfoScreen_done(InfoScreen* this);
+
+void InfoScreen_drawTitled(InfoScreen* this, char* fmt, ...);
+
+void InfoScreen_addLine(InfoScreen* this, const char* line);
+
+void InfoScreen_appendLine(InfoScreen* this, const char* line);
+
+void InfoScreen_run(InfoScreen* this);
+
+#endif
diff --git a/ListItem.c b/ListItem.c
index 140ebdc..c9e906f 100644
--- a/ListItem.c
+++ b/ListItem.c
@@ -8,7 +8,7 @@ in the source distribution for its full text.
#include "ListItem.h"
#include "CRT.h"
-#include "String.h"
+#include "StringUtils.h"
#include "RichString.h"
#include <string.h>
@@ -22,6 +22,7 @@ typedef struct ListItem_ {
Object super;
char* value;
int key;
+ bool moving;
} ListItem;
}*/
@@ -33,14 +34,23 @@ static void ListItem_delete(Object* cast) {
}
static void ListItem_display(Object* cast, RichString* out) {
- ListItem* this = (ListItem*)cast;
+ ListItem* const this = (ListItem*)cast;
assert (this != NULL);
/*
int len = strlen(this->value)+1;
char buffer[len+1];
snprintf(buffer, len, "%s", this->value);
*/
- RichString_write(out, CRT_colors[DEFAULT_COLOR], this->value/*buffer*/);
+ if (this->moving) {
+ RichString_write(out, CRT_colors[DEFAULT_COLOR],
+#ifdef HAVE_LIBNCURSESW
+ CRT_utf8 ? "↕ " :
+#endif
+ "+ ");
+ } else {
+ RichString_prune(out);
+ }
+ RichString_append(out, CRT_colors[DEFAULT_COLOR], this->value/*buffer*/);
}
ObjectClass ListItem_class = {
@@ -51,8 +61,9 @@ ObjectClass ListItem_class = {
ListItem* ListItem_new(const char* value, int key) {
ListItem* this = AllocThis(ListItem);
- this->value = strdup(value);
+ this->value = xStrdup(value);
this->key = key;
+ this->moving = false;
return this;
}
@@ -60,7 +71,7 @@ void ListItem_append(ListItem* this, const char* text) {
int oldLen = strlen(this->value);
int textLen = strlen(text);
int newLen = strlen(this->value) + textLen;
- this->value = realloc(this->value, newLen + 1);
+ this->value = xRealloc(this->value, newLen + 1);
memcpy(this->value + oldLen, text, textLen);
this->value[newLen] = '\0';
}
@@ -69,7 +80,7 @@ const char* ListItem_getRef(ListItem* this) {
return this->value;
}
-int ListItem_compare(const void* cast1, const void* cast2) {
+long ListItem_compare(const void* cast1, const void* cast2) {
ListItem* obj1 = (ListItem*) cast1;
ListItem* obj2 = (ListItem*) cast2;
return strcmp(obj1->value, obj2->value);
diff --git a/ListItem.h b/ListItem.h
index a3ca075..b48f0ac 100644
--- a/ListItem.h
+++ b/ListItem.h
@@ -15,6 +15,7 @@ typedef struct ListItem_ {
Object super;
char* value;
int key;
+ bool moving;
} ListItem;
@@ -26,7 +27,7 @@ void ListItem_append(ListItem* this, const char* text);
const char* ListItem_getRef(ListItem* this);
-int ListItem_compare(const void* cast1, const void* cast2);
+long ListItem_compare(const void* cast1, const void* cast2);
#endif
diff --git a/LoadAverageMeter.c b/LoadAverageMeter.c
index 850f802..d292a7c 100644
--- a/LoadAverageMeter.c
+++ b/LoadAverageMeter.c
@@ -8,51 +8,37 @@ in the source distribution for its full text.
#include "LoadAverageMeter.h"
#include "CRT.h"
-
-#include <assert.h>
+#include "Platform.h"
/*{
#include "Meter.h"
}*/
int LoadAverageMeter_attributes[] = {
- LOAD_AVERAGE_FIFTEEN, LOAD_AVERAGE_FIVE, LOAD_AVERAGE_ONE
+ LOAD_AVERAGE_ONE, LOAD_AVERAGE_FIVE, LOAD_AVERAGE_FIFTEEN
};
int LoadMeter_attributes[] = { LOAD };
-static inline void LoadAverageMeter_scan(double* one, double* five, double* fifteen) {
- int activeProcs, totalProcs, lastProc;
- *one = 0; *five = 0; *fifteen = 0;
- FILE *fd = fopen(PROCDIR "/loadavg", "r");
- if (fd) {
- int total = fscanf(fd, "%32lf %32lf %32lf %32d/%32d %32d", one, five, fifteen,
- &activeProcs, &totalProcs, &lastProc);
- (void) total;
- assert(total == 6);
- fclose(fd);
- }
-}
-
static void LoadAverageMeter_setValues(Meter* this, char* buffer, int size) {
- LoadAverageMeter_scan(&this->values[2], &this->values[1], &this->values[0]);
- snprintf(buffer, size, "%.2f/%.2f/%.2f", this->values[2], this->values[1], this->values[0]);
+ Platform_getLoadAverage(&this->values[0], &this->values[1], &this->values[2]);
+ snprintf(buffer, size, "%.2f/%.2f/%.2f", this->values[0], this->values[1], this->values[2]);
}
static void LoadAverageMeter_display(Object* cast, RichString* out) {
Meter* this = (Meter*)cast;
char buffer[20];
- sprintf(buffer, "%.2f ", this->values[2]);
- RichString_write(out, CRT_colors[LOAD_AVERAGE_FIFTEEN], buffer);
+ sprintf(buffer, "%.2f ", this->values[0]);
+ RichString_write(out, CRT_colors[LOAD_AVERAGE_ONE], buffer);
sprintf(buffer, "%.2f ", this->values[1]);
RichString_append(out, CRT_colors[LOAD_AVERAGE_FIVE], buffer);
- sprintf(buffer, "%.2f ", this->values[0]);
- RichString_append(out, CRT_colors[LOAD_AVERAGE_ONE], buffer);
+ sprintf(buffer, "%.2f ", this->values[2]);
+ RichString_append(out, CRT_colors[LOAD_AVERAGE_FIFTEEN], buffer);
}
static void LoadMeter_setValues(Meter* this, char* buffer, int size) {
double five, fifteen;
- LoadAverageMeter_scan(&this->values[0], &five, &fifteen);
+ Platform_getLoadAverage(&this->values[0], &five, &fifteen);
if (this->values[0] > this->total) {
this->total = this->values[0];
}
@@ -79,6 +65,7 @@ MeterClass LoadAverageMeter_class = {
.attributes = LoadAverageMeter_attributes,
.name = "LoadAverage",
.uiName = "Load average",
+ .description = "Load averages: 1 minute, 5 minutes, 15 minutes",
.caption = "Load average: "
};
@@ -94,5 +81,6 @@ MeterClass LoadMeter_class = {
.attributes = LoadMeter_attributes,
.name = "Load",
.uiName = "Load",
+ .description = "Load: average of ready processes in the last minute",
.caption = "Load: "
};
diff --git a/MainPanel.c b/MainPanel.c
new file mode 100644
index 0000000..f9b45d6
--- /dev/null
+++ b/MainPanel.c
@@ -0,0 +1,213 @@
+/*
+htop - ColumnsPanel.c
+(C) 2004-2015 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "MainPanel.h"
+#include "Process.h"
+#include "Platform.h"
+#include "CRT.h"
+
+#include <stdlib.h>
+
+/*{
+#include "Panel.h"
+#include "Action.h"
+#include "Settings.h"
+
+typedef struct MainPanel_ {
+ Panel super;
+ State* state;
+ IncSet* inc;
+ Htop_Action *keys;
+ pid_t pidSearch;
+} MainPanel;
+
+typedef bool(*MainPanel_ForeachProcessFn)(Process*, size_t);
+
+#define MainPanel_getFunctionBar(this_) (((Panel*)(this_))->defaultBar)
+
+}*/
+
+static const char* MainFunctions[] = {"Help ", "Setup ", "Search", "Filter", "Tree ", "SortBy", "Nice -", "Nice +", "Kill ", "Quit ", NULL};
+
+void MainPanel_updateTreeFunctions(MainPanel* this, bool mode) {
+ FunctionBar* bar = MainPanel_getFunctionBar(this);
+ if (mode) {
+ FunctionBar_setLabel(bar, KEY_F(5), "Sorted");
+ FunctionBar_setLabel(bar, KEY_F(6), "Collap");
+ } else {
+ FunctionBar_setLabel(bar, KEY_F(5), "Tree ");
+ FunctionBar_setLabel(bar, KEY_F(6), "SortBy");
+ }
+}
+
+void MainPanel_pidSearch(MainPanel* this, int ch) {
+ Panel* super = (Panel*) this;
+ pid_t pid = ch-48 + this->pidSearch;
+ for (int i = 0; i < Panel_size(super); i++) {
+ Process* p = (Process*) Panel_get(super, i);
+ if (p && p->pid == pid) {
+ Panel_setSelected(super, i);
+ break;
+ }
+ }
+ this->pidSearch = pid * 10;
+ if (this->pidSearch > 10000000) {
+ this->pidSearch = 0;
+ }
+}
+
+static HandlerResult MainPanel_eventHandler(Panel* super, int ch) {
+ MainPanel* this = (MainPanel*) super;
+
+ HandlerResult result = IGNORED;
+
+ Htop_Reaction reaction = HTOP_OK;
+
+ if (EVENT_IS_HEADER_CLICK(ch)) {
+ int x = EVENT_HEADER_CLICK_GET_X(ch);
+ ProcessList* pl = this->state->pl;
+ Settings* settings = this->state->settings;
+ int hx = super->scrollH + x + 1;
+ ProcessField field = ProcessList_keyAt(pl, hx);
+ if (field == settings->sortKey) {
+ Settings_invertSortOrder(settings);
+ settings->treeView = false;
+ } else {
+ reaction |= Action_setSortKey(settings, field);
+ }
+ reaction |= HTOP_RECALCULATE | HTOP_REDRAW_BAR | HTOP_SAVE_SETTINGS;
+ result = HANDLED;
+ } else if (ch != ERR && this->inc->active) {
+ bool filterChanged = IncSet_handleKey(this->inc, ch, super, (IncMode_GetPanelValue) MainPanel_getValue, NULL);
+ if (filterChanged) {
+ this->state->pl->incFilter = IncSet_filter(this->inc);
+ reaction = HTOP_REFRESH | HTOP_REDRAW_BAR;
+ }
+ reaction |= HTOP_KEEP_FOLLOWING;
+ result = HANDLED;
+ } else if (ch == 27) {
+ return HANDLED;
+ } else if (ch != ERR && ch > 0 && ch < KEY_MAX && this->keys[ch]) {
+ reaction |= (this->keys[ch])(this->state);
+ result = HANDLED;
+ } else if (isdigit(ch)) {
+ MainPanel_pidSearch(this, ch);
+ } else {
+ if (ch != ERR) {
+ this->pidSearch = 0;
+ } else {
+ reaction |= HTOP_KEEP_FOLLOWING;
+ }
+ switch (ch) {
+ case KEY_LEFT:
+ case KEY_CTRLB:
+ if (super->scrollH > 0) {
+ super->scrollH -= CRT_scrollHAmount;
+ super->needsRedraw = true;
+ }
+ return HANDLED;
+ case KEY_RIGHT:
+ case KEY_CTRLF:
+ super->scrollH += CRT_scrollHAmount;
+ super->needsRedraw = true;
+ return HANDLED;
+ }
+ }
+
+ if (reaction & HTOP_REDRAW_BAR) {
+ MainPanel_updateTreeFunctions(this, this->state->settings->treeView);
+ IncSet_drawBar(this->inc);
+ }
+ if (reaction & HTOP_UPDATE_PANELHDR) {
+ ProcessList_printHeader(this->state->pl, Panel_getHeader(super));
+ }
+ if (reaction & HTOP_REFRESH) {
+ result |= REDRAW;
+ }
+ if (reaction & HTOP_RECALCULATE) {
+ result |= RESCAN;
+ }
+ if (reaction & HTOP_SAVE_SETTINGS) {
+ this->state->settings->changed = true;
+ }
+ if (reaction & HTOP_QUIT) {
+ return BREAK_LOOP;
+ }
+ if (!(reaction & HTOP_KEEP_FOLLOWING)) {
+ this->state->pl->following = -1;
+ Panel_setSelectionColor(super, CRT_colors[PANEL_SELECTION_FOCUS]);
+ }
+ return result;
+}
+
+int MainPanel_selectedPid(MainPanel* this) {
+ Process* p = (Process*) Panel_getSelected((Panel*)this);
+ if (p) {
+ return p->pid;
+ }
+ return -1;
+}
+
+const char* MainPanel_getValue(MainPanel* this, int i) {
+ Process* p = (Process*) Panel_get((Panel*)this, i);
+ if (p)
+ return p->comm;
+ return "";
+}
+
+bool MainPanel_foreachProcess(MainPanel* this, MainPanel_ForeachProcessFn fn, int arg, bool* wasAnyTagged) {
+ Panel* super = (Panel*) this;
+ bool ok = true;
+ bool anyTagged = false;
+ for (int i = 0; i < Panel_size(super); i++) {
+ Process* p = (Process*) Panel_get(super, i);
+ if (p->tag) {
+ ok = fn(p, arg) && ok;
+ anyTagged = true;
+ }
+ }
+ if (!anyTagged) {
+ Process* p = (Process*) Panel_getSelected(super);
+ if (p) ok = fn(p, arg) && ok;
+ }
+ if (wasAnyTagged)
+ *wasAnyTagged = anyTagged;
+ return ok;
+}
+
+PanelClass MainPanel_class = {
+ .super = {
+ .extends = Class(Panel),
+ .delete = MainPanel_delete
+ },
+ .eventHandler = MainPanel_eventHandler
+};
+
+MainPanel* MainPanel_new() {
+ MainPanel* this = AllocThis(MainPanel);
+ Panel_init((Panel*) this, 1, 1, 1, 1, Class(Process), false, FunctionBar_new(MainFunctions, NULL, NULL));
+ this->keys = xCalloc(KEY_MAX, sizeof(Htop_Action));
+ this->inc = IncSet_new(MainPanel_getFunctionBar(this));
+
+ Action_setBindings(this->keys);
+ Platform_setBindings(this->keys);
+
+ return this;
+}
+
+void MainPanel_setState(MainPanel* this, State* state) {
+ this->state = state;
+}
+
+void MainPanel_delete(Object* object) {
+ Panel* super = (Panel*) object;
+ MainPanel* this = (MainPanel*) object;
+ Panel_done(super);
+ IncSet_delete(this->inc);
+ free(this->keys);
+ free(this);
+}
diff --git a/MainPanel.h b/MainPanel.h
new file mode 100644
index 0000000..83253d6
--- /dev/null
+++ b/MainPanel.h
@@ -0,0 +1,47 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_MainPanel
+#define HEADER_MainPanel
+/*
+htop - ColumnsPanel.h
+(C) 2004-2015 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Panel.h"
+#include "Action.h"
+#include "Settings.h"
+
+typedef struct MainPanel_ {
+ Panel super;
+ State* state;
+ IncSet* inc;
+ Htop_Action *keys;
+ pid_t pidSearch;
+} MainPanel;
+
+typedef bool(*MainPanel_ForeachProcessFn)(Process*, size_t);
+
+#define MainPanel_getFunctionBar(this_) (((Panel*)(this_))->defaultBar)
+
+
+void MainPanel_updateTreeFunctions(MainPanel* this, bool mode);
+
+void MainPanel_pidSearch(MainPanel* this, int ch);
+
+int MainPanel_selectedPid(MainPanel* this);
+
+const char* MainPanel_getValue(MainPanel* this, int i);
+
+bool MainPanel_foreachProcess(MainPanel* this, MainPanel_ForeachProcessFn fn, int arg, bool* wasAnyTagged);
+
+extern PanelClass MainPanel_class;
+
+MainPanel* MainPanel_new();
+
+void MainPanel_setState(MainPanel* this, State* state);
+
+void MainPanel_delete(Object* object);
+
+#endif
diff --git a/Makefile.am b/Makefile.am
index 820e2e5..8b31627 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,7 +1,9 @@
ACLOCAL_AMFLAGS = -I m4
+AUTOMAKE_OPTIONS = subdir-objects
bin_PROGRAMS = htop
+
dist_man_MANS = htop.1
EXTRA_DIST = $(dist_man_MANS) htop.desktop htop.png scripts/MakeHeader.py \
install-sh autogen.sh missing
@@ -10,31 +12,81 @@ applications_DATA = htop.desktop
pixmapdir = $(datadir)/pixmaps
pixmap_DATA = htop.png
-htop_CFLAGS = -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"$(sysconfdir)\"
+htop_CFLAGS = -pedantic -Wall $(wextra_flag) -std=c99 -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"$(sysconfdir)\" -I"$(top_srcdir)/$(my_htop_platform)"
+htop_LDFLAGS =
AM_CPPFLAGS = -DNDEBUG
myhtopsources = AvailableMetersPanel.c CategoriesPanel.c CheckItem.c \
-ClockMeter.c ColorsPanel.c ColumnsPanel.c CPUMeter.c CRT.c \
+ClockMeter.c ColorsPanel.c ColumnsPanel.c CPUMeter.c CRT.c MainPanel.c \
DisplayOptionsPanel.c FunctionBar.c Hashtable.c Header.c htop.c ListItem.c \
LoadAverageMeter.c MemoryMeter.c Meter.c MetersPanel.c Object.c Panel.c \
BatteryMeter.c Process.c ProcessList.c RichString.c ScreenManager.c Settings.c \
-IOPriorityPanel.c SignalsPanel.c String.c SwapMeter.c TasksMeter.c TraceScreen.c \
-UptimeMeter.c UsersTable.c Vector.c AvailableColumnsPanel.c AffinityPanel.c \
-HostnameMeter.c OpenFilesScreen.c Affinity.c IOPriority.c IncSet.c
+SignalsPanel.c StringUtils.c SwapMeter.c TasksMeter.c UptimeMeter.c \
+TraceScreen.c UsersTable.c Vector.c AvailableColumnsPanel.c AffinityPanel.c \
+HostnameMeter.c OpenFilesScreen.c Affinity.c IncSet.c Action.c EnvScreen.c \
+InfoScreen.c XAlloc.c
myhtopheaders = AvailableColumnsPanel.h AvailableMetersPanel.h \
CategoriesPanel.h CheckItem.h ClockMeter.h ColorsPanel.h ColumnsPanel.h \
-IOPriorityPanel.h CPUMeter.h CRT.h DisplayOptionsPanel.h FunctionBar.h \
+CPUMeter.h CRT.h MainPanel.h DisplayOptionsPanel.h FunctionBar.h \
Hashtable.h Header.h htop.h ListItem.h LoadAverageMeter.h MemoryMeter.h \
BatteryMeter.h Meter.h MetersPanel.h Object.h Panel.h ProcessList.h RichString.h \
-ScreenManager.h Settings.h SignalsPanel.h String.h SwapMeter.h TasksMeter.h \
-TraceScreen.h UptimeMeter.h UsersTable.h Vector.h Process.h AffinityPanel.h \
-HostnameMeter.h OpenFilesScreen.h Affinity.h IOPriority.h IncSet.h
+ScreenManager.h Settings.h SignalsPanel.h StringUtils.h SwapMeter.h \
+TasksMeter.h UptimeMeter.h TraceScreen.h UsersTable.h Vector.h Process.h \
+AffinityPanel.h HostnameMeter.h OpenFilesScreen.h Affinity.h IncSet.h Action.h \
+EnvScreen.h InfoScreen.h XAlloc.h
+
+if HTOP_LINUX
+htop_CFLAGS += -rdynamic
+myhtopplatsources = linux/Platform.c linux/IOPriorityPanel.c linux/IOPriority.c \
+linux/LinuxProcess.c linux/LinuxProcessList.c linux/LinuxCRT.c linux/Battery.c
+
+myhtopplatheaders = linux/Platform.h linux/IOPriorityPanel.h linux/IOPriority.h \
+linux/LinuxProcess.h linux/LinuxProcessList.h linux/LinuxCRT.h linux/Battery.h
+endif
+
+if HTOP_FREEBSD
+myhtopplatsources = freebsd/Platform.c freebsd/FreeBSDProcessList.c \
+freebsd/FreeBSDProcess.c freebsd/FreeBSDCRT.c freebsd/Battery.c
+
+myhtopplatheaders = freebsd/Platform.h freebsd/FreeBSDProcessList.h \
+freebsd/FreeBSDProcess.h freebsd/FreeBSDCRT.h freebsd/Battery.h
+endif
+
+if HTOP_OPENBSD
+myhtopplatsources = openbsd/Platform.c openbsd/OpenBSDProcessList.c \
+openbsd/OpenBSDProcess.c openbsd/OpenBSDCRT.c openbsd/Battery.c
+
+myhtopplatheaders = openbsd/Platform.h openbsd/OpenBSDProcessList.h \
+openbsd/OpenBSDProcess.h openbsd/OpenBSDCRT.h openbsd/Battery.h
+endif
+
+if HTOP_DARWIN
+htop_LDFLAGS += -framework IOKit -framework CoreFoundation
+myhtopplatsources = darwin/Platform.c darwin/DarwinProcess.c \
+darwin/DarwinProcessList.c darwin/DarwinCRT.c darwin/Battery.c
+
+myhtopplatheaders = darwin/Platform.h darwin/DarwinProcess.h \
+darwin/DarwinProcessList.h darwin/DarwinCRT.h darwin/Battery.h
+endif
+
+if HTOP_UNSUPPORTED
+myhtopplatsources = unsupported/Platform.c \
+unsupported/UnsupportedProcess.c unsupported/UnsupportedProcessList.c \
+unsupported/UnsupportedCRT.c unsupported/Battery.c
+
+myhtopplatheaders = unsupported/Platform.h \
+unsupported/UnsupportedProcess.h unsupported/UnsupportedProcessList.h \
+unsupported/UnsupportedCRT.h unsupported/Battery.h
+endif
SUFFIXES = .h
-BUILT_SOURCES = $(myhtopheaders)
-htop_SOURCES = $(myhtopheaders) $(myhtopsources) config.h
+BUILT_SOURCES = $(myhtopheaders) $(myhtopplatheaders)
+htop_SOURCES = $(myhtopheaders) $(myhtopplatheaders) $(myhtopsources) $(myhtopplatsources) config.h
+
+target:
+ echo $(htop_SOURCES)
profile:
$(MAKE) all CFLAGS="-pg" AM_CPPFLAGS="-pg -O2 -DNDEBUG"
@@ -42,8 +94,18 @@ profile:
debug:
$(MAKE) all CFLAGS="" AM_CPPFLAGS="-ggdb -DDEBUG"
+coverage:
+ $(MAKE) all CFLAGS="" AM_CPPFLAGS="-fprofile-arcs -ftest-coverage -DDEBUG" AM_LDFLAGS="-lgcov"
+
.c.h:
@srcdir@/scripts/MakeHeader.py $<
cppcheck:
cppcheck -q -v . --enable=all -DHAVE_CGROUP -DHAVE_OPENVZ -DHAVE_TASKSTATS
+
+.PHONY: lcov
+
+lcov:
+ mkdir -p lcov
+ lcov --capture --directory . --output-file coverage.info
+ genhtml coverage.info --output-directory lcov
diff --git a/Makefile.in b/Makefile.in
index 9cc52b7..d533aac 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,9 +1,8 @@
-# Makefile.in generated by automake 1.11.1 from Makefile.am.
+# Makefile.in generated by automake 1.14 from Makefile.am.
# @configure_input@
-# Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002,
-# 2003, 2004, 2005, 2006, 2007, 2008, 2009 Free Software Foundation,
-# Inc.
+# Copyright (C) 1994-2013 Free Software Foundation, Inc.
+
# This Makefile.in is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -17,6 +16,51 @@
VPATH = @srcdir@
+am__is_gnu_make = test -n '$(MAKEFILE_LIST)' && test -n '$(MAKELEVEL)'
+am__make_running_with_option = \
+ case $${target_option-} in \
+ ?) ;; \
+ *) echo "am__make_running_with_option: internal error: invalid" \
+ "target option '$${target_option-}' specified" >&2; \
+ exit 1;; \
+ esac; \
+ has_opt=no; \
+ sane_makeflags=$$MAKEFLAGS; \
+ if $(am__is_gnu_make); then \
+ sane_makeflags=$$MFLAGS; \
+ else \
+ case $$MAKEFLAGS in \
+ *\\[\ \ ]*) \
+ bs=\\; \
+ sane_makeflags=`printf '%s\n' "$$MAKEFLAGS" \
+ | sed "s/$$bs$$bs[$$bs $$bs ]*//g"`;; \
+ esac; \
+ fi; \
+ skip_next=no; \
+ strip_trailopt () \
+ { \
+ flg=`printf '%s\n' "$$flg" | sed "s/$$1.*$$//"`; \
+ }; \
+ for flg in $$sane_makeflags; do \
+ test $$skip_next = yes && { skip_next=no; continue; }; \
+ case $$flg in \
+ *=*|--*) continue;; \
+ -*I) strip_trailopt 'I'; skip_next=yes;; \
+ -*I?*) strip_trailopt 'I';; \
+ -*O) strip_trailopt 'O'; skip_next=yes;; \
+ -*O?*) strip_trailopt 'O';; \
+ -*l) strip_trailopt 'l'; skip_next=yes;; \
+ -*l?*) strip_trailopt 'l';; \
+ -[dEDm]) skip_next=yes;; \
+ -[JT]) skip_next=yes;; \
+ esac; \
+ case $$flg in \
+ *$$target_option*) has_opt=yes; break;; \
+ esac; \
+ done; \
+ test $$has_opt = yes
+am__make_dryrun = (target_option=n; $(am__make_running_with_option))
+am__make_keepgoing = (target_option=k; $(am__make_running_with_option))
pkgdatadir = $(datadir)/@PACKAGE@
pkgincludedir = $(includedir)/@PACKAGE@
pkglibdir = $(libdir)/@PACKAGE@
@@ -37,13 +81,15 @@ build_triplet = @build@
host_triplet = @host@
target_triplet = @target@
bin_PROGRAMS = htop$(EXEEXT)
+@HTOP_LINUX_TRUE@am__append_1 = -rdynamic
+@HTOP_DARWIN_TRUE@am__append_2 = -framework IOKit -framework CoreFoundation
subdir = .
-DIST_COMMON = README $(am__configure_deps) $(dist_man_MANS) \
- $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
- $(srcdir)/config.h.in $(srcdir)/htop.1.in \
- $(top_srcdir)/configure AUTHORS COPYING ChangeLog INSTALL NEWS \
- compile config.guess config.sub depcomp install-sh ltmain.sh \
- missing
+DIST_COMMON = INSTALL NEWS README AUTHORS ChangeLog \
+ $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
+ $(top_srcdir)/configure $(am__configure_deps) \
+ $(srcdir)/config.h.in $(srcdir)/htop.1.in depcomp \
+ $(dist_man_MANS) COPYING compile config.guess config.sub \
+ install-sh missing ltmain.sh
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/libtool.m4 \
$(top_srcdir)/m4/ltoptions.m4 $(top_srcdir)/m4/ltsugar.m4 \
@@ -60,50 +106,158 @@ CONFIG_CLEAN_VPATH_FILES =
am__installdirs = "$(DESTDIR)$(bindir)" "$(DESTDIR)$(man1dir)" \
"$(DESTDIR)$(applicationsdir)" "$(DESTDIR)$(pixmapdir)"
PROGRAMS = $(bin_PROGRAMS)
+am__htop_SOURCES_DIST = AvailableColumnsPanel.h AvailableMetersPanel.h \
+ CategoriesPanel.h CheckItem.h ClockMeter.h ColorsPanel.h \
+ ColumnsPanel.h CPUMeter.h CRT.h MainPanel.h \
+ DisplayOptionsPanel.h FunctionBar.h Hashtable.h Header.h \
+ htop.h ListItem.h LoadAverageMeter.h MemoryMeter.h \
+ BatteryMeter.h Meter.h MetersPanel.h Object.h Panel.h \
+ ProcessList.h RichString.h ScreenManager.h Settings.h \
+ SignalsPanel.h StringUtils.h SwapMeter.h TasksMeter.h \
+ UptimeMeter.h TraceScreen.h UsersTable.h Vector.h Process.h \
+ AffinityPanel.h HostnameMeter.h OpenFilesScreen.h Affinity.h \
+ IncSet.h Action.h EnvScreen.h InfoScreen.h XAlloc.h \
+ darwin/Platform.h darwin/DarwinProcess.h \
+ darwin/DarwinProcessList.h darwin/DarwinCRT.h darwin/Battery.h \
+ freebsd/Platform.h freebsd/FreeBSDProcessList.h \
+ freebsd/FreeBSDProcess.h freebsd/FreeBSDCRT.h \
+ freebsd/Battery.h linux/Platform.h linux/IOPriorityPanel.h \
+ linux/IOPriority.h linux/LinuxProcess.h \
+ linux/LinuxProcessList.h linux/LinuxCRT.h linux/Battery.h \
+ openbsd/Platform.h openbsd/OpenBSDProcessList.h \
+ openbsd/OpenBSDProcess.h openbsd/OpenBSDCRT.h \
+ openbsd/Battery.h unsupported/Platform.h \
+ unsupported/UnsupportedProcess.h \
+ unsupported/UnsupportedProcessList.h \
+ unsupported/UnsupportedCRT.h unsupported/Battery.h \
+ AvailableMetersPanel.c CategoriesPanel.c CheckItem.c \
+ ClockMeter.c ColorsPanel.c ColumnsPanel.c CPUMeter.c CRT.c \
+ MainPanel.c DisplayOptionsPanel.c FunctionBar.c Hashtable.c \
+ Header.c htop.c ListItem.c LoadAverageMeter.c MemoryMeter.c \
+ Meter.c MetersPanel.c Object.c Panel.c BatteryMeter.c \
+ Process.c ProcessList.c RichString.c ScreenManager.c \
+ Settings.c SignalsPanel.c StringUtils.c SwapMeter.c \
+ TasksMeter.c UptimeMeter.c TraceScreen.c UsersTable.c Vector.c \
+ AvailableColumnsPanel.c AffinityPanel.c HostnameMeter.c \
+ OpenFilesScreen.c Affinity.c IncSet.c Action.c EnvScreen.c \
+ InfoScreen.c XAlloc.c darwin/Platform.c darwin/DarwinProcess.c \
+ darwin/DarwinProcessList.c darwin/DarwinCRT.c darwin/Battery.c \
+ freebsd/Platform.c freebsd/FreeBSDProcessList.c \
+ freebsd/FreeBSDProcess.c freebsd/FreeBSDCRT.c \
+ freebsd/Battery.c linux/Platform.c linux/IOPriorityPanel.c \
+ linux/IOPriority.c linux/LinuxProcess.c \
+ linux/LinuxProcessList.c linux/LinuxCRT.c linux/Battery.c \
+ openbsd/Platform.c openbsd/OpenBSDProcessList.c \
+ openbsd/OpenBSDProcess.c openbsd/OpenBSDCRT.c \
+ openbsd/Battery.c unsupported/Platform.c \
+ unsupported/UnsupportedProcess.c \
+ unsupported/UnsupportedProcessList.c \
+ unsupported/UnsupportedCRT.c unsupported/Battery.c config.h
am__objects_1 =
am__objects_2 = htop-AvailableMetersPanel.$(OBJEXT) \
htop-CategoriesPanel.$(OBJEXT) htop-CheckItem.$(OBJEXT) \
htop-ClockMeter.$(OBJEXT) htop-ColorsPanel.$(OBJEXT) \
htop-ColumnsPanel.$(OBJEXT) htop-CPUMeter.$(OBJEXT) \
- htop-CRT.$(OBJEXT) htop-DisplayOptionsPanel.$(OBJEXT) \
- htop-FunctionBar.$(OBJEXT) htop-Hashtable.$(OBJEXT) \
- htop-Header.$(OBJEXT) htop-htop.$(OBJEXT) \
- htop-ListItem.$(OBJEXT) htop-LoadAverageMeter.$(OBJEXT) \
- htop-MemoryMeter.$(OBJEXT) htop-Meter.$(OBJEXT) \
- htop-MetersPanel.$(OBJEXT) htop-Object.$(OBJEXT) \
- htop-Panel.$(OBJEXT) htop-BatteryMeter.$(OBJEXT) \
- htop-Process.$(OBJEXT) htop-ProcessList.$(OBJEXT) \
- htop-RichString.$(OBJEXT) htop-ScreenManager.$(OBJEXT) \
- htop-Settings.$(OBJEXT) htop-IOPriorityPanel.$(OBJEXT) \
- htop-SignalsPanel.$(OBJEXT) htop-String.$(OBJEXT) \
+ htop-CRT.$(OBJEXT) htop-MainPanel.$(OBJEXT) \
+ htop-DisplayOptionsPanel.$(OBJEXT) htop-FunctionBar.$(OBJEXT) \
+ htop-Hashtable.$(OBJEXT) htop-Header.$(OBJEXT) \
+ htop-htop.$(OBJEXT) htop-ListItem.$(OBJEXT) \
+ htop-LoadAverageMeter.$(OBJEXT) htop-MemoryMeter.$(OBJEXT) \
+ htop-Meter.$(OBJEXT) htop-MetersPanel.$(OBJEXT) \
+ htop-Object.$(OBJEXT) htop-Panel.$(OBJEXT) \
+ htop-BatteryMeter.$(OBJEXT) htop-Process.$(OBJEXT) \
+ htop-ProcessList.$(OBJEXT) htop-RichString.$(OBJEXT) \
+ htop-ScreenManager.$(OBJEXT) htop-Settings.$(OBJEXT) \
+ htop-SignalsPanel.$(OBJEXT) htop-StringUtils.$(OBJEXT) \
htop-SwapMeter.$(OBJEXT) htop-TasksMeter.$(OBJEXT) \
- htop-TraceScreen.$(OBJEXT) htop-UptimeMeter.$(OBJEXT) \
+ htop-UptimeMeter.$(OBJEXT) htop-TraceScreen.$(OBJEXT) \
htop-UsersTable.$(OBJEXT) htop-Vector.$(OBJEXT) \
htop-AvailableColumnsPanel.$(OBJEXT) \
htop-AffinityPanel.$(OBJEXT) htop-HostnameMeter.$(OBJEXT) \
htop-OpenFilesScreen.$(OBJEXT) htop-Affinity.$(OBJEXT) \
- htop-IOPriority.$(OBJEXT) htop-IncSet.$(OBJEXT)
-am_htop_OBJECTS = $(am__objects_1) $(am__objects_2)
+ htop-IncSet.$(OBJEXT) htop-Action.$(OBJEXT) \
+ htop-EnvScreen.$(OBJEXT) htop-InfoScreen.$(OBJEXT) \
+ htop-XAlloc.$(OBJEXT)
+am__dirstamp = $(am__leading_dot)dirstamp
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_FALSE@@HTOP_UNSUPPORTED_TRUE@am__objects_3 = unsupported/htop-Platform.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_FALSE@@HTOP_UNSUPPORTED_TRUE@ unsupported/htop-UnsupportedProcess.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_FALSE@@HTOP_UNSUPPORTED_TRUE@ unsupported/htop-UnsupportedProcessList.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_FALSE@@HTOP_UNSUPPORTED_TRUE@ unsupported/htop-UnsupportedCRT.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_FALSE@@HTOP_UNSUPPORTED_TRUE@ unsupported/htop-Battery.$(OBJEXT)
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_TRUE@am__objects_3 = openbsd/htop-Platform.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_TRUE@ openbsd/htop-OpenBSDProcessList.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_TRUE@ openbsd/htop-OpenBSDProcess.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_TRUE@ openbsd/htop-OpenBSDCRT.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_FALSE@@HTOP_OPENBSD_TRUE@ openbsd/htop-Battery.$(OBJEXT)
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_TRUE@am__objects_3 = linux/htop-Platform.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_TRUE@ linux/htop-IOPriorityPanel.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_TRUE@ linux/htop-IOPriority.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_TRUE@ linux/htop-LinuxProcess.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_TRUE@ linux/htop-LinuxProcessList.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_TRUE@ linux/htop-LinuxCRT.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_FALSE@@HTOP_LINUX_TRUE@ linux/htop-Battery.$(OBJEXT)
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_TRUE@am__objects_3 = freebsd/htop-Platform.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_TRUE@ freebsd/htop-FreeBSDProcessList.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_TRUE@ freebsd/htop-FreeBSDProcess.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_TRUE@ freebsd/htop-FreeBSDCRT.$(OBJEXT) \
+@HTOP_DARWIN_FALSE@@HTOP_FREEBSD_TRUE@ freebsd/htop-Battery.$(OBJEXT)
+@HTOP_DARWIN_TRUE@am__objects_3 = darwin/htop-Platform.$(OBJEXT) \
+@HTOP_DARWIN_TRUE@ darwin/htop-DarwinProcess.$(OBJEXT) \
+@HTOP_DARWIN_TRUE@ darwin/htop-DarwinProcessList.$(OBJEXT) \
+@HTOP_DARWIN_TRUE@ darwin/htop-DarwinCRT.$(OBJEXT) \
+@HTOP_DARWIN_TRUE@ darwin/htop-Battery.$(OBJEXT)
+am_htop_OBJECTS = $(am__objects_1) $(am__objects_1) $(am__objects_2) \
+ $(am__objects_3)
htop_OBJECTS = $(am_htop_OBJECTS)
htop_LDADD = $(LDADD)
-htop_LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=link $(CCLD) $(htop_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
+AM_V_lt = $(am__v_lt_@AM_V@)
+am__v_lt_ = $(am__v_lt_@AM_DEFAULT_V@)
+am__v_lt_0 = --silent
+am__v_lt_1 =
+htop_LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(htop_CFLAGS) $(CFLAGS) \
+ $(htop_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_P = $(am__v_P_@AM_V@)
+am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
+am__v_P_0 = false
+am__v_P_1 = :
+AM_V_GEN = $(am__v_GEN_@AM_V@)
+am__v_GEN_ = $(am__v_GEN_@AM_DEFAULT_V@)
+am__v_GEN_0 = @echo " GEN " $@;
+am__v_GEN_1 =
+AM_V_at = $(am__v_at_@AM_V@)
+am__v_at_ = $(am__v_at_@AM_DEFAULT_V@)
+am__v_at_0 = @
+am__v_at_1 =
DEFAULT_INCLUDES = -I.@am__isrc@
depcomp = $(SHELL) $(top_srcdir)/depcomp
am__depfiles_maybe = depfiles
am__mv = mv -f
COMPILE = $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) \
$(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
-LTCOMPILE = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=compile $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
- $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CFLAGS) $(CFLAGS)
+LTCOMPILE = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=compile $(CC) $(DEFS) \
+ $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) \
+ $(AM_CFLAGS) $(CFLAGS)
+AM_V_CC = $(am__v_CC_@AM_V@)
+am__v_CC_ = $(am__v_CC_@AM_DEFAULT_V@)
+am__v_CC_0 = @echo " CC " $@;
+am__v_CC_1 =
CCLD = $(CC)
-LINK = $(LIBTOOL) --tag=CC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) \
- --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) $(AM_LDFLAGS) \
- $(LDFLAGS) -o $@
+LINK = $(LIBTOOL) $(AM_V_lt) --tag=CC $(AM_LIBTOOLFLAGS) \
+ $(LIBTOOLFLAGS) --mode=link $(CCLD) $(AM_CFLAGS) $(CFLAGS) \
+ $(AM_LDFLAGS) $(LDFLAGS) -o $@
+AM_V_CCLD = $(am__v_CCLD_@AM_V@)
+am__v_CCLD_ = $(am__v_CCLD_@AM_DEFAULT_V@)
+am__v_CCLD_0 = @echo " CCLD " $@;
+am__v_CCLD_1 =
SOURCES = $(htop_SOURCES)
-DIST_SOURCES = $(htop_SOURCES)
+DIST_SOURCES = $(am__htop_SOURCES_DIST)
+am__can_run_installinfo = \
+ case $$AM_UPDATE_INFO_DIR in \
+ n|no|NO) false;; \
+ *) (install-info --version) >/dev/null 2>&1;; \
+ esac
am__vpath_adj_setup = srcdirstrip=`echo "$(srcdir)" | sed 's|.|.|g'`;
am__vpath_adj = case $$p in \
$(srcdir)/*) f=`echo "$$p" | sed "s|^$$srcdirstrip/||"`;; \
@@ -125,25 +279,58 @@ am__nobase_list = $(am__nobase_strip_setup); \
am__base_list = \
sed '$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;$$!N;s/\n/ /g' | \
sed '$$!N;$$!N;$$!N;$$!N;s/\n/ /g'
+am__uninstall_files_from_dir = { \
+ test -z "$$files" \
+ || { test ! -d "$$dir" && test ! -f "$$dir" && test ! -r "$$dir"; } \
+ || { echo " ( cd '$$dir' && rm -f" $$files ")"; \
+ $(am__cd) "$$dir" && rm -f $$files; }; \
+ }
man1dir = $(mandir)/man1
NROFF = nroff
MANS = $(dist_man_MANS)
DATA = $(applications_DATA) $(pixmap_DATA)
+am__tagged_files = $(HEADERS) $(SOURCES) $(TAGS_FILES) \
+ $(LISP)config.h.in
+# Read a list of newline-separated strings from the standard input,
+# and print each of them once, without duplicates. Input order is
+# *not* preserved.
+am__uniquify_input = $(AWK) '\
+ BEGIN { nonempty = 0; } \
+ { items[$$0] = 1; nonempty = 1; } \
+ END { if (nonempty) { for (i in items) print i; }; } \
+'
+# Make sure the list of sources is unique. This is necessary because,
+# e.g., the same source file might be shared among _SOURCES variables
+# for different programs/libraries.
+am__define_uniq_tagged_files = \
+ list='$(am__tagged_files)'; \
+ unique=`for i in $$list; do \
+ if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
+ done | $(am__uniquify_input)`
ETAGS = etags
CTAGS = ctags
+CSCOPE = cscope
+AM_RECURSIVE_TARGETS = cscope
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
distdir = $(PACKAGE)-$(VERSION)
top_distdir = $(distdir)
am__remove_distdir = \
- { test ! -d "$(distdir)" \
- || { find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
- && rm -fr "$(distdir)"; }; }
+ if test -d "$(distdir)"; then \
+ find "$(distdir)" -type d ! -perm -200 -exec chmod u+w {} ';' \
+ && rm -rf "$(distdir)" \
+ || { sleep 5 && rm -rf "$(distdir)"; }; \
+ else :; fi
+am__post_remove_distdir = $(am__remove_distdir)
DIST_ARCHIVES = $(distdir).tar.gz
GZIP_ENV = --best
+DIST_TARGETS = dist-gzip
distuninstallcheck_listfiles = find . -type f -print
+am__distuninstallcheck_listfiles = $(distuninstallcheck_listfiles) \
+ | sed 's|^\./|$(prefix)/|' | grep -v '$(infodir)/dir$$'
distcleancheck_listfiles = find . -type f -print
ACLOCAL = @ACLOCAL@
AMTAR = @AMTAR@
+AM_DEFAULT_VERBOSITY = @AM_DEFAULT_VERBOSITY@
AR = @AR@
AUTOCONF = @AUTOCONF@
AUTOHEADER = @AUTOHEADER@
@@ -157,6 +344,7 @@ CPPFLAGS = @CPPFLAGS@
CYGPATH_W = @CYGPATH_W@
DEFS = @DEFS@
DEPDIR = @DEPDIR@
+DLLTOOL = @DLLTOOL@
DSYMUTIL = @DSYMUTIL@
DUMPBIN = @DUMPBIN@
ECHO_C = @ECHO_C@
@@ -180,6 +368,7 @@ LIPO = @LIPO@
LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAKEINFO = @MAKEINFO@
+MANIFEST_TOOL = @MANIFEST_TOOL@
MKDIR_P = @MKDIR_P@
NM = @NM@
NMEDIT = @NMEDIT@
@@ -205,6 +394,7 @@ abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
+ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
@@ -239,6 +429,7 @@ localedir = @localedir@
localstatedir = @localstatedir@
mandir = @mandir@
mkdir_p = @mkdir_p@
+my_htop_platform = @my_htop_platform@
oldincludedir = @oldincludedir@
pdfdir = @pdfdir@
prefix = @prefix@
@@ -256,7 +447,9 @@ target_vendor = @target_vendor@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
+wextra_flag = @wextra_flag@
ACLOCAL_AMFLAGS = -I m4
+AUTOMAKE_OPTIONS = subdir-objects
dist_man_MANS = htop.1
EXTRA_DIST = $(dist_man_MANS) htop.desktop htop.png scripts/MakeHeader.py \
install-sh autogen.sh missing
@@ -265,35 +458,72 @@ applicationsdir = $(datadir)/applications
applications_DATA = htop.desktop
pixmapdir = $(datadir)/pixmaps
pixmap_DATA = htop.png
-htop_CFLAGS = -pedantic -Wall -Wextra -std=c99 -rdynamic -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"$(sysconfdir)\"
+htop_CFLAGS = -pedantic -Wall $(wextra_flag) -std=c99 \
+ -D_XOPEN_SOURCE_EXTENDED -DSYSCONFDIR=\"$(sysconfdir)\" \
+ -I"$(top_srcdir)/$(my_htop_platform)" $(am__append_1)
+htop_LDFLAGS = $(am__append_2)
AM_CPPFLAGS = -DNDEBUG
myhtopsources = AvailableMetersPanel.c CategoriesPanel.c CheckItem.c \
-ClockMeter.c ColorsPanel.c ColumnsPanel.c CPUMeter.c CRT.c \
+ClockMeter.c ColorsPanel.c ColumnsPanel.c CPUMeter.c CRT.c MainPanel.c \
DisplayOptionsPanel.c FunctionBar.c Hashtable.c Header.c htop.c ListItem.c \
LoadAverageMeter.c MemoryMeter.c Meter.c MetersPanel.c Object.c Panel.c \
BatteryMeter.c Process.c ProcessList.c RichString.c ScreenManager.c Settings.c \
-IOPriorityPanel.c SignalsPanel.c String.c SwapMeter.c TasksMeter.c TraceScreen.c \
-UptimeMeter.c UsersTable.c Vector.c AvailableColumnsPanel.c AffinityPanel.c \
-HostnameMeter.c OpenFilesScreen.c Affinity.c IOPriority.c IncSet.c
+SignalsPanel.c StringUtils.c SwapMeter.c TasksMeter.c UptimeMeter.c \
+TraceScreen.c UsersTable.c Vector.c AvailableColumnsPanel.c AffinityPanel.c \
+HostnameMeter.c OpenFilesScreen.c Affinity.c IncSet.c Action.c EnvScreen.c \
+InfoScreen.c XAlloc.c
myhtopheaders = AvailableColumnsPanel.h AvailableMetersPanel.h \
CategoriesPanel.h CheckItem.h ClockMeter.h ColorsPanel.h ColumnsPanel.h \
-IOPriorityPanel.h CPUMeter.h CRT.h DisplayOptionsPanel.h FunctionBar.h \
+CPUMeter.h CRT.h MainPanel.h DisplayOptionsPanel.h FunctionBar.h \
Hashtable.h Header.h htop.h ListItem.h LoadAverageMeter.h MemoryMeter.h \
BatteryMeter.h Meter.h MetersPanel.h Object.h Panel.h ProcessList.h RichString.h \
-ScreenManager.h Settings.h SignalsPanel.h String.h SwapMeter.h TasksMeter.h \
-TraceScreen.h UptimeMeter.h UsersTable.h Vector.h Process.h AffinityPanel.h \
-HostnameMeter.h OpenFilesScreen.h Affinity.h IOPriority.h IncSet.h
+ScreenManager.h Settings.h SignalsPanel.h StringUtils.h SwapMeter.h \
+TasksMeter.h UptimeMeter.h TraceScreen.h UsersTable.h Vector.h Process.h \
+AffinityPanel.h HostnameMeter.h OpenFilesScreen.h Affinity.h IncSet.h Action.h \
+EnvScreen.h InfoScreen.h XAlloc.h
+
+@HTOP_DARWIN_TRUE@myhtopplatsources = darwin/Platform.c darwin/DarwinProcess.c \
+@HTOP_DARWIN_TRUE@darwin/DarwinProcessList.c darwin/DarwinCRT.c darwin/Battery.c
+
+@HTOP_FREEBSD_TRUE@myhtopplatsources = freebsd/Platform.c freebsd/FreeBSDProcessList.c \
+@HTOP_FREEBSD_TRUE@freebsd/FreeBSDProcess.c freebsd/FreeBSDCRT.c freebsd/Battery.c
+
+@HTOP_LINUX_TRUE@myhtopplatsources = linux/Platform.c linux/IOPriorityPanel.c linux/IOPriority.c \
+@HTOP_LINUX_TRUE@linux/LinuxProcess.c linux/LinuxProcessList.c linux/LinuxCRT.c linux/Battery.c
+
+@HTOP_OPENBSD_TRUE@myhtopplatsources = openbsd/Platform.c openbsd/OpenBSDProcessList.c \
+@HTOP_OPENBSD_TRUE@openbsd/OpenBSDProcess.c openbsd/OpenBSDCRT.c openbsd/Battery.c
+
+@HTOP_UNSUPPORTED_TRUE@myhtopplatsources = unsupported/Platform.c \
+@HTOP_UNSUPPORTED_TRUE@unsupported/UnsupportedProcess.c unsupported/UnsupportedProcessList.c \
+@HTOP_UNSUPPORTED_TRUE@unsupported/UnsupportedCRT.c unsupported/Battery.c
+
+@HTOP_DARWIN_TRUE@myhtopplatheaders = darwin/Platform.h darwin/DarwinProcess.h \
+@HTOP_DARWIN_TRUE@darwin/DarwinProcessList.h darwin/DarwinCRT.h darwin/Battery.h
+
+@HTOP_FREEBSD_TRUE@myhtopplatheaders = freebsd/Platform.h freebsd/FreeBSDProcessList.h \
+@HTOP_FREEBSD_TRUE@freebsd/FreeBSDProcess.h freebsd/FreeBSDCRT.h freebsd/Battery.h
+
+@HTOP_LINUX_TRUE@myhtopplatheaders = linux/Platform.h linux/IOPriorityPanel.h linux/IOPriority.h \
+@HTOP_LINUX_TRUE@linux/LinuxProcess.h linux/LinuxProcessList.h linux/LinuxCRT.h linux/Battery.h
+
+@HTOP_OPENBSD_TRUE@myhtopplatheaders = openbsd/Platform.h openbsd/OpenBSDProcessList.h \
+@HTOP_OPENBSD_TRUE@openbsd/OpenBSDProcess.h openbsd/OpenBSDCRT.h openbsd/Battery.h
+
+@HTOP_UNSUPPORTED_TRUE@myhtopplatheaders = unsupported/Platform.h \
+@HTOP_UNSUPPORTED_TRUE@unsupported/UnsupportedProcess.h unsupported/UnsupportedProcessList.h \
+@HTOP_UNSUPPORTED_TRUE@unsupported/UnsupportedCRT.h unsupported/Battery.h
SUFFIXES = .h
-BUILT_SOURCES = $(myhtopheaders)
-htop_SOURCES = $(myhtopheaders) $(myhtopsources) config.h
+BUILT_SOURCES = $(myhtopheaders) $(myhtopplatheaders)
+htop_SOURCES = $(myhtopheaders) $(myhtopplatheaders) $(myhtopsources) $(myhtopplatsources) config.h
all: $(BUILT_SOURCES) config.h
$(MAKE) $(AM_MAKEFLAGS) all-am
.SUFFIXES:
.SUFFIXES: .h .c .lo .o .obj
-am--refresh:
+am--refresh: Makefile
@:
$(srcdir)/Makefile.in: $(srcdir)/Makefile.am $(am__configure_deps)
@for dep in $?; do \
@@ -329,10 +559,8 @@ $(ACLOCAL_M4): $(am__aclocal_m4_deps)
$(am__aclocal_m4_deps):
config.h: stamp-h1
- @if test ! -f $@; then \
- rm -f stamp-h1; \
- $(MAKE) $(AM_MAKEFLAGS) stamp-h1; \
- else :; fi
+ @test -f $@ || rm -f stamp-h1
+ @test -f $@ || $(MAKE) $(AM_MAKEFLAGS) stamp-h1
stamp-h1: $(srcdir)/config.h.in $(top_builddir)/config.status
@rm -f stamp-h1
@@ -348,14 +576,19 @@ htop.1: $(top_builddir)/config.status $(srcdir)/htop.1.in
cd $(top_builddir) && $(SHELL) ./config.status $@
install-binPROGRAMS: $(bin_PROGRAMS)
@$(NORMAL_INSTALL)
- test -z "$(bindir)" || $(MKDIR_P) "$(DESTDIR)$(bindir)"
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(bindir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(bindir)" || exit 1; \
+ fi; \
for p in $$list; do echo "$$p $$p"; done | \
sed 's/$(EXEEXT)$$//' | \
- while read p p1; do if test -f $$p || test -f $$p1; \
- then echo "$$p"; echo "$$p"; else :; fi; \
+ while read p p1; do if test -f $$p \
+ || test -f $$p1 \
+ ; then echo "$$p"; echo "$$p"; else :; fi; \
done | \
- sed -e 'p;s,.*/,,;n;h' -e 's|.*|.|' \
+ sed -e 'p;s,.*/,,;n;h' \
+ -e 's|.*|.|' \
-e 'p;x;s,.*/,,;s/$(EXEEXT)$$//;$(transform);s/$$/$(EXEEXT)/' | \
sed 'N;N;N;s,\n, ,g' | \
$(AWK) 'BEGIN { files["."] = ""; dirs["."] = 1 } \
@@ -376,7 +609,8 @@ uninstall-binPROGRAMS:
@list='$(bin_PROGRAMS)'; test -n "$(bindir)" || list=; \
files=`for p in $$list; do echo "$$p"; done | \
sed -e 'h;s,^.*/,,;s/$(EXEEXT)$$//;$(transform)' \
- -e 's/$$/$(EXEEXT)/' `; \
+ -e 's/$$/$(EXEEXT)/' \
+ `; \
test -n "$$list" || exit 0; \
echo " ( cd '$(DESTDIR)$(bindir)' && rm -f" $$files ")"; \
cd "$(DESTDIR)$(bindir)" && rm -f $$files
@@ -389,16 +623,110 @@ clean-binPROGRAMS:
list=`for p in $$list; do echo "$$p"; done | sed 's/$(EXEEXT)$$//'`; \
echo " rm -f" $$list; \
rm -f $$list
-htop$(EXEEXT): $(htop_OBJECTS) $(htop_DEPENDENCIES)
+darwin/$(am__dirstamp):
+ @$(MKDIR_P) darwin
+ @: > darwin/$(am__dirstamp)
+darwin/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) darwin/$(DEPDIR)
+ @: > darwin/$(DEPDIR)/$(am__dirstamp)
+darwin/htop-Platform.$(OBJEXT): darwin/$(am__dirstamp) \
+ darwin/$(DEPDIR)/$(am__dirstamp)
+darwin/htop-DarwinProcess.$(OBJEXT): darwin/$(am__dirstamp) \
+ darwin/$(DEPDIR)/$(am__dirstamp)
+darwin/htop-DarwinProcessList.$(OBJEXT): darwin/$(am__dirstamp) \
+ darwin/$(DEPDIR)/$(am__dirstamp)
+darwin/htop-DarwinCRT.$(OBJEXT): darwin/$(am__dirstamp) \
+ darwin/$(DEPDIR)/$(am__dirstamp)
+darwin/htop-Battery.$(OBJEXT): darwin/$(am__dirstamp) \
+ darwin/$(DEPDIR)/$(am__dirstamp)
+freebsd/$(am__dirstamp):
+ @$(MKDIR_P) freebsd
+ @: > freebsd/$(am__dirstamp)
+freebsd/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) freebsd/$(DEPDIR)
+ @: > freebsd/$(DEPDIR)/$(am__dirstamp)
+freebsd/htop-Platform.$(OBJEXT): freebsd/$(am__dirstamp) \
+ freebsd/$(DEPDIR)/$(am__dirstamp)
+freebsd/htop-FreeBSDProcessList.$(OBJEXT): freebsd/$(am__dirstamp) \
+ freebsd/$(DEPDIR)/$(am__dirstamp)
+freebsd/htop-FreeBSDProcess.$(OBJEXT): freebsd/$(am__dirstamp) \
+ freebsd/$(DEPDIR)/$(am__dirstamp)
+freebsd/htop-FreeBSDCRT.$(OBJEXT): freebsd/$(am__dirstamp) \
+ freebsd/$(DEPDIR)/$(am__dirstamp)
+freebsd/htop-Battery.$(OBJEXT): freebsd/$(am__dirstamp) \
+ freebsd/$(DEPDIR)/$(am__dirstamp)
+linux/$(am__dirstamp):
+ @$(MKDIR_P) linux
+ @: > linux/$(am__dirstamp)
+linux/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) linux/$(DEPDIR)
+ @: > linux/$(DEPDIR)/$(am__dirstamp)
+linux/htop-Platform.$(OBJEXT): linux/$(am__dirstamp) \
+ linux/$(DEPDIR)/$(am__dirstamp)
+linux/htop-IOPriorityPanel.$(OBJEXT): linux/$(am__dirstamp) \
+ linux/$(DEPDIR)/$(am__dirstamp)
+linux/htop-IOPriority.$(OBJEXT): linux/$(am__dirstamp) \
+ linux/$(DEPDIR)/$(am__dirstamp)
+linux/htop-LinuxProcess.$(OBJEXT): linux/$(am__dirstamp) \
+ linux/$(DEPDIR)/$(am__dirstamp)
+linux/htop-LinuxProcessList.$(OBJEXT): linux/$(am__dirstamp) \
+ linux/$(DEPDIR)/$(am__dirstamp)
+linux/htop-LinuxCRT.$(OBJEXT): linux/$(am__dirstamp) \
+ linux/$(DEPDIR)/$(am__dirstamp)
+linux/htop-Battery.$(OBJEXT): linux/$(am__dirstamp) \
+ linux/$(DEPDIR)/$(am__dirstamp)
+openbsd/$(am__dirstamp):
+ @$(MKDIR_P) openbsd
+ @: > openbsd/$(am__dirstamp)
+openbsd/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) openbsd/$(DEPDIR)
+ @: > openbsd/$(DEPDIR)/$(am__dirstamp)
+openbsd/htop-Platform.$(OBJEXT): openbsd/$(am__dirstamp) \
+ openbsd/$(DEPDIR)/$(am__dirstamp)
+openbsd/htop-OpenBSDProcessList.$(OBJEXT): openbsd/$(am__dirstamp) \
+ openbsd/$(DEPDIR)/$(am__dirstamp)
+openbsd/htop-OpenBSDProcess.$(OBJEXT): openbsd/$(am__dirstamp) \
+ openbsd/$(DEPDIR)/$(am__dirstamp)
+openbsd/htop-OpenBSDCRT.$(OBJEXT): openbsd/$(am__dirstamp) \
+ openbsd/$(DEPDIR)/$(am__dirstamp)
+openbsd/htop-Battery.$(OBJEXT): openbsd/$(am__dirstamp) \
+ openbsd/$(DEPDIR)/$(am__dirstamp)
+unsupported/$(am__dirstamp):
+ @$(MKDIR_P) unsupported
+ @: > unsupported/$(am__dirstamp)
+unsupported/$(DEPDIR)/$(am__dirstamp):
+ @$(MKDIR_P) unsupported/$(DEPDIR)
+ @: > unsupported/$(DEPDIR)/$(am__dirstamp)
+unsupported/htop-Platform.$(OBJEXT): unsupported/$(am__dirstamp) \
+ unsupported/$(DEPDIR)/$(am__dirstamp)
+unsupported/htop-UnsupportedProcess.$(OBJEXT): \
+ unsupported/$(am__dirstamp) \
+ unsupported/$(DEPDIR)/$(am__dirstamp)
+unsupported/htop-UnsupportedProcessList.$(OBJEXT): \
+ unsupported/$(am__dirstamp) \
+ unsupported/$(DEPDIR)/$(am__dirstamp)
+unsupported/htop-UnsupportedCRT.$(OBJEXT): \
+ unsupported/$(am__dirstamp) \
+ unsupported/$(DEPDIR)/$(am__dirstamp)
+unsupported/htop-Battery.$(OBJEXT): unsupported/$(am__dirstamp) \
+ unsupported/$(DEPDIR)/$(am__dirstamp)
+
+htop$(EXEEXT): $(htop_OBJECTS) $(htop_DEPENDENCIES) $(EXTRA_htop_DEPENDENCIES)
@rm -f htop$(EXEEXT)
- $(htop_LINK) $(htop_OBJECTS) $(htop_LDADD) $(LIBS)
+ $(AM_V_CCLD)$(htop_LINK) $(htop_OBJECTS) $(htop_LDADD) $(LIBS)
mostlyclean-compile:
-rm -f *.$(OBJEXT)
+ -rm -f darwin/*.$(OBJEXT)
+ -rm -f freebsd/*.$(OBJEXT)
+ -rm -f linux/*.$(OBJEXT)
+ -rm -f openbsd/*.$(OBJEXT)
+ -rm -f unsupported/*.$(OBJEXT)
distclean-compile:
-rm -f *.tab.c
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-Action.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-Affinity.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-AffinityPanel.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-AvailableColumnsPanel.Po@am__quote@
@@ -412,15 +740,16 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-ColorsPanel.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-ColumnsPanel.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-DisplayOptionsPanel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-EnvScreen.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-FunctionBar.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-Hashtable.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-Header.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-HostnameMeter.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-IOPriority.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-IOPriorityPanel.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-IncSet.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-InfoScreen.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-ListItem.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-LoadAverageMeter.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-MainPanel.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-MemoryMeter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-Meter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-MetersPanel.Po@am__quote@
@@ -433,623 +762,1074 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-ScreenManager.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-Settings.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-SignalsPanel.Po@am__quote@
-@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-String.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-StringUtils.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-SwapMeter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-TasksMeter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-TraceScreen.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-UptimeMeter.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-UsersTable.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-Vector.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-XAlloc.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/htop-htop.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@darwin/$(DEPDIR)/htop-Battery.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@darwin/$(DEPDIR)/htop-DarwinCRT.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@darwin/$(DEPDIR)/htop-DarwinProcess.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@darwin/$(DEPDIR)/htop-DarwinProcessList.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@darwin/$(DEPDIR)/htop-Platform.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@freebsd/$(DEPDIR)/htop-Battery.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@freebsd/$(DEPDIR)/htop-FreeBSDCRT.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@freebsd/$(DEPDIR)/htop-FreeBSDProcess.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@freebsd/$(DEPDIR)/htop-FreeBSDProcessList.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@freebsd/$(DEPDIR)/htop-Platform.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/htop-Battery.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/htop-IOPriority.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/htop-IOPriorityPanel.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/htop-LinuxCRT.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/htop-LinuxProcess.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/htop-LinuxProcessList.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@linux/$(DEPDIR)/htop-Platform.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@openbsd/$(DEPDIR)/htop-Battery.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@openbsd/$(DEPDIR)/htop-OpenBSDCRT.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@openbsd/$(DEPDIR)/htop-OpenBSDProcess.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@openbsd/$(DEPDIR)/htop-OpenBSDProcessList.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@openbsd/$(DEPDIR)/htop-Platform.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@unsupported/$(DEPDIR)/htop-Battery.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@unsupported/$(DEPDIR)/htop-Platform.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@unsupported/$(DEPDIR)/htop-UnsupportedCRT.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@unsupported/$(DEPDIR)/htop-UnsupportedProcess.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@unsupported/$(DEPDIR)/htop-UnsupportedProcessList.Po@am__quote@
.c.o:
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.o$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c $<
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ $<
.c.obj:
-@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ `$(CYGPATH_W) '$<'`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.obj$$||'`;\
+@am__fastdepCC_TRUE@ $(COMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ `$(CYGPATH_W) '$<'` &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(COMPILE) -c `$(CYGPATH_W) '$<'`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(COMPILE) -c -o $@ `$(CYGPATH_W) '$<'`
.c.lo:
-@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $(DEPDIR)/$*.Tpo -c -o $@ $<
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/$*.Tpo $(DEPDIR)/$*.Plo
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)depbase=`echo $@ | sed 's|[^/]*$$|$(DEPDIR)/&|;s|\.lo$$||'`;\
+@am__fastdepCC_TRUE@ $(LTCOMPILE) -MT $@ -MD -MP -MF $$depbase.Tpo -c -o $@ $< &&\
+@am__fastdepCC_TRUE@ $(am__mv) $$depbase.Tpo $$depbase.Plo
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='$<' object='$@' libtool=yes @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(LTCOMPILE) -c -o $@ $<
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(LTCOMPILE) -c -o $@ $<
htop-AvailableMetersPanel.o: AvailableMetersPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AvailableMetersPanel.o -MD -MP -MF $(DEPDIR)/htop-AvailableMetersPanel.Tpo -c -o htop-AvailableMetersPanel.o `test -f 'AvailableMetersPanel.c' || echo '$(srcdir)/'`AvailableMetersPanel.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-AvailableMetersPanel.Tpo $(DEPDIR)/htop-AvailableMetersPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='AvailableMetersPanel.c' object='htop-AvailableMetersPanel.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AvailableMetersPanel.o -MD -MP -MF $(DEPDIR)/htop-AvailableMetersPanel.Tpo -c -o htop-AvailableMetersPanel.o `test -f 'AvailableMetersPanel.c' || echo '$(srcdir)/'`AvailableMetersPanel.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-AvailableMetersPanel.Tpo $(DEPDIR)/htop-AvailableMetersPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='AvailableMetersPanel.c' object='htop-AvailableMetersPanel.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AvailableMetersPanel.o `test -f 'AvailableMetersPanel.c' || echo '$(srcdir)/'`AvailableMetersPanel.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AvailableMetersPanel.o `test -f 'AvailableMetersPanel.c' || echo '$(srcdir)/'`AvailableMetersPanel.c
htop-AvailableMetersPanel.obj: AvailableMetersPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AvailableMetersPanel.obj -MD -MP -MF $(DEPDIR)/htop-AvailableMetersPanel.Tpo -c -o htop-AvailableMetersPanel.obj `if test -f 'AvailableMetersPanel.c'; then $(CYGPATH_W) 'AvailableMetersPanel.c'; else $(CYGPATH_W) '$(srcdir)/AvailableMetersPanel.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-AvailableMetersPanel.Tpo $(DEPDIR)/htop-AvailableMetersPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='AvailableMetersPanel.c' object='htop-AvailableMetersPanel.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AvailableMetersPanel.obj -MD -MP -MF $(DEPDIR)/htop-AvailableMetersPanel.Tpo -c -o htop-AvailableMetersPanel.obj `if test -f 'AvailableMetersPanel.c'; then $(CYGPATH_W) 'AvailableMetersPanel.c'; else $(CYGPATH_W) '$(srcdir)/AvailableMetersPanel.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-AvailableMetersPanel.Tpo $(DEPDIR)/htop-AvailableMetersPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='AvailableMetersPanel.c' object='htop-AvailableMetersPanel.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AvailableMetersPanel.obj `if test -f 'AvailableMetersPanel.c'; then $(CYGPATH_W) 'AvailableMetersPanel.c'; else $(CYGPATH_W) '$(srcdir)/AvailableMetersPanel.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AvailableMetersPanel.obj `if test -f 'AvailableMetersPanel.c'; then $(CYGPATH_W) 'AvailableMetersPanel.c'; else $(CYGPATH_W) '$(srcdir)/AvailableMetersPanel.c'; fi`
htop-CategoriesPanel.o: CategoriesPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CategoriesPanel.o -MD -MP -MF $(DEPDIR)/htop-CategoriesPanel.Tpo -c -o htop-CategoriesPanel.o `test -f 'CategoriesPanel.c' || echo '$(srcdir)/'`CategoriesPanel.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-CategoriesPanel.Tpo $(DEPDIR)/htop-CategoriesPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='CategoriesPanel.c' object='htop-CategoriesPanel.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CategoriesPanel.o -MD -MP -MF $(DEPDIR)/htop-CategoriesPanel.Tpo -c -o htop-CategoriesPanel.o `test -f 'CategoriesPanel.c' || echo '$(srcdir)/'`CategoriesPanel.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-CategoriesPanel.Tpo $(DEPDIR)/htop-CategoriesPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CategoriesPanel.c' object='htop-CategoriesPanel.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CategoriesPanel.o `test -f 'CategoriesPanel.c' || echo '$(srcdir)/'`CategoriesPanel.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CategoriesPanel.o `test -f 'CategoriesPanel.c' || echo '$(srcdir)/'`CategoriesPanel.c
htop-CategoriesPanel.obj: CategoriesPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CategoriesPanel.obj -MD -MP -MF $(DEPDIR)/htop-CategoriesPanel.Tpo -c -o htop-CategoriesPanel.obj `if test -f 'CategoriesPanel.c'; then $(CYGPATH_W) 'CategoriesPanel.c'; else $(CYGPATH_W) '$(srcdir)/CategoriesPanel.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-CategoriesPanel.Tpo $(DEPDIR)/htop-CategoriesPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='CategoriesPanel.c' object='htop-CategoriesPanel.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CategoriesPanel.obj -MD -MP -MF $(DEPDIR)/htop-CategoriesPanel.Tpo -c -o htop-CategoriesPanel.obj `if test -f 'CategoriesPanel.c'; then $(CYGPATH_W) 'CategoriesPanel.c'; else $(CYGPATH_W) '$(srcdir)/CategoriesPanel.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-CategoriesPanel.Tpo $(DEPDIR)/htop-CategoriesPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CategoriesPanel.c' object='htop-CategoriesPanel.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CategoriesPanel.obj `if test -f 'CategoriesPanel.c'; then $(CYGPATH_W) 'CategoriesPanel.c'; else $(CYGPATH_W) '$(srcdir)/CategoriesPanel.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CategoriesPanel.obj `if test -f 'CategoriesPanel.c'; then $(CYGPATH_W) 'CategoriesPanel.c'; else $(CYGPATH_W) '$(srcdir)/CategoriesPanel.c'; fi`
htop-CheckItem.o: CheckItem.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CheckItem.o -MD -MP -MF $(DEPDIR)/htop-CheckItem.Tpo -c -o htop-CheckItem.o `test -f 'CheckItem.c' || echo '$(srcdir)/'`CheckItem.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-CheckItem.Tpo $(DEPDIR)/htop-CheckItem.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='CheckItem.c' object='htop-CheckItem.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CheckItem.o -MD -MP -MF $(DEPDIR)/htop-CheckItem.Tpo -c -o htop-CheckItem.o `test -f 'CheckItem.c' || echo '$(srcdir)/'`CheckItem.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-CheckItem.Tpo $(DEPDIR)/htop-CheckItem.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CheckItem.c' object='htop-CheckItem.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CheckItem.o `test -f 'CheckItem.c' || echo '$(srcdir)/'`CheckItem.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CheckItem.o `test -f 'CheckItem.c' || echo '$(srcdir)/'`CheckItem.c
htop-CheckItem.obj: CheckItem.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CheckItem.obj -MD -MP -MF $(DEPDIR)/htop-CheckItem.Tpo -c -o htop-CheckItem.obj `if test -f 'CheckItem.c'; then $(CYGPATH_W) 'CheckItem.c'; else $(CYGPATH_W) '$(srcdir)/CheckItem.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-CheckItem.Tpo $(DEPDIR)/htop-CheckItem.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='CheckItem.c' object='htop-CheckItem.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CheckItem.obj -MD -MP -MF $(DEPDIR)/htop-CheckItem.Tpo -c -o htop-CheckItem.obj `if test -f 'CheckItem.c'; then $(CYGPATH_W) 'CheckItem.c'; else $(CYGPATH_W) '$(srcdir)/CheckItem.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-CheckItem.Tpo $(DEPDIR)/htop-CheckItem.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CheckItem.c' object='htop-CheckItem.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CheckItem.obj `if test -f 'CheckItem.c'; then $(CYGPATH_W) 'CheckItem.c'; else $(CYGPATH_W) '$(srcdir)/CheckItem.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CheckItem.obj `if test -f 'CheckItem.c'; then $(CYGPATH_W) 'CheckItem.c'; else $(CYGPATH_W) '$(srcdir)/CheckItem.c'; fi`
htop-ClockMeter.o: ClockMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ClockMeter.o -MD -MP -MF $(DEPDIR)/htop-ClockMeter.Tpo -c -o htop-ClockMeter.o `test -f 'ClockMeter.c' || echo '$(srcdir)/'`ClockMeter.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-ClockMeter.Tpo $(DEPDIR)/htop-ClockMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ClockMeter.c' object='htop-ClockMeter.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ClockMeter.o -MD -MP -MF $(DEPDIR)/htop-ClockMeter.Tpo -c -o htop-ClockMeter.o `test -f 'ClockMeter.c' || echo '$(srcdir)/'`ClockMeter.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ClockMeter.Tpo $(DEPDIR)/htop-ClockMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ClockMeter.c' object='htop-ClockMeter.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ClockMeter.o `test -f 'ClockMeter.c' || echo '$(srcdir)/'`ClockMeter.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ClockMeter.o `test -f 'ClockMeter.c' || echo '$(srcdir)/'`ClockMeter.c
htop-ClockMeter.obj: ClockMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ClockMeter.obj -MD -MP -MF $(DEPDIR)/htop-ClockMeter.Tpo -c -o htop-ClockMeter.obj `if test -f 'ClockMeter.c'; then $(CYGPATH_W) 'ClockMeter.c'; else $(CYGPATH_W) '$(srcdir)/ClockMeter.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-ClockMeter.Tpo $(DEPDIR)/htop-ClockMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ClockMeter.c' object='htop-ClockMeter.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ClockMeter.obj -MD -MP -MF $(DEPDIR)/htop-ClockMeter.Tpo -c -o htop-ClockMeter.obj `if test -f 'ClockMeter.c'; then $(CYGPATH_W) 'ClockMeter.c'; else $(CYGPATH_W) '$(srcdir)/ClockMeter.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ClockMeter.Tpo $(DEPDIR)/htop-ClockMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ClockMeter.c' object='htop-ClockMeter.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ClockMeter.obj `if test -f 'ClockMeter.c'; then $(CYGPATH_W) 'ClockMeter.c'; else $(CYGPATH_W) '$(srcdir)/ClockMeter.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ClockMeter.obj `if test -f 'ClockMeter.c'; then $(CYGPATH_W) 'ClockMeter.c'; else $(CYGPATH_W) '$(srcdir)/ClockMeter.c'; fi`
htop-ColorsPanel.o: ColorsPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ColorsPanel.o -MD -MP -MF $(DEPDIR)/htop-ColorsPanel.Tpo -c -o htop-ColorsPanel.o `test -f 'ColorsPanel.c' || echo '$(srcdir)/'`ColorsPanel.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-ColorsPanel.Tpo $(DEPDIR)/htop-ColorsPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ColorsPanel.c' object='htop-ColorsPanel.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ColorsPanel.o -MD -MP -MF $(DEPDIR)/htop-ColorsPanel.Tpo -c -o htop-ColorsPanel.o `test -f 'ColorsPanel.c' || echo '$(srcdir)/'`ColorsPanel.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ColorsPanel.Tpo $(DEPDIR)/htop-ColorsPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ColorsPanel.c' object='htop-ColorsPanel.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ColorsPanel.o `test -f 'ColorsPanel.c' || echo '$(srcdir)/'`ColorsPanel.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ColorsPanel.o `test -f 'ColorsPanel.c' || echo '$(srcdir)/'`ColorsPanel.c
htop-ColorsPanel.obj: ColorsPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ColorsPanel.obj -MD -MP -MF $(DEPDIR)/htop-ColorsPanel.Tpo -c -o htop-ColorsPanel.obj `if test -f 'ColorsPanel.c'; then $(CYGPATH_W) 'ColorsPanel.c'; else $(CYGPATH_W) '$(srcdir)/ColorsPanel.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-ColorsPanel.Tpo $(DEPDIR)/htop-ColorsPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ColorsPanel.c' object='htop-ColorsPanel.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ColorsPanel.obj -MD -MP -MF $(DEPDIR)/htop-ColorsPanel.Tpo -c -o htop-ColorsPanel.obj `if test -f 'ColorsPanel.c'; then $(CYGPATH_W) 'ColorsPanel.c'; else $(CYGPATH_W) '$(srcdir)/ColorsPanel.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ColorsPanel.Tpo $(DEPDIR)/htop-ColorsPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ColorsPanel.c' object='htop-ColorsPanel.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ColorsPanel.obj `if test -f 'ColorsPanel.c'; then $(CYGPATH_W) 'ColorsPanel.c'; else $(CYGPATH_W) '$(srcdir)/ColorsPanel.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ColorsPanel.obj `if test -f 'ColorsPanel.c'; then $(CYGPATH_W) 'ColorsPanel.c'; else $(CYGPATH_W) '$(srcdir)/ColorsPanel.c'; fi`
htop-ColumnsPanel.o: ColumnsPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ColumnsPanel.o -MD -MP -MF $(DEPDIR)/htop-ColumnsPanel.Tpo -c -o htop-ColumnsPanel.o `test -f 'ColumnsPanel.c' || echo '$(srcdir)/'`ColumnsPanel.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-ColumnsPanel.Tpo $(DEPDIR)/htop-ColumnsPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ColumnsPanel.c' object='htop-ColumnsPanel.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ColumnsPanel.o -MD -MP -MF $(DEPDIR)/htop-ColumnsPanel.Tpo -c -o htop-ColumnsPanel.o `test -f 'ColumnsPanel.c' || echo '$(srcdir)/'`ColumnsPanel.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ColumnsPanel.Tpo $(DEPDIR)/htop-ColumnsPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ColumnsPanel.c' object='htop-ColumnsPanel.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ColumnsPanel.o `test -f 'ColumnsPanel.c' || echo '$(srcdir)/'`ColumnsPanel.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ColumnsPanel.o `test -f 'ColumnsPanel.c' || echo '$(srcdir)/'`ColumnsPanel.c
htop-ColumnsPanel.obj: ColumnsPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ColumnsPanel.obj -MD -MP -MF $(DEPDIR)/htop-ColumnsPanel.Tpo -c -o htop-ColumnsPanel.obj `if test -f 'ColumnsPanel.c'; then $(CYGPATH_W) 'ColumnsPanel.c'; else $(CYGPATH_W) '$(srcdir)/ColumnsPanel.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-ColumnsPanel.Tpo $(DEPDIR)/htop-ColumnsPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ColumnsPanel.c' object='htop-ColumnsPanel.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ColumnsPanel.obj -MD -MP -MF $(DEPDIR)/htop-ColumnsPanel.Tpo -c -o htop-ColumnsPanel.obj `if test -f 'ColumnsPanel.c'; then $(CYGPATH_W) 'ColumnsPanel.c'; else $(CYGPATH_W) '$(srcdir)/ColumnsPanel.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ColumnsPanel.Tpo $(DEPDIR)/htop-ColumnsPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ColumnsPanel.c' object='htop-ColumnsPanel.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ColumnsPanel.obj `if test -f 'ColumnsPanel.c'; then $(CYGPATH_W) 'ColumnsPanel.c'; else $(CYGPATH_W) '$(srcdir)/ColumnsPanel.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ColumnsPanel.obj `if test -f 'ColumnsPanel.c'; then $(CYGPATH_W) 'ColumnsPanel.c'; else $(CYGPATH_W) '$(srcdir)/ColumnsPanel.c'; fi`
htop-CPUMeter.o: CPUMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CPUMeter.o -MD -MP -MF $(DEPDIR)/htop-CPUMeter.Tpo -c -o htop-CPUMeter.o `test -f 'CPUMeter.c' || echo '$(srcdir)/'`CPUMeter.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-CPUMeter.Tpo $(DEPDIR)/htop-CPUMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='CPUMeter.c' object='htop-CPUMeter.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CPUMeter.o -MD -MP -MF $(DEPDIR)/htop-CPUMeter.Tpo -c -o htop-CPUMeter.o `test -f 'CPUMeter.c' || echo '$(srcdir)/'`CPUMeter.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-CPUMeter.Tpo $(DEPDIR)/htop-CPUMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CPUMeter.c' object='htop-CPUMeter.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CPUMeter.o `test -f 'CPUMeter.c' || echo '$(srcdir)/'`CPUMeter.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CPUMeter.o `test -f 'CPUMeter.c' || echo '$(srcdir)/'`CPUMeter.c
htop-CPUMeter.obj: CPUMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CPUMeter.obj -MD -MP -MF $(DEPDIR)/htop-CPUMeter.Tpo -c -o htop-CPUMeter.obj `if test -f 'CPUMeter.c'; then $(CYGPATH_W) 'CPUMeter.c'; else $(CYGPATH_W) '$(srcdir)/CPUMeter.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-CPUMeter.Tpo $(DEPDIR)/htop-CPUMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='CPUMeter.c' object='htop-CPUMeter.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CPUMeter.obj -MD -MP -MF $(DEPDIR)/htop-CPUMeter.Tpo -c -o htop-CPUMeter.obj `if test -f 'CPUMeter.c'; then $(CYGPATH_W) 'CPUMeter.c'; else $(CYGPATH_W) '$(srcdir)/CPUMeter.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-CPUMeter.Tpo $(DEPDIR)/htop-CPUMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CPUMeter.c' object='htop-CPUMeter.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CPUMeter.obj `if test -f 'CPUMeter.c'; then $(CYGPATH_W) 'CPUMeter.c'; else $(CYGPATH_W) '$(srcdir)/CPUMeter.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CPUMeter.obj `if test -f 'CPUMeter.c'; then $(CYGPATH_W) 'CPUMeter.c'; else $(CYGPATH_W) '$(srcdir)/CPUMeter.c'; fi`
htop-CRT.o: CRT.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CRT.o -MD -MP -MF $(DEPDIR)/htop-CRT.Tpo -c -o htop-CRT.o `test -f 'CRT.c' || echo '$(srcdir)/'`CRT.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-CRT.Tpo $(DEPDIR)/htop-CRT.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='CRT.c' object='htop-CRT.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CRT.o -MD -MP -MF $(DEPDIR)/htop-CRT.Tpo -c -o htop-CRT.o `test -f 'CRT.c' || echo '$(srcdir)/'`CRT.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-CRT.Tpo $(DEPDIR)/htop-CRT.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CRT.c' object='htop-CRT.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CRT.o `test -f 'CRT.c' || echo '$(srcdir)/'`CRT.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CRT.o `test -f 'CRT.c' || echo '$(srcdir)/'`CRT.c
htop-CRT.obj: CRT.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CRT.obj -MD -MP -MF $(DEPDIR)/htop-CRT.Tpo -c -o htop-CRT.obj `if test -f 'CRT.c'; then $(CYGPATH_W) 'CRT.c'; else $(CYGPATH_W) '$(srcdir)/CRT.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-CRT.Tpo $(DEPDIR)/htop-CRT.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='CRT.c' object='htop-CRT.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-CRT.obj -MD -MP -MF $(DEPDIR)/htop-CRT.Tpo -c -o htop-CRT.obj `if test -f 'CRT.c'; then $(CYGPATH_W) 'CRT.c'; else $(CYGPATH_W) '$(srcdir)/CRT.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-CRT.Tpo $(DEPDIR)/htop-CRT.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='CRT.c' object='htop-CRT.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CRT.obj `if test -f 'CRT.c'; then $(CYGPATH_W) 'CRT.c'; else $(CYGPATH_W) '$(srcdir)/CRT.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-CRT.obj `if test -f 'CRT.c'; then $(CYGPATH_W) 'CRT.c'; else $(CYGPATH_W) '$(srcdir)/CRT.c'; fi`
+
+htop-MainPanel.o: MainPanel.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-MainPanel.o -MD -MP -MF $(DEPDIR)/htop-MainPanel.Tpo -c -o htop-MainPanel.o `test -f 'MainPanel.c' || echo '$(srcdir)/'`MainPanel.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-MainPanel.Tpo $(DEPDIR)/htop-MainPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='MainPanel.c' object='htop-MainPanel.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-MainPanel.o `test -f 'MainPanel.c' || echo '$(srcdir)/'`MainPanel.c
+
+htop-MainPanel.obj: MainPanel.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-MainPanel.obj -MD -MP -MF $(DEPDIR)/htop-MainPanel.Tpo -c -o htop-MainPanel.obj `if test -f 'MainPanel.c'; then $(CYGPATH_W) 'MainPanel.c'; else $(CYGPATH_W) '$(srcdir)/MainPanel.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-MainPanel.Tpo $(DEPDIR)/htop-MainPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='MainPanel.c' object='htop-MainPanel.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-MainPanel.obj `if test -f 'MainPanel.c'; then $(CYGPATH_W) 'MainPanel.c'; else $(CYGPATH_W) '$(srcdir)/MainPanel.c'; fi`
htop-DisplayOptionsPanel.o: DisplayOptionsPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-DisplayOptionsPanel.o -MD -MP -MF $(DEPDIR)/htop-DisplayOptionsPanel.Tpo -c -o htop-DisplayOptionsPanel.o `test -f 'DisplayOptionsPanel.c' || echo '$(srcdir)/'`DisplayOptionsPanel.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-DisplayOptionsPanel.Tpo $(DEPDIR)/htop-DisplayOptionsPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='DisplayOptionsPanel.c' object='htop-DisplayOptionsPanel.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-DisplayOptionsPanel.o -MD -MP -MF $(DEPDIR)/htop-DisplayOptionsPanel.Tpo -c -o htop-DisplayOptionsPanel.o `test -f 'DisplayOptionsPanel.c' || echo '$(srcdir)/'`DisplayOptionsPanel.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-DisplayOptionsPanel.Tpo $(DEPDIR)/htop-DisplayOptionsPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='DisplayOptionsPanel.c' object='htop-DisplayOptionsPanel.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-DisplayOptionsPanel.o `test -f 'DisplayOptionsPanel.c' || echo '$(srcdir)/'`DisplayOptionsPanel.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-DisplayOptionsPanel.o `test -f 'DisplayOptionsPanel.c' || echo '$(srcdir)/'`DisplayOptionsPanel.c
htop-DisplayOptionsPanel.obj: DisplayOptionsPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-DisplayOptionsPanel.obj -MD -MP -MF $(DEPDIR)/htop-DisplayOptionsPanel.Tpo -c -o htop-DisplayOptionsPanel.obj `if test -f 'DisplayOptionsPanel.c'; then $(CYGPATH_W) 'DisplayOptionsPanel.c'; else $(CYGPATH_W) '$(srcdir)/DisplayOptionsPanel.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-DisplayOptionsPanel.Tpo $(DEPDIR)/htop-DisplayOptionsPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='DisplayOptionsPanel.c' object='htop-DisplayOptionsPanel.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-DisplayOptionsPanel.obj -MD -MP -MF $(DEPDIR)/htop-DisplayOptionsPanel.Tpo -c -o htop-DisplayOptionsPanel.obj `if test -f 'DisplayOptionsPanel.c'; then $(CYGPATH_W) 'DisplayOptionsPanel.c'; else $(CYGPATH_W) '$(srcdir)/DisplayOptionsPanel.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-DisplayOptionsPanel.Tpo $(DEPDIR)/htop-DisplayOptionsPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='DisplayOptionsPanel.c' object='htop-DisplayOptionsPanel.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-DisplayOptionsPanel.obj `if test -f 'DisplayOptionsPanel.c'; then $(CYGPATH_W) 'DisplayOptionsPanel.c'; else $(CYGPATH_W) '$(srcdir)/DisplayOptionsPanel.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-DisplayOptionsPanel.obj `if test -f 'DisplayOptionsPanel.c'; then $(CYGPATH_W) 'DisplayOptionsPanel.c'; else $(CYGPATH_W) '$(srcdir)/DisplayOptionsPanel.c'; fi`
htop-FunctionBar.o: FunctionBar.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-FunctionBar.o -MD -MP -MF $(DEPDIR)/htop-FunctionBar.Tpo -c -o htop-FunctionBar.o `test -f 'FunctionBar.c' || echo '$(srcdir)/'`FunctionBar.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-FunctionBar.Tpo $(DEPDIR)/htop-FunctionBar.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='FunctionBar.c' object='htop-FunctionBar.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-FunctionBar.o -MD -MP -MF $(DEPDIR)/htop-FunctionBar.Tpo -c -o htop-FunctionBar.o `test -f 'FunctionBar.c' || echo '$(srcdir)/'`FunctionBar.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-FunctionBar.Tpo $(DEPDIR)/htop-FunctionBar.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='FunctionBar.c' object='htop-FunctionBar.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-FunctionBar.o `test -f 'FunctionBar.c' || echo '$(srcdir)/'`FunctionBar.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-FunctionBar.o `test -f 'FunctionBar.c' || echo '$(srcdir)/'`FunctionBar.c
htop-FunctionBar.obj: FunctionBar.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-FunctionBar.obj -MD -MP -MF $(DEPDIR)/htop-FunctionBar.Tpo -c -o htop-FunctionBar.obj `if test -f 'FunctionBar.c'; then $(CYGPATH_W) 'FunctionBar.c'; else $(CYGPATH_W) '$(srcdir)/FunctionBar.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-FunctionBar.Tpo $(DEPDIR)/htop-FunctionBar.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='FunctionBar.c' object='htop-FunctionBar.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-FunctionBar.obj -MD -MP -MF $(DEPDIR)/htop-FunctionBar.Tpo -c -o htop-FunctionBar.obj `if test -f 'FunctionBar.c'; then $(CYGPATH_W) 'FunctionBar.c'; else $(CYGPATH_W) '$(srcdir)/FunctionBar.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-FunctionBar.Tpo $(DEPDIR)/htop-FunctionBar.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='FunctionBar.c' object='htop-FunctionBar.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-FunctionBar.obj `if test -f 'FunctionBar.c'; then $(CYGPATH_W) 'FunctionBar.c'; else $(CYGPATH_W) '$(srcdir)/FunctionBar.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-FunctionBar.obj `if test -f 'FunctionBar.c'; then $(CYGPATH_W) 'FunctionBar.c'; else $(CYGPATH_W) '$(srcdir)/FunctionBar.c'; fi`
htop-Hashtable.o: Hashtable.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Hashtable.o -MD -MP -MF $(DEPDIR)/htop-Hashtable.Tpo -c -o htop-Hashtable.o `test -f 'Hashtable.c' || echo '$(srcdir)/'`Hashtable.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Hashtable.Tpo $(DEPDIR)/htop-Hashtable.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Hashtable.c' object='htop-Hashtable.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Hashtable.o -MD -MP -MF $(DEPDIR)/htop-Hashtable.Tpo -c -o htop-Hashtable.o `test -f 'Hashtable.c' || echo '$(srcdir)/'`Hashtable.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Hashtable.Tpo $(DEPDIR)/htop-Hashtable.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Hashtable.c' object='htop-Hashtable.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Hashtable.o `test -f 'Hashtable.c' || echo '$(srcdir)/'`Hashtable.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Hashtable.o `test -f 'Hashtable.c' || echo '$(srcdir)/'`Hashtable.c
htop-Hashtable.obj: Hashtable.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Hashtable.obj -MD -MP -MF $(DEPDIR)/htop-Hashtable.Tpo -c -o htop-Hashtable.obj `if test -f 'Hashtable.c'; then $(CYGPATH_W) 'Hashtable.c'; else $(CYGPATH_W) '$(srcdir)/Hashtable.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Hashtable.Tpo $(DEPDIR)/htop-Hashtable.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Hashtable.c' object='htop-Hashtable.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Hashtable.obj -MD -MP -MF $(DEPDIR)/htop-Hashtable.Tpo -c -o htop-Hashtable.obj `if test -f 'Hashtable.c'; then $(CYGPATH_W) 'Hashtable.c'; else $(CYGPATH_W) '$(srcdir)/Hashtable.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Hashtable.Tpo $(DEPDIR)/htop-Hashtable.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Hashtable.c' object='htop-Hashtable.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Hashtable.obj `if test -f 'Hashtable.c'; then $(CYGPATH_W) 'Hashtable.c'; else $(CYGPATH_W) '$(srcdir)/Hashtable.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Hashtable.obj `if test -f 'Hashtable.c'; then $(CYGPATH_W) 'Hashtable.c'; else $(CYGPATH_W) '$(srcdir)/Hashtable.c'; fi`
htop-Header.o: Header.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Header.o -MD -MP -MF $(DEPDIR)/htop-Header.Tpo -c -o htop-Header.o `test -f 'Header.c' || echo '$(srcdir)/'`Header.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Header.Tpo $(DEPDIR)/htop-Header.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Header.c' object='htop-Header.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Header.o -MD -MP -MF $(DEPDIR)/htop-Header.Tpo -c -o htop-Header.o `test -f 'Header.c' || echo '$(srcdir)/'`Header.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Header.Tpo $(DEPDIR)/htop-Header.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Header.c' object='htop-Header.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Header.o `test -f 'Header.c' || echo '$(srcdir)/'`Header.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Header.o `test -f 'Header.c' || echo '$(srcdir)/'`Header.c
htop-Header.obj: Header.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Header.obj -MD -MP -MF $(DEPDIR)/htop-Header.Tpo -c -o htop-Header.obj `if test -f 'Header.c'; then $(CYGPATH_W) 'Header.c'; else $(CYGPATH_W) '$(srcdir)/Header.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Header.Tpo $(DEPDIR)/htop-Header.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Header.c' object='htop-Header.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Header.obj -MD -MP -MF $(DEPDIR)/htop-Header.Tpo -c -o htop-Header.obj `if test -f 'Header.c'; then $(CYGPATH_W) 'Header.c'; else $(CYGPATH_W) '$(srcdir)/Header.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Header.Tpo $(DEPDIR)/htop-Header.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Header.c' object='htop-Header.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Header.obj `if test -f 'Header.c'; then $(CYGPATH_W) 'Header.c'; else $(CYGPATH_W) '$(srcdir)/Header.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Header.obj `if test -f 'Header.c'; then $(CYGPATH_W) 'Header.c'; else $(CYGPATH_W) '$(srcdir)/Header.c'; fi`
htop-htop.o: htop.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-htop.o -MD -MP -MF $(DEPDIR)/htop-htop.Tpo -c -o htop-htop.o `test -f 'htop.c' || echo '$(srcdir)/'`htop.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-htop.Tpo $(DEPDIR)/htop-htop.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htop.c' object='htop-htop.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-htop.o -MD -MP -MF $(DEPDIR)/htop-htop.Tpo -c -o htop-htop.o `test -f 'htop.c' || echo '$(srcdir)/'`htop.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-htop.Tpo $(DEPDIR)/htop-htop.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='htop.c' object='htop-htop.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-htop.o `test -f 'htop.c' || echo '$(srcdir)/'`htop.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-htop.o `test -f 'htop.c' || echo '$(srcdir)/'`htop.c
htop-htop.obj: htop.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-htop.obj -MD -MP -MF $(DEPDIR)/htop-htop.Tpo -c -o htop-htop.obj `if test -f 'htop.c'; then $(CYGPATH_W) 'htop.c'; else $(CYGPATH_W) '$(srcdir)/htop.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-htop.Tpo $(DEPDIR)/htop-htop.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='htop.c' object='htop-htop.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-htop.obj -MD -MP -MF $(DEPDIR)/htop-htop.Tpo -c -o htop-htop.obj `if test -f 'htop.c'; then $(CYGPATH_W) 'htop.c'; else $(CYGPATH_W) '$(srcdir)/htop.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-htop.Tpo $(DEPDIR)/htop-htop.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='htop.c' object='htop-htop.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-htop.obj `if test -f 'htop.c'; then $(CYGPATH_W) 'htop.c'; else $(CYGPATH_W) '$(srcdir)/htop.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-htop.obj `if test -f 'htop.c'; then $(CYGPATH_W) 'htop.c'; else $(CYGPATH_W) '$(srcdir)/htop.c'; fi`
htop-ListItem.o: ListItem.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ListItem.o -MD -MP -MF $(DEPDIR)/htop-ListItem.Tpo -c -o htop-ListItem.o `test -f 'ListItem.c' || echo '$(srcdir)/'`ListItem.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-ListItem.Tpo $(DEPDIR)/htop-ListItem.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ListItem.c' object='htop-ListItem.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ListItem.o -MD -MP -MF $(DEPDIR)/htop-ListItem.Tpo -c -o htop-ListItem.o `test -f 'ListItem.c' || echo '$(srcdir)/'`ListItem.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ListItem.Tpo $(DEPDIR)/htop-ListItem.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ListItem.c' object='htop-ListItem.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ListItem.o `test -f 'ListItem.c' || echo '$(srcdir)/'`ListItem.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ListItem.o `test -f 'ListItem.c' || echo '$(srcdir)/'`ListItem.c
htop-ListItem.obj: ListItem.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ListItem.obj -MD -MP -MF $(DEPDIR)/htop-ListItem.Tpo -c -o htop-ListItem.obj `if test -f 'ListItem.c'; then $(CYGPATH_W) 'ListItem.c'; else $(CYGPATH_W) '$(srcdir)/ListItem.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-ListItem.Tpo $(DEPDIR)/htop-ListItem.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ListItem.c' object='htop-ListItem.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ListItem.obj -MD -MP -MF $(DEPDIR)/htop-ListItem.Tpo -c -o htop-ListItem.obj `if test -f 'ListItem.c'; then $(CYGPATH_W) 'ListItem.c'; else $(CYGPATH_W) '$(srcdir)/ListItem.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ListItem.Tpo $(DEPDIR)/htop-ListItem.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ListItem.c' object='htop-ListItem.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ListItem.obj `if test -f 'ListItem.c'; then $(CYGPATH_W) 'ListItem.c'; else $(CYGPATH_W) '$(srcdir)/ListItem.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ListItem.obj `if test -f 'ListItem.c'; then $(CYGPATH_W) 'ListItem.c'; else $(CYGPATH_W) '$(srcdir)/ListItem.c'; fi`
htop-LoadAverageMeter.o: LoadAverageMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-LoadAverageMeter.o -MD -MP -MF $(DEPDIR)/htop-LoadAverageMeter.Tpo -c -o htop-LoadAverageMeter.o `test -f 'LoadAverageMeter.c' || echo '$(srcdir)/'`LoadAverageMeter.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-LoadAverageMeter.Tpo $(DEPDIR)/htop-LoadAverageMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='LoadAverageMeter.c' object='htop-LoadAverageMeter.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-LoadAverageMeter.o -MD -MP -MF $(DEPDIR)/htop-LoadAverageMeter.Tpo -c -o htop-LoadAverageMeter.o `test -f 'LoadAverageMeter.c' || echo '$(srcdir)/'`LoadAverageMeter.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-LoadAverageMeter.Tpo $(DEPDIR)/htop-LoadAverageMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='LoadAverageMeter.c' object='htop-LoadAverageMeter.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-LoadAverageMeter.o `test -f 'LoadAverageMeter.c' || echo '$(srcdir)/'`LoadAverageMeter.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-LoadAverageMeter.o `test -f 'LoadAverageMeter.c' || echo '$(srcdir)/'`LoadAverageMeter.c
htop-LoadAverageMeter.obj: LoadAverageMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-LoadAverageMeter.obj -MD -MP -MF $(DEPDIR)/htop-LoadAverageMeter.Tpo -c -o htop-LoadAverageMeter.obj `if test -f 'LoadAverageMeter.c'; then $(CYGPATH_W) 'LoadAverageMeter.c'; else $(CYGPATH_W) '$(srcdir)/LoadAverageMeter.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-LoadAverageMeter.Tpo $(DEPDIR)/htop-LoadAverageMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='LoadAverageMeter.c' object='htop-LoadAverageMeter.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-LoadAverageMeter.obj -MD -MP -MF $(DEPDIR)/htop-LoadAverageMeter.Tpo -c -o htop-LoadAverageMeter.obj `if test -f 'LoadAverageMeter.c'; then $(CYGPATH_W) 'LoadAverageMeter.c'; else $(CYGPATH_W) '$(srcdir)/LoadAverageMeter.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-LoadAverageMeter.Tpo $(DEPDIR)/htop-LoadAverageMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='LoadAverageMeter.c' object='htop-LoadAverageMeter.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-LoadAverageMeter.obj `if test -f 'LoadAverageMeter.c'; then $(CYGPATH_W) 'LoadAverageMeter.c'; else $(CYGPATH_W) '$(srcdir)/LoadAverageMeter.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-LoadAverageMeter.obj `if test -f 'LoadAverageMeter.c'; then $(CYGPATH_W) 'LoadAverageMeter.c'; else $(CYGPATH_W) '$(srcdir)/LoadAverageMeter.c'; fi`
htop-MemoryMeter.o: MemoryMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-MemoryMeter.o -MD -MP -MF $(DEPDIR)/htop-MemoryMeter.Tpo -c -o htop-MemoryMeter.o `test -f 'MemoryMeter.c' || echo '$(srcdir)/'`MemoryMeter.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-MemoryMeter.Tpo $(DEPDIR)/htop-MemoryMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='MemoryMeter.c' object='htop-MemoryMeter.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-MemoryMeter.o -MD -MP -MF $(DEPDIR)/htop-MemoryMeter.Tpo -c -o htop-MemoryMeter.o `test -f 'MemoryMeter.c' || echo '$(srcdir)/'`MemoryMeter.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-MemoryMeter.Tpo $(DEPDIR)/htop-MemoryMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='MemoryMeter.c' object='htop-MemoryMeter.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-MemoryMeter.o `test -f 'MemoryMeter.c' || echo '$(srcdir)/'`MemoryMeter.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-MemoryMeter.o `test -f 'MemoryMeter.c' || echo '$(srcdir)/'`MemoryMeter.c
htop-MemoryMeter.obj: MemoryMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-MemoryMeter.obj -MD -MP -MF $(DEPDIR)/htop-MemoryMeter.Tpo -c -o htop-MemoryMeter.obj `if test -f 'MemoryMeter.c'; then $(CYGPATH_W) 'MemoryMeter.c'; else $(CYGPATH_W) '$(srcdir)/MemoryMeter.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-MemoryMeter.Tpo $(DEPDIR)/htop-MemoryMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='MemoryMeter.c' object='htop-MemoryMeter.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-MemoryMeter.obj -MD -MP -MF $(DEPDIR)/htop-MemoryMeter.Tpo -c -o htop-MemoryMeter.obj `if test -f 'MemoryMeter.c'; then $(CYGPATH_W) 'MemoryMeter.c'; else $(CYGPATH_W) '$(srcdir)/MemoryMeter.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-MemoryMeter.Tpo $(DEPDIR)/htop-MemoryMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='MemoryMeter.c' object='htop-MemoryMeter.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-MemoryMeter.obj `if test -f 'MemoryMeter.c'; then $(CYGPATH_W) 'MemoryMeter.c'; else $(CYGPATH_W) '$(srcdir)/MemoryMeter.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-MemoryMeter.obj `if test -f 'MemoryMeter.c'; then $(CYGPATH_W) 'MemoryMeter.c'; else $(CYGPATH_W) '$(srcdir)/MemoryMeter.c'; fi`
htop-Meter.o: Meter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Meter.o -MD -MP -MF $(DEPDIR)/htop-Meter.Tpo -c -o htop-Meter.o `test -f 'Meter.c' || echo '$(srcdir)/'`Meter.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Meter.Tpo $(DEPDIR)/htop-Meter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Meter.c' object='htop-Meter.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Meter.o -MD -MP -MF $(DEPDIR)/htop-Meter.Tpo -c -o htop-Meter.o `test -f 'Meter.c' || echo '$(srcdir)/'`Meter.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Meter.Tpo $(DEPDIR)/htop-Meter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Meter.c' object='htop-Meter.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Meter.o `test -f 'Meter.c' || echo '$(srcdir)/'`Meter.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Meter.o `test -f 'Meter.c' || echo '$(srcdir)/'`Meter.c
htop-Meter.obj: Meter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Meter.obj -MD -MP -MF $(DEPDIR)/htop-Meter.Tpo -c -o htop-Meter.obj `if test -f 'Meter.c'; then $(CYGPATH_W) 'Meter.c'; else $(CYGPATH_W) '$(srcdir)/Meter.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Meter.Tpo $(DEPDIR)/htop-Meter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Meter.c' object='htop-Meter.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Meter.obj -MD -MP -MF $(DEPDIR)/htop-Meter.Tpo -c -o htop-Meter.obj `if test -f 'Meter.c'; then $(CYGPATH_W) 'Meter.c'; else $(CYGPATH_W) '$(srcdir)/Meter.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Meter.Tpo $(DEPDIR)/htop-Meter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Meter.c' object='htop-Meter.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Meter.obj `if test -f 'Meter.c'; then $(CYGPATH_W) 'Meter.c'; else $(CYGPATH_W) '$(srcdir)/Meter.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Meter.obj `if test -f 'Meter.c'; then $(CYGPATH_W) 'Meter.c'; else $(CYGPATH_W) '$(srcdir)/Meter.c'; fi`
htop-MetersPanel.o: MetersPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-MetersPanel.o -MD -MP -MF $(DEPDIR)/htop-MetersPanel.Tpo -c -o htop-MetersPanel.o `test -f 'MetersPanel.c' || echo '$(srcdir)/'`MetersPanel.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-MetersPanel.Tpo $(DEPDIR)/htop-MetersPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='MetersPanel.c' object='htop-MetersPanel.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-MetersPanel.o -MD -MP -MF $(DEPDIR)/htop-MetersPanel.Tpo -c -o htop-MetersPanel.o `test -f 'MetersPanel.c' || echo '$(srcdir)/'`MetersPanel.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-MetersPanel.Tpo $(DEPDIR)/htop-MetersPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='MetersPanel.c' object='htop-MetersPanel.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-MetersPanel.o `test -f 'MetersPanel.c' || echo '$(srcdir)/'`MetersPanel.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-MetersPanel.o `test -f 'MetersPanel.c' || echo '$(srcdir)/'`MetersPanel.c
htop-MetersPanel.obj: MetersPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-MetersPanel.obj -MD -MP -MF $(DEPDIR)/htop-MetersPanel.Tpo -c -o htop-MetersPanel.obj `if test -f 'MetersPanel.c'; then $(CYGPATH_W) 'MetersPanel.c'; else $(CYGPATH_W) '$(srcdir)/MetersPanel.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-MetersPanel.Tpo $(DEPDIR)/htop-MetersPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='MetersPanel.c' object='htop-MetersPanel.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-MetersPanel.obj -MD -MP -MF $(DEPDIR)/htop-MetersPanel.Tpo -c -o htop-MetersPanel.obj `if test -f 'MetersPanel.c'; then $(CYGPATH_W) 'MetersPanel.c'; else $(CYGPATH_W) '$(srcdir)/MetersPanel.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-MetersPanel.Tpo $(DEPDIR)/htop-MetersPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='MetersPanel.c' object='htop-MetersPanel.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-MetersPanel.obj `if test -f 'MetersPanel.c'; then $(CYGPATH_W) 'MetersPanel.c'; else $(CYGPATH_W) '$(srcdir)/MetersPanel.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-MetersPanel.obj `if test -f 'MetersPanel.c'; then $(CYGPATH_W) 'MetersPanel.c'; else $(CYGPATH_W) '$(srcdir)/MetersPanel.c'; fi`
htop-Object.o: Object.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Object.o -MD -MP -MF $(DEPDIR)/htop-Object.Tpo -c -o htop-Object.o `test -f 'Object.c' || echo '$(srcdir)/'`Object.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Object.Tpo $(DEPDIR)/htop-Object.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Object.c' object='htop-Object.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Object.o -MD -MP -MF $(DEPDIR)/htop-Object.Tpo -c -o htop-Object.o `test -f 'Object.c' || echo '$(srcdir)/'`Object.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Object.Tpo $(DEPDIR)/htop-Object.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Object.c' object='htop-Object.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Object.o `test -f 'Object.c' || echo '$(srcdir)/'`Object.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Object.o `test -f 'Object.c' || echo '$(srcdir)/'`Object.c
htop-Object.obj: Object.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Object.obj -MD -MP -MF $(DEPDIR)/htop-Object.Tpo -c -o htop-Object.obj `if test -f 'Object.c'; then $(CYGPATH_W) 'Object.c'; else $(CYGPATH_W) '$(srcdir)/Object.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Object.Tpo $(DEPDIR)/htop-Object.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Object.c' object='htop-Object.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Object.obj -MD -MP -MF $(DEPDIR)/htop-Object.Tpo -c -o htop-Object.obj `if test -f 'Object.c'; then $(CYGPATH_W) 'Object.c'; else $(CYGPATH_W) '$(srcdir)/Object.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Object.Tpo $(DEPDIR)/htop-Object.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Object.c' object='htop-Object.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Object.obj `if test -f 'Object.c'; then $(CYGPATH_W) 'Object.c'; else $(CYGPATH_W) '$(srcdir)/Object.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Object.obj `if test -f 'Object.c'; then $(CYGPATH_W) 'Object.c'; else $(CYGPATH_W) '$(srcdir)/Object.c'; fi`
htop-Panel.o: Panel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Panel.o -MD -MP -MF $(DEPDIR)/htop-Panel.Tpo -c -o htop-Panel.o `test -f 'Panel.c' || echo '$(srcdir)/'`Panel.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Panel.Tpo $(DEPDIR)/htop-Panel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Panel.c' object='htop-Panel.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Panel.o -MD -MP -MF $(DEPDIR)/htop-Panel.Tpo -c -o htop-Panel.o `test -f 'Panel.c' || echo '$(srcdir)/'`Panel.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Panel.Tpo $(DEPDIR)/htop-Panel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Panel.c' object='htop-Panel.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Panel.o `test -f 'Panel.c' || echo '$(srcdir)/'`Panel.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Panel.o `test -f 'Panel.c' || echo '$(srcdir)/'`Panel.c
htop-Panel.obj: Panel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Panel.obj -MD -MP -MF $(DEPDIR)/htop-Panel.Tpo -c -o htop-Panel.obj `if test -f 'Panel.c'; then $(CYGPATH_W) 'Panel.c'; else $(CYGPATH_W) '$(srcdir)/Panel.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Panel.Tpo $(DEPDIR)/htop-Panel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Panel.c' object='htop-Panel.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Panel.obj -MD -MP -MF $(DEPDIR)/htop-Panel.Tpo -c -o htop-Panel.obj `if test -f 'Panel.c'; then $(CYGPATH_W) 'Panel.c'; else $(CYGPATH_W) '$(srcdir)/Panel.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Panel.Tpo $(DEPDIR)/htop-Panel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Panel.c' object='htop-Panel.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Panel.obj `if test -f 'Panel.c'; then $(CYGPATH_W) 'Panel.c'; else $(CYGPATH_W) '$(srcdir)/Panel.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Panel.obj `if test -f 'Panel.c'; then $(CYGPATH_W) 'Panel.c'; else $(CYGPATH_W) '$(srcdir)/Panel.c'; fi`
htop-BatteryMeter.o: BatteryMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-BatteryMeter.o -MD -MP -MF $(DEPDIR)/htop-BatteryMeter.Tpo -c -o htop-BatteryMeter.o `test -f 'BatteryMeter.c' || echo '$(srcdir)/'`BatteryMeter.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-BatteryMeter.Tpo $(DEPDIR)/htop-BatteryMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='BatteryMeter.c' object='htop-BatteryMeter.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-BatteryMeter.o -MD -MP -MF $(DEPDIR)/htop-BatteryMeter.Tpo -c -o htop-BatteryMeter.o `test -f 'BatteryMeter.c' || echo '$(srcdir)/'`BatteryMeter.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-BatteryMeter.Tpo $(DEPDIR)/htop-BatteryMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='BatteryMeter.c' object='htop-BatteryMeter.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-BatteryMeter.o `test -f 'BatteryMeter.c' || echo '$(srcdir)/'`BatteryMeter.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-BatteryMeter.o `test -f 'BatteryMeter.c' || echo '$(srcdir)/'`BatteryMeter.c
htop-BatteryMeter.obj: BatteryMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-BatteryMeter.obj -MD -MP -MF $(DEPDIR)/htop-BatteryMeter.Tpo -c -o htop-BatteryMeter.obj `if test -f 'BatteryMeter.c'; then $(CYGPATH_W) 'BatteryMeter.c'; else $(CYGPATH_W) '$(srcdir)/BatteryMeter.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-BatteryMeter.Tpo $(DEPDIR)/htop-BatteryMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='BatteryMeter.c' object='htop-BatteryMeter.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-BatteryMeter.obj -MD -MP -MF $(DEPDIR)/htop-BatteryMeter.Tpo -c -o htop-BatteryMeter.obj `if test -f 'BatteryMeter.c'; then $(CYGPATH_W) 'BatteryMeter.c'; else $(CYGPATH_W) '$(srcdir)/BatteryMeter.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-BatteryMeter.Tpo $(DEPDIR)/htop-BatteryMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='BatteryMeter.c' object='htop-BatteryMeter.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-BatteryMeter.obj `if test -f 'BatteryMeter.c'; then $(CYGPATH_W) 'BatteryMeter.c'; else $(CYGPATH_W) '$(srcdir)/BatteryMeter.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-BatteryMeter.obj `if test -f 'BatteryMeter.c'; then $(CYGPATH_W) 'BatteryMeter.c'; else $(CYGPATH_W) '$(srcdir)/BatteryMeter.c'; fi`
htop-Process.o: Process.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Process.o -MD -MP -MF $(DEPDIR)/htop-Process.Tpo -c -o htop-Process.o `test -f 'Process.c' || echo '$(srcdir)/'`Process.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Process.Tpo $(DEPDIR)/htop-Process.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Process.c' object='htop-Process.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Process.o -MD -MP -MF $(DEPDIR)/htop-Process.Tpo -c -o htop-Process.o `test -f 'Process.c' || echo '$(srcdir)/'`Process.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Process.Tpo $(DEPDIR)/htop-Process.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Process.c' object='htop-Process.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Process.o `test -f 'Process.c' || echo '$(srcdir)/'`Process.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Process.o `test -f 'Process.c' || echo '$(srcdir)/'`Process.c
htop-Process.obj: Process.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Process.obj -MD -MP -MF $(DEPDIR)/htop-Process.Tpo -c -o htop-Process.obj `if test -f 'Process.c'; then $(CYGPATH_W) 'Process.c'; else $(CYGPATH_W) '$(srcdir)/Process.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Process.Tpo $(DEPDIR)/htop-Process.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Process.c' object='htop-Process.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Process.obj -MD -MP -MF $(DEPDIR)/htop-Process.Tpo -c -o htop-Process.obj `if test -f 'Process.c'; then $(CYGPATH_W) 'Process.c'; else $(CYGPATH_W) '$(srcdir)/Process.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Process.Tpo $(DEPDIR)/htop-Process.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Process.c' object='htop-Process.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Process.obj `if test -f 'Process.c'; then $(CYGPATH_W) 'Process.c'; else $(CYGPATH_W) '$(srcdir)/Process.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Process.obj `if test -f 'Process.c'; then $(CYGPATH_W) 'Process.c'; else $(CYGPATH_W) '$(srcdir)/Process.c'; fi`
htop-ProcessList.o: ProcessList.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ProcessList.o -MD -MP -MF $(DEPDIR)/htop-ProcessList.Tpo -c -o htop-ProcessList.o `test -f 'ProcessList.c' || echo '$(srcdir)/'`ProcessList.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-ProcessList.Tpo $(DEPDIR)/htop-ProcessList.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ProcessList.c' object='htop-ProcessList.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ProcessList.o -MD -MP -MF $(DEPDIR)/htop-ProcessList.Tpo -c -o htop-ProcessList.o `test -f 'ProcessList.c' || echo '$(srcdir)/'`ProcessList.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ProcessList.Tpo $(DEPDIR)/htop-ProcessList.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ProcessList.c' object='htop-ProcessList.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ProcessList.o `test -f 'ProcessList.c' || echo '$(srcdir)/'`ProcessList.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ProcessList.o `test -f 'ProcessList.c' || echo '$(srcdir)/'`ProcessList.c
htop-ProcessList.obj: ProcessList.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ProcessList.obj -MD -MP -MF $(DEPDIR)/htop-ProcessList.Tpo -c -o htop-ProcessList.obj `if test -f 'ProcessList.c'; then $(CYGPATH_W) 'ProcessList.c'; else $(CYGPATH_W) '$(srcdir)/ProcessList.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-ProcessList.Tpo $(DEPDIR)/htop-ProcessList.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ProcessList.c' object='htop-ProcessList.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ProcessList.obj -MD -MP -MF $(DEPDIR)/htop-ProcessList.Tpo -c -o htop-ProcessList.obj `if test -f 'ProcessList.c'; then $(CYGPATH_W) 'ProcessList.c'; else $(CYGPATH_W) '$(srcdir)/ProcessList.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ProcessList.Tpo $(DEPDIR)/htop-ProcessList.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ProcessList.c' object='htop-ProcessList.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ProcessList.obj `if test -f 'ProcessList.c'; then $(CYGPATH_W) 'ProcessList.c'; else $(CYGPATH_W) '$(srcdir)/ProcessList.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ProcessList.obj `if test -f 'ProcessList.c'; then $(CYGPATH_W) 'ProcessList.c'; else $(CYGPATH_W) '$(srcdir)/ProcessList.c'; fi`
htop-RichString.o: RichString.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-RichString.o -MD -MP -MF $(DEPDIR)/htop-RichString.Tpo -c -o htop-RichString.o `test -f 'RichString.c' || echo '$(srcdir)/'`RichString.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-RichString.Tpo $(DEPDIR)/htop-RichString.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='RichString.c' object='htop-RichString.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-RichString.o -MD -MP -MF $(DEPDIR)/htop-RichString.Tpo -c -o htop-RichString.o `test -f 'RichString.c' || echo '$(srcdir)/'`RichString.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-RichString.Tpo $(DEPDIR)/htop-RichString.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='RichString.c' object='htop-RichString.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-RichString.o `test -f 'RichString.c' || echo '$(srcdir)/'`RichString.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-RichString.o `test -f 'RichString.c' || echo '$(srcdir)/'`RichString.c
htop-RichString.obj: RichString.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-RichString.obj -MD -MP -MF $(DEPDIR)/htop-RichString.Tpo -c -o htop-RichString.obj `if test -f 'RichString.c'; then $(CYGPATH_W) 'RichString.c'; else $(CYGPATH_W) '$(srcdir)/RichString.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-RichString.Tpo $(DEPDIR)/htop-RichString.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='RichString.c' object='htop-RichString.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-RichString.obj -MD -MP -MF $(DEPDIR)/htop-RichString.Tpo -c -o htop-RichString.obj `if test -f 'RichString.c'; then $(CYGPATH_W) 'RichString.c'; else $(CYGPATH_W) '$(srcdir)/RichString.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-RichString.Tpo $(DEPDIR)/htop-RichString.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='RichString.c' object='htop-RichString.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-RichString.obj `if test -f 'RichString.c'; then $(CYGPATH_W) 'RichString.c'; else $(CYGPATH_W) '$(srcdir)/RichString.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-RichString.obj `if test -f 'RichString.c'; then $(CYGPATH_W) 'RichString.c'; else $(CYGPATH_W) '$(srcdir)/RichString.c'; fi`
htop-ScreenManager.o: ScreenManager.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ScreenManager.o -MD -MP -MF $(DEPDIR)/htop-ScreenManager.Tpo -c -o htop-ScreenManager.o `test -f 'ScreenManager.c' || echo '$(srcdir)/'`ScreenManager.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-ScreenManager.Tpo $(DEPDIR)/htop-ScreenManager.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ScreenManager.c' object='htop-ScreenManager.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ScreenManager.o -MD -MP -MF $(DEPDIR)/htop-ScreenManager.Tpo -c -o htop-ScreenManager.o `test -f 'ScreenManager.c' || echo '$(srcdir)/'`ScreenManager.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ScreenManager.Tpo $(DEPDIR)/htop-ScreenManager.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ScreenManager.c' object='htop-ScreenManager.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ScreenManager.o `test -f 'ScreenManager.c' || echo '$(srcdir)/'`ScreenManager.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ScreenManager.o `test -f 'ScreenManager.c' || echo '$(srcdir)/'`ScreenManager.c
htop-ScreenManager.obj: ScreenManager.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ScreenManager.obj -MD -MP -MF $(DEPDIR)/htop-ScreenManager.Tpo -c -o htop-ScreenManager.obj `if test -f 'ScreenManager.c'; then $(CYGPATH_W) 'ScreenManager.c'; else $(CYGPATH_W) '$(srcdir)/ScreenManager.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-ScreenManager.Tpo $(DEPDIR)/htop-ScreenManager.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='ScreenManager.c' object='htop-ScreenManager.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-ScreenManager.obj -MD -MP -MF $(DEPDIR)/htop-ScreenManager.Tpo -c -o htop-ScreenManager.obj `if test -f 'ScreenManager.c'; then $(CYGPATH_W) 'ScreenManager.c'; else $(CYGPATH_W) '$(srcdir)/ScreenManager.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-ScreenManager.Tpo $(DEPDIR)/htop-ScreenManager.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='ScreenManager.c' object='htop-ScreenManager.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ScreenManager.obj `if test -f 'ScreenManager.c'; then $(CYGPATH_W) 'ScreenManager.c'; else $(CYGPATH_W) '$(srcdir)/ScreenManager.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-ScreenManager.obj `if test -f 'ScreenManager.c'; then $(CYGPATH_W) 'ScreenManager.c'; else $(CYGPATH_W) '$(srcdir)/ScreenManager.c'; fi`
htop-Settings.o: Settings.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Settings.o -MD -MP -MF $(DEPDIR)/htop-Settings.Tpo -c -o htop-Settings.o `test -f 'Settings.c' || echo '$(srcdir)/'`Settings.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Settings.Tpo $(DEPDIR)/htop-Settings.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Settings.c' object='htop-Settings.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Settings.o -MD -MP -MF $(DEPDIR)/htop-Settings.Tpo -c -o htop-Settings.o `test -f 'Settings.c' || echo '$(srcdir)/'`Settings.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Settings.Tpo $(DEPDIR)/htop-Settings.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Settings.c' object='htop-Settings.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Settings.o `test -f 'Settings.c' || echo '$(srcdir)/'`Settings.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Settings.o `test -f 'Settings.c' || echo '$(srcdir)/'`Settings.c
htop-Settings.obj: Settings.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Settings.obj -MD -MP -MF $(DEPDIR)/htop-Settings.Tpo -c -o htop-Settings.obj `if test -f 'Settings.c'; then $(CYGPATH_W) 'Settings.c'; else $(CYGPATH_W) '$(srcdir)/Settings.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Settings.Tpo $(DEPDIR)/htop-Settings.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Settings.c' object='htop-Settings.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Settings.obj `if test -f 'Settings.c'; then $(CYGPATH_W) 'Settings.c'; else $(CYGPATH_W) '$(srcdir)/Settings.c'; fi`
-
-htop-IOPriorityPanel.o: IOPriorityPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-IOPriorityPanel.o -MD -MP -MF $(DEPDIR)/htop-IOPriorityPanel.Tpo -c -o htop-IOPriorityPanel.o `test -f 'IOPriorityPanel.c' || echo '$(srcdir)/'`IOPriorityPanel.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-IOPriorityPanel.Tpo $(DEPDIR)/htop-IOPriorityPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='IOPriorityPanel.c' object='htop-IOPriorityPanel.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Settings.obj -MD -MP -MF $(DEPDIR)/htop-Settings.Tpo -c -o htop-Settings.obj `if test -f 'Settings.c'; then $(CYGPATH_W) 'Settings.c'; else $(CYGPATH_W) '$(srcdir)/Settings.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Settings.Tpo $(DEPDIR)/htop-Settings.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Settings.c' object='htop-Settings.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-IOPriorityPanel.o `test -f 'IOPriorityPanel.c' || echo '$(srcdir)/'`IOPriorityPanel.c
-
-htop-IOPriorityPanel.obj: IOPriorityPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-IOPriorityPanel.obj -MD -MP -MF $(DEPDIR)/htop-IOPriorityPanel.Tpo -c -o htop-IOPriorityPanel.obj `if test -f 'IOPriorityPanel.c'; then $(CYGPATH_W) 'IOPriorityPanel.c'; else $(CYGPATH_W) '$(srcdir)/IOPriorityPanel.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-IOPriorityPanel.Tpo $(DEPDIR)/htop-IOPriorityPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='IOPriorityPanel.c' object='htop-IOPriorityPanel.obj' libtool=no @AMDEPBACKSLASH@
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-IOPriorityPanel.obj `if test -f 'IOPriorityPanel.c'; then $(CYGPATH_W) 'IOPriorityPanel.c'; else $(CYGPATH_W) '$(srcdir)/IOPriorityPanel.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Settings.obj `if test -f 'Settings.c'; then $(CYGPATH_W) 'Settings.c'; else $(CYGPATH_W) '$(srcdir)/Settings.c'; fi`
htop-SignalsPanel.o: SignalsPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-SignalsPanel.o -MD -MP -MF $(DEPDIR)/htop-SignalsPanel.Tpo -c -o htop-SignalsPanel.o `test -f 'SignalsPanel.c' || echo '$(srcdir)/'`SignalsPanel.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-SignalsPanel.Tpo $(DEPDIR)/htop-SignalsPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SignalsPanel.c' object='htop-SignalsPanel.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-SignalsPanel.o -MD -MP -MF $(DEPDIR)/htop-SignalsPanel.Tpo -c -o htop-SignalsPanel.o `test -f 'SignalsPanel.c' || echo '$(srcdir)/'`SignalsPanel.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-SignalsPanel.Tpo $(DEPDIR)/htop-SignalsPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='SignalsPanel.c' object='htop-SignalsPanel.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-SignalsPanel.o `test -f 'SignalsPanel.c' || echo '$(srcdir)/'`SignalsPanel.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-SignalsPanel.o `test -f 'SignalsPanel.c' || echo '$(srcdir)/'`SignalsPanel.c
htop-SignalsPanel.obj: SignalsPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-SignalsPanel.obj -MD -MP -MF $(DEPDIR)/htop-SignalsPanel.Tpo -c -o htop-SignalsPanel.obj `if test -f 'SignalsPanel.c'; then $(CYGPATH_W) 'SignalsPanel.c'; else $(CYGPATH_W) '$(srcdir)/SignalsPanel.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-SignalsPanel.Tpo $(DEPDIR)/htop-SignalsPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SignalsPanel.c' object='htop-SignalsPanel.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-SignalsPanel.obj -MD -MP -MF $(DEPDIR)/htop-SignalsPanel.Tpo -c -o htop-SignalsPanel.obj `if test -f 'SignalsPanel.c'; then $(CYGPATH_W) 'SignalsPanel.c'; else $(CYGPATH_W) '$(srcdir)/SignalsPanel.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-SignalsPanel.Tpo $(DEPDIR)/htop-SignalsPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='SignalsPanel.c' object='htop-SignalsPanel.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-SignalsPanel.obj `if test -f 'SignalsPanel.c'; then $(CYGPATH_W) 'SignalsPanel.c'; else $(CYGPATH_W) '$(srcdir)/SignalsPanel.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-SignalsPanel.obj `if test -f 'SignalsPanel.c'; then $(CYGPATH_W) 'SignalsPanel.c'; else $(CYGPATH_W) '$(srcdir)/SignalsPanel.c'; fi`
-htop-String.o: String.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-String.o -MD -MP -MF $(DEPDIR)/htop-String.Tpo -c -o htop-String.o `test -f 'String.c' || echo '$(srcdir)/'`String.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-String.Tpo $(DEPDIR)/htop-String.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='String.c' object='htop-String.o' libtool=no @AMDEPBACKSLASH@
+htop-StringUtils.o: StringUtils.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-StringUtils.o -MD -MP -MF $(DEPDIR)/htop-StringUtils.Tpo -c -o htop-StringUtils.o `test -f 'StringUtils.c' || echo '$(srcdir)/'`StringUtils.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-StringUtils.Tpo $(DEPDIR)/htop-StringUtils.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='StringUtils.c' object='htop-StringUtils.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-String.o `test -f 'String.c' || echo '$(srcdir)/'`String.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-StringUtils.o `test -f 'StringUtils.c' || echo '$(srcdir)/'`StringUtils.c
-htop-String.obj: String.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-String.obj -MD -MP -MF $(DEPDIR)/htop-String.Tpo -c -o htop-String.obj `if test -f 'String.c'; then $(CYGPATH_W) 'String.c'; else $(CYGPATH_W) '$(srcdir)/String.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-String.Tpo $(DEPDIR)/htop-String.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='String.c' object='htop-String.obj' libtool=no @AMDEPBACKSLASH@
+htop-StringUtils.obj: StringUtils.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-StringUtils.obj -MD -MP -MF $(DEPDIR)/htop-StringUtils.Tpo -c -o htop-StringUtils.obj `if test -f 'StringUtils.c'; then $(CYGPATH_W) 'StringUtils.c'; else $(CYGPATH_W) '$(srcdir)/StringUtils.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-StringUtils.Tpo $(DEPDIR)/htop-StringUtils.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='StringUtils.c' object='htop-StringUtils.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-String.obj `if test -f 'String.c'; then $(CYGPATH_W) 'String.c'; else $(CYGPATH_W) '$(srcdir)/String.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-StringUtils.obj `if test -f 'StringUtils.c'; then $(CYGPATH_W) 'StringUtils.c'; else $(CYGPATH_W) '$(srcdir)/StringUtils.c'; fi`
htop-SwapMeter.o: SwapMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-SwapMeter.o -MD -MP -MF $(DEPDIR)/htop-SwapMeter.Tpo -c -o htop-SwapMeter.o `test -f 'SwapMeter.c' || echo '$(srcdir)/'`SwapMeter.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-SwapMeter.Tpo $(DEPDIR)/htop-SwapMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SwapMeter.c' object='htop-SwapMeter.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-SwapMeter.o -MD -MP -MF $(DEPDIR)/htop-SwapMeter.Tpo -c -o htop-SwapMeter.o `test -f 'SwapMeter.c' || echo '$(srcdir)/'`SwapMeter.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-SwapMeter.Tpo $(DEPDIR)/htop-SwapMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='SwapMeter.c' object='htop-SwapMeter.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-SwapMeter.o `test -f 'SwapMeter.c' || echo '$(srcdir)/'`SwapMeter.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-SwapMeter.o `test -f 'SwapMeter.c' || echo '$(srcdir)/'`SwapMeter.c
htop-SwapMeter.obj: SwapMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-SwapMeter.obj -MD -MP -MF $(DEPDIR)/htop-SwapMeter.Tpo -c -o htop-SwapMeter.obj `if test -f 'SwapMeter.c'; then $(CYGPATH_W) 'SwapMeter.c'; else $(CYGPATH_W) '$(srcdir)/SwapMeter.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-SwapMeter.Tpo $(DEPDIR)/htop-SwapMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='SwapMeter.c' object='htop-SwapMeter.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-SwapMeter.obj -MD -MP -MF $(DEPDIR)/htop-SwapMeter.Tpo -c -o htop-SwapMeter.obj `if test -f 'SwapMeter.c'; then $(CYGPATH_W) 'SwapMeter.c'; else $(CYGPATH_W) '$(srcdir)/SwapMeter.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-SwapMeter.Tpo $(DEPDIR)/htop-SwapMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='SwapMeter.c' object='htop-SwapMeter.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-SwapMeter.obj `if test -f 'SwapMeter.c'; then $(CYGPATH_W) 'SwapMeter.c'; else $(CYGPATH_W) '$(srcdir)/SwapMeter.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-SwapMeter.obj `if test -f 'SwapMeter.c'; then $(CYGPATH_W) 'SwapMeter.c'; else $(CYGPATH_W) '$(srcdir)/SwapMeter.c'; fi`
htop-TasksMeter.o: TasksMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-TasksMeter.o -MD -MP -MF $(DEPDIR)/htop-TasksMeter.Tpo -c -o htop-TasksMeter.o `test -f 'TasksMeter.c' || echo '$(srcdir)/'`TasksMeter.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-TasksMeter.Tpo $(DEPDIR)/htop-TasksMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='TasksMeter.c' object='htop-TasksMeter.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-TasksMeter.o -MD -MP -MF $(DEPDIR)/htop-TasksMeter.Tpo -c -o htop-TasksMeter.o `test -f 'TasksMeter.c' || echo '$(srcdir)/'`TasksMeter.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-TasksMeter.Tpo $(DEPDIR)/htop-TasksMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='TasksMeter.c' object='htop-TasksMeter.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-TasksMeter.o `test -f 'TasksMeter.c' || echo '$(srcdir)/'`TasksMeter.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-TasksMeter.o `test -f 'TasksMeter.c' || echo '$(srcdir)/'`TasksMeter.c
htop-TasksMeter.obj: TasksMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-TasksMeter.obj -MD -MP -MF $(DEPDIR)/htop-TasksMeter.Tpo -c -o htop-TasksMeter.obj `if test -f 'TasksMeter.c'; then $(CYGPATH_W) 'TasksMeter.c'; else $(CYGPATH_W) '$(srcdir)/TasksMeter.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-TasksMeter.Tpo $(DEPDIR)/htop-TasksMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='TasksMeter.c' object='htop-TasksMeter.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-TasksMeter.obj -MD -MP -MF $(DEPDIR)/htop-TasksMeter.Tpo -c -o htop-TasksMeter.obj `if test -f 'TasksMeter.c'; then $(CYGPATH_W) 'TasksMeter.c'; else $(CYGPATH_W) '$(srcdir)/TasksMeter.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-TasksMeter.Tpo $(DEPDIR)/htop-TasksMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='TasksMeter.c' object='htop-TasksMeter.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-TasksMeter.obj `if test -f 'TasksMeter.c'; then $(CYGPATH_W) 'TasksMeter.c'; else $(CYGPATH_W) '$(srcdir)/TasksMeter.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-TasksMeter.obj `if test -f 'TasksMeter.c'; then $(CYGPATH_W) 'TasksMeter.c'; else $(CYGPATH_W) '$(srcdir)/TasksMeter.c'; fi`
-htop-TraceScreen.o: TraceScreen.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-TraceScreen.o -MD -MP -MF $(DEPDIR)/htop-TraceScreen.Tpo -c -o htop-TraceScreen.o `test -f 'TraceScreen.c' || echo '$(srcdir)/'`TraceScreen.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-TraceScreen.Tpo $(DEPDIR)/htop-TraceScreen.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='TraceScreen.c' object='htop-TraceScreen.o' libtool=no @AMDEPBACKSLASH@
+htop-UptimeMeter.o: UptimeMeter.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-UptimeMeter.o -MD -MP -MF $(DEPDIR)/htop-UptimeMeter.Tpo -c -o htop-UptimeMeter.o `test -f 'UptimeMeter.c' || echo '$(srcdir)/'`UptimeMeter.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-UptimeMeter.Tpo $(DEPDIR)/htop-UptimeMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UptimeMeter.c' object='htop-UptimeMeter.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-TraceScreen.o `test -f 'TraceScreen.c' || echo '$(srcdir)/'`TraceScreen.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-UptimeMeter.o `test -f 'UptimeMeter.c' || echo '$(srcdir)/'`UptimeMeter.c
-htop-TraceScreen.obj: TraceScreen.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-TraceScreen.obj -MD -MP -MF $(DEPDIR)/htop-TraceScreen.Tpo -c -o htop-TraceScreen.obj `if test -f 'TraceScreen.c'; then $(CYGPATH_W) 'TraceScreen.c'; else $(CYGPATH_W) '$(srcdir)/TraceScreen.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-TraceScreen.Tpo $(DEPDIR)/htop-TraceScreen.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='TraceScreen.c' object='htop-TraceScreen.obj' libtool=no @AMDEPBACKSLASH@
+htop-UptimeMeter.obj: UptimeMeter.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-UptimeMeter.obj -MD -MP -MF $(DEPDIR)/htop-UptimeMeter.Tpo -c -o htop-UptimeMeter.obj `if test -f 'UptimeMeter.c'; then $(CYGPATH_W) 'UptimeMeter.c'; else $(CYGPATH_W) '$(srcdir)/UptimeMeter.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-UptimeMeter.Tpo $(DEPDIR)/htop-UptimeMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UptimeMeter.c' object='htop-UptimeMeter.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-TraceScreen.obj `if test -f 'TraceScreen.c'; then $(CYGPATH_W) 'TraceScreen.c'; else $(CYGPATH_W) '$(srcdir)/TraceScreen.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-UptimeMeter.obj `if test -f 'UptimeMeter.c'; then $(CYGPATH_W) 'UptimeMeter.c'; else $(CYGPATH_W) '$(srcdir)/UptimeMeter.c'; fi`
-htop-UptimeMeter.o: UptimeMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-UptimeMeter.o -MD -MP -MF $(DEPDIR)/htop-UptimeMeter.Tpo -c -o htop-UptimeMeter.o `test -f 'UptimeMeter.c' || echo '$(srcdir)/'`UptimeMeter.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-UptimeMeter.Tpo $(DEPDIR)/htop-UptimeMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='UptimeMeter.c' object='htop-UptimeMeter.o' libtool=no @AMDEPBACKSLASH@
+htop-TraceScreen.o: TraceScreen.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-TraceScreen.o -MD -MP -MF $(DEPDIR)/htop-TraceScreen.Tpo -c -o htop-TraceScreen.o `test -f 'TraceScreen.c' || echo '$(srcdir)/'`TraceScreen.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-TraceScreen.Tpo $(DEPDIR)/htop-TraceScreen.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='TraceScreen.c' object='htop-TraceScreen.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-UptimeMeter.o `test -f 'UptimeMeter.c' || echo '$(srcdir)/'`UptimeMeter.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-TraceScreen.o `test -f 'TraceScreen.c' || echo '$(srcdir)/'`TraceScreen.c
-htop-UptimeMeter.obj: UptimeMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-UptimeMeter.obj -MD -MP -MF $(DEPDIR)/htop-UptimeMeter.Tpo -c -o htop-UptimeMeter.obj `if test -f 'UptimeMeter.c'; then $(CYGPATH_W) 'UptimeMeter.c'; else $(CYGPATH_W) '$(srcdir)/UptimeMeter.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-UptimeMeter.Tpo $(DEPDIR)/htop-UptimeMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='UptimeMeter.c' object='htop-UptimeMeter.obj' libtool=no @AMDEPBACKSLASH@
+htop-TraceScreen.obj: TraceScreen.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-TraceScreen.obj -MD -MP -MF $(DEPDIR)/htop-TraceScreen.Tpo -c -o htop-TraceScreen.obj `if test -f 'TraceScreen.c'; then $(CYGPATH_W) 'TraceScreen.c'; else $(CYGPATH_W) '$(srcdir)/TraceScreen.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-TraceScreen.Tpo $(DEPDIR)/htop-TraceScreen.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='TraceScreen.c' object='htop-TraceScreen.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-UptimeMeter.obj `if test -f 'UptimeMeter.c'; then $(CYGPATH_W) 'UptimeMeter.c'; else $(CYGPATH_W) '$(srcdir)/UptimeMeter.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-TraceScreen.obj `if test -f 'TraceScreen.c'; then $(CYGPATH_W) 'TraceScreen.c'; else $(CYGPATH_W) '$(srcdir)/TraceScreen.c'; fi`
htop-UsersTable.o: UsersTable.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-UsersTable.o -MD -MP -MF $(DEPDIR)/htop-UsersTable.Tpo -c -o htop-UsersTable.o `test -f 'UsersTable.c' || echo '$(srcdir)/'`UsersTable.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-UsersTable.Tpo $(DEPDIR)/htop-UsersTable.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='UsersTable.c' object='htop-UsersTable.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-UsersTable.o -MD -MP -MF $(DEPDIR)/htop-UsersTable.Tpo -c -o htop-UsersTable.o `test -f 'UsersTable.c' || echo '$(srcdir)/'`UsersTable.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-UsersTable.Tpo $(DEPDIR)/htop-UsersTable.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UsersTable.c' object='htop-UsersTable.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-UsersTable.o `test -f 'UsersTable.c' || echo '$(srcdir)/'`UsersTable.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-UsersTable.o `test -f 'UsersTable.c' || echo '$(srcdir)/'`UsersTable.c
htop-UsersTable.obj: UsersTable.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-UsersTable.obj -MD -MP -MF $(DEPDIR)/htop-UsersTable.Tpo -c -o htop-UsersTable.obj `if test -f 'UsersTable.c'; then $(CYGPATH_W) 'UsersTable.c'; else $(CYGPATH_W) '$(srcdir)/UsersTable.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-UsersTable.Tpo $(DEPDIR)/htop-UsersTable.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='UsersTable.c' object='htop-UsersTable.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-UsersTable.obj -MD -MP -MF $(DEPDIR)/htop-UsersTable.Tpo -c -o htop-UsersTable.obj `if test -f 'UsersTable.c'; then $(CYGPATH_W) 'UsersTable.c'; else $(CYGPATH_W) '$(srcdir)/UsersTable.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-UsersTable.Tpo $(DEPDIR)/htop-UsersTable.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='UsersTable.c' object='htop-UsersTable.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-UsersTable.obj `if test -f 'UsersTable.c'; then $(CYGPATH_W) 'UsersTable.c'; else $(CYGPATH_W) '$(srcdir)/UsersTable.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-UsersTable.obj `if test -f 'UsersTable.c'; then $(CYGPATH_W) 'UsersTable.c'; else $(CYGPATH_W) '$(srcdir)/UsersTable.c'; fi`
htop-Vector.o: Vector.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Vector.o -MD -MP -MF $(DEPDIR)/htop-Vector.Tpo -c -o htop-Vector.o `test -f 'Vector.c' || echo '$(srcdir)/'`Vector.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Vector.Tpo $(DEPDIR)/htop-Vector.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Vector.c' object='htop-Vector.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Vector.o -MD -MP -MF $(DEPDIR)/htop-Vector.Tpo -c -o htop-Vector.o `test -f 'Vector.c' || echo '$(srcdir)/'`Vector.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Vector.Tpo $(DEPDIR)/htop-Vector.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Vector.c' object='htop-Vector.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Vector.o `test -f 'Vector.c' || echo '$(srcdir)/'`Vector.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Vector.o `test -f 'Vector.c' || echo '$(srcdir)/'`Vector.c
htop-Vector.obj: Vector.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Vector.obj -MD -MP -MF $(DEPDIR)/htop-Vector.Tpo -c -o htop-Vector.obj `if test -f 'Vector.c'; then $(CYGPATH_W) 'Vector.c'; else $(CYGPATH_W) '$(srcdir)/Vector.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Vector.Tpo $(DEPDIR)/htop-Vector.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Vector.c' object='htop-Vector.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Vector.obj -MD -MP -MF $(DEPDIR)/htop-Vector.Tpo -c -o htop-Vector.obj `if test -f 'Vector.c'; then $(CYGPATH_W) 'Vector.c'; else $(CYGPATH_W) '$(srcdir)/Vector.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Vector.Tpo $(DEPDIR)/htop-Vector.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Vector.c' object='htop-Vector.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Vector.obj `if test -f 'Vector.c'; then $(CYGPATH_W) 'Vector.c'; else $(CYGPATH_W) '$(srcdir)/Vector.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Vector.obj `if test -f 'Vector.c'; then $(CYGPATH_W) 'Vector.c'; else $(CYGPATH_W) '$(srcdir)/Vector.c'; fi`
htop-AvailableColumnsPanel.o: AvailableColumnsPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AvailableColumnsPanel.o -MD -MP -MF $(DEPDIR)/htop-AvailableColumnsPanel.Tpo -c -o htop-AvailableColumnsPanel.o `test -f 'AvailableColumnsPanel.c' || echo '$(srcdir)/'`AvailableColumnsPanel.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-AvailableColumnsPanel.Tpo $(DEPDIR)/htop-AvailableColumnsPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='AvailableColumnsPanel.c' object='htop-AvailableColumnsPanel.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AvailableColumnsPanel.o -MD -MP -MF $(DEPDIR)/htop-AvailableColumnsPanel.Tpo -c -o htop-AvailableColumnsPanel.o `test -f 'AvailableColumnsPanel.c' || echo '$(srcdir)/'`AvailableColumnsPanel.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-AvailableColumnsPanel.Tpo $(DEPDIR)/htop-AvailableColumnsPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='AvailableColumnsPanel.c' object='htop-AvailableColumnsPanel.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AvailableColumnsPanel.o `test -f 'AvailableColumnsPanel.c' || echo '$(srcdir)/'`AvailableColumnsPanel.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AvailableColumnsPanel.o `test -f 'AvailableColumnsPanel.c' || echo '$(srcdir)/'`AvailableColumnsPanel.c
htop-AvailableColumnsPanel.obj: AvailableColumnsPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AvailableColumnsPanel.obj -MD -MP -MF $(DEPDIR)/htop-AvailableColumnsPanel.Tpo -c -o htop-AvailableColumnsPanel.obj `if test -f 'AvailableColumnsPanel.c'; then $(CYGPATH_W) 'AvailableColumnsPanel.c'; else $(CYGPATH_W) '$(srcdir)/AvailableColumnsPanel.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-AvailableColumnsPanel.Tpo $(DEPDIR)/htop-AvailableColumnsPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='AvailableColumnsPanel.c' object='htop-AvailableColumnsPanel.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AvailableColumnsPanel.obj -MD -MP -MF $(DEPDIR)/htop-AvailableColumnsPanel.Tpo -c -o htop-AvailableColumnsPanel.obj `if test -f 'AvailableColumnsPanel.c'; then $(CYGPATH_W) 'AvailableColumnsPanel.c'; else $(CYGPATH_W) '$(srcdir)/AvailableColumnsPanel.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-AvailableColumnsPanel.Tpo $(DEPDIR)/htop-AvailableColumnsPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='AvailableColumnsPanel.c' object='htop-AvailableColumnsPanel.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AvailableColumnsPanel.obj `if test -f 'AvailableColumnsPanel.c'; then $(CYGPATH_W) 'AvailableColumnsPanel.c'; else $(CYGPATH_W) '$(srcdir)/AvailableColumnsPanel.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AvailableColumnsPanel.obj `if test -f 'AvailableColumnsPanel.c'; then $(CYGPATH_W) 'AvailableColumnsPanel.c'; else $(CYGPATH_W) '$(srcdir)/AvailableColumnsPanel.c'; fi`
htop-AffinityPanel.o: AffinityPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AffinityPanel.o -MD -MP -MF $(DEPDIR)/htop-AffinityPanel.Tpo -c -o htop-AffinityPanel.o `test -f 'AffinityPanel.c' || echo '$(srcdir)/'`AffinityPanel.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-AffinityPanel.Tpo $(DEPDIR)/htop-AffinityPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='AffinityPanel.c' object='htop-AffinityPanel.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AffinityPanel.o -MD -MP -MF $(DEPDIR)/htop-AffinityPanel.Tpo -c -o htop-AffinityPanel.o `test -f 'AffinityPanel.c' || echo '$(srcdir)/'`AffinityPanel.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-AffinityPanel.Tpo $(DEPDIR)/htop-AffinityPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='AffinityPanel.c' object='htop-AffinityPanel.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AffinityPanel.o `test -f 'AffinityPanel.c' || echo '$(srcdir)/'`AffinityPanel.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AffinityPanel.o `test -f 'AffinityPanel.c' || echo '$(srcdir)/'`AffinityPanel.c
htop-AffinityPanel.obj: AffinityPanel.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AffinityPanel.obj -MD -MP -MF $(DEPDIR)/htop-AffinityPanel.Tpo -c -o htop-AffinityPanel.obj `if test -f 'AffinityPanel.c'; then $(CYGPATH_W) 'AffinityPanel.c'; else $(CYGPATH_W) '$(srcdir)/AffinityPanel.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-AffinityPanel.Tpo $(DEPDIR)/htop-AffinityPanel.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='AffinityPanel.c' object='htop-AffinityPanel.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-AffinityPanel.obj -MD -MP -MF $(DEPDIR)/htop-AffinityPanel.Tpo -c -o htop-AffinityPanel.obj `if test -f 'AffinityPanel.c'; then $(CYGPATH_W) 'AffinityPanel.c'; else $(CYGPATH_W) '$(srcdir)/AffinityPanel.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-AffinityPanel.Tpo $(DEPDIR)/htop-AffinityPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='AffinityPanel.c' object='htop-AffinityPanel.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AffinityPanel.obj `if test -f 'AffinityPanel.c'; then $(CYGPATH_W) 'AffinityPanel.c'; else $(CYGPATH_W) '$(srcdir)/AffinityPanel.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-AffinityPanel.obj `if test -f 'AffinityPanel.c'; then $(CYGPATH_W) 'AffinityPanel.c'; else $(CYGPATH_W) '$(srcdir)/AffinityPanel.c'; fi`
htop-HostnameMeter.o: HostnameMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-HostnameMeter.o -MD -MP -MF $(DEPDIR)/htop-HostnameMeter.Tpo -c -o htop-HostnameMeter.o `test -f 'HostnameMeter.c' || echo '$(srcdir)/'`HostnameMeter.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-HostnameMeter.Tpo $(DEPDIR)/htop-HostnameMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='HostnameMeter.c' object='htop-HostnameMeter.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-HostnameMeter.o -MD -MP -MF $(DEPDIR)/htop-HostnameMeter.Tpo -c -o htop-HostnameMeter.o `test -f 'HostnameMeter.c' || echo '$(srcdir)/'`HostnameMeter.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-HostnameMeter.Tpo $(DEPDIR)/htop-HostnameMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='HostnameMeter.c' object='htop-HostnameMeter.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-HostnameMeter.o `test -f 'HostnameMeter.c' || echo '$(srcdir)/'`HostnameMeter.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-HostnameMeter.o `test -f 'HostnameMeter.c' || echo '$(srcdir)/'`HostnameMeter.c
htop-HostnameMeter.obj: HostnameMeter.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-HostnameMeter.obj -MD -MP -MF $(DEPDIR)/htop-HostnameMeter.Tpo -c -o htop-HostnameMeter.obj `if test -f 'HostnameMeter.c'; then $(CYGPATH_W) 'HostnameMeter.c'; else $(CYGPATH_W) '$(srcdir)/HostnameMeter.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-HostnameMeter.Tpo $(DEPDIR)/htop-HostnameMeter.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='HostnameMeter.c' object='htop-HostnameMeter.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-HostnameMeter.obj -MD -MP -MF $(DEPDIR)/htop-HostnameMeter.Tpo -c -o htop-HostnameMeter.obj `if test -f 'HostnameMeter.c'; then $(CYGPATH_W) 'HostnameMeter.c'; else $(CYGPATH_W) '$(srcdir)/HostnameMeter.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-HostnameMeter.Tpo $(DEPDIR)/htop-HostnameMeter.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='HostnameMeter.c' object='htop-HostnameMeter.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-HostnameMeter.obj `if test -f 'HostnameMeter.c'; then $(CYGPATH_W) 'HostnameMeter.c'; else $(CYGPATH_W) '$(srcdir)/HostnameMeter.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-HostnameMeter.obj `if test -f 'HostnameMeter.c'; then $(CYGPATH_W) 'HostnameMeter.c'; else $(CYGPATH_W) '$(srcdir)/HostnameMeter.c'; fi`
htop-OpenFilesScreen.o: OpenFilesScreen.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-OpenFilesScreen.o -MD -MP -MF $(DEPDIR)/htop-OpenFilesScreen.Tpo -c -o htop-OpenFilesScreen.o `test -f 'OpenFilesScreen.c' || echo '$(srcdir)/'`OpenFilesScreen.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-OpenFilesScreen.Tpo $(DEPDIR)/htop-OpenFilesScreen.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='OpenFilesScreen.c' object='htop-OpenFilesScreen.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-OpenFilesScreen.o -MD -MP -MF $(DEPDIR)/htop-OpenFilesScreen.Tpo -c -o htop-OpenFilesScreen.o `test -f 'OpenFilesScreen.c' || echo '$(srcdir)/'`OpenFilesScreen.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-OpenFilesScreen.Tpo $(DEPDIR)/htop-OpenFilesScreen.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='OpenFilesScreen.c' object='htop-OpenFilesScreen.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-OpenFilesScreen.o `test -f 'OpenFilesScreen.c' || echo '$(srcdir)/'`OpenFilesScreen.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-OpenFilesScreen.o `test -f 'OpenFilesScreen.c' || echo '$(srcdir)/'`OpenFilesScreen.c
htop-OpenFilesScreen.obj: OpenFilesScreen.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-OpenFilesScreen.obj -MD -MP -MF $(DEPDIR)/htop-OpenFilesScreen.Tpo -c -o htop-OpenFilesScreen.obj `if test -f 'OpenFilesScreen.c'; then $(CYGPATH_W) 'OpenFilesScreen.c'; else $(CYGPATH_W) '$(srcdir)/OpenFilesScreen.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-OpenFilesScreen.Tpo $(DEPDIR)/htop-OpenFilesScreen.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='OpenFilesScreen.c' object='htop-OpenFilesScreen.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-OpenFilesScreen.obj -MD -MP -MF $(DEPDIR)/htop-OpenFilesScreen.Tpo -c -o htop-OpenFilesScreen.obj `if test -f 'OpenFilesScreen.c'; then $(CYGPATH_W) 'OpenFilesScreen.c'; else $(CYGPATH_W) '$(srcdir)/OpenFilesScreen.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-OpenFilesScreen.Tpo $(DEPDIR)/htop-OpenFilesScreen.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='OpenFilesScreen.c' object='htop-OpenFilesScreen.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-OpenFilesScreen.obj `if test -f 'OpenFilesScreen.c'; then $(CYGPATH_W) 'OpenFilesScreen.c'; else $(CYGPATH_W) '$(srcdir)/OpenFilesScreen.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-OpenFilesScreen.obj `if test -f 'OpenFilesScreen.c'; then $(CYGPATH_W) 'OpenFilesScreen.c'; else $(CYGPATH_W) '$(srcdir)/OpenFilesScreen.c'; fi`
htop-Affinity.o: Affinity.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Affinity.o -MD -MP -MF $(DEPDIR)/htop-Affinity.Tpo -c -o htop-Affinity.o `test -f 'Affinity.c' || echo '$(srcdir)/'`Affinity.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Affinity.Tpo $(DEPDIR)/htop-Affinity.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Affinity.c' object='htop-Affinity.o' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Affinity.o -MD -MP -MF $(DEPDIR)/htop-Affinity.Tpo -c -o htop-Affinity.o `test -f 'Affinity.c' || echo '$(srcdir)/'`Affinity.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Affinity.Tpo $(DEPDIR)/htop-Affinity.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Affinity.c' object='htop-Affinity.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Affinity.o `test -f 'Affinity.c' || echo '$(srcdir)/'`Affinity.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Affinity.o `test -f 'Affinity.c' || echo '$(srcdir)/'`Affinity.c
htop-Affinity.obj: Affinity.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Affinity.obj -MD -MP -MF $(DEPDIR)/htop-Affinity.Tpo -c -o htop-Affinity.obj `if test -f 'Affinity.c'; then $(CYGPATH_W) 'Affinity.c'; else $(CYGPATH_W) '$(srcdir)/Affinity.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-Affinity.Tpo $(DEPDIR)/htop-Affinity.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='Affinity.c' object='htop-Affinity.obj' libtool=no @AMDEPBACKSLASH@
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Affinity.obj -MD -MP -MF $(DEPDIR)/htop-Affinity.Tpo -c -o htop-Affinity.obj `if test -f 'Affinity.c'; then $(CYGPATH_W) 'Affinity.c'; else $(CYGPATH_W) '$(srcdir)/Affinity.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Affinity.Tpo $(DEPDIR)/htop-Affinity.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Affinity.c' object='htop-Affinity.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Affinity.obj `if test -f 'Affinity.c'; then $(CYGPATH_W) 'Affinity.c'; else $(CYGPATH_W) '$(srcdir)/Affinity.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Affinity.obj `if test -f 'Affinity.c'; then $(CYGPATH_W) 'Affinity.c'; else $(CYGPATH_W) '$(srcdir)/Affinity.c'; fi`
-htop-IOPriority.o: IOPriority.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-IOPriority.o -MD -MP -MF $(DEPDIR)/htop-IOPriority.Tpo -c -o htop-IOPriority.o `test -f 'IOPriority.c' || echo '$(srcdir)/'`IOPriority.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-IOPriority.Tpo $(DEPDIR)/htop-IOPriority.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='IOPriority.c' object='htop-IOPriority.o' libtool=no @AMDEPBACKSLASH@
+htop-IncSet.o: IncSet.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-IncSet.o -MD -MP -MF $(DEPDIR)/htop-IncSet.Tpo -c -o htop-IncSet.o `test -f 'IncSet.c' || echo '$(srcdir)/'`IncSet.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-IncSet.Tpo $(DEPDIR)/htop-IncSet.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='IncSet.c' object='htop-IncSet.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-IOPriority.o `test -f 'IOPriority.c' || echo '$(srcdir)/'`IOPriority.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-IncSet.o `test -f 'IncSet.c' || echo '$(srcdir)/'`IncSet.c
-htop-IOPriority.obj: IOPriority.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-IOPriority.obj -MD -MP -MF $(DEPDIR)/htop-IOPriority.Tpo -c -o htop-IOPriority.obj `if test -f 'IOPriority.c'; then $(CYGPATH_W) 'IOPriority.c'; else $(CYGPATH_W) '$(srcdir)/IOPriority.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-IOPriority.Tpo $(DEPDIR)/htop-IOPriority.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='IOPriority.c' object='htop-IOPriority.obj' libtool=no @AMDEPBACKSLASH@
+htop-IncSet.obj: IncSet.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-IncSet.obj -MD -MP -MF $(DEPDIR)/htop-IncSet.Tpo -c -o htop-IncSet.obj `if test -f 'IncSet.c'; then $(CYGPATH_W) 'IncSet.c'; else $(CYGPATH_W) '$(srcdir)/IncSet.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-IncSet.Tpo $(DEPDIR)/htop-IncSet.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='IncSet.c' object='htop-IncSet.obj' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-IOPriority.obj `if test -f 'IOPriority.c'; then $(CYGPATH_W) 'IOPriority.c'; else $(CYGPATH_W) '$(srcdir)/IOPriority.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-IncSet.obj `if test -f 'IncSet.c'; then $(CYGPATH_W) 'IncSet.c'; else $(CYGPATH_W) '$(srcdir)/IncSet.c'; fi`
-htop-IncSet.o: IncSet.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-IncSet.o -MD -MP -MF $(DEPDIR)/htop-IncSet.Tpo -c -o htop-IncSet.o `test -f 'IncSet.c' || echo '$(srcdir)/'`IncSet.c
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-IncSet.Tpo $(DEPDIR)/htop-IncSet.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='IncSet.c' object='htop-IncSet.o' libtool=no @AMDEPBACKSLASH@
+htop-Action.o: Action.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Action.o -MD -MP -MF $(DEPDIR)/htop-Action.Tpo -c -o htop-Action.o `test -f 'Action.c' || echo '$(srcdir)/'`Action.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Action.Tpo $(DEPDIR)/htop-Action.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Action.c' object='htop-Action.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-IncSet.o `test -f 'IncSet.c' || echo '$(srcdir)/'`IncSet.c
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Action.o `test -f 'Action.c' || echo '$(srcdir)/'`Action.c
-htop-IncSet.obj: IncSet.c
-@am__fastdepCC_TRUE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-IncSet.obj -MD -MP -MF $(DEPDIR)/htop-IncSet.Tpo -c -o htop-IncSet.obj `if test -f 'IncSet.c'; then $(CYGPATH_W) 'IncSet.c'; else $(CYGPATH_W) '$(srcdir)/IncSet.c'; fi`
-@am__fastdepCC_TRUE@ $(am__mv) $(DEPDIR)/htop-IncSet.Tpo $(DEPDIR)/htop-IncSet.Po
-@AMDEP_TRUE@@am__fastdepCC_FALSE@ source='IncSet.c' object='htop-IncSet.obj' libtool=no @AMDEPBACKSLASH@
+htop-Action.obj: Action.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-Action.obj -MD -MP -MF $(DEPDIR)/htop-Action.Tpo -c -o htop-Action.obj `if test -f 'Action.c'; then $(CYGPATH_W) 'Action.c'; else $(CYGPATH_W) '$(srcdir)/Action.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-Action.Tpo $(DEPDIR)/htop-Action.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='Action.c' object='htop-Action.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-Action.obj `if test -f 'Action.c'; then $(CYGPATH_W) 'Action.c'; else $(CYGPATH_W) '$(srcdir)/Action.c'; fi`
+
+htop-EnvScreen.o: EnvScreen.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-EnvScreen.o -MD -MP -MF $(DEPDIR)/htop-EnvScreen.Tpo -c -o htop-EnvScreen.o `test -f 'EnvScreen.c' || echo '$(srcdir)/'`EnvScreen.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-EnvScreen.Tpo $(DEPDIR)/htop-EnvScreen.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='EnvScreen.c' object='htop-EnvScreen.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-EnvScreen.o `test -f 'EnvScreen.c' || echo '$(srcdir)/'`EnvScreen.c
+
+htop-EnvScreen.obj: EnvScreen.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-EnvScreen.obj -MD -MP -MF $(DEPDIR)/htop-EnvScreen.Tpo -c -o htop-EnvScreen.obj `if test -f 'EnvScreen.c'; then $(CYGPATH_W) 'EnvScreen.c'; else $(CYGPATH_W) '$(srcdir)/EnvScreen.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-EnvScreen.Tpo $(DEPDIR)/htop-EnvScreen.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='EnvScreen.c' object='htop-EnvScreen.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-EnvScreen.obj `if test -f 'EnvScreen.c'; then $(CYGPATH_W) 'EnvScreen.c'; else $(CYGPATH_W) '$(srcdir)/EnvScreen.c'; fi`
+
+htop-InfoScreen.o: InfoScreen.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-InfoScreen.o -MD -MP -MF $(DEPDIR)/htop-InfoScreen.Tpo -c -o htop-InfoScreen.o `test -f 'InfoScreen.c' || echo '$(srcdir)/'`InfoScreen.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-InfoScreen.Tpo $(DEPDIR)/htop-InfoScreen.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='InfoScreen.c' object='htop-InfoScreen.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-InfoScreen.o `test -f 'InfoScreen.c' || echo '$(srcdir)/'`InfoScreen.c
+
+htop-InfoScreen.obj: InfoScreen.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-InfoScreen.obj -MD -MP -MF $(DEPDIR)/htop-InfoScreen.Tpo -c -o htop-InfoScreen.obj `if test -f 'InfoScreen.c'; then $(CYGPATH_W) 'InfoScreen.c'; else $(CYGPATH_W) '$(srcdir)/InfoScreen.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-InfoScreen.Tpo $(DEPDIR)/htop-InfoScreen.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='InfoScreen.c' object='htop-InfoScreen.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-InfoScreen.obj `if test -f 'InfoScreen.c'; then $(CYGPATH_W) 'InfoScreen.c'; else $(CYGPATH_W) '$(srcdir)/InfoScreen.c'; fi`
+
+htop-XAlloc.o: XAlloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-XAlloc.o -MD -MP -MF $(DEPDIR)/htop-XAlloc.Tpo -c -o htop-XAlloc.o `test -f 'XAlloc.c' || echo '$(srcdir)/'`XAlloc.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-XAlloc.Tpo $(DEPDIR)/htop-XAlloc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='XAlloc.c' object='htop-XAlloc.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-XAlloc.o `test -f 'XAlloc.c' || echo '$(srcdir)/'`XAlloc.c
+
+htop-XAlloc.obj: XAlloc.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT htop-XAlloc.obj -MD -MP -MF $(DEPDIR)/htop-XAlloc.Tpo -c -o htop-XAlloc.obj `if test -f 'XAlloc.c'; then $(CYGPATH_W) 'XAlloc.c'; else $(CYGPATH_W) '$(srcdir)/XAlloc.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) $(DEPDIR)/htop-XAlloc.Tpo $(DEPDIR)/htop-XAlloc.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='XAlloc.c' object='htop-XAlloc.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-XAlloc.obj `if test -f 'XAlloc.c'; then $(CYGPATH_W) 'XAlloc.c'; else $(CYGPATH_W) '$(srcdir)/XAlloc.c'; fi`
+
+darwin/htop-Platform.o: darwin/Platform.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-Platform.o -MD -MP -MF darwin/$(DEPDIR)/htop-Platform.Tpo -c -o darwin/htop-Platform.o `test -f 'darwin/Platform.c' || echo '$(srcdir)/'`darwin/Platform.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-Platform.Tpo darwin/$(DEPDIR)/htop-Platform.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/Platform.c' object='darwin/htop-Platform.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-Platform.o `test -f 'darwin/Platform.c' || echo '$(srcdir)/'`darwin/Platform.c
+
+darwin/htop-Platform.obj: darwin/Platform.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-Platform.obj -MD -MP -MF darwin/$(DEPDIR)/htop-Platform.Tpo -c -o darwin/htop-Platform.obj `if test -f 'darwin/Platform.c'; then $(CYGPATH_W) 'darwin/Platform.c'; else $(CYGPATH_W) '$(srcdir)/darwin/Platform.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-Platform.Tpo darwin/$(DEPDIR)/htop-Platform.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/Platform.c' object='darwin/htop-Platform.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-Platform.obj `if test -f 'darwin/Platform.c'; then $(CYGPATH_W) 'darwin/Platform.c'; else $(CYGPATH_W) '$(srcdir)/darwin/Platform.c'; fi`
+
+darwin/htop-DarwinProcess.o: darwin/DarwinProcess.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-DarwinProcess.o -MD -MP -MF darwin/$(DEPDIR)/htop-DarwinProcess.Tpo -c -o darwin/htop-DarwinProcess.o `test -f 'darwin/DarwinProcess.c' || echo '$(srcdir)/'`darwin/DarwinProcess.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-DarwinProcess.Tpo darwin/$(DEPDIR)/htop-DarwinProcess.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/DarwinProcess.c' object='darwin/htop-DarwinProcess.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-DarwinProcess.o `test -f 'darwin/DarwinProcess.c' || echo '$(srcdir)/'`darwin/DarwinProcess.c
+
+darwin/htop-DarwinProcess.obj: darwin/DarwinProcess.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-DarwinProcess.obj -MD -MP -MF darwin/$(DEPDIR)/htop-DarwinProcess.Tpo -c -o darwin/htop-DarwinProcess.obj `if test -f 'darwin/DarwinProcess.c'; then $(CYGPATH_W) 'darwin/DarwinProcess.c'; else $(CYGPATH_W) '$(srcdir)/darwin/DarwinProcess.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-DarwinProcess.Tpo darwin/$(DEPDIR)/htop-DarwinProcess.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/DarwinProcess.c' object='darwin/htop-DarwinProcess.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-DarwinProcess.obj `if test -f 'darwin/DarwinProcess.c'; then $(CYGPATH_W) 'darwin/DarwinProcess.c'; else $(CYGPATH_W) '$(srcdir)/darwin/DarwinProcess.c'; fi`
+
+darwin/htop-DarwinProcessList.o: darwin/DarwinProcessList.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-DarwinProcessList.o -MD -MP -MF darwin/$(DEPDIR)/htop-DarwinProcessList.Tpo -c -o darwin/htop-DarwinProcessList.o `test -f 'darwin/DarwinProcessList.c' || echo '$(srcdir)/'`darwin/DarwinProcessList.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-DarwinProcessList.Tpo darwin/$(DEPDIR)/htop-DarwinProcessList.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/DarwinProcessList.c' object='darwin/htop-DarwinProcessList.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-DarwinProcessList.o `test -f 'darwin/DarwinProcessList.c' || echo '$(srcdir)/'`darwin/DarwinProcessList.c
+
+darwin/htop-DarwinProcessList.obj: darwin/DarwinProcessList.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-DarwinProcessList.obj -MD -MP -MF darwin/$(DEPDIR)/htop-DarwinProcessList.Tpo -c -o darwin/htop-DarwinProcessList.obj `if test -f 'darwin/DarwinProcessList.c'; then $(CYGPATH_W) 'darwin/DarwinProcessList.c'; else $(CYGPATH_W) '$(srcdir)/darwin/DarwinProcessList.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-DarwinProcessList.Tpo darwin/$(DEPDIR)/htop-DarwinProcessList.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/DarwinProcessList.c' object='darwin/htop-DarwinProcessList.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-DarwinProcessList.obj `if test -f 'darwin/DarwinProcessList.c'; then $(CYGPATH_W) 'darwin/DarwinProcessList.c'; else $(CYGPATH_W) '$(srcdir)/darwin/DarwinProcessList.c'; fi`
+
+darwin/htop-DarwinCRT.o: darwin/DarwinCRT.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-DarwinCRT.o -MD -MP -MF darwin/$(DEPDIR)/htop-DarwinCRT.Tpo -c -o darwin/htop-DarwinCRT.o `test -f 'darwin/DarwinCRT.c' || echo '$(srcdir)/'`darwin/DarwinCRT.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-DarwinCRT.Tpo darwin/$(DEPDIR)/htop-DarwinCRT.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/DarwinCRT.c' object='darwin/htop-DarwinCRT.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-DarwinCRT.o `test -f 'darwin/DarwinCRT.c' || echo '$(srcdir)/'`darwin/DarwinCRT.c
+
+darwin/htop-DarwinCRT.obj: darwin/DarwinCRT.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-DarwinCRT.obj -MD -MP -MF darwin/$(DEPDIR)/htop-DarwinCRT.Tpo -c -o darwin/htop-DarwinCRT.obj `if test -f 'darwin/DarwinCRT.c'; then $(CYGPATH_W) 'darwin/DarwinCRT.c'; else $(CYGPATH_W) '$(srcdir)/darwin/DarwinCRT.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-DarwinCRT.Tpo darwin/$(DEPDIR)/htop-DarwinCRT.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/DarwinCRT.c' object='darwin/htop-DarwinCRT.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-DarwinCRT.obj `if test -f 'darwin/DarwinCRT.c'; then $(CYGPATH_W) 'darwin/DarwinCRT.c'; else $(CYGPATH_W) '$(srcdir)/darwin/DarwinCRT.c'; fi`
+
+darwin/htop-Battery.o: darwin/Battery.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-Battery.o -MD -MP -MF darwin/$(DEPDIR)/htop-Battery.Tpo -c -o darwin/htop-Battery.o `test -f 'darwin/Battery.c' || echo '$(srcdir)/'`darwin/Battery.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-Battery.Tpo darwin/$(DEPDIR)/htop-Battery.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/Battery.c' object='darwin/htop-Battery.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-Battery.o `test -f 'darwin/Battery.c' || echo '$(srcdir)/'`darwin/Battery.c
+
+darwin/htop-Battery.obj: darwin/Battery.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT darwin/htop-Battery.obj -MD -MP -MF darwin/$(DEPDIR)/htop-Battery.Tpo -c -o darwin/htop-Battery.obj `if test -f 'darwin/Battery.c'; then $(CYGPATH_W) 'darwin/Battery.c'; else $(CYGPATH_W) '$(srcdir)/darwin/Battery.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) darwin/$(DEPDIR)/htop-Battery.Tpo darwin/$(DEPDIR)/htop-Battery.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='darwin/Battery.c' object='darwin/htop-Battery.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o darwin/htop-Battery.obj `if test -f 'darwin/Battery.c'; then $(CYGPATH_W) 'darwin/Battery.c'; else $(CYGPATH_W) '$(srcdir)/darwin/Battery.c'; fi`
+
+freebsd/htop-Platform.o: freebsd/Platform.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-Platform.o -MD -MP -MF freebsd/$(DEPDIR)/htop-Platform.Tpo -c -o freebsd/htop-Platform.o `test -f 'freebsd/Platform.c' || echo '$(srcdir)/'`freebsd/Platform.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-Platform.Tpo freebsd/$(DEPDIR)/htop-Platform.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/Platform.c' object='freebsd/htop-Platform.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-Platform.o `test -f 'freebsd/Platform.c' || echo '$(srcdir)/'`freebsd/Platform.c
+
+freebsd/htop-Platform.obj: freebsd/Platform.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-Platform.obj -MD -MP -MF freebsd/$(DEPDIR)/htop-Platform.Tpo -c -o freebsd/htop-Platform.obj `if test -f 'freebsd/Platform.c'; then $(CYGPATH_W) 'freebsd/Platform.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/Platform.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-Platform.Tpo freebsd/$(DEPDIR)/htop-Platform.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/Platform.c' object='freebsd/htop-Platform.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-Platform.obj `if test -f 'freebsd/Platform.c'; then $(CYGPATH_W) 'freebsd/Platform.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/Platform.c'; fi`
+
+freebsd/htop-FreeBSDProcessList.o: freebsd/FreeBSDProcessList.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-FreeBSDProcessList.o -MD -MP -MF freebsd/$(DEPDIR)/htop-FreeBSDProcessList.Tpo -c -o freebsd/htop-FreeBSDProcessList.o `test -f 'freebsd/FreeBSDProcessList.c' || echo '$(srcdir)/'`freebsd/FreeBSDProcessList.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-FreeBSDProcessList.Tpo freebsd/$(DEPDIR)/htop-FreeBSDProcessList.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/FreeBSDProcessList.c' object='freebsd/htop-FreeBSDProcessList.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-FreeBSDProcessList.o `test -f 'freebsd/FreeBSDProcessList.c' || echo '$(srcdir)/'`freebsd/FreeBSDProcessList.c
+
+freebsd/htop-FreeBSDProcessList.obj: freebsd/FreeBSDProcessList.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-FreeBSDProcessList.obj -MD -MP -MF freebsd/$(DEPDIR)/htop-FreeBSDProcessList.Tpo -c -o freebsd/htop-FreeBSDProcessList.obj `if test -f 'freebsd/FreeBSDProcessList.c'; then $(CYGPATH_W) 'freebsd/FreeBSDProcessList.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/FreeBSDProcessList.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-FreeBSDProcessList.Tpo freebsd/$(DEPDIR)/htop-FreeBSDProcessList.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/FreeBSDProcessList.c' object='freebsd/htop-FreeBSDProcessList.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-FreeBSDProcessList.obj `if test -f 'freebsd/FreeBSDProcessList.c'; then $(CYGPATH_W) 'freebsd/FreeBSDProcessList.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/FreeBSDProcessList.c'; fi`
+
+freebsd/htop-FreeBSDProcess.o: freebsd/FreeBSDProcess.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-FreeBSDProcess.o -MD -MP -MF freebsd/$(DEPDIR)/htop-FreeBSDProcess.Tpo -c -o freebsd/htop-FreeBSDProcess.o `test -f 'freebsd/FreeBSDProcess.c' || echo '$(srcdir)/'`freebsd/FreeBSDProcess.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-FreeBSDProcess.Tpo freebsd/$(DEPDIR)/htop-FreeBSDProcess.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/FreeBSDProcess.c' object='freebsd/htop-FreeBSDProcess.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-FreeBSDProcess.o `test -f 'freebsd/FreeBSDProcess.c' || echo '$(srcdir)/'`freebsd/FreeBSDProcess.c
+
+freebsd/htop-FreeBSDProcess.obj: freebsd/FreeBSDProcess.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-FreeBSDProcess.obj -MD -MP -MF freebsd/$(DEPDIR)/htop-FreeBSDProcess.Tpo -c -o freebsd/htop-FreeBSDProcess.obj `if test -f 'freebsd/FreeBSDProcess.c'; then $(CYGPATH_W) 'freebsd/FreeBSDProcess.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/FreeBSDProcess.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-FreeBSDProcess.Tpo freebsd/$(DEPDIR)/htop-FreeBSDProcess.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/FreeBSDProcess.c' object='freebsd/htop-FreeBSDProcess.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-FreeBSDProcess.obj `if test -f 'freebsd/FreeBSDProcess.c'; then $(CYGPATH_W) 'freebsd/FreeBSDProcess.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/FreeBSDProcess.c'; fi`
+
+freebsd/htop-FreeBSDCRT.o: freebsd/FreeBSDCRT.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-FreeBSDCRT.o -MD -MP -MF freebsd/$(DEPDIR)/htop-FreeBSDCRT.Tpo -c -o freebsd/htop-FreeBSDCRT.o `test -f 'freebsd/FreeBSDCRT.c' || echo '$(srcdir)/'`freebsd/FreeBSDCRT.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-FreeBSDCRT.Tpo freebsd/$(DEPDIR)/htop-FreeBSDCRT.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/FreeBSDCRT.c' object='freebsd/htop-FreeBSDCRT.o' libtool=no @AMDEPBACKSLASH@
@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
-@am__fastdepCC_FALSE@ $(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o htop-IncSet.obj `if test -f 'IncSet.c'; then $(CYGPATH_W) 'IncSet.c'; else $(CYGPATH_W) '$(srcdir)/IncSet.c'; fi`
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-FreeBSDCRT.o `test -f 'freebsd/FreeBSDCRT.c' || echo '$(srcdir)/'`freebsd/FreeBSDCRT.c
+
+freebsd/htop-FreeBSDCRT.obj: freebsd/FreeBSDCRT.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-FreeBSDCRT.obj -MD -MP -MF freebsd/$(DEPDIR)/htop-FreeBSDCRT.Tpo -c -o freebsd/htop-FreeBSDCRT.obj `if test -f 'freebsd/FreeBSDCRT.c'; then $(CYGPATH_W) 'freebsd/FreeBSDCRT.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/FreeBSDCRT.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-FreeBSDCRT.Tpo freebsd/$(DEPDIR)/htop-FreeBSDCRT.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/FreeBSDCRT.c' object='freebsd/htop-FreeBSDCRT.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-FreeBSDCRT.obj `if test -f 'freebsd/FreeBSDCRT.c'; then $(CYGPATH_W) 'freebsd/FreeBSDCRT.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/FreeBSDCRT.c'; fi`
+
+freebsd/htop-Battery.o: freebsd/Battery.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-Battery.o -MD -MP -MF freebsd/$(DEPDIR)/htop-Battery.Tpo -c -o freebsd/htop-Battery.o `test -f 'freebsd/Battery.c' || echo '$(srcdir)/'`freebsd/Battery.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-Battery.Tpo freebsd/$(DEPDIR)/htop-Battery.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/Battery.c' object='freebsd/htop-Battery.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-Battery.o `test -f 'freebsd/Battery.c' || echo '$(srcdir)/'`freebsd/Battery.c
+
+freebsd/htop-Battery.obj: freebsd/Battery.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT freebsd/htop-Battery.obj -MD -MP -MF freebsd/$(DEPDIR)/htop-Battery.Tpo -c -o freebsd/htop-Battery.obj `if test -f 'freebsd/Battery.c'; then $(CYGPATH_W) 'freebsd/Battery.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/Battery.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) freebsd/$(DEPDIR)/htop-Battery.Tpo freebsd/$(DEPDIR)/htop-Battery.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='freebsd/Battery.c' object='freebsd/htop-Battery.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o freebsd/htop-Battery.obj `if test -f 'freebsd/Battery.c'; then $(CYGPATH_W) 'freebsd/Battery.c'; else $(CYGPATH_W) '$(srcdir)/freebsd/Battery.c'; fi`
+
+linux/htop-Platform.o: linux/Platform.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-Platform.o -MD -MP -MF linux/$(DEPDIR)/htop-Platform.Tpo -c -o linux/htop-Platform.o `test -f 'linux/Platform.c' || echo '$(srcdir)/'`linux/Platform.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-Platform.Tpo linux/$(DEPDIR)/htop-Platform.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/Platform.c' object='linux/htop-Platform.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-Platform.o `test -f 'linux/Platform.c' || echo '$(srcdir)/'`linux/Platform.c
+
+linux/htop-Platform.obj: linux/Platform.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-Platform.obj -MD -MP -MF linux/$(DEPDIR)/htop-Platform.Tpo -c -o linux/htop-Platform.obj `if test -f 'linux/Platform.c'; then $(CYGPATH_W) 'linux/Platform.c'; else $(CYGPATH_W) '$(srcdir)/linux/Platform.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-Platform.Tpo linux/$(DEPDIR)/htop-Platform.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/Platform.c' object='linux/htop-Platform.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-Platform.obj `if test -f 'linux/Platform.c'; then $(CYGPATH_W) 'linux/Platform.c'; else $(CYGPATH_W) '$(srcdir)/linux/Platform.c'; fi`
+
+linux/htop-IOPriorityPanel.o: linux/IOPriorityPanel.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-IOPriorityPanel.o -MD -MP -MF linux/$(DEPDIR)/htop-IOPriorityPanel.Tpo -c -o linux/htop-IOPriorityPanel.o `test -f 'linux/IOPriorityPanel.c' || echo '$(srcdir)/'`linux/IOPriorityPanel.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-IOPriorityPanel.Tpo linux/$(DEPDIR)/htop-IOPriorityPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/IOPriorityPanel.c' object='linux/htop-IOPriorityPanel.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-IOPriorityPanel.o `test -f 'linux/IOPriorityPanel.c' || echo '$(srcdir)/'`linux/IOPriorityPanel.c
+
+linux/htop-IOPriorityPanel.obj: linux/IOPriorityPanel.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-IOPriorityPanel.obj -MD -MP -MF linux/$(DEPDIR)/htop-IOPriorityPanel.Tpo -c -o linux/htop-IOPriorityPanel.obj `if test -f 'linux/IOPriorityPanel.c'; then $(CYGPATH_W) 'linux/IOPriorityPanel.c'; else $(CYGPATH_W) '$(srcdir)/linux/IOPriorityPanel.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-IOPriorityPanel.Tpo linux/$(DEPDIR)/htop-IOPriorityPanel.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/IOPriorityPanel.c' object='linux/htop-IOPriorityPanel.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-IOPriorityPanel.obj `if test -f 'linux/IOPriorityPanel.c'; then $(CYGPATH_W) 'linux/IOPriorityPanel.c'; else $(CYGPATH_W) '$(srcdir)/linux/IOPriorityPanel.c'; fi`
+
+linux/htop-IOPriority.o: linux/IOPriority.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-IOPriority.o -MD -MP -MF linux/$(DEPDIR)/htop-IOPriority.Tpo -c -o linux/htop-IOPriority.o `test -f 'linux/IOPriority.c' || echo '$(srcdir)/'`linux/IOPriority.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-IOPriority.Tpo linux/$(DEPDIR)/htop-IOPriority.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/IOPriority.c' object='linux/htop-IOPriority.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-IOPriority.o `test -f 'linux/IOPriority.c' || echo '$(srcdir)/'`linux/IOPriority.c
+
+linux/htop-IOPriority.obj: linux/IOPriority.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-IOPriority.obj -MD -MP -MF linux/$(DEPDIR)/htop-IOPriority.Tpo -c -o linux/htop-IOPriority.obj `if test -f 'linux/IOPriority.c'; then $(CYGPATH_W) 'linux/IOPriority.c'; else $(CYGPATH_W) '$(srcdir)/linux/IOPriority.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-IOPriority.Tpo linux/$(DEPDIR)/htop-IOPriority.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/IOPriority.c' object='linux/htop-IOPriority.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-IOPriority.obj `if test -f 'linux/IOPriority.c'; then $(CYGPATH_W) 'linux/IOPriority.c'; else $(CYGPATH_W) '$(srcdir)/linux/IOPriority.c'; fi`
+
+linux/htop-LinuxProcess.o: linux/LinuxProcess.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-LinuxProcess.o -MD -MP -MF linux/$(DEPDIR)/htop-LinuxProcess.Tpo -c -o linux/htop-LinuxProcess.o `test -f 'linux/LinuxProcess.c' || echo '$(srcdir)/'`linux/LinuxProcess.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-LinuxProcess.Tpo linux/$(DEPDIR)/htop-LinuxProcess.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/LinuxProcess.c' object='linux/htop-LinuxProcess.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-LinuxProcess.o `test -f 'linux/LinuxProcess.c' || echo '$(srcdir)/'`linux/LinuxProcess.c
+
+linux/htop-LinuxProcess.obj: linux/LinuxProcess.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-LinuxProcess.obj -MD -MP -MF linux/$(DEPDIR)/htop-LinuxProcess.Tpo -c -o linux/htop-LinuxProcess.obj `if test -f 'linux/LinuxProcess.c'; then $(CYGPATH_W) 'linux/LinuxProcess.c'; else $(CYGPATH_W) '$(srcdir)/linux/LinuxProcess.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-LinuxProcess.Tpo linux/$(DEPDIR)/htop-LinuxProcess.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/LinuxProcess.c' object='linux/htop-LinuxProcess.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-LinuxProcess.obj `if test -f 'linux/LinuxProcess.c'; then $(CYGPATH_W) 'linux/LinuxProcess.c'; else $(CYGPATH_W) '$(srcdir)/linux/LinuxProcess.c'; fi`
+
+linux/htop-LinuxProcessList.o: linux/LinuxProcessList.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-LinuxProcessList.o -MD -MP -MF linux/$(DEPDIR)/htop-LinuxProcessList.Tpo -c -o linux/htop-LinuxProcessList.o `test -f 'linux/LinuxProcessList.c' || echo '$(srcdir)/'`linux/LinuxProcessList.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-LinuxProcessList.Tpo linux/$(DEPDIR)/htop-LinuxProcessList.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/LinuxProcessList.c' object='linux/htop-LinuxProcessList.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-LinuxProcessList.o `test -f 'linux/LinuxProcessList.c' || echo '$(srcdir)/'`linux/LinuxProcessList.c
+
+linux/htop-LinuxProcessList.obj: linux/LinuxProcessList.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-LinuxProcessList.obj -MD -MP -MF linux/$(DEPDIR)/htop-LinuxProcessList.Tpo -c -o linux/htop-LinuxProcessList.obj `if test -f 'linux/LinuxProcessList.c'; then $(CYGPATH_W) 'linux/LinuxProcessList.c'; else $(CYGPATH_W) '$(srcdir)/linux/LinuxProcessList.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-LinuxProcessList.Tpo linux/$(DEPDIR)/htop-LinuxProcessList.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/LinuxProcessList.c' object='linux/htop-LinuxProcessList.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-LinuxProcessList.obj `if test -f 'linux/LinuxProcessList.c'; then $(CYGPATH_W) 'linux/LinuxProcessList.c'; else $(CYGPATH_W) '$(srcdir)/linux/LinuxProcessList.c'; fi`
+
+linux/htop-LinuxCRT.o: linux/LinuxCRT.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-LinuxCRT.o -MD -MP -MF linux/$(DEPDIR)/htop-LinuxCRT.Tpo -c -o linux/htop-LinuxCRT.o `test -f 'linux/LinuxCRT.c' || echo '$(srcdir)/'`linux/LinuxCRT.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-LinuxCRT.Tpo linux/$(DEPDIR)/htop-LinuxCRT.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/LinuxCRT.c' object='linux/htop-LinuxCRT.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-LinuxCRT.o `test -f 'linux/LinuxCRT.c' || echo '$(srcdir)/'`linux/LinuxCRT.c
+
+linux/htop-LinuxCRT.obj: linux/LinuxCRT.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-LinuxCRT.obj -MD -MP -MF linux/$(DEPDIR)/htop-LinuxCRT.Tpo -c -o linux/htop-LinuxCRT.obj `if test -f 'linux/LinuxCRT.c'; then $(CYGPATH_W) 'linux/LinuxCRT.c'; else $(CYGPATH_W) '$(srcdir)/linux/LinuxCRT.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-LinuxCRT.Tpo linux/$(DEPDIR)/htop-LinuxCRT.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/LinuxCRT.c' object='linux/htop-LinuxCRT.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-LinuxCRT.obj `if test -f 'linux/LinuxCRT.c'; then $(CYGPATH_W) 'linux/LinuxCRT.c'; else $(CYGPATH_W) '$(srcdir)/linux/LinuxCRT.c'; fi`
+
+linux/htop-Battery.o: linux/Battery.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-Battery.o -MD -MP -MF linux/$(DEPDIR)/htop-Battery.Tpo -c -o linux/htop-Battery.o `test -f 'linux/Battery.c' || echo '$(srcdir)/'`linux/Battery.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-Battery.Tpo linux/$(DEPDIR)/htop-Battery.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/Battery.c' object='linux/htop-Battery.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-Battery.o `test -f 'linux/Battery.c' || echo '$(srcdir)/'`linux/Battery.c
+
+linux/htop-Battery.obj: linux/Battery.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT linux/htop-Battery.obj -MD -MP -MF linux/$(DEPDIR)/htop-Battery.Tpo -c -o linux/htop-Battery.obj `if test -f 'linux/Battery.c'; then $(CYGPATH_W) 'linux/Battery.c'; else $(CYGPATH_W) '$(srcdir)/linux/Battery.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) linux/$(DEPDIR)/htop-Battery.Tpo linux/$(DEPDIR)/htop-Battery.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='linux/Battery.c' object='linux/htop-Battery.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o linux/htop-Battery.obj `if test -f 'linux/Battery.c'; then $(CYGPATH_W) 'linux/Battery.c'; else $(CYGPATH_W) '$(srcdir)/linux/Battery.c'; fi`
+
+openbsd/htop-Platform.o: openbsd/Platform.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-Platform.o -MD -MP -MF openbsd/$(DEPDIR)/htop-Platform.Tpo -c -o openbsd/htop-Platform.o `test -f 'openbsd/Platform.c' || echo '$(srcdir)/'`openbsd/Platform.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-Platform.Tpo openbsd/$(DEPDIR)/htop-Platform.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/Platform.c' object='openbsd/htop-Platform.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-Platform.o `test -f 'openbsd/Platform.c' || echo '$(srcdir)/'`openbsd/Platform.c
+
+openbsd/htop-Platform.obj: openbsd/Platform.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-Platform.obj -MD -MP -MF openbsd/$(DEPDIR)/htop-Platform.Tpo -c -o openbsd/htop-Platform.obj `if test -f 'openbsd/Platform.c'; then $(CYGPATH_W) 'openbsd/Platform.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/Platform.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-Platform.Tpo openbsd/$(DEPDIR)/htop-Platform.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/Platform.c' object='openbsd/htop-Platform.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-Platform.obj `if test -f 'openbsd/Platform.c'; then $(CYGPATH_W) 'openbsd/Platform.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/Platform.c'; fi`
+
+openbsd/htop-OpenBSDProcessList.o: openbsd/OpenBSDProcessList.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-OpenBSDProcessList.o -MD -MP -MF openbsd/$(DEPDIR)/htop-OpenBSDProcessList.Tpo -c -o openbsd/htop-OpenBSDProcessList.o `test -f 'openbsd/OpenBSDProcessList.c' || echo '$(srcdir)/'`openbsd/OpenBSDProcessList.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-OpenBSDProcessList.Tpo openbsd/$(DEPDIR)/htop-OpenBSDProcessList.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/OpenBSDProcessList.c' object='openbsd/htop-OpenBSDProcessList.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-OpenBSDProcessList.o `test -f 'openbsd/OpenBSDProcessList.c' || echo '$(srcdir)/'`openbsd/OpenBSDProcessList.c
+
+openbsd/htop-OpenBSDProcessList.obj: openbsd/OpenBSDProcessList.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-OpenBSDProcessList.obj -MD -MP -MF openbsd/$(DEPDIR)/htop-OpenBSDProcessList.Tpo -c -o openbsd/htop-OpenBSDProcessList.obj `if test -f 'openbsd/OpenBSDProcessList.c'; then $(CYGPATH_W) 'openbsd/OpenBSDProcessList.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/OpenBSDProcessList.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-OpenBSDProcessList.Tpo openbsd/$(DEPDIR)/htop-OpenBSDProcessList.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/OpenBSDProcessList.c' object='openbsd/htop-OpenBSDProcessList.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-OpenBSDProcessList.obj `if test -f 'openbsd/OpenBSDProcessList.c'; then $(CYGPATH_W) 'openbsd/OpenBSDProcessList.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/OpenBSDProcessList.c'; fi`
+
+openbsd/htop-OpenBSDProcess.o: openbsd/OpenBSDProcess.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-OpenBSDProcess.o -MD -MP -MF openbsd/$(DEPDIR)/htop-OpenBSDProcess.Tpo -c -o openbsd/htop-OpenBSDProcess.o `test -f 'openbsd/OpenBSDProcess.c' || echo '$(srcdir)/'`openbsd/OpenBSDProcess.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-OpenBSDProcess.Tpo openbsd/$(DEPDIR)/htop-OpenBSDProcess.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/OpenBSDProcess.c' object='openbsd/htop-OpenBSDProcess.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-OpenBSDProcess.o `test -f 'openbsd/OpenBSDProcess.c' || echo '$(srcdir)/'`openbsd/OpenBSDProcess.c
+
+openbsd/htop-OpenBSDProcess.obj: openbsd/OpenBSDProcess.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-OpenBSDProcess.obj -MD -MP -MF openbsd/$(DEPDIR)/htop-OpenBSDProcess.Tpo -c -o openbsd/htop-OpenBSDProcess.obj `if test -f 'openbsd/OpenBSDProcess.c'; then $(CYGPATH_W) 'openbsd/OpenBSDProcess.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/OpenBSDProcess.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-OpenBSDProcess.Tpo openbsd/$(DEPDIR)/htop-OpenBSDProcess.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/OpenBSDProcess.c' object='openbsd/htop-OpenBSDProcess.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-OpenBSDProcess.obj `if test -f 'openbsd/OpenBSDProcess.c'; then $(CYGPATH_W) 'openbsd/OpenBSDProcess.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/OpenBSDProcess.c'; fi`
+
+openbsd/htop-OpenBSDCRT.o: openbsd/OpenBSDCRT.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-OpenBSDCRT.o -MD -MP -MF openbsd/$(DEPDIR)/htop-OpenBSDCRT.Tpo -c -o openbsd/htop-OpenBSDCRT.o `test -f 'openbsd/OpenBSDCRT.c' || echo '$(srcdir)/'`openbsd/OpenBSDCRT.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-OpenBSDCRT.Tpo openbsd/$(DEPDIR)/htop-OpenBSDCRT.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/OpenBSDCRT.c' object='openbsd/htop-OpenBSDCRT.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-OpenBSDCRT.o `test -f 'openbsd/OpenBSDCRT.c' || echo '$(srcdir)/'`openbsd/OpenBSDCRT.c
+
+openbsd/htop-OpenBSDCRT.obj: openbsd/OpenBSDCRT.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-OpenBSDCRT.obj -MD -MP -MF openbsd/$(DEPDIR)/htop-OpenBSDCRT.Tpo -c -o openbsd/htop-OpenBSDCRT.obj `if test -f 'openbsd/OpenBSDCRT.c'; then $(CYGPATH_W) 'openbsd/OpenBSDCRT.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/OpenBSDCRT.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-OpenBSDCRT.Tpo openbsd/$(DEPDIR)/htop-OpenBSDCRT.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/OpenBSDCRT.c' object='openbsd/htop-OpenBSDCRT.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-OpenBSDCRT.obj `if test -f 'openbsd/OpenBSDCRT.c'; then $(CYGPATH_W) 'openbsd/OpenBSDCRT.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/OpenBSDCRT.c'; fi`
+
+openbsd/htop-Battery.o: openbsd/Battery.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-Battery.o -MD -MP -MF openbsd/$(DEPDIR)/htop-Battery.Tpo -c -o openbsd/htop-Battery.o `test -f 'openbsd/Battery.c' || echo '$(srcdir)/'`openbsd/Battery.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-Battery.Tpo openbsd/$(DEPDIR)/htop-Battery.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/Battery.c' object='openbsd/htop-Battery.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-Battery.o `test -f 'openbsd/Battery.c' || echo '$(srcdir)/'`openbsd/Battery.c
+
+openbsd/htop-Battery.obj: openbsd/Battery.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT openbsd/htop-Battery.obj -MD -MP -MF openbsd/$(DEPDIR)/htop-Battery.Tpo -c -o openbsd/htop-Battery.obj `if test -f 'openbsd/Battery.c'; then $(CYGPATH_W) 'openbsd/Battery.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/Battery.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) openbsd/$(DEPDIR)/htop-Battery.Tpo openbsd/$(DEPDIR)/htop-Battery.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='openbsd/Battery.c' object='openbsd/htop-Battery.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o openbsd/htop-Battery.obj `if test -f 'openbsd/Battery.c'; then $(CYGPATH_W) 'openbsd/Battery.c'; else $(CYGPATH_W) '$(srcdir)/openbsd/Battery.c'; fi`
+
+unsupported/htop-Platform.o: unsupported/Platform.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-Platform.o -MD -MP -MF unsupported/$(DEPDIR)/htop-Platform.Tpo -c -o unsupported/htop-Platform.o `test -f 'unsupported/Platform.c' || echo '$(srcdir)/'`unsupported/Platform.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-Platform.Tpo unsupported/$(DEPDIR)/htop-Platform.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/Platform.c' object='unsupported/htop-Platform.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-Platform.o `test -f 'unsupported/Platform.c' || echo '$(srcdir)/'`unsupported/Platform.c
+
+unsupported/htop-Platform.obj: unsupported/Platform.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-Platform.obj -MD -MP -MF unsupported/$(DEPDIR)/htop-Platform.Tpo -c -o unsupported/htop-Platform.obj `if test -f 'unsupported/Platform.c'; then $(CYGPATH_W) 'unsupported/Platform.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/Platform.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-Platform.Tpo unsupported/$(DEPDIR)/htop-Platform.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/Platform.c' object='unsupported/htop-Platform.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-Platform.obj `if test -f 'unsupported/Platform.c'; then $(CYGPATH_W) 'unsupported/Platform.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/Platform.c'; fi`
+
+unsupported/htop-UnsupportedProcess.o: unsupported/UnsupportedProcess.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-UnsupportedProcess.o -MD -MP -MF unsupported/$(DEPDIR)/htop-UnsupportedProcess.Tpo -c -o unsupported/htop-UnsupportedProcess.o `test -f 'unsupported/UnsupportedProcess.c' || echo '$(srcdir)/'`unsupported/UnsupportedProcess.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-UnsupportedProcess.Tpo unsupported/$(DEPDIR)/htop-UnsupportedProcess.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/UnsupportedProcess.c' object='unsupported/htop-UnsupportedProcess.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-UnsupportedProcess.o `test -f 'unsupported/UnsupportedProcess.c' || echo '$(srcdir)/'`unsupported/UnsupportedProcess.c
+
+unsupported/htop-UnsupportedProcess.obj: unsupported/UnsupportedProcess.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-UnsupportedProcess.obj -MD -MP -MF unsupported/$(DEPDIR)/htop-UnsupportedProcess.Tpo -c -o unsupported/htop-UnsupportedProcess.obj `if test -f 'unsupported/UnsupportedProcess.c'; then $(CYGPATH_W) 'unsupported/UnsupportedProcess.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/UnsupportedProcess.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-UnsupportedProcess.Tpo unsupported/$(DEPDIR)/htop-UnsupportedProcess.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/UnsupportedProcess.c' object='unsupported/htop-UnsupportedProcess.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-UnsupportedProcess.obj `if test -f 'unsupported/UnsupportedProcess.c'; then $(CYGPATH_W) 'unsupported/UnsupportedProcess.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/UnsupportedProcess.c'; fi`
+
+unsupported/htop-UnsupportedProcessList.o: unsupported/UnsupportedProcessList.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-UnsupportedProcessList.o -MD -MP -MF unsupported/$(DEPDIR)/htop-UnsupportedProcessList.Tpo -c -o unsupported/htop-UnsupportedProcessList.o `test -f 'unsupported/UnsupportedProcessList.c' || echo '$(srcdir)/'`unsupported/UnsupportedProcessList.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-UnsupportedProcessList.Tpo unsupported/$(DEPDIR)/htop-UnsupportedProcessList.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/UnsupportedProcessList.c' object='unsupported/htop-UnsupportedProcessList.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-UnsupportedProcessList.o `test -f 'unsupported/UnsupportedProcessList.c' || echo '$(srcdir)/'`unsupported/UnsupportedProcessList.c
+
+unsupported/htop-UnsupportedProcessList.obj: unsupported/UnsupportedProcessList.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-UnsupportedProcessList.obj -MD -MP -MF unsupported/$(DEPDIR)/htop-UnsupportedProcessList.Tpo -c -o unsupported/htop-UnsupportedProcessList.obj `if test -f 'unsupported/UnsupportedProcessList.c'; then $(CYGPATH_W) 'unsupported/UnsupportedProcessList.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/UnsupportedProcessList.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-UnsupportedProcessList.Tpo unsupported/$(DEPDIR)/htop-UnsupportedProcessList.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/UnsupportedProcessList.c' object='unsupported/htop-UnsupportedProcessList.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-UnsupportedProcessList.obj `if test -f 'unsupported/UnsupportedProcessList.c'; then $(CYGPATH_W) 'unsupported/UnsupportedProcessList.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/UnsupportedProcessList.c'; fi`
+
+unsupported/htop-UnsupportedCRT.o: unsupported/UnsupportedCRT.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-UnsupportedCRT.o -MD -MP -MF unsupported/$(DEPDIR)/htop-UnsupportedCRT.Tpo -c -o unsupported/htop-UnsupportedCRT.o `test -f 'unsupported/UnsupportedCRT.c' || echo '$(srcdir)/'`unsupported/UnsupportedCRT.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-UnsupportedCRT.Tpo unsupported/$(DEPDIR)/htop-UnsupportedCRT.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/UnsupportedCRT.c' object='unsupported/htop-UnsupportedCRT.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-UnsupportedCRT.o `test -f 'unsupported/UnsupportedCRT.c' || echo '$(srcdir)/'`unsupported/UnsupportedCRT.c
+
+unsupported/htop-UnsupportedCRT.obj: unsupported/UnsupportedCRT.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-UnsupportedCRT.obj -MD -MP -MF unsupported/$(DEPDIR)/htop-UnsupportedCRT.Tpo -c -o unsupported/htop-UnsupportedCRT.obj `if test -f 'unsupported/UnsupportedCRT.c'; then $(CYGPATH_W) 'unsupported/UnsupportedCRT.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/UnsupportedCRT.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-UnsupportedCRT.Tpo unsupported/$(DEPDIR)/htop-UnsupportedCRT.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/UnsupportedCRT.c' object='unsupported/htop-UnsupportedCRT.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-UnsupportedCRT.obj `if test -f 'unsupported/UnsupportedCRT.c'; then $(CYGPATH_W) 'unsupported/UnsupportedCRT.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/UnsupportedCRT.c'; fi`
+
+unsupported/htop-Battery.o: unsupported/Battery.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-Battery.o -MD -MP -MF unsupported/$(DEPDIR)/htop-Battery.Tpo -c -o unsupported/htop-Battery.o `test -f 'unsupported/Battery.c' || echo '$(srcdir)/'`unsupported/Battery.c
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-Battery.Tpo unsupported/$(DEPDIR)/htop-Battery.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/Battery.c' object='unsupported/htop-Battery.o' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-Battery.o `test -f 'unsupported/Battery.c' || echo '$(srcdir)/'`unsupported/Battery.c
+
+unsupported/htop-Battery.obj: unsupported/Battery.c
+@am__fastdepCC_TRUE@ $(AM_V_CC)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -MT unsupported/htop-Battery.obj -MD -MP -MF unsupported/$(DEPDIR)/htop-Battery.Tpo -c -o unsupported/htop-Battery.obj `if test -f 'unsupported/Battery.c'; then $(CYGPATH_W) 'unsupported/Battery.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/Battery.c'; fi`
+@am__fastdepCC_TRUE@ $(AM_V_at)$(am__mv) unsupported/$(DEPDIR)/htop-Battery.Tpo unsupported/$(DEPDIR)/htop-Battery.Po
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ $(AM_V_CC)source='unsupported/Battery.c' object='unsupported/htop-Battery.obj' libtool=no @AMDEPBACKSLASH@
+@AMDEP_TRUE@@am__fastdepCC_FALSE@ DEPDIR=$(DEPDIR) $(CCDEPMODE) $(depcomp) @AMDEPBACKSLASH@
+@am__fastdepCC_FALSE@ $(AM_V_CC@am__nodep@)$(CC) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(htop_CFLAGS) $(CFLAGS) -c -o unsupported/htop-Battery.obj `if test -f 'unsupported/Battery.c'; then $(CYGPATH_W) 'unsupported/Battery.c'; else $(CYGPATH_W) '$(srcdir)/unsupported/Battery.c'; fi`
mostlyclean-libtool:
-rm -f *.lo
@@ -1061,11 +1841,18 @@ distclean-libtool:
-rm -f libtool config.lt
install-man1: $(dist_man_MANS)
@$(NORMAL_INSTALL)
- test -z "$(man1dir)" || $(MKDIR_P) "$(DESTDIR)$(man1dir)"
- @list=''; test -n "$(man1dir)" || exit 0; \
- { for i in $$list; do echo "$$i"; done; \
- l2='$(dist_man_MANS)'; for i in $$l2; do echo "$$i"; done | \
- sed -n '/\.1[a-z]*$$/p'; \
+ @list1=''; \
+ list2='$(dist_man_MANS)'; \
+ test -n "$(man1dir)" \
+ && test -n "`echo $$list1$$list2`" \
+ || exit 0; \
+ echo " $(MKDIR_P) '$(DESTDIR)$(man1dir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(man1dir)" || exit 1; \
+ { for i in $$list1; do echo "$$i"; done; \
+ if test -n "$$list2"; then \
+ for i in $$list2; do echo "$$i"; done \
+ | sed -n '/\.1[a-z]*$$/p'; \
+ fi; \
} | while read p; do \
if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; echo "$$p"; \
@@ -1094,13 +1881,14 @@ uninstall-man1:
sed -n '/\.1[a-z]*$$/p'; \
} | sed -e 's,.*/,,;h;s,.*\.,,;s,^[^1][0-9a-z]*$$,1,;x' \
-e 's,\.[0-9a-z]*$$,,;$(transform);G;s,\n,.,'`; \
- test -z "$$files" || { \
- echo " ( cd '$(DESTDIR)$(man1dir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(man1dir)" && rm -f $$files; }
+ dir='$(DESTDIR)$(man1dir)'; $(am__uninstall_files_from_dir)
install-applicationsDATA: $(applications_DATA)
@$(NORMAL_INSTALL)
- test -z "$(applicationsdir)" || $(MKDIR_P) "$(DESTDIR)$(applicationsdir)"
@list='$(applications_DATA)'; test -n "$(applicationsdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(applicationsdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(applicationsdir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
@@ -1114,13 +1902,14 @@ uninstall-applicationsDATA:
@$(NORMAL_UNINSTALL)
@list='$(applications_DATA)'; test -n "$(applicationsdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- test -n "$$files" || exit 0; \
- echo " ( cd '$(DESTDIR)$(applicationsdir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(applicationsdir)" && rm -f $$files
+ dir='$(DESTDIR)$(applicationsdir)'; $(am__uninstall_files_from_dir)
install-pixmapDATA: $(pixmap_DATA)
@$(NORMAL_INSTALL)
- test -z "$(pixmapdir)" || $(MKDIR_P) "$(DESTDIR)$(pixmapdir)"
@list='$(pixmap_DATA)'; test -n "$(pixmapdir)" || list=; \
+ if test -n "$$list"; then \
+ echo " $(MKDIR_P) '$(DESTDIR)$(pixmapdir)'"; \
+ $(MKDIR_P) "$(DESTDIR)$(pixmapdir)" || exit 1; \
+ fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
@@ -1134,30 +1923,17 @@ uninstall-pixmapDATA:
@$(NORMAL_UNINSTALL)
@list='$(pixmap_DATA)'; test -n "$(pixmapdir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
- test -n "$$files" || exit 0; \
- echo " ( cd '$(DESTDIR)$(pixmapdir)' && rm -f" $$files ")"; \
- cd "$(DESTDIR)$(pixmapdir)" && rm -f $$files
-
-ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
- list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
- mkid -fID $$unique
-tags: TAGS
-
-TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
+ dir='$(DESTDIR)$(pixmapdir)'; $(am__uninstall_files_from_dir)
+
+ID: $(am__tagged_files)
+ $(am__define_uniq_tagged_files); mkid -fID $$unique
+tags: tags-am
+TAGS: tags
+
+tags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
set x; \
here=`pwd`; \
- list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ $(am__define_uniq_tagged_files); \
shift; \
if test -z "$(ETAGS_ARGS)$$*$$unique"; then :; else \
test -n "$$unique" || unique=$$empty_fix; \
@@ -1169,15 +1945,11 @@ TAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
$$unique; \
fi; \
fi
-ctags: CTAGS
-CTAGS: $(HEADERS) $(SOURCES) config.h.in $(TAGS_DEPENDENCIES) \
- $(TAGS_FILES) $(LISP)
- list='$(SOURCES) $(HEADERS) config.h.in $(LISP) $(TAGS_FILES)'; \
- unique=`for i in $$list; do \
- if test -f "$$i"; then echo $$i; else echo $(srcdir)/$$i; fi; \
- done | \
- $(AWK) '{ files[$$0] = 1; nonempty = 1; } \
- END { if (nonempty) { for (i in files) print i; }; }'`; \
+ctags: ctags-am
+
+CTAGS: ctags
+ctags-am: $(TAGS_DEPENDENCIES) $(am__tagged_files)
+ $(am__define_uniq_tagged_files); \
test -z "$(CTAGS_ARGS)$$unique" \
|| $(CTAGS) $(CTAGSFLAGS) $(AM_CTAGSFLAGS) $(CTAGS_ARGS) \
$$unique
@@ -1186,24 +1958,33 @@ GTAGS:
here=`$(am__cd) $(top_builddir) && pwd` \
&& $(am__cd) $(top_srcdir) \
&& gtags -i $(GTAGS_ARGS) "$$here"
+cscope: cscope.files
+ test ! -s cscope.files \
+ || $(CSCOPE) -b -q $(AM_CSCOPEFLAGS) $(CSCOPEFLAGS) -i cscope.files $(CSCOPE_ARGS)
+clean-cscope:
+ -rm -f cscope.files
+cscope.files: clean-cscope cscopelist
+cscopelist: cscopelist-am
+
+cscopelist-am: $(am__tagged_files)
+ list='$(am__tagged_files)'; \
+ case "$(srcdir)" in \
+ [\\/]* | ?:[\\/]*) sdir="$(srcdir)" ;; \
+ *) sdir=$(subdir)/$(srcdir) ;; \
+ esac; \
+ for i in $$list; do \
+ if test -f "$$i"; then \
+ echo "$(subdir)/$$i"; \
+ else \
+ echo "$$sdir/$$i"; \
+ fi; \
+ done >> $(top_builddir)/cscope.files
distclean-tags:
-rm -f TAGS ID GTAGS GRTAGS GSYMS GPATH tags
+ -rm -f cscope.out cscope.in.out cscope.po.out cscope.files
distdir: $(DISTFILES)
- @list='$(MANS)'; if test -n "$$list"; then \
- list=`for p in $$list; do \
- if test -f $$p; then d=; else d="$(srcdir)/"; fi; \
- if test -f "$$d$$p"; then echo "$$d$$p"; else :; fi; done`; \
- if test -n "$$list" && \
- grep 'ab help2man is required to generate this page' $$list >/dev/null; then \
- echo "error: found man pages containing the \`missing help2man' replacement text:" >&2; \
- grep -l 'ab help2man is required to generate this page' $$list | sed 's/^/ /' >&2; \
- echo " to fix them, install help2man, remove and regenerate the man pages;" >&2; \
- echo " typically \`make maintainer-clean' will remove them" >&2; \
- exit 1; \
- else :; fi; \
- else :; fi
$(am__remove_distdir)
test -d "$(distdir)" || mkdir "$(distdir)"
@srcdirstrip=`echo "$(srcdir)" | sed 's/[].[^$$\\*]/\\\\&/g'`; \
@@ -1244,36 +2025,42 @@ distdir: $(DISTFILES)
|| chmod -R a+r "$(distdir)"
dist-gzip: distdir
tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
+ $(am__post_remove_distdir)
dist-bzip2: distdir
- tardir=$(distdir) && $(am__tar) | bzip2 -9 -c >$(distdir).tar.bz2
- $(am__remove_distdir)
+ tardir=$(distdir) && $(am__tar) | BZIP2=$${BZIP2--9} bzip2 -c >$(distdir).tar.bz2
+ $(am__post_remove_distdir)
-dist-lzma: distdir
- tardir=$(distdir) && $(am__tar) | lzma -9 -c >$(distdir).tar.lzma
- $(am__remove_distdir)
+dist-lzip: distdir
+ tardir=$(distdir) && $(am__tar) | lzip -c $${LZIP_OPT--9} >$(distdir).tar.lz
+ $(am__post_remove_distdir)
dist-xz: distdir
- tardir=$(distdir) && $(am__tar) | xz -c >$(distdir).tar.xz
- $(am__remove_distdir)
+ tardir=$(distdir) && $(am__tar) | XZ_OPT=$${XZ_OPT--e} xz -c >$(distdir).tar.xz
+ $(am__post_remove_distdir)
dist-tarZ: distdir
+ @echo WARNING: "Support for shar distribution archives is" \
+ "deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
tardir=$(distdir) && $(am__tar) | compress -c >$(distdir).tar.Z
- $(am__remove_distdir)
+ $(am__post_remove_distdir)
dist-shar: distdir
+ @echo WARNING: "Support for distribution archives compressed with" \
+ "legacy program 'compress' is deprecated." >&2
+ @echo WARNING: "It will be removed altogether in Automake 2.0" >&2
shar $(distdir) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).shar.gz
- $(am__remove_distdir)
+ $(am__post_remove_distdir)
dist-zip: distdir
-rm -f $(distdir).zip
zip -rq $(distdir).zip $(distdir)
- $(am__remove_distdir)
+ $(am__post_remove_distdir)
-dist dist-all: distdir
- tardir=$(distdir) && $(am__tar) | GZIP=$(GZIP_ENV) gzip -c >$(distdir).tar.gz
- $(am__remove_distdir)
+dist dist-all:
+ $(MAKE) $(AM_MAKEFLAGS) $(DIST_TARGETS) am__post_remove_distdir='@:'
+ $(am__post_remove_distdir)
# This target untars the dist file and tries a VPATH configuration. Then
# it guarantees that the distribution is self-contained by making another
@@ -1284,8 +2071,8 @@ distcheck: dist
GZIP=$(GZIP_ENV) gzip -dc $(distdir).tar.gz | $(am__untar) ;;\
*.tar.bz2*) \
bzip2 -dc $(distdir).tar.bz2 | $(am__untar) ;;\
- *.tar.lzma*) \
- lzma -dc $(distdir).tar.lzma | $(am__untar) ;;\
+ *.tar.lz*) \
+ lzip -dc $(distdir).tar.lz | $(am__untar) ;;\
*.tar.xz*) \
xz -dc $(distdir).tar.xz | $(am__untar) ;;\
*.tar.Z*) \
@@ -1295,9 +2082,9 @@ distcheck: dist
*.zip*) \
unzip $(distdir).zip ;;\
esac
- chmod -R a-w $(distdir); chmod a+w $(distdir)
- mkdir $(distdir)/_build
- mkdir $(distdir)/_inst
+ chmod -R a-w $(distdir)
+ chmod u+w $(distdir)
+ mkdir $(distdir)/_build $(distdir)/_inst
chmod a-w $(distdir)
test -d $(distdir)/_build || exit 0; \
dc_install_base=`$(am__cd) $(distdir)/_inst && pwd | sed -e 's,^[^:\\/]:[\\/],/,'` \
@@ -1305,6 +2092,7 @@ distcheck: dist
&& am__cwd=`pwd` \
&& $(am__cd) $(distdir)/_build \
&& ../configure --srcdir=.. --prefix="$$dc_install_base" \
+ $(AM_DISTCHECK_CONFIGURE_FLAGS) \
$(DISTCHECK_CONFIGURE_FLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) \
&& $(MAKE) $(AM_MAKEFLAGS) dvi \
@@ -1328,13 +2116,21 @@ distcheck: dist
&& $(MAKE) $(AM_MAKEFLAGS) distcleancheck \
&& cd "$$am__cwd" \
|| exit 1
- $(am__remove_distdir)
+ $(am__post_remove_distdir)
@(echo "$(distdir) archives ready for distribution: "; \
list='$(DIST_ARCHIVES)'; for i in $$list; do echo $$i; done) | \
sed -e 1h -e 1s/./=/g -e 1p -e 1x -e '$$p' -e '$$x'
distuninstallcheck:
- @$(am__cd) '$(distuninstallcheck_dir)' \
- && test `$(distuninstallcheck_listfiles) | wc -l` -le 1 \
+ @test -n '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: trying to run $@ with an empty' \
+ '$$(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ $(am__cd) '$(distuninstallcheck_dir)' || { \
+ echo 'ERROR: cannot chdir into $(distuninstallcheck_dir)' >&2; \
+ exit 1; \
+ }; \
+ test `$(am__distuninstallcheck_listfiles) | wc -l` -eq 0 \
|| { echo "ERROR: files left after uninstall:" ; \
if test -n "$(DESTDIR)"; then \
echo " (check DESTDIR support)"; \
@@ -1369,10 +2165,15 @@ install-am: all-am
installcheck: installcheck-am
install-strip:
- $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
- install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
- `test -z '$(STRIP)' || \
- echo "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'"` install
+ if test -z '$(STRIP)'; then \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ install; \
+ else \
+ $(MAKE) $(AM_MAKEFLAGS) INSTALL_PROGRAM="$(INSTALL_STRIP_PROGRAM)" \
+ install_sh_PROGRAM="$(INSTALL_STRIP_PROGRAM)" INSTALL_STRIP_FLAG=-s \
+ "INSTALL_PROGRAM_ENV=STRIPPROG='$(STRIP)'" install; \
+ fi
mostlyclean-generic:
clean-generic:
@@ -1380,6 +2181,16 @@ clean-generic:
distclean-generic:
-test -z "$(CONFIG_CLEAN_FILES)" || rm -f $(CONFIG_CLEAN_FILES)
-test . = "$(srcdir)" || test -z "$(CONFIG_CLEAN_VPATH_FILES)" || rm -f $(CONFIG_CLEAN_VPATH_FILES)
+ -rm -f darwin/$(DEPDIR)/$(am__dirstamp)
+ -rm -f darwin/$(am__dirstamp)
+ -rm -f freebsd/$(DEPDIR)/$(am__dirstamp)
+ -rm -f freebsd/$(am__dirstamp)
+ -rm -f linux/$(DEPDIR)/$(am__dirstamp)
+ -rm -f linux/$(am__dirstamp)
+ -rm -f openbsd/$(DEPDIR)/$(am__dirstamp)
+ -rm -f openbsd/$(am__dirstamp)
+ -rm -f unsupported/$(DEPDIR)/$(am__dirstamp)
+ -rm -f unsupported/$(am__dirstamp)
maintainer-clean-generic:
@echo "This command is intended for maintainers to use"
@@ -1391,7 +2202,7 @@ clean-am: clean-binPROGRAMS clean-generic clean-libtool mostlyclean-am
distclean: distclean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
- -rm -rf ./$(DEPDIR)
+ -rm -rf ./$(DEPDIR) darwin/$(DEPDIR) freebsd/$(DEPDIR) linux/$(DEPDIR) openbsd/$(DEPDIR) unsupported/$(DEPDIR)
-rm -f Makefile
distclean-am: clean-am distclean-compile distclean-generic \
distclean-hdr distclean-libtool distclean-tags
@@ -1440,7 +2251,7 @@ installcheck-am:
maintainer-clean: maintainer-clean-am
-rm -f $(am__CONFIG_DISTCLEAN_FILES)
-rm -rf $(top_srcdir)/autom4te.cache
- -rm -rf ./$(DEPDIR)
+ -rm -rf ./$(DEPDIR) darwin/$(DEPDIR) freebsd/$(DEPDIR) linux/$(DEPDIR) openbsd/$(DEPDIR) unsupported/$(DEPDIR)
-rm -f Makefile
maintainer-clean-am: distclean-am maintainer-clean-generic
@@ -1464,25 +2275,29 @@ uninstall-man: uninstall-man1
.MAKE: all check install install-am install-strip
-.PHONY: CTAGS GTAGS all all-am am--refresh check check-am clean \
- clean-binPROGRAMS clean-generic clean-libtool ctags dist \
- dist-all dist-bzip2 dist-gzip dist-lzma dist-shar dist-tarZ \
- dist-xz dist-zip distcheck distclean distclean-compile \
- distclean-generic distclean-hdr distclean-libtool \
- distclean-tags distcleancheck distdir distuninstallcheck dvi \
- dvi-am html html-am info info-am install install-am \
- install-applicationsDATA install-binPROGRAMS install-data \
- install-data-am install-dvi install-dvi-am install-exec \
- install-exec-am install-html install-html-am install-info \
- install-info-am install-man install-man1 install-pdf \
- install-pdf-am install-pixmapDATA install-ps install-ps-am \
- install-strip installcheck installcheck-am installdirs \
- maintainer-clean maintainer-clean-generic mostlyclean \
- mostlyclean-compile mostlyclean-generic mostlyclean-libtool \
- pdf pdf-am ps ps-am tags uninstall uninstall-am \
- uninstall-applicationsDATA uninstall-binPROGRAMS uninstall-man \
- uninstall-man1 uninstall-pixmapDATA
-
+.PHONY: CTAGS GTAGS TAGS all all-am am--refresh check check-am clean \
+ clean-binPROGRAMS clean-cscope clean-generic clean-libtool \
+ cscope cscopelist-am ctags ctags-am dist dist-all dist-bzip2 \
+ dist-gzip dist-lzip dist-shar dist-tarZ dist-xz dist-zip \
+ distcheck distclean distclean-compile distclean-generic \
+ distclean-hdr distclean-libtool distclean-tags distcleancheck \
+ distdir distuninstallcheck dvi dvi-am html html-am info \
+ info-am install install-am install-applicationsDATA \
+ install-binPROGRAMS install-data install-data-am install-dvi \
+ install-dvi-am install-exec install-exec-am install-html \
+ install-html-am install-info install-info-am install-man \
+ install-man1 install-pdf install-pdf-am install-pixmapDATA \
+ install-ps install-ps-am install-strip installcheck \
+ installcheck-am installdirs maintainer-clean \
+ maintainer-clean-generic mostlyclean mostlyclean-compile \
+ mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
+ tags tags-am uninstall uninstall-am uninstall-applicationsDATA \
+ uninstall-binPROGRAMS uninstall-man uninstall-man1 \
+ uninstall-pixmapDATA
+
+
+target:
+ echo $(htop_SOURCES)
profile:
$(MAKE) all CFLAGS="-pg" AM_CPPFLAGS="-pg -O2 -DNDEBUG"
@@ -1490,12 +2305,22 @@ profile:
debug:
$(MAKE) all CFLAGS="" AM_CPPFLAGS="-ggdb -DDEBUG"
+coverage:
+ $(MAKE) all CFLAGS="" AM_CPPFLAGS="-fprofile-arcs -ftest-coverage -DDEBUG" AM_LDFLAGS="-lgcov"
+
.c.h:
@srcdir@/scripts/MakeHeader.py $<
cppcheck:
cppcheck -q -v . --enable=all -DHAVE_CGROUP -DHAVE_OPENVZ -DHAVE_TASKSTATS
+.PHONY: lcov
+
+lcov:
+ mkdir -p lcov
+ lcov --capture --directory . --output-file coverage.info
+ genhtml coverage.info --output-directory lcov
+
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.
.NOEXPORT:
diff --git a/MemoryMeter.c b/MemoryMeter.c
index 0151625..dae56b5 100644
--- a/MemoryMeter.c
+++ b/MemoryMeter.c
@@ -8,7 +8,7 @@ in the source distribution for its full text.
#include "MemoryMeter.h"
#include "CRT.h"
-#include "ProcessList.h"
+#include "Platform.h"
#include <stdlib.h>
#include <string.h>
@@ -25,36 +25,32 @@ int MemoryMeter_attributes[] = {
};
static void MemoryMeter_setValues(Meter* this, char* buffer, int size) {
- long int usedMem = this->pl->usedMem;
- long int buffersMem = this->pl->buffersMem;
- long int cachedMem = this->pl->cachedMem;
- usedMem -= buffersMem + cachedMem;
- this->total = this->pl->totalMem;
- this->values[0] = usedMem;
- this->values[1] = buffersMem;
- this->values[2] = cachedMem;
- snprintf(buffer, size, "%ld/%ldMB", (long int) usedMem / 1024, (long int) this->total / 1024);
+ int written;
+ Platform_setMemoryValues(this);
+
+ written = Meter_humanUnit(buffer, this->values[0], size);
+ buffer += written;
+ if ((size -= written) > 0) {
+ *buffer++ = '/';
+ size--;
+ Meter_humanUnit(buffer, this->total, size);
+ }
}
static void MemoryMeter_display(Object* cast, RichString* out) {
char buffer[50];
Meter* this = (Meter*)cast;
- int k = 1024; const char* format = "%ldM ";
- long int totalMem = this->total / k;
- long int usedMem = this->values[0] / k;
- long int buffersMem = this->values[1] / k;
- long int cachedMem = this->values[2] / k;
RichString_write(out, CRT_colors[METER_TEXT], ":");
- sprintf(buffer, format, totalMem);
+ Meter_humanUnit(buffer, this->total, 50);
RichString_append(out, CRT_colors[METER_VALUE], buffer);
- sprintf(buffer, format, usedMem);
- RichString_append(out, CRT_colors[METER_TEXT], "used:");
+ Meter_humanUnit(buffer, this->values[0], 50);
+ RichString_append(out, CRT_colors[METER_TEXT], " used:");
RichString_append(out, CRT_colors[MEMORY_USED], buffer);
- sprintf(buffer, format, buffersMem);
- RichString_append(out, CRT_colors[METER_TEXT], "buffers:");
+ Meter_humanUnit(buffer, this->values[1], 50);
+ RichString_append(out, CRT_colors[METER_TEXT], " buffers:");
RichString_append(out, CRT_colors[MEMORY_BUFFERS_TEXT], buffer);
- sprintf(buffer, format, cachedMem);
- RichString_append(out, CRT_colors[METER_TEXT], "cache:");
+ Meter_humanUnit(buffer, this->values[2], 50);
+ RichString_append(out, CRT_colors[METER_TEXT], " cache:");
RichString_append(out, CRT_colors[MEMORY_CACHE], buffer);
}
@@ -69,7 +65,7 @@ MeterClass MemoryMeter_class = {
.maxItems = 3,
.total = 100.0,
.attributes = MemoryMeter_attributes,
- "Memory",
- "Memory",
- "Mem"
+ .name = "Memory",
+ .uiName = "Memory",
+ .caption = "Mem"
};
diff --git a/Meter.c b/Meter.c
index 3abd708..9a7868e 100644
--- a/Meter.c
+++ b/Meter.c
@@ -7,19 +7,10 @@ in the source distribution for its full text.
#include "Meter.h"
-#include "CPUMeter.h"
-#include "MemoryMeter.h"
-#include "SwapMeter.h"
-#include "TasksMeter.h"
-#include "LoadAverageMeter.h"
-#include "UptimeMeter.h"
-#include "BatteryMeter.h"
-#include "ClockMeter.h"
-#include "HostnameMeter.h"
#include "RichString.h"
#include "Object.h"
#include "CRT.h"
-#include "String.h"
+#include "StringUtils.h"
#include "ListItem.h"
#include "Settings.h"
@@ -30,11 +21,16 @@ in the source distribution for its full text.
#include <assert.h>
#include <sys/time.h>
-#define METER_BUFFER_LEN 128
+#define METER_BUFFER_LEN 256
+
+#define GRAPH_DELAY (DEFAULT_DELAY/2)
+
+#define GRAPH_HEIGHT 4 /* Unit: rows (lines) */
/*{
#include "ListItem.h"
-#include "ProcessList.h"
+
+#include <sys/time.h>
typedef struct Meter_ Meter;
@@ -57,6 +53,7 @@ typedef struct MeterClass_ {
const char* name;
const char* uiName;
const char* caption;
+ const char* description;
const char maxItems;
char curItems;
} MeterClass;
@@ -86,7 +83,7 @@ struct Meter_ {
int param;
void* drawData;
int h;
- ProcessList* pl;
+ struct ProcessList_* pl;
double* values;
double total;
};
@@ -119,6 +116,9 @@ typedef struct GraphData_ {
#ifndef MAX
#define MAX(a,b) ((a)>(b)?(a):(b))
#endif
+#ifndef CLAMP
+#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
+#endif
MeterClass Meter_class = {
.super = {
@@ -126,29 +126,8 @@ MeterClass Meter_class = {
}
};
-MeterClass* Meter_types[] = {
- &CPUMeter_class,
- &ClockMeter_class,
- &LoadAverageMeter_class,
- &LoadMeter_class,
- &MemoryMeter_class,
- &SwapMeter_class,
- &TasksMeter_class,
- &UptimeMeter_class,
- &BatteryMeter_class,
- &HostnameMeter_class,
- &AllCPUsMeter_class,
- &AllCPUs2Meter_class,
- &LeftCPUsMeter_class,
- &RightCPUsMeter_class,
- &LeftCPUs2Meter_class,
- &RightCPUs2Meter_class,
- &BlankMeter_class,
- NULL
-};
-
-Meter* Meter_new(ProcessList* pl, int param, MeterClass* type) {
- Meter* this = calloc(1, sizeof(Meter));
+Meter* Meter_new(struct ProcessList_* pl, int param, MeterClass* type) {
+ Meter* this = xCalloc(1, sizeof(Meter));
Object_setClass(this, type);
this->h = 1;
this->param = param;
@@ -158,15 +137,46 @@ Meter* Meter_new(ProcessList* pl, int param, MeterClass* type) {
maxItems = 1;
}
type->curItems = maxItems;
- this->values = calloc(maxItems, sizeof(double));
+ this->values = xCalloc(maxItems, sizeof(double));
this->total = type->total;
- this->caption = strdup(type->caption);
+ this->caption = xStrdup(type->caption);
if (Meter_initFn(this))
Meter_init(this);
Meter_setMode(this, type->defaultMode);
return this;
}
+int Meter_humanUnit(char* buffer, unsigned long int value, int size) {
+ const char * prefix = "KMGTPEZY";
+ unsigned long int powi = 1;
+ unsigned int written, powj = 1, precision = 2;
+
+ for(;;) {
+ if (value / 1024 < powi)
+ break;
+
+ if (prefix[1] == 0)
+ break;
+
+ powi *= 1024;
+ ++prefix;
+ }
+
+ if (*prefix == 'K')
+ precision = 0;
+
+ for (; precision > 0; precision--) {
+ powj *= 10;
+ if (value / powi < powj)
+ break;
+ }
+
+ written = snprintf(buffer, size, "%.*f%c",
+ precision, (double) value / powi, *prefix);
+
+ return written;
+}
+
void Meter_delete(Object* cast) {
if (!cast)
return;
@@ -183,7 +193,7 @@ void Meter_delete(Object* cast) {
void Meter_setCaption(Meter* this, const char* caption) {
free(this->caption);
- this->caption = strdup(caption);
+ this->caption = xStrdup(caption);
}
static inline void Meter_displayBuffer(Meter* this, char* buffer, RichString* out) {
@@ -217,7 +227,7 @@ void Meter_setMode(Meter* this, int modeIndex) {
this->mode = modeIndex;
}
-ListItem* Meter_toListItem(Meter* this) {
+ListItem* Meter_toListItem(Meter* this, bool moving) {
char mode[21];
if (this->mode)
snprintf(mode, 20, " [%s]", Meter_modes[this->mode]->uiName);
@@ -230,7 +240,9 @@ ListItem* Meter_toListItem(Meter* this) {
number[0] = '\0';
char buffer[51];
snprintf(buffer, 50, "%s%s%s", Meter_uiName(this), number, mode);
- return ListItem_new(buffer, 0);
+ ListItem* li = ListItem_new(buffer, 0);
+ li->moving = moving;
+ return li;
}
/* ---------- TextMeterMode ---------- */
@@ -244,7 +256,6 @@ static void TextMeterMode_draw(Meter* this, int x, int y, int w) {
mvaddstr(y, x, this->caption);
int captionLen = strlen(this->caption);
x += captionLen;
- mvhline(y, x, ' ', CRT_colors[DEFAULT_COLOR]);
attrset(CRT_colors[RESET_COLOR]);
RichString_begin(out);
Meter_displayBuffer(this, buffer, &out);
@@ -254,7 +265,7 @@ static void TextMeterMode_draw(Meter* this, int x, int y, int w) {
/* ---------- BarMeterMode ---------- */
-static char BarMeterMode_characters[] = "|#*@$%&";
+static char BarMeterMode_characters[] = "|#*@$%&.";
static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
char buffer[METER_BUFFER_LEN];
@@ -291,8 +302,7 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
int items = Meter_getItems(this);
for (int i = 0; i < items; i++) {
double value = this->values[i];
- value = MAX(value, 0);
- value = MIN(value, this->total);
+ value = CLAMP(value, 0.0, this->total);
if (value > 0) {
blockSizes[i] = ceil((value/this->total) * w);
} else {
@@ -300,7 +310,7 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
}
int nextOffset = offset + blockSizes[i];
// (Control against invalid values)
- nextOffset = MIN(MAX(nextOffset, 0), w);
+ nextOffset = CLAMP(nextOffset, 0, w);
for (int j = offset; j < nextOffset; j++)
if (bar[j] == ' ') {
if (CRT_colorScheme == COLORSCHEME_MONOCHROME) {
@@ -318,8 +328,7 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
attrset(CRT_colors[Meter_attributes(this)[i]]);
mvaddnstr(y, x + offset, bar + offset, blockSizes[i]);
offset += blockSizes[i];
- offset = MAX(offset, 0);
- offset = MIN(offset, w);
+ offset = CLAMP(offset, 0, w);
}
if (offset < w) {
attrset(CRT_colors[BAR_SHADOW]);
@@ -332,30 +341,56 @@ static void BarMeterMode_draw(Meter* this, int x, int y, int w) {
/* ---------- GraphMeterMode ---------- */
-#define DrawDot(a,y,c) do { attrset(a); mvaddch(y, x+k, c); } while(0)
+#ifdef HAVE_LIBNCURSESW
-static int GraphMeterMode_colors[21] = {
- GRAPH_1, GRAPH_1, GRAPH_1,
- GRAPH_2, GRAPH_2, GRAPH_2,
- GRAPH_3, GRAPH_3, GRAPH_3,
- GRAPH_4, GRAPH_4, GRAPH_4,
- GRAPH_5, GRAPH_5, GRAPH_6,
- GRAPH_7, GRAPH_7, GRAPH_7,
- GRAPH_8, GRAPH_8, GRAPH_9
+#define PIXPERROW_UTF8 4
+static const char* GraphMeterMode_dotsUtf8[] = {
+ /*00*/" ", /*01*/"⢀", /*02*/"⢠", /*03*/"⢰", /*04*/ "⢸",
+ /*10*/"⡀", /*11*/"⣀", /*12*/"⣠", /*13*/"⣰", /*14*/ "⣸",
+ /*20*/"⡄", /*21*/"⣄", /*22*/"⣤", /*23*/"⣴", /*24*/ "⣼",
+ /*30*/"⡆", /*31*/"⣆", /*32*/"⣦", /*33*/"⣶", /*34*/ "⣾",
+ /*40*/"⡇", /*41*/"⣇", /*42*/"⣧", /*43*/"⣷", /*44*/ "⣿"
};
-static const char* GraphMeterMode_characters = "^`'-.,_~'`-.,_~'`-.,_";
+#endif
+
+#define PIXPERROW_ASCII 2
+static const char* GraphMeterMode_dotsAscii[] = {
+ /*00*/" ", /*01*/".", /*02*/":",
+ /*10*/".", /*11*/".", /*12*/":",
+ /*20*/":", /*21*/":", /*22*/":"
+};
+
+static const char** GraphMeterMode_dots;
+static int GraphMeterMode_pixPerRow;
static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
- if (!this->drawData) this->drawData = calloc(1, sizeof(GraphData));
- GraphData* data = (GraphData*) this->drawData;
+ if (!this->drawData) this->drawData = xCalloc(1, sizeof(GraphData));
+ GraphData* data = (GraphData*) this->drawData;
const int nValues = METER_BUFFER_LEN;
+
+#ifdef HAVE_LIBNCURSESW
+ if (CRT_utf8) {
+ GraphMeterMode_dots = GraphMeterMode_dotsUtf8;
+ GraphMeterMode_pixPerRow = PIXPERROW_UTF8;
+ } else
+#endif
+ {
+ GraphMeterMode_dots = GraphMeterMode_dotsAscii;
+ GraphMeterMode_pixPerRow = PIXPERROW_ASCII;
+ }
+
+ attrset(CRT_colors[METER_TEXT]);
+ int captionLen = 3;
+ mvaddnstr(y, x, this->caption, captionLen);
+ x += captionLen;
+ w -= captionLen;
struct timeval now;
gettimeofday(&now, NULL);
if (!timercmp(&now, &(data->time), <)) {
- struct timeval delay = { .tv_sec = (int)(DEFAULT_DELAY/10), .tv_usec = (DEFAULT_DELAY-((int)(DEFAULT_DELAY/10)*10)) * 100000 };
+ struct timeval delay = { .tv_sec = (int)(CRT_delay/10), .tv_usec = (CRT_delay-((int)(CRT_delay/10)*10)) * 100000 };
timeradd(&now, &delay, &(data->time));
for (int i = 0; i < nValues - 1; i++)
@@ -372,55 +407,75 @@ static void GraphMeterMode_draw(Meter* this, int x, int y, int w) {
data->values[nValues - 1] = value;
}
- for (int i = nValues - w, k = 0; i < nValues; i++, k++) {
- double value = data->values[i];
- DrawDot( CRT_colors[DEFAULT_COLOR], y, ' ' );
- DrawDot( CRT_colors[DEFAULT_COLOR], y+1, ' ' );
- DrawDot( CRT_colors[DEFAULT_COLOR], y+2, ' ' );
-
- double threshold = 1.00;
- for (int j = 0; j < 21; j++, threshold -= 0.05)
- if (value >= threshold) {
- DrawDot(CRT_colors[GraphMeterMode_colors[j]], y+(j/7.0), GraphMeterMode_characters[j]);
- break;
- }
+ int i = nValues - (w*2) + 2, k = 0;
+ if (i < 0) {
+ k = -i/2;
+ i = 0;
+ }
+ for (; i < nValues; i+=2, k++) {
+ int pix = GraphMeterMode_pixPerRow * GRAPH_HEIGHT;
+ int v1 = CLAMP(data->values[i] * pix, 1, pix);
+ int v2 = CLAMP(data->values[i+1] * pix, 1, pix);
+
+ int colorIdx = GRAPH_1;
+ for (int line = 0; line < GRAPH_HEIGHT; line++) {
+ int line1 = CLAMP(v1 - (GraphMeterMode_pixPerRow * (GRAPH_HEIGHT - 1 - line)), 0, GraphMeterMode_pixPerRow);
+ int line2 = CLAMP(v2 - (GraphMeterMode_pixPerRow * (GRAPH_HEIGHT - 1 - line)), 0, GraphMeterMode_pixPerRow);
+
+ attrset(CRT_colors[colorIdx]);
+ mvaddstr(y+line, x+k, GraphMeterMode_dots[line1 * (GraphMeterMode_pixPerRow + 1) + line2]);
+ colorIdx = GRAPH_2;
+ }
}
attrset(CRT_colors[RESET_COLOR]);
}
/* ---------- LEDMeterMode ---------- */
-static const char* LEDMeterMode_digitsAscii[3][10] = {
- { " __ "," "," __ "," __ "," "," __ "," __ "," __ "," __ "," __ "},
- { "| |"," |"," __|"," __|","|__|","|__ ","|__ "," |","|__|","|__|"},
- { "|__|"," |","|__ "," __|"," |"," __|","|__|"," |","|__|"," __|"},
+static const char* LEDMeterMode_digitsAscii[] = {
+ " __ "," "," __ "," __ "," "," __ "," __ "," __ "," __ "," __ ",
+ "| |"," |"," __|"," __|","|__|","|__ ","|__ "," |","|__|","|__|",
+ "|__|"," |","|__ "," __|"," |"," __|","|__|"," |","|__|"," __|"
};
-static const char* LEDMeterMode_digitsUtf8[3][10] = {
- { "┌──┐"," ┐ ","╶──┐","╶──┐","╷ ╷","┌──╴","┌──╴","╶──┐","┌──┐","┌──┐"},
- { "│ │"," │ ","┌──┘"," ──┤","└──┤","└──┐","├──┐"," │","├──┤","└──┤"},
- { "└──┘"," ╵ ","└──╴","╶──┘"," ╵","╶──┘","└──┘"," ╵","└──┘"," ──┘"},
+#ifdef HAVE_LIBNCURSESW
+
+static const char* LEDMeterMode_digitsUtf8[] = {
+ "┌──┐"," ┐ ","╶──┐","╶──┐","╷ ╷","┌──╴","┌──╴","╶──┐","┌──┐","┌──┐",
+ "│ │"," │ ","┌──┘"," ──┤","└──┤","└──┐","├──┐"," │","├──┤","└──┤",
+ "└──┘"," ╵ ","└──╴","╶──┘"," ╵","╶──┘","└──┘"," ╵","└──┘"," ──┘"
};
+#endif
+
+static const char** LEDMeterMode_digits;
+
static void LEDMeterMode_drawDigit(int x, int y, int n) {
- if (CRT_utf8) {
- for (int i = 0; i < 3; i++)
- mvaddstr(y+i, x, LEDMeterMode_digitsUtf8[i][n]);
- } else {
- for (int i = 0; i < 3; i++)
- mvaddstr(y+i, x, LEDMeterMode_digitsAscii[i][n]);
- }
+ for (int i = 0; i < 3; i++)
+ mvaddstr(y+i, x, LEDMeterMode_digits[i * 10 + n]);
}
static void LEDMeterMode_draw(Meter* this, int x, int y, int w) {
(void) w;
+
+#ifdef HAVE_LIBNCURSESW
+ if (CRT_utf8)
+ LEDMeterMode_digits = LEDMeterMode_digitsUtf8;
+ else
+#endif
+ LEDMeterMode_digits = LEDMeterMode_digitsAscii;
+
char buffer[METER_BUFFER_LEN];
Meter_setValues(this, buffer, METER_BUFFER_LEN - 1);
RichString_begin(out);
Meter_displayBuffer(this, buffer, &out);
- int yText = CRT_utf8 ? y+1 : y+2;
+ int yText =
+#ifdef HAVE_LIBNCURSESW
+ CRT_utf8 ? y+1 :
+#endif
+ y+2;
attrset(CRT_colors[LED_COLOR]);
mvaddstr(yText, x, this->caption);
int xx = x + strlen(this->caption);
@@ -453,7 +508,7 @@ static MeterMode TextMeterMode = {
static MeterMode GraphMeterMode = {
.uiName = "Graph",
- .h = 3,
+ .h = GRAPH_HEIGHT,
.draw = GraphMeterMode_draw,
};
diff --git a/Meter.h b/Meter.h
index 2f58b8f..7b728ee 100644
--- a/Meter.h
+++ b/Meter.h
@@ -9,10 +9,15 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
-#define METER_BUFFER_LEN 128
+#define METER_BUFFER_LEN 256
+
+#define GRAPH_DELAY (DEFAULT_DELAY/2)
+
+#define GRAPH_HEIGHT 4 /* Unit: rows (lines) */
#include "ListItem.h"
-#include "ProcessList.h"
+
+#include <sys/time.h>
typedef struct Meter_ Meter;
@@ -35,6 +40,7 @@ typedef struct MeterClass_ {
const char* name;
const char* uiName;
const char* caption;
+ const char* description;
const char maxItems;
char curItems;
} MeterClass;
@@ -64,7 +70,7 @@ struct Meter_ {
int param;
void* drawData;
int h;
- ProcessList* pl;
+ struct ProcessList_* pl;
double* values;
double total;
};
@@ -96,12 +102,15 @@ typedef struct GraphData_ {
#ifndef MAX
#define MAX(a,b) ((a)>(b)?(a):(b))
#endif
+#ifndef CLAMP
+#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
+#endif
extern MeterClass Meter_class;
-extern MeterClass* Meter_types[];
+Meter* Meter_new(struct ProcessList_* pl, int param, MeterClass* type);
-Meter* Meter_new(ProcessList* pl, int param, MeterClass* type);
+int Meter_humanUnit(char* buffer, unsigned long int value, int size);
void Meter_delete(Object* cast);
@@ -109,7 +118,7 @@ void Meter_setCaption(Meter* this, const char* caption);
void Meter_setMode(Meter* this, int modeIndex);
-ListItem* Meter_toListItem(Meter* this);
+ListItem* Meter_toListItem(Meter* this, bool moving);
/* ---------- TextMeterMode ---------- */
@@ -117,10 +126,19 @@ ListItem* Meter_toListItem(Meter* this);
/* ---------- GraphMeterMode ---------- */
-#define DrawDot(a,y,c) do { attrset(a); mvaddch(y, x+k, c); } while(0)
+#ifdef HAVE_LIBNCURSESW
+
+#define PIXPERROW_UTF8 4
+#endif
+
+#define PIXPERROW_ASCII 2
/* ---------- LEDMeterMode ---------- */
+#ifdef HAVE_LIBNCURSESW
+
+#endif
+
extern MeterMode* Meter_modes[];
/* Blank meter */
diff --git a/MetersPanel.c b/MetersPanel.c
index 0e755f5..bdbe83e 100644
--- a/MetersPanel.c
+++ b/MetersPanel.c
@@ -9,22 +9,37 @@ in the source distribution for its full text.
#include <stdlib.h>
#include <assert.h>
+#include "CRT.h"
/*{
#include "Panel.h"
#include "Settings.h"
#include "ScreenManager.h"
-typedef struct MetersPanel_ {
+typedef struct MetersPanel_ MetersPanel;
+
+struct MetersPanel_ {
Panel super;
Settings* settings;
Vector* meters;
ScreenManager* scr;
-} MetersPanel;
+ MetersPanel* leftNeighbor;
+ MetersPanel* rightNeighbor;
+ bool moving;
+};
}*/
+static const char* MetersFunctions[] = {"Type ", "Move ", "Delete", "Done ", NULL};
+static const char* MetersKeys[] = {"Space", "Enter", "Del", "Esc"};
+static int MetersEvents[] = {' ', 13, KEY_DC, 27};
+
+static const char* MetersMovingFunctions[] = {"Up ", "Down ", "Left ", "Right ", "Confirm", "Delete", "Done ", NULL};
+static const char* MetersMovingKeys[] = {"Up", "Dn", "Lt", "Rt", "Enter", "Del", "Esc"};
+static int MetersMovingEvents[] = {KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT, 13, KEY_DC, 27};
+static FunctionBar* Meters_movingBar = NULL;
+
static void MetersPanel_delete(Object* object) {
Panel* super = (Panel*) object;
MetersPanel* this = (MetersPanel*) object;
@@ -32,27 +47,80 @@ static void MetersPanel_delete(Object* object) {
free(this);
}
+void MetersPanel_setMoving(MetersPanel* this, bool moving) {
+ Panel* super = (Panel*) this;
+ this->moving = moving;
+ ((ListItem*)Panel_getSelected(super))->moving = moving;
+ if (!moving) {
+ Panel_setSelectionColor(super, CRT_colors[PANEL_SELECTION_FOCUS]);
+ Panel_setDefaultBar(super);
+ } else {
+ Panel_setSelectionColor(super, CRT_colors[PANEL_SELECTION_FOLLOW]);
+ super->currentBar = Meters_movingBar;
+ }
+}
+
+static inline bool moveToNeighbor(MetersPanel* this, MetersPanel* neighbor, int selected) {
+ Panel* super = (Panel*) this;
+ if (this->moving) {
+ if (neighbor) {
+ if (selected < Vector_size(this->meters)) {
+ MetersPanel_setMoving(this, false);
+
+ Meter* meter = (Meter*) Vector_take(this->meters, selected);
+ Panel_remove(super, selected);
+ Vector_insert(neighbor->meters, selected, meter);
+ Panel_insert(&(neighbor->super), selected, (Object*) Meter_toListItem(meter, false));
+ Panel_setSelected(&(neighbor->super), selected);
+
+ MetersPanel_setMoving(neighbor, true);
+ return true;
+ }
+ }
+ }
+ return false;
+}
+
static HandlerResult MetersPanel_eventHandler(Panel* super, int ch) {
MetersPanel* this = (MetersPanel*) super;
int selected = Panel_getSelectedIndex(super);
HandlerResult result = IGNORED;
+ bool sideMove = false;
switch(ch) {
case 0x0a:
case 0x0d:
case KEY_ENTER:
+ {
+ if (!Vector_size(this->meters))
+ break;
+ MetersPanel_setMoving(this, !(this->moving));
+ FunctionBar_draw(this->super.currentBar, NULL);
+ result = HANDLED;
+ break;
+ }
+ case ' ':
case KEY_F(4):
case 't':
{
+ if (!Vector_size(this->meters))
+ break;
Meter* meter = (Meter*) Vector_get(this->meters, selected);
int mode = meter->mode + 1;
if (mode == LAST_METERMODE) mode = 1;
Meter_setMode(meter, mode);
- Panel_set(super, selected, (Object*) Meter_toListItem(meter));
+ Panel_set(super, selected, (Object*) Meter_toListItem(meter, this->moving));
result = HANDLED;
break;
}
+ case KEY_UP:
+ {
+ if (!this->moving) {
+ break;
+ }
+ /* else fallthrough */
+ }
case KEY_F(7):
case '[':
case '-':
@@ -62,6 +130,13 @@ static HandlerResult MetersPanel_eventHandler(Panel* super, int ch) {
result = HANDLED;
break;
}
+ case KEY_DOWN:
+ {
+ if (!this->moving) {
+ break;
+ }
+ /* else fallthrough */
+ }
case KEY_F(8):
case ']':
case '+':
@@ -71,19 +146,41 @@ static HandlerResult MetersPanel_eventHandler(Panel* super, int ch) {
result = HANDLED;
break;
}
+ case KEY_RIGHT:
+ {
+ sideMove = moveToNeighbor(this, this->rightNeighbor, selected);
+ if (this->moving && !sideMove) {
+ // lock user here until it exits positioning-mode
+ result = HANDLED;
+ }
+ // if user is free, don't set HANDLED;
+ // let ScreenManager handle focus.
+ break;
+ }
+ case KEY_LEFT:
+ {
+ sideMove = moveToNeighbor(this, this->leftNeighbor, selected);
+ if (this->moving && !sideMove) {
+ result = HANDLED;
+ }
+ break;
+ }
case KEY_F(9):
case KEY_DC:
{
+ if (!Vector_size(this->meters))
+ break;
if (selected < Vector_size(this->meters)) {
Vector_remove(this->meters, selected);
Panel_remove(super, selected);
}
+ MetersPanel_setMoving(this, false);
result = HANDLED;
break;
}
}
- if (result == HANDLED) {
- Header* header = this->settings->header;
+ if (result == HANDLED || sideMove) {
+ Header* header = (Header*) this->scr->header;
this->settings->changed = true;
Header_calculateHeight(header);
Header_draw(header);
@@ -103,15 +200,22 @@ PanelClass MetersPanel_class = {
MetersPanel* MetersPanel_new(Settings* settings, const char* header, Vector* meters, ScreenManager* scr) {
MetersPanel* this = AllocThis(MetersPanel);
Panel* super = (Panel*) this;
- Panel_init(super, 1, 1, 1, 1, Class(ListItem), true);
+ FunctionBar* fuBar = FunctionBar_new(MetersFunctions, MetersKeys, MetersEvents);
+ if (!Meters_movingBar) {
+ Meters_movingBar = FunctionBar_new(MetersMovingFunctions, MetersMovingKeys, MetersMovingEvents);
+ }
+ Panel_init(super, 1, 1, 1, 1, Class(ListItem), true, fuBar);
this->settings = settings;
this->meters = meters;
this->scr = scr;
+ this->moving = false;
+ this->rightNeighbor = NULL;
+ this->leftNeighbor = NULL;
Panel_setHeader(super, header);
for (int i = 0; i < Vector_size(meters); i++) {
Meter* meter = (Meter*) Vector_get(meters, i);
- Panel_add(super, (Object*) Meter_toListItem(meter));
+ Panel_add(super, (Object*) Meter_toListItem(meter, false));
}
return this;
}
diff --git a/MetersPanel.h b/MetersPanel.h
index 56c83e7..1736dfb 100644
--- a/MetersPanel.h
+++ b/MetersPanel.h
@@ -13,14 +13,22 @@ in the source distribution for its full text.
#include "Settings.h"
#include "ScreenManager.h"
-typedef struct MetersPanel_ {
+typedef struct MetersPanel_ MetersPanel;
+
+struct MetersPanel_ {
Panel super;
Settings* settings;
Vector* meters;
ScreenManager* scr;
-} MetersPanel;
+ MetersPanel* leftNeighbor;
+ MetersPanel* rightNeighbor;
+ bool moving;
+};
+
+
+void MetersPanel_setMoving(MetersPanel* this, bool moving);
extern PanelClass MetersPanel_class;
diff --git a/Object.c b/Object.c
index 2399e50..120d28c 100644
--- a/Object.c
+++ b/Object.c
@@ -9,11 +9,12 @@ in the source distribution for its full text.
/*{
#include "RichString.h"
+#include "XAlloc.h"
typedef struct Object_ Object;
typedef void(*Object_Display)(Object*, RichString*);
-typedef int(*Object_Compare)(const void*, const void*);
+typedef long(*Object_Compare)(const void*, const void*);
typedef void(*Object_Delete)(Object*);
#define Object_getClass(obj_) ((Object*)(obj_))->klass
@@ -26,7 +27,7 @@ typedef void(*Object_Delete)(Object*);
#define Class(class_) ((ObjectClass*)(&(class_ ## _class)))
-#define AllocThis(class_) (class_*) malloc(sizeof(class_)); Object_setClass(this, Class(class_));
+#define AllocThis(class_) (class_*) xMalloc(sizeof(class_)); Object_setClass(this, Class(class_));
typedef struct ObjectClass_ {
const void* extends;
diff --git a/Object.h b/Object.h
index bfabe6f..19a667c 100644
--- a/Object.h
+++ b/Object.h
@@ -10,11 +10,12 @@ in the source distribution for its full text.
*/
#include "RichString.h"
+#include "XAlloc.h"
typedef struct Object_ Object;
typedef void(*Object_Display)(Object*, RichString*);
-typedef int(*Object_Compare)(const void*, const void*);
+typedef long(*Object_Compare)(const void*, const void*);
typedef void(*Object_Delete)(Object*);
#define Object_getClass(obj_) ((Object*)(obj_))->klass
@@ -27,7 +28,7 @@ typedef void(*Object_Delete)(Object*);
#define Class(class_) ((ObjectClass*)(&(class_ ## _class)))
-#define AllocThis(class_) (class_*) malloc(sizeof(class_)); Object_setClass(this, Class(class_));
+#define AllocThis(class_) (class_*) xMalloc(sizeof(class_)); Object_setClass(this, Class(class_));
typedef struct ObjectClass_ {
const void* extends;
diff --git a/OpenFilesScreen.c b/OpenFilesScreen.c
index 7dfc32a..1eda373 100644
--- a/OpenFilesScreen.c
+++ b/OpenFilesScreen.c
@@ -9,9 +9,9 @@ in the source distribution for its full text.
#include "CRT.h"
#include "ProcessList.h"
-#include "ListItem.h"
#include "IncSet.h"
-#include "String.h"
+#include "StringUtils.h"
+#include "FunctionBar.h"
#include <string.h>
#include <stdio.h>
@@ -24,9 +24,7 @@ in the source distribution for its full text.
#include <sys/wait.h>
/*{
-#include "Process.h"
-#include "Panel.h"
-#include "FunctionBar.h"
+#include "InfoScreen.h"
typedef struct OpenFiles_Data_ {
char* data[256];
@@ -44,50 +42,44 @@ typedef struct OpenFiles_FileData_ {
} OpenFiles_FileData;
typedef struct OpenFilesScreen_ {
- Process* process;
+ InfoScreen super;
pid_t pid;
- Panel* display;
- FunctionBar* bar;
} OpenFilesScreen;
}*/
-static const char* ofsFunctions[] = {"Search ", "Filter ", "Refresh", "Done ", NULL};
-
-static const char* ofsKeys[] = {"F3", "F4", "F5", "Esc"};
-
-static int ofsEvents[] = {KEY_F(3), KEY_F(4), KEY_F(5), 27};
+InfoScreenClass OpenFilesScreen_class = {
+ .super = {
+ .extends = Class(Object),
+ .delete = OpenFilesScreen_delete
+ },
+ .scan = OpenFilesScreen_scan,
+ .draw = OpenFilesScreen_draw
+};
OpenFilesScreen* OpenFilesScreen_new(Process* process) {
- OpenFilesScreen* this = (OpenFilesScreen*) malloc(sizeof(OpenFilesScreen));
- this->process = process;
- this->display = Panel_new(0, 1, COLS, LINES-3, false, Class(ListItem));
+ OpenFilesScreen* this = xMalloc(sizeof(OpenFilesScreen));
+ Object_setClass(this, Class(OpenFilesScreen));
if (Process_isThread(process))
this->pid = process->tgid;
else
this->pid = process->pid;
- return this;
+ return (OpenFilesScreen*) InfoScreen_init(&this->super, process, NULL, LINES-3, " FD TYPE DEVICE SIZE NODE NAME");
}
-void OpenFilesScreen_delete(OpenFilesScreen* this) {
- Panel_delete((Object*)this->display);
- free(this);
+void OpenFilesScreen_delete(Object* this) {
+ free(InfoScreen_done((InfoScreen*)this));
}
-static void OpenFilesScreen_draw(OpenFilesScreen* this, IncSet* inc) {
- attrset(CRT_colors[METER_TEXT]);
- mvhline(0, 0, ' ', COLS);
- mvprintw(0, 0, "Snapshot of files open in process %d - %s", this->pid, this->process->comm);
- attrset(CRT_colors[DEFAULT_COLOR]);
- Panel_draw(this->display, true);
- IncSet_drawBar(inc);
+void OpenFilesScreen_draw(InfoScreen* this) {
+ InfoScreen_drawTitled(this, "Snapshot of files open in process %d - %s", ((OpenFilesScreen*)this)->pid, this->process->comm);
}
static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) {
char command[1025];
snprintf(command, 1024, "lsof -P -p %d -F 2> /dev/null", pid);
FILE* fd = popen(command, "r");
- OpenFiles_ProcessData* pdata = calloc(1, sizeof(OpenFiles_ProcessData));
+ OpenFiles_ProcessData* pdata = xCalloc(1, sizeof(OpenFiles_ProcessData));
OpenFiles_FileData* fdata = NULL;
OpenFiles_Data* item = &(pdata->data);
if (!fd) {
@@ -98,7 +90,7 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) {
int cmd = fgetc(fd);
if (cmd == EOF)
break;
- char* entry = malloc(1024);
+ char* entry = xMalloc(1024);
if (!fgets(entry, 1024, fd)) {
free(entry);
break;
@@ -106,7 +98,7 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) {
char* newline = strrchr(entry, '\n');
*newline = '\0';
if (cmd == 'f') {
- OpenFiles_FileData* nextFile = calloc(1, sizeof(OpenFiles_FileData));
+ OpenFiles_FileData* nextFile = xCalloc(1, sizeof(OpenFiles_FileData));
if (fdata == NULL) {
pdata->files = nextFile;
} else {
@@ -122,27 +114,21 @@ static OpenFiles_ProcessData* OpenFilesScreen_getProcessData(pid_t pid) {
return pdata;
}
-static inline void addLine(const char* line, Vector* lines, Panel* panel, const char* incFilter) {
- Vector_add(lines, (Object*) ListItem_new(line, 0));
- if (!incFilter || String_contains_i(line, incFilter))
- Panel_add(panel, (Object*)Vector_get(lines, Vector_size(lines)-1));
-}
-
static inline void OpenFiles_Data_clear(OpenFiles_Data* data) {
for (int i = 0; i < 255; i++)
if (data->data[i])
free(data->data[i]);
}
-static void OpenFilesScreen_scan(OpenFilesScreen* this, Vector* lines, IncSet* inc) {
+void OpenFilesScreen_scan(InfoScreen* this) {
Panel* panel = this->display;
int idx = Panel_getSelectedIndex(panel);
Panel_prune(panel);
- OpenFiles_ProcessData* pdata = OpenFilesScreen_getProcessData(this->pid);
+ OpenFiles_ProcessData* pdata = OpenFilesScreen_getProcessData(((OpenFilesScreen*)this)->pid);
if (pdata->error == 127) {
- addLine("Could not execute 'lsof'. Please make sure it is available in your $PATH.", lines, panel, IncSet_filter(inc));
+ InfoScreen_addLine(this, "Could not execute 'lsof'. Please make sure it is available in your $PATH.");
} else if (pdata->error == 1) {
- addLine("Failed listing open files.", lines, panel, IncSet_filter(inc));
+ InfoScreen_addLine(this, "Failed listing open files.");
} else {
OpenFiles_FileData* fdata = pdata->files;
while (fdata) {
@@ -155,7 +141,7 @@ static void OpenFilesScreen_scan(OpenFilesScreen* this, Vector* lines, IncSet* i
data['s'] ? data['s'] : "",
data['i'] ? data['i'] : "",
data['n'] ? data['n'] : "");
- addLine(entry, lines, panel, IncSet_filter(inc));
+ InfoScreen_addLine(this, entry);
OpenFiles_Data_clear(&fdata->data);
OpenFiles_FileData* old = fdata;
fdata = fdata->next;
@@ -164,83 +150,7 @@ static void OpenFilesScreen_scan(OpenFilesScreen* this, Vector* lines, IncSet* i
OpenFiles_Data_clear(&pdata->data);
}
free(pdata);
- Vector_insertionSort(lines);
+ Vector_insertionSort(this->lines);
Vector_insertionSort(panel->items);
Panel_setSelected(panel, idx);
}
-
-void OpenFilesScreen_run(OpenFilesScreen* this) {
- Panel* panel = this->display;
- Panel_setHeader(panel, " FD TYPE DEVICE SIZE NODE NAME");
-
- FunctionBar* bar = FunctionBar_new(ofsFunctions, ofsKeys, ofsEvents);
- IncSet* inc = IncSet_new(bar);
-
- Vector* lines = Vector_new(panel->items->type, true, DEFAULT_SIZE);
-
- OpenFilesScreen_scan(this, lines, inc);
- OpenFilesScreen_draw(this, inc);
-
- bool looping = true;
- while (looping) {
-
- Panel_draw(panel, true);
-
- if (inc->active)
- move(LINES-1, CRT_cursorX);
- int ch = getch();
-
- if (ch == KEY_MOUSE) {
- MEVENT mevent;
- int ok = getmouse(&mevent);
- if (ok == OK)
- if (mevent.y >= panel->y && mevent.y < LINES - 1) {
- Panel_setSelected(panel, mevent.y - panel->y + panel->scrollV);
- ch = 0;
- } if (mevent.y == LINES - 1)
- ch = FunctionBar_synthesizeEvent(inc->bar, mevent.x);
- }
-
- if (inc->active) {
- IncSet_handleKey(inc, ch, panel, IncSet_getListItemValue, lines);
- continue;
- }
-
- switch(ch) {
- case ERR:
- continue;
- case KEY_F(3):
- case '/':
- IncSet_activate(inc, INC_SEARCH);
- break;
- case KEY_F(4):
- case '\\':
- IncSet_activate(inc, INC_FILTER);
- break;
- case KEY_F(5):
- clear();
- OpenFilesScreen_scan(this, lines, inc);
- OpenFilesScreen_draw(this, inc);
- break;
- case '\014': // Ctrl+L
- clear();
- OpenFilesScreen_draw(this, inc);
- break;
- case 'q':
- case 27:
- case KEY_F(10):
- looping = false;
- break;
- case KEY_RESIZE:
- Panel_resize(panel, COLS, LINES-2);
- OpenFilesScreen_draw(this, inc);
- break;
- default:
- Panel_onKey(panel, ch);
- }
- }
-
- Vector_delete(lines);
- FunctionBar_delete((Object*)bar);
- IncSet_delete(inc);
-}
diff --git a/OpenFilesScreen.h b/OpenFilesScreen.h
index b3cdd97..8160cfe 100644
--- a/OpenFilesScreen.h
+++ b/OpenFilesScreen.h
@@ -9,9 +9,7 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
-#include "Process.h"
-#include "Panel.h"
-#include "FunctionBar.h"
+#include "InfoScreen.h"
typedef struct OpenFiles_Data_ {
char* data[256];
@@ -29,17 +27,19 @@ typedef struct OpenFiles_FileData_ {
} OpenFiles_FileData;
typedef struct OpenFilesScreen_ {
- Process* process;
+ InfoScreen super;
pid_t pid;
- Panel* display;
- FunctionBar* bar;
} OpenFilesScreen;
+extern InfoScreenClass OpenFilesScreen_class;
+
OpenFilesScreen* OpenFilesScreen_new(Process* process);
-void OpenFilesScreen_delete(OpenFilesScreen* this);
+void OpenFilesScreen_delete(Object* this);
+
+void OpenFilesScreen_draw(InfoScreen* this);
-void OpenFilesScreen_run(OpenFilesScreen* this);
+void OpenFilesScreen_scan(InfoScreen* this);
#endif
diff --git a/Panel.c b/Panel.c
index 26b1190..dd94cea 100644
--- a/Panel.c
+++ b/Panel.c
@@ -10,7 +10,7 @@ in the source distribution for its full text.
#include "CRT.h"
#include "RichString.h"
#include "ListItem.h"
-#include "String.h"
+#include "StringUtils.h"
#include <math.h>
#include <stdbool.h>
@@ -24,16 +24,24 @@ in the source distribution for its full text.
/*{
#include "Object.h"
#include "Vector.h"
+#include "FunctionBar.h"
typedef struct Panel_ Panel;
typedef enum HandlerResult_ {
- HANDLED,
- IGNORED,
- BREAK_LOOP
+ HANDLED = 0x01,
+ IGNORED = 0x02,
+ BREAK_LOOP = 0x04,
+ REDRAW = 0x08,
+ RESCAN = 0x10,
+ SYNTH_KEY = 0x20,
} HandlerResult;
-#define EVENT_SETSELECTED -1
+#define EVENT_SET_SELECTED -1
+
+#define EVENT_HEADER_CLICK(x_) (-10000 + x_)
+#define EVENT_IS_HEADER_CLICK(ev_) (ev_ >= -10000 && ev_ <= -9000)
+#define EVENT_HEADER_CLICK_GET_X(ev_) (ev_ + 10000)
typedef HandlerResult(*Panel_EventHandler)(Panel*, int);
@@ -48,19 +56,23 @@ typedef struct PanelClass_ {
struct Panel_ {
Object super;
- PanelClass* class;
int x, y, w, h;
WINDOW* window;
Vector* items;
int selected;
int oldSelected;
- char* eventHandlerBuffer;
+ void* eventHandlerState;
int scrollV;
short scrollH;
bool needsRedraw;
+ FunctionBar* currentBar;
+ FunctionBar* defaultBar;
RichString header;
+ int selectionColor;
};
+#define Panel_setDefaultBar(this_) do{ (this_)->currentBar = (this_)->defaultBar; }while(0)
+
}*/
#ifndef MIN
@@ -80,14 +92,14 @@ PanelClass Panel_class = {
.extends = Class(Object),
.delete = Panel_delete
},
- .eventHandler = Panel_selectByTyping
+ .eventHandler = Panel_selectByTyping,
};
-Panel* Panel_new(int x, int y, int w, int h, bool owner, ObjectClass* type) {
+Panel* Panel_new(int x, int y, int w, int h, bool owner, ObjectClass* type, FunctionBar* fuBar) {
Panel* this;
- this = malloc(sizeof(Panel));
+ this = xMalloc(sizeof(Panel));
Object_setClass(this, Class(Panel));
- Panel_init(this, x, y, w, h, type, owner);
+ Panel_init(this, x, y, w, h, type, owner, fuBar);
return this;
}
@@ -97,12 +109,12 @@ void Panel_delete(Object* cast) {
free(this);
}
-void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool owner) {
+void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool owner, FunctionBar* fuBar) {
this->x = x;
this->y = y;
this->w = w;
this->h = h;
- this->eventHandlerBuffer = NULL;
+ this->eventHandlerState = NULL;
this->items = Vector_new(type, owner, DEFAULT_SIZE);
this->scrollV = 0;
this->scrollH = 0;
@@ -110,15 +122,23 @@ void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool
this->oldSelected = 0;
this->needsRedraw = true;
RichString_beginAllocated(this->header);
+ this->defaultBar = fuBar;
+ this->currentBar = fuBar;
+ this->selectionColor = CRT_colors[PANEL_SELECTION_FOCUS];
}
void Panel_done(Panel* this) {
assert (this != NULL);
- free(this->eventHandlerBuffer);
+ free(this->eventHandlerState);
Vector_delete(this->items);
+ FunctionBar_delete(this->defaultBar);
RichString_end(this->header);
}
+void Panel_setSelectionColor(Panel* this, int color) {
+ this->selectionColor = color;
+}
+
RichString* Panel_getHeader(Panel* this) {
assert (this != NULL);
@@ -234,38 +254,26 @@ int Panel_size(Panel* this) {
void Panel_setSelected(Panel* this, int selected) {
assert (this != NULL);
- selected = MAX(0, MIN(Vector_size(this->items) - 1, selected));
+ int size = Vector_size(this->items);
+ if (selected >= size) {
+ selected = size - 1;
+ }
+ if (selected < 0)
+ selected = 0;
this->selected = selected;
if (Panel_eventHandlerFn(this)) {
- Panel_eventHandler(this, EVENT_SETSELECTED);
+ Panel_eventHandler(this, EVENT_SET_SELECTED);
}
}
void Panel_draw(Panel* this, bool focus) {
assert (this != NULL);
- int itemCount = Vector_size(this->items);
+ int size = Vector_size(this->items);
int scrollH = this->scrollH;
- int y = this->y; int x = this->x;
- int first = this->scrollV;
- if (itemCount > this->h && first > itemCount - this->h) {
- first = itemCount - this->h;
- this->scrollV = first;
- }
- int last = MIN(itemCount, first + MIN(itemCount, this->h));
- if (this->selected < first) {
- first = this->selected;
- this->scrollV = first;
- this->needsRedraw = true;
- }
- if (this->selected >= last) {
- last = MIN(itemCount, this->selected + 1);
- first = MAX(0, last - this->h);
- this->scrollV = first;
- this->needsRedraw = true;
- }
- assert(first >= 0);
- assert(last <= itemCount);
+ int y = this->y;
+ int x = this->x;
+ int h = this->h;
int headerLen = RichString_sizeVal(this->header);
if (headerLen > 0) {
@@ -281,14 +289,34 @@ void Panel_draw(Panel* this, bool focus) {
attrset(CRT_colors[RESET_COLOR]);
y++;
}
-
- int highlight = focus
- ? CRT_colors[PANEL_HIGHLIGHT_FOCUS]
- : CRT_colors[PANEL_HIGHLIGHT_UNFOCUS];
- if (this->needsRedraw) {
+ // ensure scroll area is on screen
+ if (this->scrollV < 0) {
+ this->scrollV = 0;
+ this->needsRedraw = true;
+ } else if (this->scrollV >= size) {
+ this->scrollV = MAX(size - 1, 0);
+ this->needsRedraw = true;
+ }
+ // ensure selection is on screen
+ if (this->selected < this->scrollV) {
+ this->scrollV = this->selected;
+ this->needsRedraw = true;
+ } else if (this->selected >= this->scrollV + h) {
+ this->scrollV = this->selected - h + 1;
+ this->needsRedraw = true;
+ }
+
+ int first = this->scrollV;
+ int upTo = MIN(first + h, size);
- for(int i = first, j = 0; j < this->h && i < last; i++, j++) {
+ int selectionColor = focus
+ ? this->selectionColor
+ : CRT_colors[PANEL_SELECTION_UNFOCUS];
+
+ if (this->needsRedraw) {
+ int line = 0;
+ for(int i = first; line < h && i < upTo; i++) {
Object* itemObj = Vector_get(this->items, i);
assert(itemObj); if(!itemObj) continue;
RichString_begin(item);
@@ -297,18 +325,21 @@ void Panel_draw(Panel* this, bool focus) {
int amt = MIN(itemLen - scrollH, this->w);
bool selected = (i == this->selected);
if (selected) {
- attrset(highlight);
- RichString_setAttr(&item, highlight);
+ attrset(selectionColor);
+ RichString_setAttr(&item, selectionColor);
}
- mvhline(y + j, x, ' ', this->w);
+ mvhline(y + line, x, ' ', this->w);
if (amt > 0)
- RichString_printoffnVal(item, y+j, x, scrollH, amt);
+ RichString_printoffnVal(item, y + line, x, scrollH, amt);
if (selected)
attrset(CRT_colors[RESET_COLOR]);
RichString_end(item);
+ line++;
+ }
+ while (line < h) {
+ mvhline(y + line, x, ' ', this->w);
+ line++;
}
- for (int i = y + (last - first); i < y + this->h; i++)
- mvhline(i, x+0, ' ', this->w);
this->needsRedraw = false;
} else {
@@ -321,15 +352,15 @@ void Panel_draw(Panel* this, bool focus) {
RichString_begin(new);
Object_display(newObj, &new);
int newLen = RichString_sizeVal(new);
- mvhline(y+ this->oldSelected - this->scrollV, x+0, ' ', this->w);
+ mvhline(y+ this->oldSelected - first, x+0, ' ', this->w);
if (scrollH < oldLen)
- RichString_printoffnVal(old, y+this->oldSelected - this->scrollV, x,
+ RichString_printoffnVal(old, y+this->oldSelected - first, x,
scrollH, MIN(oldLen - scrollH, this->w));
- attrset(highlight);
- mvhline(y+this->selected - this->scrollV, x+0, ' ', this->w);
- RichString_setAttr(&new, highlight);
+ attrset(selectionColor);
+ mvhline(y+this->selected - first, x+0, ' ', this->w);
+ RichString_setAttr(&new, selectionColor);
if (scrollH < newLen)
- RichString_printoffnVal(new, y+this->selected - this->scrollV, x,
+ RichString_printoffnVal(new, y+this->selected - first, x,
scrollH, MIN(newLen - scrollH, this->w));
attrset(CRT_colors[RESET_COLOR]);
RichString_end(new);
@@ -341,38 +372,26 @@ void Panel_draw(Panel* this, bool focus) {
bool Panel_onKey(Panel* this, int key) {
assert (this != NULL);
+
+ int size = Vector_size(this->items);
switch (key) {
case KEY_DOWN:
case KEY_CTRLN:
- if (this->selected + 1 < Vector_size(this->items))
- this->selected++;
- return true;
+ this->selected++;
+ break;
case KEY_UP:
case KEY_CTRLP:
- if (this->selected > 0)
- this->selected--;
- return true;
+ this->selected--;
+ break;
#ifdef KEY_C_DOWN
case KEY_C_DOWN:
- if (this->selected + 1 < Vector_size(this->items)) {
- this->selected++;
- if (this->scrollV < Vector_size(this->items) - this->h) {
- this->scrollV++;
- this->needsRedraw = true;
- }
- }
- return true;
+ this->selected++;
+ break;
#endif
#ifdef KEY_C_UP
case KEY_C_UP:
- if (this->selected > 0) {
- this->selected--;
- if (this->scrollV > 0) {
- this->scrollV--;
- this->needsRedraw = true;
- }
- }
- return true;
+ this->selected--;
+ break;
#endif
case KEY_LEFT:
case KEY_CTRLB:
@@ -380,69 +399,89 @@ bool Panel_onKey(Panel* this, int key) {
this->scrollH -= CRT_scrollHAmount;
this->needsRedraw = true;
}
- return true;
+ break;
case KEY_RIGHT:
case KEY_CTRLF:
this->scrollH += CRT_scrollHAmount;
this->needsRedraw = true;
- return true;
+ break;
case KEY_PPAGE:
this->selected -= (this->h - 1);
this->scrollV -= (this->h - 1);
- if (this->selected < 0)
- this->selected = 0;
- if (this->scrollV < 0)
- this->scrollV = 0;
this->needsRedraw = true;
- return true;
+ break;
case KEY_NPAGE:
this->selected += (this->h - 1);
- int size = Vector_size(this->items);
- if (this->selected >= size)
- this->selected = size - 1;
this->scrollV += (this->h - 1);
- if (this->scrollV >= MAX(0, size - this->h))
- this->scrollV = MAX(0, size - this->h - 1);
this->needsRedraw = true;
- return true;
+ break;
+ case KEY_WHEELUP:
+ this->selected -= CRT_scrollWheelVAmount;
+ this->scrollV -= CRT_scrollWheelVAmount;
+ this->needsRedraw = true;
+ break;
+ case KEY_WHEELDOWN:
+ {
+ this->selected += CRT_scrollWheelVAmount;
+ this->scrollV += CRT_scrollWheelVAmount;
+ if (this->scrollV > Vector_size(this->items) - this->h) {
+ this->scrollV = Vector_size(this->items) - this->h;
+ }
+ this->needsRedraw = true;
+ break;
+ }
case KEY_HOME:
this->selected = 0;
- return true;
+ break;
case KEY_END:
- this->selected = Vector_size(this->items) - 1;
- return true;
+ this->selected = size - 1;
+ break;
+ default:
+ return false;
+ }
+
+ // ensure selection within bounds
+ if (this->selected < 0) {
+ this->selected = 0;
+ this->needsRedraw = true;
+ } else if (this->selected >= size) {
+ this->selected = size - 1;
+ this->needsRedraw = true;
}
- return false;
+ return true;
}
HandlerResult Panel_selectByTyping(Panel* this, int ch) {
int size = Panel_size(this);
- if (!this->eventHandlerBuffer)
- this->eventHandlerBuffer = calloc(100, 1);
+ if (!this->eventHandlerState)
+ this->eventHandlerState = xCalloc(100, sizeof(char));
+ char* buffer = this->eventHandlerState;
- if (isalnum(ch)) {
- int len = strlen(this->eventHandlerBuffer);
+ if (ch < 255 && isalnum(ch)) {
+ int len = strlen(buffer);
if (len < 99) {
- this->eventHandlerBuffer[len] = ch;
- this->eventHandlerBuffer[len+1] = '\0';
+ buffer[len] = ch;
+ buffer[len+1] = '\0';
}
for (int try = 0; try < 2; try++) {
- len = strlen(this->eventHandlerBuffer);
+ len = strlen(buffer);
for (int i = 0; i < size; i++) {
char* cur = ((ListItem*) Panel_get(this, i))->value;
while (*cur == ' ') cur++;
- if (strncasecmp(cur, this->eventHandlerBuffer, len) == 0) {
+ if (strncasecmp(cur, buffer, len) == 0) {
Panel_setSelected(this, i);
return HANDLED;
}
}
- this->eventHandlerBuffer[0] = ch;
- this->eventHandlerBuffer[1] = '\0';
+ // if current word did not match,
+ // retry considering the character the start of a new word.
+ buffer[0] = ch;
+ buffer[1] = '\0';
}
return HANDLED;
} else if (ch != ERR) {
- this->eventHandlerBuffer[0] = '\0';
+ buffer[0] = '\0';
}
if (ch == 13) {
return BREAK_LOOP;
diff --git a/Panel.h b/Panel.h
index 91c0a40..6789770 100644
--- a/Panel.h
+++ b/Panel.h
@@ -13,16 +13,24 @@ in the source distribution for its full text.
#include "Object.h"
#include "Vector.h"
+#include "FunctionBar.h"
typedef struct Panel_ Panel;
typedef enum HandlerResult_ {
- HANDLED,
- IGNORED,
- BREAK_LOOP
+ HANDLED = 0x01,
+ IGNORED = 0x02,
+ BREAK_LOOP = 0x04,
+ REDRAW = 0x08,
+ RESCAN = 0x10,
+ SYNTH_KEY = 0x20,
} HandlerResult;
-#define EVENT_SETSELECTED -1
+#define EVENT_SET_SELECTED -1
+
+#define EVENT_HEADER_CLICK(x_) (-10000 + x_)
+#define EVENT_IS_HEADER_CLICK(ev_) (ev_ >= -10000 && ev_ <= -9000)
+#define EVENT_HEADER_CLICK_GET_X(ev_) (ev_ + 10000)
typedef HandlerResult(*Panel_EventHandler)(Panel*, int);
@@ -37,19 +45,23 @@ typedef struct PanelClass_ {
struct Panel_ {
Object super;
- PanelClass* class;
int x, y, w, h;
WINDOW* window;
Vector* items;
int selected;
int oldSelected;
- char* eventHandlerBuffer;
+ void* eventHandlerState;
int scrollV;
short scrollH;
bool needsRedraw;
+ FunctionBar* currentBar;
+ FunctionBar* defaultBar;
RichString header;
+ int selectionColor;
};
+#define Panel_setDefaultBar(this_) do{ (this_)->currentBar = (this_)->defaultBar; }while(0)
+
#ifndef MIN
#define MIN(a,b) ((a)<(b)?(a):(b))
@@ -65,14 +77,16 @@ struct Panel_ {
extern PanelClass Panel_class;
-Panel* Panel_new(int x, int y, int w, int h, bool owner, ObjectClass* type);
+Panel* Panel_new(int x, int y, int w, int h, bool owner, ObjectClass* type, FunctionBar* fuBar);
void Panel_delete(Object* cast);
-void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool owner);
+void Panel_init(Panel* this, int x, int y, int w, int h, ObjectClass* type, bool owner, FunctionBar* fuBar);
void Panel_done(Panel* this);
+void Panel_setSelectionColor(Panel* this, int color);
+
RichString* Panel_getHeader(Panel* this);
extern void Panel_setHeader(Panel* this, const char* header);
diff --git a/Process.c b/Process.c
index 4efd854..07ecba1 100644
--- a/Process.c
+++ b/Process.c
@@ -1,16 +1,17 @@
/*
htop - Process.c
-(C) 2004-2011 Hisham H. Muhammad
+(C) 2004-2015 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
#include "Process.h"
+#include "Settings.h"
-#include "ProcessList.h"
#include "CRT.h"
-#include "String.h"
+#include "StringUtils.h"
#include "RichString.h"
+#include "Platform.h"
#include <stdio.h>
#include <sys/time.h>
@@ -23,16 +24,16 @@ in the source distribution for its full text.
#include <string.h>
#include <stdbool.h>
#include <pwd.h>
-#include <sched.h>
#include <time.h>
#include <assert.h>
-#include <sys/syscall.h>
+#include <math.h>
-#ifdef HAVE_LIBHWLOC
-#include <hwloc/linux.h>
+#ifdef __ANDROID__
+#define SYS_ioprio_get __NR_ioprio_get
+#define SYS_ioprio_set __NR_ioprio_set
#endif
-// This works only with glibc 2.1+. On earlier versions
+// On Linux, this works only with glibc 2.1+. On earlier versions
// the behavior is similar to have a hardcoded page size.
#ifndef PAGE_SIZE
#define PAGE_SIZE ( sysconf(_SC_PAGESIZE) )
@@ -41,137 +42,87 @@ in the source distribution for its full text.
/*{
#include "Object.h"
-#include "Affinity.h"
-#include "IOPriority.h"
-#include <sys/types.h>
-
-#define PROCESS_FLAG_IO 1
-#define PROCESS_FLAG_IOPRIO 2
-#define PROCESS_FLAG_OPENVZ 4
-#define PROCESS_FLAG_VSERVER 8
-#define PROCESS_FLAG_CGROUP 16
-
-#ifndef Process_isKernelThread
-#define Process_isKernelThread(_process) (_process->pgrp == 0)
-#endif
-#ifndef Process_isUserlandThread
-#define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
-#endif
-
-#ifndef Process_isThread
-#define Process_isThread(_process) (Process_isUserlandThread(_process) || Process_isKernelThread(_process))
-#endif
+#include <sys/types.h>
-typedef enum ProcessField_ {
- PID = 1, COMM, STATE, PPID, PGRP, SESSION, TTY_NR, TPGID, FLAGS, MINFLT, CMINFLT, MAJFLT, CMAJFLT, UTIME,
- STIME, CUTIME, CSTIME, PRIORITY, NICE, ITREALVALUE, STARTTIME, VSIZE, RSS, RLIM, STARTCODE, ENDCODE,
- STARTSTACK, KSTKESP, KSTKEIP, SIGNAL, BLOCKED, SSIGIGNORE, SIGCATCH, WCHAN, NSWAP, CNSWAP, EXIT_SIGNAL,
- PROCESSOR, M_SIZE, M_RESIDENT, M_SHARE, M_TRS, M_DRS, M_LRS, M_DT, ST_UID, PERCENT_CPU, PERCENT_MEM,
- USER, TIME, NLWP, TGID,
- #ifdef HAVE_OPENVZ
- CTID, VPID,
- #endif
- #ifdef HAVE_VSERVER
- VXID,
- #endif
- #ifdef HAVE_TASKSTATS
- RCHAR, WCHAR, SYSCR, SYSCW, RBYTES, WBYTES, CNCLWB, IO_READ_RATE, IO_WRITE_RATE, IO_RATE,
- #endif
- #ifdef HAVE_CGROUP
- CGROUP,
- #endif
- #ifdef HAVE_OOM
- OOM,
- #endif
- IO_PRIORITY,
- LAST_PROCESSFIELD
+#define PROCESS_FLAG_IO 0x0001
+
+typedef enum ProcessFields {
+ PID = 1,
+ COMM = 2,
+ STATE = 3,
+ PPID = 4,
+ PGRP = 5,
+ SESSION = 6,
+ TTY_NR = 7,
+ TPGID = 8,
+ MINFLT = 10,
+ MAJFLT = 12,
+ PRIORITY = 18,
+ NICE = 19,
+ STARTTIME = 21,
+ PROCESSOR = 38,
+ M_SIZE = 39,
+ M_RESIDENT = 40,
+ ST_UID = 46,
+ PERCENT_CPU = 47,
+ PERCENT_MEM = 48,
+ USER = 49,
+ TIME = 50,
+ NLWP = 51,
+ TGID = 52,
} ProcessField;
-struct ProcessList_;
+typedef struct ProcessPidColumn_ {
+ int id;
+ char* label;
+} ProcessPidColumn;
typedef struct Process_ {
Object super;
- struct ProcessList_ *pl;
+ struct Settings_* settings;
+ unsigned long long int time;
pid_t pid;
+ pid_t ppid;
+ pid_t tgid;
char* comm;
+ int commLen;
int indent;
+
+ int basenameOffset;
+ bool updated;
+
char state;
bool tag;
bool showChildren;
bool show;
- pid_t ppid;
unsigned int pgrp;
unsigned int session;
unsigned int tty_nr;
- pid_t tgid;
int tpgid;
+ uid_t st_uid;
unsigned long int flags;
+ int processor;
- uid_t st_uid;
float percent_cpu;
float percent_mem;
char* user;
- unsigned long long int utime;
- unsigned long long int stime;
- unsigned long long int cutime;
- unsigned long long int cstime;
long int priority;
long int nice;
long int nlwp;
- IOPriority ioPriority;
char starttime_show[8];
time_t starttime_ctime;
- #ifdef HAVE_TASKSTATS
- unsigned long long io_rchar;
- unsigned long long io_wchar;
- unsigned long long io_syscr;
- unsigned long long io_syscw;
- unsigned long long io_read_bytes;
- unsigned long long io_write_bytes;
- unsigned long long io_cancelled_write_bytes;
- double io_rate_read_bps;
- unsigned long long io_rate_read_time;
- double io_rate_write_bps;
- unsigned long long io_rate_write_time;
- #endif
-
- int processor;
long m_size;
long m_resident;
- long m_share;
- long m_trs;
- long m_drs;
- long m_lrs;
- long m_dt;
-
- #ifdef HAVE_OPENVZ
- unsigned int ctid;
- unsigned int vpid;
- #endif
- #ifdef HAVE_VSERVER
- unsigned int vxid;
- #endif
-
- #ifdef HAVE_CGROUP
- char* cgroup;
- #endif
- #ifdef HAVE_OOM
- unsigned int oom;
- #endif
int exit_signal;
- int basenameOffset;
- bool updated;
unsigned long int minflt;
- unsigned long int cminflt;
unsigned long int majflt;
- unsigned long int cmajflt;
#ifdef DEBUG
long int itrealvalue;
unsigned long int vsize;
@@ -193,131 +144,35 @@ typedef struct Process_ {
} Process;
-}*/
+typedef struct ProcessFieldData_ {
+ const char* name;
+ const char* title;
+ const char* description;
+ int flags;
+} ProcessFieldData;
-const char *Process_fieldNames[] = {
- "", "PID", "Command", "STATE", "PPID", "PGRP", "SESSION",
- "TTY_NR", "TPGID", "FLAGS", "MINFLT", "CMINFLT", "MAJFLT", "CMAJFLT",
- "UTIME", "STIME", "CUTIME", "CSTIME", "PRIORITY", "NICE", "ITREALVALUE",
- "STARTTIME", "VSIZE", "RSS", "RLIM", "STARTCODE", "ENDCODE", "STARTSTACK",
- "KSTKESP", "KSTKEIP", "SIGNAL", "BLOCKED", "SIGIGNORE", "SIGCATCH", "WCHAN",
- "NSWAP", "CNSWAP", "EXIT_SIGNAL", "PROCESSOR", "M_SIZE", "M_RESIDENT", "M_SHARE",
- "M_TRS", "M_DRS", "M_LRS", "M_DT", "ST_UID", "PERCENT_CPU", "PERCENT_MEM",
- "USER", "TIME", "NLWP", "TGID",
-#ifdef HAVE_OPENVZ
- "CTID", "VPID",
-#endif
-#ifdef HAVE_VSERVER
- "VXID",
-#endif
-#ifdef HAVE_TASKSTATS
- "RCHAR", "WCHAR", "SYSCR", "SYSCW", "RBYTES", "WBYTES", "CNCLWB",
- "IO_READ_RATE", "IO_WRITE_RATE", "IO_RATE",
-#endif
-#ifdef HAVE_CGROUP
- "CGROUP",
-#endif
-#ifdef HAVE_OOM
- "OOM",
-#endif
- "IO_PRIORITY",
-"*** report bug! ***"
-};
+// Implemented in platform-specific code:
+void Process_writeField(Process* this, RichString* str, ProcessField field);
+long Process_compare(const void* v1, const void* v2);
+void Process_delete(Object* cast);
+bool Process_isThread(Process* this);
+extern ProcessFieldData Process_fields[];
+extern ProcessPidColumn Process_pidColumns[];
+extern char Process_pidFormat[20];
-const int Process_fieldFlags[] = {
- 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0, 0, 0, 0,
- 0, 0, 0, 0,
-#ifdef HAVE_OPENVZ
- PROCESS_FLAG_OPENVZ, PROCESS_FLAG_OPENVZ,
-#endif
-#ifdef HAVE_VSERVER
- PROCESS_FLAG_VSERVER,
-#endif
-#ifdef HAVE_TASKSTATS
- PROCESS_FLAG_IO, PROCESS_FLAG_IO, PROCESS_FLAG_IO, PROCESS_FLAG_IO, PROCESS_FLAG_IO, PROCESS_FLAG_IO, PROCESS_FLAG_IO,
- PROCESS_FLAG_IO, PROCESS_FLAG_IO, PROCESS_FLAG_IO,
-#endif
-#ifdef HAVE_CGROUP
- PROCESS_FLAG_CGROUP,
-#endif
-#ifdef HAVE_OOM
- 0,
-#endif
- PROCESS_FLAG_IOPRIO
-};
+typedef Process*(*Process_New)(struct Settings_*);
+typedef void (*Process_WriteField)(Process*, RichString*, ProcessField);
-const char *Process_fieldTitles[] = {
- "", " PID ", "Command ", "S ", " PPID ", " PGRP ", " SESN ",
- " TTY ", " TPGID ", "- ", " MINFLT ", " CMINFLT ", " MAJFLT ", " CMAJFLT ",
- " UTIME+ ", " STIME+ ", " CUTIME+ ", " CSTIME+ ", "PRI ", " NI ", "- ",
- "START ", "- ", "- ", "- ", "- ", "- ", "- ",
- "- ", "- ", "- ", "- ", "- ", "- ", "- ",
- "- ", "- ", "- ", "CPU ", " VIRT ", " RES ", " SHR ",
- " CODE ", " DATA ", " LIB ", " DIRTY ", " UID ", "CPU% ", "MEM% ",
- "USER ", " TIME+ ", "NLWP ", " TGID ",
-#ifdef HAVE_OPENVZ
- " CTID ", " VPID ",
-#endif
-#ifdef HAVE_VSERVER
- " VXID ",
-#endif
-#ifdef HAVE_TASKSTATS
- " RD_CHAR ", " WR_CHAR ", " RD_SYSC ", " WR_SYSC ", " IO_RBYTES ", " IO_WBYTES ", " IO_CANCEL ",
- " IORR ", " IOWR ", " IORW ",
-#endif
-#ifdef HAVE_CGROUP
- " CGROUP ",
-#endif
-#ifdef HAVE_OOM
- " OOM ",
-#endif
- "IO ",
-"*** report bug! ***"
-};
+typedef struct ProcessClass_ {
+ const ObjectClass super;
+ const Process_WriteField writeField;
+} ProcessClass;
-static int Process_getuid = -1;
+#define As_Process(this_) ((ProcessClass*)((this_)->super.klass))
-static char* Process_pidFormat = "%7u ";
-static char* Process_tpgidFormat = "%7u ";
-
-void Process_getMaxPid() {
- FILE* file = fopen(PROCDIR "/sys/kernel/pid_max", "r");
- if (!file) return;
- int maxPid = 4194303;
- fscanf(file, "%32d", &maxPid);
- fclose(file);
- if (maxPid > 99999) {
- Process_fieldTitles[PID] = " PID ";
- Process_fieldTitles[PPID] = " PPID ";
- Process_fieldTitles[TPGID] = " TPGID ";
- Process_fieldTitles[TGID] = " TGID ";
- Process_fieldTitles[PGRP] = " PGRP ";
- Process_fieldTitles[SESSION] = " SESN ";
- #ifdef HAVE_OOM
- Process_fieldTitles[OOM] = " OOM ";
- #endif
- Process_pidFormat = "%7u ";
- Process_tpgidFormat = "%7d ";
- } else {
- Process_fieldTitles[PID] = " PID ";
- Process_fieldTitles[PPID] = " PPID ";
- Process_fieldTitles[TPGID] = "TPGID ";
- Process_fieldTitles[TGID] = " TGID ";
- Process_fieldTitles[PGRP] = " PGRP ";
- Process_fieldTitles[SESSION] = " SESN ";
- #ifdef HAVE_OOM
- Process_fieldTitles[OOM] = " OOM ";
- #endif
- Process_pidFormat = "%5u ";
- Process_tpgidFormat = "%5d ";
- }
-}
+}*/
+
+static int Process_getuid = -1;
#define ONE_K 1024L
#define ONE_M (ONE_K * ONE_K)
@@ -327,7 +182,24 @@ void Process_getMaxPid() {
#define ONE_DECIMAL_M (ONE_DECIMAL_K * ONE_DECIMAL_K)
#define ONE_DECIMAL_G (ONE_DECIMAL_M * ONE_DECIMAL_K)
-static void Process_humanNumber(RichString* str, unsigned long number, bool coloring) {
+char Process_pidFormat[20] = "%7d ";
+
+static char Process_titleBuffer[20][20];
+
+void Process_setupColumnWidths() {
+ int maxPid = Platform_getMaxPid();
+ if (maxPid == -1) return;
+ int digits = ceil(log10(maxPid));
+ assert(digits < 20);
+ for (int i = 0; Process_pidColumns[i].label; i++) {
+ assert(i < 20);
+ sprintf(Process_titleBuffer[i], "%*s ", digits, Process_pidColumns[i].label);
+ Process_fields[Process_pidColumns[i].id].title = Process_titleBuffer[i];
+ }
+ sprintf(Process_pidFormat, "%%%dd ", digits);
+}
+
+void Process_humanNumber(RichString* str, unsigned long number, bool coloring) {
char buffer[11];
int len;
@@ -338,7 +210,7 @@ static void Process_humanNumber(RichString* str, unsigned long number, bool colo
largeNumberColor = CRT_colors[PROCESS];
processMegabytesColor = CRT_colors[PROCESS];
}
-
+
if(number >= (10 * ONE_DECIMAL_M)) {
#ifdef __LP64__
if(number >= (100 * ONE_DECIMAL_G)) {
@@ -375,7 +247,7 @@ static void Process_humanNumber(RichString* str, unsigned long number, bool colo
RichString_appendn(str, processColor, buffer, len);
}
-static void Process_colorNumber(RichString* str, unsigned long long number, bool coloring) {
+void Process_colorNumber(RichString* str, unsigned long long number, bool coloring) {
char buffer[14];
int largeNumberColor = CRT_colors[LARGE_NUMBER];
@@ -402,19 +274,13 @@ static void Process_colorNumber(RichString* str, unsigned long long number, bool
}
}
-static double jiffy = 0.0;
-
-static void Process_printTime(RichString* str, unsigned long long t) {
- if(jiffy == 0.0) jiffy = sysconf(_SC_CLK_TCK);
- double jiffytime = 1.0 / jiffy;
+void Process_printTime(RichString* str, unsigned long long totalHundredths) {
+ unsigned long long totalSeconds = totalHundredths / 100;
- double realTime = t * jiffytime;
- unsigned long long iRealTime = (unsigned long long) realTime;
-
- unsigned long long hours = iRealTime / 3600;
- int minutes = (iRealTime / 60) % 60;
- int seconds = iRealTime % 60;
- int hundredths = (realTime - iRealTime) * 100;
+ unsigned long long hours = totalSeconds / 3600;
+ int minutes = (totalSeconds / 60) % 60;
+ int seconds = totalSeconds % 60;
+ int hundredths = totalHundredths - (totalSeconds * 100);
char buffer[11];
if (hours >= 100) {
snprintf(buffer, 10, "%7lluh ", hours);
@@ -432,79 +298,97 @@ static void Process_printTime(RichString* str, unsigned long long t) {
}
static inline void Process_writeCommand(Process* this, int attr, int baseattr, RichString* str) {
- int start = RichString_size(str);
- RichString_append(str, attr, this->comm);
- if (this->pl->highlightBaseName) {
- int finish = RichString_size(str) - 1;
- if (this->basenameOffset != -1)
- finish = (start + this->basenameOffset) - 1;
- int colon = RichString_findChar(str, ':', start);
- if (colon != -1 && colon < finish) {
- finish = colon;
- } else {
- for (int i = finish - start; i >= 0; i--) {
- if (this->comm[i] == '/') {
- start += i+1;
- break;
- }
+ int start = RichString_size(str), finish = 0;
+ char* comm = this->comm;
+
+ if (this->settings->highlightBaseName || !this->settings->showProgramPath) {
+ int i, basename = 0;
+ for (i = 0; i < this->basenameOffset; i++) {
+ if (comm[i] == '/') {
+ basename = i + 1;
+ } else if (comm[i] == ':') {
+ finish = i + 1;
+ break;
}
}
- RichString_setAttrn(str, baseattr, start, finish);
+ if (!finish) {
+ if (this->settings->showProgramPath)
+ start += basename;
+ else
+ comm += basename;
+ finish = this->basenameOffset - basename;
+ }
+ finish += start - 1;
}
+
+ RichString_append(str, attr, comm);
+
+ if (this->settings->highlightBaseName)
+ RichString_setAttrn(str, baseattr, start, finish);
}
-static inline void Process_outputRate(RichString* str, int attr, char* buffer, int n, double rate, int coloring) {
- rate = rate / 1024;
- if (rate < 0.01)
- snprintf(buffer, n, " 0 ");
- else if (rate <= 10)
- snprintf(buffer, n, "%5.2f ", rate);
- else if (rate <= 100)
- snprintf(buffer, n, "%5.1f ", rate);
- else {
- Process_humanNumber(str, rate, coloring);
- return;
+void Process_outputRate(RichString* str, char* buffer, int n, double rate, int coloring) {
+ int largeNumberColor = CRT_colors[LARGE_NUMBER];
+ int processMegabytesColor = CRT_colors[PROCESS_MEGABYTES];
+ int processColor = CRT_colors[PROCESS];
+ if (!coloring) {
+ largeNumberColor = CRT_colors[PROCESS];
+ processMegabytesColor = CRT_colors[PROCESS];
+ }
+ if (rate < ONE_K) {
+ int len = snprintf(buffer, n, "%7.2f B/s ", rate);
+ RichString_appendn(str, processColor, buffer, len);
+ } else if (rate < ONE_K * ONE_K) {
+ int len = snprintf(buffer, n, "%7.2f K/s ", rate / ONE_K);
+ RichString_appendn(str, processColor, buffer, len);
+ } else if (rate < ONE_K * ONE_K * ONE_K) {
+ int len = snprintf(buffer, n, "%7.2f M/s ", rate / ONE_K / ONE_K);
+ RichString_appendn(str, processMegabytesColor, buffer, len);
+ } else {
+ int len = snprintf(buffer, n, "%7.2f G/s ", rate / ONE_K / ONE_K / ONE_K);
+ RichString_appendn(str, largeNumberColor, buffer, len);
}
- RichString_append(str, attr, buffer);
}
-static void Process_writeField(Process* this, RichString* str, ProcessField field) {
+void Process_writeField(Process* this, RichString* str, ProcessField field) {
char buffer[256]; buffer[255] = '\0';
int attr = CRT_colors[DEFAULT_COLOR];
int baseattr = CRT_colors[PROCESS_BASENAME];
int n = sizeof(buffer) - 1;
- bool coloring = this->pl->highlightMegabytes;
+ bool coloring = this->settings->highlightMegabytes;
switch (field) {
- case PID: snprintf(buffer, n, Process_pidFormat, this->pid); break;
- case PPID: snprintf(buffer, n, Process_pidFormat, this->ppid); break;
- case PGRP: snprintf(buffer, n, Process_pidFormat, this->pgrp); break;
- case SESSION: snprintf(buffer, n, Process_pidFormat, this->session); break;
- case TTY_NR: snprintf(buffer, n, "%5u ", this->tty_nr); break;
- case TGID: snprintf(buffer, n, Process_pidFormat, this->tgid); break;
- case TPGID: snprintf(buffer, n, Process_tpgidFormat, this->tpgid); break;
- case MINFLT: Process_colorNumber(str, this->minflt, coloring); return;
- case CMINFLT: Process_colorNumber(str, this->cminflt, coloring); return;
- case MAJFLT: Process_colorNumber(str, this->majflt, coloring); return;
- case CMAJFLT: Process_colorNumber(str, this->cmajflt, coloring); return;
- case PROCESSOR: snprintf(buffer, n, "%3d ", ProcessList_cpuId(this->pl, this->processor)); break;
- case NLWP: snprintf(buffer, n, "%4ld ", this->nlwp); break;
+ case PERCENT_CPU: {
+ if (this->percent_cpu > 999.9) {
+ snprintf(buffer, n, "%4d ", (unsigned int)this->percent_cpu);
+ } else if (this->percent_cpu > 99.9) {
+ snprintf(buffer, n, "%3d. ", (unsigned int)this->percent_cpu);
+ } else {
+ snprintf(buffer, n, "%4.1f ", this->percent_cpu);
+ }
+ break;
+ }
+ case PERCENT_MEM: {
+ if (this->percent_mem > 99.9) {
+ snprintf(buffer, n, "100. ");
+ } else {
+ snprintf(buffer, n, "%4.1f ", this->percent_mem);
+ }
+ break;
+ }
case COMM: {
- if (this->pl->highlightThreads && Process_isThread(this)) {
+ if (this->settings->highlightThreads && Process_isThread(this)) {
attr = CRT_colors[PROCESS_THREAD];
baseattr = CRT_colors[PROCESS_THREAD_BASENAME];
}
- if (!this->pl->treeView || this->indent == 0) {
+ if (!this->settings->treeView || this->indent == 0) {
Process_writeCommand(this, attr, baseattr, str);
return;
} else {
char* buf = buffer;
int maxIndent = 0;
- const char **treeStr = this->pl->treeStr;
bool lastItem = (this->indent < 0);
int indent = (this->indent < 0 ? -this->indent : this->indent);
- if (treeStr == NULL)
- treeStr = ProcessList_treeStrAscii;
for (int i = 0; i < 32; i++)
if (indent & (1 << i))
@@ -512,26 +396,34 @@ static void Process_writeField(Process* this, RichString* str, ProcessField fiel
for (int i = 0; i < maxIndent - 1; i++) {
int written;
if (indent & (1 << i))
- written = snprintf(buf, n, "%s ", treeStr[TREE_STR_VERT]);
+ written = snprintf(buf, n, "%s ", CRT_treeStr[TREE_STR_VERT]);
else
written = snprintf(buf, n, " ");
buf += written;
n -= written;
}
- const char* draw = treeStr[lastItem ? (this->pl->direction == 1 ? TREE_STR_BEND : TREE_STR_TEND) : TREE_STR_RTEE];
- snprintf(buf, n, "%s%s ", draw, this->showChildren ? treeStr[TREE_STR_SHUT] : treeStr[TREE_STR_OPEN] );
+ const char* draw = CRT_treeStr[lastItem ? (this->settings->direction == 1 ? TREE_STR_BEND : TREE_STR_TEND) : TREE_STR_RTEE];
+ snprintf(buf, n, "%s%s ", draw, this->showChildren ? CRT_treeStr[TREE_STR_SHUT] : CRT_treeStr[TREE_STR_OPEN] );
RichString_append(str, CRT_colors[PROCESS_TREE], buffer);
Process_writeCommand(this, attr, baseattr, str);
return;
}
}
- case STATE: {
- snprintf(buffer, n, "%c ", this->state);
- attr = this->state == 'R'
- ? CRT_colors[PROCESS_R_STATE]
+ case MAJFLT: Process_colorNumber(str, this->majflt, coloring); return;
+ case MINFLT: Process_colorNumber(str, this->minflt, coloring); return;
+ case M_RESIDENT: Process_humanNumber(str, this->m_resident * PAGE_SIZE_KB, coloring); return;
+ case M_SIZE: Process_humanNumber(str, this->m_size * PAGE_SIZE_KB, coloring); return;
+ case NICE: {
+ snprintf(buffer, n, "%3ld ", this->nice);
+ attr = this->nice < 0 ? CRT_colors[PROCESS_HIGH_PRIORITY]
+ : this->nice > 0 ? CRT_colors[PROCESS_LOW_PRIORITY]
: attr;
break;
}
+ case NLWP: snprintf(buffer, n, "%4ld ", this->nlwp); break;
+ case PGRP: snprintf(buffer, n, Process_pidFormat, this->pgrp); break;
+ case PID: snprintf(buffer, n, Process_pidFormat, this->pid); break;
+ case PPID: snprintf(buffer, n, Process_pidFormat, this->ppid); break;
case PRIORITY: {
if(this->priority == -100)
snprintf(buffer, n, " RT ");
@@ -539,21 +431,26 @@ static void Process_writeField(Process* this, RichString* str, ProcessField fiel
snprintf(buffer, n, "%3ld ", this->priority);
break;
}
- case NICE: {
- snprintf(buffer, n, "%3ld ", this->nice);
- attr = this->nice < 0 ? CRT_colors[PROCESS_HIGH_PRIORITY]
- : this->nice > 0 ? CRT_colors[PROCESS_LOW_PRIORITY]
- : attr;
+ case PROCESSOR: snprintf(buffer, n, "%3d ", Settings_cpuId(this->settings, this->processor)); break;
+ case SESSION: snprintf(buffer, n, Process_pidFormat, this->session); break;
+ case STARTTIME: snprintf(buffer, n, "%s", this->starttime_show); break;
+ case STATE: {
+ snprintf(buffer, n, "%c ", this->state);
+ switch(this->state) {
+ case 'R':
+ attr = CRT_colors[PROCESS_R_STATE];
+ break;
+ case 'D':
+ attr = CRT_colors[PROCESS_D_STATE];
+ break;
+ }
break;
}
- case M_DRS: Process_humanNumber(str, this->m_drs * PAGE_SIZE_KB, coloring); return;
- case M_DT: Process_humanNumber(str, this->m_dt * PAGE_SIZE_KB, coloring); return;
- case M_LRS: Process_humanNumber(str, this->m_lrs * PAGE_SIZE_KB, coloring); return;
- case M_TRS: Process_humanNumber(str, this->m_trs * PAGE_SIZE_KB, coloring); return;
- case M_SIZE: Process_humanNumber(str, this->m_size * PAGE_SIZE_KB, coloring); return;
- case M_RESIDENT: Process_humanNumber(str, this->m_resident * PAGE_SIZE_KB, coloring); return;
- case M_SHARE: Process_humanNumber(str, this->m_share * PAGE_SIZE_KB, coloring); return;
case ST_UID: snprintf(buffer, n, "%4d ", this->st_uid); break;
+ case TIME: Process_printTime(str, this->time); return;
+ case TGID: snprintf(buffer, n, Process_pidFormat, this->tgid); break;
+ case TPGID: snprintf(buffer, n, Process_pidFormat, this->tpgid); break;
+ case TTY_NR: snprintf(buffer, n, "%5u ", this->tty_nr); break;
case USER: {
if (Process_getuid != (int) this->st_uid)
attr = CRT_colors[PROCESS_SHADOW];
@@ -568,128 +465,48 @@ static void Process_writeField(Process* this, RichString* str, ProcessField fiel
}
break;
}
- case UTIME: Process_printTime(str, this->utime); return;
- case STIME: Process_printTime(str, this->stime); return;
- case CUTIME: Process_printTime(str, this->cutime); return;
- case CSTIME: Process_printTime(str, this->cstime); return;
- case TIME: Process_printTime(str, this->utime + this->stime); return;
- case PERCENT_CPU: {
- if (this->percent_cpu > 999.9) {
- snprintf(buffer, n, "%4d ", (unsigned int)this->percent_cpu);
- } else if (this->percent_cpu > 99.9) {
- snprintf(buffer, n, "%3d. ", (unsigned int)this->percent_cpu);
- } else {
- snprintf(buffer, n, "%4.1f ", this->percent_cpu);
- }
- break;
- }
- case PERCENT_MEM: {
- if (this->percent_mem > 99.9) {
- snprintf(buffer, n, "100. ");
- } else {
- snprintf(buffer, n, "%4.1f ", this->percent_mem);
- }
- break;
- }
- case STARTTIME: snprintf(buffer, n, "%s", this->starttime_show); break;
- #ifdef HAVE_OPENVZ
- case CTID: snprintf(buffer, n, "%5u ", this->ctid); break;
- case VPID: snprintf(buffer, n, "%5u ", this->vpid); break;
- #endif
- #ifdef HAVE_VSERVER
- case VXID: snprintf(buffer, n, "%5u ", this->vxid); break;
- #endif
- #ifdef HAVE_TASKSTATS
- case RCHAR: Process_colorNumber(str, this->io_rchar, coloring); return;
- case WCHAR: Process_colorNumber(str, this->io_wchar, coloring); return;
- case SYSCR: Process_colorNumber(str, this->io_syscr, coloring); return;
- case SYSCW: Process_colorNumber(str, this->io_syscw, coloring); return;
- case RBYTES: Process_colorNumber(str, this->io_read_bytes, coloring); return;
- case WBYTES: Process_colorNumber(str, this->io_write_bytes, coloring); return;
- case CNCLWB: Process_colorNumber(str, this->io_cancelled_write_bytes, coloring); return;
- case IO_READ_RATE: Process_outputRate(str, attr, buffer, n, this->io_rate_read_bps, coloring); return;
- case IO_WRITE_RATE: Process_outputRate(str, attr, buffer, n, this->io_rate_write_bps, coloring); return;
- case IO_RATE: Process_outputRate(str, attr, buffer, n, this->io_rate_read_bps + this->io_rate_write_bps, coloring); return;
- #endif
- #ifdef HAVE_CGROUP
- case CGROUP: snprintf(buffer, n, "%-10s ", this->cgroup); break;
- #endif
- #ifdef HAVE_OOM
- case OOM: snprintf(buffer, n, Process_pidFormat, this->oom); break;
- #endif
- case IO_PRIORITY: {
- int klass = IOPriority_class(this->ioPriority);
- if (klass == IOPRIO_CLASS_NONE) {
- // see note [1] above
- snprintf(buffer, n, "B%1d ", (int) (this->nice + 20) / 5);
- } else if (klass == IOPRIO_CLASS_BE) {
- snprintf(buffer, n, "B%1d ", IOPriority_data(this->ioPriority));
- } else if (klass == IOPRIO_CLASS_RT) {
- attr = CRT_colors[PROCESS_HIGH_PRIORITY];
- snprintf(buffer, n, "R%1d ", IOPriority_data(this->ioPriority));
- } else if (this->ioPriority == IOPriority_Idle) {
- attr = CRT_colors[PROCESS_LOW_PRIORITY];
- snprintf(buffer, n, "id ");
- } else {
- snprintf(buffer, n, "?? ");
- }
- break;
- }
default:
snprintf(buffer, n, "- ");
}
RichString_append(str, attr, buffer);
}
-static void Process_display(Object* cast, RichString* out) {
+void Process_display(Object* cast, RichString* out) {
Process* this = (Process*) cast;
- ProcessField* fields = this->pl->fields;
+ ProcessField* fields = this->settings->fields;
RichString_prune(out);
for (int i = 0; fields[i]; i++)
- Process_writeField(this, out, fields[i]);
- if (this->pl->shadowOtherUsers && (int)this->st_uid != Process_getuid)
+ As_Process(this)->writeField(this, out, fields[i]);
+ if (this->settings->shadowOtherUsers && (int)this->st_uid != Process_getuid)
RichString_setAttr(out, CRT_colors[PROCESS_SHADOW]);
if (this->tag == true)
RichString_setAttr(out, CRT_colors[PROCESS_TAG]);
assert(out->chlen > 0);
}
-void Process_delete(Object* cast) {
- Process* this = (Process*) cast;
+void Process_done(Process* this) {
assert (this != NULL);
- if (this->comm) free(this->comm);
-#ifdef HAVE_CGROUP
- if (this->cgroup) free(this->cgroup);
-#endif
- free(this);
+ free(this->comm);
}
-ObjectClass Process_class = {
- .extends = Class(Object),
- .display = Process_display,
- .delete = Process_delete,
- .compare = Process_compare
+ProcessClass Process_class = {
+ .super = {
+ .extends = Class(Object),
+ .display = Process_display,
+ .delete = Process_delete,
+ .compare = Process_compare
+ },
+ .writeField = Process_writeField,
};
-Process* Process_new(struct ProcessList_ *pl) {
- Process* this = calloc(1, sizeof(Process));
- Object_setClass(this, Class(Process));
- this->pid = 0;
- this->pl = pl;
+void Process_init(Process* this, struct Settings_* settings) {
+ this->settings = settings;
this->tag = false;
this->showChildren = true;
this->show = true;
this->updated = false;
- this->utime = 0;
- this->stime = 0;
- this->comm = NULL;
this->basenameOffset = -1;
- this->indent = 0;
-#ifdef HAVE_CGROUP
- this->cgroup = NULL;
-#endif
if (Process_getuid == -1) Process_getuid = getuid();
- return this;
}
void Process_toggleTag(Process* this) {
@@ -697,8 +514,11 @@ void Process_toggleTag(Process* this) {
}
bool Process_setPriority(Process* this, int priority) {
+ uid_t euid = geteuid();
+ seteuid(getuid());
int old_prio = getpriority(PRIO_PROCESS, this->pid);
int err = setpriority(PRIO_PROCESS, this->pid, priority);
+ seteuid(euid);
if (err == 0 && old_prio != getpriority(PRIO_PROCESS, this->pid)) {
this->nice = priority;
}
@@ -709,193 +529,81 @@ bool Process_changePriorityBy(Process* this, size_t delta) {
return Process_setPriority(this, this->nice + delta);
}
-IOPriority Process_updateIOPriority(Process* this) {
- IOPriority ioprio = syscall(SYS_ioprio_get, IOPRIO_WHO_PROCESS, this->pid);
- this->ioPriority = ioprio;
- return ioprio;
-}
-
-bool Process_setIOPriority(Process* this, IOPriority ioprio) {
- syscall(SYS_ioprio_set, IOPRIO_WHO_PROCESS, this->pid, ioprio);
- return (Process_updateIOPriority(this) == ioprio);
-}
-
-/*
-[1] Note that before kernel 2.6.26 a process that has not asked for
-an io priority formally uses "none" as scheduling class, but the
-io scheduler will treat such processes as if it were in the best
-effort class. The priority within the best effort class will be
-dynamically derived from the cpu nice level of the process:
-io_priority = (cpu_nice + 20) / 5. -- From ionice(1) man page
-*/
-#define Process_effectiveIOPriority(p_) (IOPriority_class(p_->ioPriority) == IOPRIO_CLASS_NONE ? IOPriority_tuple(IOPRIO_CLASS_BE, (p_->nice + 20) / 5) : p_->ioPriority)
-
-#ifdef HAVE_LIBHWLOC
-
-Affinity* Process_getAffinity(Process* this) {
- hwloc_cpuset_t cpuset = hwloc_bitmap_alloc();
- bool ok = (hwloc_linux_get_tid_cpubind(this->pl->topology, this->pid, cpuset) == 0);
- Affinity* affinity = NULL;
- if (ok) {
- affinity = Affinity_new();
- if (hwloc_bitmap_last(cpuset) == -1) {
- for (int i = 0; i < this->pl->cpuCount; i++) {
- Affinity_add(affinity, i);
- }
- } else {
- unsigned int id;
- hwloc_bitmap_foreach_begin(id, cpuset);
- Affinity_add(affinity, id);
- hwloc_bitmap_foreach_end();
- }
- }
- hwloc_bitmap_free(cpuset);
- return affinity;
-}
-
-bool Process_setAffinity(Process* this, Affinity* affinity) {
- hwloc_cpuset_t cpuset = hwloc_bitmap_alloc();
- for (int i = 0; i < affinity->used; i++) {
- hwloc_bitmap_set(cpuset, affinity->cpus[i]);
- }
- bool ok = (hwloc_linux_set_tid_cpubind(this->pl->topology, this->pid, cpuset) == 0);
- hwloc_bitmap_free(cpuset);
- return ok;
-}
-
-#elif HAVE_NATIVE_AFFINITY
-
-Affinity* Process_getAffinity(Process* this) {
- cpu_set_t cpuset;
- bool ok = (sched_getaffinity(this->pid, sizeof(cpu_set_t), &cpuset) == 0);
- if (!ok) return NULL;
- Affinity* affinity = Affinity_new();
- for (int i = 0; i < this->pl->cpuCount; i++) {
- if (CPU_ISSET(i, &cpuset))
- Affinity_add(affinity, i);
- }
- return affinity;
-}
-
-bool Process_setAffinity(Process* this, Affinity* affinity) {
- cpu_set_t cpuset;
- CPU_ZERO(&cpuset);
- for (int i = 0; i < affinity->used; i++) {
- CPU_SET(affinity->cpus[i], &cpuset);
- }
- bool ok = (sched_setaffinity(this->pid, sizeof(unsigned long), &cpuset) == 0);
- return ok;
-}
-
-#endif
-
void Process_sendSignal(Process* this, size_t sgn) {
+ uid_t euid = geteuid();
+ seteuid(getuid());
kill(this->pid, (int) sgn);
+ seteuid(euid);
}
-int Process_pidCompare(const void* v1, const void* v2) {
+long Process_pidCompare(const void* v1, const void* v2) {
Process* p1 = (Process*)v1;
Process* p2 = (Process*)v2;
return (p1->pid - p2->pid);
}
-int Process_compare(const void* v1, const void* v2) {
+long Process_compare(const void* v1, const void* v2) {
Process *p1, *p2;
- ProcessList *pl = ((Process*)v1)->pl;
- if (pl->direction == 1) {
+ Settings *settings = ((Process*)v1)->settings;
+ if (settings->direction == 1) {
p1 = (Process*)v1;
p2 = (Process*)v2;
} else {
p2 = (Process*)v1;
p1 = (Process*)v2;
}
- long long diff;
- switch (pl->sortKey) {
+ switch (settings->sortKey) {
+ case PERCENT_CPU:
+ return (p2->percent_cpu > p1->percent_cpu ? 1 : -1);
+ case PERCENT_MEM:
+ return (p2->m_resident - p1->m_resident);
+ case COMM:
+ return strcmp(p1->comm, p2->comm);
+ case MAJFLT:
+ return (p2->majflt - p1->majflt);
+ case MINFLT:
+ return (p2->minflt - p1->minflt);
+ case M_RESIDENT:
+ return (p2->m_resident - p1->m_resident);
+ case M_SIZE:
+ return (p2->m_size - p1->m_size);
+ case NICE:
+ return (p1->nice - p2->nice);
+ case NLWP:
+ return (p1->nlwp - p2->nlwp);
+ case PGRP:
+ return (p1->pgrp - p2->pgrp);
case PID:
return (p1->pid - p2->pid);
case PPID:
return (p1->ppid - p2->ppid);
- case USER:
- return strcmp(p1->user ? p1->user : "", p2->user ? p2->user : "");
case PRIORITY:
return (p1->priority - p2->priority);
case PROCESSOR:
return (p1->processor - p2->processor);
case SESSION:
return (p1->session - p2->session);
- case STATE:
- return (p1->state - p2->state);
- case NICE:
- return (p1->nice - p2->nice);
- case M_DRS:
- return (p2->m_drs - p1->m_drs);
- case M_DT:
- return (p2->m_dt - p1->m_dt);
- case M_LRS:
- return (p2->m_lrs - p1->m_lrs);
- case M_TRS:
- return (p2->m_trs - p1->m_trs);
- case M_SIZE:
- return (p2->m_size - p1->m_size);
- case M_RESIDENT:
- return (p2->m_resident - p1->m_resident);
- case M_SHARE:
- return (p2->m_share - p1->m_share);
- case PERCENT_CPU:
- return (p2->percent_cpu > p1->percent_cpu ? 1 : -1);
- case PERCENT_MEM:
- return (p2->m_resident - p1->m_resident);
- case UTIME:
- return (p2->utime - p1->utime);
- case STIME:
- return (p2->stime - p1->stime);
- case TIME:
- return ((p2->utime+p2->stime) - (p1->utime+p1->stime));
- case COMM:
- return strcmp(p1->comm, p2->comm);
- case NLWP:
- return (p1->nlwp - p2->nlwp);
case STARTTIME: {
if (p1->starttime_ctime == p2->starttime_ctime)
return (p1->pid - p2->pid);
else
return (p1->starttime_ctime - p2->starttime_ctime);
}
- #ifdef HAVE_OPENVZ
- case CTID:
- return (p1->ctid - p2->ctid);
- case VPID:
- return (p1->vpid - p2->vpid);
- #endif
- #ifdef HAVE_VSERVER
- case VXID:
- return (p1->vxid - p2->vxid);
- #endif
- #ifdef HAVE_TASKSTATS
- case RCHAR: diff = p2->io_rchar - p1->io_rchar; goto test_diff;
- case WCHAR: diff = p2->io_wchar - p1->io_wchar; goto test_diff;
- case SYSCR: diff = p2->io_syscr - p1->io_syscr; goto test_diff;
- case SYSCW: diff = p2->io_syscw - p1->io_syscw; goto test_diff;
- case RBYTES: diff = p2->io_read_bytes - p1->io_read_bytes; goto test_diff;
- case WBYTES: diff = p2->io_write_bytes - p1->io_write_bytes; goto test_diff;
- case CNCLWB: diff = p2->io_cancelled_write_bytes - p1->io_cancelled_write_bytes; goto test_diff;
- case IO_READ_RATE: diff = p2->io_rate_read_bps - p1->io_rate_read_bps; goto test_diff;
- case IO_WRITE_RATE: diff = p2->io_rate_write_bps - p1->io_rate_write_bps; goto test_diff;
- case IO_RATE: diff = (p2->io_rate_read_bps + p2->io_rate_write_bps) - (p1->io_rate_read_bps + p1->io_rate_write_bps); goto test_diff;
- #endif
- #ifdef HAVE_CGROUP
- case CGROUP:
- return strcmp(p1->cgroup ? p1->cgroup : "", p2->cgroup ? p2->cgroup : "");
- #endif
- #ifdef HAVE_OOM
- case OOM:
- return (p1->oom - p2->oom);
- #endif
- case IO_PRIORITY:
- return Process_effectiveIOPriority(p1) - Process_effectiveIOPriority(p2);
+ case STATE:
+ return (p1->state - p2->state);
+ case ST_UID:
+ return (p1->st_uid - p2->st_uid);
+ case TIME:
+ return ((p2->time) - (p1->time));
+ case TGID:
+ return (p1->tgid - p2->tgid);
+ case TPGID:
+ return (p1->tpgid - p2->tpgid);
+ case TTY_NR:
+ return (p1->tty_nr - p2->tty_nr);
+ case USER:
+ return strcmp(p1->user ? p1->user : "", p2->user ? p2->user : "");
default:
return (p1->pid - p2->pid);
}
- test_diff:
- return (diff > 0) ? 1 : (diff < 0 ? -1 : 0);
}
diff --git a/Process.h b/Process.h
index 19083fd..c9aa3e1 100644
--- a/Process.h
+++ b/Process.h
@@ -4,15 +4,17 @@
#define HEADER_Process
/*
htop - Process.h
-(C) 2004-2011 Hisham H. Muhammad
+(C) 2004-2015 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
-#ifdef HAVE_LIBHWLOC
+#ifdef __ANDROID__
+#define SYS_ioprio_get __NR_ioprio_get
+#define SYS_ioprio_set __NR_ioprio_set
#endif
-// This works only with glibc 2.1+. On earlier versions
+// On Linux, this works only with glibc 2.1+. On earlier versions
// the behavior is similar to have a hardcoded page size.
#ifndef PAGE_SIZE
#define PAGE_SIZE ( sysconf(_SC_PAGESIZE) )
@@ -20,137 +22,87 @@ in the source distribution for its full text.
#define PAGE_SIZE_KB ( PAGE_SIZE / ONE_K )
#include "Object.h"
-#include "Affinity.h"
-#include "IOPriority.h"
-#include <sys/types.h>
-
-#define PROCESS_FLAG_IO 1
-#define PROCESS_FLAG_IOPRIO 2
-#define PROCESS_FLAG_OPENVZ 4
-#define PROCESS_FLAG_VSERVER 8
-#define PROCESS_FLAG_CGROUP 16
-
-#ifndef Process_isKernelThread
-#define Process_isKernelThread(_process) (_process->pgrp == 0)
-#endif
-
-#ifndef Process_isUserlandThread
-#define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
-#endif
-#ifndef Process_isThread
-#define Process_isThread(_process) (Process_isUserlandThread(_process) || Process_isKernelThread(_process))
-#endif
+#include <sys/types.h>
-typedef enum ProcessField_ {
- PID = 1, COMM, STATE, PPID, PGRP, SESSION, TTY_NR, TPGID, FLAGS, MINFLT, CMINFLT, MAJFLT, CMAJFLT, UTIME,
- STIME, CUTIME, CSTIME, PRIORITY, NICE, ITREALVALUE, STARTTIME, VSIZE, RSS, RLIM, STARTCODE, ENDCODE,
- STARTSTACK, KSTKESP, KSTKEIP, SIGNAL, BLOCKED, SSIGIGNORE, SIGCATCH, WCHAN, NSWAP, CNSWAP, EXIT_SIGNAL,
- PROCESSOR, M_SIZE, M_RESIDENT, M_SHARE, M_TRS, M_DRS, M_LRS, M_DT, ST_UID, PERCENT_CPU, PERCENT_MEM,
- USER, TIME, NLWP, TGID,
- #ifdef HAVE_OPENVZ
- CTID, VPID,
- #endif
- #ifdef HAVE_VSERVER
- VXID,
- #endif
- #ifdef HAVE_TASKSTATS
- RCHAR, WCHAR, SYSCR, SYSCW, RBYTES, WBYTES, CNCLWB, IO_READ_RATE, IO_WRITE_RATE, IO_RATE,
- #endif
- #ifdef HAVE_CGROUP
- CGROUP,
- #endif
- #ifdef HAVE_OOM
- OOM,
- #endif
- IO_PRIORITY,
- LAST_PROCESSFIELD
+#define PROCESS_FLAG_IO 0x0001
+
+typedef enum ProcessFields {
+ PID = 1,
+ COMM = 2,
+ STATE = 3,
+ PPID = 4,
+ PGRP = 5,
+ SESSION = 6,
+ TTY_NR = 7,
+ TPGID = 8,
+ MINFLT = 10,
+ MAJFLT = 12,
+ PRIORITY = 18,
+ NICE = 19,
+ STARTTIME = 21,
+ PROCESSOR = 38,
+ M_SIZE = 39,
+ M_RESIDENT = 40,
+ ST_UID = 46,
+ PERCENT_CPU = 47,
+ PERCENT_MEM = 48,
+ USER = 49,
+ TIME = 50,
+ NLWP = 51,
+ TGID = 52,
} ProcessField;
-struct ProcessList_;
+typedef struct ProcessPidColumn_ {
+ int id;
+ char* label;
+} ProcessPidColumn;
typedef struct Process_ {
Object super;
- struct ProcessList_ *pl;
+ struct Settings_* settings;
+ unsigned long long int time;
pid_t pid;
+ pid_t ppid;
+ pid_t tgid;
char* comm;
+ int commLen;
int indent;
+
+ int basenameOffset;
+ bool updated;
+
char state;
bool tag;
bool showChildren;
bool show;
- pid_t ppid;
unsigned int pgrp;
unsigned int session;
unsigned int tty_nr;
- pid_t tgid;
int tpgid;
+ uid_t st_uid;
unsigned long int flags;
+ int processor;
- uid_t st_uid;
float percent_cpu;
float percent_mem;
char* user;
- unsigned long long int utime;
- unsigned long long int stime;
- unsigned long long int cutime;
- unsigned long long int cstime;
long int priority;
long int nice;
long int nlwp;
- IOPriority ioPriority;
char starttime_show[8];
time_t starttime_ctime;
- #ifdef HAVE_TASKSTATS
- unsigned long long io_rchar;
- unsigned long long io_wchar;
- unsigned long long io_syscr;
- unsigned long long io_syscw;
- unsigned long long io_read_bytes;
- unsigned long long io_write_bytes;
- unsigned long long io_cancelled_write_bytes;
- double io_rate_read_bps;
- unsigned long long io_rate_read_time;
- double io_rate_write_bps;
- unsigned long long io_rate_write_time;
- #endif
-
- int processor;
long m_size;
long m_resident;
- long m_share;
- long m_trs;
- long m_drs;
- long m_lrs;
- long m_dt;
-
- #ifdef HAVE_OPENVZ
- unsigned int ctid;
- unsigned int vpid;
- #endif
- #ifdef HAVE_VSERVER
- unsigned int vxid;
- #endif
-
- #ifdef HAVE_CGROUP
- char* cgroup;
- #endif
- #ifdef HAVE_OOM
- unsigned int oom;
- #endif
int exit_signal;
- int basenameOffset;
- bool updated;
unsigned long int minflt;
- unsigned long int cminflt;
unsigned long int majflt;
- unsigned long int cmajflt;
#ifdef DEBUG
long int itrealvalue;
unsigned long int vsize;
@@ -172,15 +124,32 @@ typedef struct Process_ {
} Process;
+typedef struct ProcessFieldData_ {
+ const char* name;
+ const char* title;
+ const char* description;
+ int flags;
+} ProcessFieldData;
-extern const char *Process_fieldNames[];
+// Implemented in platform-specific code:
+void Process_writeField(Process* this, RichString* str, ProcessField field);
+long Process_compare(const void* v1, const void* v2);
+void Process_delete(Object* cast);
+bool Process_isThread(Process* this);
+extern ProcessFieldData Process_fields[];
+extern ProcessPidColumn Process_pidColumns[];
+extern char Process_pidFormat[20];
-extern const int Process_fieldFlags[];
+typedef Process*(*Process_New)(struct Settings_*);
+typedef void (*Process_WriteField)(Process*, RichString*, ProcessField);
-extern const char *Process_fieldTitles[];
+typedef struct ProcessClass_ {
+ const ObjectClass super;
+ const Process_WriteField writeField;
+} ProcessClass;
+#define As_Process(this_) ((ProcessClass*)((this_)->super.klass))
-void Process_getMaxPid();
#define ONE_K 1024L
#define ONE_M (ONE_K * ONE_K)
@@ -190,50 +159,38 @@ void Process_getMaxPid();
#define ONE_DECIMAL_M (ONE_DECIMAL_K * ONE_DECIMAL_K)
#define ONE_DECIMAL_G (ONE_DECIMAL_M * ONE_DECIMAL_K)
-void Process_delete(Object* cast);
+extern char Process_pidFormat[20];
-extern ObjectClass Process_class;
+void Process_setupColumnWidths();
-Process* Process_new(struct ProcessList_ *pl);
+void Process_humanNumber(RichString* str, unsigned long number, bool coloring);
-void Process_toggleTag(Process* this);
-
-bool Process_setPriority(Process* this, int priority);
+void Process_colorNumber(RichString* str, unsigned long long number, bool coloring);
-bool Process_changePriorityBy(Process* this, size_t delta);
+void Process_printTime(RichString* str, unsigned long long totalHundredths);
-IOPriority Process_updateIOPriority(Process* this);
+void Process_outputRate(RichString* str, char* buffer, int n, double rate, int coloring);
-bool Process_setIOPriority(Process* this, IOPriority ioprio);
+void Process_writeField(Process* this, RichString* str, ProcessField field);
-/*
-[1] Note that before kernel 2.6.26 a process that has not asked for
-an io priority formally uses "none" as scheduling class, but the
-io scheduler will treat such processes as if it were in the best
-effort class. The priority within the best effort class will be
-dynamically derived from the cpu nice level of the process:
-extern io_priority;
-*/
-#define Process_effectiveIOPriority(p_) (IOPriority_class(p_->ioPriority) == IOPRIO_CLASS_NONE ? IOPriority_tuple(IOPRIO_CLASS_BE, (p_->nice + 20) / 5) : p_->ioPriority)
+void Process_display(Object* cast, RichString* out);
-#ifdef HAVE_LIBHWLOC
+void Process_done(Process* this);
-Affinity* Process_getAffinity(Process* this);
+extern ProcessClass Process_class;
-bool Process_setAffinity(Process* this, Affinity* affinity);
+void Process_init(Process* this, struct Settings_* settings);
-#elif HAVE_NATIVE_AFFINITY
-
-Affinity* Process_getAffinity(Process* this);
+void Process_toggleTag(Process* this);
-bool Process_setAffinity(Process* this, Affinity* affinity);
+bool Process_setPriority(Process* this, int priority);
-#endif
+bool Process_changePriorityBy(Process* this, size_t delta);
void Process_sendSignal(Process* this, size_t sgn);
-int Process_pidCompare(const void* v1, const void* v2);
+long Process_pidCompare(const void* v1, const void* v2);
-int Process_compare(const void* v1, const void* v2);
+long Process_compare(const void* v1, const void* v2);
#endif
diff --git a/ProcessList.c b/ProcessList.c
index d362115..5f5151f 100644
--- a/ProcessList.c
+++ b/ProcessList.c
@@ -6,27 +6,13 @@ in the source distribution for its full text.
*/
#include "ProcessList.h"
+#include "Platform.h"
#include "CRT.h"
-#include "String.h"
+#include "StringUtils.h"
-#include <sys/time.h>
-#include <sys/utsname.h>
-#include <sys/stat.h>
-#include <unistd.h>
-#include <dirent.h>
#include <stdlib.h>
-#include <stdio.h>
-#include <signal.h>
-#include <stdbool.h>
-#include <stdarg.h>
-#include <math.h>
#include <string.h>
-#include <time.h>
-#include <assert.h>
-#include <sys/types.h>
-#include <fcntl.h>
-#include <errno.h>
/*{
#include "Vector.h"
@@ -34,18 +20,7 @@ in the source distribution for its full text.
#include "UsersTable.h"
#include "Panel.h"
#include "Process.h"
-
-#ifndef PROCDIR
-#define PROCDIR "/proc"
-#endif
-
-#ifndef PROCSTATFILE
-#define PROCSTATFILE PROCDIR "/stat"
-#endif
-
-#ifndef PROCMEMINFOFILE
-#define PROCMEMINFOFILE PROCDIR "/meminfo"
-#endif
+#include "Settings.h"
#ifndef MAX_NAME
#define MAX_NAME 128
@@ -55,51 +30,9 @@ in the source distribution for its full text.
#define MAX_READ 2048
#endif
-#ifndef ProcessList_cpuId
-#define ProcessList_cpuId(pl, cpu) ((pl)->countCPUsFromZero ? (cpu) : (cpu)+1)
-#endif
-
-typedef enum TreeStr_ {
- TREE_STR_HORZ,
- TREE_STR_VERT,
- TREE_STR_RTEE,
- TREE_STR_BEND,
- TREE_STR_TEND,
- TREE_STR_OPEN,
- TREE_STR_SHUT,
- TREE_STR_COUNT
-} TreeStr;
-
-typedef struct CPUData_ {
- unsigned long long int totalTime;
- unsigned long long int userTime;
- unsigned long long int systemTime;
- unsigned long long int systemAllTime;
- unsigned long long int idleAllTime;
- unsigned long long int idleTime;
- unsigned long long int niceTime;
- unsigned long long int ioWaitTime;
- unsigned long long int irqTime;
- unsigned long long int softIrqTime;
- unsigned long long int stealTime;
- unsigned long long int guestTime;
-
- unsigned long long int totalPeriod;
- unsigned long long int userPeriod;
- unsigned long long int systemPeriod;
- unsigned long long int systemAllPeriod;
- unsigned long long int idleAllPeriod;
- unsigned long long int idlePeriod;
- unsigned long long int nicePeriod;
- unsigned long long int ioWaitPeriod;
- unsigned long long int irqPeriod;
- unsigned long long int softIrqPeriod;
- unsigned long long int stealPeriod;
- unsigned long long int guestPeriod;
-} CPUData;
-
typedef struct ProcessList_ {
- const char **treeStr;
+ Settings* settings;
+
Vector* processes;
Vector* processes2;
Hashtable* processTable;
@@ -111,17 +44,15 @@ typedef struct ProcessList_ {
const char* incFilter;
Hashtable* pidWhiteList;
- int cpuCount;
- int totalTasks;
- int userlandThreads;
- int kernelThreads;
- int runningTasks;
-
#ifdef HAVE_LIBHWLOC
hwloc_topology_t topology;
bool topologyOk;
#endif
- CPUData* cpus;
+
+ int totalTasks;
+ int runningTasks;
+ int userlandThreads;
+ int kernelThreads;
unsigned long long int totalMem;
unsigned long long int usedMem;
@@ -133,91 +64,28 @@ typedef struct ProcessList_ {
unsigned long long int usedSwap;
unsigned long long int freeSwap;
- int flags;
- ProcessField* fields;
- ProcessField sortKey;
- int direction;
- bool hideThreads;
- bool shadowOtherUsers;
- bool showThreadNames;
- bool showingThreadNames;
- bool hideKernelThreads;
- bool hideUserlandThreads;
- bool treeView;
- bool highlightBaseName;
- bool highlightMegabytes;
- bool highlightThreads;
- bool detailedCPUTime;
- bool countCPUsFromZero;
- bool updateProcessNames;
- bool accountGuestInCPUMeter;
- bool userOnly;
+ int cpuCount;
} ProcessList;
-}*/
-
-static ProcessField defaultHeaders[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, M_SHARE, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 };
+ProcessList* ProcessList_new(UsersTable* ut, Hashtable* pidWhiteList, uid_t userId);
+void ProcessList_delete(ProcessList* pl);
+void ProcessList_goThroughEntries(ProcessList* pl);
-const char *ProcessList_treeStrAscii[TREE_STR_COUNT] = {
- "-", // TREE_STR_HORZ
- "|", // TREE_STR_VERT
- "`", // TREE_STR_RTEE
- "`", // TREE_STR_BEND
- ",", // TREE_STR_TEND
- "+", // TREE_STR_OPEN
- "-", // TREE_STR_SHUT
-};
-
-const char *ProcessList_treeStrUtf8[TREE_STR_COUNT] = {
- "\xe2\x94\x80", // TREE_STR_HORZ ─
- "\xe2\x94\x82", // TREE_STR_VERT │
- "\xe2\x94\x9c", // TREE_STR_RTEE ├
- "\xe2\x94\x94", // TREE_STR_BEND └
- "\xe2\x94\x8c", // TREE_STR_TEND ┌
- "+", // TREE_STR_OPEN +
- "\xe2\x94\x80", // TREE_STR_SHUT ─
-};
-
-static ssize_t xread(int fd, void *buf, size_t count) {
- // Read some bytes. Retry on EINTR and when we don't get as many bytes as we requested.
- size_t alreadyRead = 0;
- for(;;) {
- ssize_t res = read(fd, buf, count);
- if (res == -1 && errno == EINTR) continue;
- if (res > 0) {
- buf = ((char*)buf)+res;
- count -= res;
- alreadyRead += res;
- }
- if (res == -1) return -1;
- if (count == 0 || res == 0) return alreadyRead;
- }
-}
+}*/
-ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList) {
- ProcessList* this;
- this = calloc(1, sizeof(ProcessList));
- this->processes = Vector_new(Class(Process), true, DEFAULT_SIZE);
+ProcessList* ProcessList_init(ProcessList* this, ObjectClass* klass, UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) {
+ this->processes = Vector_new(klass, true, DEFAULT_SIZE);
this->processTable = Hashtable_new(140, false);
this->usersTable = usersTable;
this->pidWhiteList = pidWhiteList;
+ this->userId = userId;
- /* tree-view auxiliary buffers */
- this->processes2 = Vector_new(Class(Process), true, DEFAULT_SIZE);
+ // tree-view auxiliary buffer
+ this->processes2 = Vector_new(klass, true, DEFAULT_SIZE);
- FILE* file = fopen(PROCSTATFILE, "r");
- if (file == NULL) {
- CRT_fatalError("Cannot open " PROCSTATFILE);
- }
- char buffer[256];
- int cpus = -1;
- do {
- cpus++;
- fgets(buffer, 255, file);
- } while (String_startsWith(buffer, "cpu"));
- fclose(file);
- this->cpuCount = MAX(cpus - 1, 1);
+ // set later by platform-specific code
+ this->cpuCount = 0;
#ifdef HAVE_LIBHWLOC
this->topologyOk = false;
@@ -229,77 +97,36 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList) {
this->topologyOk = true;
}
#endif
- this->cpus = calloc(cpus, sizeof(CPUData));
-
- for (int i = 0; i < cpus; i++) {
- this->cpus[i].totalTime = 1;
- this->cpus[i].totalPeriod = 1;
- }
- this->fields = calloc(LAST_PROCESSFIELD+1, sizeof(ProcessField));
- // TODO: turn 'fields' into a Vector,
- // (and ProcessFields into proper objects).
- this->flags = 0;
- for (int i = 0; defaultHeaders[i]; i++) {
- this->fields[i] = defaultHeaders[i];
- this->fields[i] |= Process_fieldFlags[defaultHeaders[i]];
- }
- this->sortKey = PERCENT_CPU;
- this->direction = 1;
- this->hideThreads = false;
- this->shadowOtherUsers = false;
- this->showThreadNames = false;
- this->showingThreadNames = false;
- this->hideKernelThreads = false;
- this->hideUserlandThreads = false;
- this->treeView = false;
- this->highlightBaseName = false;
- this->highlightMegabytes = false;
- this->detailedCPUTime = false;
- this->countCPUsFromZero = false;
- this->updateProcessNames = false;
- this->treeStr = NULL;
this->following = -1;
- if (CRT_utf8)
- this->treeStr = CRT_utf8 ? ProcessList_treeStrUtf8 : ProcessList_treeStrAscii;
-
return this;
}
-void ProcessList_delete(ProcessList* this) {
+void ProcessList_done(ProcessList* this) {
Hashtable_delete(this->processTable);
Vector_delete(this->processes);
Vector_delete(this->processes2);
- free(this->cpus);
- free(this->fields);
- free(this);
}
void ProcessList_setPanel(ProcessList* this, Panel* panel) {
this->panel = panel;
}
-void ProcessList_invertSortOrder(ProcessList* this) {
- if (this->direction == 1)
- this->direction = -1;
- else
- this->direction = 1;
-}
-
void ProcessList_printHeader(ProcessList* this, RichString* header) {
RichString_prune(header);
- ProcessField* fields = this->fields;
+ ProcessField* fields = this->settings->fields;
for (int i = 0; fields[i]; i++) {
- const char* field = Process_fieldTitles[fields[i]];
- if (!this->treeView && this->sortKey == fields[i])
- RichString_append(header, CRT_colors[PANEL_HIGHLIGHT_FOCUS], field);
+ const char* field = Process_fields[fields[i]].title;
+ if (!field) field = "- ";
+ if (!this->settings->treeView && this->settings->sortKey == fields[i])
+ RichString_append(header, CRT_colors[PANEL_SELECTION_FOCUS], field);
else
RichString_append(header, CRT_colors[PANEL_HEADER_FOCUS], field);
}
}
-static void ProcessList_add(ProcessList* this, Process* p) {
+void ProcessList_add(ProcessList* this, Process* p) {
assert(Vector_indexOf(this->processes, p, Process_pidCompare) == -1);
assert(Hashtable_get(this->processTable, p->pid) == NULL);
@@ -311,7 +138,7 @@ static void ProcessList_add(ProcessList* this, Process* p) {
assert(Hashtable_count(this->processTable) == Vector_count(this->processes));
}
-static void ProcessList_remove(ProcessList* this, Process* p) {
+void ProcessList_remove(ProcessList* this, Process* p) {
assert(Vector_indexOf(this->processes, p, Process_pidCompare) != -1);
assert(Hashtable_get(this->processTable, p->pid) != NULL);
Process* pp = Hashtable_remove(this->processTable, p->pid);
@@ -337,7 +164,7 @@ static void ProcessList_buildTree(ProcessList* this, pid_t pid, int level, int i
for (int i = Vector_size(this->processes) - 1; i >= 0; i--) {
Process* process = (Process*) (Vector_get(this->processes, i));
- if (process->tgid == pid || (process->tgid == process->pid && process->ppid == pid)) {
+ if (process->show && (process->tgid == pid || (process->tgid == process->pid && process->ppid == pid))) {
process = (Process*) (Vector_take(this->processes, i));
Vector_add(children, process);
}
@@ -364,22 +191,23 @@ static void ProcessList_buildTree(ProcessList* this, pid_t pid, int level, int i
}
void ProcessList_sort(ProcessList* this) {
- if (!this->treeView) {
+ if (!this->settings->treeView) {
Vector_insertionSort(this->processes);
} else {
// Save settings
- int direction = this->direction;
- int sortKey = this->sortKey;
+ int direction = this->settings->direction;
+ int sortKey = this->settings->sortKey;
// Sort by PID
- this->sortKey = PID;
- this->direction = 1;
+ this->settings->sortKey = PID;
+ this->settings->direction = 1;
Vector_quickSort(this->processes);
// Restore settings
- this->sortKey = sortKey;
- this->direction = direction;
+ this->settings->sortKey = sortKey;
+ this->settings->direction = direction;
// Take PID 1 as root and add to the new listing
int vsize = Vector_size(this->processes);
Process* init = (Process*) (Vector_take(this->processes, 0));
+ if (!init) return;
// This assertion crashes on hardened kernels.
// I wonder how well tree view works on those systems.
// assert(init->pid == 1);
@@ -403,629 +231,15 @@ void ProcessList_sort(ProcessList* this) {
}
}
-static bool ProcessList_readStatFile(Process *process, const char* dirname, const char* name, char* command) {
- char filename[MAX_NAME+1];
- snprintf(filename, MAX_NAME, "%s/%s/stat", dirname, name);
- int fd = open(filename, O_RDONLY);
- if (fd == -1)
- return false;
-
- static char buf[MAX_READ+1];
-
- int size = xread(fd, buf, MAX_READ);
- close(fd);
- if (size <= 0) return false;
- buf[size] = '\0';
-
- assert(process->pid == atoi(buf));
- char *location = strchr(buf, ' ');
- if (!location) return false;
-
- location += 2;
- char *end = strrchr(location, ')');
- if (!end) return false;
-
- int commsize = end - location;
- memcpy(command, location, commsize);
- command[commsize] = '\0';
- location = end + 2;
-
- process->state = location[0];
- location += 2;
- process->ppid = strtol(location, &location, 10);
- location += 1;
- process->pgrp = strtoul(location, &location, 10);
- location += 1;
- process->session = strtoul(location, &location, 10);
- location += 1;
- process->tty_nr = strtoul(location, &location, 10);
- location += 1;
- process->tpgid = strtol(location, &location, 10);
- location += 1;
- process->flags = strtoul(location, &location, 10);
- location += 1;
- process->minflt = strtoull(location, &location, 10);
- location += 1;
- process->cminflt = strtoull(location, &location, 10);
- location += 1;
- process->majflt = strtoull(location, &location, 10);
- location += 1;
- process->cmajflt = strtoull(location, &location, 10);
- location += 1;
- process->utime = strtoull(location, &location, 10);
- location += 1;
- process->stime = strtoull(location, &location, 10);
- location += 1;
- process->cutime = strtoull(location, &location, 10);
- location += 1;
- process->cstime = strtoull(location, &location, 10);
- location += 1;
- process->priority = strtol(location, &location, 10);
- location += 1;
- process->nice = strtol(location, &location, 10);
- location += 1;
- process->nlwp = strtol(location, &location, 10);
- location += 1;
- for (int i=0; i<17; i++) location = strchr(location, ' ')+1;
- process->exit_signal = strtol(location, &location, 10);
- location += 1;
- assert(location != NULL);
- process->processor = strtol(location, &location, 10);
- assert(location == NULL);
-
- return true;
-}
-
-static bool ProcessList_statProcessDir(Process* process, const char* dirname, char* name, time_t curTime) {
- char filename[MAX_NAME+1];
- filename[MAX_NAME] = '\0';
-
- snprintf(filename, MAX_NAME, "%s/%s", dirname, name);
- struct stat sstat;
- int statok = stat(filename, &sstat);
- if (statok == -1)
- return false;
- process->st_uid = sstat.st_uid;
-
- struct tm date;
- time_t ctime = sstat.st_ctime;
- process->starttime_ctime = ctime;
- (void) localtime_r((time_t*) &ctime, &date);
- strftime(process->starttime_show, 7, ((ctime > curTime - 86400) ? "%R " : "%b%d "), &date);
-
- return true;
-}
-
-#ifdef HAVE_TASKSTATS
-
-static void ProcessList_readIoFile(Process* process, const char* dirname, char* name, unsigned long long now) {
- char filename[MAX_NAME+1];
- filename[MAX_NAME] = '\0';
-
- snprintf(filename, MAX_NAME, "%s/%s/io", dirname, name);
- int fd = open(filename, O_RDONLY);
- if (fd == -1)
- return;
-
- char buffer[1024];
- ssize_t buflen = xread(fd, buffer, 1023);
- close(fd);
- if (buflen < 1) return;
- buffer[buflen] = '\0';
- unsigned long long last_read = process->io_read_bytes;
- unsigned long long last_write = process->io_write_bytes;
- char *buf = buffer;
- char *line = NULL;
- while ((line = strsep(&buf, "\n")) != NULL) {
- switch (line[0]) {
- case 'r':
- if (line[1] == 'c' && strncmp(line+2, "har: ", 5) == 0)
- process->io_rchar = strtoull(line+7, NULL, 10);
- else if (strncmp(line+1, "ead_bytes: ", 11) == 0) {
- process->io_read_bytes = strtoull(line+12, NULL, 10);
- process->io_rate_read_bps =
- ((double)(process->io_read_bytes - last_read))/(((double)(now - process->io_rate_read_time))/1000);
- process->io_rate_read_time = now;
- }
- break;
- case 'w':
- if (line[1] == 'c' && strncmp(line+2, "har: ", 5) == 0)
- process->io_wchar = strtoull(line+7, NULL, 10);
- else if (strncmp(line+1, "rite_bytes: ", 12) == 0) {
- process->io_write_bytes = strtoull(line+13, NULL, 10);
- process->io_rate_write_bps =
- ((double)(process->io_write_bytes - last_write))/(((double)(now - process->io_rate_write_time))/1000);
- process->io_rate_write_time = now;
- }
- break;
- case 's':
- if (line[5] == 'r' && strncmp(line+1, "yscr: ", 6) == 0)
- process->io_syscr = strtoull(line+7, NULL, 10);
- else if (strncmp(line+1, "yscw: ", 6) == 0)
- sscanf(line, "syscw: %32llu", &process->io_syscw);
- process->io_syscw = strtoull(line+7, NULL, 10);
- break;
- case 'c':
- if (strncmp(line+1, "ancelled_write_bytes: ", 22) == 0)
- process->io_cancelled_write_bytes = strtoull(line+23, NULL, 10);
- }
- }
-}
-
-#endif
-
-static bool ProcessList_readStatmFile(Process* process, const char* dirname, const char* name) {
- char filename[MAX_NAME+1];
- snprintf(filename, MAX_NAME, "%s/%s/statm", dirname, name);
- int fd = open(filename, O_RDONLY);
- if (fd == -1)
- return false;
- char buf[256];
- ssize_t rres = xread(fd, buf, 255);
- close(fd);
- if (rres < 1) return false;
-
- char *p = buf;
- errno = 0;
- process->m_size = strtol(p, &p, 10); if (*p == ' ') p++;
- process->m_resident = strtol(p, &p, 10); if (*p == ' ') p++;
- process->m_share = strtol(p, &p, 10); if (*p == ' ') p++;
- process->m_trs = strtol(p, &p, 10); if (*p == ' ') p++;
- process->m_lrs = strtol(p, &p, 10); if (*p == ' ') p++;
- process->m_drs = strtol(p, &p, 10); if (*p == ' ') p++;
- process->m_dt = strtol(p, &p, 10);
- return (errno == 0);
-}
-
-#ifdef HAVE_OPENVZ
-
-static void ProcessList_readOpenVZData(Process* process, const char* dirname, const char* name) {
- if (access("/proc/vz", R_OK) != 0) {
- process->vpid = process->pid;
- process->ctid = 0;
- return;
- }
- char filename[MAX_NAME+1];
- snprintf(filename, MAX_NAME, "%s/%s/stat", dirname, name);
- FILE* file = fopen(filename, "r");
- if (!file)
- return;
- fscanf(file,
- "%*32u %*32s %*1c %*32u %*32u %*32u %*32u %*32u %*32u %*32u "
- "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u "
- "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u "
- "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u "
- "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u "
- "%*32u %*32u %*32u %*32u %*32u %*32u %*32u "
- "%*32u %*32u %32u %32u",
- &process->vpid, &process->ctid);
- fclose(file);
-}
-
-#endif
-
-#ifdef HAVE_CGROUP
-
-static void ProcessList_readCGroupFile(Process* process, const char* dirname, const char* name) {
- char filename[MAX_NAME+1];
- snprintf(filename, MAX_NAME, "%s/%s/cgroup", dirname, name);
- FILE* file = fopen(filename, "r");
- if (!file) {
- process->cgroup = strdup("");
- return;
- }
- char buffer[256];
- char *ok = fgets(buffer, 255, file);
- if (ok) {
- char* trimmed = String_trim(buffer);
- int nFields;
- char** fields = String_split(trimmed, ':', &nFields);
- free(trimmed);
- if (nFields >= 3) {
- process->cgroup = strndup(fields[2] + 1, 10);
- } else {
- process->cgroup = strdup("");
- }
- String_freeArray(fields);
- }
- fclose(file);
-}
-
-#endif
-
-#ifdef HAVE_VSERVER
-
-static void ProcessList_readVServerData(Process* process, const char* dirname, const char* name) {
- char filename[MAX_NAME+1];
- snprintf(filename, MAX_NAME, "%s/%s/status", dirname, name);
- FILE* file = fopen(filename, "r");
- if (!file)
- return;
- char buffer[256];
- process->vxid = 0;
- while (fgets(buffer, 255, file)) {
- if (String_startsWith(buffer, "VxID:")) {
- int vxid;
- int ok = sscanf(buffer, "VxID:\t%32d", &vxid);
- if (ok >= 1) {
- process->vxid = vxid;
- }
- }
- #if defined HAVE_ANCIENT_VSERVER
- else if (String_startsWith(buffer, "s_context:")) {
- int vxid;
- int ok = sscanf(buffer, "s_context:\t%32d", &vxid);
- if (ok >= 1) {
- process->vxid = vxid;
- }
- }
- #endif
- }
- fclose(file);
-}
-
-#endif
-
-#ifdef HAVE_OOM
-
-static void ProcessList_readOomData(Process* process, const char* dirname, const char* name) {
- char filename[MAX_NAME+1];
- snprintf(filename, MAX_NAME, "%s/%s/oom_score", dirname, name);
- FILE* file = fopen(filename, "r");
- if (!file)
- return;
- char buffer[256];
- if (fgets(buffer, 255, file)) {
- unsigned int oom;
- int ok = sscanf(buffer, "%32u", &oom);
- if (ok >= 1) {
- process->oom = oom;
- }
- }
- fclose(file);
-}
-
-#endif
-
-static bool ProcessList_readCmdlineFile(Process* process, const char* dirname, const char* name) {
- if (Process_isKernelThread(process))
- return true;
-
- char filename[MAX_NAME+1];
- snprintf(filename, MAX_NAME, "%s/%s/cmdline", dirname, name);
- int fd = open(filename, O_RDONLY);
- if (fd == -1)
- return false;
-
- char command[4096+1]; // max cmdline length on Linux
- int amtRead = xread(fd, command, sizeof(command) - 1);
- close(fd);
- int tokenEnd = 0;
- if (amtRead > 0) {
- for (int i = 0; i < amtRead; i++)
- if (command[i] == '\0' || command[i] == '\n') {
- if (tokenEnd == 0) {
- tokenEnd = i;
- }
- command[i] = ' ';
- }
- }
- if (tokenEnd == 0) {
- tokenEnd = amtRead;
- }
- command[amtRead] = '\0';
- free(process->comm);
- process->comm = strdup(command);
- process->basenameOffset = tokenEnd;
-
- return true;
-}
-
-
-static bool ProcessList_processEntries(ProcessList* this, const char* dirname, Process* parent, double period, struct timeval tv) {
- DIR* dir;
- struct dirent* entry;
-
- time_t curTime = tv.tv_sec;
- #ifdef HAVE_TASKSTATS
- unsigned long long now = tv.tv_sec*1000LL+tv.tv_usec/1000LL;
- #endif
-
- dir = opendir(dirname);
- if (!dir) return false;
- int cpus = this->cpuCount;
- bool hideKernelThreads = this->hideKernelThreads;
- bool hideUserlandThreads = this->hideUserlandThreads;
- while ((entry = readdir(dir)) != NULL) {
- char* name = entry->d_name;
-
- // The RedHat kernel hides threads with a dot.
- // I believe this is non-standard.
- if ((!this->hideThreads) && name[0] == '.') {
- name++;
- }
-
- // Just skip all non-number directories.
- if (name[0] < '0' || name[0] > '9') {
- continue;
- }
-
- // filename is a number: process directory
- int pid = atoi(name);
-
- if (parent && pid == parent->pid)
- continue;
-
- if (pid <= 0)
- continue;
-
- Process* process = NULL;
- Process* existingProcess = (Process*) Hashtable_get(this->processTable, pid);
-
- if (existingProcess) {
- assert(Vector_indexOf(this->processes, existingProcess, Process_pidCompare) != -1);
- process = existingProcess;
- assert(process->pid == pid);
- } else {
- process = Process_new(this);
- assert(process->comm == NULL);
- process->pid = pid;
- process->tgid = parent ? parent->pid : pid;
- }
-
- char subdirname[MAX_NAME+1];
- snprintf(subdirname, MAX_NAME, "%s/%s/task", dirname, name);
- ProcessList_processEntries(this, subdirname, process, period, tv);
-
- #ifdef HAVE_TASKSTATS
- if (this->flags & PROCESS_FLAG_IO)
- ProcessList_readIoFile(process, dirname, name, now);
- #endif
-
- if (! ProcessList_readStatmFile(process, dirname, name))
- goto errorReadingProcess;
-
- process->show = ! ((hideKernelThreads && Process_isKernelThread(process)) || (hideUserlandThreads && Process_isUserlandThread(process)));
-
- char command[MAX_NAME+1];
- unsigned long long int lasttimes = (process->utime + process->stime);
- if (! ProcessList_readStatFile(process, dirname, name, command))
- goto errorReadingProcess;
- if (this->flags & PROCESS_FLAG_IOPRIO)
- Process_updateIOPriority(process);
- float percent_cpu = (process->utime + process->stime - lasttimes) / period * 100.0;
- process->percent_cpu = MAX(MIN(percent_cpu, cpus*100.0), 0.0);
- if (isnan(process->percent_cpu)) process->percent_cpu = 0.0;
- process->percent_mem = (process->m_resident * PAGE_SIZE_KB) / (double)(this->totalMem) * 100.0;
-
- if(!existingProcess) {
-
- if (! ProcessList_statProcessDir(process, dirname, name, curTime))
- goto errorReadingProcess;
-
- process->user = UsersTable_getRef(this->usersTable, process->st_uid);
-
- #ifdef HAVE_OPENVZ
- if (this->flags & PROCESS_FLAG_OPENVZ)
- ProcessList_readOpenVZData(process, dirname, name);
- #endif
-
- #ifdef HAVE_CGROUP
- if (this->flags & PROCESS_FLAG_CGROUP)
- ProcessList_readCGroupFile(process, dirname, name);
- #endif
-
- #ifdef HAVE_VSERVER
- if (this->flags & PROCESS_FLAG_VSERVER)
- ProcessList_readVServerData(process, dirname, name);
- #endif
-
- #ifdef HAVE_OOM
- ProcessList_readOomData(process, dirname, name);
- #endif
-
- if (! ProcessList_readCmdlineFile(process, dirname, name))
- goto errorReadingProcess;
-
- ProcessList_add(this, process);
- } else {
- if (this->updateProcessNames) {
- if (! ProcessList_readCmdlineFile(process, dirname, name))
- goto errorReadingProcess;
- }
- }
-
- if (process->state == 'Z') {
- free(process->comm);
- process->basenameOffset = -1;
- process->comm = strdup(command);
- } else if (Process_isThread(process)) {
- if (this->showThreadNames || Process_isKernelThread(process) || process->state == 'Z') {
- free(process->comm);
- process->basenameOffset = -1;
- process->comm = strdup(command);
- } else if (this->showingThreadNames) {
- if (! ProcessList_readCmdlineFile(process, dirname, name))
- goto errorReadingProcess;
- }
- if (Process_isKernelThread(process)) {
- this->kernelThreads++;
- } else {
- this->userlandThreads++;
- }
- }
-
- this->totalTasks++;
- if (process->state == 'R')
- this->runningTasks++;
- process->updated = true;
-
- continue;
-
- // Exception handler.
- errorReadingProcess: {
- if (process->comm) {
- free(process->comm);
- process->basenameOffset = -1;
- process->comm = NULL;
- }
- if (existingProcess)
- ProcessList_remove(this, process);
- else
- Process_delete((Object*)process);
- }
- }
- closedir(dir);
- return true;
-}
-
-void ProcessList_scan(ProcessList* this) {
- unsigned long long int usertime, nicetime, systemtime, idletime;
- unsigned long long int swapFree = 0;
-
- FILE* file = fopen(PROCMEMINFOFILE, "r");
- if (file == NULL) {
- CRT_fatalError("Cannot open " PROCMEMINFOFILE);
- }
- int cpus = this->cpuCount;
- assert(cpus > 0);
- {
- char buffer[128];
- while (fgets(buffer, 128, file)) {
-
- switch (buffer[0]) {
- case 'M':
- if (String_startsWith(buffer, "MemTotal:"))
- sscanf(buffer, "MemTotal: %32llu kB", &this->totalMem);
- else if (String_startsWith(buffer, "MemFree:"))
- sscanf(buffer, "MemFree: %32llu kB", &this->freeMem);
- else if (String_startsWith(buffer, "MemShared:"))
- sscanf(buffer, "MemShared: %32llu kB", &this->sharedMem);
- break;
- case 'B':
- if (String_startsWith(buffer, "Buffers:"))
- sscanf(buffer, "Buffers: %32llu kB", &this->buffersMem);
- break;
- case 'C':
- if (String_startsWith(buffer, "Cached:"))
- sscanf(buffer, "Cached: %32llu kB", &this->cachedMem);
- break;
- case 'S':
- if (String_startsWith(buffer, "SwapTotal:"))
- sscanf(buffer, "SwapTotal: %32llu kB", &this->totalSwap);
- if (String_startsWith(buffer, "SwapFree:"))
- sscanf(buffer, "SwapFree: %32llu kB", &swapFree);
- break;
- }
- }
- }
-
- this->usedMem = this->totalMem - this->freeMem;
- this->usedSwap = this->totalSwap - swapFree;
- fclose(file);
-
- file = fopen(PROCSTATFILE, "r");
- if (file == NULL) {
- CRT_fatalError("Cannot open " PROCSTATFILE);
- }
- for (int i = 0; i <= cpus; i++) {
- char buffer[256];
- int cpuid;
- unsigned long long int ioWait, irq, softIrq, steal, guest, guestnice;
- unsigned long long int systemalltime, idlealltime, totaltime, virtalltime;
- ioWait = irq = softIrq = steal = guest = guestnice = 0;
- // Dependending on your kernel version,
- // 5, 7, 8 or 9 of these fields will be set.
- // The rest will remain at zero.
- fgets(buffer, 255, file);
- if (i == 0)
- sscanf(buffer, "cpu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu", &usertime, &nicetime, &systemtime, &idletime, &ioWait, &irq, &softIrq, &steal, &guest, &guestnice);
- else {
- sscanf(buffer, "cpu%4d %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu", &cpuid, &usertime, &nicetime, &systemtime, &idletime, &ioWait, &irq, &softIrq, &steal, &guest, &guestnice);
- assert(cpuid == i - 1);
- }
- // Guest time is already accounted in usertime
- usertime = usertime - guest;
- nicetime = nicetime - guestnice;
- // Fields existing on kernels >= 2.6
- // (and RHEL's patched kernel 2.4...)
- idlealltime = idletime + ioWait;
- systemalltime = systemtime + irq + softIrq;
- virtalltime = guest + guestnice;
- totaltime = usertime + nicetime + systemalltime + idlealltime + steal + virtalltime;
- CPUData* cpuData = &(this->cpus[i]);
- assert (usertime >= cpuData->userTime);
- assert (nicetime >= cpuData->niceTime);
- assert (systemtime >= cpuData->systemTime);
- assert (idletime >= cpuData->idleTime);
- assert (totaltime >= cpuData->totalTime);
- assert (systemalltime >= cpuData->systemAllTime);
- assert (idlealltime >= cpuData->idleAllTime);
- assert (ioWait >= cpuData->ioWaitTime);
- assert (irq >= cpuData->irqTime);
- assert (softIrq >= cpuData->softIrqTime);
- assert (steal >= cpuData->stealTime);
- assert (virtalltime >= cpuData->guestTime);
- cpuData->userPeriod = usertime - cpuData->userTime;
- cpuData->nicePeriod = nicetime - cpuData->niceTime;
- cpuData->systemPeriod = systemtime - cpuData->systemTime;
- cpuData->systemAllPeriod = systemalltime - cpuData->systemAllTime;
- cpuData->idleAllPeriod = idlealltime - cpuData->idleAllTime;
- cpuData->idlePeriod = idletime - cpuData->idleTime;
- cpuData->ioWaitPeriod = ioWait - cpuData->ioWaitTime;
- cpuData->irqPeriod = irq - cpuData->irqTime;
- cpuData->softIrqPeriod = softIrq - cpuData->softIrqTime;
- cpuData->stealPeriod = steal - cpuData->stealTime;
- cpuData->guestPeriod = virtalltime - cpuData->guestTime;
- cpuData->totalPeriod = totaltime - cpuData->totalTime;
- cpuData->userTime = usertime;
- cpuData->niceTime = nicetime;
- cpuData->systemTime = systemtime;
- cpuData->systemAllTime = systemalltime;
- cpuData->idleAllTime = idlealltime;
- cpuData->idleTime = idletime;
- cpuData->ioWaitTime = ioWait;
- cpuData->irqTime = irq;
- cpuData->softIrqTime = softIrq;
- cpuData->stealTime = steal;
- cpuData->guestTime = virtalltime;
- cpuData->totalTime = totaltime;
- }
- double period = (double)this->cpus[0].totalPeriod / cpus; fclose(file);
-
- // mark all process as "dirty"
- for (int i = 0; i < Vector_size(this->processes); i++) {
- Process* p = (Process*) Vector_get(this->processes, i);
- p->updated = false;
- }
-
- this->totalTasks = 0;
- this->userlandThreads = 0;
- this->kernelThreads = 0;
- this->runningTasks = 0;
-
- struct timeval tv;
- gettimeofday(&tv, NULL);
- ProcessList_processEntries(this, PROCDIR, NULL, period, tv);
-
- this->showingThreadNames = this->showThreadNames;
-
- for (int i = Vector_size(this->processes) - 1; i >= 0; i--) {
- Process* p = (Process*) Vector_get(this->processes, i);
- if (p->updated == false)
- ProcessList_remove(this, p);
- else
- p->updated = false;
- }
-
-}
ProcessField ProcessList_keyAt(ProcessList* this, int at) {
int x = 0;
- ProcessField* fields = this->fields;
+ ProcessField* fields = this->settings->fields;
ProcessField field;
for (int i = 0; (field = fields[i]); i++) {
- int len = strlen(Process_fieldTitles[field]);
+ const char* title = Process_fields[field].title;
+ if (!title) title = "- ";
+ int len = strlen(title);
if (at >= x && at <= x + len) {
return field;
}
@@ -1042,21 +256,11 @@ void ProcessList_expandTree(ProcessList* this) {
}
}
-void ProcessList_rebuildPanel(ProcessList* this, bool flags, int following, bool userOnly, uid_t userId, const char* incFilter) {
- if (!flags) {
- following = this->following;
- userOnly = this->userOnly;
- userId = this->userId;
- incFilter = this->incFilter;
- } else {
- this->following = following;
- this->userOnly = userOnly;
- this->userId = userId;
- this->incFilter = incFilter;
- }
+void ProcessList_rebuildPanel(ProcessList* this) {
+ const char* incFilter = this->incFilter;
int currPos = Panel_getSelectedIndex(this->panel);
- pid_t currPid = following != -1 ? following : 0;
+ pid_t currPid = this->following != -1 ? this->following : 0;
int currScrollV = this->panel->scrollV;
Panel_prune(this->panel);
@@ -1067,14 +271,14 @@ void ProcessList_rebuildPanel(ProcessList* this, bool flags, int following, bool
Process* p = ProcessList_get(this, i);
if ( (!p->show)
- || (userOnly && (p->st_uid != userId))
+ || (this->userId != (uid_t) -1 && (p->st_uid != this->userId))
|| (incFilter && !(String_contains_i(p->comm, incFilter)))
- || (this->pidWhiteList && !Hashtable_get(this->pidWhiteList, p->pid)) )
+ || (this->pidWhiteList && !Hashtable_get(this->pidWhiteList, p->tgid)) )
hidden = true;
if (!hidden) {
Panel_set(this->panel, idx, (Object*)p);
- if ((following == -1 && idx == currPos) || (following != -1 && p->pid == currPid)) {
+ if ((this->following == -1 && idx == currPos) || (this->following != -1 && p->pid == currPid)) {
Panel_setSelected(this->panel, idx);
this->panel->scrollV = currScrollV;
}
@@ -1082,3 +286,41 @@ void ProcessList_rebuildPanel(ProcessList* this, bool flags, int following, bool
}
}
}
+
+Process* ProcessList_getProcess(ProcessList* this, pid_t pid, bool* preExisting, Process_New constructor) {
+ Process* proc = (Process*) Hashtable_get(this->processTable, pid);
+ *preExisting = proc;
+ if (proc) {
+ assert(Vector_indexOf(this->processes, proc, Process_pidCompare) != -1);
+ assert(proc->pid == pid);
+ } else {
+ proc = constructor(this->settings);
+ assert(proc->comm == NULL);
+ proc->pid = pid;
+ }
+ return proc;
+}
+
+void ProcessList_scan(ProcessList* this) {
+
+ // mark all process as "dirty"
+ for (int i = 0; i < Vector_size(this->processes); i++) {
+ Process* p = (Process*) Vector_get(this->processes, i);
+ p->updated = false;
+ }
+
+ this->totalTasks = 0;
+ this->userlandThreads = 0;
+ this->kernelThreads = 0;
+ this->runningTasks = 0;
+
+ ProcessList_goThroughEntries(this);
+
+ for (int i = Vector_size(this->processes) - 1; i >= 0; i--) {
+ Process* p = (Process*) Vector_get(this->processes, i);
+ if (p->updated == false)
+ ProcessList_remove(this, p);
+ else
+ p->updated = false;
+ }
+}
diff --git a/ProcessList.h b/ProcessList.h
index 1f3549a..f96481e 100644
--- a/ProcessList.h
+++ b/ProcessList.h
@@ -14,18 +14,7 @@ in the source distribution for its full text.
#include "UsersTable.h"
#include "Panel.h"
#include "Process.h"
-
-#ifndef PROCDIR
-#define PROCDIR "/proc"
-#endif
-
-#ifndef PROCSTATFILE
-#define PROCSTATFILE PROCDIR "/stat"
-#endif
-
-#ifndef PROCMEMINFOFILE
-#define PROCMEMINFOFILE PROCDIR "/meminfo"
-#endif
+#include "Settings.h"
#ifndef MAX_NAME
#define MAX_NAME 128
@@ -35,51 +24,9 @@ in the source distribution for its full text.
#define MAX_READ 2048
#endif
-#ifndef ProcessList_cpuId
-#define ProcessList_cpuId(pl, cpu) ((pl)->countCPUsFromZero ? (cpu) : (cpu)+1)
-#endif
-
-typedef enum TreeStr_ {
- TREE_STR_HORZ,
- TREE_STR_VERT,
- TREE_STR_RTEE,
- TREE_STR_BEND,
- TREE_STR_TEND,
- TREE_STR_OPEN,
- TREE_STR_SHUT,
- TREE_STR_COUNT
-} TreeStr;
-
-typedef struct CPUData_ {
- unsigned long long int totalTime;
- unsigned long long int userTime;
- unsigned long long int systemTime;
- unsigned long long int systemAllTime;
- unsigned long long int idleAllTime;
- unsigned long long int idleTime;
- unsigned long long int niceTime;
- unsigned long long int ioWaitTime;
- unsigned long long int irqTime;
- unsigned long long int softIrqTime;
- unsigned long long int stealTime;
- unsigned long long int guestTime;
-
- unsigned long long int totalPeriod;
- unsigned long long int userPeriod;
- unsigned long long int systemPeriod;
- unsigned long long int systemAllPeriod;
- unsigned long long int idleAllPeriod;
- unsigned long long int idlePeriod;
- unsigned long long int nicePeriod;
- unsigned long long int ioWaitPeriod;
- unsigned long long int irqPeriod;
- unsigned long long int softIrqPeriod;
- unsigned long long int stealPeriod;
- unsigned long long int guestPeriod;
-} CPUData;
-
typedef struct ProcessList_ {
- const char **treeStr;
+ Settings* settings;
+
Vector* processes;
Vector* processes2;
Hashtable* processTable;
@@ -91,17 +38,15 @@ typedef struct ProcessList_ {
const char* incFilter;
Hashtable* pidWhiteList;
- int cpuCount;
- int totalTasks;
- int userlandThreads;
- int kernelThreads;
- int runningTasks;
-
#ifdef HAVE_LIBHWLOC
hwloc_topology_t topology;
bool topologyOk;
#endif
- CPUData* cpus;
+
+ int totalTasks;
+ int runningTasks;
+ int userlandThreads;
+ int kernelThreads;
unsigned long long int totalMem;
unsigned long long int usedMem;
@@ -113,76 +58,41 @@ typedef struct ProcessList_ {
unsigned long long int usedSwap;
unsigned long long int freeSwap;
- int flags;
- ProcessField* fields;
- ProcessField sortKey;
- int direction;
- bool hideThreads;
- bool shadowOtherUsers;
- bool showThreadNames;
- bool showingThreadNames;
- bool hideKernelThreads;
- bool hideUserlandThreads;
- bool treeView;
- bool highlightBaseName;
- bool highlightMegabytes;
- bool highlightThreads;
- bool detailedCPUTime;
- bool countCPUsFromZero;
- bool updateProcessNames;
- bool accountGuestInCPUMeter;
- bool userOnly;
+ int cpuCount;
} ProcessList;
+ProcessList* ProcessList_new(UsersTable* ut, Hashtable* pidWhiteList, uid_t userId);
+void ProcessList_delete(ProcessList* pl);
+void ProcessList_goThroughEntries(ProcessList* pl);
-extern const char *ProcessList_treeStrAscii[TREE_STR_COUNT];
-
-extern const char *ProcessList_treeStrUtf8[TREE_STR_COUNT];
-ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList);
+ProcessList* ProcessList_init(ProcessList* this, ObjectClass* klass, UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId);
-void ProcessList_delete(ProcessList* this);
+void ProcessList_done(ProcessList* this);
void ProcessList_setPanel(ProcessList* this, Panel* panel);
-void ProcessList_invertSortOrder(ProcessList* this);
-
void ProcessList_printHeader(ProcessList* this, RichString* header);
+void ProcessList_add(ProcessList* this, Process* p);
+
+void ProcessList_remove(ProcessList* this, Process* p);
+
Process* ProcessList_get(ProcessList* this, int idx);
int ProcessList_size(ProcessList* this);
void ProcessList_sort(ProcessList* this);
-#ifdef HAVE_TASKSTATS
-
-#endif
-
-#ifdef HAVE_OPENVZ
-
-#endif
-
-#ifdef HAVE_CGROUP
-
-#endif
-
-#ifdef HAVE_VSERVER
-
-#endif
+ProcessField ProcessList_keyAt(ProcessList* this, int at);
-#ifdef HAVE_OOM
+void ProcessList_expandTree(ProcessList* this);
-#endif
+void ProcessList_rebuildPanel(ProcessList* this);
+Process* ProcessList_getProcess(ProcessList* this, pid_t pid, bool* preExisting, Process_New constructor);
void ProcessList_scan(ProcessList* this);
-ProcessField ProcessList_keyAt(ProcessList* this, int at);
-
-void ProcessList_expandTree(ProcessList* this);
-
-void ProcessList_rebuildPanel(ProcessList* this, bool flags, int following, bool userOnly, uid_t userId, const char* incFilter);
-
#endif
diff --git a/README b/README
index f713e1c..3bc17a4 100644
--- a/README
+++ b/README
@@ -3,33 +3,21 @@ htop
by Hisham Muhammad <hisham@gobolinux.org>
-May, 2004 - January, 2014
-
-Note
-----
-
-![Alert](http://i.imgur.com/ugIqB9s.png) **Mac users, [click here](https://www.bountysource.com/fundraisers/554-mac-os-x-support-in-the-official-htop-1-x-tree)!** The htop version you are using is a 5-year old fork -- help bring htop 1.x to the Mac!
+2004 - 2015
Introduction
------------
This is htop, an interactive process viewer.
-It requires ncurses. It is tested with Linux 2.6,
-but is also reported to work (and was originally developed)
-with the 2.4 series.
-
-Note that, while, htop is Linux specific -- it is based
-on the Linux /proc filesystem -- it is also reported to work
-with FreeBSD systems featuring a Linux-compatible /proc.
-This is, however, unsupported. Contact the packager for your
-system when reporting problems on platforms other than Linux.
-
-This software has evolved considerably during the last years,
-and is reasonably complete, but there is still room for
-improvement. Read the TODO file to see what's known to be missing.
-
-Comparison between 'htop' and 'top'
------------------------------------
+It requires ncurses. It is developed primarily on Linux,
+but we also have code for running under FreeBSD and Mac OS X
+(help and testing are wanted for these platforms!)
+
+This software has evolved considerably over the years,
+and is reasonably complete, but there is always room for improvement.
+
+Comparison between 'htop' and classic 'top'
+-------------------------------------------
* In 'htop' you can scroll the list vertically and horizontally
to see all processes and full command lines.
diff --git a/RichString.c b/RichString.c
index 34720c1..e7dd4e8 100644
--- a/RichString.c
+++ b/RichString.c
@@ -6,11 +6,12 @@ in the source distribution for its full text.
*/
#include "RichString.h"
+#include "XAlloc.h"
#include <stdlib.h>
#include <string.h>
-#define RICHSTRING_MAXLEN 300
+#define RICHSTRING_MAXLEN 350
/*{
#include "config.h"
@@ -29,18 +30,22 @@ in the source distribution for its full text.
#include <curses.h>
#endif
+#ifdef HAVE_LIBNCURSESW
+#include <wctype.h>
+#endif
+
#define RichString_size(this) ((this)->chlen)
#define RichString_sizeVal(this) ((this).chlen)
-#define RichString_begin(this) RichString (this); (this).chlen = 0; (this).chptr = (this).chstr;
-#define RichString_beginAllocated(this) (this).chlen = 0; (this).chptr = (this).chstr;
+#define RichString_begin(this) RichString (this); memset(&this, 0, sizeof(RichString)); (this).chptr = (this).chstr;
+#define RichString_beginAllocated(this) memset(&this, 0, sizeof(RichString)); (this).chptr = (this).chstr;
#define RichString_end(this) RichString_prune(&(this));
#ifdef HAVE_LIBNCURSESW
#define RichString_printVal(this, y, x) mvadd_wchstr(y, x, (this).chptr)
#define RichString_printoffnVal(this, y, x, off, n) mvadd_wchnstr(y, x, (this).chptr + off, n)
#define RichString_getCharVal(this, i) ((this).chptr[i].chars[0] & 255)
-#define RichString_setChar(this, at, ch) do{ (this)->chptr[(at)].chars[0] = ch; } while(0)
+#define RichString_setChar(this, at, ch) do{ (this)->chptr[(at)] = (CharType) { .chars = { ch, 0 } }; } while(0)
#define CharType cchar_t
#else
#define RichString_printVal(this, y, x) mvaddchstr(y, x, (this).chptr)
@@ -52,52 +57,48 @@ in the source distribution for its full text.
typedef struct RichString_ {
int chlen;
- CharType chstr[RICHSTRING_MAXLEN+1];
CharType* chptr;
+ CharType chstr[RICHSTRING_MAXLEN+1];
} RichString;
}*/
-#ifndef MIN
-#define MIN(a,b) ((a)<(b)?(a):(b))
-#endif
-
#define charBytes(n) (sizeof(CharType) * (n))
-static inline void RichString_setLen(RichString* this, int len) {
+static void RichString_extendLen(RichString* this, int len) {
if (this->chlen <= RICHSTRING_MAXLEN) {
if (len > RICHSTRING_MAXLEN) {
- this->chptr = malloc(charBytes(len+1));
- memcpy(this->chptr, this->chstr, charBytes(this->chlen+1));
+ this->chptr = xMalloc(charBytes(len + 1));
+ memcpy(this->chptr, this->chstr, charBytes(this->chlen));
}
} else {
if (len <= RICHSTRING_MAXLEN) {
- memcpy(this->chstr, this->chptr, charBytes(this->chlen));
+ memcpy(this->chstr, this->chptr, charBytes(len));
free(this->chptr);
this->chptr = this->chstr;
} else {
- this->chptr = realloc(this->chptr, charBytes(len+1));
+ this->chptr = xRealloc(this->chptr, charBytes(len + 1));
}
}
+
RichString_setChar(this, len, 0);
this->chlen = len;
}
+#define RichString_setLen(this, len) do{ if(len < RICHSTRING_MAXLEN && this->chlen < RICHSTRING_MAXLEN) { RichString_setChar(this,len,0); this->chlen=len; } else RichString_extendLen(this,len); }while(0)
+
#ifdef HAVE_LIBNCURSESW
static inline void RichString_writeFrom(RichString* this, int attrs, const char* data_c, int from, int len) {
wchar_t data[len+1];
len = mbstowcs(data, data_c, len);
- if (len<0)
+ if (len < 0)
return;
int newLen = from + len;
RichString_setLen(this, newLen);
- memset(&this->chptr[from], 0, sizeof(CharType) * (newLen - from));
for (int i = from, j = 0; i < newLen; i++, j++) {
- this->chptr[i].chars[0] = data[j];
- this->chptr[i].attr = attrs;
+ this->chptr[i] = (CharType) { .attr = attrs & 0xffffff, .chars = { (iswprint(data[j]) ? data[j] : '?') } };
}
- this->chptr[newLen].chars[0] = 0;
}
inline void RichString_setAttrn(RichString* this, int attrs, int start, int finish) {
@@ -125,7 +126,7 @@ static inline void RichString_writeFrom(RichString* this, int attrs, const char*
int newLen = from + len;
RichString_setLen(this, newLen);
for (int i = from, j = 0; i < newLen; i++, j++)
- this->chptr[i] = (isprint(data_c[j]) ? data_c[j] : '?') | attrs;
+ this->chptr[i] = (data_c[j] >= 32 ? data_c[j] : '?') | attrs;
this->chptr[newLen] = 0;
}
@@ -152,9 +153,8 @@ int RichString_findChar(RichString* this, char c, int start) {
void RichString_prune(RichString* this) {
if (this->chlen > RICHSTRING_MAXLEN)
free(this->chptr);
+ memset(this, 0, sizeof(RichString));
this->chptr = this->chstr;
- this->chlen = 0;
- RichString_setChar(this, 0, 0);
}
void RichString_setAttr(RichString* this, int attrs) {
diff --git a/RichString.h b/RichString.h
index a9cb3f6..796965a 100644
--- a/RichString.h
+++ b/RichString.h
@@ -9,7 +9,7 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
-#define RICHSTRING_MAXLEN 300
+#define RICHSTRING_MAXLEN 350
#include "config.h"
#include <ctype.h>
@@ -27,18 +27,22 @@ in the source distribution for its full text.
#include <curses.h>
#endif
+#ifdef HAVE_LIBNCURSESW
+#include <wctype.h>
+#endif
+
#define RichString_size(this) ((this)->chlen)
#define RichString_sizeVal(this) ((this).chlen)
-#define RichString_begin(this) RichString (this); (this).chlen = 0; (this).chptr = (this).chstr;
-#define RichString_beginAllocated(this) (this).chlen = 0; (this).chptr = (this).chstr;
+#define RichString_begin(this) RichString (this); memset(&this, 0, sizeof(RichString)); (this).chptr = (this).chstr;
+#define RichString_beginAllocated(this) memset(&this, 0, sizeof(RichString)); (this).chptr = (this).chstr;
#define RichString_end(this) RichString_prune(&(this));
#ifdef HAVE_LIBNCURSESW
#define RichString_printVal(this, y, x) mvadd_wchstr(y, x, (this).chptr)
#define RichString_printoffnVal(this, y, x, off, n) mvadd_wchnstr(y, x, (this).chptr + off, n)
#define RichString_getCharVal(this, i) ((this).chptr[i].chars[0] & 255)
-#define RichString_setChar(this, at, ch) do{ (this)->chptr[(at)].chars[0] = ch; } while(0)
+#define RichString_setChar(this, at, ch) do{ (this)->chptr[(at)] = (CharType) { .chars = { ch, 0 } }; } while(0)
#define CharType cchar_t
#else
#define RichString_printVal(this, y, x) mvaddchstr(y, x, (this).chptr)
@@ -50,17 +54,15 @@ in the source distribution for its full text.
typedef struct RichString_ {
int chlen;
- CharType chstr[RICHSTRING_MAXLEN+1];
CharType* chptr;
+ CharType chstr[RICHSTRING_MAXLEN+1];
} RichString;
-#ifndef MIN
-#define MIN(a,b) ((a)<(b)?(a):(b))
-#endif
-
#define charBytes(n) (sizeof(CharType) * (n))
+#define RichString_setLen(this, len) do{ if(len < RICHSTRING_MAXLEN && this->chlen < RICHSTRING_MAXLEN) { RichString_setChar(this,len,0); this->chlen=len; } else RichString_extendLen(this,len); }while(0)
+
#ifdef HAVE_LIBNCURSESW
extern void RichString_setAttrn(RichString* this, int attrs, int start, int finish);
diff --git a/ScreenManager.c b/ScreenManager.c
index 646ee2f..a33d342 100644
--- a/ScreenManager.c
+++ b/ScreenManager.c
@@ -6,9 +6,10 @@ in the source distribution for its full text.
*/
#include "ScreenManager.h"
+#include "ProcessList.h"
-#include "Panel.h"
#include "Object.h"
+#include "CRT.h"
#include <assert.h>
#include <time.h>
@@ -19,6 +20,8 @@ in the source distribution for its full text.
#include "FunctionBar.h"
#include "Vector.h"
#include "Header.h"
+#include "Settings.h"
+#include "Panel.h"
typedef enum Orientation_ {
VERTICAL,
@@ -32,30 +35,27 @@ typedef struct ScreenManager_ {
int y2;
Orientation orientation;
Vector* panels;
- Vector* fuBars;
int panelCount;
- const FunctionBar* fuBar;
const Header* header;
- time_t lastScan;
+ const Settings* settings;
bool owner;
bool allowFocusChange;
} ScreenManager;
}*/
-ScreenManager* ScreenManager_new(int x1, int y1, int x2, int y2, Orientation orientation, const Header* header, bool owner) {
+ScreenManager* ScreenManager_new(int x1, int y1, int x2, int y2, Orientation orientation, const Header* header, const Settings* settings, bool owner) {
ScreenManager* this;
- this = malloc(sizeof(ScreenManager));
+ this = xMalloc(sizeof(ScreenManager));
this->x1 = x1;
this->y1 = y1;
this->x2 = x2;
this->y2 = y2;
- this->fuBar = NULL;
this->orientation = orientation;
this->panels = Vector_new(Class(Panel), owner, DEFAULT_SIZE);
- this->fuBars = Vector_new(Class(FunctionBar), true, DEFAULT_SIZE);
this->panelCount = 0;
this->header = header;
+ this->settings = settings;
this->owner = owner;
this->allowFocusChange = true;
return this;
@@ -63,7 +63,6 @@ ScreenManager* ScreenManager_new(int x1, int y1, int x2, int y2, Orientation ori
void ScreenManager_delete(ScreenManager* this) {
Vector_delete(this->panels);
- Vector_delete(this->fuBars);
free(this);
}
@@ -71,27 +70,23 @@ inline int ScreenManager_size(ScreenManager* this) {
return this->panelCount;
}
-void ScreenManager_add(ScreenManager* this, Panel* item, FunctionBar* fuBar, int size) {
+void ScreenManager_add(ScreenManager* this, Panel* item, int size) {
if (this->orientation == HORIZONTAL) {
int lastX = 0;
if (this->panelCount > 0) {
Panel* last = (Panel*) Vector_get(this->panels, this->panelCount - 1);
lastX = last->x + last->w + 1;
}
+ int height = LINES - this->y1 + this->y2;
if (size > 0) {
- Panel_resize(item, size, LINES-this->y1+this->y2);
+ Panel_resize(item, size, height);
} else {
- Panel_resize(item, COLS-this->x1+this->x2-lastX, LINES-this->y1+this->y2);
+ Panel_resize(item, COLS-this->x1+this->x2-lastX, height);
}
Panel_move(item, lastX, this->y1);
}
// TODO: VERTICAL
Vector_add(this->panels, item);
- if (fuBar)
- Vector_add(this->fuBars, fuBar);
- else
- Vector_add(this->fuBars, FunctionBar_new(NULL, NULL, NULL));
- if (!this->fuBar && fuBar) this->fuBar = fuBar;
item->needsRedraw = true;
this->panelCount++;
}
@@ -99,8 +94,6 @@ void ScreenManager_add(ScreenManager* this, Panel* item, FunctionBar* fuBar, int
Panel* ScreenManager_remove(ScreenManager* this, int idx) {
assert(this->panelCount > idx);
Panel* panel = (Panel*) Vector_remove(this->panels, idx);
- Vector_remove(this->fuBars, idx);
- this->fuBar = NULL;
this->panelCount--;
return panel;
}
@@ -111,93 +104,191 @@ void ScreenManager_resize(ScreenManager* this, int x1, int y1, int x2, int y2) {
this->x2 = x2;
this->y2 = y2;
int panels = this->panelCount;
- int lastX = 0;
- for (int i = 0; i < panels - 1; i++) {
- Panel* panel = (Panel*) Vector_get(this->panels, i);
- Panel_resize(panel, panel->w, LINES-y1+y2);
+ if (this->orientation == HORIZONTAL) {
+ int lastX = 0;
+ for (int i = 0; i < panels - 1; i++) {
+ Panel* panel = (Panel*) Vector_get(this->panels, i);
+ Panel_resize(panel, panel->w, LINES-y1+y2);
+ Panel_move(panel, lastX, y1);
+ lastX = panel->x + panel->w + 1;
+ }
+ Panel* panel = (Panel*) Vector_get(this->panels, panels-1);
+ Panel_resize(panel, COLS-x1+x2-lastX, LINES-y1+y2);
Panel_move(panel, lastX, y1);
- lastX = panel->x + panel->w + 1;
}
- Panel* panel = (Panel*) Vector_get(this->panels, panels-1);
- Panel_resize(panel, COLS-x1+x2-lastX, LINES-y1+y2);
- Panel_move(panel, lastX, y1);
+ // TODO: VERTICAL
+}
+
+static void checkRecalculation(ScreenManager* this, double* oldTime, int* sortTimeout, bool* redraw, bool *rescan, bool *timedOut) {
+ ProcessList* pl = this->header->pl;
+
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ double newTime = ((double)tv.tv_sec * 10) + ((double)tv.tv_usec / 100000);
+ *timedOut = (newTime - *oldTime > this->settings->delay);
+ *rescan = *rescan || *timedOut;
+ if (newTime < *oldTime) *rescan = true; // clock was adjusted?
+ if (*rescan) {
+ *oldTime = newTime;
+ ProcessList_scan(pl);
+ if (*sortTimeout == 0 || this->settings->treeView) {
+ ProcessList_sort(pl);
+ *sortTimeout = 1;
+ }
+ *redraw = true;
+ }
+ if (*redraw) {
+ ProcessList_rebuildPanel(pl);
+ Header_draw(this->header);
+ }
+ *rescan = false;
+}
+
+static void ScreenManager_drawPanels(ScreenManager* this, int focus) {
+ int nPanels = this->panelCount;
+ for (int i = 0; i < nPanels; i++) {
+ Panel* panel = (Panel*) Vector_get(this->panels, i);
+ Panel_draw(panel, i == focus);
+ if (i < nPanels) {
+ if (this->orientation == HORIZONTAL) {
+ mvvline(panel->y, panel->x+panel->w, ' ', panel->h+1);
+ }
+ }
+ }
+}
+
+static Panel* setCurrentPanel(Panel* panel) {
+ FunctionBar_draw(panel->currentBar, NULL);
+ return panel;
}
void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
bool quit = false;
int focus = 0;
- Panel* panelFocus = (Panel*) Vector_get(this->panels, focus);
- if (this->fuBar)
- FunctionBar_draw(this->fuBar, NULL);
-
- this->lastScan = 0;
+ Panel* panelFocus = setCurrentPanel((Panel*) Vector_get(this->panels, focus));
+
+ double oldTime = 0.0;
+
+ int ch = ERR;
+ int closeTimeout = 0;
+
+ bool timedOut = true;
+ bool redraw = true;
+ bool rescan = false;
+ int sortTimeout = 0;
+ int resetSortTimeout = 5;
- int ch = 0;
while (!quit) {
- int panels = this->panelCount;
if (this->header) {
- time_t now = time(NULL);
- if (now > this->lastScan) {
- ProcessList_scan(this->header->pl);
- ProcessList_sort(this->header->pl);
- this->lastScan = now;
- }
- Header_draw(this->header);
- ProcessList_rebuildPanel(this->header->pl, false, false, false, false, NULL);
+ checkRecalculation(this, &oldTime, &sortTimeout, &redraw, &rescan, &timedOut);
}
- for (int i = 0; i < panels; i++) {
- Panel* panel = (Panel*) Vector_get(this->panels, i);
- Panel_draw(panel, i == focus);
- if (i < panels) {
- if (this->orientation == HORIZONTAL) {
- mvvline(panel->y, panel->x+panel->w, ' ', panel->h+1);
- }
- }
+
+ if (redraw) {
+ ScreenManager_drawPanels(this, focus);
}
- FunctionBar* bar = (FunctionBar*) Vector_get(this->fuBars, focus);
- if (bar)
- this->fuBar = bar;
- if (this->fuBar)
- FunctionBar_draw(this->fuBar, NULL);
+ int prevCh = ch;
ch = getch();
-
+
+ HandlerResult result = IGNORED;
if (ch == KEY_MOUSE) {
+ ch = ERR;
MEVENT mevent;
int ok = getmouse(&mevent);
if (ok == OK) {
- if (mevent.y == LINES - 1) {
- ch = FunctionBar_synthesizeEvent(this->fuBar, mevent.x);
- } else {
- for (int i = 0; i < this->panelCount; i++) {
- Panel* panel = (Panel*) Vector_get(this->panels, i);
- if (mevent.x > panel->x && mevent.x <= panel->x+panel->w &&
- mevent.y > panel->y && mevent.y <= panel->y+panel->h &&
- (this->allowFocusChange || panelFocus == panel) ) {
- focus = i;
- panelFocus = panel;
- Panel_setSelected(panel, mevent.y - panel->y + panel->scrollV - 1);
- break;
+ if (mevent.bstate & BUTTON1_RELEASED) {
+ if (mevent.y == LINES - 1) {
+ ch = FunctionBar_synthesizeEvent(panelFocus->currentBar, mevent.x);
+ } else {
+ for (int i = 0; i < this->panelCount; i++) {
+ Panel* panel = (Panel*) Vector_get(this->panels, i);
+ if (mevent.x >= panel->x && mevent.x <= panel->x+panel->w) {
+ if (mevent.y == panel->y) {
+ ch = EVENT_HEADER_CLICK(mevent.x - panel->x);
+ break;
+ } else if (mevent.y > panel->y && mevent.y <= panel->y+panel->h) {
+ ch = KEY_MOUSE;
+ if (panel == panelFocus || this->allowFocusChange) {
+ focus = i;
+ panelFocus = setCurrentPanel(panel);
+ Object* oldSelection = Panel_getSelected(panel);
+ Panel_setSelected(panel, mevent.y - panel->y + panel->scrollV - 1);
+ if (Panel_getSelected(panel) == oldSelection) {
+ ch = KEY_RECLICK;
+ }
+ }
+ break;
+ }
+ }
}
}
+ #if NCURSES_MOUSE_VERSION > 1
+ } else if (mevent.bstate & BUTTON4_PRESSED) {
+ ch = KEY_WHEELUP;
+ } else if (mevent.bstate & BUTTON5_PRESSED) {
+ ch = KEY_WHEELDOWN;
+ #endif
}
}
}
-
- if (Panel_eventHandlerFn(panelFocus)) {
- HandlerResult result = Panel_eventHandler(panelFocus, ch);
- if (result == HANDLED) {
- continue;
- } else if (result == BREAK_LOOP) {
- quit = true;
- continue;
+ if (ch == ERR) {
+ sortTimeout--;
+ if (prevCh == ch && !timedOut) {
+ closeTimeout++;
+ if (closeTimeout == 100) {
+ break;
+ }
+ } else
+ closeTimeout = 0;
+ redraw = false;
+ continue;
+ }
+ else if (ch == 27) {
+ int ch2 = getch();
+ if (ch2 != ERR) {
+ switch(ch2)
+ {
+ case 'h':
+ ch = KEY_LEFT;
+ break;
+ case 'j':
+ ch = KEY_DOWN;
+ break;
+ case 'k':
+ ch = KEY_UP;
+ break;
+ case 'l':
+ ch = KEY_RIGHT;
+ break;
+ default:
+ ungetch(ch2);
+ break;
+ }
}
}
+ redraw = true;
+ if (Panel_eventHandlerFn(panelFocus)) {
+ result = Panel_eventHandler(panelFocus, ch);
+ }
+ if (result & SYNTH_KEY) {
+ ch = result >> 16;
+ }
+ if (result & REDRAW) {
+ sortTimeout = 0;
+ }
+ if (result & RESCAN) {
+ rescan = true;
+ sortTimeout = 0;
+ }
+ if (result & HANDLED) {
+ continue;
+ } else if (result & BREAK_LOOP) {
+ quit = true;
+ continue;
+ }
switch (ch) {
- case ERR:
- continue;
case KEY_RESIZE:
{
ScreenManager_resize(this, this->x1, this->y1, this->x2, this->y2);
@@ -210,7 +301,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
tryLeft:
if (focus > 0)
focus--;
- panelFocus = (Panel*) Vector_get(this->panels, focus);
+ panelFocus = setCurrentPanel((Panel*) Vector_get(this->panels, focus));
if (Panel_size(panelFocus) == 0 && focus > 0)
goto tryLeft;
break;
@@ -222,7 +313,7 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
tryRight:
if (focus < this->panelCount - 1)
focus++;
- panelFocus = (Panel*) Vector_get(this->panels, focus);
+ panelFocus = setCurrentPanel((Panel*) Vector_get(this->panels, focus));
if (Panel_size(panelFocus) == 0 && focus < this->panelCount - 1)
goto tryRight;
break;
@@ -232,11 +323,14 @@ void ScreenManager_run(ScreenManager* this, Panel** lastFocus, int* lastKey) {
quit = true;
continue;
default:
+ sortTimeout = resetSortTimeout;
Panel_onKey(panelFocus, ch);
break;
}
}
- *lastFocus = panelFocus;
- *lastKey = ch;
+ if (lastFocus)
+ *lastFocus = panelFocus;
+ if (lastKey)
+ *lastKey = ch;
}
diff --git a/ScreenManager.h b/ScreenManager.h
index 5179fe9..3d02a88 100644
--- a/ScreenManager.h
+++ b/ScreenManager.h
@@ -12,6 +12,8 @@ in the source distribution for its full text.
#include "FunctionBar.h"
#include "Vector.h"
#include "Header.h"
+#include "Settings.h"
+#include "Panel.h"
typedef enum Orientation_ {
VERTICAL,
@@ -25,23 +27,21 @@ typedef struct ScreenManager_ {
int y2;
Orientation orientation;
Vector* panels;
- Vector* fuBars;
int panelCount;
- const FunctionBar* fuBar;
const Header* header;
- time_t lastScan;
+ const Settings* settings;
bool owner;
bool allowFocusChange;
} ScreenManager;
-ScreenManager* ScreenManager_new(int x1, int y1, int x2, int y2, Orientation orientation, const Header* header, bool owner);
+ScreenManager* ScreenManager_new(int x1, int y1, int x2, int y2, Orientation orientation, const Header* header, const Settings* settings, bool owner);
void ScreenManager_delete(ScreenManager* this);
extern int ScreenManager_size(ScreenManager* this);
-void ScreenManager_add(ScreenManager* this, Panel* item, FunctionBar* fuBar, int size);
+void ScreenManager_add(ScreenManager* this, Panel* item, int size);
Panel* ScreenManager_remove(ScreenManager* this, int idx);
diff --git a/Settings.c b/Settings.c
index cd9e6c1..a6bb355 100644
--- a/Settings.c
+++ b/Settings.c
@@ -6,9 +6,11 @@ in the source distribution for its full text.
*/
#include "Settings.h"
+#include "Platform.h"
-#include "String.h"
+#include "StringUtils.h"
#include "Vector.h"
+#include "CRT.h"
#include <sys/stat.h>
#include <stdlib.h>
@@ -18,51 +20,156 @@ in the source distribution for its full text.
#define DEFAULT_DELAY 15
/*{
-#include "ProcessList.h"
-#include "Header.h"
+#include "Process.h"
#include <stdbool.h>
+typedef struct {
+ int len;
+ char** names;
+ int* modes;
+} MeterColumnSettings;
+
typedef struct Settings_ {
- char* userSettings;
- ProcessList* pl;
- Header* header;
+ char* filename;
+
+ MeterColumnSettings columns[2];
+
+ ProcessField* fields;
+ int flags;
int colorScheme;
int delay;
+
+ int cpuCount;
+ int direction;
+ ProcessField sortKey;
+
+ bool countCPUsFromZero;
+ bool detailedCPUTime;
+ bool treeView;
+ bool showProgramPath;
+ bool hideThreads;
+ bool shadowOtherUsers;
+ bool showThreadNames;
+ bool hideKernelThreads;
+ bool hideUserlandThreads;
+ bool highlightBaseName;
+ bool highlightMegabytes;
+ bool highlightThreads;
+ bool updateProcessNames;
+ bool accountGuestInCPUMeter;
+ bool headerMargin;
+
bool changed;
} Settings;
+#ifndef Settings_cpuId
+#define Settings_cpuId(settings, cpu) ((settings)->countCPUsFromZero ? (cpu) : (cpu)+1)
+#endif
+
}*/
void Settings_delete(Settings* this) {
- free(this->userSettings);
+ free(this->filename);
+ free(this->fields);
+ for (unsigned int i = 0; i < (sizeof(this->columns)/sizeof(MeterColumnSettings)); i++) {
+ String_freeArray(this->columns[i].names);
+ free(this->columns[i].modes);
+ }
free(this);
}
-static void Settings_readMeters(Settings* this, char* line, HeaderSide side) {
+static void Settings_readMeters(Settings* this, char* line, int column) {
+ char* trim = String_trim(line);
+ int nIds;
+ char** ids = String_split(trim, ' ', &nIds);
+ free(trim);
+ this->columns[column].names = ids;
+}
+
+static void Settings_readMeterModes(Settings* this, char* line, int column) {
char* trim = String_trim(line);
int nIds;
char** ids = String_split(trim, ' ', &nIds);
free(trim);
+ int len = 0;
for (int i = 0; ids[i]; i++) {
- Header_createMeter(this->header, ids[i], side);
+ len++;
+ }
+ this->columns[column].len = len;
+ int* modes = xCalloc(len, sizeof(int));
+ for (int i = 0; i < len; i++) {
+ modes[i] = atoi(ids[i]);
}
String_freeArray(ids);
+ this->columns[column].modes = modes;
+}
+
+static void Settings_defaultMeters(Settings* this) {
+ int sizes[] = { 3, 3 };
+ if (this->cpuCount > 4) {
+ sizes[1]++;
+ }
+ for (int i = 0; i < 2; i++) {
+ this->columns[i].names = xCalloc(sizes[i] + 1, sizeof(char*));
+ this->columns[i].modes = xCalloc(sizes[i], sizeof(int));
+ this->columns[i].len = sizes[i];
+ }
+
+ int r = 0;
+ if (this->cpuCount > 8) {
+ this->columns[0].names[0] = xStrdup("LeftCPUs2");
+ this->columns[0].modes[0] = BAR_METERMODE;
+ this->columns[1].names[r] = xStrdup("RightCPUs2");
+ this->columns[1].modes[r++] = BAR_METERMODE;
+ } else if (this->cpuCount > 4) {
+ this->columns[0].names[0] = xStrdup("LeftCPUs");
+ this->columns[0].modes[0] = BAR_METERMODE;
+ this->columns[1].names[r] = xStrdup("RightCPUs");
+ this->columns[1].modes[r++] = BAR_METERMODE;
+ } else {
+ this->columns[0].names[0] = xStrdup("AllCPUs");
+ this->columns[0].modes[0] = BAR_METERMODE;
+ }
+ this->columns[0].names[1] = xStrdup("Memory");
+ this->columns[0].modes[1] = BAR_METERMODE;
+ this->columns[0].names[2] = xStrdup("Swap");
+ this->columns[0].modes[2] = BAR_METERMODE;
+
+ this->columns[1].names[r] = xStrdup("Tasks");
+ this->columns[1].modes[r++] = TEXT_METERMODE;
+ this->columns[1].names[r] = xStrdup("LoadAverage");
+ this->columns[1].modes[r++] = TEXT_METERMODE;
+ this->columns[1].names[r] = xStrdup("Uptime");
+ this->columns[1].modes[r++] = TEXT_METERMODE;
}
-static void Settings_readMeterModes(Settings* this, char* line, HeaderSide side) {
+static void readFields(ProcessField* fields, int* flags, const char* line) {
char* trim = String_trim(line);
int nIds;
char** ids = String_split(trim, ' ', &nIds);
free(trim);
- for (int i = 0; ids[i]; i++) {
- int mode = atoi(ids[i]);
- Header_setMode(this->header, i, mode, side);
+ int i, j;
+ *flags = 0;
+ for (j = 0, i = 0; i < Platform_numberOfFields && ids[i]; i++) {
+ // This "+1" is for compatibility with the older enum format.
+ int id = atoi(ids[i]) + 1;
+ if (id > 0 && Process_fields[id].name && id < Platform_numberOfFields) {
+ fields[j] = id;
+ *flags |= Process_fields[id].flags;
+ j++;
+ }
}
+ fields[j] = (ProcessField) NULL;
String_freeArray(ids);
}
-static bool Settings_read(Settings* this, const char* fileName, int cpuCount) {
- FILE* fd = fopen(fileName, "r");
+static bool Settings_read(Settings* this, const char* fileName) {
+ FILE* fd;
+ uid_t euid = geteuid();
+
+ seteuid(getuid());
+ fd = fopen(fileName, "r");
+ seteuid(euid);
if (!fd)
return false;
@@ -77,156 +184,171 @@ static bool Settings_read(Settings* this, const char* fileName, int cpuCount) {
continue;
}
if (String_eq(option[0], "fields")) {
- char* trim = String_trim(option[1]);
- int nIds;
- char** ids = String_split(trim, ' ', &nIds);
- free(trim);
- int i, j;
- this->pl->flags = 0;
- for (j = 0, i = 0; i < LAST_PROCESSFIELD && ids[i]; i++) {
- // This "+1" is for compatibility with the older enum format.
- int id = atoi(ids[i]) + 1;
- if (id > 0 && id < LAST_PROCESSFIELD) {
- this->pl->fields[j] = id;
- this->pl->flags |= Process_fieldFlags[id];
- j++;
- }
- }
- this->pl->fields[j] = (ProcessField) NULL;
- String_freeArray(ids);
+ readFields(this->fields, &(this->flags), option[1]);
} else if (String_eq(option[0], "sort_key")) {
// This "+1" is for compatibility with the older enum format.
- this->pl->sortKey = atoi(option[1]) + 1;
+ this->sortKey = atoi(option[1]) + 1;
} else if (String_eq(option[0], "sort_direction")) {
- this->pl->direction = atoi(option[1]);
+ this->direction = atoi(option[1]);
} else if (String_eq(option[0], "tree_view")) {
- this->pl->treeView = atoi(option[1]);
+ this->treeView = atoi(option[1]);
} else if (String_eq(option[0], "hide_threads")) {
- this->pl->hideThreads = atoi(option[1]);
+ this->hideThreads = atoi(option[1]);
} else if (String_eq(option[0], "hide_kernel_threads")) {
- this->pl->hideKernelThreads = atoi(option[1]);
+ this->hideKernelThreads = atoi(option[1]);
} else if (String_eq(option[0], "hide_userland_threads")) {
- this->pl->hideUserlandThreads = atoi(option[1]);
+ this->hideUserlandThreads = atoi(option[1]);
} else if (String_eq(option[0], "shadow_other_users")) {
- this->pl->shadowOtherUsers = atoi(option[1]);
+ this->shadowOtherUsers = atoi(option[1]);
} else if (String_eq(option[0], "show_thread_names")) {
- this->pl->showThreadNames = atoi(option[1]);
+ this->showThreadNames = atoi(option[1]);
+ } else if (String_eq(option[0], "show_program_path")) {
+ this->showProgramPath = atoi(option[1]);
} else if (String_eq(option[0], "highlight_base_name")) {
- this->pl->highlightBaseName = atoi(option[1]);
+ this->highlightBaseName = atoi(option[1]);
} else if (String_eq(option[0], "highlight_megabytes")) {
- this->pl->highlightMegabytes = atoi(option[1]);
+ this->highlightMegabytes = atoi(option[1]);
} else if (String_eq(option[0], "highlight_threads")) {
- this->pl->highlightThreads = atoi(option[1]);
+ this->highlightThreads = atoi(option[1]);
} else if (String_eq(option[0], "header_margin")) {
- this->header->margin = atoi(option[1]);
+ this->headerMargin = atoi(option[1]);
} else if (String_eq(option[0], "expand_system_time")) {
// Compatibility option.
- this->pl->detailedCPUTime = atoi(option[1]);
+ this->detailedCPUTime = atoi(option[1]);
} else if (String_eq(option[0], "detailed_cpu_time")) {
- this->pl->detailedCPUTime = atoi(option[1]);
+ this->detailedCPUTime = atoi(option[1]);
} else if (String_eq(option[0], "cpu_count_from_zero")) {
- this->pl->countCPUsFromZero = atoi(option[1]);
+ this->countCPUsFromZero = atoi(option[1]);
} else if (String_eq(option[0], "update_process_names")) {
- this->pl->updateProcessNames = atoi(option[1]);
+ this->updateProcessNames = atoi(option[1]);
} else if (String_eq(option[0], "account_guest_in_cpu_meter")) {
- this->pl->accountGuestInCPUMeter = atoi(option[1]);
+ this->accountGuestInCPUMeter = atoi(option[1]);
} else if (String_eq(option[0], "delay")) {
this->delay = atoi(option[1]);
} else if (String_eq(option[0], "color_scheme")) {
this->colorScheme = atoi(option[1]);
- if (this->colorScheme < 0) this->colorScheme = 0;
- if (this->colorScheme > 5) this->colorScheme = 5;
+ if (this->colorScheme < 0 || this->colorScheme >= LAST_COLORSCHEME) this->colorScheme = 0;
} else if (String_eq(option[0], "left_meters")) {
- Settings_readMeters(this, option[1], LEFT_HEADER);
+ Settings_readMeters(this, option[1], 0);
readMeters = true;
} else if (String_eq(option[0], "right_meters")) {
- Settings_readMeters(this, option[1], RIGHT_HEADER);
+ Settings_readMeters(this, option[1], 1);
readMeters = true;
} else if (String_eq(option[0], "left_meter_modes")) {
- Settings_readMeterModes(this, option[1], LEFT_HEADER);
+ Settings_readMeterModes(this, option[1], 0);
readMeters = true;
} else if (String_eq(option[0], "right_meter_modes")) {
- Settings_readMeterModes(this, option[1], RIGHT_HEADER);
+ Settings_readMeterModes(this, option[1], 1);
readMeters = true;
}
String_freeArray(option);
}
fclose(fd);
if (!readMeters) {
- Header_defaultMeters(this->header, cpuCount);
+ Settings_defaultMeters(this);
}
return true;
}
+static void writeFields(FILE* fd, ProcessField* fields, const char* name) {
+ fprintf(fd, "%s=", name);
+ for (int i = 0; fields[i]; i++) {
+ // This "-1" is for compatibility with the older enum format.
+ fprintf(fd, "%d ", (int) fields[i]-1);
+ }
+ fprintf(fd, "\n");
+}
+
+static void writeMeters(Settings* this, FILE* fd, int column) {
+ for (int i = 0; i < this->columns[column].len; i++) {
+ fprintf(fd, "%s ", this->columns[column].names[i]);
+ }
+ fprintf(fd, "\n");
+}
+
+static void writeMeterModes(Settings* this, FILE* fd, int column) {
+ for (int i = 0; i < this->columns[column].len; i++) {
+ fprintf(fd, "%d ", this->columns[column].modes[i]);
+ }
+ fprintf(fd, "\n");
+}
+
bool Settings_write(Settings* this) {
- // TODO: implement File object and make
- // file I/O object-oriented.
FILE* fd;
- fd = fopen(this->userSettings, "w");
+ uid_t euid = geteuid();
+
+ seteuid(getuid());
+ fd = fopen(this->filename, "w");
+ seteuid(euid);
if (fd == NULL) {
return false;
}
fprintf(fd, "# Beware! This file is rewritten by htop when settings are changed in the interface.\n");
fprintf(fd, "# The parser is also very primitive, and not human-friendly.\n");
- fprintf(fd, "fields=");
- for (int i = 0; this->pl->fields[i]; i++) {
- // This "-1" is for compatibility with the older enum format.
- fprintf(fd, "%d ", (int) this->pl->fields[i]-1);
- }
- fprintf(fd, "\n");
+ writeFields(fd, this->fields, "fields");
// This "-1" is for compatibility with the older enum format.
- fprintf(fd, "sort_key=%d\n", (int) this->pl->sortKey-1);
- fprintf(fd, "sort_direction=%d\n", (int) this->pl->direction);
- fprintf(fd, "hide_threads=%d\n", (int) this->pl->hideThreads);
- fprintf(fd, "hide_kernel_threads=%d\n", (int) this->pl->hideKernelThreads);
- fprintf(fd, "hide_userland_threads=%d\n", (int) this->pl->hideUserlandThreads);
- fprintf(fd, "shadow_other_users=%d\n", (int) this->pl->shadowOtherUsers);
- fprintf(fd, "show_thread_names=%d\n", (int) this->pl->showThreadNames);
- fprintf(fd, "highlight_base_name=%d\n", (int) this->pl->highlightBaseName);
- fprintf(fd, "highlight_megabytes=%d\n", (int) this->pl->highlightMegabytes);
- fprintf(fd, "highlight_threads=%d\n", (int) this->pl->highlightThreads);
- fprintf(fd, "tree_view=%d\n", (int) this->pl->treeView);
- fprintf(fd, "header_margin=%d\n", (int) this->header->margin);
- fprintf(fd, "detailed_cpu_time=%d\n", (int) this->pl->detailedCPUTime);
- fprintf(fd, "cpu_count_from_zero=%d\n", (int) this->pl->countCPUsFromZero);
- fprintf(fd, "update_process_names=%d\n", (int) this->pl->updateProcessNames);
- fprintf(fd, "account_guest_in_cpu_meter=%d\n", (int) this->pl->accountGuestInCPUMeter);
+ fprintf(fd, "sort_key=%d\n", (int) this->sortKey-1);
+ fprintf(fd, "sort_direction=%d\n", (int) this->direction);
+ fprintf(fd, "hide_threads=%d\n", (int) this->hideThreads);
+ fprintf(fd, "hide_kernel_threads=%d\n", (int) this->hideKernelThreads);
+ fprintf(fd, "hide_userland_threads=%d\n", (int) this->hideUserlandThreads);
+ fprintf(fd, "shadow_other_users=%d\n", (int) this->shadowOtherUsers);
+ fprintf(fd, "show_thread_names=%d\n", (int) this->showThreadNames);
+ fprintf(fd, "show_program_path=%d\n", (int) this->showProgramPath);
+ fprintf(fd, "highlight_base_name=%d\n", (int) this->highlightBaseName);
+ fprintf(fd, "highlight_megabytes=%d\n", (int) this->highlightMegabytes);
+ fprintf(fd, "highlight_threads=%d\n", (int) this->highlightThreads);
+ fprintf(fd, "tree_view=%d\n", (int) this->treeView);
+ fprintf(fd, "header_margin=%d\n", (int) this->headerMargin);
+ fprintf(fd, "detailed_cpu_time=%d\n", (int) this->detailedCPUTime);
+ fprintf(fd, "cpu_count_from_zero=%d\n", (int) this->countCPUsFromZero);
+ fprintf(fd, "update_process_names=%d\n", (int) this->updateProcessNames);
+ fprintf(fd, "account_guest_in_cpu_meter=%d\n", (int) this->accountGuestInCPUMeter);
fprintf(fd, "color_scheme=%d\n", (int) this->colorScheme);
fprintf(fd, "delay=%d\n", (int) this->delay);
- fprintf(fd, "left_meters=");
- for (int i = 0; i < Header_size(this->header, LEFT_HEADER); i++) {
- char* name = Header_readMeterName(this->header, i, LEFT_HEADER);
- fprintf(fd, "%s ", name);
- free(name);
- }
- fprintf(fd, "\n");
- fprintf(fd, "left_meter_modes=");
- for (int i = 0; i < Header_size(this->header, LEFT_HEADER); i++)
- fprintf(fd, "%d ", Header_readMeterMode(this->header, i, LEFT_HEADER));
- fprintf(fd, "\n");
- fprintf(fd, "right_meters=");
- for (int i = 0; i < Header_size(this->header, RIGHT_HEADER); i++) {
- char* name = Header_readMeterName(this->header, i, RIGHT_HEADER);
- fprintf(fd, "%s ", name);
- free(name);
- }
- fprintf(fd, "\n");
- fprintf(fd, "right_meter_modes=");
- for (int i = 0; i < Header_size(this->header, RIGHT_HEADER); i++)
- fprintf(fd, "%d ", Header_readMeterMode(this->header, i, RIGHT_HEADER));
- fprintf(fd, "\n");
+ fprintf(fd, "left_meters="); writeMeters(this, fd, 0);
+ fprintf(fd, "left_meter_modes="); writeMeterModes(this, fd, 0);
+ fprintf(fd, "right_meters="); writeMeters(this, fd, 1);
+ fprintf(fd, "right_meter_modes="); writeMeterModes(this, fd, 1);
fclose(fd);
return true;
}
-Settings* Settings_new(ProcessList* pl, Header* header, int cpuCount) {
- Settings* this = malloc(sizeof(Settings));
- this->pl = pl;
- this->header = header;
+Settings* Settings_new(int cpuCount) {
+
+ Settings* this = xCalloc(1, sizeof(Settings));
+
+ this->sortKey = PERCENT_CPU;
+ this->direction = 1;
+ this->hideThreads = false;
+ this->shadowOtherUsers = false;
+ this->showThreadNames = false;
+ this->hideKernelThreads = false;
+ this->hideUserlandThreads = false;
+ this->treeView = false;
+ this->highlightBaseName = false;
+ this->highlightMegabytes = false;
+ this->detailedCPUTime = false;
+ this->countCPUsFromZero = false;
+ this->updateProcessNames = false;
+ this->cpuCount = cpuCount;
+ this->showProgramPath = true;
+ this->highlightThreads = true;
+
+ this->fields = xCalloc(Platform_numberOfFields+1, sizeof(ProcessField));
+ // TODO: turn 'fields' into a Vector,
+ // (and ProcessFields into proper objects).
+ this->flags = 0;
+ ProcessField* defaults = Platform_defaultFields;
+ for (int i = 0; defaults[i]; i++) {
+ this->fields[i] = defaults[i];
+ this->flags |= Process_fields[defaults[i]].flags;
+ }
+
char* legacyDotfile = NULL;
char* rcfile = getenv("HTOPRC");
if (rcfile) {
- this->userSettings = strdup(rcfile);
+ this->filename = xStrdup(rcfile);
} else {
const char* home = getenv("HOME");
if (!home) home = "";
@@ -234,15 +356,17 @@ Settings* Settings_new(ProcessList* pl, Header* header, int cpuCount) {
char* configDir = NULL;
char* htopDir = NULL;
if (xdgConfigHome) {
- this->userSettings = String_cat(xdgConfigHome, "/htop/htoprc");
- configDir = strdup(xdgConfigHome);
+ this->filename = String_cat(xdgConfigHome, "/htop/htoprc");
+ configDir = xStrdup(xdgConfigHome);
htopDir = String_cat(xdgConfigHome, "/htop");
} else {
- this->userSettings = String_cat(home, "/.config/htop/htoprc");
+ this->filename = String_cat(home, "/.config/htop/htoprc");
configDir = String_cat(home, "/.config");
htopDir = String_cat(home, "/.config/htop");
}
legacyDotfile = String_cat(home, "/.htoprc");
+ uid_t euid = geteuid();
+ seteuid(getuid());
(void) mkdir(configDir, 0700);
(void) mkdir(htopDir, 0700);
free(htopDir);
@@ -255,11 +379,12 @@ Settings* Settings_new(ProcessList* pl, Header* header, int cpuCount) {
free(legacyDotfile);
legacyDotfile = NULL;
}
+ seteuid(euid);
}
this->colorScheme = 0;
this->changed = false;
this->delay = DEFAULT_DELAY;
- bool ok = Settings_read(this, legacyDotfile ? legacyDotfile : this->userSettings, cpuCount);
+ bool ok = Settings_read(this, legacyDotfile ? legacyDotfile : this->filename);
if (ok) {
if (legacyDotfile) {
// Transition to new location and delete old configuration file
@@ -270,15 +395,23 @@ Settings* Settings_new(ProcessList* pl, Header* header, int cpuCount) {
this->changed = true;
// TODO: how to get SYSCONFDIR correctly through Autoconf?
char* systemSettings = String_cat(SYSCONFDIR, "/htoprc");
- ok = Settings_read(this, systemSettings, cpuCount);
+ ok = Settings_read(this, systemSettings);
free(systemSettings);
if (!ok) {
- Header_defaultMeters(this->header, cpuCount);
- pl->hideKernelThreads = true;
- pl->highlightMegabytes = true;
- pl->highlightThreads = false;
+ Settings_defaultMeters(this);
+ this->hideKernelThreads = true;
+ this->highlightMegabytes = true;
+ this->highlightThreads = true;
+ this->headerMargin = true;
}
}
free(legacyDotfile);
return this;
}
+
+void Settings_invertSortOrder(Settings* this) {
+ if (this->direction == 1)
+ this->direction = -1;
+ else
+ this->direction = 1;
+}
diff --git a/Settings.h b/Settings.h
index 28fe552..d9dc068 100644
--- a/Settings.h
+++ b/Settings.h
@@ -11,24 +11,59 @@ in the source distribution for its full text.
#define DEFAULT_DELAY 15
-#include "ProcessList.h"
-#include "Header.h"
+#include "Process.h"
#include <stdbool.h>
+typedef struct {
+ int len;
+ char** names;
+ int* modes;
+} MeterColumnSettings;
+
typedef struct Settings_ {
- char* userSettings;
- ProcessList* pl;
- Header* header;
+ char* filename;
+
+ MeterColumnSettings columns[2];
+
+ ProcessField* fields;
+ int flags;
int colorScheme;
int delay;
+
+ int cpuCount;
+ int direction;
+ ProcessField sortKey;
+
+ bool countCPUsFromZero;
+ bool detailedCPUTime;
+ bool treeView;
+ bool showProgramPath;
+ bool hideThreads;
+ bool shadowOtherUsers;
+ bool showThreadNames;
+ bool hideKernelThreads;
+ bool hideUserlandThreads;
+ bool highlightBaseName;
+ bool highlightMegabytes;
+ bool highlightThreads;
+ bool updateProcessNames;
+ bool accountGuestInCPUMeter;
+ bool headerMargin;
+
bool changed;
} Settings;
+#ifndef Settings_cpuId
+#define Settings_cpuId(settings, cpu) ((settings)->countCPUsFromZero ? (cpu) : (cpu)+1)
+#endif
+
void Settings_delete(Settings* this);
bool Settings_write(Settings* this);
-Settings* Settings_new(ProcessList* pl, Header* header, int cpuCount);
+Settings* Settings_new(int cpuCount);
+
+void Settings_invertSortOrder(Settings* this);
#endif
diff --git a/SignalsPanel.c b/SignalsPanel.c
index a52e528..9816a84 100644
--- a/SignalsPanel.c
+++ b/SignalsPanel.c
@@ -7,12 +7,14 @@ in the source distribution for its full text.
#include "Panel.h"
#include "SignalsPanel.h"
+#include "Platform.h"
#include "ListItem.h"
#include "RichString.h"
#include <stdlib.h>
#include <assert.h>
+#include <signal.h>
#include <ctype.h>
@@ -25,48 +27,18 @@ typedef struct SignalItem_ {
}*/
-static SignalItem signals[] = {
- { .name = " 0 Cancel", .number = 0 },
- { .name = " 1 SIGHUP", .number = 1 },
- { .name = " 2 SIGINT", .number = 2 },
- { .name = " 3 SIGQUIT", .number = 3 },
- { .name = " 4 SIGILL", .number = 4 },
- { .name = " 5 SIGTRAP", .number = 5 },
- { .name = " 6 SIGABRT", .number = 6 },
- { .name = " 6 SIGIOT", .number = 6 },
- { .name = " 7 SIGBUS", .number = 7 },
- { .name = " 8 SIGFPE", .number = 8 },
- { .name = " 9 SIGKILL", .number = 9 },
- { .name = "10 SIGUSR1", .number = 10 },
- { .name = "11 SIGSEGV", .number = 11 },
- { .name = "12 SIGUSR2", .number = 12 },
- { .name = "13 SIGPIPE", .number = 13 },
- { .name = "14 SIGALRM", .number = 14 },
- { .name = "15 SIGTERM", .number = 15 },
- { .name = "16 SIGSTKFLT", .number = 16 },
- { .name = "17 SIGCHLD", .number = 17 },
- { .name = "18 SIGCONT", .number = 18 },
- { .name = "19 SIGSTOP", .number = 19 },
- { .name = "20 SIGTSTP", .number = 20 },
- { .name = "21 SIGTTIN", .number = 21 },
- { .name = "22 SIGTTOU", .number = 22 },
- { .name = "23 SIGURG", .number = 23 },
- { .name = "24 SIGXCPU", .number = 24 },
- { .name = "25 SIGXFSZ", .number = 25 },
- { .name = "26 SIGVTALRM", .number = 26 },
- { .name = "27 SIGPROF", .number = 27 },
- { .name = "28 SIGWINCH", .number = 28 },
- { .name = "29 SIGIO", .number = 29 },
- { .name = "29 SIGPOLL", .number = 29 },
- { .name = "30 SIGPWR", .number = 30 },
- { .name = "31 SIGSYS", .number = 31 },
-};
-
Panel* SignalsPanel_new() {
- Panel* this = Panel_new(1, 1, 1, 1, true, Class(ListItem));
- for(unsigned int i = 0; i < sizeof(signals)/sizeof(SignalItem); i++)
- Panel_set(this, i, (Object*) ListItem_new(signals[i].name, signals[i].number));
+ Panel* this = Panel_new(1, 1, 1, 1, true, Class(ListItem), FunctionBar_newEnterEsc("Send ", "Cancel "));
+ const int defaultSignal = SIGTERM;
+ int defaultPosition = 15;
+ for(unsigned int i = 0; i < Platform_numberOfSignals; i++) {
+ Panel_set(this, i, (Object*) ListItem_new(Platform_signals[i].name, Platform_signals[i].number));
+ // signal 15 is not always the 15th signal in the table
+ if (Platform_signals[i].number == defaultSignal) {
+ defaultPosition = i;
+ }
+ }
Panel_setHeader(this, "Send signal:");
- Panel_setSelected(this, 16); // 16th item is SIGTERM
+ Panel_setSelected(this, defaultPosition);
return this;
}
diff --git a/String.c b/StringUtils.c
index cbfd687..173caba 100644
--- a/String.c
+++ b/StringUtils.c
@@ -1,11 +1,12 @@
/*
-htop - String.c
+htop - StringUtils.c
(C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
-#include "String.h"
+#include "StringUtils.h"
+#include "XAlloc.h"
#include "config.h"
@@ -22,7 +23,7 @@ in the source distribution for its full text.
char* String_cat(const char* s1, const char* s2) {
int l1 = strlen(s1);
int l2 = strlen(s2);
- char* out = malloc(l1 + l2 + 1);
+ char* out = xMalloc(l1 + l2 + 1);
strncpy(out, s1, l1);
strncpy(out+l1, s2, l2+1);
return out;
@@ -36,7 +37,7 @@ char* String_trim(const char* in) {
while (len > 0 && (in[len-1] == ' ' || in[len-1] == '\t' || in[len-1] == '\n')) {
len--;
}
- char* out = malloc(len+1);
+ char* out = xMalloc(len+1);
strncpy(out, in, len);
out[len] = '\0';
return out;
@@ -55,20 +56,20 @@ inline int String_eq(const char* s1, const char* s2) {
char** String_split(const char* s, char sep, int* n) {
*n = 0;
const int rate = 10;
- char** out = (char**) malloc(sizeof(char*) * rate);
+ char** out = xCalloc(rate, sizeof(char*));
int ctr = 0;
int blocks = rate;
char* where;
while ((where = strchr(s, sep)) != NULL) {
int size = where - s;
- char* token = (char*) malloc(size + 1);
+ char* token = xMalloc(size + 1);
strncpy(token, s, size);
token[size] = '\0';
out[ctr] = token;
ctr++;
if (ctr == blocks) {
blocks += rate;
- char** newOut = (char**) realloc(out, sizeof(char*) * blocks);
+ char** newOut = (char**) xRealloc(out, sizeof(char*) * blocks);
if (newOut) {
out = newOut;
} else {
@@ -80,12 +81,12 @@ char** String_split(const char* s, char sep, int* n) {
}
if (s[0] != '\0') {
int size = strlen(s);
- char* token = (char*) malloc(size + 1);
+ char* token = xMalloc(size + 1);
strncpy(token, s, size + 1);
out[ctr] = token;
ctr++;
}
- char** newOut = realloc(out, sizeof(char*) * (ctr + 1));
+ char** newOut = xRealloc(out, sizeof(char*) * (ctr + 1));
if (newOut) {
out = newOut;
}
@@ -125,5 +126,5 @@ char* String_getToken(const char* line, const unsigned short int numMatch) {
}
match[foundCount] = '\0';
- return((char*)strdup(match));
+ return((char*)xStrdup(match));
}
diff --git a/String.h b/StringUtils.h
index cb7f1ac..38ffae7 100644
--- a/String.h
+++ b/StringUtils.h
@@ -1,9 +1,9 @@
/* Do not edit this file. It was automatically generated. */
-#ifndef HEADER_String
-#define HEADER_String
+#ifndef HEADER_StringUtils
+#define HEADER_StringUtils
/*
-htop - String.h
+htop - StringUtils.h
(C) 2004-2011 Hisham H. Muhammad
Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
diff --git a/SwapMeter.c b/SwapMeter.c
index 2cb86d5..895ca0b 100644
--- a/SwapMeter.c
+++ b/SwapMeter.c
@@ -8,7 +8,7 @@ in the source distribution for its full text.
#include "SwapMeter.h"
#include "CRT.h"
-#include "ProcessList.h"
+#include "Platform.h"
#include <stdlib.h>
#include <string.h>
@@ -20,37 +20,31 @@ in the source distribution for its full text.
#include "Meter.h"
}*/
-#define KILOBYTE 1
-#define MEGABYTE 1024
-#define GIGABYTE 1048576
-
int SwapMeter_attributes[] = {
SWAP
};
-/* NOTE: Value is in kilobytes */
-static void SwapMeter_humanNumber(char* buffer, const long int* value) {
- sprintf(buffer, "%ldM ", *value / MEGABYTE);
-}
-
-static void SwapMeter_setValues(Meter* this, char* buffer, int len) {
- long int usedSwap = this->pl->usedSwap;
- this->total = this->pl->totalSwap;
- this->values[0] = usedSwap;
+static void SwapMeter_setValues(Meter* this, char* buffer, int size) {
+ int written;
+ Platform_setSwapValues(this);
- snprintf(buffer, len, "%ld/%ldMB", (long int) usedSwap / MEGABYTE, (long int) this->total / MEGABYTE);
+ written = Meter_humanUnit(buffer, this->values[0], size);
+ buffer += written;
+ if ((size -= written) > 0) {
+ *buffer++ = '/';
+ size--;
+ Meter_humanUnit(buffer, this->total, size);
+ }
}
static void SwapMeter_display(Object* cast, RichString* out) {
char buffer[50];
Meter* this = (Meter*)cast;
- long int swap = (long int) this->values[0];
- long int total = (long int) this->total;
RichString_write(out, CRT_colors[METER_TEXT], ":");
- SwapMeter_humanNumber(buffer, &total);
+ Meter_humanUnit(buffer, this->total, 50);
RichString_append(out, CRT_colors[METER_VALUE], buffer);
- SwapMeter_humanNumber(buffer, &swap);
- RichString_append(out, CRT_colors[METER_TEXT], "used:");
+ Meter_humanUnit(buffer, this->values[0], 50);
+ RichString_append(out, CRT_colors[METER_TEXT], " used:");
RichString_append(out, CRT_colors[METER_VALUE], buffer);
}
diff --git a/SwapMeter.h b/SwapMeter.h
index bb46a38..2b57fe5 100644
--- a/SwapMeter.h
+++ b/SwapMeter.h
@@ -11,13 +11,8 @@ in the source distribution for its full text.
#include "Meter.h"
-#define KILOBYTE 1
-#define MEGABYTE 1024
-#define GIGABYTE 1048576
-
extern int SwapMeter_attributes[];
-/* NOTE: Value is in kilobytes */
extern MeterClass SwapMeter_class;
#endif
diff --git a/TasksMeter.c b/TasksMeter.c
index 22a125e..f3764d6 100644
--- a/TasksMeter.c
+++ b/TasksMeter.c
@@ -7,7 +7,7 @@ in the source distribution for its full text.
#include "TasksMeter.h"
-#include "ProcessList.h"
+#include "Platform.h"
#include "CRT.h"
/*{
@@ -15,42 +15,53 @@ in the source distribution for its full text.
}*/
int TasksMeter_attributes[] = {
- TASKS_RUNNING
+ CPU_KERNEL, PROCESS_THREAD, PROCESS, TASKS_RUNNING
};
static void TasksMeter_setValues(Meter* this, char* buffer, int len) {
ProcessList* pl = this->pl;
- this->total = pl->totalTasks;
- this->values[0] = pl->runningTasks;
- snprintf(buffer, len, "%d/%d", (int) this->values[0], (int) this->total);
+ this->values[0] = pl->kernelThreads;
+ this->values[1] = pl->userlandThreads;
+ this->values[2] = pl->totalTasks - pl->kernelThreads - pl->userlandThreads;
+ this->values[3] = pl->runningTasks;
+ if (pl->totalTasks > this->total) {
+ this->total = pl->totalTasks;
+ }
+ if (this->pl->settings->hideKernelThreads) {
+ this->values[0] = 0;
+ }
+ snprintf(buffer, len, "%d/%d", (int) this->values[3], (int) this->total);
}
static void TasksMeter_display(Object* cast, RichString* out) {
Meter* this = (Meter*)cast;
- ProcessList* pl = this->pl;
+ Settings* settings = this->pl->settings;
char buffer[20];
- sprintf(buffer, "%d", (int)(this->total - pl->userlandThreads - pl->kernelThreads));
+
+ int processes = (int) this->values[2];
+
+ sprintf(buffer, "%d", processes);
RichString_write(out, CRT_colors[METER_VALUE], buffer);
int threadValueColor = CRT_colors[METER_VALUE];
int threadCaptionColor = CRT_colors[METER_TEXT];
- if (pl->highlightThreads) {
+ if (settings->highlightThreads) {
threadValueColor = CRT_colors[PROCESS_THREAD_BASENAME];
threadCaptionColor = CRT_colors[PROCESS_THREAD];
}
- if (!pl->hideUserlandThreads) {
+ if (!settings->hideUserlandThreads) {
RichString_append(out, CRT_colors[METER_TEXT], ", ");
- sprintf(buffer, "%d", (int)pl->userlandThreads);
+ sprintf(buffer, "%d", (int)this->values[1]);
RichString_append(out, threadValueColor, buffer);
RichString_append(out, threadCaptionColor, " thr");
}
- if (!pl->hideKernelThreads) {
+ if (!settings->hideKernelThreads) {
RichString_append(out, CRT_colors[METER_TEXT], ", ");
- sprintf(buffer, "%d", (int)pl->kernelThreads);
+ sprintf(buffer, "%d", (int)this->values[0]);
RichString_append(out, threadValueColor, buffer);
RichString_append(out, threadCaptionColor, " kthr");
}
RichString_append(out, CRT_colors[METER_TEXT], "; ");
- sprintf(buffer, "%d", (int)this->values[0]);
+ sprintf(buffer, "%d", (int)this->values[3]);
RichString_append(out, CRT_colors[TASKS_RUNNING], buffer);
RichString_append(out, CRT_colors[METER_TEXT], " running");
}
@@ -64,6 +75,7 @@ MeterClass TasksMeter_class = {
.setValues = TasksMeter_setValues,
.defaultMode = TEXT_METERMODE,
.total = 100.0,
+ .maxItems = 4,
.attributes = TasksMeter_attributes,
.name = "Tasks",
.uiName = "Task counter",
diff --git a/TraceScreen.c b/TraceScreen.c
index 5823022..5ae0600 100644
--- a/TraceScreen.c
+++ b/TraceScreen.c
@@ -8,10 +8,12 @@ in the source distribution for its full text.
#include "TraceScreen.h"
#include "CRT.h"
+#include "InfoScreen.h"
#include "ProcessList.h"
#include "ListItem.h"
#include "IncSet.h"
-#include "String.h"
+#include "StringUtils.h"
+#include "FunctionBar.h"
#include <stdio.h>
#include <unistd.h>
@@ -25,205 +27,146 @@ in the source distribution for its full text.
#include <signal.h>
/*{
-#include "Process.h"
-#include "Panel.h"
-#include "FunctionBar.h"
+#include "InfoScreen.h"
typedef struct TraceScreen_ {
- Process* process;
- Panel* display;
+ InfoScreen super;
bool tracing;
+ int fdpair[2];
+ int child;
+ FILE* strace;
+ int fd_strace;
+ bool contLine;
+ bool follow;
} TraceScreen;
}*/
-static const char* tsFunctions[] = {"Search ", "Filter ", "AutoScroll ", "Stop Tracing ", "Done ", NULL};
+static const char* TraceScreenFunctions[] = {"Search ", "Filter ", "AutoScroll ", "Stop Tracing ", "Done ", NULL};
-static const char* tsKeys[] = {"F3", "F4", "F8", "F9", "Esc"};
+static const char* TraceScreenKeys[] = {"F3", "F4", "F8", "F9", "Esc"};
-static int tsEvents[] = {KEY_F(3), KEY_F(4), KEY_F(8), KEY_F(9), 27};
+static int TraceScreenEvents[] = {KEY_F(3), KEY_F(4), KEY_F(8), KEY_F(9), 27};
+
+InfoScreenClass TraceScreen_class = {
+ .super = {
+ .extends = Class(Object),
+ .delete = TraceScreen_delete
+ },
+ .draw = TraceScreen_draw,
+ .onErr = TraceScreen_updateTrace,
+ .onKey = TraceScreen_onKey,
+};
TraceScreen* TraceScreen_new(Process* process) {
- TraceScreen* this = (TraceScreen*) malloc(sizeof(TraceScreen));
- this->process = process;
- this->display = Panel_new(0, 1, COLS, LINES-2, false, Class(ListItem));
+ TraceScreen* this = xMalloc(sizeof(TraceScreen));
+ Object_setClass(this, Class(TraceScreen));
this->tracing = true;
- return this;
+ this->contLine = false;
+ this->follow = false;
+ FunctionBar* fuBar = FunctionBar_new(TraceScreenFunctions, TraceScreenKeys, TraceScreenEvents);
+ CRT_disableDelay();
+ return (TraceScreen*) InfoScreen_init(&this->super, process, fuBar, LINES-2, "");
}
-void TraceScreen_delete(TraceScreen* this) {
- Panel_delete((Object*)this->display);
- free(this);
+void TraceScreen_delete(Object* cast) {
+ TraceScreen* this = (TraceScreen*) cast;
+ if (this->child > 0) {
+ kill(this->child, SIGTERM);
+ waitpid(this->child, NULL, 0);
+ fclose(this->strace);
+ }
+ CRT_enableDelay();
+ free(InfoScreen_done((InfoScreen*)cast));
}
-static void TraceScreen_draw(TraceScreen* this, IncSet* inc) {
+void TraceScreen_draw(InfoScreen* this) {
attrset(CRT_colors[PANEL_HEADER_FOCUS]);
mvhline(0, 0, ' ', COLS);
mvprintw(0, 0, "Trace of process %d - %s", this->process->pid, this->process->comm);
attrset(CRT_colors[DEFAULT_COLOR]);
- IncSet_drawBar(inc);
-}
-
-static inline void addLine(const char* line, Vector* lines, Panel* panel, const char* incFilter) {
- Vector_add(lines, (Object*) ListItem_new(line, 0));
- if (!incFilter || String_contains_i(line, incFilter))
- Panel_add(panel, (Object*)Vector_get(lines, Vector_size(lines)-1));
+ IncSet_drawBar(this->inc);
}
-static inline void appendLine(const char* line, Vector* lines, Panel* panel, const char* incFilter) {
- ListItem* last = (ListItem*)Vector_get(lines, Vector_size(lines)-1);
- ListItem_append(last, line);
- if (incFilter && Panel_get(panel, Panel_size(panel)-1) != (Object*)last && String_contains_i(line, incFilter))
- Panel_add(panel, (Object*)last);
-}
-
-void TraceScreen_run(TraceScreen* this) {
-// if (this->process->pid == getpid()) return;
+bool TraceScreen_forkTracer(TraceScreen* this) {
char buffer[1001];
- int fdpair[2];
- int err = pipe(fdpair);
- if (err == -1) return;
- int child = fork();
- if (child == -1) return;
- if (child == 0) {
- dup2(fdpair[1], STDERR_FILENO);
- int ok = fcntl(fdpair[1], F_SETFL, O_NONBLOCK);
+ int err = pipe(this->fdpair);
+ if (err == -1) return false;
+ this->child = fork();
+ if (this->child == -1) return false;
+ if (this->child == 0) {
+ seteuid(getuid());
+ dup2(this->fdpair[1], STDERR_FILENO);
+ int ok = fcntl(this->fdpair[1], F_SETFL, O_NONBLOCK);
if (ok != -1) {
- sprintf(buffer, "%d", this->process->pid);
+ sprintf(buffer, "%d", this->super.process->pid);
execlp("strace", "strace", "-p", buffer, NULL);
}
const char* message = "Could not execute 'strace'. Please make sure it is available in your $PATH.";
- write(fdpair[1], message, strlen(message));
+ ssize_t written = write(this->fdpair[1], message, strlen(message));
+ (void) written;
exit(1);
}
- fcntl(fdpair[0], F_SETFL, O_NONBLOCK);
- FILE* strace = fdopen(fdpair[0], "r");
- Panel* panel = this->display;
- int fd_strace = fileno(strace);
- CRT_disableDelay();
- bool contLine = false;
- bool follow = false;
- bool looping = true;
-
- FunctionBar* bar = FunctionBar_new(tsFunctions, tsKeys, tsEvents);
- IncSet* inc = IncSet_new(bar);
-
- Vector* lines = Vector_new(panel->items->type, true, DEFAULT_SIZE);
-
- TraceScreen_draw(this, inc);
-
- while (looping) {
-
- Panel_draw(panel, true);
- const char* incFilter = IncSet_filter(inc);
-
- if (inc->active)
- move(LINES-1, CRT_cursorX);
- int ch = getch();
-
- if (ch == ERR) {
- fd_set fds;
- FD_ZERO(&fds);
-// FD_SET(STDIN_FILENO, &fds);
- FD_SET(fd_strace, &fds);
- struct timeval tv;
- tv.tv_sec = 0; tv.tv_usec = 500;
- int ready = select(fd_strace+1, &fds, NULL, NULL, &tv);
- int nread = 0;
- if (ready > 0 && FD_ISSET(fd_strace, &fds))
- nread = fread(buffer, 1, 1000, strace);
- if (nread && this->tracing) {
- char* line = buffer;
- buffer[nread] = '\0';
- for (int i = 0; i < nread; i++) {
- if (buffer[i] == '\n') {
- buffer[i] = '\0';
- if (contLine) {
- appendLine(line, lines, panel, incFilter);
- contLine = false;
- } else {
- addLine(line, lines, panel, incFilter);
- }
- line = buffer+i+1;
- }
- }
- if (line < buffer+nread) {
- addLine(line, lines, panel, incFilter);
- buffer[nread] = '\0';
- contLine = true;
+ fcntl(this->fdpair[0], F_SETFL, O_NONBLOCK);
+ this->strace = fdopen(this->fdpair[0], "r");
+ this->fd_strace = fileno(this->strace);
+ return true;
+}
+
+void TraceScreen_updateTrace(InfoScreen* super) {
+ TraceScreen* this = (TraceScreen*) super;
+ char buffer[1001];
+ fd_set fds;
+ FD_ZERO(&fds);
+// FD_SET(STDIN_FILENO, &fds);
+ FD_SET(this->fd_strace, &fds);
+ struct timeval tv;
+ tv.tv_sec = 0; tv.tv_usec = 500;
+ int ready = select(this->fd_strace+1, &fds, NULL, NULL, &tv);
+ int nread = 0;
+ if (ready > 0 && FD_ISSET(this->fd_strace, &fds))
+ nread = fread(buffer, 1, 1000, this->strace);
+ if (nread && this->tracing) {
+ char* line = buffer;
+ buffer[nread] = '\0';
+ for (int i = 0; i < nread; i++) {
+ if (buffer[i] == '\n') {
+ buffer[i] = '\0';
+ if (this->contLine) {
+ InfoScreen_appendLine(&this->super, line);
+ this->contLine = false;
+ } else {
+ InfoScreen_addLine(&this->super, line);
}
- if (follow)
- Panel_setSelected(panel, Panel_size(panel)-1);
+ line = buffer+i+1;
}
}
-
- if (ch == KEY_MOUSE) {
- MEVENT mevent;
- int ok = getmouse(&mevent);
- if (ok == OK)
- if (mevent.y >= panel->y && mevent.y < LINES - 1) {
- Panel_setSelected(panel, mevent.y - panel->y + panel->scrollV);
- follow = false;
- ch = 0;
- } if (mevent.y == LINES - 1)
- ch = FunctionBar_synthesizeEvent(inc->bar, mevent.x);
- }
-
- if (inc->active) {
- IncSet_handleKey(inc, ch, panel, IncSet_getListItemValue, lines);
- continue;
+ if (line < buffer+nread) {
+ InfoScreen_addLine(&this->super, line);
+ buffer[nread] = '\0';
+ this->contLine = true;
}
-
- switch(ch) {
- case ERR:
- continue;
- case KEY_HOME:
- Panel_setSelected(panel, 0);
- break;
- case KEY_END:
- Panel_setSelected(panel, Panel_size(panel)-1);
- break;
- case KEY_F(3):
- case '/':
- IncSet_activate(inc, INC_SEARCH);
- break;
- case KEY_F(4):
- case '\\':
- IncSet_activate(inc, INC_FILTER);
- break;
+ if (this->follow)
+ Panel_setSelected(this->super.display, Panel_size(this->super.display)-1);
+ }
+}
+
+bool TraceScreen_onKey(InfoScreen* super, int ch) {
+ TraceScreen* this = (TraceScreen*) super;
+ switch(ch) {
case 'f':
case KEY_F(8):
- follow = !follow;
- if (follow)
- Panel_setSelected(panel, Panel_size(panel)-1);
- break;
+ this->follow = !(this->follow);
+ if (this->follow)
+ Panel_setSelected(super->display, Panel_size(super->display)-1);
+ return true;
case 't':
case KEY_F(9):
this->tracing = !this->tracing;
- FunctionBar_setLabel(bar, KEY_F(9), this->tracing?"Stop Tracing ":"Resume Tracing ");
- TraceScreen_draw(this, inc);
- break;
- case 'q':
- case 27:
- case KEY_F(10):
- looping = false;
- break;
- case KEY_RESIZE:
- Panel_resize(panel, COLS, LINES-2);
- TraceScreen_draw(this, inc);
- break;
- default:
- follow = false;
- Panel_onKey(panel, ch);
- }
+ FunctionBar_setLabel(super->display->defaultBar, KEY_F(9), this->tracing?"Stop Tracing ":"Resume Tracing ");
+ InfoScreen_draw(this);
+ return true;
}
-
- IncSet_delete(inc);
- FunctionBar_delete((Object*)bar);
- Vector_delete(lines);
-
- kill(child, SIGTERM);
- waitpid(child, NULL, 0);
- fclose(strace);
- CRT_enableDelay();
+ this->follow = false;
+ return false;
}
diff --git a/TraceScreen.h b/TraceScreen.h
index 03d1856..8845c51 100644
--- a/TraceScreen.h
+++ b/TraceScreen.h
@@ -9,21 +9,32 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
-#include "Process.h"
-#include "Panel.h"
-#include "FunctionBar.h"
+#include "InfoScreen.h"
typedef struct TraceScreen_ {
- Process* process;
- Panel* display;
+ InfoScreen super;
bool tracing;
+ int fdpair[2];
+ int child;
+ FILE* strace;
+ int fd_strace;
+ bool contLine;
+ bool follow;
} TraceScreen;
+extern InfoScreenClass TraceScreen_class;
+
TraceScreen* TraceScreen_new(Process* process);
-void TraceScreen_delete(TraceScreen* this);
+void TraceScreen_delete(Object* cast);
+
+void TraceScreen_draw(InfoScreen* this);
+
+bool TraceScreen_forkTracer(TraceScreen* this);
+
+void TraceScreen_updateTrace(InfoScreen* super);
-void TraceScreen_run(TraceScreen* this);
+bool TraceScreen_onKey(InfoScreen* super, int ch);
#endif
diff --git a/UptimeMeter.c b/UptimeMeter.c
index 9e28817..a033b17 100644
--- a/UptimeMeter.c
+++ b/UptimeMeter.c
@@ -6,12 +6,9 @@ in the source distribution for its full text.
*/
#include "UptimeMeter.h"
-
-#include "ProcessList.h"
+#include "Platform.h"
#include "CRT.h"
-#include <math.h>
-
/*{
#include "Meter.h"
}*/
@@ -21,13 +18,11 @@ int UptimeMeter_attributes[] = {
};
static void UptimeMeter_setValues(Meter* this, char* buffer, int len) {
- double uptime = 0;
- FILE* fd = fopen(PROCDIR "/uptime", "r");
- if (fd) {
- fscanf(fd, "%64lf", &uptime);
- fclose(fd);
+ int totalseconds = Platform_getUptime();
+ if (totalseconds == -1) {
+ snprintf(buffer, len, "(unknown)");
+ return;
}
- int totalseconds = (int) ceil(uptime);
int seconds = totalseconds % 60;
int minutes = (totalseconds/60) % 60;
int hours = (totalseconds/3600) % 24;
diff --git a/UsersTable.c b/UsersTable.c
index ecabb0a..f383256 100644
--- a/UsersTable.c
+++ b/UsersTable.c
@@ -6,6 +6,7 @@ in the source distribution for its full text.
*/
#include "UsersTable.h"
+#include "XAlloc.h"
#include "config.h"
@@ -27,7 +28,7 @@ typedef struct UsersTable_ {
UsersTable* UsersTable_new() {
UsersTable* this;
- this = malloc(sizeof(UsersTable));
+ this = xMalloc(sizeof(UsersTable));
this->users = Hashtable_new(20, true);
return this;
}
@@ -42,7 +43,7 @@ char* UsersTable_getRef(UsersTable* this, unsigned int uid) {
if (name == NULL) {
struct passwd* userData = getpwuid(uid);
if (userData != NULL) {
- name = strdup(userData->pw_name);
+ name = xStrdup(userData->pw_name);
Hashtable_put(this->users, uid, name);
}
}
diff --git a/Vector.c b/Vector.c
index f3212f8..0cdf9af 100644
--- a/Vector.c
+++ b/Vector.c
@@ -37,9 +37,9 @@ Vector* Vector_new(ObjectClass* type, bool owner, int size) {
if (size == DEFAULT_SIZE)
size = 10;
- this = (Vector*) malloc(sizeof(Vector));
+ this = xMalloc(sizeof(Vector));
this->growthRate = size;
- this->array = (Object**) calloc(size, sizeof(Object*));
+ this->array = (Object**) xCalloc(size, sizeof(Object*));
this->arraySize = size;
this->items = 0;
this->type = type;
@@ -179,7 +179,7 @@ static void Vector_checkArraySize(Vector* this) {
//int i;
//i = this->arraySize;
this->arraySize = this->items + this->growthRate;
- this->array = (Object**) realloc(this->array, sizeof(Object*) * this->arraySize);
+ this->array = (Object**) xRealloc(this->array, sizeof(Object*) * this->arraySize);
//for (; i < this->arraySize; i++)
// this->array[i] = NULL;
}
@@ -189,9 +189,12 @@ static void Vector_checkArraySize(Vector* this) {
void Vector_insert(Vector* this, int idx, void* data_) {
Object* data = data_;
assert(idx >= 0);
- assert(idx <= this->items);
assert(Object_isA(data, this->type));
assert(Vector_isConsistent(this));
+
+ if (idx > this->items) {
+ idx = this->items;
+ }
Vector_checkArraySize(this);
//assert(this->array[this->items] == NULL);
diff --git a/XAlloc.c b/XAlloc.c
new file mode 100644
index 0000000..cc29021
--- /dev/null
+++ b/XAlloc.c
@@ -0,0 +1,52 @@
+
+#include "XAlloc.h"
+#include "RichString.h"
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+#include <err.h>
+#include <stdlib.h>
+#include <string.h>
+
+/*{
+#include <stdlib.h>
+}*/
+
+static inline void fail() {
+ curs_set(1);
+ endwin();
+ err(1, NULL);
+}
+
+void* xMalloc(size_t size) {
+ void* data = malloc(size);
+ if (!data && size > 0) {
+ fail();
+ }
+ return data;
+}
+
+void* xCalloc(size_t nmemb, size_t size) {
+ void* data = calloc(nmemb, size);
+ if (!data) {
+ fail();
+ }
+ return data;
+}
+
+void* xRealloc(void* ptr, size_t size) {
+ void* data = realloc(ptr, size);
+ if (!data && size > 0) {
+ fail();
+ }
+ return data;
+}
+
+char* xStrdup(const char* str) {
+ char* data = strdup(str);
+ if (!data && str) {
+ fail();
+ }
+ return data;
+}
diff --git a/XAlloc.h b/XAlloc.h
new file mode 100644
index 0000000..3cc060d
--- /dev/null
+++ b/XAlloc.h
@@ -0,0 +1,20 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_XAlloc
+#define HEADER_XAlloc
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#include <stdlib.h>
+
+void* xMalloc(size_t size);
+
+void* xCalloc(size_t nmemb, size_t size);
+
+void* xRealloc(void* ptr, size_t size);
+
+char* xStrdup(const char* str);
+
+#endif
diff --git a/aclocal.m4 b/aclocal.m4
index ea25f92..cd7a0f4 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -1,7 +1,7 @@
-# generated automatically by aclocal 1.11.1 -*- Autoconf -*-
+# generated automatically by aclocal 1.14 -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2007, 2008, 2009 Free Software Foundation, Inc.
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
@@ -11,15 +11,16 @@
# even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE.
+m4_ifndef([AC_CONFIG_MACRO_DIRS], [m4_defun([_AM_CONFIG_MACRO_DIRS], [])m4_defun([AC_CONFIG_MACRO_DIRS], [_AM_CONFIG_MACRO_DIRS($@)])])
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
m4_if(m4_defn([AC_AUTOCONF_VERSION]), [2.69],,
[m4_warning([this file was generated for autoconf 2.69.
You have another version of autoconf. It may work, but is not guaranteed to.
If you have problems, you may need to regenerate the build system entirely.
-To do so, use the procedure documented by the package, typically `autoreconf'.])])
+To do so, use the procedure documented by the package, typically 'autoreconf'.])])
-# Copyright (C) 2002, 2003, 2005, 2006, 2007, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2002-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -31,10 +32,10 @@ To do so, use the procedure documented by the package, typically `autoreconf'.])
# generated from the m4 files accompanying Automake X.Y.
# (This private macro should not be called outside this file.)
AC_DEFUN([AM_AUTOMAKE_VERSION],
-[am__api_version='1.11'
+[am__api_version='1.14'
dnl Some users find AM_AUTOMAKE_VERSION and mistake it for a way to
dnl require some minimum version. Point them to the right macro.
-m4_if([$1], [1.11.1], [],
+m4_if([$1], [1.14], [],
[AC_FATAL([Do not call $0, use AM_INIT_AUTOMAKE([$1]).])])dnl
])
@@ -50,22 +51,22 @@ m4_define([_AM_AUTOCONF_VERSION], [])
# Call AM_AUTOMAKE_VERSION and AM_AUTOMAKE_VERSION so they can be traced.
# This function is AC_REQUIREd by AM_INIT_AUTOMAKE.
AC_DEFUN([AM_SET_CURRENT_AUTOMAKE_VERSION],
-[AM_AUTOMAKE_VERSION([1.11.1])dnl
+[AM_AUTOMAKE_VERSION([1.14])dnl
m4_ifndef([AC_AUTOCONF_VERSION],
[m4_copy([m4_PACKAGE_VERSION], [AC_AUTOCONF_VERSION])])dnl
_AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
# AM_AUX_DIR_EXPAND -*- Autoconf -*-
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
# For projects using AC_CONFIG_AUX_DIR([foo]), Autoconf sets
-# $ac_aux_dir to `$srcdir/foo'. In other projects, it is set to
-# `$srcdir', `$srcdir/..', or `$srcdir/../..'.
+# $ac_aux_dir to '$srcdir/foo'. In other projects, it is set to
+# '$srcdir', '$srcdir/..', or '$srcdir/../..'.
#
# Of course, Automake must honor this variable whenever it calls a
# tool from the auxiliary directory. The problem is that $srcdir (and
@@ -84,7 +85,7 @@ _AM_AUTOCONF_VERSION(m4_defn([AC_AUTOCONF_VERSION]))])
#
# The reason of the latter failure is that $top_srcdir and $ac_aux_dir
# are both prefixed by $srcdir. In an in-source build this is usually
-# harmless because $srcdir is `.', but things will broke when you
+# harmless because $srcdir is '.', but things will broke when you
# start a VPATH build or use an absolute $srcdir.
#
# So we could use something similar to $top_srcdir/$ac_aux_dir/missing,
@@ -110,22 +111,19 @@ am_aux_dir=`cd $ac_aux_dir && pwd`
# AM_CONDITIONAL -*- Autoconf -*-
-# Copyright (C) 1997, 2000, 2001, 2003, 2004, 2005, 2006, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 9
-
# AM_CONDITIONAL(NAME, SHELL-CONDITION)
# -------------------------------------
# Define a conditional.
AC_DEFUN([AM_CONDITIONAL],
-[AC_PREREQ(2.52)dnl
- ifelse([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
- [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
+[AC_PREREQ([2.52])dnl
+ m4_if([$1], [TRUE], [AC_FATAL([$0: invalid condition: $1])],
+ [$1], [FALSE], [AC_FATAL([$0: invalid condition: $1])])dnl
AC_SUBST([$1_TRUE])dnl
AC_SUBST([$1_FALSE])dnl
_AM_SUBST_NOTMAKE([$1_TRUE])dnl
@@ -144,16 +142,14 @@ AC_CONFIG_COMMANDS_PRE(
Usually this means the macro was only invoked conditionally.]])
fi])])
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2009
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 10
-# There are a few dirty hacks below to avoid letting `AC_PROG_CC' be
+# There are a few dirty hacks below to avoid letting 'AC_PROG_CC' be
# written in clear, in which case automake, when reading aclocal.m4,
# will think it sees a *use*, and therefore will trigger all it's
# C support machinery. Also note that it means that autoscan, seeing
@@ -163,7 +159,7 @@ fi])])
# _AM_DEPENDENCIES(NAME)
# ----------------------
# See how the compiler implements dependency checking.
-# NAME is "CC", "CXX", "GCJ", or "OBJC".
+# NAME is "CC", "CXX", "OBJC", "OBJCXX", "UPC", or "GJC".
# We try a few techniques and use that to set a single cache variable.
#
# We don't AC_REQUIRE the corresponding AC_PROG_CC since the latter was
@@ -176,12 +172,13 @@ AC_REQUIRE([AM_OUTPUT_DEPENDENCY_COMMANDS])dnl
AC_REQUIRE([AM_MAKE_INCLUDE])dnl
AC_REQUIRE([AM_DEP_TRACK])dnl
-ifelse([$1], CC, [depcc="$CC" am_compiler_list=],
- [$1], CXX, [depcc="$CXX" am_compiler_list=],
- [$1], OBJC, [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
- [$1], UPC, [depcc="$UPC" am_compiler_list=],
- [$1], GCJ, [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
- [depcc="$$1" am_compiler_list=])
+m4_if([$1], [CC], [depcc="$CC" am_compiler_list=],
+ [$1], [CXX], [depcc="$CXX" am_compiler_list=],
+ [$1], [OBJC], [depcc="$OBJC" am_compiler_list='gcc3 gcc'],
+ [$1], [OBJCXX], [depcc="$OBJCXX" am_compiler_list='gcc3 gcc'],
+ [$1], [UPC], [depcc="$UPC" am_compiler_list=],
+ [$1], [GCJ], [depcc="$GCJ" am_compiler_list='gcc3 gcc'],
+ [depcc="$$1" am_compiler_list=])
AC_CACHE_CHECK([dependency style of $depcc],
[am_cv_$1_dependencies_compiler_type],
@@ -189,8 +186,9 @@ AC_CACHE_CHECK([dependency style of $depcc],
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
@@ -229,16 +227,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
@@ -247,16 +245,16 @@ AC_CACHE_CHECK([dependency style of $depcc],
test "$am__universal" = false || continue
;;
nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
- msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
@@ -304,7 +302,7 @@ AM_CONDITIONAL([am__fastdep$1], [
# AM_SET_DEPDIR
# -------------
# Choose a directory name for dependency files.
-# This macro is AC_REQUIREd in _AM_DEPENDENCIES
+# This macro is AC_REQUIREd in _AM_DEPENDENCIES.
AC_DEFUN([AM_SET_DEPDIR],
[AC_REQUIRE([AM_SET_LEADING_DOT])dnl
AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
@@ -314,34 +312,39 @@ AC_SUBST([DEPDIR], ["${am__leading_dot}deps"])dnl
# AM_DEP_TRACK
# ------------
AC_DEFUN([AM_DEP_TRACK],
-[AC_ARG_ENABLE(dependency-tracking,
-[ --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors])
+[AC_ARG_ENABLE([dependency-tracking], [dnl
+AS_HELP_STRING(
+ [--enable-dependency-tracking],
+ [do not reject slow dependency extractors])
+AS_HELP_STRING(
+ [--disable-dependency-tracking],
+ [speeds up one-time build])])
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
+ am__nodep='_no'
fi
AM_CONDITIONAL([AMDEP], [test "x$enable_dependency_tracking" != xno])
AC_SUBST([AMDEPBACKSLASH])dnl
_AM_SUBST_NOTMAKE([AMDEPBACKSLASH])dnl
+AC_SUBST([am__nodep])dnl
+_AM_SUBST_NOTMAKE([am__nodep])dnl
])
# Generate code to set up dependency tracking. -*- Autoconf -*-
-# Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-#serial 5
# _AM_OUTPUT_DEPENDENCY_COMMANDS
# ------------------------------
AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
[{
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
@@ -354,7 +357,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
+ # We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
@@ -366,21 +369,19 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
+ # from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
+ test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`AS_DIRNAME(["$file"])`
@@ -398,7 +399,7 @@ AC_DEFUN([_AM_OUTPUT_DEPENDENCY_COMMANDS],
# This macro should only be invoked once -- use via AC_REQUIRE.
#
# This code is only required when automatic dependency tracking
-# is enabled. FIXME. This creates each `.P' file that we will
+# is enabled. FIXME. This creates each '.P' file that we will
# need in order to bootstrap the dependency handling code.
AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
[AC_CONFIG_COMMANDS([depfiles],
@@ -408,18 +409,21 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# Do all the work for Automake. -*- Autoconf -*-
-# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004,
-# 2005, 2006, 2008, 2009 Free Software Foundation, Inc.
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 16
-
# This macro actually does too much. Some checks are only needed if
# your package does certain things. But this isn't really a big deal.
+dnl Redefine AC_PROG_CC to automatically invoke _AM_PROG_CC_C_O.
+m4_define([AC_PROG_CC],
+m4_defn([AC_PROG_CC])
+[_AM_PROG_CC_C_O
+])
+
# AM_INIT_AUTOMAKE(PACKAGE, VERSION, [NO-DEFINE])
# AM_INIT_AUTOMAKE([OPTIONS])
# -----------------------------------------------
@@ -432,7 +436,7 @@ AC_DEFUN([AM_OUTPUT_DEPENDENCY_COMMANDS],
# arguments mandatory, and then we can depend on a new Autoconf
# release and drop the old call support.
AC_DEFUN([AM_INIT_AUTOMAKE],
-[AC_PREREQ([2.62])dnl
+[AC_PREREQ([2.65])dnl
dnl Autoconf wants to disallow AM_ names. We explicitly allow
dnl the ones we care about.
m4_pattern_allow([^AM_[A-Z]+FLAGS$])dnl
@@ -461,31 +465,40 @@ AC_SUBST([CYGPATH_W])
# Define the identity of the package.
dnl Distinguish between old-style and new-style calls.
m4_ifval([$2],
-[m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
+[AC_DIAGNOSE([obsolete],
+ [$0: two- and three-arguments forms are deprecated.])
+m4_ifval([$3], [_AM_SET_OPTION([no-define])])dnl
AC_SUBST([PACKAGE], [$1])dnl
AC_SUBST([VERSION], [$2])],
[_AM_SET_OPTIONS([$1])dnl
dnl Diagnose old-style AC_INIT with new-style AM_AUTOMAKE_INIT.
-m4_if(m4_ifdef([AC_PACKAGE_NAME], 1)m4_ifdef([AC_PACKAGE_VERSION], 1), 11,,
+m4_if(
+ m4_ifdef([AC_PACKAGE_NAME], [ok]):m4_ifdef([AC_PACKAGE_VERSION], [ok]),
+ [ok:ok],,
[m4_fatal([AC_INIT should be called with package and version arguments])])dnl
AC_SUBST([PACKAGE], ['AC_PACKAGE_TARNAME'])dnl
AC_SUBST([VERSION], ['AC_PACKAGE_VERSION'])])dnl
_AM_IF_OPTION([no-define],,
-[AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE", [Name of package])
- AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [Version number of package])])dnl
+[AC_DEFINE_UNQUOTED([PACKAGE], ["$PACKAGE"], [Name of package])
+ AC_DEFINE_UNQUOTED([VERSION], ["$VERSION"], [Version number of package])])dnl
# Some tools Automake needs.
AC_REQUIRE([AM_SANITY_CHECK])dnl
AC_REQUIRE([AC_ARG_PROGRAM])dnl
-AM_MISSING_PROG(ACLOCAL, aclocal-${am__api_version})
-AM_MISSING_PROG(AUTOCONF, autoconf)
-AM_MISSING_PROG(AUTOMAKE, automake-${am__api_version})
-AM_MISSING_PROG(AUTOHEADER, autoheader)
-AM_MISSING_PROG(MAKEINFO, makeinfo)
+AM_MISSING_PROG([ACLOCAL], [aclocal-${am__api_version}])
+AM_MISSING_PROG([AUTOCONF], [autoconf])
+AM_MISSING_PROG([AUTOMAKE], [automake-${am__api_version}])
+AM_MISSING_PROG([AUTOHEADER], [autoheader])
+AM_MISSING_PROG([MAKEINFO], [makeinfo])
AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
AC_REQUIRE([AM_PROG_INSTALL_STRIP])dnl
-AC_REQUIRE([AM_PROG_MKDIR_P])dnl
+AC_REQUIRE([AC_PROG_MKDIR_P])dnl
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+AC_SUBST([mkdir_p], ['$(MKDIR_P)'])
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
AC_REQUIRE([AC_PROG_AWK])dnl
@@ -496,34 +509,78 @@ _AM_IF_OPTION([tar-ustar], [_AM_PROG_TAR([ustar])],
[_AM_PROG_TAR([v7])])])
_AM_IF_OPTION([no-dependencies],,
[AC_PROVIDE_IFELSE([AC_PROG_CC],
- [_AM_DEPENDENCIES(CC)],
- [define([AC_PROG_CC],
- defn([AC_PROG_CC])[_AM_DEPENDENCIES(CC)])])dnl
+ [_AM_DEPENDENCIES([CC])],
+ [m4_define([AC_PROG_CC],
+ m4_defn([AC_PROG_CC])[_AM_DEPENDENCIES([CC])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_CXX],
- [_AM_DEPENDENCIES(CXX)],
- [define([AC_PROG_CXX],
- defn([AC_PROG_CXX])[_AM_DEPENDENCIES(CXX)])])dnl
+ [_AM_DEPENDENCIES([CXX])],
+ [m4_define([AC_PROG_CXX],
+ m4_defn([AC_PROG_CXX])[_AM_DEPENDENCIES([CXX])])])dnl
AC_PROVIDE_IFELSE([AC_PROG_OBJC],
- [_AM_DEPENDENCIES(OBJC)],
- [define([AC_PROG_OBJC],
- defn([AC_PROG_OBJC])[_AM_DEPENDENCIES(OBJC)])])dnl
+ [_AM_DEPENDENCIES([OBJC])],
+ [m4_define([AC_PROG_OBJC],
+ m4_defn([AC_PROG_OBJC])[_AM_DEPENDENCIES([OBJC])])])dnl
+AC_PROVIDE_IFELSE([AC_PROG_OBJCXX],
+ [_AM_DEPENDENCIES([OBJCXX])],
+ [m4_define([AC_PROG_OBJCXX],
+ m4_defn([AC_PROG_OBJCXX])[_AM_DEPENDENCIES([OBJCXX])])])dnl
])
-_AM_IF_OPTION([silent-rules], [AC_REQUIRE([AM_SILENT_RULES])])dnl
-dnl The `parallel-tests' driver may need to know about EXEEXT, so add the
-dnl `am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This macro
-dnl is hooked onto _AC_COMPILER_EXEEXT early, see below.
+AC_REQUIRE([AM_SILENT_RULES])dnl
+dnl The testsuite driver may need to know about EXEEXT, so add the
+dnl 'am__EXEEXT' conditional if _AM_COMPILER_EXEEXT was seen. This
+dnl macro is hooked onto _AC_COMPILER_EXEEXT early, see below.
AC_CONFIG_COMMANDS_PRE(dnl
[m4_provide_if([_AM_COMPILER_EXEEXT],
[AM_CONDITIONAL([am__EXEEXT], [test -n "$EXEEXT"])])])dnl
-])
-dnl Hook into `_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ AC_MSG_ERROR([Your 'rm' program is bad, sorry.])
+ fi
+fi])
+
+dnl Hook into '_AC_COMPILER_EXEEXT' early to learn its expansion. Do not
dnl add the conditional right here, as _AC_COMPILER_EXEEXT may be further
dnl mangled by Autoconf and run in a shell conditional statement.
m4_define([_AC_COMPILER_EXEEXT],
m4_defn([_AC_COMPILER_EXEEXT])[m4_provide([_AM_COMPILER_EXEEXT])])
-
# When config.status generates a header, we must update the stamp-h file.
# This file resides in the same directory as the config header
# that is generated. The stamp files are numbered to have different names.
@@ -545,7 +602,7 @@ for _am_header in $config_headers :; do
done
echo "timestamp for $_am_arg" >`AS_DIRNAME(["$_am_arg"])`/stamp-h[]$_am_stamp_count])
-# Copyright (C) 2001, 2003, 2005, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -564,16 +621,14 @@ if test x"${install_sh}" != xset; then
install_sh="\${SHELL} $am_aux_dir/install-sh"
esac
fi
-AC_SUBST(install_sh)])
+AC_SUBST([install_sh])])
-# Copyright (C) 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2003-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 2
-
# Check whether the underlying file-system supports filenames
# with a leading dot. For instance MS-DOS doesn't.
AC_DEFUN([AM_SET_LEADING_DOT],
@@ -589,14 +644,12 @@ AC_SUBST([am__leading_dot])])
# Check to see how 'make' treats includes. -*- Autoconf -*-
-# Copyright (C) 2001, 2002, 2003, 2005, 2009 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 4
-
# AM_MAKE_INCLUDE()
# -----------------
# Check to see how make treats includes.
@@ -614,7 +667,7 @@ am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
@@ -639,52 +692,14 @@ AC_MSG_RESULT([$_am_result])
rm -f confinc confmf
])
-# Copyright (C) 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# serial 6
-
-# AM_PROG_CC_C_O
-# --------------
-# Like AC_PROG_CC_C_O, but changed for automake.
-AC_DEFUN([AM_PROG_CC_C_O],
-[AC_REQUIRE([AC_PROG_CC_C_O])dnl
-AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
-AC_REQUIRE_AUX_FILE([compile])dnl
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $[2] | sed ['s/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/']`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
- # Losing compiler, so override with the script.
- # FIXME: It is wrong to rewrite CC.
- # But if we don't then we get into trouble of one sort or another.
- # A longer-term fix would be to have automake use am__CC in this case,
- # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
- CC="$am_aux_dir/compile $CC"
-fi
-dnl Make sure AC_PROG_CC is never called again, or it will override our
-dnl setting of CC.
-m4_define([AC_PROG_CC],
- [m4_fatal([AC_PROG_CC cannot be called after AM_PROG_CC_C_O])])
-])
-
# Fake the existence of programs that GNU maintainers use. -*- Autoconf -*-
-# Copyright (C) 1997, 1999, 2000, 2001, 2003, 2004, 2005, 2008
-# Free Software Foundation, Inc.
+# Copyright (C) 1997-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 6
-
# AM_MISSING_PROG(NAME, PROGRAM)
# ------------------------------
AC_DEFUN([AM_MISSING_PROG],
@@ -692,11 +707,10 @@ AC_DEFUN([AM_MISSING_PROG],
$1=${$1-"${am_missing_run}$2"}
AC_SUBST($1)])
-
# AM_MISSING_HAS_RUN
# ------------------
-# Define MISSING if not defined so far and test if it supports --run.
-# If it does, set am_missing_run to use it, otherwise, to nothing.
+# Define MISSING if not defined so far and test if it is modern enough.
+# If it is, set am_missing_run to use it, otherwise, to nothing.
AC_DEFUN([AM_MISSING_HAS_RUN],
[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
AC_REQUIRE_AUX_FILE([missing])dnl
@@ -709,63 +723,35 @@ if test x"${MISSING+set}" != xset; then
esac
fi
# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
else
am_missing_run=
- AC_MSG_WARN([`missing' script is too old or missing])
+ AC_MSG_WARN(['missing' script is too old or missing])
fi
])
-# Copyright (C) 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
-#
-# This file is free software; the Free Software Foundation
-# gives unlimited permission to copy and/or distribute it,
-# with or without modifications, as long as this notice is preserved.
-
-# AM_PROG_MKDIR_P
-# ---------------
-# Check for `mkdir -p'.
-AC_DEFUN([AM_PROG_MKDIR_P],
-[AC_PREREQ([2.60])dnl
-AC_REQUIRE([AC_PROG_MKDIR_P])dnl
-dnl Automake 1.8 to 1.9.6 used to define mkdir_p. We now use MKDIR_P,
-dnl while keeping a definition of mkdir_p for backward compatibility.
-dnl @MKDIR_P@ is magic: AC_OUTPUT adjusts its value for each Makefile.
-dnl However we cannot define mkdir_p as $(MKDIR_P) for the sake of
-dnl Makefile.ins that do not define MKDIR_P, so we do our own
-dnl adjustment using top_builddir (which is defined more often than
-dnl MKDIR_P).
-AC_SUBST([mkdir_p], ["$MKDIR_P"])dnl
-case $mkdir_p in
- [[\\/$]]* | ?:[[\\/]]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-])
-
# Helper functions for option handling. -*- Autoconf -*-
-# Copyright (C) 2001, 2002, 2003, 2005, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 4
-
# _AM_MANGLE_OPTION(NAME)
# -----------------------
AC_DEFUN([_AM_MANGLE_OPTION],
[[_AM_OPTION_]m4_bpatsubst($1, [[^a-zA-Z0-9_]], [_])])
# _AM_SET_OPTION(NAME)
-# ------------------------------
+# --------------------
# Set option NAME. Presently that only means defining a flag for this option.
AC_DEFUN([_AM_SET_OPTION],
-[m4_define(_AM_MANGLE_OPTION([$1]), 1)])
+[m4_define(_AM_MANGLE_OPTION([$1]), [1])])
# _AM_SET_OPTIONS(OPTIONS)
-# ----------------------------------
+# ------------------------
# OPTIONS is a space-separated list of Automake options.
AC_DEFUN([_AM_SET_OPTIONS],
[m4_foreach_w([_AM_Option], [$1], [_AM_SET_OPTION(_AM_Option)])])
@@ -776,24 +762,82 @@ AC_DEFUN([_AM_SET_OPTIONS],
AC_DEFUN([_AM_IF_OPTION],
[m4_ifset(_AM_MANGLE_OPTION([$1]), [$2], [$3])])
-# Check to make sure that the build environment is sane. -*- Autoconf -*-
+# Copyright (C) 1999-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
-# Copyright (C) 1996, 1997, 2000, 2001, 2003, 2005, 2008
-# Free Software Foundation, Inc.
+# _AM_PROG_CC_C_O
+# ---------------
+# Like AC_PROG_CC_C_O, but changed for automake. We rewrite AC_PROG_CC
+# to automatically call this.
+AC_DEFUN([_AM_PROG_CC_C_O],
+[AC_REQUIRE([AM_AUX_DIR_EXPAND])dnl
+AC_REQUIRE_AUX_FILE([compile])dnl
+AC_LANG_PUSH([C])dnl
+AC_CACHE_CHECK(
+ [whether $CC understands -c and -o together],
+ [am_cv_prog_cc_c_o],
+ [AC_LANG_CONFTEST([AC_LANG_PROGRAM([])])
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if AM_RUN_LOG([$CC -c conftest.$ac_ext -o conftest2.$ac_objext]) \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i])
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+AC_LANG_POP([C])])
+
+# For backward compatibility.
+AC_DEFUN_ONCE([AM_PROG_CC_C_O], [AC_REQUIRE([AC_PROG_CC])])
+
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 5
+# AM_RUN_LOG(COMMAND)
+# -------------------
+# Run COMMAND, save the exit status in ac_status, and log it.
+# (This has been adapted from Autoconf's _AC_RUN_LOG macro.)
+AC_DEFUN([AM_RUN_LOG],
+[{ echo "$as_me:$LINENO: $1" >&AS_MESSAGE_LOG_FD
+ ($1) >&AS_MESSAGE_LOG_FD 2>&AS_MESSAGE_LOG_FD
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&AS_MESSAGE_LOG_FD
+ (exit $ac_status); }])
+
+# Check to make sure that the build environment is sane. -*- Autoconf -*-
+
+# Copyright (C) 1996-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
# AM_SANITY_CHECK
# ---------------
AC_DEFUN([AM_SANITY_CHECK],
[AC_MSG_CHECKING([whether build environment is sane])
-# Just in case
-sleep 1
-echo timestamp > conftest.file
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
@@ -804,32 +848,40 @@ case `pwd` in
esac
case $srcdir in
*[[\\\"\#\$\&\'\`$am_lf\ \ ]]*)
- AC_MSG_ERROR([unsafe srcdir value: `$srcdir']);;
+ AC_MSG_ERROR([unsafe srcdir value: '$srcdir']);;
esac
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$[*]" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- rm -f conftest.file
- if test "$[*]" != "X $srcdir/configure conftest.file" \
- && test "$[*]" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
-alias in your environment])
- fi
-
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$[*]" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$[*]" != "X $srcdir/configure conftest.file" \
+ && test "$[*]" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ AC_MSG_ERROR([ls -t appears to fail. Make sure there is not a broken
+ alias in your environment])
+ fi
+ if test "$[2]" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
test "$[2]" = conftest.file
)
then
@@ -839,9 +891,85 @@ else
AC_MSG_ERROR([newly created file is older than distributed files!
Check your system clock])
fi
-AC_MSG_RESULT(yes)])
+AC_MSG_RESULT([yes])
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+AC_CONFIG_COMMANDS_PRE(
+ [AC_MSG_CHECKING([that generated files are newer than configure])
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ AC_MSG_RESULT([done])])
+rm -f conftest.file
+])
+
+# Copyright (C) 2009-2013 Free Software Foundation, Inc.
+#
+# This file is free software; the Free Software Foundation
+# gives unlimited permission to copy and/or distribute it,
+# with or without modifications, as long as this notice is preserved.
+
+# AM_SILENT_RULES([DEFAULT])
+# --------------------------
+# Enable less verbose build rules; with the default set to DEFAULT
+# ("yes" being less verbose, "no" or empty being verbose).
+AC_DEFUN([AM_SILENT_RULES],
+[AC_ARG_ENABLE([silent-rules], [dnl
+AS_HELP_STRING(
+ [--enable-silent-rules],
+ [less verbose build output (undo: "make V=1")])
+AS_HELP_STRING(
+ [--disable-silent-rules],
+ [verbose build output (undo: "make V=0")])dnl
+])
+case $enable_silent_rules in @%:@ (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=m4_if([$1], [yes], [0], [1]);;
+esac
+dnl
+dnl A few 'make' implementations (e.g., NonStop OS and NextStep)
+dnl do not support nested variable expansions.
+dnl See automake bug#9928 and bug#10237.
+am_make=${MAKE-make}
+AC_CACHE_CHECK([whether $am_make supports nested variables],
+ [am_cv_make_support_nested_variables],
+ [if AS_ECHO([['TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit']]) | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi])
+if test $am_cv_make_support_nested_variables = yes; then
+ dnl Using '$V' instead of '$(V)' breaks IRIX make.
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AC_SUBST([AM_V])dnl
+AM_SUBST_NOTMAKE([AM_V])dnl
+AC_SUBST([AM_DEFAULT_V])dnl
+AM_SUBST_NOTMAKE([AM_DEFAULT_V])dnl
+AC_SUBST([AM_DEFAULT_VERBOSITY])dnl
+AM_BACKSLASH='\'
+AC_SUBST([AM_BACKSLASH])dnl
+_AM_SUBST_NOTMAKE([AM_BACKSLASH])dnl
+])
-# Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2001-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
@@ -849,34 +977,32 @@ AC_MSG_RESULT(yes)])
# AM_PROG_INSTALL_STRIP
# ---------------------
-# One issue with vendor `install' (even GNU) is that you can't
+# One issue with vendor 'install' (even GNU) is that you can't
# specify the program used to strip binaries. This is especially
# annoying in cross-compiling environments, where the build's strip
# is unlikely to handle the host's binaries.
# Fortunately install-sh will honor a STRIPPROG variable, so we
-# always use install-sh in `make install-strip', and initialize
+# always use install-sh in "make install-strip", and initialize
# STRIPPROG with the value of the STRIP variable (set by the user).
AC_DEFUN([AM_PROG_INSTALL_STRIP],
[AC_REQUIRE([AM_PROG_INSTALL_SH])dnl
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
-dnl Don't test for $cross_compiling = yes, because it might be `maybe'.
+# will honor the 'STRIP' environment variable to overrule this program.
+dnl Don't test for $cross_compiling = yes, because it might be 'maybe'.
if test "$cross_compiling" != no; then
AC_CHECK_TOOL([STRIP], [strip], :)
fi
INSTALL_STRIP_PROGRAM="\$(install_sh) -c -s"
AC_SUBST([INSTALL_STRIP_PROGRAM])])
-# Copyright (C) 2006, 2008 Free Software Foundation, Inc.
+# Copyright (C) 2006-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 2
-
# _AM_SUBST_NOTMAKE(VARIABLE)
# ---------------------------
# Prevent Automake from outputting VARIABLE = @VARIABLE@ in Makefile.in.
@@ -884,24 +1010,22 @@ AC_SUBST([INSTALL_STRIP_PROGRAM])])
AC_DEFUN([_AM_SUBST_NOTMAKE])
# AM_SUBST_NOTMAKE(VARIABLE)
-# ---------------------------
+# --------------------------
# Public sister of _AM_SUBST_NOTMAKE.
AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Check how to create a tarball. -*- Autoconf -*-
-# Copyright (C) 2004, 2005 Free Software Foundation, Inc.
+# Copyright (C) 2004-2013 Free Software Foundation, Inc.
#
# This file is free software; the Free Software Foundation
# gives unlimited permission to copy and/or distribute it,
# with or without modifications, as long as this notice is preserved.
-# serial 2
-
# _AM_PROG_TAR(FORMAT)
# --------------------
# Check how to create a tarball in format FORMAT.
-# FORMAT should be one of `v7', `ustar', or `pax'.
+# FORMAT should be one of 'v7', 'ustar', or 'pax'.
#
# Substitute a variable $(am__tar) that is a command
# writing to stdout a FORMAT-tarball containing the directory
@@ -911,75 +1035,114 @@ AC_DEFUN([AM_SUBST_NOTMAKE], [_AM_SUBST_NOTMAKE($@)])
# Substitute a variable $(am__untar) that extract such
# a tarball read from stdin.
# $(am__untar) < result.tar
+#
AC_DEFUN([_AM_PROG_TAR],
-[# Always define AMTAR for backward compatibility.
-AM_MISSING_PROG([AMTAR], [tar])
-m4_if([$1], [v7],
- [am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'],
- [m4_case([$1], [ustar],, [pax],,
- [m4_fatal([Unknown tar format])])
-AC_MSG_CHECKING([how to create a $1 tar archive])
-# Loop over all known methods to create a tar archive until one works.
+[# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AC_SUBST([AMTAR], ['$${TAR-tar}'])
+
+# We'll loop over all known methods to create a tar archive until one works.
_am_tools='gnutar m4_if([$1], [ustar], [plaintar]) pax cpio none'
-_am_tools=${am_cv_prog_tar_$1-$_am_tools}
-# Do not fold the above two line into one, because Tru64 sh and
-# Solaris sh will not grok spaces in the rhs of `-'.
-for _am_tool in $_am_tools
-do
- case $_am_tool in
- gnutar)
- for _am_tar in tar gnutar gtar;
- do
- AM_RUN_LOG([$_am_tar --version]) && break
- done
- am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
- am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
- am__untar="$_am_tar -xf -"
- ;;
- plaintar)
- # Must skip GNU tar: if it does not support --format= it doesn't create
- # ustar tarball either.
- (tar --version) >/dev/null 2>&1 && continue
- am__tar='tar chf - "$$tardir"'
- am__tar_='tar chf - "$tardir"'
- am__untar='tar xf -'
- ;;
- pax)
- am__tar='pax -L -x $1 -w "$$tardir"'
- am__tar_='pax -L -x $1 -w "$tardir"'
- am__untar='pax -r'
- ;;
- cpio)
- am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
- am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
- am__untar='cpio -i -H $1 -d'
- ;;
- none)
- am__tar=false
- am__tar_=false
- am__untar=false
- ;;
- esac
- # If the value was cached, stop now. We just wanted to have am__tar
- # and am__untar set.
- test -n "${am_cv_prog_tar_$1}" && break
+m4_if([$1], [v7],
+ [am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'],
+
+ [m4_case([$1],
+ [ustar],
+ [# The POSIX 1988 'ustar' format is defined with fixed-size fields.
+ # There is notably a 21 bits limit for the UID and the GID. In fact,
+ # the 'pax' utility can hang on bigger UID/GID (see automake bug#8343
+ # and bug#13588).
+ am_max_uid=2097151 # 2^21 - 1
+ am_max_gid=$am_max_uid
+ # The $UID and $GID variables are not portable, so we need to resort
+ # to the POSIX-mandated id(1) utility. Errors in the 'id' calls
+ # below are definitely unexpected, so allow the users to see them
+ # (that is, avoid stderr redirection).
+ am_uid=`id -u || echo unknown`
+ am_gid=`id -g || echo unknown`
+ AC_MSG_CHECKING([whether UID '$am_uid' is supported by ustar format])
+ if test $am_uid -le $am_max_uid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi
+ AC_MSG_CHECKING([whether GID '$am_gid' is supported by ustar format])
+ if test $am_gid -le $am_max_gid; then
+ AC_MSG_RESULT([yes])
+ else
+ AC_MSG_RESULT([no])
+ _am_tools=none
+ fi],
+
+ [pax],
+ [],
+
+ [m4_fatal([Unknown tar format])])
+
+ AC_MSG_CHECKING([how to create a $1 tar archive])
+
+ # Go ahead even if we have the value already cached. We do so because we
+ # need to set the values for the 'am__tar' and 'am__untar' variables.
+ _am_tools=${am_cv_prog_tar_$1-$_am_tools}
+
+ for _am_tool in $_am_tools; do
+ case $_am_tool in
+ gnutar)
+ for _am_tar in tar gnutar gtar; do
+ AM_RUN_LOG([$_am_tar --version]) && break
+ done
+ am__tar="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$$tardir"'
+ am__tar_="$_am_tar --format=m4_if([$1], [pax], [posix], [$1]) -chf - "'"$tardir"'
+ am__untar="$_am_tar -xf -"
+ ;;
+ plaintar)
+ # Must skip GNU tar: if it does not support --format= it doesn't create
+ # ustar tarball either.
+ (tar --version) >/dev/null 2>&1 && continue
+ am__tar='tar chf - "$$tardir"'
+ am__tar_='tar chf - "$tardir"'
+ am__untar='tar xf -'
+ ;;
+ pax)
+ am__tar='pax -L -x $1 -w "$$tardir"'
+ am__tar_='pax -L -x $1 -w "$tardir"'
+ am__untar='pax -r'
+ ;;
+ cpio)
+ am__tar='find "$$tardir" -print | cpio -o -H $1 -L'
+ am__tar_='find "$tardir" -print | cpio -o -H $1 -L'
+ am__untar='cpio -i -H $1 -d'
+ ;;
+ none)
+ am__tar=false
+ am__tar_=false
+ am__untar=false
+ ;;
+ esac
- # tar/untar a dummy directory, and stop if the command works
- rm -rf conftest.dir
- mkdir conftest.dir
- echo GrepMe > conftest.dir/file
- AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ # If the value was cached, stop now. We just wanted to have am__tar
+ # and am__untar set.
+ test -n "${am_cv_prog_tar_$1}" && break
+
+ # tar/untar a dummy directory, and stop if the command works.
+ rm -rf conftest.dir
+ mkdir conftest.dir
+ echo GrepMe > conftest.dir/file
+ AM_RUN_LOG([tardir=conftest.dir && eval $am__tar_ >conftest.tar])
+ rm -rf conftest.dir
+ if test -s conftest.tar; then
+ AM_RUN_LOG([$am__untar <conftest.tar])
+ AM_RUN_LOG([cat conftest.dir/file])
+ grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
+ fi
+ done
rm -rf conftest.dir
- if test -s conftest.tar; then
- AM_RUN_LOG([$am__untar <conftest.tar])
- grep GrepMe conftest.dir/file >/dev/null 2>&1 && break
- fi
-done
-rm -rf conftest.dir
-AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
-AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+ AC_CACHE_VAL([am_cv_prog_tar_$1], [am_cv_prog_tar_$1=$_am_tool])
+ AC_MSG_RESULT([$am_cv_prog_tar_$1])])
+
AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
diff --git a/autogen.sh b/autogen.sh
index 7a2624c..a3b71cc 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,9 +1,15 @@
#!/bin/sh
+glibtoolize=$(which glibtoolize 2> /dev/null)
+if [ ${#glibtoolize} -gt 0 ]
+then libtoolize=glibtoolize
+else libtoolize=libtoolize
+fi
+
+mkdir -p m4
aclocal -I m4
autoconf
autoheader
-libtoolize --copy --force
+$libtoolize --copy --force
automake --add-missing --copy
-
diff --git a/config.h b/config.h
index 03f7ffb..0ba87b0 100644
--- a/config.h
+++ b/config.h
@@ -4,6 +4,9 @@
/* Define to 1 if the `closedir' function returns void instead of `int'. */
/* #undef CLOSEDIR_VOID */
+/* Copyright message. */
+#define COPYRIGHT "(C) 2004-2016 Hisham Muhammad"
+
/* Define if ancient vserver support enabled. */
/* #undef HAVE_ANCIENT_VSERVER */
@@ -32,13 +35,16 @@
/* Define to 1 if you have the `hwloc' library (-lhwloc). */
/* #undef HAVE_LIBHWLOC */
+/* Define to 1 if you have the `kvm' library (-lkvm). */
+/* #undef HAVE_LIBKVM */
+
/* Define to 1 if you have the `m' library (-lm). */
#define HAVE_LIBM 1
-/* Define to 1 if you have the `ncurses' library (-lncurses). */
+/* The library is present. */
/* #undef HAVE_LIBNCURSES */
-/* Define to 1 if you have the `ncursesw' library (-lncursesw). */
+/* The library is present. */
#define HAVE_LIBNCURSESW 1
/* Define to 1 if you have the `memmove' function. */
@@ -65,12 +71,12 @@
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
/* #undef HAVE_NDIR_H */
-/* Define if OOM score support enabled. */
-/* #undef HAVE_OOM */
-
/* Define if openvz support enabled. */
/* #undef HAVE_OPENVZ */
+/* Define if using a Linux-compatible proc filesystem. */
+/* #undef HAVE_PROC */
+
/* Define to 1 if `stat' has the bug that it succeeds when given the
zero-length file name argument. */
/* #undef HAVE_STAT_EMPTY_STRING_BUG */
@@ -139,9 +145,6 @@
*/
#define LT_OBJDIR ".libs/"
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-/* #undef NO_MINUS_C_MINUS_O */
-
/* Name of package */
#define PACKAGE "htop"
@@ -152,7 +155,7 @@
#define PACKAGE_NAME "htop"
/* Define to the full name and version of this package. */
-#define PACKAGE_STRING "htop 1.0.3"
+#define PACKAGE_STRING "htop 2.0.0"
/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "htop"
@@ -161,7 +164,7 @@
#define PACKAGE_URL ""
/* Define to the version of this package. */
-#define PACKAGE_VERSION "1.0.3"
+#define PACKAGE_VERSION "2.0.0"
/* Path of proc filesystem */
#define PROCDIR "/proc"
@@ -195,7 +198,7 @@
/* Version number of package */
-#define VERSION "1.0.3"
+#define VERSION "2.0.0"
/* Define to 1 if on MINIX. */
/* #undef _MINIX */
diff --git a/config.h.in b/config.h.in
index 24d0423..cbf4d5a 100644
--- a/config.h.in
+++ b/config.h.in
@@ -3,6 +3,9 @@
/* Define to 1 if the `closedir' function returns void instead of `int'. */
#undef CLOSEDIR_VOID
+/* Copyright message. */
+#undef COPYRIGHT
+
/* Define if ancient vserver support enabled. */
#undef HAVE_ANCIENT_VSERVER
@@ -31,13 +34,16 @@
/* Define to 1 if you have the `hwloc' library (-lhwloc). */
#undef HAVE_LIBHWLOC
+/* Define to 1 if you have the `kvm' library (-lkvm). */
+#undef HAVE_LIBKVM
+
/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM
-/* Define to 1 if you have the `ncurses' library (-lncurses). */
+/* The library is present. */
#undef HAVE_LIBNCURSES
-/* Define to 1 if you have the `ncursesw' library (-lncursesw). */
+/* The library is present. */
#undef HAVE_LIBNCURSESW
/* Define to 1 if you have the `memmove' function. */
@@ -64,12 +70,12 @@
/* Define to 1 if you have the <ndir.h> header file, and it defines `DIR'. */
#undef HAVE_NDIR_H
-/* Define if OOM score support enabled. */
-#undef HAVE_OOM
-
/* Define if openvz support enabled. */
#undef HAVE_OPENVZ
+/* Define if using a Linux-compatible proc filesystem. */
+#undef HAVE_PROC
+
/* Define to 1 if `stat' has the bug that it succeeds when given the
zero-length file name argument. */
#undef HAVE_STAT_EMPTY_STRING_BUG
@@ -138,9 +144,6 @@
*/
#undef LT_OBJDIR
-/* Define to 1 if your C compiler doesn't accept -c and -o together. */
-#undef NO_MINUS_C_MINUS_O
-
/* Name of package */
#undef PACKAGE
diff --git a/configure b/configure
index ed8d76e..70eb844 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.69 for htop 1.0.3.
+# Generated by GNU Autoconf 2.69 for htop 2.0.0.
#
# Report bugs to <hisham@gobolinux.org>.
#
@@ -590,8 +590,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='htop'
PACKAGE_TARNAME='htop'
-PACKAGE_VERSION='1.0.3'
-PACKAGE_STRING='htop 1.0.3'
+PACKAGE_VERSION='2.0.0'
+PACKAGE_STRING='htop 2.0.0'
PACKAGE_BUGREPORT='hisham@gobolinux.org'
PACKAGE_URL=''
@@ -635,14 +635,29 @@ ac_unique_file="htop.c"
ac_subst_vars='am__EXEEXT_FALSE
am__EXEEXT_TRUE
LTLIBOBJS
+my_htop_platform
+HTOP_UNSUPPORTED_FALSE
+HTOP_UNSUPPORTED_TRUE
+HTOP_DARWIN_FALSE
+HTOP_DARWIN_TRUE
+HTOP_OPENBSD_FALSE
+HTOP_OPENBSD_TRUE
+HTOP_FREEBSD_FALSE
+HTOP_FREEBSD_TRUE
+HTOP_LINUX_FALSE
+HTOP_LINUX_TRUE
+wextra_flag
LIBOBJS
OTOOL64
OTOOL
LIPO
NMEDIT
DSYMUTIL
+MANIFEST_TOOL
RANLIB
+ac_ct_AR
AR
+DLLTOOL
OBJDUMP
LN_S
NM
@@ -652,9 +667,14 @@ LD
FGREP
SED
LIBTOOL
+AM_BACKSLASH
+AM_DEFAULT_VERBOSITY
+AM_DEFAULT_V
+AM_V
am__fastdepCC_FALSE
am__fastdepCC_TRUE
CCDEPMODE
+am__nodep
AMDEPBACKSLASH
AMDEP_FALSE
AMDEP_TRUE
@@ -748,12 +768,15 @@ ac_subst_files=''
ac_user_opts='
enable_option_checking
enable_dependency_tracking
+enable_silent_rules
enable_shared
enable_static
with_pic
enable_fast_install
with_gnu_ld
+with_sysroot
enable_libtool_lock
+enable_proc
with_proc
enable_openvz
enable_cgroup
@@ -763,7 +786,6 @@ enable_taskstats
enable_unicode
enable_native_affinity
enable_hwloc
-enable_oom
'
ac_precious_vars='build_alias
host_alias
@@ -1314,7 +1336,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
-\`configure' configures htop 1.0.3 to adapt to many kinds of systems.
+\`configure' configures htop 2.0.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@@ -1385,7 +1407,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
- short | recursive ) echo "Configuration of htop 1.0.3:";;
+ short | recursive ) echo "Configuration of htop 2.0.0:";;
esac
cat <<\_ACEOF
@@ -1393,13 +1415,18 @@ Optional Features:
--disable-option-checking ignore unrecognized --enable/--with options
--disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no)
--enable-FEATURE[=ARG] include FEATURE [ARG=yes]
- --disable-dependency-tracking speeds up one-time build
- --enable-dependency-tracking do not reject slow dependency extractors
+ --enable-dependency-tracking
+ do not reject slow dependency extractors
+ --disable-dependency-tracking
+ speeds up one-time build
+ --enable-silent-rules less verbose build output (undo: "make V=1")
+ --disable-silent-rules verbose build output (undo: "make V=0")
--enable-shared[=PKGS] build shared libraries [default=no]
--enable-static[=PKGS] build static libraries [default=yes]
--enable-fast-install[=PKGS]
optimize for fast installation [default=yes]
--disable-libtool-lock avoid locking (might break parallel builds)
+ --enable-proc use Linux-compatible proc filesystem
--enable-openvz enable OpenVZ support
--enable-cgroup enable cgroups support
--enable-vserver enable VServer support
@@ -1414,15 +1441,17 @@ Optional Features:
sched_getaffinity for affinity support, disables
hwloc
--enable-hwloc enable hwloc support for CPU affinity
- --enable-oom enable OOM score reporting
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
- --with-pic try to use only PIC/non-PIC objects [default=use
+ --with-pic[=PKGS] try to use only PIC/non-PIC objects [default=use
both]
--with-gnu-ld assume the C compiler uses GNU ld [default=no]
- --with-proc=DIR Location of a Linux-compatible proc filesystem (default=/proc).
+ --with-sysroot=DIR Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).
+ --with-proc=DIR Location of a Linux-compatible proc filesystem
+ (default=/proc).
Some influential environment variables:
CC C compiler command
@@ -1500,7 +1529,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
-htop configure 1.0.3
+htop configure 2.0.0
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@@ -1923,7 +1952,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
-It was created by htop $as_me 1.0.3, which was
+It was created by htop $as_me 2.0.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@@ -2272,7 +2301,12 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu
+year=$(date +%Y)
+
# The following two lines are required by hwloc scripts
+# expand $ac_aux_dir to an absolute path
+am_aux_dir=`cd $ac_aux_dir && pwd`
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -3062,6 +3096,65 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+ ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
+ fi
+ done
+ rm -f core conftest*
+ unset am_i
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
+ # Losing compiler, so override with the script.
+ # FIXME: It is wrong to rewrite CC.
+ # But if we don't then we get into trouble of one sort or another.
+ # A longer-term fix would be to have automake use am__CC in this case,
+ # and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
+ CC="$am_aux_dir/compile $CC"
+fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
+
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
@@ -3661,7 +3754,7 @@ test -n "$target_alias" &&
NONENONEs,x,x, &&
program_prefix=${target_alias}-
-am__api_version='1.11'
+am__api_version='1.14'
# Find a good install program. We prefer a C program (faster),
# so one script is as good as another. But avoid the broken or
@@ -3758,9 +3851,6 @@ test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether build environment is sane" >&5
$as_echo_n "checking whether build environment is sane... " >&6; }
-# Just in case
-sleep 1
-echo timestamp > conftest.file
# Reject unsafe characters in $srcdir or the absolute working directory
# name. Accept space and tab only in the latter.
am_lf='
@@ -3771,32 +3861,40 @@ case `pwd` in
esac
case $srcdir in
*[\\\"\#\$\&\'\`$am_lf\ \ ]*)
- as_fn_error $? "unsafe srcdir value: \`$srcdir'" "$LINENO" 5;;
+ as_fn_error $? "unsafe srcdir value: '$srcdir'" "$LINENO" 5;;
esac
-# Do `set' in a subshell so we don't clobber the current shell's
+# Do 'set' in a subshell so we don't clobber the current shell's
# arguments. Must try -L first in case configure is actually a
# symlink; some systems play weird games with the mod time of symlinks
# (eg FreeBSD returns the mod time of the symlink's containing
# directory).
if (
- set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
- if test "$*" = "X"; then
- # -L didn't work.
- set X `ls -t "$srcdir/configure" conftest.file`
- fi
- rm -f conftest.file
- if test "$*" != "X $srcdir/configure conftest.file" \
- && test "$*" != "X conftest.file $srcdir/configure"; then
-
- # If neither matched, then we have a broken ls. This can happen
- # if, for instance, CONFIG_SHELL is bash and it inherits a
- # broken ls alias from the environment. This has actually
- # happened. Such a system could not be considered "sane".
- as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
-alias in your environment" "$LINENO" 5
- fi
-
+ am_has_slept=no
+ for am_try in 1 2; do
+ echo "timestamp, slept: $am_has_slept" > conftest.file
+ set X `ls -Lt "$srcdir/configure" conftest.file 2> /dev/null`
+ if test "$*" = "X"; then
+ # -L didn't work.
+ set X `ls -t "$srcdir/configure" conftest.file`
+ fi
+ if test "$*" != "X $srcdir/configure conftest.file" \
+ && test "$*" != "X conftest.file $srcdir/configure"; then
+
+ # If neither matched, then we have a broken ls. This can happen
+ # if, for instance, CONFIG_SHELL is bash and it inherits a
+ # broken ls alias from the environment. This has actually
+ # happened. Such a system could not be considered "sane".
+ as_fn_error $? "ls -t appears to fail. Make sure there is not a broken
+ alias in your environment" "$LINENO" 5
+ fi
+ if test "$2" = conftest.file || test $am_try -eq 2; then
+ break
+ fi
+ # Just in case.
+ sleep 1
+ am_has_slept=yes
+ done
test "$2" = conftest.file
)
then
@@ -3808,6 +3906,16 @@ Check your system clock" "$LINENO" 5
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
$as_echo "yes" >&6; }
+# If we didn't sleep, we still need to ensure time stamps of config.status and
+# generated files are strictly newer.
+am_sleep_pid=
+if grep 'slept: no' conftest.file >/dev/null 2>&1; then
+ ( sleep 1 ) &
+ am_sleep_pid=$!
+fi
+
+rm -f conftest.file
+
test "$program_prefix" != NONE &&
program_transform_name="s&^&$program_prefix&;$program_transform_name"
# Use a double $ so make ignores it.
@@ -3818,9 +3926,6 @@ test "$program_suffix" != NONE &&
ac_script='s/[\\$]/&&/g;s/;s,x,x,$//'
program_transform_name=`$as_echo "$program_transform_name" | sed "$ac_script"`
-# expand $ac_aux_dir to an absolute path
-am_aux_dir=`cd $ac_aux_dir && pwd`
-
if test x"${MISSING+set}" != xset; then
case $am_aux_dir in
*\ * | *\ *)
@@ -3830,12 +3935,12 @@ if test x"${MISSING+set}" != xset; then
esac
fi
# Use eval to expand $SHELL
-if eval "$MISSING --run true"; then
- am_missing_run="$MISSING --run "
+if eval "$MISSING --is-lightweight"; then
+ am_missing_run="$MISSING "
else
am_missing_run=
- { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \`missing' script is too old or missing" >&5
-$as_echo "$as_me: WARNING: \`missing' script is too old or missing" >&2;}
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: 'missing' script is too old or missing" >&5
+$as_echo "$as_me: WARNING: 'missing' script is too old or missing" >&2;}
fi
if test x"${install_sh}" != xset; then
@@ -3847,10 +3952,10 @@ if test x"${install_sh}" != xset; then
esac
fi
-# Installed binaries are usually stripped using `strip' when the user
-# run `make install-strip'. However `strip' might not be the right
+# Installed binaries are usually stripped using 'strip' when the user
+# run "make install-strip". However 'strip' might not be the right
# tool to use in cross-compilation environments, therefore Automake
-# will honor the `STRIP' environment variable to overrule this program.
+# will honor the 'STRIP' environment variable to overrule this program.
if test "$cross_compiling" != no; then
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
@@ -3989,12 +4094,6 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $MKDIR_P" >&5
$as_echo "$MKDIR_P" >&6; }
-mkdir_p="$MKDIR_P"
-case $mkdir_p in
- [\\/$]* | ?:[\\/]*) ;;
- */*) mkdir_p="\$(top_builddir)/$mkdir_p" ;;
-esac
-
for ac_prog in gawk mawk nawk awk
do
# Extract the first word of "$ac_prog", so it can be a program name with args.
@@ -4096,7 +4195,7 @@ am__quote=
_am_result=none
# First try GNU make style include.
echo "include confinc" > confmf
-# Ignore all kinds of additional output from `make'.
+# Ignore all kinds of additional output from 'make'.
case `$am_make -s -f confmf 2> /dev/null` in #(
*the\ am__doit\ target*)
am__include=include
@@ -4129,6 +4228,7 @@ fi
if test "x$enable_dependency_tracking" != xno; then
am_depcomp="$ac_aux_dir/depcomp"
AMDEPBACKSLASH='\'
+ am__nodep='_no'
fi
if test "x$enable_dependency_tracking" != xno; then
AMDEP_TRUE=
@@ -4139,6 +4239,45 @@ else
fi
+# Check whether --enable-silent-rules was given.
+if test "${enable_silent_rules+set}" = set; then :
+ enableval=$enable_silent_rules;
+fi
+
+case $enable_silent_rules in # (((
+ yes) AM_DEFAULT_VERBOSITY=0;;
+ no) AM_DEFAULT_VERBOSITY=1;;
+ *) AM_DEFAULT_VERBOSITY=1;;
+esac
+am_make=${MAKE-make}
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $am_make supports nested variables" >&5
+$as_echo_n "checking whether $am_make supports nested variables... " >&6; }
+if ${am_cv_make_support_nested_variables+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if $as_echo 'TRUE=$(BAR$(V))
+BAR0=false
+BAR1=true
+V=1
+am__doit:
+ @$(TRUE)
+.PHONY: am__doit' | $am_make -f - >/dev/null 2>&1; then
+ am_cv_make_support_nested_variables=yes
+else
+ am_cv_make_support_nested_variables=no
+fi
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_make_support_nested_variables" >&5
+$as_echo "$am_cv_make_support_nested_variables" >&6; }
+if test $am_cv_make_support_nested_variables = yes; then
+ AM_V='$(V)'
+ AM_DEFAULT_V='$(AM_DEFAULT_VERBOSITY)'
+else
+ AM_V=$AM_DEFAULT_VERBOSITY
+ AM_DEFAULT_V=$AM_DEFAULT_VERBOSITY
+fi
+AM_BACKSLASH='\'
+
if test "`cd $srcdir && pwd`" != "`pwd`"; then
# Use -I$(srcdir) only when $(srcdir) != ., so that make's output
# is not polluted with repeated "-I."
@@ -4161,7 +4300,7 @@ fi
# Define the identity of the package.
PACKAGE='htop'
- VERSION='1.0.3'
+ VERSION='2.0.0'
cat >>confdefs.h <<_ACEOF
@@ -4189,13 +4328,24 @@ AUTOHEADER=${AUTOHEADER-"${am_missing_run}autoheader"}
MAKEINFO=${MAKEINFO-"${am_missing_run}makeinfo"}
+# For better backward compatibility. To be removed once Automake 1.9.x
+# dies out for good. For more background, see:
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00001.html>
+# <http://lists.gnu.org/archive/html/automake/2012-07/msg00014.html>
+mkdir_p='$(MKDIR_P)'
+
# We need awk for the "check" target. The system "awk" is bad on
# some platforms.
-# Always define AMTAR for backward compatibility.
+# Always define AMTAR for backward compatibility. Yes, it's still used
+# in the wild :-( We should find a proper way to deprecate it ...
+AMTAR='$${TAR-tar}'
+
+
+# We'll loop over all known methods to create a tar archive until one works.
+_am_tools='gnutar pax cpio none'
-AMTAR=${AMTAR-"${am_missing_run}tar"}
+am__tar='$${TAR-tar} chof - "$$tardir"' am__untar='$${TAR-tar} xf -'
-am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
@@ -4211,8 +4361,9 @@ else
# We make a subdir and do the tests there. Otherwise we can end up
# making bogus files that we don't know about and never remove. For
# instance it was reported that on HP-UX the gcc test will end up
- # making a dummy file named `D' -- because `-MD' means `put the output
- # in D'.
+ # making a dummy file named 'D' -- because '-MD' means "put the output
+ # in D".
+ rm -rf conftest.dir
mkdir conftest.dir
# Copy depcomp to subdir because otherwise we won't find it if we're
# using a relative directory.
@@ -4246,16 +4397,16 @@ else
: > sub/conftest.c
for i in 1 2 3 4 5 6; do
echo '#include "conftst'$i'.h"' >> sub/conftest.c
- # Using `: > sub/conftst$i.h' creates only sub/conftst1.h with
- # Solaris 8's {/usr,}/bin/sh.
- touch sub/conftst$i.h
+ # Using ": > sub/conftst$i.h" creates only sub/conftst1.h with
+ # Solaris 10 /bin/sh.
+ echo '/* dummy */' > sub/conftst$i.h
done
echo "${am__include} ${am__quote}sub/conftest.Po${am__quote}" > confmf
- # We check with `-c' and `-o' for the sake of the "dashmstdout"
+ # We check with '-c' and '-o' for the sake of the "dashmstdout"
# mode. It turns out that the SunPro C++ compiler does not properly
- # handle `-M -o', and we need to detect this. Also, some Intel
- # versions had trouble with output in subdirs
+ # handle '-M -o', and we need to detect this. Also, some Intel
+ # versions had trouble with output in subdirs.
am__obj=sub/conftest.${OBJEXT-o}
am__minus_obj="-o $am__obj"
case $depmode in
@@ -4264,16 +4415,16 @@ else
test "$am__universal" = false || continue
;;
nosideeffect)
- # after this tag, mechanisms are not by side-effect, so they'll
- # only be used when explicitly requested
+ # After this tag, mechanisms are not by side-effect, so they'll
+ # only be used when explicitly requested.
if test "x$enable_dependency_tracking" = xyes; then
continue
else
break
fi
;;
- msvisualcpp | msvcmsys)
- # This compiler won't grok `-c -o', but also, the minuso test has
+ msvc7 | msvc7msys | msvisualcpp | msvcmsys)
+ # This compiler won't grok '-c -o', but also, the minuso test has
# not run yet. These depmodes are late enough in the game, and
# so weak that their functioning should not be impacted.
am__obj=conftest.${OBJEXT-o}
@@ -4328,12 +4479,54 @@ fi
+# POSIX will say in a future version that running "rm -f" with no argument
+# is OK; and we want to be able to make that assumption in our Makefile
+# recipes. So use an aggressive probe to check that the usage we want is
+# actually supported "in the wild" to an acceptable degree.
+# See automake bug#10828.
+# To make any issue more visible, cause the running configure to be aborted
+# by default if the 'rm' program in use doesn't match our expectations; the
+# user can still override this though.
+if rm -f && rm -fr && rm -rf; then : OK; else
+ cat >&2 <<'END'
+Oops!
+
+Your 'rm' program seems unable to run without file operands specified
+on the command line, even when the '-f' option is present. This is contrary
+to the behaviour of most rm programs out there, and not conforming with
+the upcoming POSIX standard: <http://austingroupbugs.net/view.php?id=542>
+
+Please tell bug-automake@gnu.org about your system, including the value
+of your $PATH and any error possibly output before this message. This
+can help us improve future automake versions.
+
+END
+ if test x"$ACCEPT_INFERIOR_RM_PROGRAM" = x"yes"; then
+ echo 'Configuration will proceed anyway, since you have set the' >&2
+ echo 'ACCEPT_INFERIOR_RM_PROGRAM variable to "yes"' >&2
+ echo >&2
+ else
+ cat >&2 <<'END'
+Aborting the configuration process, to ensure you take notice of the issue.
+
+You can download and install GNU coreutils to get an 'rm' implementation
+that behaves properly: <http://www.gnu.org/software/coreutils/>.
+
+If you want to complete the configuration process using your problematic
+'rm' anyway, export the environment variable ACCEPT_INFERIOR_RM_PROGRAM
+to "yes", and re-run configure.
+
+END
+ as_fn_error $? "Your 'rm' program is bad, sorry." "$LINENO" 5
+ fi
+fi
ac_config_headers="$ac_config_headers config.h"
# Checks for programs.
+# ----------------------------------------------------------------------
ac_ext=c
ac_cpp='$CPP $CPPFLAGS'
ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
@@ -4873,16 +5066,14 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
ac_compiler_gnu=$ac_cv_c_compiler_gnu
-if test "x$CC" != xcc; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC and cc understand -c and -o together" >&5
-$as_echo_n "checking whether $CC and cc understand -c and -o together... " >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether cc understands -c and -o together" >&5
-$as_echo_n "checking whether cc understands -c and -o together... " >&6; }
-fi
-set dummy $CC; ac_cc=`$as_echo "$2" |
- sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-if eval \${ac_cv_prog_cc_${ac_cc}_c_o+:} false; then :
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether $CC understands -c and -o together" >&5
+$as_echo_n "checking whether $CC understands -c and -o together... " >&6; }
+if ${am_cv_prog_cc_c_o+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
@@ -4896,100 +5087,30 @@ main ()
return 0;
}
_ACEOF
-# Make sure it works both with $CC and with simple cc.
-# We do the test twice because some compilers refuse to overwrite an
-# existing .o file with -o, though they will create one.
-ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
-rm -f conftest2.*
-if { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } &&
- test -f conftest2.$ac_objext && { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; };
-then
- eval ac_cv_prog_cc_${ac_cc}_c_o=yes
- if test "x$CC" != xcc; then
- # Test first that cc exists at all.
- if { ac_try='cc -c conftest.$ac_ext >&5'
- { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; }; }; then
- ac_try='cc -c conftest.$ac_ext -o conftest2.$ac_objext >&5'
- rm -f conftest2.*
- if { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; } &&
- test -f conftest2.$ac_objext && { { case "(($ac_try" in
- *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
- *) ac_try_echo=$ac_try;;
-esac
-eval ac_try_echo="\"\$as_me:${as_lineno-$LINENO}: $ac_try_echo\""
-$as_echo "$ac_try_echo"; } >&5
- (eval "$ac_try") 2>&5
- ac_status=$?
- $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
- test $ac_status = 0; };
- then
- # cc works too.
- :
- else
- # cc exists but doesn't like -o.
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
- fi
+ # Make sure it works both with $CC and with simple cc.
+ # Following AC_PROG_CC_C_O, we do the test twice because some
+ # compilers refuse to overwrite an existing .o file with -o,
+ # though they will create one.
+ am_cv_prog_cc_c_o=yes
+ for am_i in 1 2; do
+ if { echo "$as_me:$LINENO: $CC -c conftest.$ac_ext -o conftest2.$ac_objext" >&5
+ ($CC -c conftest.$ac_ext -o conftest2.$ac_objext) >&5 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } \
+ && test -f conftest2.$ac_objext; then
+ : OK
+ else
+ am_cv_prog_cc_c_o=no
+ break
fi
- fi
-else
- eval ac_cv_prog_cc_${ac_cc}_c_o=no
-fi
-rm -f core conftest*
-
-fi
-if eval test \$ac_cv_prog_cc_${ac_cc}_c_o = yes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
-$as_echo "yes" >&6; }
-else
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
-$as_echo "no" >&6; }
-
-$as_echo "#define NO_MINUS_C_MINUS_O 1" >>confdefs.h
-
+ done
+ rm -f core conftest*
+ unset am_i
fi
-
-# FIXME: we rely on the cache variable name because
-# there is no other way.
-set dummy $CC
-am_cc=`echo $2 | sed 's/[^a-zA-Z0-9_]/_/g;s/^[0-9]/_/'`
-eval am_t=\$ac_cv_prog_cc_${am_cc}_c_o
-if test "$am_t" != yes; then
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $am_cv_prog_cc_c_o" >&5
+$as_echo "$am_cv_prog_cc_c_o" >&6; }
+if test "$am_cv_prog_cc_c_o" != yes; then
# Losing compiler, so override with the script.
# FIXME: It is wrong to rewrite CC.
# But if we don't then we get into trouble of one sort or another.
@@ -4997,6 +5118,12 @@ if test "$am_t" != yes; then
# and then we could set am__CC="\$(top_srcdir)/compile \$(CC)"
CC="$am_aux_dir/compile $CC"
fi
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5'
+ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5'
+ac_compiler_gnu=$ac_cv_c_compiler_gnu
+
@@ -5070,8 +5197,8 @@ esac
-macro_version='2.2.10'
-macro_revision='1.3175'
+macro_version='2.4.2'
+macro_revision='1.3337'
@@ -5111,7 +5238,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to print strings" >&5
$as_echo_n "checking how to print strings... " >&6; }
# Test print first, because it will be a builtin if present.
-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
ECHO='print -r --'
elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
@@ -5715,6 +5842,11 @@ else
lt_cv_sys_max_cmd_len=196608
;;
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
osf*)
# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
@@ -5754,7 +5886,7 @@ else
# If test is not a shell built-in, we'll probably end up computing a
# maximum length that is only half of the actual maximum length, but
# we can't tell.
- while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+ while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
= "X$teststring$teststring"; } >/dev/null 2>&1 &&
test $i != 17 # 1/2 MB should be enough
do
@@ -5797,8 +5929,8 @@ $as_echo_n "checking whether the shell understands some XSI constructs... " >&6;
# Try some XSI features
xsi_shell=no
( _lt_dummy="a/b/c"
- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
- = c,a/b,, \
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
&& eval 'test $(( 1 + 1 )) -eq 2 \
&& test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
&& xsi_shell=yes
@@ -5847,6 +5979,80 @@ esac
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to $host format" >&5
+$as_echo_n "checking how to convert $build file names to $host format... " >&6; }
+if ${lt_cv_to_host_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
+ ;;
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
+ ;;
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+
+fi
+
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_host_file_cmd" >&5
+$as_echo "$lt_cv_to_host_file_cmd" >&6; }
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to convert $build file names to toolchain format" >&5
+$as_echo_n "checking how to convert $build file names to toolchain format... " >&6; }
+if ${lt_cv_to_tool_file_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ #assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
+
+fi
+
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_to_tool_file_cmd" >&5
+$as_echo "$lt_cv_to_tool_file_cmd" >&6; }
+
+
+
+
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $LD option to reload object files" >&5
$as_echo_n "checking for $LD option to reload object files... " >&6; }
if ${lt_cv_ld_reload_flag+:} false; then :
@@ -5863,6 +6069,11 @@ case $reload_flag in
esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
darwin*)
if test "$GCC" = yes; then
reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
@@ -6104,7 +6315,7 @@ irix5* | irix6* | nonstopux*)
lt_cv_deplibs_check_method=pass_all
;;
-# This must be Linux ELF.
+# This must be glibc/ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
@@ -6186,6 +6397,21 @@ esac
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_deplibs_check_method" >&5
$as_echo "$lt_cv_deplibs_check_method" >&6; }
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[\1]\/[\1]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
test -z "$deplibs_check_method" && deplibs_check_method=unknown
@@ -6201,9 +6427,162 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
+
+
+
+
+
+
+
+
+
+
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}dlltool", so it can be a program name with args.
+set dummy ${ac_tool_prefix}dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$DLLTOOL"; then
+ ac_cv_prog_DLLTOOL="$DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_DLLTOOL="${ac_tool_prefix}dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+DLLTOOL=$ac_cv_prog_DLLTOOL
+if test -n "$DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $DLLTOOL" >&5
+$as_echo "$DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_DLLTOOL"; then
+ ac_ct_DLLTOOL=$DLLTOOL
+ # Extract the first word of "dlltool", so it can be a program name with args.
+set dummy dlltool; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_DLLTOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_DLLTOOL"; then
+ ac_cv_prog_ac_ct_DLLTOOL="$ac_ct_DLLTOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_DLLTOOL="dlltool"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_DLLTOOL=$ac_cv_prog_ac_ct_DLLTOOL
+if test -n "$ac_ct_DLLTOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_DLLTOOL" >&5
+$as_echo "$ac_ct_DLLTOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_DLLTOOL" = x; then
+ DLLTOOL="false"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ DLLTOOL=$ac_ct_DLLTOOL
+ fi
+else
+ DLLTOOL="$ac_cv_prog_DLLTOOL"
+fi
+
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+
+
+
+
+
+
+
+
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking how to associate runtime and link libraries" >&5
+$as_echo_n "checking how to associate runtime and link libraries... " >&6; }
+if ${lt_cv_sharedlib_from_linklib_cmd+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_sharedlib_from_linklib_cmd" >&5
+$as_echo "$lt_cv_sharedlib_from_linklib_cmd" >&6; }
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+
+
+
+
+
+
if test -n "$ac_tool_prefix"; then
- # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args.
-set dummy ${ac_tool_prefix}ar; ac_word=$2
+ for ac_prog in ar
+ do
+ # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args.
+set dummy $ac_tool_prefix$ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_AR+:} false; then :
@@ -6219,7 +6598,7 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_AR="${ac_tool_prefix}ar"
+ ac_cv_prog_AR="$ac_tool_prefix$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -6239,11 +6618,15 @@ $as_echo "no" >&6; }
fi
+ test -n "$AR" && break
+ done
fi
-if test -z "$ac_cv_prog_AR"; then
+if test -z "$AR"; then
ac_ct_AR=$AR
- # Extract the first word of "ar", so it can be a program name with args.
-set dummy ar; ac_word=$2
+ for ac_prog in ar
+do
+ # Extract the first word of "$ac_prog", so it can be a program name with args.
+set dummy $ac_prog; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_prog_ac_ct_AR+:} false; then :
@@ -6259,7 +6642,7 @@ do
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
- ac_cv_prog_ac_ct_AR="ar"
+ ac_cv_prog_ac_ct_AR="$ac_prog"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
@@ -6278,6 +6661,10 @@ else
$as_echo "no" >&6; }
fi
+
+ test -n "$ac_ct_AR" && break
+done
+
if test "x$ac_ct_AR" = x; then
AR="false"
else
@@ -6289,12 +6676,10 @@ ac_tool_warned=yes ;;
esac
AR=$ac_ct_AR
fi
-else
- AR="$ac_cv_prog_AR"
fi
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
+: ${AR=ar}
+: ${AR_FLAGS=cru}
@@ -6306,6 +6691,64 @@ test -z "$AR_FLAGS" && AR_FLAGS=cru
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for archiver @FILE support" >&5
+$as_echo_n "checking for archiver @FILE support... " >&6; }
+if ${lt_cv_ar_at_file+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_ar_at_file=no
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+ echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&5'
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$lt_ar_try\""; } >&5
+ (eval $lt_ar_try) 2>&5
+ ac_status=$?
+ $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+ test $ac_status = 0; }
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ar_at_file" >&5
+$as_echo "$lt_cv_ar_at_file" >&6; }
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+
+
+
+
+
+
+
if test -n "$ac_tool_prefix"; then
# Extract the first word of "${ac_tool_prefix}strip", so it can be a program name with args.
set dummy ${ac_tool_prefix}strip; ac_word=$2
@@ -6512,13 +6955,13 @@ old_postuninstall_cmds=
if test -n "$RANLIB"; then
case $host_os in
openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
;;
*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
;;
esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
fi
case $host_os in
@@ -6640,8 +7083,8 @@ esac
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([^ ]*\)[ ]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([^ ]*\) \(lib[^ ]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([^ ]*\) \([^ ]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
# Handle CRLF in mingw tool chain
opt_cr=
@@ -6665,6 +7108,7 @@ for ac_symprfx in "" "_"; do
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK '"\
" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
" \$ 0!~/External *\|/{next};"\
" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
@@ -6677,6 +7121,7 @@ for ac_symprfx in "" "_"; do
else
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[ ]\($symcode$symcode*\)[ ][ ]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
# Check to see that the pipe works correctly.
pipe_works=no
@@ -6718,6 +7163,18 @@ _LT_EOF
if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -6729,7 +7186,7 @@ _LT_EOF
cat <<_LT_EOF >> conftest.$ac_ext
/* The mapping between symbol names and symbols. */
-const struct {
+LT_DLSYM_CONST struct {
const char *name;
void *address;
}
@@ -6755,8 +7212,8 @@ static const void *lt_preloaded_setup() {
_LT_EOF
# Now try linking the two files.
mv conftest.$ac_objext conftstm.$ac_objext
- lt_save_LIBS="$LIBS"
- lt_save_CFLAGS="$CFLAGS"
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
LIBS="conftstm.$ac_objext"
CFLAGS="$CFLAGS$lt_prog_compiler_no_builtin_flag"
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_link\""; } >&5
@@ -6766,8 +7223,8 @@ _LT_EOF
test $ac_status = 0; } && test -s conftest${ac_exeext}; then
pipe_works=yes
fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
else
echo "cannot find nm_test_func in $nlist" >&5
fi
@@ -6804,6 +7261,16 @@ else
$as_echo "ok" >&6; }
fi
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[@]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
+
+
+
@@ -6825,6 +7292,45 @@ fi
+
+
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for sysroot" >&5
+$as_echo_n "checking for sysroot... " >&6; }
+
+# Check whether --with-sysroot was given.
+if test "${with_sysroot+set}" = set; then :
+ withval=$with_sysroot;
+else
+ with_sysroot=no
+fi
+
+
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${with_sysroot}" >&5
+$as_echo "${with_sysroot}" >&6; }
+ as_fn_error $? "The sysroot must be an absolute path." "$LINENO" 5
+ ;;
+esac
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: ${lt_sysroot:-no}" >&5
+$as_echo "${lt_sysroot:-no}" >&6; }
+
+
+
+
+
# Check whether --enable-libtool-lock was given.
if test "${enable_libtool_lock+set}" = set; then :
enableval=$enable_libtool_lock;
@@ -6991,7 +7497,7 @@ $as_echo "$lt_cv_cc_needs_belf" >&6; }
CFLAGS="$SAVE_CFLAGS"
fi
;;
-sparc*-*solaris*)
+*-*solaris*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if { { eval echo "\"\$as_me\":${as_lineno-$LINENO}: \"$ac_compile\""; } >&5
@@ -7002,7 +7508,20 @@ sparc*-*solaris*)
case `/usr/bin/file conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
- yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ yes*)
+ case $host in
+ i?86-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD="${LD-ld}_sol2"
+ fi
+ ;;
*)
if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
LD="${LD-ld} -64"
@@ -7018,6 +7537,123 @@ esac
need_locks="$enable_libtool_lock"
+if test -n "$ac_tool_prefix"; then
+ # Extract the first word of "${ac_tool_prefix}mt", so it can be a program name with args.
+set dummy ${ac_tool_prefix}mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$MANIFEST_TOOL"; then
+ ac_cv_prog_MANIFEST_TOOL="$MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_MANIFEST_TOOL="${ac_tool_prefix}mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+MANIFEST_TOOL=$ac_cv_prog_MANIFEST_TOOL
+if test -n "$MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $MANIFEST_TOOL" >&5
+$as_echo "$MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+fi
+if test -z "$ac_cv_prog_MANIFEST_TOOL"; then
+ ac_ct_MANIFEST_TOOL=$MANIFEST_TOOL
+ # Extract the first word of "mt", so it can be a program name with args.
+set dummy mt; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_prog_ac_ct_MANIFEST_TOOL+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ if test -n "$ac_ct_MANIFEST_TOOL"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="$ac_ct_MANIFEST_TOOL" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+ IFS=$as_save_IFS
+ test -z "$as_dir" && as_dir=.
+ for ac_exec_ext in '' $ac_executable_extensions; do
+ if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+ ac_cv_prog_ac_ct_MANIFEST_TOOL="mt"
+ $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+ break 2
+ fi
+done
+ done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_MANIFEST_TOOL=$ac_cv_prog_ac_ct_MANIFEST_TOOL
+if test -n "$ac_ct_MANIFEST_TOOL"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_ct_MANIFEST_TOOL" >&5
+$as_echo "$ac_ct_MANIFEST_TOOL" >&6; }
+else
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+ if test "x$ac_ct_MANIFEST_TOOL" = x; then
+ MANIFEST_TOOL=":"
+ else
+ case $cross_compiling:$ac_tool_warned in
+yes:)
+{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: using cross tools not prefixed with host triplet" >&5
+$as_echo "$as_me: WARNING: using cross tools not prefixed with host triplet" >&2;}
+ac_tool_warned=yes ;;
+esac
+ MANIFEST_TOOL=$ac_ct_MANIFEST_TOOL
+ fi
+else
+ MANIFEST_TOOL="$ac_cv_prog_MANIFEST_TOOL"
+fi
+
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if $MANIFEST_TOOL is a manifest tool" >&5
+$as_echo_n "checking if $MANIFEST_TOOL is a manifest tool... " >&6; }
+if ${lt_cv_path_mainfest_tool+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&5
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&5
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_path_mainfest_tool" >&5
+$as_echo "$lt_cv_path_mainfest_tool" >&6; }
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+
+
+
+
+
case $host_os in
rhapsody* | darwin*)
@@ -7525,7 +8161,13 @@ else
$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-dynamiclib -Wl,-single_module conftest.c 2>conftest.err
_lt_result=$?
- if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&5
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test $_lt_result -eq 0; then
lt_cv_apple_cc_single_mod=yes
else
cat conftest.err >&5
@@ -7536,6 +8178,7 @@ else
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_apple_cc_single_mod" >&5
$as_echo "$lt_cv_apple_cc_single_mod" >&6; }
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -exported_symbols_list linker flag" >&5
$as_echo_n "checking for -exported_symbols_list linker flag... " >&6; }
if ${lt_cv_ld_exported_symbols_list+:} false; then :
@@ -7568,6 +8211,7 @@ rm -f core conftest.err conftest.$ac_objext \
fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_ld_exported_symbols_list" >&5
$as_echo "$lt_cv_ld_exported_symbols_list" >&6; }
+
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -force_load linker flag" >&5
$as_echo_n "checking for -force_load linker flag... " >&6; }
if ${lt_cv_ld_force_load+:} false; then :
@@ -7589,7 +8233,9 @@ _LT_EOF
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&5
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
_lt_result=$?
- if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&5
+ elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
lt_cv_ld_force_load=yes
else
cat conftest.err >&5
@@ -7667,7 +8313,22 @@ done
# Check whether --with-pic was given.
if test "${with_pic+set}" = set; then :
- withval=$with_pic; pic_mode="$withval"
+ withval=$with_pic; lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for lt_pkg in $withval; do
+ IFS="$lt_save_ifs"
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac
else
pic_mode=default
fi
@@ -7745,6 +8406,10 @@ LIBTOOL='$(SHELL) $(top_builddir)/libtool'
+
+
+
+
test -z "$LN_S" && LN_S="ln -s"
@@ -8105,8 +8770,6 @@ fi
lt_prog_compiler_pic=
lt_prog_compiler_static=
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
-$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
if test "$GCC" = yes; then
lt_prog_compiler_wl='-Wl,'
@@ -8206,7 +8869,9 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
case $cc_basename in
nvcc*) # Cuda Compiler Driver 2.2
lt_prog_compiler_wl='-Xlinker '
- lt_prog_compiler_pic='-Xcompiler -fPIC'
+ if test -n "$lt_prog_compiler_pic"; then
+ lt_prog_compiler_pic="-Xcompiler $lt_prog_compiler_pic"
+ fi
;;
esac
else
@@ -8271,6 +8936,12 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
lt_prog_compiler_pic='--shared'
lt_prog_compiler_static='--static'
;;
+ nagfor*)
+ # NAG Fortran compiler
+ lt_prog_compiler_wl='-Wl,-Wl,,'
+ lt_prog_compiler_pic='-PIC'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
# Portland Group compilers (*not* the Pentium gcc compiler,
# which looks to be a dead project)
@@ -8291,18 +8962,33 @@ $as_echo_n "checking for $compiler option to produce PIC... " >&6; }
;;
*)
case `$CC -V 2>&1 | sed 5q` in
- *Sun\ F* | *Sun*Fortran*)
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [1-7].* | *Sun*Fortran*\ 8.[0-3]*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
lt_prog_compiler_wl=''
;;
+ *Sun\ F* | *Sun*Fortran*)
+ lt_prog_compiler_pic='-KPIC'
+ lt_prog_compiler_static='-Bstatic'
+ lt_prog_compiler_wl='-Qoption ld '
+ ;;
*Sun\ C*)
# Sun C 5.9
lt_prog_compiler_pic='-KPIC'
lt_prog_compiler_static='-Bstatic'
lt_prog_compiler_wl='-Wl,'
;;
+ *Intel*\ [CF]*Compiler*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fPIC'
+ lt_prog_compiler_static='-static'
+ ;;
+ *Portland\ Group*)
+ lt_prog_compiler_wl='-Wl,'
+ lt_prog_compiler_pic='-fpic'
+ lt_prog_compiler_static='-Bstatic'
+ ;;
esac
;;
esac
@@ -8390,13 +9076,17 @@ case $host_os in
lt_prog_compiler_pic="$lt_prog_compiler_pic -DPIC"
;;
esac
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_prog_compiler_pic" >&5
-$as_echo "$lt_prog_compiler_pic" >&6; }
-
-
-
-
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $compiler option to produce PIC" >&5
+$as_echo_n "checking for $compiler option to produce PIC... " >&6; }
+if ${lt_cv_prog_compiler_pic+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ lt_cv_prog_compiler_pic=$lt_prog_compiler_pic
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_prog_compiler_pic" >&5
+$as_echo "$lt_cv_prog_compiler_pic" >&6; }
+lt_prog_compiler_pic=$lt_cv_prog_compiler_pic
#
# Check to make sure the PIC flag actually works.
@@ -8457,6 +9147,11 @@ fi
+
+
+
+
+
#
# Check to make sure the static flag actually works.
#
@@ -8655,7 +9350,6 @@ $as_echo_n "checking whether the $compiler linker ($LD) supports shared librarie
hardcode_direct=no
hardcode_direct_absolute=no
hardcode_libdir_flag_spec=
- hardcode_libdir_flag_spec_ld=
hardcode_libdir_separator=
hardcode_minus_L=no
hardcode_shlibpath_var=unsupported
@@ -8807,7 +9501,8 @@ _LT_EOF
allow_undefined_flag=unsupported
always_export_symbols=no
enable_shared_with_static_runtimes=yes
- export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1 DATA/;s/^.*[ ]__nm__\([^ ]*\)[ ][^ ]*/\1 DATA/;/^I[ ]/d;/^[AITW][ ]/s/.* //'\'' | sort | uniq > $export_symbols'
+ exclude_expsyms='[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname'
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -8855,7 +9550,7 @@ _LT_EOF
if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
&& test "$tmp_diet" = no
then
- tmp_addflag=
+ tmp_addflag=' $pic_flag'
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
@@ -8904,8 +9599,7 @@ _LT_EOF
xlf* | bgf* | bgxlf* | mpixlf*)
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
whole_archive_flag_spec='--whole-archive$convenience --no-whole-archive'
- hardcode_libdir_flag_spec=
- hardcode_libdir_flag_spec_ld='-rpath $libdir'
+ hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
archive_cmds='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
if test "x$supports_anon_versioning" = xyes; then
archive_expsym_cmds='echo "{ global:" > $output_objdir/$libname.ver~
@@ -8925,8 +9619,8 @@ _LT_EOF
archive_cmds='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
@@ -8944,8 +9638,8 @@ _LT_EOF
_LT_EOF
elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
@@ -8991,8 +9685,8 @@ _LT_EOF
*)
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
ld_shlibs=no
fi
@@ -9122,7 +9816,13 @@ _LT_EOF
allow_undefined_flag='-berok'
# Determine the default libpath from the value encoded in an
# empty executable.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -9135,22 +9835,29 @@ main ()
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
archive_expsym_cmds='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
@@ -9162,7 +9869,13 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
else
# Determine the default libpath from the value encoded in an
# empty executable.
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ if ${lt_cv_aix_libpath_+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
int
@@ -9175,22 +9888,29 @@ main ()
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi
+ lt_aix_libpath_sed='
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }'
+ lt_cv_aix_libpath_=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+ if test -z "$lt_cv_aix_libpath_"; then
+ lt_cv_aix_libpath_="/usr/lib:/lib"
+ fi
+
+fi
+
+ aix_libpath=$lt_cv_aix_libpath_
+fi
hardcode_libdir_flag_spec='${wl}-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
@@ -9235,20 +9955,64 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
- hardcode_libdir_flag_spec=' '
- allow_undefined_flag=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- old_archive_from_new_cmds='true'
- # FIXME: Should let the user specify the lib program.
- old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
- fix_srcfile_path='`cygpath -w "$srcfile"`'
- enable_shared_with_static_runtimes=yes
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ always_export_symbols=yes
+ file_list_spec='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ archive_expsym_cmds='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, )='true'
+ enable_shared_with_static_runtimes=yes
+ exclude_expsyms='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ export_symbols_cmds='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[BCDGRS][ ]/s/.*[ ]\([^ ]*\)/\1,DATA/'\'' | $SED -e '\''/^[AITW][ ]/s/.*[ ]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ old_postinstall_cmds='chmod 644 $oldlib'
+ postlink_cmds='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ hardcode_libdir_flag_spec=' '
+ allow_undefined_flag=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ archive_cmds='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ old_archive_from_new_cmds='true'
+ # FIXME: Should let the user specify the lib program.
+ old_archive_cmds='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ enable_shared_with_static_runtimes=yes
+ ;;
+ esac
;;
darwin* | rhapsody*)
@@ -9260,6 +10024,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_shlibpath_var=unsupported
if test "$lt_cv_ld_force_load" = "yes"; then
whole_archive_flag_spec='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+
else
whole_archive_flag_spec=''
fi
@@ -9288,10 +10053,6 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hardcode_shlibpath_var=no
;;
- freebsd1*)
- ld_shlibs=no
- ;;
-
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
# support. Future versions do this automatically, but an explicit c++rt0.o
# does not break anything, and helps significantly (at the cost of a little
@@ -9304,7 +10065,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
;;
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
+ freebsd2.*)
archive_cmds='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
hardcode_direct=yes
hardcode_minus_L=yes
@@ -9313,7 +10074,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
freebsd* | dragonfly*)
- archive_cmds='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
hardcode_libdir_flag_spec='-R$libdir'
hardcode_direct=yes
hardcode_shlibpath_var=no
@@ -9321,7 +10082,7 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hpux9*)
if test "$GCC" = yes; then
- archive_cmds='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ archive_cmds='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
else
archive_cmds='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
fi
@@ -9337,13 +10098,12 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
hpux10*)
if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
else
archive_cmds='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
fi
if test "$with_gnu_ld" = no; then
hardcode_libdir_flag_spec='${wl}+b ${wl}$libdir'
- hardcode_libdir_flag_spec_ld='+b $libdir'
hardcode_libdir_separator=:
hardcode_direct=yes
hardcode_direct_absolute=yes
@@ -9361,10 +10121,10 @@ if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
archive_cmds='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
- archive_cmds='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
@@ -9443,23 +10203,36 @@ fi
irix5* | irix6* | nonstopux*)
if test "$GCC" = yes; then
- archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
# Try to use the -exported_symbol ld option, if it does not
# work, assume that -exports_file does not work either and
# implicitly export all symbols.
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
- cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+ # This should be the same for all languages, so no per-tag cache variable.
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking whether the $host_os linker accepts -exported_symbol" >&5
+$as_echo_n "checking whether the $host_os linker accepts -exported_symbol... " >&6; }
+if ${lt_cv_irix_exported_symbol+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-int foo(void) {}
+int foo (void) { return 0; }
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
-
+ lt_cv_irix_exported_symbol=yes
+else
+ lt_cv_irix_exported_symbol=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
- LDFLAGS="$save_LDFLAGS"
+ LDFLAGS="$save_LDFLAGS"
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $lt_cv_irix_exported_symbol" >&5
+$as_echo "$lt_cv_irix_exported_symbol" >&6; }
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ archive_expsym_cmds='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
else
archive_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
archive_expsym_cmds='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
@@ -9544,7 +10317,7 @@ rm -f core conftest.err conftest.$ac_objext \
osf4* | osf5*) # as osf3* with the addition of -msym flag
if test "$GCC" = yes; then
allow_undefined_flag=' ${wl}-expect_unresolved ${wl}\*'
- archive_cmds='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ archive_cmds='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
hardcode_libdir_flag_spec='${wl}-rpath ${wl}$libdir'
else
allow_undefined_flag=' -expect_unresolved \*'
@@ -9563,9 +10336,9 @@ rm -f core conftest.err conftest.$ac_objext \
no_undefined_flag=' -z defs'
if test "$GCC" = yes; then
wlarc='${wl}'
- archive_cmds='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ archive_cmds='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
archive_expsym_cmds='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
else
case `$CC -V 2>&1` in
*"Compilers 5.0"*)
@@ -9954,11 +10727,6 @@ esac
-
-
-
-
-
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking dynamic linker characteristics" >&5
$as_echo_n "checking dynamic linker characteristics... " >&6; }
@@ -10048,7 +10816,7 @@ need_version=unknown
case $host_os in
aix3*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
shlibpath_var=LIBPATH
@@ -10057,7 +10825,7 @@ aix3*)
;;
aix[4-9]*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
hardcode_into_libs=yes
@@ -10122,7 +10890,7 @@ beos*)
;;
bsdi[45]*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
@@ -10141,8 +10909,9 @@ cygwin* | mingw* | pw32* | cegcc*)
need_version=no
need_lib_prefix=no
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
postinstall_cmds='base_file=`basename \${file}`~
@@ -10175,13 +10944,71 @@ cygwin* | mingw* | pw32* | cegcc*)
library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
;;
esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([a-zA-Z]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | $GREP ';[c-zC-Z]:/' >/dev/null; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
;;
*)
+ # Assume MSVC wrapper
library_names_spec='${libname}`echo ${release} | $SED -e 's/[.]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
;;
esac
- dynamic_linker='Win32 ld.exe'
# FIXME: first we should search . and the directory the executable is in
shlibpath_var=PATH
;;
@@ -10202,7 +11029,7 @@ darwin* | rhapsody*)
;;
dgux*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
@@ -10210,10 +11037,6 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;
-freebsd1*)
- dynamic_linker=no
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -10221,7 +11044,7 @@ freebsd* | dragonfly*)
objformat=`/usr/bin/objformat`
else
case $host_os in
- freebsd[123]*) objformat=aout ;;
+ freebsd[23].*) objformat=aout ;;
*) objformat=elf ;;
esac
fi
@@ -10239,7 +11062,7 @@ freebsd* | dragonfly*)
esac
shlibpath_var=LD_LIBRARY_PATH
case $host_os in
- freebsd2*)
+ freebsd2.*)
shlibpath_overrides_runpath=yes
;;
freebsd3.[01]* | freebsdelf3.[01]*)
@@ -10259,17 +11082,18 @@ freebsd* | dragonfly*)
;;
gnu*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
haiku*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
dynamic_linker="$host_os runtime_loader"
@@ -10330,7 +11154,7 @@ hpux9* | hpux10* | hpux11*)
;;
interix[3-9]*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
@@ -10346,7 +11170,7 @@ irix5* | irix6* | nonstopux*)
nonstopux*) version_type=nonstopux ;;
*)
if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
else
version_type=irix
fi ;;
@@ -10383,9 +11207,9 @@ linux*oldld* | linux*aout* | linux*coff*)
dynamic_linker=no
;;
-# This must be Linux ELF.
+# This must be glibc/ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -10467,7 +11291,7 @@ netbsd*)
;;
newsos6)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
@@ -10536,7 +11360,7 @@ rdos*)
;;
solaris*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -10561,7 +11385,7 @@ sunos4*)
;;
sysv4 | sysv4.3*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
@@ -10585,7 +11409,7 @@ sysv4 | sysv4.3*)
sysv4*MP*)
if test -d /usr/nec ;then
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
soname_spec='$libname${shared_ext}.$major'
shlibpath_var=LD_LIBRARY_PATH
@@ -10616,7 +11440,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
tpf*)
# TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -10626,7 +11450,7 @@ tpf*)
;;
uts4*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
@@ -11117,10 +11941,10 @@ else
/* When -fvisbility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-void fnord () __attribute__((visibility("default")));
+int fnord () __attribute__((visibility("default")));
#endif
-void fnord () { int i=42; }
+int fnord () { return 42; }
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
@@ -11223,10 +12047,10 @@ else
/* When -fvisbility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-void fnord () __attribute__((visibility("default")));
+int fnord () __attribute__((visibility("default")));
#endif
-void fnord () { int i=42; }
+int fnord () { return 42; }
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
@@ -11408,6 +12232,8 @@ CC="$lt_save_CC"
+
+
ac_config_commands="$ac_config_commands libtool"
@@ -11417,7 +12243,28 @@ CC="$lt_save_CC"
+# Checks for platform.
+# ----------------------------------------------------------------------
+case "$target" in
+*linux*)
+ my_htop_platform=linux
+ ;;
+*freebsd*)
+ my_htop_platform=freebsd
+ ;;
+*openbsd*)
+ my_htop_platform=openbsd
+ ;;
+*darwin*)
+ my_htop_platform=darwin
+ ;;
+*)
+ my_htop_platform=unsupported
+ ;;
+esac
+
# Checks for libraries.
+# ----------------------------------------------------------------------
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for ceil in -lm" >&5
$as_echo_n "checking for ceil in -lm... " >&6; }
if ${ac_cv_lib_m_ceil+:} false; then :
@@ -11467,6 +12314,7 @@ fi
# Checks for header files.
+# ----------------------------------------------------------------------
ac_header_dirent=no
for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
as_ac_Header=`$as_echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
@@ -11770,6 +12618,7 @@ done
# Checks for typedefs, structures, and compiler characteristics.
+# ----------------------------------------------------------------------
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for stdbool.h that conforms to C99" >&5
$as_echo_n "checking for stdbool.h that conforms to C99... " >&6; }
if ${ac_cv_header_stdbool_h+:} false; then :
@@ -11986,7 +12835,8 @@ $as_echo "#define gid_t int" >>confdefs.h
fi
-# Checks for library functions.
+# Checks for library functions and compiler features.
+# ----------------------------------------------------------------------
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking whether closedir returns void" >&5
$as_echo_n "checking whether closedir returns void... " >&6; }
if ${ac_cv_func_closedir_void+:} false; then :
@@ -12207,8 +13057,58 @@ fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
CFLAGS="$save_cflags"
+save_cflags="${CFLAGS}"
+CFLAGS="$CFLAGS -Wextra"
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if compiler supports -Wextra" >&5
+$as_echo_n "checking if compiler supports -Wextra... " >&6; }
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+int
+main ()
+{
+
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+ wextra_flag=-Wextra
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+else
+
+ wextra_flag=
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+CFLAGS="$save_cflags"
+
+
+# Checks for features and flags.
+# ----------------------------------------------------------------------
PROCDIR=/proc
+# Check whether --enable-proc was given.
+if test "${enable_proc+set}" = set; then :
+ enableval=$enable_proc; enable_proc="yes"
+else
+ enable_proc="no"
+fi
+
+if test "x$enable_proc" = xyes; then
+ # An enabled proc assumes we're emulating Linux.
+ my_htop_platform=linux
+
+$as_echo "#define HAVE_PROC 1" >>confdefs.h
+
+fi
+
+
# Check whether --with-proc was given.
if test "${with_proc+set}" = set; then :
withval=$with_proc; if test -n "$withval"; then
@@ -12217,8 +13117,8 @@ cat >>confdefs.h <<_ACEOF
#define PROCDIR "$withval"
_ACEOF
- PROCDIR="$withval"
- fi
+ PROCDIR="$withval"
+fi
else
$as_echo "#define PROCDIR \"/proc\"" >>confdefs.h
@@ -12226,6 +13126,57 @@ $as_echo "#define PROCDIR \"/proc\"" >>confdefs.h
fi
+if test "x$cross_compiling" = xno; then
+ if test "x$enable_proc" = xyes; then
+ as_ac_File=`$as_echo "ac_cv_file_$PROCDIR/stat" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $PROCDIR/stat" >&5
+$as_echo_n "checking for $PROCDIR/stat... " >&6; }
+if eval \${$as_ac_File+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ test "$cross_compiling" = yes &&
+ as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
+if test -r "$PROCDIR/stat"; then
+ eval "$as_ac_File=yes"
+else
+ eval "$as_ac_File=no"
+fi
+fi
+eval ac_res=\$$as_ac_File
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
+
+else
+ as_fn_error $? "Cannot find $PROCDIR/stat. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help." "$LINENO" 5
+fi
+
+ as_ac_File=`$as_echo "ac_cv_file_$PROCDIR/meminfo" | $as_tr_sh`
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $PROCDIR/meminfo" >&5
+$as_echo_n "checking for $PROCDIR/meminfo... " >&6; }
+if eval \${$as_ac_File+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ test "$cross_compiling" = yes &&
+ as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
+if test -r "$PROCDIR/meminfo"; then
+ eval "$as_ac_File=yes"
+else
+ eval "$as_ac_File=no"
+fi
+fi
+eval ac_res=\$$as_ac_File
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
+$as_echo "$ac_res" >&6; }
+if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
+
+else
+ as_fn_error $? "Cannot find $PROCDIR/meminfo. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help." "$LINENO" 5
+fi
+
+ fi
+fi
+
# Check whether --enable-openvz was given.
if test "${enable_openvz+set}" = set; then :
enableval=$enable_openvz;
@@ -12294,6 +13245,12 @@ $as_echo "#define HAVE_TASKSTATS 1" >>confdefs.h
fi
+# HTOP_CHECK_SCRIPT(LIBNAME, FUNCTION, DEFINE, CONFIG_SCRIPT, ELSE_PART)
+
+
+# HTOP_CHECK_LIB(LIBNAME, FUNCTION, DEFINE, ELSE_PART)
+
+
# Check whether --enable-unicode was given.
if test "${enable_unicode+set}" = set; then :
enableval=$enable_unicode;
@@ -12302,9 +13259,70 @@ else
fi
if test "x$enable_unicode" = xyes; then
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for refresh in -lncursesw" >&5
-$as_echo_n "checking for refresh in -lncursesw... " >&6; }
-if ${ac_cv_lib_ncursesw_refresh+:} false; then :
+
+ htop_config_script=$("ncursesw6-config" --libs 2> /dev/null)
+ htop_script_success=no
+ htop_save_LDFLAGS="$LDFLAGS"
+ if test ! "x$htop_config_script" = x; then
+ LDFLAGS="$htop_config_script $LDFLAGS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncursesw6" >&5
+$as_echo_n "checking for addnwstr in -lncursesw6... " >&6; }
+if ${ac_cv_lib_ncursesw6_addnwstr+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lncursesw6 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char addnwstr ();
+int
+main ()
+{
+return addnwstr ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ncursesw6_addnwstr=yes
+else
+ ac_cv_lib_ncursesw6_addnwstr=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw6_addnwstr" >&5
+$as_echo "$ac_cv_lib_ncursesw6_addnwstr" >&6; }
+if test "x$ac_cv_lib_ncursesw6_addnwstr" = xyes; then :
+
+
+$as_echo "#define HAVE_LIBNCURSESW 1" >>confdefs.h
+
+ LIBS="$htop_config_script $LIBS "
+ htop_script_success=yes
+
+fi
+
+ LDFLAGS="$save_LDFLAGS"
+ fi
+ if test "x$htop_script_success" = xno; then
+
+ htop_config_script=$("ncursesw5-config" --libs 2> /dev/null)
+ htop_script_success=no
+ htop_save_LDFLAGS="$LDFLAGS"
+ if test ! "x$htop_config_script" = x; then
+ LDFLAGS="$htop_config_script $LDFLAGS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncursesw" >&5
+$as_echo_n "checking for addnwstr in -lncursesw... " >&6; }
+if ${ac_cv_lib_ncursesw_addnwstr+:} false; then :
$as_echo_n "(cached) " >&6
else
ac_check_lib_save_LIBS=$LIBS
@@ -12318,40 +13336,248 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext
#ifdef __cplusplus
extern "C"
#endif
-char refresh ();
+char addnwstr ();
int
main ()
{
-return refresh ();
+return addnwstr ();
;
return 0;
}
_ACEOF
if ac_fn_c_try_link "$LINENO"; then :
- ac_cv_lib_ncursesw_refresh=yes
+ ac_cv_lib_ncursesw_addnwstr=yes
else
- ac_cv_lib_ncursesw_refresh=no
+ ac_cv_lib_ncursesw_addnwstr=no
fi
rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_refresh" >&5
-$as_echo "$ac_cv_lib_ncursesw_refresh" >&6; }
-if test "x$ac_cv_lib_ncursesw_refresh" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNCURSESW 1
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_addnwstr" >&5
+$as_echo "$ac_cv_lib_ncursesw_addnwstr" >&6; }
+if test "x$ac_cv_lib_ncursesw_addnwstr" = xyes; then :
+
+
+$as_echo "#define HAVE_LIBNCURSESW 1" >>confdefs.h
+
+ LIBS="$htop_config_script $LIBS "
+ htop_script_success=yes
+
+fi
+
+ LDFLAGS="$save_LDFLAGS"
+ fi
+ if test "x$htop_script_success" = xno; then
+
+ htop_config_script=$("ncurses5-config" --libs 2> /dev/null)
+ htop_script_success=no
+ htop_save_LDFLAGS="$LDFLAGS"
+ if test ! "x$htop_config_script" = x; then
+ LDFLAGS="$htop_config_script $LDFLAGS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncurses" >&5
+$as_echo_n "checking for addnwstr in -lncurses... " >&6; }
+if ${ac_cv_lib_ncurses_addnwstr+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lncurses $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char addnwstr ();
+int
+main ()
+{
+return addnwstr ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ncurses_addnwstr=yes
+else
+ ac_cv_lib_ncurses_addnwstr=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_addnwstr" >&5
+$as_echo "$ac_cv_lib_ncurses_addnwstr" >&6; }
+if test "x$ac_cv_lib_ncurses_addnwstr" = xyes; then :
+
+
+$as_echo "#define HAVE_LIBNCURSESW 1" >>confdefs.h
+
+ LIBS="$htop_config_script $LIBS "
+ htop_script_success=yes
+
+fi
+
+ LDFLAGS="$save_LDFLAGS"
+ fi
+ if test "x$htop_script_success" = xno; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncursesw6" >&5
+$as_echo_n "checking for addnwstr in -lncursesw6... " >&6; }
+if ${ac_cv_lib_ncursesw6_addnwstr+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lncursesw6 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char addnwstr ();
+int
+main ()
+{
+return addnwstr ();
+ ;
+ return 0;
+}
_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ncursesw6_addnwstr=yes
+else
+ ac_cv_lib_ncursesw6_addnwstr=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw6_addnwstr" >&5
+$as_echo "$ac_cv_lib_ncursesw6_addnwstr" >&6; }
+if test "x$ac_cv_lib_ncursesw6_addnwstr" = xyes; then :
+
+
+$as_echo "#define HAVE_LIBNCURSESW 1" >>confdefs.h
- LIBS="-lncursesw $LIBS"
+ LIBS="-lncursesw6 $LIBS "
else
- missing_libraries="$missing_libraries libncursesw"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncursesw" >&5
+$as_echo_n "checking for addnwstr in -lncursesw... " >&6; }
+if ${ac_cv_lib_ncursesw_addnwstr+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lncursesw $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char addnwstr ();
+int
+main ()
+{
+return addnwstr ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ncursesw_addnwstr=yes
+else
+ ac_cv_lib_ncursesw_addnwstr=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncursesw_addnwstr" >&5
+$as_echo "$ac_cv_lib_ncursesw_addnwstr" >&6; }
+if test "x$ac_cv_lib_ncursesw_addnwstr" = xyes; then :
+
+
+$as_echo "#define HAVE_LIBNCURSESW 1" >>confdefs.h
+
+ LIBS="-lncursesw $LIBS "
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for addnwstr in -lncurses" >&5
+$as_echo_n "checking for addnwstr in -lncurses... " >&6; }
+if ${ac_cv_lib_ncurses_addnwstr+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lncurses $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char addnwstr ();
+int
+main ()
+{
+return addnwstr ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ncurses_addnwstr=yes
+else
+ ac_cv_lib_ncurses_addnwstr=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_addnwstr" >&5
+$as_echo "$ac_cv_lib_ncurses_addnwstr" >&6; }
+if test "x$ac_cv_lib_ncurses_addnwstr" = xyes; then :
+
+
+$as_echo "#define HAVE_LIBNCURSESW 1" >>confdefs.h
+
+ LIBS="-lncurses $LIBS "
+
+else
+ missing_libraries="$missing_libraries libncursesw"
as_fn_error $? "You may want to use --disable-unicode or install libncursesw." "$LINENO" 5
fi
+
+fi
+
+
+fi
+
+
+ fi
+
+ fi
+
+ fi
+
+
for ac_header in ncursesw/curses.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "ncursesw/curses.h" "ac_cv_header_ncursesw_curses_h" "$ac_includes_default"
@@ -12406,7 +13632,68 @@ fi
done
else
- { $as_echo "$as_me:${as_lineno-$LINENO}: checking for refresh in -lncurses" >&5
+
+ htop_config_script=$("ncurses6-config" --libs 2> /dev/null)
+ htop_script_success=no
+ htop_save_LDFLAGS="$LDFLAGS"
+ if test ! "x$htop_config_script" = x; then
+ LDFLAGS="$htop_config_script $LDFLAGS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for refresh in -lncurses6" >&5
+$as_echo_n "checking for refresh in -lncurses6... " >&6; }
+if ${ac_cv_lib_ncurses6_refresh+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lncurses6 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char refresh ();
+int
+main ()
+{
+return refresh ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ncurses6_refresh=yes
+else
+ ac_cv_lib_ncurses6_refresh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses6_refresh" >&5
+$as_echo "$ac_cv_lib_ncurses6_refresh" >&6; }
+if test "x$ac_cv_lib_ncurses6_refresh" = xyes; then :
+
+
+$as_echo "#define HAVE_LIBNCURSES 1" >>confdefs.h
+
+ LIBS="$htop_config_script $LIBS "
+ htop_script_success=yes
+
+fi
+
+ LDFLAGS="$save_LDFLAGS"
+ fi
+ if test "x$htop_script_success" = xno; then
+
+ htop_config_script=$("ncurses5-config" --libs 2> /dev/null)
+ htop_script_success=no
+ htop_save_LDFLAGS="$LDFLAGS"
+ if test ! "x$htop_config_script" = x; then
+ LDFLAGS="$htop_config_script $LDFLAGS"
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for refresh in -lncurses" >&5
$as_echo_n "checking for refresh in -lncurses... " >&6; }
if ${ac_cv_lib_ncurses_refresh+:} false; then :
$as_echo_n "(cached) " >&6
@@ -12443,16 +13730,121 @@ fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_refresh" >&5
$as_echo "$ac_cv_lib_ncurses_refresh" >&6; }
if test "x$ac_cv_lib_ncurses_refresh" = xyes; then :
- cat >>confdefs.h <<_ACEOF
-#define HAVE_LIBNCURSES 1
+
+
+$as_echo "#define HAVE_LIBNCURSES 1" >>confdefs.h
+
+ LIBS="$htop_config_script $LIBS "
+ htop_script_success=yes
+
+fi
+
+ LDFLAGS="$save_LDFLAGS"
+ fi
+ if test "x$htop_script_success" = xno; then
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for refresh in -lncurses6" >&5
+$as_echo_n "checking for refresh in -lncurses6... " >&6; }
+if ${ac_cv_lib_ncurses6_refresh+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lncurses6 $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char refresh ();
+int
+main ()
+{
+return refresh ();
+ ;
+ return 0;
+}
_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ncurses6_refresh=yes
+else
+ ac_cv_lib_ncurses6_refresh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses6_refresh" >&5
+$as_echo "$ac_cv_lib_ncurses6_refresh" >&6; }
+if test "x$ac_cv_lib_ncurses6_refresh" = xyes; then :
+
- LIBS="-lncurses $LIBS"
+$as_echo "#define HAVE_LIBNCURSES 1" >>confdefs.h
+
+ LIBS="-lncurses6 $LIBS "
+
+else
+
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for refresh in -lncurses" >&5
+$as_echo_n "checking for refresh in -lncurses... " >&6; }
+if ${ac_cv_lib_ncurses_refresh+:} false; then :
+ $as_echo_n "(cached) " >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lncurses $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char refresh ();
+int
+main ()
+{
+return refresh ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_ncurses_refresh=yes
+else
+ ac_cv_lib_ncurses_refresh=no
+fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ncurses_refresh" >&5
+$as_echo "$ac_cv_lib_ncurses_refresh" >&6; }
+if test "x$ac_cv_lib_ncurses_refresh" = xyes; then :
+
+
+$as_echo "#define HAVE_LIBNCURSES 1" >>confdefs.h
+
+ LIBS="-lncurses $LIBS "
else
missing_libraries="$missing_libraries libncurses"
+
fi
+
+fi
+
+
+ fi
+
+ fi
+
+
for ac_header in curses.h
do :
ac_fn_c_check_header_mongrel "$LINENO" "curses.h" "ac_cv_header_curses_h" "$ac_includes_default"
@@ -12508,58 +13900,102 @@ done
fi
-if test ! -z "$missing_libraries"; then
- as_fn_error $? "missing libraries: $missing_libraries" "$LINENO" 5
-fi
-if test ! -z "$missing_headers"; then
- as_fn_error $? "missing headers: $missing_headers" "$LINENO" 5
-fi
-
-if test "x$cross_compiling" = xno; then
-as_ac_File=`$as_echo "ac_cv_file_$PROCDIR/stat" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $PROCDIR/stat" >&5
-$as_echo_n "checking for $PROCDIR/stat... " >&6; }
-if eval \${$as_ac_File+:} false; then :
+if test "$my_htop_platform" = "freebsd"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kvm_open in -lkvm" >&5
+$as_echo_n "checking for kvm_open in -lkvm... " >&6; }
+if ${ac_cv_lib_kvm_kvm_open+:} false; then :
$as_echo_n "(cached) " >&6
else
- test "$cross_compiling" = yes &&
- as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
-if test -r "$PROCDIR/stat"; then
- eval "$as_ac_File=yes"
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lkvm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kvm_open ();
+int
+main ()
+{
+return kvm_open ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_kvm_kvm_open=yes
else
- eval "$as_ac_File=no"
+ ac_cv_lib_kvm_kvm_open=no
fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-eval ac_res=\$$as_ac_File
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kvm_kvm_open" >&5
+$as_echo "$ac_cv_lib_kvm_kvm_open" >&6; }
+if test "x$ac_cv_lib_kvm_kvm_open" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBKVM 1
+_ACEOF
+
+ LIBS="-lkvm $LIBS"
else
- as_fn_error $? "Cannot find /proc/stat. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help." "$LINENO" 5
+ missing_libraries="$missing_libraries libkvm"
fi
-as_ac_File=`$as_echo "ac_cv_file_$PROCDIR/meminfo" | $as_tr_sh`
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $PROCDIR/meminfo" >&5
-$as_echo_n "checking for $PROCDIR/meminfo... " >&6; }
-if eval \${$as_ac_File+:} false; then :
+fi
+
+if test "$my_htop_platform" = "openbsd"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for kvm_open in -lkvm" >&5
+$as_echo_n "checking for kvm_open in -lkvm... " >&6; }
+if ${ac_cv_lib_kvm_kvm_open+:} false; then :
$as_echo_n "(cached) " >&6
else
- test "$cross_compiling" = yes &&
- as_fn_error $? "cannot check for file existence when cross compiling" "$LINENO" 5
-if test -r "$PROCDIR/meminfo"; then
- eval "$as_ac_File=yes"
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-lkvm $LIBS"
+cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h. */
+
+/* Override any GCC internal prototype to avoid an error.
+ Use char because int might match the return type of a GCC
+ builtin and then its argument prototype would still apply. */
+#ifdef __cplusplus
+extern "C"
+#endif
+char kvm_open ();
+int
+main ()
+{
+return kvm_open ();
+ ;
+ return 0;
+}
+_ACEOF
+if ac_fn_c_try_link "$LINENO"; then :
+ ac_cv_lib_kvm_kvm_open=yes
else
- eval "$as_ac_File=no"
+ ac_cv_lib_kvm_kvm_open=no
fi
+rm -f core conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
fi
-eval ac_res=\$$as_ac_File
- { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5
-$as_echo "$ac_res" >&6; }
-if eval test \"x\$"$as_ac_File"\" = x"yes"; then :
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_kvm_kvm_open" >&5
+$as_echo "$ac_cv_lib_kvm_kvm_open" >&6; }
+if test "x$ac_cv_lib_kvm_kvm_open" = xyes; then :
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBKVM 1
+_ACEOF
+
+ LIBS="-lkvm $LIBS"
else
- as_fn_error $? "Cannot find /proc/meminfo. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help." "$LINENO" 5
+ missing_libraries="$missing_libraries libkvm"
fi
fi
@@ -12691,19 +14127,64 @@ done
fi
-# Check whether --enable-oom was given.
-if test "${enable_oom+set}" = set; then :
- enableval=$enable_oom;
+# Bail out on errors.
+# ----------------------------------------------------------------------
+if test ! -z "$missing_libraries"; then
+ as_fn_error $? "missing libraries: $missing_libraries" "$LINENO" 5
+fi
+if test ! -z "$missing_headers"; then
+ as_fn_error $? "missing headers: $missing_headers" "$LINENO" 5
+fi
+
+
+cat >>confdefs.h <<_ACEOF
+#define COPYRIGHT "(C) 2004-$year Hisham Muhammad"
+_ACEOF
+
+
+# We're done, let's go!
+# ----------------------------------------------------------------------
+ if test "$my_htop_platform" = linux; then
+ HTOP_LINUX_TRUE=
+ HTOP_LINUX_FALSE='#'
else
- enable_oom="no"
+ HTOP_LINUX_TRUE='#'
+ HTOP_LINUX_FALSE=
fi
-if test "x$enable_oom" = xyes; then
+ if test "$my_htop_platform" = freebsd; then
+ HTOP_FREEBSD_TRUE=
+ HTOP_FREEBSD_FALSE='#'
+else
+ HTOP_FREEBSD_TRUE='#'
+ HTOP_FREEBSD_FALSE=
+fi
-$as_echo "#define HAVE_OOM 1" >>confdefs.h
+ if test "$my_htop_platform" = openbsd; then
+ HTOP_OPENBSD_TRUE=
+ HTOP_OPENBSD_FALSE='#'
+else
+ HTOP_OPENBSD_TRUE='#'
+ HTOP_OPENBSD_FALSE=
+fi
+ if test "$my_htop_platform" = darwin; then
+ HTOP_DARWIN_TRUE=
+ HTOP_DARWIN_FALSE='#'
+else
+ HTOP_DARWIN_TRUE='#'
+ HTOP_DARWIN_FALSE=
fi
+ if test "$my_htop_platform" = unsupported; then
+ HTOP_UNSUPPORTED_TRUE=
+ HTOP_UNSUPPORTED_FALSE='#'
+else
+ HTOP_UNSUPPORTED_TRUE='#'
+ HTOP_UNSUPPORTED_FALSE=
+fi
+
+
ac_config_files="$ac_config_files Makefile htop.1"
cat >confcache <<\_ACEOF
@@ -12815,6 +14296,14 @@ LIBOBJS=$ac_libobjs
LTLIBOBJS=$ac_ltlibobjs
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking that generated files are newer than configure" >&5
+$as_echo_n "checking that generated files are newer than configure... " >&6; }
+ if test -n "$am_sleep_pid"; then
+ # Hide warnings about reused PIDs.
+ wait $am_sleep_pid 2>/dev/null
+ fi
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: done" >&5
+$as_echo "done" >&6; }
if test -z "${AMDEP_TRUE}" && test -z "${AMDEP_FALSE}"; then
as_fn_error $? "conditional \"AMDEP\" was never defined.
Usually this means the macro was only invoked conditionally." "$LINENO" 5
@@ -12831,6 +14320,26 @@ else
am__EXEEXT_FALSE=
fi
+if test -z "${HTOP_LINUX_TRUE}" && test -z "${HTOP_LINUX_FALSE}"; then
+ as_fn_error $? "conditional \"HTOP_LINUX\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HTOP_FREEBSD_TRUE}" && test -z "${HTOP_FREEBSD_FALSE}"; then
+ as_fn_error $? "conditional \"HTOP_FREEBSD\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HTOP_OPENBSD_TRUE}" && test -z "${HTOP_OPENBSD_FALSE}"; then
+ as_fn_error $? "conditional \"HTOP_OPENBSD\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HTOP_DARWIN_TRUE}" && test -z "${HTOP_DARWIN_FALSE}"; then
+ as_fn_error $? "conditional \"HTOP_DARWIN\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
+if test -z "${HTOP_UNSUPPORTED_TRUE}" && test -z "${HTOP_UNSUPPORTED_FALSE}"; then
+ as_fn_error $? "conditional \"HTOP_UNSUPPORTED\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
: "${CONFIG_STATUS=./config.status}"
ac_write_fail=0
@@ -13228,7 +14737,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
-This file was extended by htop $as_me 1.0.3, which was
+This file was extended by htop $as_me 2.0.0, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@@ -13294,7 +14803,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
-htop config.status 1.0.3
+htop config.status 2.0.0
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"
@@ -13431,6 +14940,7 @@ pic_mode='`$ECHO "$pic_mode" | $SED "$delay_single_quote_subst"`'
enable_fast_install='`$ECHO "$enable_fast_install" | $SED "$delay_single_quote_subst"`'
SHELL='`$ECHO "$SHELL" | $SED "$delay_single_quote_subst"`'
ECHO='`$ECHO "$ECHO" | $SED "$delay_single_quote_subst"`'
+PATH_SEPARATOR='`$ECHO "$PATH_SEPARATOR" | $SED "$delay_single_quote_subst"`'
host_alias='`$ECHO "$host_alias" | $SED "$delay_single_quote_subst"`'
host='`$ECHO "$host" | $SED "$delay_single_quote_subst"`'
host_os='`$ECHO "$host_os" | $SED "$delay_single_quote_subst"`'
@@ -13451,13 +14961,20 @@ exeext='`$ECHO "$exeext" | $SED "$delay_single_quote_subst"`'
lt_unset='`$ECHO "$lt_unset" | $SED "$delay_single_quote_subst"`'
lt_SP2NL='`$ECHO "$lt_SP2NL" | $SED "$delay_single_quote_subst"`'
lt_NL2SP='`$ECHO "$lt_NL2SP" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_host_file_cmd='`$ECHO "$lt_cv_to_host_file_cmd" | $SED "$delay_single_quote_subst"`'
+lt_cv_to_tool_file_cmd='`$ECHO "$lt_cv_to_tool_file_cmd" | $SED "$delay_single_quote_subst"`'
reload_flag='`$ECHO "$reload_flag" | $SED "$delay_single_quote_subst"`'
reload_cmds='`$ECHO "$reload_cmds" | $SED "$delay_single_quote_subst"`'
OBJDUMP='`$ECHO "$OBJDUMP" | $SED "$delay_single_quote_subst"`'
deplibs_check_method='`$ECHO "$deplibs_check_method" | $SED "$delay_single_quote_subst"`'
file_magic_cmd='`$ECHO "$file_magic_cmd" | $SED "$delay_single_quote_subst"`'
+file_magic_glob='`$ECHO "$file_magic_glob" | $SED "$delay_single_quote_subst"`'
+want_nocaseglob='`$ECHO "$want_nocaseglob" | $SED "$delay_single_quote_subst"`'
+DLLTOOL='`$ECHO "$DLLTOOL" | $SED "$delay_single_quote_subst"`'
+sharedlib_from_linklib_cmd='`$ECHO "$sharedlib_from_linklib_cmd" | $SED "$delay_single_quote_subst"`'
AR='`$ECHO "$AR" | $SED "$delay_single_quote_subst"`'
AR_FLAGS='`$ECHO "$AR_FLAGS" | $SED "$delay_single_quote_subst"`'
+archiver_list_spec='`$ECHO "$archiver_list_spec" | $SED "$delay_single_quote_subst"`'
STRIP='`$ECHO "$STRIP" | $SED "$delay_single_quote_subst"`'
RANLIB='`$ECHO "$RANLIB" | $SED "$delay_single_quote_subst"`'
old_postinstall_cmds='`$ECHO "$old_postinstall_cmds" | $SED "$delay_single_quote_subst"`'
@@ -13472,14 +14989,17 @@ lt_cv_sys_global_symbol_pipe='`$ECHO "$lt_cv_sys_global_symbol_pipe" | $SED "$de
lt_cv_sys_global_symbol_to_cdecl='`$ECHO "$lt_cv_sys_global_symbol_to_cdecl" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_to_c_name_address='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address" | $SED "$delay_single_quote_subst"`'
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix='`$ECHO "$lt_cv_sys_global_symbol_to_c_name_address_lib_prefix" | $SED "$delay_single_quote_subst"`'
+nm_file_list_spec='`$ECHO "$nm_file_list_spec" | $SED "$delay_single_quote_subst"`'
+lt_sysroot='`$ECHO "$lt_sysroot" | $SED "$delay_single_quote_subst"`'
objdir='`$ECHO "$objdir" | $SED "$delay_single_quote_subst"`'
MAGIC_CMD='`$ECHO "$MAGIC_CMD" | $SED "$delay_single_quote_subst"`'
lt_prog_compiler_no_builtin_flag='`$ECHO "$lt_prog_compiler_no_builtin_flag" | $SED "$delay_single_quote_subst"`'
-lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
lt_prog_compiler_pic='`$ECHO "$lt_prog_compiler_pic" | $SED "$delay_single_quote_subst"`'
+lt_prog_compiler_wl='`$ECHO "$lt_prog_compiler_wl" | $SED "$delay_single_quote_subst"`'
lt_prog_compiler_static='`$ECHO "$lt_prog_compiler_static" | $SED "$delay_single_quote_subst"`'
lt_cv_prog_compiler_c_o='`$ECHO "$lt_cv_prog_compiler_c_o" | $SED "$delay_single_quote_subst"`'
need_locks='`$ECHO "$need_locks" | $SED "$delay_single_quote_subst"`'
+MANIFEST_TOOL='`$ECHO "$MANIFEST_TOOL" | $SED "$delay_single_quote_subst"`'
DSYMUTIL='`$ECHO "$DSYMUTIL" | $SED "$delay_single_quote_subst"`'
NMEDIT='`$ECHO "$NMEDIT" | $SED "$delay_single_quote_subst"`'
LIPO='`$ECHO "$LIPO" | $SED "$delay_single_quote_subst"`'
@@ -13503,7 +15023,6 @@ with_gnu_ld='`$ECHO "$with_gnu_ld" | $SED "$delay_single_quote_subst"`'
allow_undefined_flag='`$ECHO "$allow_undefined_flag" | $SED "$delay_single_quote_subst"`'
no_undefined_flag='`$ECHO "$no_undefined_flag" | $SED "$delay_single_quote_subst"`'
hardcode_libdir_flag_spec='`$ECHO "$hardcode_libdir_flag_spec" | $SED "$delay_single_quote_subst"`'
-hardcode_libdir_flag_spec_ld='`$ECHO "$hardcode_libdir_flag_spec_ld" | $SED "$delay_single_quote_subst"`'
hardcode_libdir_separator='`$ECHO "$hardcode_libdir_separator" | $SED "$delay_single_quote_subst"`'
hardcode_direct='`$ECHO "$hardcode_direct" | $SED "$delay_single_quote_subst"`'
hardcode_direct_absolute='`$ECHO "$hardcode_direct_absolute" | $SED "$delay_single_quote_subst"`'
@@ -13512,12 +15031,12 @@ hardcode_shlibpath_var='`$ECHO "$hardcode_shlibpath_var" | $SED "$delay_single_q
hardcode_automatic='`$ECHO "$hardcode_automatic" | $SED "$delay_single_quote_subst"`'
inherit_rpath='`$ECHO "$inherit_rpath" | $SED "$delay_single_quote_subst"`'
link_all_deplibs='`$ECHO "$link_all_deplibs" | $SED "$delay_single_quote_subst"`'
-fix_srcfile_path='`$ECHO "$fix_srcfile_path" | $SED "$delay_single_quote_subst"`'
always_export_symbols='`$ECHO "$always_export_symbols" | $SED "$delay_single_quote_subst"`'
export_symbols_cmds='`$ECHO "$export_symbols_cmds" | $SED "$delay_single_quote_subst"`'
exclude_expsyms='`$ECHO "$exclude_expsyms" | $SED "$delay_single_quote_subst"`'
include_expsyms='`$ECHO "$include_expsyms" | $SED "$delay_single_quote_subst"`'
prelink_cmds='`$ECHO "$prelink_cmds" | $SED "$delay_single_quote_subst"`'
+postlink_cmds='`$ECHO "$postlink_cmds" | $SED "$delay_single_quote_subst"`'
file_list_spec='`$ECHO "$file_list_spec" | $SED "$delay_single_quote_subst"`'
variables_saved_for_relink='`$ECHO "$variables_saved_for_relink" | $SED "$delay_single_quote_subst"`'
need_lib_prefix='`$ECHO "$need_lib_prefix" | $SED "$delay_single_quote_subst"`'
@@ -13559,6 +15078,7 @@ _LTECHO_EOF'
# Quote evaled strings.
for var in SHELL \
ECHO \
+PATH_SEPARATOR \
SED \
GREP \
EGREP \
@@ -13572,8 +15092,13 @@ reload_flag \
OBJDUMP \
deplibs_check_method \
file_magic_cmd \
+file_magic_glob \
+want_nocaseglob \
+DLLTOOL \
+sharedlib_from_linklib_cmd \
AR \
AR_FLAGS \
+archiver_list_spec \
STRIP \
RANLIB \
CC \
@@ -13583,12 +15108,14 @@ lt_cv_sys_global_symbol_pipe \
lt_cv_sys_global_symbol_to_cdecl \
lt_cv_sys_global_symbol_to_c_name_address \
lt_cv_sys_global_symbol_to_c_name_address_lib_prefix \
+nm_file_list_spec \
lt_prog_compiler_no_builtin_flag \
-lt_prog_compiler_wl \
lt_prog_compiler_pic \
+lt_prog_compiler_wl \
lt_prog_compiler_static \
lt_cv_prog_compiler_c_o \
need_locks \
+MANIFEST_TOOL \
DSYMUTIL \
NMEDIT \
LIPO \
@@ -13602,9 +15129,7 @@ with_gnu_ld \
allow_undefined_flag \
no_undefined_flag \
hardcode_libdir_flag_spec \
-hardcode_libdir_flag_spec_ld \
hardcode_libdir_separator \
-fix_srcfile_path \
exclude_expsyms \
include_expsyms \
file_list_spec \
@@ -13640,6 +15165,7 @@ module_cmds \
module_expsym_cmds \
export_symbols_cmds \
prelink_cmds \
+postlink_cmds \
postinstall_cmds \
postuninstall_cmds \
finish_cmds \
@@ -14284,7 +15810,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
case $ac_file$ac_mode in
"depfiles":C) test x"$AMDEP_TRUE" != x"" || {
- # Autoconf 2.62 quotes --file arguments for eval, but not when files
+ # Older Autoconf quotes --file arguments for eval, but not when files
# are listed without --file. Let's play safe and only enable the eval
# if we detect the quoting.
case $CONFIG_FILES in
@@ -14297,7 +15823,7 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
# Strip MF so we end up with the name of the file.
mf=`echo "$mf" | sed -e 's/:.*$//'`
# Check whether this is an Automake generated Makefile or not.
- # We used to match only the files named `Makefile.in', but
+ # We used to match only the files named 'Makefile.in', but
# some people rename them; so instead we look at the file content.
# Grep'ing the first line is not enough: some people post-process
# each Makefile.in and add a new line on top of each file to say so.
@@ -14331,21 +15857,19 @@ $as_echo X"$mf" |
continue
fi
# Extract the definition of DEPDIR, am__include, and am__quote
- # from the Makefile without running `make'.
+ # from the Makefile without running 'make'.
DEPDIR=`sed -n 's/^DEPDIR = //p' < "$mf"`
test -z "$DEPDIR" && continue
am__include=`sed -n 's/^am__include = //p' < "$mf"`
- test -z "am__include" && continue
+ test -z "$am__include" && continue
am__quote=`sed -n 's/^am__quote = //p' < "$mf"`
- # When using ansi2knr, U may be empty or an underscore; expand it
- U=`sed -n 's/^U = //p' < "$mf"`
# Find all dependency output files, they are included files with
# $(DEPDIR) in their names. We invoke sed twice because it is the
# simplest approach to changing $(DEPDIR) to its actual value in the
# expansion.
for file in `sed -n "
s/^$am__include $am__quote\(.*(DEPDIR).*\)$am__quote"'$/\1/p' <"$mf" | \
- sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g' -e 's/\$U/'"$U"'/g'`; do
+ sed -e 's/\$(DEPDIR)/'"$DEPDIR"'/g'`; do
# Make sure the directory exists.
test -f "$dirpart/$file" && continue
fdir=`$as_dirname -- "$file" ||
@@ -14399,8 +15923,8 @@ $as_echo X"$file" |
# NOTE: Changes made to this file will be lost: look at ltmain.sh.
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-# Inc.
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is part of GNU Libtool.
@@ -14454,6 +15978,9 @@ SHELL=$lt_SHELL
# An echo program that protects backslashes.
ECHO=$lt_ECHO
+# The PATH separator for the build system.
+PATH_SEPARATOR=$lt_PATH_SEPARATOR
+
# The host system.
host_alias=$host_alias
host=$host
@@ -14503,19 +16030,42 @@ SP2NL=$lt_lt_SP2NL
# turn newlines into spaces.
NL2SP=$lt_lt_NL2SP
+# convert \$build file names to \$host format.
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+
+# convert \$build files to toolchain format.
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+
# An object symbol dumper.
OBJDUMP=$lt_OBJDUMP
# Method to check whether dependent libraries are shared objects.
deplibs_check_method=$lt_deplibs_check_method
-# Command to use when deplibs_check_method == "file_magic".
+# Command to use when deplibs_check_method = "file_magic".
file_magic_cmd=$lt_file_magic_cmd
+# How to find potential files when deplibs_check_method = "file_magic".
+file_magic_glob=$lt_file_magic_glob
+
+# Find potential files using nocaseglob when deplibs_check_method = "file_magic".
+want_nocaseglob=$lt_want_nocaseglob
+
+# DLL creation program.
+DLLTOOL=$lt_DLLTOOL
+
+# Command to associate shared and link libraries.
+sharedlib_from_linklib_cmd=$lt_sharedlib_from_linklib_cmd
+
# The archiver.
AR=$lt_AR
+
+# Flags to create an archive.
AR_FLAGS=$lt_AR_FLAGS
+# How to feed a file listing to the archiver.
+archiver_list_spec=$lt_archiver_list_spec
+
# A symbol stripping program.
STRIP=$lt_STRIP
@@ -14545,6 +16095,12 @@ global_symbol_to_c_name_address=$lt_lt_cv_sys_global_symbol_to_c_name_address
# Transform the output of nm in a C name address pair when lib prefix is needed.
global_symbol_to_c_name_address_lib_prefix=$lt_lt_cv_sys_global_symbol_to_c_name_address_lib_prefix
+# Specify filename containing input files for \$NM.
+nm_file_list_spec=$lt_nm_file_list_spec
+
+# The root where to search for dependent libraries,and in which our libraries should be installed.
+lt_sysroot=$lt_sysroot
+
# The name of the directory that contains temporary libtool files.
objdir=$objdir
@@ -14554,6 +16110,9 @@ MAGIC_CMD=$MAGIC_CMD
# Must we lock files when doing compilation?
need_locks=$lt_need_locks
+# Manifest tool.
+MANIFEST_TOOL=$lt_MANIFEST_TOOL
+
# Tool to manipulate archived DWARF debug symbol files on Mac OS X.
DSYMUTIL=$lt_DSYMUTIL
@@ -14668,12 +16227,12 @@ with_gcc=$GCC
# Compiler flag to turn off builtin functions.
no_builtin_flag=$lt_lt_prog_compiler_no_builtin_flag
-# How to pass a linker flag through the compiler.
-wl=$lt_lt_prog_compiler_wl
-
# Additional compiler flags for building library objects.
pic_flag=$lt_lt_prog_compiler_pic
+# How to pass a linker flag through the compiler.
+wl=$lt_lt_prog_compiler_wl
+
# Compiler flag to prevent dynamic linking.
link_static_flag=$lt_lt_prog_compiler_static
@@ -14723,10 +16282,6 @@ no_undefined_flag=$lt_no_undefined_flag
# This must work even if \$libdir does not exist
hardcode_libdir_flag_spec=$lt_hardcode_libdir_flag_spec
-# If ld is used when linking, flag to hardcode \$libdir into a binary
-# during linking. This must work even if \$libdir does not exist.
-hardcode_libdir_flag_spec_ld=$lt_hardcode_libdir_flag_spec_ld
-
# Whether we need a single "-rpath" flag with a separated argument.
hardcode_libdir_separator=$lt_hardcode_libdir_separator
@@ -14760,9 +16315,6 @@ inherit_rpath=$inherit_rpath
# Whether libtool must link a program against all its dependency libraries.
link_all_deplibs=$link_all_deplibs
-# Fix the shell variable \$srcfile for the compiler.
-fix_srcfile_path=$lt_fix_srcfile_path
-
# Set to "yes" if exported symbols are required.
always_export_symbols=$always_export_symbols
@@ -14778,6 +16330,9 @@ include_expsyms=$lt_include_expsyms
# Commands necessary for linking programs (against libraries) with templates.
prelink_cmds=$lt_prelink_cmds
+# Commands necessary for finishing linking programs.
+postlink_cmds=$lt_postlink_cmds
+
# Specify filename containing input files.
file_list_spec=$lt_file_list_spec
@@ -14810,210 +16365,169 @@ ltmain="$ac_aux_dir/ltmain.sh"
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- case $xsi_shell in
- yes)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
-}
-
-# func_basename file
-func_basename ()
-{
- func_basename_result="${1##*/}"
-}
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-# dirname: Compute the dirname of FILE. If nonempty,
-# add APPEND to the result, otherwise set result
-# to NONDIR_REPLACEMENT.
-# value returned in "$func_dirname_result"
-# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
- func_basename_result="${1##*/}"
-}
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-func_stripname ()
-{
- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
- # positional parameters, so assign one to ordinary parameter first.
- func_stripname_result=${3}
- func_stripname_result=${func_stripname_result#"${1}"}
- func_stripname_result=${func_stripname_result%"${2}"}
-}
-
-# func_opt_split
-func_opt_split ()
-{
- func_opt_split_opt=${1%%=*}
- func_opt_split_arg=${1#*=}
-}
-
-# func_lo2o object
-func_lo2o ()
-{
- case ${1} in
- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
- *) func_lo2o_result=${1} ;;
- esac
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=${1%.*}.lo
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=$(( $* ))
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=${#1}
-}
-
-_LT_EOF
- ;;
- *) # Bourne compatible functions.
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- # Extract subdirectory from the argument.
- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
-}
-
-# func_basename file
-func_basename ()
-{
- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-}
-
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
- case ${2} in
- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
- esac
-}
-
-# sed scripts:
-my_sed_long_opt='1s/^\(-[^=]*\)=.*/\1/;q'
-my_sed_long_arg='1s/^-[^=]*=//'
-
-# func_opt_split
-func_opt_split ()
-{
- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
-}
-
-# func_lo2o object
-func_lo2o ()
-{
- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=`expr "$@"`
-}
-
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=`expr "$1" : ".*" 2>/dev/null || echo $max_cmd_len`
-}
-
-_LT_EOF
-esac
-
-case $lt_shell_append in
- yes)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "$1+=\$2"
-}
-_LT_EOF
- ;;
- *)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "$1=\$$1\$2"
-}
-
-_LT_EOF
- ;;
- esac
-
-
- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- mv -f "$cfgfile" "$ofile" ||
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
+
+ if test x"$xsi_shell" = xyes; then
+ sed -e '/^func_dirname ()$/,/^} # func_dirname /c\
+func_dirname ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+} # Extended-shell func_dirname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_basename ()$/,/^} # func_basename /c\
+func_basename ()\
+{\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_dirname_and_basename ()$/,/^} # func_dirname_and_basename /c\
+func_dirname_and_basename ()\
+{\
+\ case ${1} in\
+\ */*) func_dirname_result="${1%/*}${2}" ;;\
+\ * ) func_dirname_result="${3}" ;;\
+\ esac\
+\ func_basename_result="${1##*/}"\
+} # Extended-shell func_dirname_and_basename implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_stripname ()$/,/^} # func_stripname /c\
+func_stripname ()\
+{\
+\ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are\
+\ # positional parameters, so assign one to ordinary parameter first.\
+\ func_stripname_result=${3}\
+\ func_stripname_result=${func_stripname_result#"${1}"}\
+\ func_stripname_result=${func_stripname_result%"${2}"}\
+} # Extended-shell func_stripname implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_long_opt ()$/,/^} # func_split_long_opt /c\
+func_split_long_opt ()\
+{\
+\ func_split_long_opt_name=${1%%=*}\
+\ func_split_long_opt_arg=${1#*=}\
+} # Extended-shell func_split_long_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_split_short_opt ()$/,/^} # func_split_short_opt /c\
+func_split_short_opt ()\
+{\
+\ func_split_short_opt_arg=${1#??}\
+\ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}\
+} # Extended-shell func_split_short_opt implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_lo2o ()$/,/^} # func_lo2o /c\
+func_lo2o ()\
+{\
+\ case ${1} in\
+\ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;\
+\ *) func_lo2o_result=${1} ;;\
+\ esac\
+} # Extended-shell func_lo2o implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_xform ()$/,/^} # func_xform /c\
+func_xform ()\
+{\
+ func_xform_result=${1%.*}.lo\
+} # Extended-shell func_xform implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_arith ()$/,/^} # func_arith /c\
+func_arith ()\
+{\
+ func_arith_result=$(( $* ))\
+} # Extended-shell func_arith implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_len ()$/,/^} # func_len /c\
+func_len ()\
+{\
+ func_len_result=${#1}\
+} # Extended-shell func_len implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+fi
+
+if test x"$lt_shell_append" = xyes; then
+ sed -e '/^func_append ()$/,/^} # func_append /c\
+func_append ()\
+{\
+ eval "${1}+=\\${2}"\
+} # Extended-shell func_append implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ sed -e '/^func_append_quoted ()$/,/^} # func_append_quoted /c\
+func_append_quoted ()\
+{\
+\ func_quote_for_eval "${2}"\
+\ eval "${1}+=\\\\ \\$func_quote_for_eval_result"\
+} # Extended-shell func_append_quoted implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+
+
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([a-zA-Z_]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
+
+if test x"$_lt_function_replace_fail" = x":"; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: Unable to substitute extended shell functions in $ofile" >&5
+$as_echo "$as_me: WARNING: Unable to substitute extended shell functions in $ofile" >&2;}
+fi
+
+
+ mv -f "$cfgfile" "$ofile" ||
(rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
chmod +x "$ofile"
diff --git a/configure.ac b/configure.ac
index 2b934e8..3bd58bc 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2,7 +2,9 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.65)
-AC_INIT([htop],[1.0.3],[hisham@gobolinux.org])
+AC_INIT([htop],[2.0.0],[hisham@gobolinux.org])
+
+year=$(date +%Y)
# The following two lines are required by hwloc scripts
AC_USE_SYSTEM_EXTENSIONS
@@ -14,6 +16,7 @@ AC_CONFIG_HEADER([config.h])
AC_CONFIG_MACRO_DIR([m4])
# Checks for programs.
+# ----------------------------------------------------------------------
AC_PROG_CC
AM_PROG_CC_C_O
@@ -21,10 +24,32 @@ AC_DISABLE_SHARED
AC_ENABLE_STATIC
AC_PROG_LIBTOOL
+# Checks for platform.
+# ----------------------------------------------------------------------
+case "$target" in
+*linux*)
+ my_htop_platform=linux
+ ;;
+*freebsd*)
+ my_htop_platform=freebsd
+ ;;
+*openbsd*)
+ my_htop_platform=openbsd
+ ;;
+*darwin*)
+ my_htop_platform=darwin
+ ;;
+*)
+ my_htop_platform=unsupported
+ ;;
+esac
+
# Checks for libraries.
+# ----------------------------------------------------------------------
AC_CHECK_LIB([m], [ceil], [], [missing_libraries="$missing_libraries libm"])
# Checks for header files.
+# ----------------------------------------------------------------------
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h],[:],[
@@ -33,12 +58,14 @@ AC_CHECK_HEADERS([stdlib.h string.h strings.h sys/param.h sys/time.h unistd.h],[
AC_CHECK_HEADERS([execinfo.h],[:],[:])
# Checks for typedefs, structures, and compiler characteristics.
+# ----------------------------------------------------------------------
AC_HEADER_STDBOOL
AC_C_CONST
AC_TYPE_PID_T
AC_TYPE_UID_T
-# Checks for library functions.
+# Checks for library functions and compiler features.
+# ----------------------------------------------------------------------
AC_FUNC_CLOSEDIR_VOID
AC_TYPE_SIGNAL
AC_FUNC_STAT
@@ -52,14 +79,44 @@ AC_TRY_COMPILE(AC_INCLUDES_DEFAULT, [char *a; a = strdup("foo"); int i = 0; i++;
AC_MSG_ERROR([htop is written in C99. A newer version of gcc is required.]))
CFLAGS="$save_cflags"
+save_cflags="${CFLAGS}"
+CFLAGS="$CFLAGS -Wextra"
+AC_MSG_CHECKING([if compiler supports -Wextra])
+AC_TRY_COMPILE([], [], [
+ wextra_flag=-Wextra
+ AC_MSG_RESULT([yes])
+],[
+ wextra_flag=
+ AC_MSG_RESULT([no])
+])
+CFLAGS="$save_cflags"
+AC_SUBST(wextra_flag)
+
+# Checks for features and flags.
+# ----------------------------------------------------------------------
PROCDIR=/proc
-AC_ARG_WITH(proc, [ --with-proc=DIR Location of a Linux-compatible proc filesystem (default=/proc).],
- if test -n "$withval"; then
- AC_DEFINE_UNQUOTED(PROCDIR, "$withval", [Path of proc filesystem])
- PROCDIR="$withval"
- fi,
- AC_DEFINE(PROCDIR, "/proc", [Path of proc filesystem]))
+AC_ARG_ENABLE(proc, [AC_HELP_STRING([--enable-proc], [use Linux-compatible proc filesystem])], enable_proc="yes", enable_proc="no")
+if test "x$enable_proc" = xyes; then
+ # An enabled proc assumes we're emulating Linux.
+ my_htop_platform=linux
+ AC_DEFINE(HAVE_PROC, 1, [Define if using a Linux-compatible proc filesystem.])
+fi
+
+AC_ARG_WITH(proc, [AC_HELP_STRING([--with-proc=DIR], [Location of a Linux-compatible proc filesystem (default=/proc).])],
+
+if test -n "$withval"; then
+ AC_DEFINE_UNQUOTED(PROCDIR, "$withval", [Path of proc filesystem])
+ PROCDIR="$withval"
+fi,
+AC_DEFINE(PROCDIR, "/proc", [Path of proc filesystem]))
+
+if test "x$cross_compiling" = xno; then
+ if test "x$enable_proc" = xyes; then
+ AC_CHECK_FILE($PROCDIR/stat,,AC_MSG_ERROR(Cannot find $PROCDIR/stat. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help.))
+ AC_CHECK_FILE($PROCDIR/meminfo,,AC_MSG_ERROR(Cannot find $PROCDIR/meminfo. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help.))
+ fi
+fi
AC_ARG_ENABLE(openvz, [AC_HELP_STRING([--enable-openvz], [enable OpenVZ support])], ,enable_openvz="no")
if test "x$enable_openvz" = xyes; then
@@ -87,34 +144,71 @@ if test "x$enable_taskstats" = xyes; then
AC_DEFINE(HAVE_TASKSTATS, 1, [Define if taskstats support enabled.])
fi
+# HTOP_CHECK_SCRIPT(LIBNAME, FUNCTION, DEFINE, CONFIG_SCRIPT, ELSE_PART)
+m4_define([HTOP_CHECK_SCRIPT],
+[
+ htop_config_script=$([$4] --libs 2> /dev/null)
+ htop_script_success=no
+ htop_save_LDFLAGS="$LDFLAGS"
+ if test ! "x$htop_config_script" = x; then
+ LDFLAGS="$htop_config_script $LDFLAGS"
+ AC_CHECK_LIB([$1], [$2], [
+ AC_DEFINE([$3], 1, [The library is present.])
+ LIBS="$htop_config_script $LIBS "
+ htop_script_success=yes
+ ], [])
+ LDFLAGS="$save_LDFLAGS"
+ fi
+ if test "x$htop_script_success" = xno; then
+ [$5]
+ fi
+])
+
+# HTOP_CHECK_LIB(LIBNAME, FUNCTION, DEFINE, ELSE_PART)
+m4_define([HTOP_CHECK_LIB],
+[
+ AC_CHECK_LIB([$1], [$2], [
+ AC_DEFINE([$3], 1, [The library is present.])
+ LIBS="-l[$1] $LIBS "
+ ], [$4])
+])
+
AC_ARG_ENABLE(unicode, [AC_HELP_STRING([--enable-unicode], [enable Unicode support])], ,enable_unicode="yes")
if test "x$enable_unicode" = xyes; then
- AC_CHECK_LIB([ncursesw], [refresh], [], [
+ HTOP_CHECK_SCRIPT([ncursesw6], [addnwstr], [HAVE_LIBNCURSESW], "ncursesw6-config",
+ HTOP_CHECK_SCRIPT([ncursesw], [addnwstr], [HAVE_LIBNCURSESW], "ncursesw5-config",
+ HTOP_CHECK_SCRIPT([ncurses], [addnwstr], [HAVE_LIBNCURSESW], "ncurses5-config",
+ HTOP_CHECK_LIB([ncursesw6], [addnwstr], [HAVE_LIBNCURSESW],
+ HTOP_CHECK_LIB([ncursesw], [addnwstr], [HAVE_LIBNCURSESW],
+ HTOP_CHECK_LIB([ncurses], [addnwstr], [HAVE_LIBNCURSESW],
missing_libraries="$missing_libraries libncursesw"
AC_MSG_ERROR([You may want to use --disable-unicode or install libncursesw.])
- ])
+ ))))))
+
AC_CHECK_HEADERS([ncursesw/curses.h],[:],
[AC_CHECK_HEADERS([ncurses/ncurses.h],[:],
[AC_CHECK_HEADERS([ncurses/curses.h],[:],
[AC_CHECK_HEADERS([ncurses.h],[:],[missing_headers="$missing_headers $ac_header"])])])])
else
- AC_CHECK_LIB([ncurses], [refresh], [], [missing_libraries="$missing_libraries libncurses"])
+ HTOP_CHECK_SCRIPT([ncurses6], [refresh], [HAVE_LIBNCURSES], "ncurses6-config",
+ HTOP_CHECK_SCRIPT([ncurses], [refresh], [HAVE_LIBNCURSES], "ncurses5-config",
+ HTOP_CHECK_LIB([ncurses6], [refresh], [HAVE_LIBNCURSES],
+ HTOP_CHECK_LIB([ncurses], [refresh], [HAVE_LIBNCURSES],
+ missing_libraries="$missing_libraries libncurses"
+ ))))
+
AC_CHECK_HEADERS([curses.h],[:],
[AC_CHECK_HEADERS([ncurses/curses.h],[:],
[AC_CHECK_HEADERS([ncurses/ncurses.h],[:],
[AC_CHECK_HEADERS([ncurses.h],[:],[missing_headers="$missing_headers $ac_header"])])])])
fi
-if test ! -z "$missing_libraries"; then
- AC_MSG_ERROR([missing libraries: $missing_libraries])
-fi
-if test ! -z "$missing_headers"; then
- AC_MSG_ERROR([missing headers: $missing_headers])
+if test "$my_htop_platform" = "freebsd"; then
+ AC_CHECK_LIB([kvm], [kvm_open], [], [missing_libraries="$missing_libraries libkvm"])
fi
-if test "x$cross_compiling" = xno; then
-AC_CHECK_FILE($PROCDIR/stat,,AC_MSG_ERROR(Cannot find /proc/stat. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help.))
-AC_CHECK_FILE($PROCDIR/meminfo,,AC_MSG_ERROR(Cannot find /proc/meminfo. Make sure you have a Linux-compatible /proc filesystem mounted. See the file README for help.))
+if test "$my_htop_platform" = "openbsd"; then
+ AC_CHECK_LIB([kvm], [kvm_open], [], [missing_libraries="$missing_libraries libkvm"])
fi
AC_ARG_ENABLE(native_affinity, [AC_HELP_STRING([--enable-native-affinity], [enable native sched_setaffinity and sched_getaffinity for affinity support, disables hwloc])], ,enable_native_affinity="yes")
@@ -145,10 +239,24 @@ then
AC_CHECK_HEADERS([hwloc.h],[:], [missing_headers="$missing_headers $ac_header"])
fi
-AC_ARG_ENABLE(oom, [AC_HELP_STRING([--enable-oom], [enable OOM score reporting])], ,enable_oom="no")
-if test "x$enable_oom" = xyes; then
- AC_DEFINE(HAVE_OOM, 1, [Define if OOM score support enabled.])
+# Bail out on errors.
+# ----------------------------------------------------------------------
+if test ! -z "$missing_libraries"; then
+ AC_MSG_ERROR([missing libraries: $missing_libraries])
fi
+if test ! -z "$missing_headers"; then
+ AC_MSG_ERROR([missing headers: $missing_headers])
+fi
+
+AC_DEFINE_UNQUOTED(COPYRIGHT, "(C) 2004-$year Hisham Muhammad", [Copyright message.])
+# We're done, let's go!
+# ----------------------------------------------------------------------
+AM_CONDITIONAL([HTOP_LINUX], [test "$my_htop_platform" = linux])
+AM_CONDITIONAL([HTOP_FREEBSD], [test "$my_htop_platform" = freebsd])
+AM_CONDITIONAL([HTOP_OPENBSD], [test "$my_htop_platform" = openbsd])
+AM_CONDITIONAL([HTOP_DARWIN], [test "$my_htop_platform" = darwin])
+AM_CONDITIONAL([HTOP_UNSUPPORTED], [test "$my_htop_platform" = unsupported])
+AC_SUBST(my_htop_platform)
AC_CONFIG_FILES([Makefile htop.1])
AC_OUTPUT
diff --git a/darwin/Battery.c b/darwin/Battery.c
new file mode 100644
index 0000000..d197c04
--- /dev/null
+++ b/darwin/Battery.c
@@ -0,0 +1,75 @@
+
+#include "BatteryMeter.h"
+
+#include <CoreFoundation/CoreFoundation.h>
+#include <CoreFoundation/CFString.h>
+#include <IOKit/ps/IOPowerSources.h>
+#include <IOKit/ps/IOPSKeys.h>
+
+void Battery_getData(double* level, ACPresence* isOnAC) {
+ CFTypeRef power_sources = IOPSCopyPowerSourcesInfo();
+
+ *level = -1;
+ *isOnAC = AC_ERROR;
+
+ if(NULL == power_sources) {
+ return;
+ }
+
+ if(power_sources != NULL) {
+ CFArrayRef list = IOPSCopyPowerSourcesList(power_sources);
+ CFDictionaryRef battery = NULL;
+ int len;
+
+ if(NULL == list) {
+ CFRelease(power_sources);
+
+ return;
+ }
+
+ len = CFArrayGetCount(list);
+
+ /* Get the battery */
+ for(int i = 0; i < len && battery == NULL; ++i) {
+ CFDictionaryRef candidate = IOPSGetPowerSourceDescription(power_sources,
+ CFArrayGetValueAtIndex(list, i)); /* GET rule */
+ CFStringRef type;
+
+ if(NULL != candidate) {
+ type = (CFStringRef) CFDictionaryGetValue(candidate,
+ CFSTR(kIOPSTransportTypeKey)); /* GET rule */
+
+ if(kCFCompareEqualTo == CFStringCompare(type, CFSTR(kIOPSInternalType), 0)) {
+ CFRetain(candidate);
+ battery = candidate;
+ }
+ }
+ }
+
+ if(NULL != battery) {
+ /* Determine the AC state */
+ CFStringRef power_state = CFDictionaryGetValue(battery, CFSTR(kIOPSPowerSourceStateKey));
+
+ *isOnAC = (kCFCompareEqualTo == CFStringCompare(power_state, CFSTR(kIOPSACPowerValue), 0))
+ ? AC_PRESENT
+ : AC_ABSENT;
+
+ /* Get the percentage remaining */
+ double current;
+ double max;
+
+ CFNumberGetValue(CFDictionaryGetValue(battery, CFSTR(kIOPSCurrentCapacityKey)),
+ kCFNumberDoubleType, &current);
+ CFNumberGetValue(CFDictionaryGetValue(battery, CFSTR(kIOPSMaxCapacityKey)),
+ kCFNumberDoubleType, &max);
+
+ *level = (current * 100.0) / max;
+
+ CFRelease(battery);
+ }
+
+ CFRelease(list);
+ CFRelease(power_sources);
+ }
+}
+
diff --git a/darwin/Battery.h b/darwin/Battery.h
new file mode 100644
index 0000000..8dc0cef
--- /dev/null
+++ b/darwin/Battery.h
@@ -0,0 +1,9 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_Battery
+#define HEADER_Battery
+
+void Battery_getData(double* level, ACPresence* isOnAC);
+
+
+#endif
diff --git a/darwin/DarwinCRT.c b/darwin/DarwinCRT.c
new file mode 100644
index 0000000..5172598
--- /dev/null
+++ b/darwin/DarwinCRT.c
@@ -0,0 +1,35 @@
+/*
+htop - DarwinCRT.c
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "config.h"
+#include "CRT.h"
+#include <stdio.h>
+#include <stdlib.h>
+#include <execinfo.h>
+
+void CRT_handleSIGSEGV(int sgn) {
+ (void) sgn;
+ CRT_done();
+ #ifdef __APPLE__
+ fprintf(stderr, "\n\nhtop " VERSION " aborting. Please report bug at http://hisham.hm/htop\n");
+ #ifdef HAVE_EXECINFO_H
+ size_t size = backtrace(backtraceArray, sizeof(backtraceArray) / sizeof(void *));
+ fprintf(stderr, "\n Please include in your report the following backtrace: \n");
+ backtrace_symbols_fd(backtraceArray, size, 2);
+ fprintf(stderr, "\nAdditionally, in order to make the above backtrace useful,");
+ fprintf(stderr, "\nplease also run the following command to generate a disassembly of your binary:");
+ fprintf(stderr, "\n\n otool -tvV `which htop` > ~/htop.otool");
+ fprintf(stderr, "\n\nand then attach the file ~/htop.otool to your bug report.");
+ fprintf(stderr, "\n\nThank you for helping to improve htop!\n\n");
+ #endif
+ #else
+ fprintf(stderr, "\nUnfortunately, you seem to be using an unsupported platform!");
+ fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n");
+ #endif
+ abort();
+}
+
diff --git a/darwin/DarwinCRT.h b/darwin/DarwinCRT.h
new file mode 100644
index 0000000..e1c22bb
--- /dev/null
+++ b/darwin/DarwinCRT.h
@@ -0,0 +1,15 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_DarwinCRT
+#define HEADER_DarwinCRT
+/*
+htop - DarwinCRT.h
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+void CRT_handleSIGSEGV(int sgn);
+
+
+#endif
diff --git a/darwin/DarwinProcess.c b/darwin/DarwinProcess.c
new file mode 100644
index 0000000..9c46046
--- /dev/null
+++ b/darwin/DarwinProcess.c
@@ -0,0 +1,344 @@
+/*
+htop - DarwinProcess.c
+(C) 2015 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Process.h"
+#include "DarwinProcess.h"
+
+#include <stdlib.h>
+#include <libproc.h>
+#include <string.h>
+#include <stdio.h>
+
+/*{
+#include "Settings.h"
+#include "DarwinProcessList.h"
+
+#include <sys/sysctl.h>
+
+typedef struct DarwinProcess_ {
+ Process super;
+
+ uint64_t utime;
+ uint64_t stime;
+} DarwinProcess;
+
+}*/
+
+ProcessClass DarwinProcess_class = {
+ .super = {
+ .extends = Class(Process),
+ .display = Process_display,
+ .delete = Process_delete,
+ .compare = Process_compare
+ },
+ .writeField = Process_writeField,
+};
+
+DarwinProcess* DarwinProcess_new(Settings* settings) {
+ DarwinProcess* this = xCalloc(1, sizeof(DarwinProcess));
+ Object_setClass(this, Class(DarwinProcess));
+ Process_init(&this->super, settings);
+
+ this->utime = 0;
+ this->stime = 0;
+
+ return this;
+}
+
+void Process_delete(Object* cast) {
+ DarwinProcess* this = (DarwinProcess*) cast;
+ Process_done(&this->super);
+ // free platform-specific fields here
+ free(this);
+}
+
+bool Process_isThread(Process* this) {
+ (void) this;
+ return false;
+}
+
+void DarwinProcess_setStartTime(Process *proc, struct extern_proc *ep, time_t now) {
+ struct tm date;
+
+ proc->starttime_ctime = ep->p_starttime.tv_sec;
+ (void) localtime_r(&proc->starttime_ctime, &date);
+ strftime(proc->starttime_show, 7, ((proc->starttime_ctime > now - 86400) ? "%R " : "%b%d "), &date);
+}
+
+char *DarwinProcess_getCmdLine(struct kinfo_proc* k, int show_args ) {
+ /* This function is from the old Mac version of htop. Originally from ps? */
+ int mib[3], argmax, nargs, c = 0;
+ size_t size;
+ char *procargs, *sp, *np, *cp, *retval;
+
+ /* Get the maximum process arguments size. */
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_ARGMAX;
+
+ size = sizeof( argmax );
+ if ( sysctl( mib, 2, &argmax, &size, NULL, 0 ) == -1 ) {
+ goto ERROR_A;
+ }
+
+ /* Allocate space for the arguments. */
+ procargs = ( char * ) xMalloc( argmax );
+ if ( procargs == NULL ) {
+ goto ERROR_A;
+ }
+
+ /*
+ * Make a sysctl() call to get the raw argument space of the process.
+ * The layout is documented in start.s, which is part of the Csu
+ * project. In summary, it looks like:
+ *
+ * /---------------\ 0x00000000
+ * : :
+ * : :
+ * |---------------|
+ * | argc |
+ * |---------------|
+ * | arg[0] |
+ * |---------------|
+ * : :
+ * : :
+ * |---------------|
+ * | arg[argc - 1] |
+ * |---------------|
+ * | 0 |
+ * |---------------|
+ * | env[0] |
+ * |---------------|
+ * : :
+ * : :
+ * |---------------|
+ * | env[n] |
+ * |---------------|
+ * | 0 |
+ * |---------------| <-- Beginning of data returned by sysctl() is here.
+ * | argc |
+ * |---------------|
+ * | exec_path |
+ * |:::::::::::::::|
+ * | |
+ * | String area. |
+ * | |
+ * |---------------| <-- Top of stack.
+ * : :
+ * : :
+ * \---------------/ 0xffffffff
+ */
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROCARGS2;
+ mib[2] = k->kp_proc.p_pid;
+
+ size = ( size_t ) argmax;
+ if ( sysctl( mib, 3, procargs, &size, NULL, 0 ) == -1 ) {
+ goto ERROR_B;
+ }
+
+ memcpy( &nargs, procargs, sizeof( nargs ) );
+ cp = procargs + sizeof( nargs );
+
+ /* Skip the saved exec_path. */
+ for ( ; cp < &procargs[size]; cp++ ) {
+ if ( *cp == '\0' ) {
+ /* End of exec_path reached. */
+ break;
+ }
+ }
+ if ( cp == &procargs[size] ) {
+ goto ERROR_B;
+ }
+
+ /* Skip trailing '\0' characters. */
+ for ( ; cp < &procargs[size]; cp++ ) {
+ if ( *cp != '\0' ) {
+ /* Beginning of first argument reached. */
+ break;
+ }
+ }
+ if ( cp == &procargs[size] ) {
+ goto ERROR_B;
+ }
+ /* Save where the argv[0] string starts. */
+ sp = cp;
+
+ /*
+ * Iterate through the '\0'-terminated strings and convert '\0' to ' '
+ * until a string is found that has a '=' character in it (or there are
+ * no more strings in procargs). There is no way to deterministically
+ * know where the command arguments end and the environment strings
+ * start, which is why the '=' character is searched for as a heuristic.
+ */
+ for ( np = NULL; c < nargs && cp < &procargs[size]; cp++ ) {
+ if ( *cp == '\0' ) {
+ c++;
+ if ( np != NULL ) {
+ /* Convert previous '\0'. */
+ *np = ' ';
+ }
+ /* Note location of current '\0'. */
+ np = cp;
+
+ if ( !show_args ) {
+ /*
+ * Don't convert '\0' characters to ' '.
+ * However, we needed to know that the
+ * command name was terminated, which we
+ * now know.
+ */
+ break;
+ }
+ }
+ }
+#if 0
+ /*
+ * If eflg is non-zero, continue converting '\0' characters to ' '
+ * characters until no more strings that look like environment settings
+ * follow.
+ */
+ if ( ( eflg != 0 )
+ && ( ( getuid( ) == 0 )
+ || ( k->kp_eproc.e_pcred.p_ruid == getuid( ) ) ) ) {
+ for ( ; cp < &procargs[size]; cp++ ) {
+ if ( *cp == '\0' ) {
+ if ( np != NULL ) {
+ if ( &np[1] == cp ) {
+ /*
+ * Two '\0' characters in a row.
+ * This should normally only
+ * happen after all the strings
+ * have been seen, but in any
+ * case, stop parsing.
+ */
+ break;
+ }
+ /* Convert previous '\0'. */
+ *np = ' ';
+ }
+ /* Note location of current '\0'. */
+ np = cp;
+ }
+ }
+ }
+#endif
+
+ /*
+ * sp points to the beginning of the arguments/environment string, and
+ * np should point to the '\0' terminator for the string.
+ */
+ if ( np == NULL || np == sp ) {
+ /* Empty or unterminated string. */
+ goto ERROR_B;
+ }
+
+ /* Make a copy of the string. */
+ retval = xStrdup(sp);
+
+ /* Clean up. */
+ free( procargs );
+
+ return retval;
+
+ERROR_B:
+ free( procargs );
+ERROR_A:
+ retval = xStrdup(k->kp_proc.p_comm);
+
+ return retval;
+}
+
+void DarwinProcess_setFromKInfoProc(Process *proc, struct kinfo_proc *ps, time_t now, bool exists) {
+ struct extern_proc *ep = &ps->kp_proc;
+
+ /* UNSET HERE :
+ *
+ * processor
+ * user (set at ProcessList level)
+ * nlwp
+ * percent_cpu
+ * percent_mem
+ * m_size
+ * m_resident
+ * minflt
+ * majflt
+ */
+
+ /* First, the "immutable" parts */
+ if(!exists) {
+ /* Set the PID/PGID/etc. */
+ proc->pid = ep->p_pid;
+ proc->ppid = ps->kp_eproc.e_ppid;
+ proc->pgrp = ps->kp_eproc.e_pgid;
+ proc->session = 0; /* TODO Get the session id */
+ proc->tgid = ps->kp_eproc.e_tpgid;
+ proc->st_uid = ps->kp_eproc.e_ucred.cr_uid;
+ /* e_tdev = (major << 24) | (minor & 0xffffff) */
+ /* e_tdev == -1 for "no device" */
+ proc->tty_nr = ps->kp_eproc.e_tdev & 0xff; /* TODO tty_nr is unsigned */
+
+ DarwinProcess_setStartTime(proc, ep, now);
+
+ /* The command is from the old Mac htop */
+ char *slash;
+
+ proc->comm = DarwinProcess_getCmdLine(ps, false);
+ slash = strrchr(proc->comm, '/');
+ proc->basenameOffset = (NULL != slash) ? (slash - proc->comm) : 0;
+ }
+
+ /* Mutable information */
+ proc->nice = ep->p_nice;
+ proc->priority = ep->p_priority;
+
+ /* Set the state */
+ switch(ep->p_stat) {
+ case SIDL: proc->state = 'I'; break;
+ case SRUN: proc->state = 'R'; break;
+ case SSLEEP: proc->state = 'S'; break;
+ case SSTOP: proc->state = 'T'; break;
+ case SZOMB: proc->state = 'Z'; break;
+ default: proc->state = '?'; break;
+ }
+
+ /* Make sure the updated flag is set */
+ proc->updated = true;
+}
+
+void DarwinProcess_setFromLibprocPidinfo(DarwinProcess *proc, DarwinProcessList *dpl) {
+ struct proc_taskinfo pti;
+
+ if(sizeof(pti) == proc_pidinfo(proc->super.pid, PROC_PIDTASKINFO, 0, &pti, sizeof(pti))) {
+ if(0 != proc->utime || 0 != proc->stime) {
+ uint64_t diff = (pti.pti_total_system - proc->stime)
+ + (pti.pti_total_user - proc->utime);
+
+ proc->super.percent_cpu = (double)diff * (double)dpl->super.cpuCount
+ / ((double)dpl->global_diff * 100000.0);
+
+// fprintf(stderr, "%f %llu %llu %llu %llu %llu\n", proc->super.percent_cpu,
+// proc->stime, proc->utime, pti.pti_total_system, pti.pti_total_user, dpl->global_diff);
+// exit(7);
+ }
+
+ proc->super.time = (pti.pti_total_system + pti.pti_total_user) / 10000000;
+ proc->super.nlwp = pti.pti_threadnum;
+ proc->super.m_size = pti.pti_virtual_size / 1024;
+ proc->super.m_resident = pti.pti_resident_size / 1024;
+ proc->super.majflt = pti.pti_faults;
+ proc->super.percent_mem = (double)pti.pti_resident_size * 100.0
+ / (double)dpl->host_info.max_mem;
+
+ proc->stime = pti.pti_total_system;
+ proc->utime = pti.pti_total_user;
+
+ dpl->super.kernelThreads += 0; /*pti.pti_threads_system;*/
+ dpl->super.userlandThreads += pti.pti_threadnum; /*pti.pti_threads_user;*/
+ dpl->super.totalTasks += pti.pti_threadnum;
+ dpl->super.runningTasks += pti.pti_numrunning;
+ }
+}
diff --git a/darwin/DarwinProcess.h b/darwin/DarwinProcess.h
new file mode 100644
index 0000000..c479acf
--- /dev/null
+++ b/darwin/DarwinProcess.h
@@ -0,0 +1,41 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_DarwinProcess
+#define HEADER_DarwinProcess
+/*
+htop - DarwinProcess.h
+(C) 2015 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Settings.h"
+#include "DarwinProcessList.h"
+
+#include <sys/sysctl.h>
+
+typedef struct DarwinProcess_ {
+ Process super;
+
+ uint64_t utime;
+ uint64_t stime;
+} DarwinProcess;
+
+
+extern ProcessClass DarwinProcess_class;
+
+DarwinProcess* DarwinProcess_new(Settings* settings);
+
+void Process_delete(Object* cast);
+
+bool Process_isThread(Process* this);
+
+void DarwinProcess_setStartTime(Process *proc, struct extern_proc *ep, time_t now);
+
+char *DarwinProcess_getCmdLine(struct kinfo_proc* k, int show_args );
+
+void DarwinProcess_setFromKInfoProc(Process *proc, struct kinfo_proc *ps, time_t now, bool exists);
+
+void DarwinProcess_setFromLibprocPidinfo(DarwinProcess *proc, DarwinProcessList *dpl);
+
+#endif
diff --git a/darwin/DarwinProcessList.c b/darwin/DarwinProcessList.c
new file mode 100644
index 0000000..7ea89d9
--- /dev/null
+++ b/darwin/DarwinProcessList.c
@@ -0,0 +1,184 @@
+/*
+htop - DarwinProcessList.c
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "ProcessList.h"
+#include "DarwinProcess.h"
+#include "DarwinProcessList.h"
+#include "CRT.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <stdio.h>
+#include <libproc.h>
+#include <sys/mman.h>
+#include <utmpx.h>
+#include <err.h>
+
+/*{
+#include "ProcessList.h"
+#include <mach/mach_host.h>
+#include <sys/sysctl.h>
+
+typedef struct DarwinProcessList_ {
+ ProcessList super;
+
+ host_basic_info_data_t host_info;
+ vm_statistics_data_t vm_stats;
+ processor_cpu_load_info_t prev_load;
+ processor_cpu_load_info_t curr_load;
+ uint64_t kernel_threads;
+ uint64_t user_threads;
+ uint64_t global_diff;
+} DarwinProcessList;
+
+}*/
+
+void ProcessList_getHostInfo(host_basic_info_data_t *p) {
+ mach_msg_type_number_t info_size = HOST_BASIC_INFO_COUNT;
+
+ if(0 != host_info(mach_host_self(), HOST_BASIC_INFO, (host_info_t)p, &info_size)) {
+ CRT_fatalError("Unable to retrieve host info\n");
+ }
+}
+
+void ProcessList_freeCPULoadInfo(processor_cpu_load_info_t *p) {
+ if(NULL != p && NULL != *p) {
+ if(0 != munmap(*p, vm_page_size)) {
+ CRT_fatalError("Unable to free old CPU load information\n");
+ }
+ }
+
+ *p = NULL;
+}
+
+unsigned ProcessList_allocateCPULoadInfo(processor_cpu_load_info_t *p) {
+ mach_msg_type_number_t info_size = sizeof(processor_cpu_load_info_t);
+ unsigned cpu_count;
+
+ // TODO Improving the accuracy of the load counts woule help a lot.
+ if(0 != host_processor_info(mach_host_self(), PROCESSOR_CPU_LOAD_INFO, &cpu_count, (processor_info_array_t *)p, &info_size)) {
+ CRT_fatalError("Unable to retrieve CPU info\n");
+ }
+
+ return cpu_count;
+}
+
+void ProcessList_getVMStats(vm_statistics_t p) {
+ mach_msg_type_number_t info_size = HOST_VM_INFO_COUNT;
+
+ if (host_statistics(mach_host_self(), HOST_VM_INFO, (host_info_t)p, &info_size) != 0)
+ CRT_fatalError("Unable to retrieve VM statistics\n");
+}
+
+struct kinfo_proc *ProcessList_getKInfoProcs(size_t *count) {
+ int mib[4] = { CTL_KERN, KERN_PROC, KERN_PROC_ALL, 0 };
+ struct kinfo_proc *processes = NULL;
+
+ /* Note the two calls to sysctl(). One to get length and one to get the
+ * data. This -does- mean that the second call could end up with a missing
+ * process entry or two.
+ */
+ *count = 0;
+ if (sysctl(mib, 4, NULL, count, NULL, 0) < 0)
+ CRT_fatalError("Unable to get size of kproc_infos");
+
+ processes = xMalloc(*count);
+ if (processes == NULL)
+ CRT_fatalError("Out of memory for kproc_infos");
+
+ if (sysctl(mib, 4, processes, count, NULL, 0) < 0)
+ CRT_fatalError("Unable to get kinfo_procs");
+
+ *count = *count / sizeof(struct kinfo_proc);
+
+ return processes;
+}
+
+
+ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) {
+ DarwinProcessList* this = xCalloc(1, sizeof(DarwinProcessList));
+
+ ProcessList_init(&this->super, Class(Process), usersTable, pidWhiteList, userId);
+
+ /* Initialize the CPU information */
+ this->super.cpuCount = ProcessList_allocateCPULoadInfo(&this->prev_load);
+ ProcessList_getHostInfo(&this->host_info);
+ ProcessList_allocateCPULoadInfo(&this->curr_load);
+
+ /* Initialize the VM statistics */
+ ProcessList_getVMStats(&this->vm_stats);
+
+ this->super.kernelThreads = 0;
+ this->super.userlandThreads = 0;
+ this->super.totalTasks = 0;
+ this->super.runningTasks = 0;
+
+ return &this->super;
+}
+
+void ProcessList_delete(ProcessList* this) {
+ ProcessList_done(this);
+ free(this);
+}
+
+void ProcessList_goThroughEntries(ProcessList* super) {
+ DarwinProcessList *dpl = (DarwinProcessList *)super;
+ bool preExisting = true;
+ struct kinfo_proc *ps;
+ size_t count;
+ DarwinProcess *proc;
+ struct timeval tv;
+
+ gettimeofday(&tv, NULL); /* Start processing time */
+
+ /* Update the global data (CPU times and VM stats) */
+ ProcessList_freeCPULoadInfo(&dpl->prev_load);
+ dpl->prev_load = dpl->curr_load;
+ ProcessList_allocateCPULoadInfo(&dpl->curr_load);
+ ProcessList_getVMStats(&dpl->vm_stats);
+
+ /* Get the time difference */
+ dpl->global_diff = 0;
+ for(int i = 0; i < dpl->super.cpuCount; ++i) {
+ for(size_t j = 0; j < CPU_STATE_MAX; ++j) {
+ dpl->global_diff += dpl->curr_load[i].cpu_ticks[j] - dpl->prev_load[i].cpu_ticks[j];
+ }
+ }
+
+ /* Clear the thread counts */
+ super->kernelThreads = 0;
+ super->userlandThreads = 0;
+ super->totalTasks = 0;
+ super->runningTasks = 0;
+
+ /* We use kinfo_procs for initial data since :
+ *
+ * 1) They always succeed.
+ * 2) The contain the basic information.
+ *
+ * We attempt to fill-in additional information with libproc.
+ */
+ ps = ProcessList_getKInfoProcs(&count);
+
+ for(size_t i = 0; i < count; ++i) {
+ proc = (DarwinProcess *)ProcessList_getProcess(super, ps[i].kp_proc.p_pid, &preExisting, (Process_New)DarwinProcess_new);
+
+ DarwinProcess_setFromKInfoProc(&proc->super, ps + i, tv.tv_sec, preExisting);
+ DarwinProcess_setFromLibprocPidinfo(proc, dpl);
+
+ super->totalTasks += 1;
+
+ if(!preExisting) {
+ proc->super.user = UsersTable_getRef(super->usersTable, proc->super.st_uid);
+
+ ProcessList_add(super, &proc->super);
+ }
+ }
+
+ free(ps);
+}
diff --git a/darwin/DarwinProcessList.h b/darwin/DarwinProcessList.h
new file mode 100644
index 0000000..c216a80
--- /dev/null
+++ b/darwin/DarwinProcessList.h
@@ -0,0 +1,45 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_DarwinProcessList
+#define HEADER_DarwinProcessList
+/*
+htop - DarwinProcessList.h
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "ProcessList.h"
+#include <mach/mach_host.h>
+#include <sys/sysctl.h>
+
+typedef struct DarwinProcessList_ {
+ ProcessList super;
+
+ host_basic_info_data_t host_info;
+ vm_statistics_data_t vm_stats;
+ processor_cpu_load_info_t prev_load;
+ processor_cpu_load_info_t curr_load;
+ uint64_t kernel_threads;
+ uint64_t user_threads;
+ uint64_t global_diff;
+} DarwinProcessList;
+
+
+void ProcessList_getHostInfo(host_basic_info_data_t *p);
+
+void ProcessList_freeCPULoadInfo(processor_cpu_load_info_t *p);
+
+unsigned ProcessList_allocateCPULoadInfo(processor_cpu_load_info_t *p);
+
+void ProcessList_getVMStats(vm_statistics_t p);
+
+struct kinfo_proc *ProcessList_getKInfoProcs(size_t *count);
+
+ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId);
+
+void ProcessList_delete(ProcessList* this);
+
+void ProcessList_goThroughEntries(ProcessList* super);
+
+#endif
diff --git a/darwin/Platform.c b/darwin/Platform.c
new file mode 100644
index 0000000..303b6c1
--- /dev/null
+++ b/darwin/Platform.c
@@ -0,0 +1,295 @@
+/*
+htop - darwin/Platform.c
+(C) 2014 Hisham H. Muhammad
+(C) 2015 David C. Hunt
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Platform.h"
+#include "CPUMeter.h"
+#include "MemoryMeter.h"
+#include "SwapMeter.h"
+#include "TasksMeter.h"
+#include "LoadAverageMeter.h"
+#include "ClockMeter.h"
+#include "HostnameMeter.h"
+#include "UptimeMeter.h"
+#include "DarwinProcessList.h"
+
+#include <stdlib.h>
+
+/*{
+#include "Action.h"
+#include "SignalsPanel.h"
+#include "CPUMeter.h"
+#include "BatteryMeter.h"
+#include "DarwinProcess.h"
+}*/
+
+#ifndef CLAMP
+#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
+#endif
+
+ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 };
+
+SignalItem Platform_signals[] = {
+ { .name = " 0 Cancel", .number = 0 },
+ { .name = " 1 SIGHUP", .number = 1 },
+ { .name = " 2 SIGINT", .number = 2 },
+ { .name = " 3 SIGQUIT", .number = 3 },
+ { .name = " 4 SIGILL", .number = 4 },
+ { .name = " 5 SIGTRAP", .number = 5 },
+ { .name = " 6 SIGABRT", .number = 6 },
+ { .name = " 6 SIGIOT", .number = 6 },
+ { .name = " 7 SIGEMT", .number = 7 },
+ { .name = " 8 SIGFPE", .number = 8 },
+ { .name = " 9 SIGKILL", .number = 9 },
+ { .name = "10 SIGBUS", .number = 10 },
+ { .name = "11 SIGSEGV", .number = 11 },
+ { .name = "12 SIGSYS", .number = 12 },
+ { .name = "13 SIGPIPE", .number = 13 },
+ { .name = "14 SIGALRM", .number = 14 },
+ { .name = "15 SIGTERM", .number = 15 },
+ { .name = "16 SIGURG", .number = 16 },
+ { .name = "17 SIGSTOP", .number = 17 },
+ { .name = "18 SIGTSTP", .number = 18 },
+ { .name = "19 SIGCONT", .number = 19 },
+ { .name = "20 SIGCHLD", .number = 20 },
+ { .name = "21 SIGTTIN", .number = 21 },
+ { .name = "22 SIGTTOU", .number = 22 },
+ { .name = "23 SIGIO", .number = 23 },
+ { .name = "24 SIGXCPU", .number = 24 },
+ { .name = "25 SIGXFSZ", .number = 25 },
+ { .name = "26 SIGVTALRM", .number = 26 },
+ { .name = "27 SIGPROF", .number = 27 },
+ { .name = "28 SIGWINCH", .number = 28 },
+ { .name = "29 SIGINFO", .number = 29 },
+ { .name = "30 SIGUSR1", .number = 30 },
+ { .name = "31 SIGUSR2", .number = 31 },
+};
+
+unsigned int Platform_numberOfSignals = sizeof(Platform_signals)/sizeof(SignalItem);
+
+ProcessFieldData Process_fields[] = {
+ [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, },
+ [PID] = { .name = "PID", .title = " PID ", .description = "Process/thread ID", .flags = 0, },
+ [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, },
+ [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging)", .flags = 0, },
+ [PPID] = { .name = "PPID", .title = " PPID ", .description = "Parent process ID", .flags = 0, },
+ [PGRP] = { .name = "PGRP", .title = " PGRP ", .description = "Process group ID", .flags = 0, },
+ [SESSION] = { .name = "SESSION", .title = " SESN ", .description = "Process's session ID", .flags = 0, },
+ [TTY_NR] = { .name = "TTY_NR", .title = " TTY ", .description = "Controlling terminal", .flags = 0, },
+ [TPGID] = { .name = "TPGID", .title = " TPGID ", .description = "Process ID of the fg process group of the controlling terminal", .flags = 0, },
+ [MINFLT] = { .name = "MINFLT", .title = " MINFLT ", .description = "Number of minor faults which have not required loading a memory page from disk", .flags = 0, },
+ [MAJFLT] = { .name = "MAJFLT", .title = " MAJFLT ", .description = "Number of major faults which have required loading a memory page from disk", .flags = 0, },
+ [PRIORITY] = { .name = "PRIORITY", .title = "PRI ", .description = "Kernel's internal priority for the process", .flags = 0, },
+ [NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, },
+ [STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, },
+
+ [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, },
+ [M_SIZE] = { .name = "M_SIZE", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, },
+ [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, },
+ [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, },
+ [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, },
+ [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, },
+ [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, },
+ [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, },
+ [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, },
+ [TGID] = { .name = "TGID", .title = " TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, },
+ [100] = { .name = "*** report bug! ***", .title = NULL, .description = NULL, .flags = 0, },
+};
+
+MeterClass* Platform_meterTypes[] = {
+ &CPUMeter_class,
+ &ClockMeter_class,
+ &LoadAverageMeter_class,
+ &LoadMeter_class,
+ &MemoryMeter_class,
+ &SwapMeter_class,
+ &TasksMeter_class,
+ &BatteryMeter_class,
+ &HostnameMeter_class,
+ &UptimeMeter_class,
+ &AllCPUsMeter_class,
+ &AllCPUs2Meter_class,
+ &LeftCPUsMeter_class,
+ &RightCPUsMeter_class,
+ &LeftCPUs2Meter_class,
+ &RightCPUs2Meter_class,
+ &BlankMeter_class,
+ NULL
+};
+
+void Platform_setBindings(Htop_Action* keys) {
+ (void) keys;
+}
+
+int Platform_numberOfFields = 100;
+
+int Platform_getUptime() {
+ struct timeval bootTime, currTime;
+ int mib[2] = { CTL_KERN, KERN_BOOTTIME };
+ size_t size = sizeof(bootTime);
+
+ int err = sysctl(mib, 2, &bootTime, &size, NULL, 0);
+ if (err) {
+ return -1;
+ }
+ gettimeofday(&currTime, NULL);
+
+ return (int) difftime(currTime.tv_sec, bootTime.tv_sec);
+}
+
+void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
+ double results[3];
+
+ if(3 == getloadavg(results, 3)) {
+ *one = results[0];
+ *five = results[1];
+ *fifteen = results[2];
+ } else {
+ *one = 0;
+ *five = 0;
+ *fifteen = 0;
+ }
+}
+
+int Platform_getMaxPid() {
+ /* http://opensource.apple.com/source/xnu/xnu-2782.1.97/bsd/sys/proc_internal.hh */
+ return 99999;
+}
+
+ProcessPidColumn Process_pidColumns[] = {
+ { .id = PID, .label = "PID" },
+ { .id = PPID, .label = "PPID" },
+ { .id = TPGID, .label = "TPGID" },
+ { .id = TGID, .label = "TGID" },
+ { .id = PGRP, .label = "PGRP" },
+ { .id = SESSION, .label = "SESN" },
+ { .id = 0, .label = NULL },
+};
+
+static double Platform_setCPUAverageValues(Meter* mtr) {
+ DarwinProcessList *dpl = (DarwinProcessList *)mtr->pl;
+ int cpus = dpl->super.cpuCount;
+ double sumNice = 0.0;
+ double sumNormal = 0.0;
+ double sumKernel = 0.0;
+ double sumPercent = 0.0;
+ for (int i = 1; i <= cpus; i++) {
+ sumPercent += Platform_setCPUValues(mtr, i);
+ sumNice += mtr->values[CPU_METER_NICE];
+ sumNormal += mtr->values[CPU_METER_NORMAL];
+ sumKernel += mtr->values[CPU_METER_KERNEL];
+ }
+ mtr->values[CPU_METER_NICE] = sumNice / cpus;
+ mtr->values[CPU_METER_NORMAL] = sumNormal / cpus;
+ mtr->values[CPU_METER_KERNEL] = sumKernel / cpus;
+ return sumPercent / cpus;
+}
+
+double Platform_setCPUValues(Meter* mtr, int cpu) {
+
+ if (cpu == 0) {
+ return Platform_setCPUAverageValues(mtr);
+ }
+
+ DarwinProcessList *dpl = (DarwinProcessList *)mtr->pl;
+ processor_cpu_load_info_t prev = &dpl->prev_load[cpu-1];
+ processor_cpu_load_info_t curr = &dpl->curr_load[cpu-1];
+ double total = 0;
+
+ /* Take the sums */
+ for(size_t i = 0; i < CPU_STATE_MAX; ++i) {
+ total += (double)curr->cpu_ticks[i] - (double)prev->cpu_ticks[i];
+ }
+
+ mtr->values[CPU_METER_NICE]
+ = ((double)curr->cpu_ticks[CPU_STATE_NICE] - (double)prev->cpu_ticks[CPU_STATE_NICE])* 100.0 / total;
+ mtr->values[CPU_METER_NORMAL]
+ = ((double)curr->cpu_ticks[CPU_STATE_USER] - (double)prev->cpu_ticks[CPU_STATE_USER])* 100.0 / total;
+ mtr->values[CPU_METER_KERNEL]
+ = ((double)curr->cpu_ticks[CPU_STATE_SYSTEM] - (double)prev->cpu_ticks[CPU_STATE_SYSTEM])* 100.0 / total;
+
+ Meter_setItems(mtr, 3);
+
+ /* Convert to percent and return */
+ total = mtr->values[CPU_METER_NICE] + mtr->values[CPU_METER_NORMAL] + mtr->values[CPU_METER_KERNEL];
+
+ return CLAMP(total, 0.0, 100.0);
+}
+
+void Platform_setMemoryValues(Meter* mtr) {
+ DarwinProcessList *dpl = (DarwinProcessList *)mtr->pl;
+ vm_statistics_t vm = &dpl->vm_stats;
+ double page_K = (double)vm_page_size / (double)1024;
+
+ mtr->total = dpl->host_info.max_mem / 1024;
+ mtr->values[0] = (double)(vm->active_count + vm->wire_count) * page_K;
+ mtr->values[1] = (double)vm->purgeable_count * page_K;
+ mtr->values[2] = (double)vm->inactive_count * page_K;
+}
+
+void Platform_setSwapValues(Meter* mtr) {
+ int mib[2] = {CTL_VM, VM_SWAPUSAGE};
+ struct xsw_usage swapused;
+ size_t swlen = sizeof(swapused);
+ sysctl(mib, 2, &swapused, &swlen, NULL, 0);
+
+ mtr->total = swapused.xsu_total / 1024;
+ mtr->values[0] = swapused.xsu_used / 1024;
+}
+
+char* Platform_getProcessEnv(pid_t pid) {
+ char* env = NULL;
+
+ int argmax;
+ size_t bufsz = sizeof(argmax);
+
+ int mib[3];
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_ARGMAX;
+ if (sysctl(mib, 2, &argmax, &bufsz, 0, 0) == 0) {
+ char* buf = xMalloc(argmax);
+ if (buf) {
+ mib[0] = CTL_KERN;
+ mib[1] = KERN_PROCARGS2;
+ mib[2] = pid;
+ size_t bufsz = argmax;
+ if (sysctl(mib, 3, buf, &bufsz, 0, 0) == 0) {
+ if (bufsz > sizeof(int)) {
+ char *p = buf, *endp = buf + bufsz;
+ int argc = *(int*)p;
+ p += sizeof(int);
+
+ // skip exe
+ p = strchr(p, 0)+1;
+
+ // skip padding
+ while(!*p && p < endp)
+ ++p;
+
+ // skip argv
+ for (; argc-- && p < endp; p = strrchr(p, 0)+1)
+ ;
+
+ // skip padding
+ while(!*p && p < endp)
+ ++p;
+
+ size_t size = endp - p;
+ env = xMalloc(size+2);
+ if (env) {
+ memcpy(env, p, size);
+ env[size] = 0;
+ env[size+1] = 0;
+ }
+ }
+ }
+ free(buf);
+ }
+ }
+
+ return env;
+}
diff --git a/darwin/Platform.h b/darwin/Platform.h
new file mode 100644
index 0000000..29ef289
--- /dev/null
+++ b/darwin/Platform.h
@@ -0,0 +1,53 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_Platform
+#define HEADER_Platform
+/*
+htop - darwin/Platform.h
+(C) 2014 Hisham H. Muhammad
+(C) 2015 David C. Hunt
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Action.h"
+#include "SignalsPanel.h"
+#include "CPUMeter.h"
+#include "BatteryMeter.h"
+#include "DarwinProcess.h"
+
+#ifndef CLAMP
+#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
+#endif
+
+extern ProcessField Platform_defaultFields[];
+
+extern SignalItem Platform_signals[];
+
+extern unsigned int Platform_numberOfSignals;
+
+extern ProcessFieldData Process_fields[];
+
+extern MeterClass* Platform_meterTypes[];
+
+void Platform_setBindings(Htop_Action* keys);
+
+extern int Platform_numberOfFields;
+
+int Platform_getUptime();
+
+void Platform_getLoadAverage(double* one, double* five, double* fifteen);
+
+int Platform_getMaxPid();
+
+extern ProcessPidColumn Process_pidColumns[];
+
+double Platform_setCPUValues(Meter* mtr, int cpu);
+
+void Platform_setMemoryValues(Meter* mtr);
+
+void Platform_setSwapValues(Meter* mtr);
+
+char* Platform_getProcessEnv(pid_t pid);
+
+#endif
diff --git a/freebsd/Battery.c b/freebsd/Battery.c
new file mode 100644
index 0000000..ab63aa1
--- /dev/null
+++ b/freebsd/Battery.c
@@ -0,0 +1,15 @@
+/*
+htop - freebsd/Battery.c
+(C) 2015 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "BatteryMeter.h"
+
+void Battery_getData(double* level, ACPresence* isOnAC) {
+ // TODO
+ *level = -1;
+ *isOnAC = AC_ERROR;
+}
+
diff --git a/freebsd/Battery.h b/freebsd/Battery.h
new file mode 100644
index 0000000..2b4a9a8
--- /dev/null
+++ b/freebsd/Battery.h
@@ -0,0 +1,15 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_Battery
+#define HEADER_Battery
+/*
+htop - freebsd/Battery.h
+(C) 2015 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+void Battery_getData(double* level, ACPresence* isOnAC);
+
+
+#endif
diff --git a/freebsd/FreeBSDCRT.c b/freebsd/FreeBSDCRT.c
new file mode 100644
index 0000000..5c3a9de
--- /dev/null
+++ b/freebsd/FreeBSDCRT.c
@@ -0,0 +1,21 @@
+/*
+htop - UnsupportedCRT.c
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "config.h"
+#include "CRT.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+void CRT_handleSIGSEGV(int sgn) {
+ (void) sgn;
+ CRT_done();
+ fprintf(stderr, "\n\nhtop " VERSION " aborting.\n");
+ fprintf(stderr, "\nUnfortunately, you seem to be using an unsupported platform!");
+ fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n");
+ abort();
+}
+
diff --git a/freebsd/FreeBSDCRT.h b/freebsd/FreeBSDCRT.h
new file mode 100644
index 0000000..eb1091a
--- /dev/null
+++ b/freebsd/FreeBSDCRT.h
@@ -0,0 +1,15 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_FreeBSDCRT
+#define HEADER_FreeBSDCRT
+/*
+htop - UnsupportedCRT.h
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+void CRT_handleSIGSEGV(int sgn);
+
+
+#endif
diff --git a/freebsd/FreeBSDProcess.c b/freebsd/FreeBSDProcess.c
new file mode 100644
index 0000000..70cfb95
--- /dev/null
+++ b/freebsd/FreeBSDProcess.c
@@ -0,0 +1,164 @@
+/*
+htop - FreeBSDProcess.c
+(C) 2015 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Process.h"
+#include "ProcessList.h"
+#include "FreeBSDProcess.h"
+#include "Platform.h"
+#include "CRT.h"
+
+#include <stdlib.h>
+#include <string.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+/*{
+
+typedef enum FreeBSDProcessFields {
+ // Add platform-specific fields here, with ids >= 100
+ JID = 100,
+ JAIL = 101,
+ LAST_PROCESSFIELD = 102,
+} FreeBSDProcessField;
+
+
+typedef struct FreeBSDProcess_ {
+ Process super;
+ int kernel;
+ int jid;
+ char* jname;
+} FreeBSDProcess;
+
+
+#ifndef Process_isKernelThread
+#define Process_isKernelThread(_process) (_process->kernel == 1)
+#endif
+
+#ifndef Process_isUserlandThread
+#define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
+#endif
+
+}*/
+
+ProcessClass FreeBSDProcess_class = {
+ .super = {
+ .extends = Class(Process),
+ .display = Process_display,
+ .delete = Process_delete,
+ .compare = FreeBSDProcess_compare
+ },
+ .writeField = (Process_WriteField) FreeBSDProcess_writeField,
+};
+
+ProcessFieldData Process_fields[] = {
+ [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, },
+ [PID] = { .name = "PID", .title = " PID ", .description = "Process/thread ID", .flags = 0, },
+ [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, },
+ [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging)", .flags = 0, },
+ [PPID] = { .name = "PPID", .title = " PPID ", .description = "Parent process ID", .flags = 0, },
+ [PGRP] = { .name = "PGRP", .title = " PGRP ", .description = "Process group ID", .flags = 0, },
+ [SESSION] = { .name = "SESSION", .title = " SESN ", .description = "Process's session ID", .flags = 0, },
+ [TTY_NR] = { .name = "TTY_NR", .title = " TTY ", .description = "Controlling terminal", .flags = 0, },
+ [TPGID] = { .name = "TPGID", .title = " TPGID ", .description = "Process ID of the fg process group of the controlling terminal", .flags = 0, },
+ [MINFLT] = { .name = "MINFLT", .title = " MINFLT ", .description = "Number of minor faults which have not required loading a memory page from disk", .flags = 0, },
+ [MAJFLT] = { .name = "MAJFLT", .title = " MAJFLT ", .description = "Number of major faults which have required loading a memory page from disk", .flags = 0, },
+ [PRIORITY] = { .name = "PRIORITY", .title = "PRI ", .description = "Kernel's internal priority for the process", .flags = 0, },
+ [NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, },
+ [STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, },
+
+ [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, },
+ [M_SIZE] = { .name = "M_SIZE", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, },
+ [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, },
+ [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, },
+ [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, },
+ [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, },
+ [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, },
+ [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, },
+ [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, },
+ [TGID] = { .name = "TGID", .title = " TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, },
+ [JID] = { .name = "JID", .title = " JID ", .description = "Jail prison ID", .flags = 0, },
+ [JAIL] = { .name = "JAIL", .title = "JAIL ", .description = "Jail prison name", .flags = 0, },
+ [LAST_PROCESSFIELD] = { .name = "*** report bug! ***", .title = NULL, .description = NULL, .flags = 0, },
+};
+
+ProcessPidColumn Process_pidColumns[] = {
+ { .id = JID, .label = "JID" },
+ { .id = PID, .label = "PID" },
+ { .id = PPID, .label = "PPID" },
+ { .id = TPGID, .label = "TPGID" },
+ { .id = TGID, .label = "TGID" },
+ { .id = PGRP, .label = "PGRP" },
+ { .id = SESSION, .label = "SESN" },
+ { .id = 0, .label = NULL },
+};
+
+FreeBSDProcess* FreeBSDProcess_new(Settings* settings) {
+ FreeBSDProcess* this = xCalloc(1, sizeof(FreeBSDProcess));
+ Object_setClass(this, Class(FreeBSDProcess));
+ Process_init(&this->super, settings);
+ return this;
+}
+
+void Process_delete(Object* cast) {
+ FreeBSDProcess* this = (FreeBSDProcess*) cast;
+ Process_done((Process*)cast);
+ free(this->jname);
+ free(this);
+}
+
+void FreeBSDProcess_writeField(Process* this, RichString* str, ProcessField field) {
+ FreeBSDProcess* fp = (FreeBSDProcess*) this;
+ char buffer[256]; buffer[255] = '\0';
+ int attr = CRT_colors[DEFAULT_COLOR];
+ int n = sizeof(buffer) - 1;
+ switch (field) {
+ // add FreeBSD-specific fields here
+ case JID: snprintf(buffer, n, Process_pidFormat, fp->jid); break;
+ case JAIL:{
+ snprintf(buffer, n, "%-11s ", fp->jname); break;
+ if (buffer[11] != '\0') {
+ buffer[11] = ' ';
+ buffer[12] = '\0';
+ }
+ break;
+ }
+ default:
+ Process_writeField(this, str, field);
+ return;
+ }
+ RichString_append(str, attr, buffer);
+}
+
+long FreeBSDProcess_compare(const void* v1, const void* v2) {
+ FreeBSDProcess *p1, *p2;
+ Settings *settings = ((Process*)v1)->settings;
+ if (settings->direction == 1) {
+ p1 = (FreeBSDProcess*)v1;
+ p2 = (FreeBSDProcess*)v2;
+ } else {
+ p2 = (FreeBSDProcess*)v1;
+ p1 = (FreeBSDProcess*)v2;
+ }
+ switch (settings->sortKey) {
+ // add FreeBSD-specific fields here
+ case JID:
+ return (p1->jid - p2->jid);
+ case JAIL:
+ return strcmp(p1->jname ? p1->jname : "", p2->jname ? p2->jname : "");
+ default:
+ return Process_compare(v1, v2);
+ }
+}
+
+bool Process_isThread(Process* this) {
+ FreeBSDProcess* fp = (FreeBSDProcess*) this;
+
+ if (fp->kernel == 1 )
+ return 1;
+ else
+ return (Process_isUserlandThread(this));
+}
diff --git a/freebsd/FreeBSDProcess.h b/freebsd/FreeBSDProcess.h
new file mode 100644
index 0000000..23d298a
--- /dev/null
+++ b/freebsd/FreeBSDProcess.h
@@ -0,0 +1,54 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_FreeBSDProcess
+#define HEADER_FreeBSDProcess
+/*
+htop - FreeBSDProcess.h
+(C) 2015 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+
+typedef enum FreeBSDProcessFields {
+ // Add platform-specific fields here, with ids >= 100
+ JID = 100,
+ JAIL = 101,
+ LAST_PROCESSFIELD = 102,
+} FreeBSDProcessField;
+
+
+typedef struct FreeBSDProcess_ {
+ Process super;
+ int kernel;
+ int jid;
+ char* jname;
+} FreeBSDProcess;
+
+
+#ifndef Process_isKernelThread
+#define Process_isKernelThread(_process) (_process->kernel == 1)
+#endif
+
+#ifndef Process_isUserlandThread
+#define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
+#endif
+
+
+extern ProcessClass FreeBSDProcess_class;
+
+extern ProcessFieldData Process_fields[];
+
+extern ProcessPidColumn Process_pidColumns[];
+
+FreeBSDProcess* FreeBSDProcess_new(Settings* settings);
+
+void Process_delete(Object* cast);
+
+void FreeBSDProcess_writeField(Process* this, RichString* str, ProcessField field);
+
+long FreeBSDProcess_compare(const void* v1, const void* v2);
+
+bool Process_isThread(Process* this);
+
+#endif
diff --git a/freebsd/FreeBSDProcessList.c b/freebsd/FreeBSDProcessList.c
new file mode 100644
index 0000000..7c4a6db
--- /dev/null
+++ b/freebsd/FreeBSDProcessList.c
@@ -0,0 +1,532 @@
+/*
+htop - FreeBSDProcessList.c
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "ProcessList.h"
+#include "FreeBSDProcessList.h"
+#include "FreeBSDProcess.h"
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#include <sys/user.h>
+#include <fcntl.h>
+#include <string.h>
+
+/*{
+
+#include <kvm.h>
+#include <sys/param.h>
+#include <sys/jail.h>
+#include <sys/uio.h>
+#include <sys/resource.h>
+
+#define JAIL_ERRMSGLEN 1024
+char jail_errmsg[JAIL_ERRMSGLEN];
+
+typedef struct CPUData_ {
+
+ double userPercent;
+ double nicePercent;
+ double systemPercent;
+ double irqPercent;
+ double idlePercent;
+ double systemAllPercent;
+
+} CPUData;
+
+typedef struct FreeBSDProcessList_ {
+ ProcessList super;
+ kvm_t* kd;
+
+ int zfsArcEnabled;
+
+ unsigned long long int memWire;
+ unsigned long long int memActive;
+ unsigned long long int memInactive;
+ unsigned long long int memFree;
+ unsigned long long int memZfsArc;
+
+
+ CPUData* cpus;
+
+ unsigned long *cp_time_o;
+ unsigned long *cp_time_n;
+
+ unsigned long *cp_times_o;
+ unsigned long *cp_times_n;
+
+} FreeBSDProcessList;
+
+}*/
+
+
+static int MIB_hw_physmem[2];
+static int MIB_vm_stats_vm_v_page_count[4];
+static int pageSize;
+static int pageSizeKb;
+
+static int MIB_vm_stats_vm_v_wire_count[4];
+static int MIB_vm_stats_vm_v_active_count[4];
+static int MIB_vm_stats_vm_v_cache_count[4];
+static int MIB_vm_stats_vm_v_inactive_count[4];
+static int MIB_vm_stats_vm_v_free_count[4];
+
+static int MIB_vfs_bufspace[2];
+
+static int MIB_kstat_zfs_misc_arcstats_size[5];
+
+static int MIB_kern_cp_time[2];
+static int MIB_kern_cp_times[2];
+static int kernelFScale;
+
+
+ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) {
+ FreeBSDProcessList* fpl = xCalloc(1, sizeof(FreeBSDProcessList));
+ ProcessList* pl = (ProcessList*) fpl;
+ ProcessList_init(pl, Class(FreeBSDProcess), usersTable, pidWhiteList, userId);
+
+ size_t len;
+
+ // physical memory in system: hw.physmem
+ // physical page size: hw.pagesize
+ // usable pagesize : vm.stats.vm.v_page_size
+ len = 2; sysctlnametomib("hw.physmem", MIB_hw_physmem, &len);
+
+ len = sizeof(pageSize);
+ if (sysctlbyname("vm.stats.vm.v_page_size", &pageSize, &len, NULL, 0) == -1) {
+ pageSize = PAGE_SIZE;
+ pageSizeKb = PAGE_SIZE_KB;
+ } else {
+ pageSizeKb = pageSize / ONE_K;
+ }
+
+ // usable page count vm.stats.vm.v_page_count
+ // actually usable memory : vm.stats.vm.v_page_count * vm.stats.vm.v_page_size
+ len = 4; sysctlnametomib("vm.stats.vm.v_page_count", MIB_vm_stats_vm_v_page_count, &len);
+
+ len = 4; sysctlnametomib("vm.stats.vm.v_wire_count", MIB_vm_stats_vm_v_wire_count, &len);
+ len = 4; sysctlnametomib("vm.stats.vm.v_active_count", MIB_vm_stats_vm_v_active_count, &len);
+ len = 4; sysctlnametomib("vm.stats.vm.v_cache_count", MIB_vm_stats_vm_v_cache_count, &len);
+ len = 4; sysctlnametomib("vm.stats.vm.v_inactive_count", MIB_vm_stats_vm_v_inactive_count, &len);
+ len = 4; sysctlnametomib("vm.stats.vm.v_free_count", MIB_vm_stats_vm_v_free_count, &len);
+
+ len = 2; sysctlnametomib("vfs.bufspace", MIB_vfs_bufspace, &len);
+
+ len = sizeof(fpl->memZfsArc);
+ if (sysctlbyname("kstat.zfs.misc.arcstats.size", &fpl->memZfsArc, &len,
+ NULL, 0) == 0 && fpl->memZfsArc != 0) {
+ sysctlnametomib("kstat.zfs.misc.arcstats.size", MIB_kstat_zfs_misc_arcstats_size, &len);
+ fpl->zfsArcEnabled = 1;
+ } else {
+ fpl->zfsArcEnabled = 0;
+ }
+
+
+ int smp = 0;
+ len = sizeof(smp);
+
+ if (sysctlbyname("kern.smp.active", &smp, &len, NULL, 0) != 0 || len != sizeof(smp)) {
+ smp = 0;
+ }
+
+ int cpus = 1;
+ len = sizeof(cpus);
+
+ if (smp) {
+ int err = sysctlbyname("kern.smp.cpus", &cpus, &len, NULL, 0);
+ if (err) cpus = 1;
+ } else {
+ cpus = 1;
+ }
+
+ size_t sizeof_cp_time_array = sizeof(unsigned long) * CPUSTATES;
+ len = 2; sysctlnametomib("kern.cp_time", MIB_kern_cp_time, &len);
+ fpl->cp_time_o = xCalloc(cpus, sizeof_cp_time_array);
+ fpl->cp_time_n = xCalloc(cpus, sizeof_cp_time_array);
+ len = sizeof_cp_time_array;
+
+ // fetch intial single (or average) CPU clicks from kernel
+ sysctl(MIB_kern_cp_time, 2, fpl->cp_time_o, &len, NULL, 0);
+
+ // on smp box, fetch rest of intial CPU's clicks
+ if (cpus > 1) {
+ len = 2; sysctlnametomib("kern.cp_times", MIB_kern_cp_times, &len);
+ fpl->cp_times_o = xCalloc(cpus, sizeof_cp_time_array);
+ fpl->cp_times_n = xCalloc(cpus, sizeof_cp_time_array);
+ len = cpus * sizeof_cp_time_array;
+ sysctl(MIB_kern_cp_times, 2, fpl->cp_times_o, &len, NULL, 0);
+ }
+
+ pl->cpuCount = MAX(cpus, 1);
+
+ if (cpus == 1 ) {
+ fpl->cpus = xRealloc(fpl->cpus, sizeof(CPUData));
+ } else {
+ // on smp we need CPUs + 1 to store averages too (as kernel kindly provides that as well)
+ fpl->cpus = xRealloc(fpl->cpus, (pl->cpuCount + 1) * sizeof(CPUData));
+ }
+
+
+ len = sizeof(kernelFScale);
+ if (sysctlbyname("kern.fscale", &kernelFScale, &len, NULL, 0) == -1) {
+ //sane default for kernel provded CPU precentage scaling, at least on x86 machines, in case this sysctl call failed
+ kernelFScale = 2048;
+ }
+
+ fpl->kd = kvm_open(NULL, "/dev/null", NULL, 0, NULL);
+ assert(fpl->kd);
+
+ return pl;
+}
+
+void ProcessList_delete(ProcessList* this) {
+ const FreeBSDProcessList* fpl = (FreeBSDProcessList*) this;
+ if (fpl->kd) kvm_close(fpl->kd);
+
+ free(fpl->cp_time_o);
+ free(fpl->cp_time_n);
+ free(fpl->cp_times_o);
+ free(fpl->cp_times_n);
+ free(fpl->cpus);
+
+ ProcessList_done(this);
+ free(this);
+}
+
+static inline void FreeBSDProcessList_scanCPUTime(ProcessList* pl) {
+ const FreeBSDProcessList* fpl = (FreeBSDProcessList*) pl;
+
+ int cpus = pl->cpuCount; // actual CPU count
+ int maxcpu = cpus; // max iteration (in case we have average + smp)
+ int cp_times_offset;
+
+ assert(cpus > 0);
+
+ size_t sizeof_cp_time_array;
+
+ unsigned long *cp_time_n; // old clicks state
+ unsigned long *cp_time_o; // current clicks state
+
+ unsigned long long total_o = 0;
+ unsigned long long total_n = 0;
+ unsigned long long total_d = 0;
+ unsigned long cp_time_d[CPUSTATES];
+ double cp_time_p[CPUSTATES];
+
+ // get averages or single CPU clicks
+ sizeof_cp_time_array = sizeof(unsigned long) * CPUSTATES;
+ sysctl(MIB_kern_cp_time, 2, fpl->cp_time_n, &sizeof_cp_time_array, NULL, 0);
+
+ // get rest of CPUs
+ if (cpus > 1) {
+ // on smp systems FreeBSD kernel concats all CPU states into one long array in
+ // kern.cp_times sysctl OID
+ // we store averages in fpl->cpus[0], and actual cores after that
+ maxcpu = cpus + 1;
+ sizeof_cp_time_array = cpus * sizeof(unsigned long) * CPUSTATES;
+ sysctl(MIB_kern_cp_times, 2, fpl->cp_times_n, &sizeof_cp_time_array, NULL, 0);
+ }
+
+ for (int i = 0; i < maxcpu; i++) {
+ if (cpus == 1) {
+ // single CPU box
+ cp_time_n = fpl->cp_time_n;
+ cp_time_o = fpl->cp_time_o;
+ } else {
+ if (i == 0 ) {
+ // average
+ cp_time_n = fpl->cp_time_n;
+ cp_time_o = fpl->cp_time_o;
+ } else {
+ // specific smp cores
+ cp_times_offset = i - 1;
+ cp_time_n = fpl->cp_times_n + (cp_times_offset * CPUSTATES);
+ cp_time_o = fpl->cp_times_o + (cp_times_offset * CPUSTATES);
+ }
+ }
+
+ // diff old vs new
+ for (int s = 0; s < CPUSTATES; s++) {
+ cp_time_d[s] = cp_time_n[s] - cp_time_o[s];
+ total_o += cp_time_o[s];
+ total_n += cp_time_n[s];
+ }
+
+ // totals
+ total_d = total_n - total_o;
+ if (total_d < 1 ) total_d = 1;
+
+ // save current state as old and calc percentages
+ for (int s = 0; s < CPUSTATES; ++s) {
+ cp_time_o[s] = cp_time_n[s];
+ cp_time_p[s] = ((double)cp_time_d[s]) / ((double)total_d) * 100;
+ }
+
+ CPUData* cpuData = &(fpl->cpus[i]);
+ cpuData->userPercent = cp_time_p[CP_USER];
+ cpuData->nicePercent = cp_time_p[CP_NICE];
+ cpuData->systemPercent = cp_time_p[CP_SYS];
+ cpuData->irqPercent = cp_time_p[CP_INTR];
+ cpuData->systemAllPercent = cp_time_p[CP_SYS] + cp_time_p[CP_INTR];
+ // this one is not really used, but we store it anyway
+ cpuData->idlePercent = cp_time_p[CP_IDLE];
+ }
+}
+
+static inline void FreeBSDProcessList_scanMemoryInfo(ProcessList* pl) {
+ FreeBSDProcessList* fpl = (FreeBSDProcessList*) pl;
+
+ // @etosan:
+ // memory counter relationships seem to be these:
+ // total = active + wired + inactive + cache + free
+ // htop_used (unavail to anybody) = active + wired
+ // htop_cache (for cache meter) = buffers + cache
+ // user_free (avail to procs) = buffers + inactive + cache + free
+ //
+ // with ZFS ARC situation becomes bit muddled, as ARC behaves like "user_free"
+ // and belongs into cache, but is reported as wired by kernel
+ //
+ // htop_used = active + (wired - arc)
+ // htop_cache = buffers + cache + arc
+ size_t len = sizeof(pl->totalMem);
+
+ //disabled for now, as it is always smaller than phycal amount of memory...
+ //...to avoid "where is my memory?" questions
+ //sysctl(MIB_vm_stats_vm_v_page_count, 4, &(pl->totalMem), &len, NULL, 0);
+ //pl->totalMem *= pageSizeKb;
+ sysctl(MIB_hw_physmem, 2, &(pl->totalMem), &len, NULL, 0);
+ pl->totalMem /= 1024;
+
+ sysctl(MIB_vm_stats_vm_v_active_count, 4, &(fpl->memActive), &len, NULL, 0);
+ fpl->memActive *= pageSizeKb;
+
+ sysctl(MIB_vm_stats_vm_v_wire_count, 4, &(fpl->memWire), &len, NULL, 0);
+ fpl->memWire *= pageSizeKb;
+
+ sysctl(MIB_vfs_bufspace, 2, &(pl->buffersMem), &len, NULL, 0);
+ pl->buffersMem /= 1024;
+
+ sysctl(MIB_vm_stats_vm_v_cache_count, 4, &(pl->cachedMem), &len, NULL, 0);
+ pl->cachedMem *= pageSizeKb;
+
+ if (fpl->zfsArcEnabled) {
+ len = sizeof(fpl->memZfsArc);
+ sysctl(MIB_kstat_zfs_misc_arcstats_size, 5, &(fpl->memZfsArc), &len , NULL, 0);
+ fpl->memZfsArc /= 1024;
+ fpl->memWire -= fpl->memZfsArc;
+ pl->cachedMem += fpl->memZfsArc;
+ // maybe when we learn how to make custom memory meter
+ // we could do custom arc breakdown?
+ }
+
+ pl->usedMem = fpl->memActive + fpl->memWire;
+
+ //currently unused, same as with arc, custom meter perhaps
+ //sysctl(MIB_vm_stats_vm_v_inactive_count, 4, &(fpl->memInactive), &len, NULL, 0);
+ //sysctl(MIB_vm_stats_vm_v_free_count, 4, &(fpl->memFree), &len, NULL, 0);
+ //pl->freeMem = fpl->memInactive + fpl->memFree;
+ //pl->freeMem *= pageSizeKb;
+
+ struct kvm_swap swap[16];
+ int nswap = kvm_getswapinfo(fpl->kd, swap, sizeof(swap)/sizeof(swap[0]), 0);
+ pl->totalSwap = 0;
+ pl->usedSwap = 0;
+ for (int i = 0; i < nswap; i++) {
+ pl->totalSwap += swap[i].ksw_total;
+ pl->usedSwap += swap[i].ksw_used;
+ }
+ pl->totalSwap *= pageSizeKb;
+ pl->usedSwap *= pageSizeKb;
+
+ pl->sharedMem = 0; // currently unused
+}
+
+char* FreeBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kproc, int* basenameEnd) {
+ char** argv = kvm_getargv(kd, kproc, 0);
+ if (!argv) {
+ return xStrdup(kproc->ki_comm);
+ }
+ int len = 0;
+ for (int i = 0; argv[i]; i++) {
+ len += strlen(argv[i]) + 1;
+ }
+ char* comm = xMalloc(len);
+ char* at = comm;
+ *basenameEnd = 0;
+ for (int i = 0; argv[i]; i++) {
+ at = stpcpy(at, argv[i]);
+ if (!*basenameEnd) {
+ *basenameEnd = at - comm;
+ }
+ *at = ' ';
+ at++;
+ }
+ at--;
+ *at = '\0';
+ return comm;
+}
+
+char* FreeBSDProcessList_readJailName(struct kinfo_proc* kproc) {
+ int jid;
+ struct iovec jiov[6];
+ char* jname;
+ char jnamebuf[MAXHOSTNAMELEN];
+
+ if (kproc->ki_jid != 0 ){
+ memset(jnamebuf, 0, sizeof(jnamebuf));
+ *(const void **)&jiov[0].iov_base = "jid";
+ jiov[0].iov_len = sizeof("jid");
+ jiov[1].iov_base = &kproc->ki_jid;
+ jiov[1].iov_len = sizeof(kproc->ki_jid);
+ *(const void **)&jiov[2].iov_base = "name";
+ jiov[2].iov_len = sizeof("name");
+ jiov[3].iov_base = jnamebuf;
+ jiov[3].iov_len = sizeof(jnamebuf);
+ *(const void **)&jiov[4].iov_base = "errmsg";
+ jiov[4].iov_len = sizeof("errmsg");
+ jiov[5].iov_base = jail_errmsg;
+ jiov[5].iov_len = JAIL_ERRMSGLEN;
+ jail_errmsg[0] = 0;
+ jid = jail_get(jiov, 6, 0);
+ if (jid < 0) {
+ if (!jail_errmsg[0])
+ snprintf(jail_errmsg, JAIL_ERRMSGLEN, "jail_get: %s", strerror(errno));
+ return NULL;
+ } else if (jid == kproc->ki_jid) {
+ jname = xStrdup(jnamebuf);
+ if (jname == NULL)
+ strerror_r(errno, jail_errmsg, JAIL_ERRMSGLEN);
+ return jname;
+ } else {
+ return NULL;
+ }
+ } else {
+ jnamebuf[0]='-';
+ jnamebuf[1]='\0';
+ jname = xStrdup(jnamebuf);
+ }
+ return jname;
+}
+
+void ProcessList_goThroughEntries(ProcessList* this) {
+ FreeBSDProcessList* fpl = (FreeBSDProcessList*) this;
+ Settings* settings = this->settings;
+ bool hideKernelThreads = settings->hideKernelThreads;
+ bool hideUserlandThreads = settings->hideUserlandThreads;
+
+ FreeBSDProcessList_scanMemoryInfo(this);
+ FreeBSDProcessList_scanCPUTime(this);
+
+ int cpus = this->cpuCount;
+ int count = 0;
+ struct kinfo_proc* kprocs = kvm_getprocs(fpl->kd, KERN_PROC_ALL, 0, &count);
+
+ for (int i = 0; i < count; i++) {
+ struct kinfo_proc* kproc = &kprocs[i];
+ bool preExisting = false;
+ bool isIdleProcess = false;
+ Process* proc = ProcessList_getProcess(this, kproc->ki_pid, &preExisting, (Process_New) FreeBSDProcess_new);
+ FreeBSDProcess* fp = (FreeBSDProcess*) proc;
+
+ proc->show = ! ((hideKernelThreads && Process_isKernelThread(fp)) || (hideUserlandThreads && Process_isUserlandThread(proc)));
+
+ if (!preExisting) {
+ fp->jid = kproc->ki_jid;
+ proc->pid = kproc->ki_pid;
+ if ( ! ((kproc->ki_pid == 0) || (kproc->ki_pid == 1) ) && kproc->ki_flag & P_SYSTEM)
+ fp->kernel = 1;
+ else
+ fp->kernel = 0;
+ proc->ppid = kproc->ki_ppid;
+ proc->tpgid = kproc->ki_tpgid;
+ proc->tgid = kproc->ki_pid;
+ proc->session = kproc->ki_sid;
+ proc->tty_nr = kproc->ki_tdev;
+ proc->pgrp = kproc->ki_pgid;
+ proc->st_uid = kproc->ki_uid;
+ proc->starttime_ctime = kproc->ki_start.tv_sec;
+ proc->user = UsersTable_getRef(this->usersTable, proc->st_uid);
+ ProcessList_add((ProcessList*)this, proc);
+ proc->comm = FreeBSDProcessList_readProcessName(fpl->kd, kproc, &proc->basenameOffset);
+ fp->jname = FreeBSDProcessList_readJailName(kproc);
+ } else {
+ if(fp->jid != kproc->ki_jid) {
+ // proces can enter jail anytime
+ fp->jid = kproc->ki_jid;
+ free(fp->jname);
+ fp->jname = FreeBSDProcessList_readJailName(kproc);
+ }
+ if (proc->ppid != kproc->ki_ppid) {
+ // if there are reapers in the system, proces can get reparented anytime
+ proc->ppid = kproc->ki_ppid;
+ }
+ if(proc->st_uid != kproc->ki_uid) {
+ // some proceses change users (eg. to lower privs)
+ proc->st_uid = kproc->ki_uid;
+ proc->user = UsersTable_getRef(this->usersTable, proc->st_uid);
+ }
+ if (settings->updateProcessNames) {
+ free(proc->comm);
+ proc->comm = FreeBSDProcessList_readProcessName(fpl->kd, kproc, &proc->basenameOffset);
+ }
+ }
+
+ // from FreeBSD source /src/usr.bin/top/machine.c
+ proc->m_size = kproc->ki_size / 1024;
+ proc->m_resident = kproc->ki_rssize * pageSizeKb;
+ proc->nlwp = kproc->ki_numthreads;
+ proc->time = (kproc->ki_runtime + 5000) / 10000;
+
+ proc->percent_cpu = 100.0 * ((double)kproc->ki_pctcpu / (double)kernelFScale);
+ if (proc->percent_cpu > 0.1) {
+ // system idle process should own all CPU time left regardless of CPU count
+ if ( strcmp("idle", kproc->ki_comm) == 0 ) {
+ isIdleProcess = true;
+ } else {
+ if (cpus > 1)
+ proc->percent_cpu = proc->percent_cpu / (double) cpus;
+ }
+ }
+ if (isIdleProcess == false && proc->percent_cpu >= 99.8) {
+ // don't break formatting
+ proc->percent_cpu = 99.8;
+ }
+
+ proc->priority = kproc->ki_pri.pri_level - PZERO;
+
+ if (strcmp("intr", kproc->ki_comm) == 0 && kproc->ki_flag & P_SYSTEM) {
+ proc->nice = 0; //@etosan: intr kernel process (not thread) has weird nice value
+ } else if (kproc->ki_pri.pri_class == PRI_TIMESHARE) {
+ proc->nice = kproc->ki_nice - NZERO;
+ } else if (PRI_IS_REALTIME(kproc->ki_pri.pri_class)) {
+ proc->nice = PRIO_MIN - 1 - (PRI_MAX_REALTIME - kproc->ki_pri.pri_level);
+ } else {
+ proc->nice = PRIO_MAX + 1 + kproc->ki_pri.pri_level - PRI_MIN_IDLE;
+ }
+
+ switch (kproc->ki_stat) {
+ case SIDL: proc->state = 'I'; break;
+ case SRUN: proc->state = 'R'; break;
+ case SSLEEP: proc->state = 'S'; break;
+ case SSTOP: proc->state = 'T'; break;
+ case SZOMB: proc->state = 'Z'; break;
+ case SWAIT: proc->state = 'D'; break;
+ case SLOCK: proc->state = 'L'; break;
+ default: proc->state = '?';
+ }
+
+ if (Process_isKernelThread(fp)) {
+ this->kernelThreads++;
+ }
+
+ this->totalTasks++;
+ if (proc->state == 'R')
+ this->runningTasks++;
+ proc->updated = true;
+ }
+}
diff --git a/freebsd/FreeBSDProcessList.h b/freebsd/FreeBSDProcessList.h
new file mode 100644
index 0000000..2267379
--- /dev/null
+++ b/freebsd/FreeBSDProcessList.h
@@ -0,0 +1,69 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_FreeBSDProcessList
+#define HEADER_FreeBSDProcessList
+/*
+htop - FreeBSDProcessList.h
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+
+#include <kvm.h>
+#include <sys/param.h>
+#include <sys/jail.h>
+#include <sys/uio.h>
+#include <sys/resource.h>
+
+#define JAIL_ERRMSGLEN 1024
+char jail_errmsg[JAIL_ERRMSGLEN];
+
+typedef struct CPUData_ {
+
+ double userPercent;
+ double nicePercent;
+ double systemPercent;
+ double irqPercent;
+ double idlePercent;
+ double systemAllPercent;
+
+} CPUData;
+
+typedef struct FreeBSDProcessList_ {
+ ProcessList super;
+ kvm_t* kd;
+
+ int zfsArcEnabled;
+
+ unsigned long long int memWire;
+ unsigned long long int memActive;
+ unsigned long long int memInactive;
+ unsigned long long int memFree;
+ unsigned long long int memZfsArc;
+
+
+ CPUData* cpus;
+
+ unsigned long *cp_time_o;
+ unsigned long *cp_time_n;
+
+ unsigned long *cp_times_o;
+ unsigned long *cp_times_n;
+
+} FreeBSDProcessList;
+
+
+
+
+ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId);
+
+void ProcessList_delete(ProcessList* this);
+
+char* FreeBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kproc, int* basenameEnd);
+
+char* FreeBSDProcessList_readJailName(struct kinfo_proc* kproc);
+
+void ProcessList_goThroughEntries(ProcessList* this);
+
+#endif
diff --git a/freebsd/Platform.c b/freebsd/Platform.c
new file mode 100644
index 0000000..9e0c25b
--- /dev/null
+++ b/freebsd/Platform.c
@@ -0,0 +1,206 @@
+/*
+htop - freebsd/Platform.c
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Platform.h"
+#include "Meter.h"
+#include "CPUMeter.h"
+#include "MemoryMeter.h"
+#include "SwapMeter.h"
+#include "TasksMeter.h"
+#include "LoadAverageMeter.h"
+#include "UptimeMeter.h"
+#include "ClockMeter.h"
+#include "HostnameMeter.h"
+#include "FreeBSDProcess.h"
+#include "FreeBSDProcessList.h"
+
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <vm/vm_param.h>
+#include <time.h>
+
+/*{
+#include "Action.h"
+#include "BatteryMeter.h"
+#include "SignalsPanel.h"
+
+extern ProcessFieldData Process_fields[];
+
+}*/
+
+#ifndef CLAMP
+#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
+#endif
+
+ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 };
+
+int Platform_numberOfFields = LAST_PROCESSFIELD;
+
+SignalItem Platform_signals[] = {
+ { .name = " 0 Cancel", .number = 0 },
+ { .name = " 1 SIGHUP", .number = 1 },
+ { .name = " 2 SIGINT", .number = 2 },
+ { .name = " 3 SIGQUIT", .number = 3 },
+ { .name = " 4 SIGILL", .number = 4 },
+ { .name = " 5 SIGTRAP", .number = 5 },
+ { .name = " 6 SIGABRT", .number = 6 },
+ { .name = " 7 SIGEMT", .number = 7 },
+ { .name = " 8 SIGFPE", .number = 8 },
+ { .name = " 9 SIGKILL", .number = 9 },
+ { .name = "10 SIGBUS", .number = 10 },
+ { .name = "11 SIGSEGV", .number = 11 },
+ { .name = "12 SIGSYS", .number = 12 },
+ { .name = "13 SIGPIPE", .number = 13 },
+ { .name = "14 SIGALRM", .number = 14 },
+ { .name = "15 SIGTERM", .number = 15 },
+ { .name = "16 SIGURG", .number = 16 },
+ { .name = "17 SIGSTOP", .number = 17 },
+ { .name = "18 SIGTSTP", .number = 18 },
+ { .name = "19 SIGCONT", .number = 19 },
+ { .name = "20 SIGCHLD", .number = 20 },
+ { .name = "21 SIGTTIN", .number = 21 },
+ { .name = "22 SIGTTOU", .number = 22 },
+ { .name = "23 SIGIO", .number = 23 },
+ { .name = "24 SIGXCPU", .number = 24 },
+ { .name = "25 SIGXFSZ", .number = 25 },
+ { .name = "26 SIGVTALRM", .number = 26 },
+ { .name = "27 SIGPROF", .number = 27 },
+ { .name = "28 SIGWINCH", .number = 28 },
+ { .name = "29 SIGINFO", .number = 29 },
+ { .name = "30 SIGUSR1", .number = 30 },
+ { .name = "31 SIGUSR2", .number = 31 },
+ { .name = "32 SIGTHR", .number = 32 },
+ { .name = "33 SIGLIBRT", .number = 33 },
+};
+
+unsigned int Platform_numberOfSignals = sizeof(Platform_signals)/sizeof(SignalItem);
+
+void Platform_setBindings(Htop_Action* keys) {
+ (void) keys;
+}
+
+MeterClass* Platform_meterTypes[] = {
+ &CPUMeter_class,
+ &ClockMeter_class,
+ &LoadAverageMeter_class,
+ &LoadMeter_class,
+ &MemoryMeter_class,
+ &SwapMeter_class,
+ &TasksMeter_class,
+ &UptimeMeter_class,
+ &BatteryMeter_class,
+ &HostnameMeter_class,
+ &AllCPUsMeter_class,
+ &AllCPUs2Meter_class,
+ &LeftCPUsMeter_class,
+ &RightCPUsMeter_class,
+ &LeftCPUs2Meter_class,
+ &RightCPUs2Meter_class,
+ &BlankMeter_class,
+ NULL
+};
+
+int Platform_getUptime() {
+ struct timeval bootTime, currTime;
+ int mib[2] = { CTL_KERN, KERN_BOOTTIME };
+ size_t size = sizeof(bootTime);
+
+ int err = sysctl(mib, 2, &bootTime, &size, NULL, 0);
+ if (err) {
+ return -1;
+ }
+ gettimeofday(&currTime, NULL);
+
+ return (int) difftime(currTime.tv_sec, bootTime.tv_sec);
+}
+
+void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
+ struct loadavg loadAverage;
+ int mib[2] = { CTL_VM, VM_LOADAVG };
+ size_t size = sizeof(loadAverage);
+
+ int err = sysctl(mib, 2, &loadAverage, &size, NULL, 0);
+ if (err) {
+ *one = 0;
+ *five = 0;
+ *fifteen = 0;
+ return;
+ }
+ *one = (double) loadAverage.ldavg[0] / loadAverage.fscale;
+ *five = (double) loadAverage.ldavg[1] / loadAverage.fscale;
+ *fifteen = (double) loadAverage.ldavg[2] / loadAverage.fscale;
+}
+
+int Platform_getMaxPid() {
+ int maxPid;
+ size_t size = sizeof(maxPid);
+ int err = sysctlbyname("kern.pid_max", &maxPid, &size, NULL, 0);
+ if (err) {
+ return 99999;
+ }
+ return maxPid;
+}
+
+double Platform_setCPUValues(Meter* this, int cpu) {
+ FreeBSDProcessList* fpl = (FreeBSDProcessList*) this->pl;
+ int cpus = this->pl->cpuCount;
+ CPUData* cpuData;
+
+ if (cpus == 1) {
+ // single CPU box has everything in fpl->cpus[0]
+ cpuData = &(fpl->cpus[0]);
+ } else {
+ cpuData = &(fpl->cpus[cpu]);
+ }
+
+ double percent;
+ double* v = this->values;
+
+ v[CPU_METER_NICE] = cpuData->nicePercent;
+ v[CPU_METER_NORMAL] = cpuData->userPercent;
+ if (this->pl->settings->detailedCPUTime) {
+ v[CPU_METER_KERNEL] = cpuData->systemPercent;
+ v[CPU_METER_IRQ] = cpuData->irqPercent;
+ Meter_setItems(this, 4);
+ percent = v[0]+v[1]+v[2]+v[3];
+ } else {
+ v[2] = cpuData->systemAllPercent;
+ Meter_setItems(this, 3);
+ percent = v[0]+v[1]+v[2];
+ }
+
+ percent = CLAMP(percent, 0.0, 100.0);
+ if (isnan(percent)) percent = 0.0;
+ return percent;
+}
+
+void Platform_setMemoryValues(Meter* this) {
+ // TODO
+ ProcessList* pl = (ProcessList*) this->pl;
+
+ this->total = pl->totalMem;
+ this->values[0] = pl->usedMem;
+ this->values[1] = pl->buffersMem;
+ this->values[2] = pl->cachedMem;
+}
+
+void Platform_setSwapValues(Meter* this) {
+ ProcessList* pl = (ProcessList*) this->pl;
+ this->total = pl->totalSwap;
+ this->values[0] = pl->usedSwap;
+}
+
+void Platform_setTasksValues(Meter* this) {
+ // TODO
+}
+
+char* Platform_getProcessEnv(pid_t pid) {
+ // TODO
+ return NULL;
+}
diff --git a/freebsd/Platform.h b/freebsd/Platform.h
new file mode 100644
index 0000000..ecc0dcd
--- /dev/null
+++ b/freebsd/Platform.h
@@ -0,0 +1,51 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_Platform
+#define HEADER_Platform
+/*
+htop - freebsd/Platform.h
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Action.h"
+#include "BatteryMeter.h"
+#include "SignalsPanel.h"
+
+extern ProcessFieldData Process_fields[];
+
+
+#ifndef CLAMP
+#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
+#endif
+
+extern ProcessField Platform_defaultFields[];
+
+extern int Platform_numberOfFields;
+
+extern SignalItem Platform_signals[];
+
+extern unsigned int Platform_numberOfSignals;
+
+void Platform_setBindings(Htop_Action* keys);
+
+extern MeterClass* Platform_meterTypes[];
+
+int Platform_getUptime();
+
+void Platform_getLoadAverage(double* one, double* five, double* fifteen);
+
+int Platform_getMaxPid();
+
+double Platform_setCPUValues(Meter* this, int cpu);
+
+void Platform_setMemoryValues(Meter* this);
+
+void Platform_setSwapValues(Meter* this);
+
+void Platform_setTasksValues(Meter* this);
+
+char* Platform_getProcessEnv(pid_t pid);
+
+#endif
diff --git a/htop.1 b/htop.1
index 72fff27..da46bf6 100644
--- a/htop.1
+++ b/htop.1
@@ -1,4 +1,4 @@
-.TH "HTOP" "1" "2011" "htop 1.0.3" "Utils"
+.TH "HTOP" "1" "2015" "htop 2.0.0" "Utils"
.SH "NAME"
htop \- interactive process viewer
.SH "SYNOPSIS"
@@ -10,7 +10,8 @@ Htop is a free (GPL) ncurses-based process viewer for Linux.
.LP
It is similar to top, but allows you to scroll vertically and horizontally,
so you can see all the processes running on the system, along with their full
-command lines.
+command lines, as well as viewing them as a process tree, selecting mutiple
+processes and acting on them all at once.
.LP
Tasks related to processes (killing, renicing) can be done without
entering their PIDs.
@@ -150,6 +151,9 @@ Hide user threads: on systems that represent them differently than ordinary
processes (such as recent NPTL-based systems), this can hide threads from
userspace processes in the process list. (This is a toggle key.)
.TP
+.B p
+Show full paths to running programs, where applicable. (This is a toggle key.)
+.TP
.B Ctrl-L
Refresh: redraw screen and recalculate values.
.TP
@@ -167,11 +171,20 @@ shown in htop's main screen, it is shown below in parenthesis.
.LP
.TP 5
.B Command
-The full command line of the process (i.e program name and arguments).
+The full command line of the process (i.e. program name and arguments).
.TP
.B PID
The process ID.
.TP
+.B STATE (S)
+The state of the process:
+ \fBS\fR for sleeping (idle)
+ \fBR\fR for running
+ \fBD\fR for disk sleep (uninterruptible)
+ \fBZ\fR for zombie (waiting for parent to read its exit status)
+ \fBT\fR for traced or suspended (e.g by SIGTSTP)
+ \fBW\fR for paging
+.TP
.B PPID
The parent process ID.
.TP
@@ -187,47 +200,32 @@ The controlling terminal of the process.
.B TPGID
The process ID of the foreground process group of the controlling terminal.
.TP
-.B STATE (S)
-The state of the process:
- \fBS\fR for sleeping (idle)
- \fBR\fR for running
- \fBD\fR for disk sleep (uninterruptible)
- \fBZ\fR for zombie (waiting for parent to read its exit status)
- \fBT\fR for traced or suspended (e.g by SIGTSTP)
- \fBW\fR for paging
+.B MINFLT
+The number of page faults happening in the main memory.
.TP
-.B PROCESSOR (CPU)
-The ID of the CPU the process last executed on.
+.B CMINFLT
+The number of minor faults for the process's waited-for children (see MINFLT above).
.TP
-.B NLWP
-The number of threads in the process.
+.B MAJFLT
+The number of page faults happening out of the main memory.
.TP
-.B NICE (NI)
-The nice value of a process, from 19 (low priority) to -20 (high priority). A
-high value means the process is being nice, letting others have a higher
-relative priority. Only root can lower the value.
-.TP
-.B PERCENT_CPU (CPU%)
-The percentage of the CPU time that the process is currently using.
+.B CMAJFLT
+The number of major faults for the process's waited-for children (see MAJFLT above).
.TP
.B UTIME (UTIME+)
The user CPU time, which is the amount of time the process has spent executing
-on the CPU in user mode (i.e everything but system calls), measured in clock
+on the CPU in user mode (i.e. everything but system calls), measured in clock
ticks.
.TP
.B STIME (STIME+)
The system CPU time, which is the amount of time the kernel has spent
executing system calls on behalf of the process, measured in clock ticks.
.TP
-.B TIME (TIME+)
-The time, measured in clock ticks that the process has spent in user and system
-time (see UTIME, STIME above).
-.TP
-.B CUTIME
+.B CUTIME (CUTIME+)
The children's user CPU time, which is the amount of time the process's
waited-for children have spent executing in user mode (see UTIME above).
.TP
-.B CSTIME
+.B CSTIME (CSTIME+)
The children's system CPU time, which is the amount of time the kernel has spent
executing system calls on behalf of all the process's waited-for children (see
STIME above).
@@ -236,42 +234,73 @@ STIME above).
The kernel's internal priority for the process, usually just its nice value
plus twenty. Different for real-time processes.
.TP
-.B PERCENT_MEM
-The percentage of memory the process is currently using (based on the process's
-resident memory size, see M_RESIDENT below).
+.B NICE (NI)
+The nice value of a process, from 19 (low priority) to -20 (high priority). A
+high value means the process is being nice, letting others have a higher
+relative priority. The usual OS permission restrictions for adjusting priority apply.
+.TP
+.B STARTTIME (START)
+The time the process was started.
+.TP
+.B PROCESSOR (CPU)
+The ID of the CPU the process last executed on.
.TP
.B M_SIZE (VIRT)
-Size in memory of the total program size.
+The size of the virtual memory of the process.
.TP
.B M_RESIDENT (RES)
-The resident set size, i.e the size of the text and data sections, plus stack
-usage.
+The resident set size (text + data + stack) of the process (i.e. the size of the
+process's used physical memory).
.TP
.B M_SHARE (SHR)
-The size of the process's shared pages
+The size of the process's shared pages.
.TP
.B M_TRS (CODE)
-The size of the text segment of the process (i.e the size of the processes
+The text resident set size of the process (i.e. the size of the process's
executable instructions).
.TP
+.B M_DRS (DATA)
+The data resident set size (data + stack) of the process (i.e. the size of anything
+except the process's executable instructions).
+.TP
.B M_LRS (LIB)
The library size of the process.
.TP
-.B M_DRS (DATA)
-The size of the data segment plus stack usage of the process.
-.TP
.B M_DT (DIRTY)
The size of the dirty pages of the process.
.TP
.B ST_UID (UID)
The user ID of the process owner.
.TP
+.B PERCENT_CPU (CPU%)
+The percentage of the CPU time that the process is currently using.
+.TP
+.B PERCENT_MEM (MEM%)
+The percentage of memory the process is currently using (based on the process's
+resident memory size, see M_RESIDENT above).
+.TP
.B USER
The username of the process owner, or the user ID if the name can't be
determined.
.TP
-.B STARTTIME
-The time the process was started.
+.B TIME (TIME+)
+The time, measured in clock ticks that the process has spent in user and system
+time (see UTIME, STIME above).
+.TP
+.B NLWP
+The number of threads in the process.
+.TP
+.B TGID
+The thread group ID.
+.TP
+.B CTID
+OpenVZ container ID, a.k.a virtual environment ID.
+.TP
+.B VPID
+OpenVZ process ID.
+.TP
+.B VXID
+VServer process ID.
.TP
.B RCHAR (RD_CHAR)
The number of bytes the process has read.
@@ -291,38 +320,57 @@ Bytes of read(2) I/O for the process.
.B WBYTES (IO_WBYTES)
Bytes of write(2) I/O for the process.
.TP
-.B IO_READ_RATE (IORR)
+.B CNCLWB (IO_CANCEL)
+Bytes of cancelled write(2) I/O.
+.TP
+.B IO_READ_RATE (DISK READ)
The I/O rate of read(2) in bytes per second, for the process.
.TP
-.B IO_WRITE_RATE (IOWR)
+.B IO_WRITE_RATE (DISK WRITE)
The I/O rate of write(2) in bytes per second, for the process.
.TP
-.B IO_RATE (IO)
+.B IO_RATE (DISK R/W)
The I/O rate, IO_READ_RATE + IO_WRITE_RATE (see above).
.TP
-.B CNCLWB (IO_CANCEL)
-Bytes of cancelled write(2) I/O.
-.TP
.B CGROUP
Which cgroup the process is in.
.TP
-.B CTID
-OpenVZ container ID, a.k.a virtual environment ID.
-.TP
-.B VPID
-OpenVZ process ID.
-.TP
-.B VXID
-VServer process ID.
-.TP
.B OOM
OOM killer score.
.TP
+.B IO_PRIORITY (IO)
+The I/O scheduling class followed by the priority if the class supports it:
+ \fBR\fR for Realtime
+ \fBB\fR for Best-effort
+ \fBid\fR for Idle
+.TP
.B All other flags
Currently unsupported (always displays '-').
+.SH "CONFIG FILE"
+.LP
+By default htop reads its configuration from the XDG-compliant path
+~/.config/htop/htoprc -- the configuration file is overwritten by htop's
+in-program Setup configuration, so it should not be hand-edited. If no
+user configuration exists htop tries to read the system-wide configuration
+from ${prefix}/etc/htoprc and as a last resort, falls back to its
+hard coded defaults.
+.LP
+You may override the location of the configuration file using the $HTOPRC
+environment variable (so you can have multiple configurations for different
+machines that share the same home directory, for example).
+
+.SH "MEMORY SIZES"
+.LP
+Memory sizes in htop are displayed as they are in tools from the GNU Coreutils
+(when ran with the --human-readable option). This means that sizes are printed
+in powers of 1024. (e.g., 1023M = 1072693248 Bytes)
+.LP
+The decision to use this convention was made in order to conserve screen space
+and make memory size representations consistent throughout htop.
+
.SH "SEE ALSO"
-proc(5), top(1), free(1), ps(1), uptime(1)
+proc(5), top(1), free(1), ps(1), uptime(1), limits.conf(5)
.SH "AUTHORS"
.LP
diff --git a/htop.1.in b/htop.1.in
index a0e2a26..1fa88ef 100644
--- a/htop.1.in
+++ b/htop.1.in
@@ -1,4 +1,4 @@
-.TH "HTOP" "1" "2011" "@PACKAGE_STRING@" "Utils"
+.TH "HTOP" "1" "2015" "@PACKAGE_STRING@" "Utils"
.SH "NAME"
htop \- interactive process viewer
.SH "SYNOPSIS"
@@ -10,7 +10,8 @@ Htop is a free (GPL) ncurses-based process viewer for Linux.
.LP
It is similar to top, but allows you to scroll vertically and horizontally,
so you can see all the processes running on the system, along with their full
-command lines.
+command lines, as well as viewing them as a process tree, selecting mutiple
+processes and acting on them all at once.
.LP
Tasks related to processes (killing, renicing) can be done without
entering their PIDs.
@@ -150,6 +151,9 @@ Hide user threads: on systems that represent them differently than ordinary
processes (such as recent NPTL-based systems), this can hide threads from
userspace processes in the process list. (This is a toggle key.)
.TP
+.B p
+Show full paths to running programs, where applicable. (This is a toggle key.)
+.TP
.B Ctrl-L
Refresh: redraw screen and recalculate values.
.TP
@@ -167,11 +171,20 @@ shown in htop's main screen, it is shown below in parenthesis.
.LP
.TP 5
.B Command
-The full command line of the process (i.e program name and arguments).
+The full command line of the process (i.e. program name and arguments).
.TP
.B PID
The process ID.
.TP
+.B STATE (S)
+The state of the process:
+ \fBS\fR for sleeping (idle)
+ \fBR\fR for running
+ \fBD\fR for disk sleep (uninterruptible)
+ \fBZ\fR for zombie (waiting for parent to read its exit status)
+ \fBT\fR for traced or suspended (e.g by SIGTSTP)
+ \fBW\fR for paging
+.TP
.B PPID
The parent process ID.
.TP
@@ -187,47 +200,32 @@ The controlling terminal of the process.
.B TPGID
The process ID of the foreground process group of the controlling terminal.
.TP
-.B STATE (S)
-The state of the process:
- \fBS\fR for sleeping (idle)
- \fBR\fR for running
- \fBD\fR for disk sleep (uninterruptible)
- \fBZ\fR for zombie (waiting for parent to read its exit status)
- \fBT\fR for traced or suspended (e.g by SIGTSTP)
- \fBW\fR for paging
+.B MINFLT
+The number of page faults happening in the main memory.
.TP
-.B PROCESSOR (CPU)
-The ID of the CPU the process last executed on.
+.B CMINFLT
+The number of minor faults for the process's waited-for children (see MINFLT above).
.TP
-.B NLWP
-The number of threads in the process.
+.B MAJFLT
+The number of page faults happening out of the main memory.
.TP
-.B NICE (NI)
-The nice value of a process, from 19 (low priority) to -20 (high priority). A
-high value means the process is being nice, letting others have a higher
-relative priority. Only root can lower the value.
-.TP
-.B PERCENT_CPU (CPU%)
-The percentage of the CPU time that the process is currently using.
+.B CMAJFLT
+The number of major faults for the process's waited-for children (see MAJFLT above).
.TP
.B UTIME (UTIME+)
The user CPU time, which is the amount of time the process has spent executing
-on the CPU in user mode (i.e everything but system calls), measured in clock
+on the CPU in user mode (i.e. everything but system calls), measured in clock
ticks.
.TP
.B STIME (STIME+)
The system CPU time, which is the amount of time the kernel has spent
executing system calls on behalf of the process, measured in clock ticks.
.TP
-.B TIME (TIME+)
-The time, measured in clock ticks that the process has spent in user and system
-time (see UTIME, STIME above).
-.TP
-.B CUTIME
+.B CUTIME (CUTIME+)
The children's user CPU time, which is the amount of time the process's
waited-for children have spent executing in user mode (see UTIME above).
.TP
-.B CSTIME
+.B CSTIME (CSTIME+)
The children's system CPU time, which is the amount of time the kernel has spent
executing system calls on behalf of all the process's waited-for children (see
STIME above).
@@ -236,42 +234,73 @@ STIME above).
The kernel's internal priority for the process, usually just its nice value
plus twenty. Different for real-time processes.
.TP
-.B PERCENT_MEM
-The percentage of memory the process is currently using (based on the process's
-resident memory size, see M_RESIDENT below).
+.B NICE (NI)
+The nice value of a process, from 19 (low priority) to -20 (high priority). A
+high value means the process is being nice, letting others have a higher
+relative priority. The usual OS permission restrictions for adjusting priority apply.
+.TP
+.B STARTTIME (START)
+The time the process was started.
+.TP
+.B PROCESSOR (CPU)
+The ID of the CPU the process last executed on.
.TP
.B M_SIZE (VIRT)
-Size in memory of the total program size.
+The size of the virtual memory of the process.
.TP
.B M_RESIDENT (RES)
-The resident set size, i.e the size of the text and data sections, plus stack
-usage.
+The resident set size (text + data + stack) of the process (i.e. the size of the
+process's used physical memory).
.TP
.B M_SHARE (SHR)
-The size of the process's shared pages
+The size of the process's shared pages.
.TP
.B M_TRS (CODE)
-The size of the text segment of the process (i.e the size of the processes
+The text resident set size of the process (i.e. the size of the process's
executable instructions).
.TP
+.B M_DRS (DATA)
+The data resident set size (data + stack) of the process (i.e. the size of anything
+except the process's executable instructions).
+.TP
.B M_LRS (LIB)
The library size of the process.
.TP
-.B M_DRS (DATA)
-The size of the data segment plus stack usage of the process.
-.TP
.B M_DT (DIRTY)
The size of the dirty pages of the process.
.TP
.B ST_UID (UID)
The user ID of the process owner.
.TP
+.B PERCENT_CPU (CPU%)
+The percentage of the CPU time that the process is currently using.
+.TP
+.B PERCENT_MEM (MEM%)
+The percentage of memory the process is currently using (based on the process's
+resident memory size, see M_RESIDENT above).
+.TP
.B USER
The username of the process owner, or the user ID if the name can't be
determined.
.TP
-.B STARTTIME
-The time the process was started.
+.B TIME (TIME+)
+The time, measured in clock ticks that the process has spent in user and system
+time (see UTIME, STIME above).
+.TP
+.B NLWP
+The number of threads in the process.
+.TP
+.B TGID
+The thread group ID.
+.TP
+.B CTID
+OpenVZ container ID, a.k.a virtual environment ID.
+.TP
+.B VPID
+OpenVZ process ID.
+.TP
+.B VXID
+VServer process ID.
.TP
.B RCHAR (RD_CHAR)
The number of bytes the process has read.
@@ -291,38 +320,57 @@ Bytes of read(2) I/O for the process.
.B WBYTES (IO_WBYTES)
Bytes of write(2) I/O for the process.
.TP
-.B IO_READ_RATE (IORR)
+.B CNCLWB (IO_CANCEL)
+Bytes of cancelled write(2) I/O.
+.TP
+.B IO_READ_RATE (DISK READ)
The I/O rate of read(2) in bytes per second, for the process.
.TP
-.B IO_WRITE_RATE (IOWR)
+.B IO_WRITE_RATE (DISK WRITE)
The I/O rate of write(2) in bytes per second, for the process.
.TP
-.B IO_RATE (IO)
+.B IO_RATE (DISK R/W)
The I/O rate, IO_READ_RATE + IO_WRITE_RATE (see above).
.TP
-.B CNCLWB (IO_CANCEL)
-Bytes of cancelled write(2) I/O.
-.TP
.B CGROUP
Which cgroup the process is in.
.TP
-.B CTID
-OpenVZ container ID, a.k.a virtual environment ID.
-.TP
-.B VPID
-OpenVZ process ID.
-.TP
-.B VXID
-VServer process ID.
-.TP
.B OOM
OOM killer score.
.TP
+.B IO_PRIORITY (IO)
+The I/O scheduling class followed by the priority if the class supports it:
+ \fBR\fR for Realtime
+ \fBB\fR for Best-effort
+ \fBid\fR for Idle
+.TP
.B All other flags
Currently unsupported (always displays '-').
+.SH "CONFIG FILE"
+.LP
+By default htop reads its configuration from the XDG-compliant path
+~/.config/htop/htoprc -- the configuration file is overwritten by htop's
+in-program Setup configuration, so it should not be hand-edited. If no
+user configuration exists htop tries to read the system-wide configuration
+from @sysconfdir@/htoprc and as a last resort, falls back to its
+hard coded defaults.
+.LP
+You may override the location of the configuration file using the $HTOPRC
+environment variable (so you can have multiple configurations for different
+machines that share the same home directory, for example).
+
+.SH "MEMORY SIZES"
+.LP
+Memory sizes in htop are displayed as they are in tools from the GNU Coreutils
+(when ran with the --human-readable option). This means that sizes are printed
+in powers of 1024. (e.g., 1023M = 1072693248 Bytes)
+.LP
+The decision to use this convention was made in order to conserve screen space
+and make memory size representations consistent throughout htop.
+
.SH "SEE ALSO"
-proc(5), top(1), free(1), ps(1), uptime(1)
+proc(5), top(1), free(1), ps(1), uptime(1), limits.conf(5)
.SH "AUTHORS"
.LP
diff --git a/htop.c b/htop.c
index b343809..9e82a12 100644
--- a/htop.c
+++ b/htop.c
@@ -5,51 +5,35 @@ Released under the GNU GPL, see the COPYING file
in the source distribution for its full text.
*/
-#include "ProcessList.h"
+#include "config.h"
-#include "CRT.h"
-#include "Panel.h"
-#include "UsersTable.h"
-#include "RichString.h"
-#include "Settings.h"
-#include "ScreenManager.h"
#include "FunctionBar.h"
-#include "ListItem.h"
-#include "String.h"
+#include "Hashtable.h"
#include "ColumnsPanel.h"
-#include "CategoriesPanel.h"
-#include "SignalsPanel.h"
-#include "TraceScreen.h"
-#include "OpenFilesScreen.h"
-#include "AffinityPanel.h"
-#include "IOPriorityPanel.h"
-#include "IncSet.h"
+#include "CRT.h"
+#include "MainPanel.h"
+#include "ProcessList.h"
+#include "ScreenManager.h"
+#include "Settings.h"
+#include "UsersTable.h"
+#include "Platform.h"
-#include <unistd.h>
-#include <math.h>
-#include <ctype.h>
-#include <stdbool.h>
-#include <stdlib.h>
-#include <locale.h>
#include <getopt.h>
-#include <pwd.h>
+#include <locale.h>
+#include <stdio.h>
+#include <stdlib.h>
#include <string.h>
-#include <sys/param.h>
-#include <sys/time.h>
#include <time.h>
+#include <unistd.h>
//#link m
-#define COPYRIGHT "(C) 2004-2012 Hisham Muhammad"
-
static void printVersionFlag() {
fputs("htop " VERSION " - " COPYRIGHT "\n"
"Released under the GNU GPL.\n\n",
stdout);
exit(0);
}
-
-static const char* defaultFunctions[] = {"Help ", "Setup ", "Search", "Filter", "Tree ", "SortBy", "Nice -", "Nice +", "Kill ", "Quit ", NULL};
static void printHelpFlag() {
fputs("htop " VERSION " - " COPYRIGHT "\n"
@@ -60,7 +44,7 @@ static void printHelpFlag() {
"-s --sort-key=COLUMN Sort by COLUMN (try --sort-key=help for a list)\n"
"-u --user=USERNAME Show only processes of a given user\n"
"-p --pid=PID,[,PID,PID...] Show only the given PIDs\n"
- "-v --version Print version info\n"
+ "-v --version Print version info\n"
"\n"
"Long options may be passed with a single dash.\n\n"
"Press F1 inside htop for online help.\n"
@@ -69,298 +53,26 @@ static void printHelpFlag() {
exit(0);
}
-static struct { const char* key; const char* info; } helpLeft[] = {
- { .key = " Arrows: ", .info = "scroll process list" },
- { .key = " Digits: ", .info = "incremental PID search" },
- { .key = " F3 /: ", .info = "incremental name search" },
- { .key = " F4 \\: ",.info = "incremental name filtering" },
- { .key = " F5 t: ", .info = "tree view" },
- { .key = " u: ", .info = "show processes of a single user" },
- { .key = " H: ", .info = "hide/show user threads" },
- { .key = " K: ", .info = "hide/show kernel threads" },
- { .key = " F: ", .info = "cursor follows process" },
- { .key = " F6 + -: ", .info = "expand/collapse tree" },
- { .key = " P M T: ", .info = "sort by CPU%, MEM% or TIME" },
- { .key = " I: ", .info = "invert sort order" },
- { .key = " F6 >: ", .info = "select sort column" },
- { .key = NULL, .info = NULL }
-};
-
-static struct { const char* key; const char* info; } helpRight[] = {
- { .key = " Space: ", .info = "tag process" },
- { .key = " c: ", .info = "tag process and its children" },
- { .key = " U: ", .info = "untag all processes" },
- { .key = " F9 k: ", .info = "kill process/tagged processes" },
- { .key = " F7 ]: ", .info = "higher priority (root only)" },
- { .key = " F8 [: ", .info = "lower priority (+ nice)" },
-#if (HAVE_LIBHWLOC || HAVE_NATIVE_AFFINITY)
- { .key = " a: ", .info = "set CPU affinity" },
-#endif
- { .key = " i: ", .info = "set IO prority" },
- { .key = " l: ", .info = "list open files with lsof" },
- { .key = " s: ", .info = "trace syscalls with strace" },
- { .key = " ", .info = "" },
- { .key = " F2 S: ", .info = "setup" },
- { .key = " F1 h: ", .info = "show this help screen" },
- { .key = " F10 q: ", .info = "quit" },
- { .key = NULL, .info = NULL }
-};
-
-static void showHelp(ProcessList* pl) {
- clear();
- attrset(CRT_colors[HELP_BOLD]);
-
- for (int i = 0; i < LINES-1; i++)
- mvhline(i, 0, ' ', COLS);
-
- mvaddstr(0, 0, "htop " VERSION " - " COPYRIGHT);
- mvaddstr(1, 0, "Released under the GNU GPL. See 'man' page for more info.");
-
- attrset(CRT_colors[DEFAULT_COLOR]);
- mvaddstr(3, 0, "CPU usage bar: ");
- #define addattrstr(a,s) attrset(a);addstr(s)
- addattrstr(CRT_colors[BAR_BORDER], "[");
- if (pl->detailedCPUTime) {
- addattrstr(CRT_colors[CPU_NICE_TEXT], "low"); addstr("/");
- addattrstr(CRT_colors[CPU_NORMAL], "normal"); addstr("/");
- addattrstr(CRT_colors[CPU_KERNEL], "kernel"); addstr("/");
- addattrstr(CRT_colors[CPU_IRQ], "irq"); addstr("/");
- addattrstr(CRT_colors[CPU_SOFTIRQ], "soft-irq"); addstr("/");
- addattrstr(CRT_colors[CPU_STEAL], "steal"); addstr("/");
- addattrstr(CRT_colors[CPU_GUEST], "guest"); addstr("/");
- addattrstr(CRT_colors[CPU_IOWAIT], "io-wait");
- addattrstr(CRT_colors[BAR_SHADOW], " used%");
- } else {
- addattrstr(CRT_colors[CPU_NICE_TEXT], "low-priority"); addstr("/");
- addattrstr(CRT_colors[CPU_NORMAL], "normal"); addstr("/");
- addattrstr(CRT_colors[CPU_KERNEL], "kernel"); addstr("/");
- addattrstr(CRT_colors[CPU_STEAL], "virtualiz");
- addattrstr(CRT_colors[BAR_SHADOW], " used%");
- }
- addattrstr(CRT_colors[BAR_BORDER], "]");
- attrset(CRT_colors[DEFAULT_COLOR]);
- mvaddstr(4, 0, "Memory bar: ");
- addattrstr(CRT_colors[BAR_BORDER], "[");
- addattrstr(CRT_colors[MEMORY_USED], "used"); addstr("/");
- addattrstr(CRT_colors[MEMORY_BUFFERS_TEXT], "buffers"); addstr("/");
- addattrstr(CRT_colors[MEMORY_CACHE], "cache");
- addattrstr(CRT_colors[BAR_SHADOW], " used/total");
- addattrstr(CRT_colors[BAR_BORDER], "]");
- attrset(CRT_colors[DEFAULT_COLOR]);
- mvaddstr(5, 0, "Swap bar: ");
- addattrstr(CRT_colors[BAR_BORDER], "[");
- addattrstr(CRT_colors[SWAP], "used");
- addattrstr(CRT_colors[BAR_SHADOW], " used/total");
- addattrstr(CRT_colors[BAR_BORDER], "]");
- attrset(CRT_colors[DEFAULT_COLOR]);
- mvaddstr(6,0, "Type and layout of header meters are configurable in the setup screen.");
- if (CRT_colorScheme == COLORSCHEME_MONOCHROME) {
- mvaddstr(7, 0, "In monochrome, meters are displayed through different chars, in order: |#*@$%&");
- }
- mvaddstr( 8, 0, " Status: R: running; S: sleeping; T: traced/stopped; Z: zombie; D: disk sleep");
- for (int i = 0; helpLeft[i].info; i++) { mvaddstr(9+i, 9, helpLeft[i].info); }
- for (int i = 0; helpRight[i].info; i++) { mvaddstr(9+i, 49, helpRight[i].info); }
- attrset(CRT_colors[HELP_BOLD]);
- for (int i = 0; helpLeft[i].key; i++) { mvaddstr(9+i, 0, helpLeft[i].key); }
- for (int i = 0; helpRight[i].key; i++) { mvaddstr(9+i, 40, helpRight[i].key); }
-
- attrset(CRT_colors[HELP_BOLD]);
- mvaddstr(23,0, "Press any key to return.");
- attrset(CRT_colors[DEFAULT_COLOR]);
- refresh();
- CRT_readKey();
- clear();
-}
-
-static const char* CategoriesFunctions[] = {" ", " ", " ", " ", " ", " ", " ", " ", " ", "Done ", NULL};
-
-static void Setup_run(Settings* settings, const Header* header) {
- ScreenManager* scr = ScreenManager_new(0, header->height, 0, -1, HORIZONTAL, header, true);
- CategoriesPanel* panelCategories = CategoriesPanel_new(settings, scr);
- ScreenManager_add(scr, (Panel*) panelCategories, FunctionBar_new(CategoriesFunctions, NULL, NULL), 16);
- CategoriesPanel_makeMetersPage(panelCategories);
- Panel* panelFocus;
- int ch;
- ScreenManager_run(scr, &panelFocus, &ch);
- ScreenManager_delete(scr);
-}
-
-typedef bool(*ForeachProcessFn)(Process*, size_t);
-
-static bool foreachProcess(Panel* panel, ForeachProcessFn fn, int arg, bool* wasAnyTagged) {
- bool ok = true;
- bool anyTagged = false;
- for (int i = 0; i < Panel_size(panel); i++) {
- Process* p = (Process*) Panel_get(panel, i);
- if (p->tag) {
- ok = fn(p, arg) && ok;
- anyTagged = true;
- }
- }
- if (!anyTagged) {
- Process* p = (Process*) Panel_getSelected(panel);
- if (p) ok = fn(p, arg) && ok;
- }
- if (wasAnyTagged)
- *wasAnyTagged = anyTagged;
- return ok;
-}
-
-static bool changePriority(Panel* panel, int delta) {
- bool anyTagged;
- bool ok = foreachProcess(panel, (ForeachProcessFn) Process_changePriorityBy, delta, &anyTagged);
- if (!ok)
- beep();
- return anyTagged;
-}
-
-static int selectedPid(Panel* panel) {
- Process* p = (Process*) Panel_getSelected(panel);
- if (p) {
- return p->pid;
- }
- return -1;
-}
-
-static Object* pickFromVector(Panel* panel, Panel* list, int x, int y, const char** keyLabels, FunctionBar* prevBar, Header* header) {
- const char* fuKeys[] = {"Enter", "Esc", NULL};
- int fuEvents[] = {13, 27};
- ScreenManager* scr = ScreenManager_new(0, y, 0, -1, HORIZONTAL, header, false);
- scr->allowFocusChange = false;
- ScreenManager_add(scr, list, FunctionBar_new(keyLabels, fuKeys, fuEvents), x - 1);
- ScreenManager_add(scr, panel, NULL, -1);
- Panel* panelFocus;
- int ch;
- bool unfollow = false;
- int pid = selectedPid(panel);
- if (header->pl->following == -1) {
- header->pl->following = pid;
- unfollow = true;
- }
- ScreenManager_run(scr, &panelFocus, &ch);
- if (unfollow) {
- header->pl->following = -1;
- }
- ScreenManager_delete(scr);
- Panel_move(panel, 0, y);
- Panel_resize(panel, COLS, LINES-y-1);
- FunctionBar_draw(prevBar, NULL);
- if (panelFocus == list && ch == 13) {
- Process* selected = (Process*)Panel_getSelected(panel);
- if (selected && selected->pid == pid)
- return Panel_getSelected(list);
- else
- beep();
- }
- return NULL;
-}
-
-static void addUserToVector(int key, void* userCast, void* panelCast) {
- char* user = (char*) userCast;
- Panel* panel = (Panel*) panelCast;
- Panel_add(panel, (Object*) ListItem_new(user, key));
-}
-
-static bool setUserOnly(const char* userName, bool* userOnly, uid_t* userId) {
- struct passwd* user = getpwnam(userName);
- if (user) {
- *userOnly = true;
- *userId = user->pw_uid;
- return true;
- }
- return false;
-}
-
-static void setTreeView(ProcessList* pl, FunctionBar* fuBar, bool mode) {
- if (mode) {
- FunctionBar_setLabel(fuBar, KEY_F(5), "Sorted");
- FunctionBar_setLabel(fuBar, KEY_F(6), "Collap");
- } else {
- FunctionBar_setLabel(fuBar, KEY_F(5), "Tree ");
- FunctionBar_setLabel(fuBar, KEY_F(6), "SortBy");
- }
- if (mode != pl->treeView) {
- FunctionBar_draw(fuBar, NULL);
- }
- pl->treeView = mode;
-}
+// ----------------------------------------
-static inline void setSortKey(ProcessList* pl, FunctionBar* fuBar, ProcessField sortKey, Panel* panel, Settings* settings) {
- pl->sortKey = sortKey;
- pl->direction = 1;
- setTreeView(pl, fuBar, false);
- settings->changed = true;
- ProcessList_printHeader(pl, Panel_getHeader(panel));
-}
+typedef struct CommandLineSettings_ {
+ Hashtable* pidWhiteList;
+ uid_t userId;
+ int sortKey;
+ int delay;
+ bool useColors;
+} CommandLineSettings;
-static const char* getMainPanelValue(Panel* panel, int i) {
- Process* p = (Process*) Panel_get(panel, i);
- if (p)
- return p->comm;
- return "";
-}
+static CommandLineSettings parseArguments(int argc, char** argv) {
-static void tagAllChildren(Panel* panel, Process* parent) {
- parent->tag = true;
- pid_t ppid = parent->pid;
- for (int i = 0; i < Panel_size(panel); i++) {
- Process* p = (Process*) Panel_get(panel, i);
- if (!p->tag && p->ppid == ppid) {
- tagAllChildren(panel, p);
- }
- }
-}
-
-static bool expandCollapse(Panel* panel) {
- Process* p = (Process*) Panel_getSelected(panel);
- if (!p) return false;
- p->showChildren = !p->showChildren;
- return true;
-}
-
-void sortBy(Panel* panel, ProcessList* pl, Settings* settings, int headerHeight, FunctionBar* defaultBar, Header* header) {
- Panel* sortPanel = Panel_new(0, 0, 0, 0, true, Class(ListItem));
- Panel_setHeader(sortPanel, "Sort by");
- const char* fuFunctions[] = {"Sort ", "Cancel ", NULL};
- ProcessField* fields = pl->fields;
- for (int i = 0; fields[i]; i++) {
- char* name = String_trim(Process_fieldNames[fields[i]]);
- Panel_add(sortPanel, (Object*) ListItem_new(name, fields[i]));
- if (fields[i] == pl->sortKey)
- Panel_setSelected(sortPanel, i);
- free(name);
- }
- ListItem* field = (ListItem*) pickFromVector(panel, sortPanel, 15, headerHeight, fuFunctions, defaultBar, header);
- if (field) {
- settings->changed = true;
- setSortKey(pl, defaultBar, field->key, panel, settings);
- } else {
- ProcessList_printHeader(pl, Panel_getHeader(panel));
- }
- Object_delete(sortPanel);
-}
-
-static void millisleep(unsigned long millisec) {
- struct timespec req = {
- .tv_sec = 0,
- .tv_nsec = millisec * 1000000L
+ CommandLineSettings flags = {
+ .pidWhiteList = NULL,
+ .userId = -1, // -1 is guaranteed to be an invalid uid_t (see setreuid(2))
+ .sortKey = 0,
+ .delay = -1,
+ .useColors = true,
};
- while(nanosleep(&req,&req)==-1) {
- continue;
- }
-}
-
-int main(int argc, char** argv) {
- int delay = -1;
- bool userOnly = false;
- uid_t userId = 0;
- int usecolors = 1;
- char *argCopy;
- char *pid;
- Hashtable *pidWhiteList = NULL;
-
- int opt, opti=0;
static struct option long_opts[] =
{
{"help", no_argument, 0, 'h'},
@@ -371,20 +83,13 @@ int main(int argc, char** argv) {
{"no-color", no_argument, 0, 'C'},
{"no-colour",no_argument, 0, 'C'},
{"pid", required_argument, 0, 'p'},
+ {"io", no_argument, 0, 'i'},
{0,0,0,0}
};
- int sortKey = 0;
-
- char *lc_ctype = getenv("LC_CTYPE");
- if(lc_ctype != NULL)
- setlocale(LC_CTYPE, lc_ctype);
- else if ((lc_ctype = getenv("LC_ALL")))
- setlocale(LC_CTYPE, lc_ctype);
- else
- setlocale(LC_CTYPE, "");
+ int opt, opti=0;
/* Parse arguments */
- while ((opt = getopt_long(argc, argv, "hvCs:d:u:p:", long_opts, &opti))) {
+ while ((opt = getopt_long(argc, argv, "hvCs:d:u:p:i", long_opts, &opti))) {
if (opt == EOF) break;
switch (opt) {
case 'h':
@@ -395,47 +100,45 @@ int main(int argc, char** argv) {
break;
case 's':
if (strcmp(optarg, "help") == 0) {
- for (int j = 1; j < LAST_PROCESSFIELD; j++)
- printf ("%s\n", Process_fieldNames[j]);
+ for (int j = 1; j < Platform_numberOfFields; j++) {
+ const char* name = Process_fields[j].name;
+ if (name) printf ("%s\n", name);
+ }
exit(0);
}
-
- sortKey = ColumnsPanel_fieldNameToIndex(optarg);
- if (sortKey == -1) {
+ flags.sortKey = ColumnsPanel_fieldNameToIndex(optarg);
+ if (flags.sortKey == -1) {
fprintf(stderr, "Error: invalid column \"%s\".\n", optarg);
- exit(1);
}
break;
case 'd':
- if (sscanf(optarg, "%16d", &delay) == 1) {
- if (delay < 1) delay = 1;
- if (delay > 100) delay = 100;
+ if (sscanf(optarg, "%16d", &(flags.delay)) == 1) {
+ if (flags.delay < 1) flags.delay = 1;
+ if (flags.delay > 100) flags.delay = 100;
} else {
fprintf(stderr, "Error: invalid delay value \"%s\".\n", optarg);
- exit(1);
}
break;
case 'u':
- if (!setUserOnly(optarg, &userOnly, &userId)) {
+ if (!Action_setUserOnly(optarg, &(flags.userId))) {
fprintf(stderr, "Error: invalid user \"%s\".\n", optarg);
- exit(1);
}
break;
case 'C':
- usecolors=0;
+ flags.useColors = false;
break;
- case 'p': {
- argCopy = strdup(optarg);
+ case 'p': {
+ char* argCopy = xStrdup(optarg);
char* saveptr;
- pid = strtok_r(argCopy, ",", &saveptr);
+ char* pid = strtok_r(argCopy, ",", &saveptr);
- if( !pidWhiteList ) {
- pidWhiteList = Hashtable_new(8, false);
+ if(!flags.pidWhiteList) {
+ flags.pidWhiteList = Hashtable_new(8, false);
}
- while( pid ) {
+ while(pid) {
unsigned int num_pid = atoi(pid);
- Hashtable_put(pidWhiteList, num_pid, (void *) 1);
+ Hashtable_put(flags.pidWhiteList, num_pid, (void *) 1);
pid = strtok_r(NULL, ",", &saveptr);
}
free(argCopy);
@@ -446,70 +149,87 @@ int main(int argc, char** argv) {
exit(1);
}
}
+ return flags;
+}
+
+static void millisleep(unsigned long millisec) {
+ struct timespec req = {
+ .tv_sec = 0,
+ .tv_nsec = millisec * 1000000L
+ };
+ while(nanosleep(&req,&req)==-1) {
+ continue;
+ }
+}
+
+int main(int argc, char** argv) {
+ char *lc_ctype = getenv("LC_CTYPE");
+ if(lc_ctype != NULL)
+ setlocale(LC_CTYPE, lc_ctype);
+ else if ((lc_ctype = getenv("LC_ALL")))
+ setlocale(LC_CTYPE, lc_ctype);
+ else
+ setlocale(LC_CTYPE, "");
+
+ CommandLineSettings flags = parseArguments(argc, argv); // may exit()
+#ifdef HAVE_PROC
if (access(PROCDIR, R_OK) != 0) {
- fprintf(stderr, "Error: could not read procfs (compiled to look in %s).\n", PROCDIR);
- exit(1);
+ fprintf("Error: could not read procfs (compiled to look in %s).\n", PROCDIR);
}
-
- int quit = 0;
- int refreshTimeout = 0;
- int resetRefreshTimeout = 5;
- bool doRefresh = true;
- bool doRecalculate = false;
- Settings* settings;
+#endif
+
+ Process_setupColumnWidths();
- ProcessList* pl = NULL;
UsersTable* ut = UsersTable_new();
+ ProcessList* pl = ProcessList_new(ut, flags.pidWhiteList, flags.userId);
+
+ Settings* settings = Settings_new(pl->cpuCount);
+ pl->settings = settings;
-#ifdef HAVE_LIBNCURSESW
- char *locale = setlocale(LC_ALL, NULL);
- if (locale == NULL || locale[0] == '\0')
- locale = setlocale(LC_CTYPE, NULL);
- if (locale != NULL &&
- (strstr(locale, "UTF-8") ||
- strstr(locale, "utf-8") ||
- strstr(locale, "UTF8") ||
- strstr(locale, "utf8")))
- CRT_utf8 = true;
- else
- CRT_utf8 = false;
-#endif
+ Header* header = Header_new(pl, settings, 2);
- pl = ProcessList_new(ut, pidWhiteList);
- Process_getMaxPid();
-
- Header* header = Header_new(pl);
- settings = Settings_new(pl, header, pl->cpuCount);
- int headerHeight = Header_calculateHeight(header);
-
- // FIXME: move delay code to settings
- if (delay != -1)
- settings->delay = delay;
- if (!usecolors)
+ Header_populateFromSettings(header);
+
+ if (flags.delay != -1)
+ settings->delay = flags.delay;
+ if (!flags.useColors)
settings->colorScheme = COLORSCHEME_MONOCHROME;
CRT_init(settings->delay, settings->colorScheme);
-
- Panel* panel = Panel_new(0, headerHeight, COLS, LINES - headerHeight - 2, false, &Process_class);
- ProcessList_setPanel(pl, panel);
- FunctionBar* defaultBar = FunctionBar_new(defaultFunctions, NULL, NULL);
- setTreeView(pl, defaultBar, pl->treeView);
-
- if (sortKey > 0) {
- pl->sortKey = sortKey;
- setTreeView(pl, defaultBar, false);
- pl->direction = 1;
- }
- ProcessList_printHeader(pl, Panel_getHeader(panel));
+ MainPanel* panel = MainPanel_new();
+ ProcessList_setPanel(pl, (Panel*) panel);
- IncSet* inc = IncSet_new(defaultBar);
+ MainPanel_updateTreeFunctions(panel, settings->treeView);
+
+ if (flags.sortKey > 0) {
+ settings->sortKey = flags.sortKey;
+ settings->treeView = false;
+ settings->direction = 1;
+ }
+ ProcessList_printHeader(pl, Panel_getHeader((Panel*)panel));
+
+ State state = {
+ .settings = settings,
+ .ut = ut,
+ .pl = pl,
+ .panel = (Panel*) panel,
+ .header = header,
+ };
+ MainPanel_setState(panel, &state);
+
+ ScreenManager* scr = ScreenManager_new(0, header->height, 0, -1, HORIZONTAL, header, settings, true);
+ ScreenManager_add(scr, (Panel*) panel, -1);
ProcessList_scan(pl);
millisleep(75);
+ ProcessList_scan(pl);
+
+ ScreenManager_run(scr, NULL, NULL);
+ /*
FunctionBar_draw(defaultBar, NULL);
int acc = 0;
@@ -521,34 +241,45 @@ int main(int argc, char** argv) {
int ch = ERR;
int closeTimeout = 0;
- bool idle = false;
+ bool drawPanel = true;
bool collapsed = false;
+ Htop_Action keys[KEY_MAX] = { NULL };
+ setBindings(keys);
+ Platform_setBindings(keys);
+
+ bool quit = false;
+ int sortTimeout = 0;
+ int resetSortTimeout = 5;
+ bool doRefresh = true;
+ bool forceRecalculate = false;
+
while (!quit) {
gettimeofday(&tv, NULL);
double newTime = ((double)tv.tv_sec * 10) + ((double)tv.tv_usec / 100000);
- bool recalculate = (newTime - oldTime > settings->delay);
- int following = follow ? selectedPid(panel) : -1;
- if (recalculate) {
+ bool timeToRecalculate = (newTime - oldTime > settings->delay);
+ if (newTime < oldTime) timeToRecalculate = true; // clock was adjusted?
+ int following = follow ? MainPanel_selectedPid((MainPanel*)panel) : -1;
+ if (timeToRecalculate) {
Header_draw(header);
oldTime = newTime;
}
if (doRefresh) {
- if (recalculate || doRecalculate) {
+ if (timeToRecalculate || forceRecalculate) {
ProcessList_scan(pl);
- doRecalculate = false;
+ forceRecalculate = false;
}
- if (refreshTimeout == 0 || pl->treeView) {
+ if (sortTimeout == 0 || settings->treeView) {
ProcessList_sort(pl);
- refreshTimeout = 1;
+ sortTimeout = 1;
}
- ProcessList_rebuildPanel(pl, true, following, userOnly, userId, IncSet_filter(inc));
- idle = false;
+ ProcessList_rebuildPanel(pl, true, following, IncSet_filter(inc));
+ drawPanel = true;
}
doRefresh = true;
- if (pl->treeView) {
+ if (settings->treeView) {
Process* p = (Process*) Panel_getSelected(panel);
if (p) {
if (!p->showChildren && !collapsed) {
@@ -560,9 +291,11 @@ int main(int argc, char** argv) {
}
collapsed = !p->showChildren;
}
+ } else {
+ collapsed = false;
}
- if (!idle) {
+ if (drawPanel) {
Panel_draw(panel, true);
}
@@ -573,18 +306,20 @@ int main(int argc, char** argv) {
if (ch == ERR) {
if (!inc->active)
- refreshTimeout--;
- if (prev == ch && !recalculate) {
+ sortTimeout--;
+ if (prev == ch && !timeToRecalculate) {
closeTimeout++;
if (closeTimeout == 100) {
break;
}
} else
closeTimeout = 0;
- idle = true;
+ drawPanel = false;
continue;
}
- idle = false;
+ drawPanel = true;
+
+ Htop_Reaction reaction = HTOP_OK;
if (ch == KEY_MOUSE) {
MEVENT mevent;
@@ -594,20 +329,19 @@ int main(int argc, char** argv) {
if (mevent.y == panel->y) {
int x = panel->scrollH + mevent.x + 1;
ProcessField field = ProcessList_keyAt(pl, x);
- if (field == pl->sortKey) {
- ProcessList_invertSortOrder(pl);
- setTreeView(pl, defaultBar, false);
+ if (field == settings->sortKey) {
+ Settings_invertSortOrder(settings);
+ settings->treeView = false;
+ reaction |= HTOP_REDRAW_BAR;
} else {
- setSortKey(pl, defaultBar, field, panel, settings);
+ reaction |= setSortKey(settings, field);
}
- refreshTimeout = 0;
- continue;
+ sortTimeout = 0;
+ ch = ERR;
} else if (mevent.y >= panel->y + 1 && mevent.y < LINES - 1) {
Panel_setSelected(panel, mevent.y - panel->y + panel->scrollV - 1);
- doRefresh = false;
- refreshTimeout = resetRefreshTimeout;
follow = true;
- continue;
+ ch = ERR;
} if (mevent.y == LINES - 1) {
ch = FunctionBar_synthesizeEvent(inc->bar, mevent.x);
}
@@ -623,10 +357,13 @@ int main(int argc, char** argv) {
if (inc->active) {
doRefresh = IncSet_handleKey(inc, ch, panel, getMainPanelValue, NULL);
+ if (!inc->active) {
+ follow = true;
+ }
continue;
}
- if (isdigit((char)ch)) {
+ if (ch < 255 && isdigit((char)ch)) {
if (Panel_size(panel) == 0) continue;
pid_t pid = ch-48 + acc;
for (int i = 0; i < ProcessList_size(pl); i++) {
@@ -644,298 +381,42 @@ int main(int argc, char** argv) {
acc = 0;
}
- switch (ch) {
- case KEY_RESIZE:
- Panel_resize(panel, COLS, LINES-headerHeight-1);
- IncSet_drawBar(inc);
- break;
- case 'M':
- {
- refreshTimeout = 0;
- setSortKey(pl, defaultBar, PERCENT_MEM, panel, settings);
- break;
- }
- case 'T':
- {
- refreshTimeout = 0;
- setSortKey(pl, defaultBar, TIME, panel, settings);
- break;
- }
- case 'c':
- {
- Process* p = (Process*) Panel_getSelected(panel);
- if (!p) break;
- tagAllChildren(panel, p);
- break;
- }
- case 'U':
- {
- for (int i = 0; i < Panel_size(panel); i++) {
- Process* p = (Process*) Panel_get(panel, i);
- p->tag = false;
- }
- doRefresh = true;
- break;
- }
- case 'P':
- {
- refreshTimeout = 0;
- setSortKey(pl, defaultBar, PERCENT_CPU, panel, settings);
- break;
- }
- case KEY_F(1):
- case 'h':
- case '?':
- {
- showHelp(pl);
- FunctionBar_draw(defaultBar, NULL);
- refreshTimeout = 0;
- break;
- }
- case '\014': // Ctrl+L
- {
- clear();
- FunctionBar_draw(defaultBar, NULL);
- refreshTimeout = 0;
- break;
- }
- case ' ':
- {
- Process* p = (Process*) Panel_getSelected(panel);
- if (!p) break;
- Process_toggleTag(p);
- Panel_onKey(panel, KEY_DOWN);
- break;
- }
- case 's':
- {
- Process* p = (Process*) Panel_getSelected(panel);
- if (!p) break;
- TraceScreen* ts = TraceScreen_new(p);
- TraceScreen_run(ts);
- TraceScreen_delete(ts);
- clear();
- FunctionBar_draw(defaultBar, NULL);
- refreshTimeout = 0;
- CRT_enableDelay();
- break;
- }
- case 'l':
- {
- Process* p = (Process*) Panel_getSelected(panel);
- if (!p) break;
- OpenFilesScreen* ts = OpenFilesScreen_new(p);
- OpenFilesScreen_run(ts);
- OpenFilesScreen_delete(ts);
- clear();
- FunctionBar_draw(defaultBar, NULL);
- refreshTimeout = 0;
- CRT_enableDelay();
- break;
- }
- case 'S':
- case 'C':
- case KEY_F(2):
- {
- Setup_run(settings, header);
- // TODO: shouldn't need this, colors should be dynamic
- ProcessList_printHeader(pl, Panel_getHeader(panel));
- headerHeight = Header_calculateHeight(header);
- Panel_move(panel, 0, headerHeight);
- Panel_resize(panel, COLS, LINES-headerHeight-1);
- FunctionBar_draw(defaultBar, NULL);
- refreshTimeout = 0;
- break;
- }
- case 'F':
- {
- follow = true;
- continue;
- }
- case 'u':
- {
- Panel* usersPanel = Panel_new(0, 0, 0, 0, true, Class(ListItem));
- Panel_setHeader(usersPanel, "Show processes of:");
- UsersTable_foreach(ut, addUserToVector, usersPanel);
- Vector_insertionSort(usersPanel->items);
- ListItem* allUsers = ListItem_new("All users", -1);
- Panel_insert(usersPanel, 0, (Object*) allUsers);
- const char* fuFunctions[] = {"Show ", "Cancel ", NULL};
- ListItem* picked = (ListItem*) pickFromVector(panel, usersPanel, 20, headerHeight, fuFunctions, defaultBar, header);
- if (picked) {
- if (picked == allUsers) {
- userOnly = false;
- } else {
- setUserOnly(ListItem_getRef(picked), &userOnly, &userId);
- }
- }
- Panel_delete((Object*)usersPanel);
- break;
- }
- case '+':
- case '=':
- case '-':
- {
- if (expandCollapse(panel)) {
- doRecalculate = true;
- refreshTimeout = 0;
- }
- break;
- }
- case KEY_F(9):
- case 'k':
- {
- Panel* signalsPanel = (Panel*) SignalsPanel_new();
- const char* fuFunctions[] = {"Send ", "Cancel ", NULL};
- ListItem* sgn = (ListItem*) pickFromVector(panel, signalsPanel, 15, headerHeight, fuFunctions, defaultBar, header);
- if (sgn) {
- if (sgn->key != 0) {
- Panel_setHeader(panel, "Sending...");
- Panel_draw(panel, true);
- refresh();
- foreachProcess(panel, (ForeachProcessFn) Process_sendSignal, (size_t) sgn->key, NULL);
- napms(500);
- }
- }
- ProcessList_printHeader(pl, Panel_getHeader(panel));
- Panel_delete((Object*)signalsPanel);
- refreshTimeout = 0;
- break;
+ if(ch != ERR && keys[ch]) {
+ reaction |= (keys[ch])(&state);
+ } else {
+ doRefresh = false;
+ sortTimeout = resetSortTimeout;
+ Panel_onKey(panel, ch);
}
-#if (HAVE_LIBHWLOC || HAVE_NATIVE_AFFINITY)
- case 'a':
- {
- if (pl->cpuCount == 1)
- break;
+
+ // Reaction handlers:
- Process* p = (Process*) Panel_getSelected(panel);
- if (!p) break;
- Affinity* affinity = Process_getAffinity(p);
- if (!affinity) break;
- Panel* affinityPanel = AffinityPanel_new(pl, affinity);
- Affinity_delete(affinity);
-
- const char* fuFunctions[] = {"Set ", "Cancel ", NULL};
- void* set = pickFromVector(panel, affinityPanel, 15, headerHeight, fuFunctions, defaultBar, header);
- if (set) {
- Affinity* affinity = AffinityPanel_getAffinity(affinityPanel);
- bool ok = foreachProcess(panel, (ForeachProcessFn) Process_setAffinity, (size_t) affinity, NULL);
- if (!ok) beep();
- Affinity_delete(affinity);
- }
- Panel_delete((Object*)affinityPanel);
- ProcessList_printHeader(pl, Panel_getHeader(panel));
- refreshTimeout = 0;
- break;
- }
-#endif
- case KEY_F(10):
- case 'q':
- quit = 1;
- break;
- case '<':
- case ',':
- case '>':
- case '.':
- {
- sortBy(panel, pl, settings, headerHeight, defaultBar, header);
- refreshTimeout = 0;
- break;
- }
- case KEY_F(18):
- case KEY_F(6):
- {
- if (pl->treeView) {
- if (expandCollapse(panel)) {
- doRecalculate = true;
- refreshTimeout = 0;
- }
- } else {
- sortBy(panel, pl, settings, headerHeight, defaultBar, header);
- refreshTimeout = 0;
- }
- break;
+ if (reaction & HTOP_REDRAW_BAR) {
+ updateTreeFunctions(defaultBar, settings->treeView);
+ IncSet_drawBar(inc);
}
- case 'i':
- {
- Process* p = (Process*) Panel_getSelected(panel);
- if (!p) break;
- IOPriority ioprio = p->ioPriority;
- Panel* ioprioPanel = IOPriorityPanel_new(ioprio);
- const char* fuFunctions[] = {"Set ", "Cancel ", NULL};
- void* set = pickFromVector(panel, ioprioPanel, 21, headerHeight, fuFunctions, defaultBar, header);
- if (set) {
- IOPriority ioprio = IOPriorityPanel_getIOPriority(ioprioPanel);
- bool ok = foreachProcess(panel, (ForeachProcessFn) Process_setIOPriority, (size_t) ioprio, NULL);
- if (!ok)
- beep();
- }
- Panel_delete((Object*)ioprioPanel);
+ if (reaction & HTOP_UPDATE_PANELHDR) {
ProcessList_printHeader(pl, Panel_getHeader(panel));
- refreshTimeout = 0;
- break;
- }
- case 'I':
- {
- refreshTimeout = 0;
- settings->changed = true;
- ProcessList_invertSortOrder(pl);
- break;
}
- case KEY_F(8):
- case '[':
- {
- doRefresh = changePriority(panel, 1);
- break;
- }
- case KEY_F(7):
- case ']':
- {
- doRefresh = changePriority(panel, -1);
- break;
- }
- case KEY_F(3):
- case '/':
- IncSet_activate(inc, INC_SEARCH);
- break;
- case KEY_F(4):
- case '\\':
- IncSet_activate(inc, INC_FILTER);
- refreshTimeout = 0;
+ if (reaction & HTOP_REFRESH) {
doRefresh = true;
- continue;
- case 't':
- case KEY_F(5):
- refreshTimeout = 0;
- collapsed = false;
- setTreeView(pl, defaultBar, !pl->treeView);
- if (pl->treeView) pl->direction = 1;
- ProcessList_printHeader(pl, Panel_getHeader(panel));
- ProcessList_expandTree(pl);
- settings->changed = true;
- if (following != -1) continue;
- break;
- case 'H':
- doRecalculate = true;
- refreshTimeout = 0;
- pl->hideUserlandThreads = !pl->hideUserlandThreads;
- pl->hideThreads = pl->hideUserlandThreads;
- settings->changed = true;
- break;
- case 'K':
- doRecalculate = true;
- refreshTimeout = 0;
- pl->hideKernelThreads = !pl->hideKernelThreads;
+ sortTimeout = 0;
+ }
+ if (reaction & HTOP_RECALCULATE) {
+ forceRecalculate = true;
+ sortTimeout = 0;
+ }
+ if (reaction & HTOP_SAVE_SETTINGS) {
settings->changed = true;
- break;
- default:
- doRefresh = false;
- refreshTimeout = resetRefreshTimeout;
- Panel_onKey(panel, ch);
- break;
}
- follow = false;
+ if (reaction & HTOP_QUIT) {
+ quit = true;
+ }
+ follow = (reaction & HTOP_KEEP_FOLLOWING);
}
+
+ */
+
attron(CRT_colors[RESET_COLOR]);
mvhline(LINES-1, 0, ' ', COLS);
attroff(CRT_colors[RESET_COLOR]);
@@ -946,13 +427,19 @@ int main(int argc, char** argv) {
Settings_write(settings);
Header_delete(header);
ProcessList_delete(pl);
- IncSet_delete(inc);
+
+ /*
FunctionBar_delete((Object*)defaultBar);
Panel_delete((Object*)panel);
+ */
+
+ ScreenManager_delete(scr);
+
UsersTable_delete(ut);
Settings_delete(settings);
- if(pidWhiteList) {
- Hashtable_delete(pidWhiteList);
+
+ if(flags.pidWhiteList) {
+ Hashtable_delete(flags.pidWhiteList);
}
return 0;
}
diff --git a/htop.desktop b/htop.desktop
index 68050f3..2f7a7ee 100644
--- a/htop.desktop
+++ b/htop.desktop
@@ -3,8 +3,60 @@ Version=1.0
Name=Htop
Type=Application
Comment=Show System Processes
+Comment[ca]=Mostra els processos del sistema
+Comment[de]=Systemprozesse anzeigen
+Comment[en_GB]=Show System Processes
+Comment[es]=Mostrar procesos del sistema
+Comment[fi]=Katsele järjestelmän prosesseja
+Comment[fr]=Affiche les processus système
+Comment[gl]=Mostrar os procesos do sistema.
+Comment[it]=Mostra processi di sistema
+Comment[ko]=시스템 프로세스 보기
+Comment[nb]=Vis systemprosesser
+Comment[nl]=Systeemprocessen tonen
+Comment[nn]=Vis systemprosessar
+Comment[pl]=Pokaż procesy systemowe
+Comment[pt]=Mostrar os Processos do Sistema
+Comment[pt_BR]=Mostra os processos do sistema
+Comment[ru]=Просмотр списка процессов в системе
+Comment[sk]=Zobraziť systémové procesy
+Comment[sl]=Prikaz sistemskih opravil
+Comment[sr]=Приказ системских процеса
+Comment[sr@ijekavian]=Приказ системских процеса
+Comment[sr@ijekavianlatin]=Prikaz sistemskih procesa
+Comment[sr@latin]=Prikaz sistemskih procesa
+Comment[sv]=Visa systemprocesser
+Comment[tr]=Sistem Süreçlerini Göster
+Comment[uk]=Перегляд системних процесів
+Comment[zh_TW]=顯示系統行程
Terminal=true
Exec=htop
Icon=htop
Categories=ConsoleOnly;System;
GenericName=Process Viewer
+GenericName[ca]=Visor de processos
+GenericName[de]=Prozessanzeige
+GenericName[en_GB]=Process Viewer
+GenericName[es]=Visor de procesos
+GenericName[fi]=Prosessikatselin
+GenericName[fr]=Visualiseur de processus
+GenericName[gl]=Visor de procesos
+GenericName[it]=Visore dei processi
+GenericName[ko]=프로세스 뷰어
+GenericName[nb]=Prosessviser
+GenericName[nl]=Viewer van processen
+GenericName[nn]=Prosessvisar
+GenericName[pl]=Przeglądarka procesów
+GenericName[pt]=Visualizador de Processos
+GenericName[pt_BR]=Visualizador de processos
+GenericName[ru]=Монитор процессов
+GenericName[sk]=Prehliadač procesov
+GenericName[sl]=Pregledovalnik opravil
+GenericName[sr]=Приказивач процеса
+GenericName[sr@ijekavian]=Приказивач процеса
+GenericName[sr@ijekavianlatin]=Prikazivač procesa
+GenericName[sr@latin]=Prikazivač procesa
+GenericName[sv]=Processvisning
+GenericName[tr]=Süreç Görüntüleyici
+GenericName[uk]=Перегляд процесів
+GenericName[zh_TW]=行程檢視器
diff --git a/htop.h b/htop.h
index 354a2f9..7faa6c6 100644
--- a/htop.h
+++ b/htop.h
@@ -11,11 +11,8 @@ in the source distribution for its full text.
//#link m
-#define COPYRIGHT "(C) 2004-2012 Hisham Muhammad"
+// ----------------------------------------
-typedef bool(*ForeachProcessFn)(Process*, size_t);
-
-void sortBy(Panel* panel, ProcessList* pl, Settings* settings, int headerHeight, FunctionBar* defaultBar, Header* header);
int main(int argc, char** argv);
diff --git a/linux/Battery.c b/linux/Battery.c
new file mode 100644
index 0000000..572bad4
--- /dev/null
+++ b/linux/Battery.c
@@ -0,0 +1,331 @@
+/*
+htop - linux/Battery.c
+(C) 2004-2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+
+Linux battery readings written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com).
+*/
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+#include <dirent.h>
+#include <errno.h>
+#include <unistd.h>
+#include <stdlib.h>
+#include <string.h>
+#include <fcntl.h>
+#include <time.h>
+#include "BatteryMeter.h"
+#include "StringUtils.h"
+
+#define SYS_POWERSUPPLY_DIR "/sys/class/power_supply"
+
+// ----------------------------------------
+// READ FROM /proc
+// ----------------------------------------
+
+// This implementation reading from from /proc/acpi is really inefficient,
+// but I think this is on the way out so I did not rewrite it.
+// The /sys implementation below does things the right way.
+
+static unsigned long int parseBatInfo(const char *fileName, const unsigned short int lineNum, const unsigned short int wordNum) {
+ const char batteryPath[] = PROCDIR "/acpi/battery/";
+ DIR* batteryDir = opendir(batteryPath);
+ if (!batteryDir)
+ return 0;
+
+ #define MAX_BATTERIES 64
+ char* batteries[MAX_BATTERIES];
+ unsigned int nBatteries = 0;
+ memset(batteries, 0, MAX_BATTERIES * sizeof(char*));
+
+ struct dirent result;
+ struct dirent* dirEntry;
+ while (nBatteries < MAX_BATTERIES) {
+ int err = readdir_r(batteryDir, &result, &dirEntry);
+ if (err || !dirEntry)
+ break;
+ char* entryName = dirEntry->d_name;
+ if (strncmp(entryName, "BAT", 3))
+ continue;
+ batteries[nBatteries] = xStrdup(entryName);
+ nBatteries++;
+ }
+ closedir(batteryDir);
+
+ unsigned long int total = 0;
+ for (unsigned int i = 0; i < nBatteries; i++) {
+ char infoPath[30];
+ snprintf(infoPath, sizeof infoPath, "%s%s/%s", batteryPath, batteries[i], fileName);
+
+ FILE* file = fopen(infoPath, "r");
+ if (!file) {
+ break;
+ }
+
+ char line[50] = "";
+ for (unsigned short int i = 0; i < lineNum; i++) {
+ char* ok = fgets(line, sizeof line, file);
+ if (!ok) break;
+ }
+
+ fclose(file);
+
+ char *foundNumStr = String_getToken(line, wordNum);
+ const unsigned long int foundNum = atoi(foundNumStr);
+ free(foundNumStr);
+
+ total += foundNum;
+ }
+
+ for (unsigned int i = 0; i < nBatteries; i++) {
+ free(batteries[i]);
+ }
+
+ return total;
+}
+
+static ACPresence procAcpiCheck() {
+ ACPresence isOn = AC_ERROR;
+ const char *power_supplyPath = PROCDIR "/acpi/ac_adapter";
+ DIR *dir = opendir(power_supplyPath);
+ if (!dir) {
+ return AC_ERROR;
+ }
+
+ struct dirent result;
+ struct dirent* dirEntry;
+ for (;;) {
+ int err = readdir_r((DIR *) dir, &result, &dirEntry);
+ if (err || !dirEntry)
+ break;
+
+ char* entryName = (char *) dirEntry->d_name;
+
+ if (entryName[0] != 'A')
+ continue;
+
+ char statePath[50];
+ snprintf((char *) statePath, sizeof statePath, "%s/%s/state", power_supplyPath, entryName);
+ FILE* file = fopen(statePath, "r");
+
+ if (!file) {
+ isOn = AC_ERROR;
+ continue;
+ }
+
+ char line[100];
+ char* ok = fgets(line, sizeof line, file);
+ if (!ok) continue;
+ line[sizeof(line) - 1] = '\0';
+
+ fclose(file);
+
+ const char *isOnline = String_getToken(line, 2);
+
+ if (strcmp(isOnline, "on-line") == 0) {
+ isOn = AC_PRESENT;
+ } else {
+ isOn = AC_ABSENT;
+ }
+ free((char *) isOnline);
+ if (isOn == AC_PRESENT) {
+ break;
+ }
+ }
+
+ if (dir)
+ closedir(dir);
+ return isOn;
+}
+
+static double Battery_getProcBatData() {
+ const unsigned long int totalFull = parseBatInfo("info", 3, 4);
+ if (totalFull == 0)
+ return 0;
+
+ const unsigned long int totalRemain = parseBatInfo("state", 5, 3);
+ if (totalRemain == 0)
+ return 0;
+
+ return totalRemain * 100.0 / (double) totalFull;
+}
+
+static void Battery_getProcData(double* level, ACPresence* isOnAC) {
+ *level = Battery_getProcBatData();
+ *isOnAC = procAcpiCheck();
+}
+
+// ----------------------------------------
+// READ FROM /sys
+// ----------------------------------------
+
+static inline ssize_t xread(int fd, void *buf, size_t count) {
+ // Read some bytes. Retry on EINTR and when we don't get as many bytes as we requested.
+ size_t alreadyRead = 0;
+ for(;;) {
+ ssize_t res = read(fd, buf, count);
+ if (res == -1 && errno == EINTR) continue;
+ if (res > 0) {
+ buf = ((char*)buf)+res;
+ count -= res;
+ alreadyRead += res;
+ }
+ if (res == -1) return -1;
+ if (count == 0 || res == 0) return alreadyRead;
+ }
+}
+
+/**
+ * Returns a pointer to the suffix of `str` if its beginning matches `prefix`.
+ * Returns NULL if the prefix does not match.
+ * Examples:
+ * match("hello world", "hello "); -> "world"
+ * match("hello world", "goodbye "); -> NULL
+ */
+static inline const char* match(const char* str, const char* prefix) {
+ for (;;) {
+ if (*prefix == '\0') {
+ return str;
+ }
+ if (*prefix != *str) {
+ return NULL;
+ }
+ prefix++; str++;
+ }
+}
+
+static void Battery_getSysData(double* level, ACPresence* isOnAC) {
+
+ *level = 0;
+ *isOnAC = AC_ERROR;
+
+ DIR *dir = opendir(SYS_POWERSUPPLY_DIR);
+ if (!dir)
+ return;
+
+ unsigned long int totalFull = 0;
+ unsigned long int totalRemain = 0;
+
+ struct dirent result;
+ struct dirent* dirEntry;
+ for (;;) {
+ int err = readdir_r((DIR *) dir, &result, &dirEntry);
+ if (err || !dirEntry)
+ break;
+ char* entryName = (char *) dirEntry->d_name;
+ const char filePath[50];
+
+ if (entryName[0] == 'B' && entryName[1] == 'A' && entryName[2] == 'T') {
+
+ snprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/uevent", entryName);
+ int fd = open(filePath, O_RDONLY);
+ if (fd == -1) {
+ closedir(dir);
+ return;
+ }
+ char buffer[1024];
+ ssize_t buflen = xread(fd, buffer, 1023);
+ close(fd);
+ if (buflen < 1) {
+ closedir(dir);
+ return;
+ }
+ buffer[buflen] = '\0';
+ char *buf = buffer;
+ char *line = NULL;
+ bool full = false;
+ bool now = false;
+ while ((line = strsep(&buf, "\n")) != NULL) {
+ const char* ps = match(line, "POWER_SUPPLY_");
+ if (!ps) {
+ continue;
+ }
+ const char* energy = match(ps, "ENERGY_");
+ if (!energy) {
+ energy = match(ps, "CHARGE_");
+ }
+ if (!energy) {
+ continue;
+ }
+ const char* value = (!full) ? match(energy, "FULL=") : NULL;
+ if (value) {
+ totalFull += atoi(value);
+ full = true;
+ if (now) break;
+ continue;
+ }
+ value = (!now) ? match(energy, "NOW=") : NULL;
+ if (value) {
+ totalRemain += atoi(value);
+ now = true;
+ if (full) break;
+ continue;
+ }
+ }
+ } else if (entryName[0] == 'A') {
+ if (*isOnAC != AC_ERROR) {
+ continue;
+ }
+
+ snprintf((char *) filePath, sizeof filePath, SYS_POWERSUPPLY_DIR "/%s/online", entryName);
+ int fd = open(filePath, O_RDONLY);
+ if (fd == -1) {
+ closedir(dir);
+ return;
+ }
+ char buffer[2] = "";
+ for(;;) {
+ ssize_t res = read(fd, buffer, 1);
+ if (res == -1 && errno == EINTR) continue;
+ break;
+ }
+ close(fd);
+ if (buffer[0] == '0') {
+ *isOnAC = AC_ABSENT;
+ } else if (buffer[0] == '1') {
+ *isOnAC = AC_PRESENT;
+ }
+ }
+ }
+ closedir(dir);
+ *level = totalFull > 0 ? ((double) totalRemain * 100) / (double) totalFull : 0;
+}
+
+static enum { BAT_PROC, BAT_SYS, BAT_ERR } Battery_method = BAT_PROC;
+
+static time_t Battery_cacheTime = 0;
+static double Battery_cacheLevel = 0;
+static ACPresence Battery_cacheIsOnAC = 0;
+
+void Battery_getData(double* level, ACPresence* isOnAC) {
+ time_t now = time(NULL);
+ // update battery reading is slow. Update it each 10 seconds only.
+ if (now < Battery_cacheTime + 10) {
+ *level = Battery_cacheLevel;
+ *isOnAC = Battery_cacheIsOnAC;
+ return;
+ }
+
+ if (Battery_method == BAT_PROC) {
+ Battery_getProcData(level, isOnAC);
+ if (*level == 0) {
+ Battery_method = BAT_SYS;
+ }
+ }
+ if (Battery_method == BAT_SYS) {
+ Battery_getSysData(level, isOnAC);
+ if (*level == 0) {
+ Battery_method = BAT_ERR;
+ }
+ }
+ if (Battery_method == BAT_ERR) {
+ *level = -1;
+ *isOnAC = AC_ERROR;
+ }
+ Battery_cacheLevel = *level;
+ Battery_cacheIsOnAC = *isOnAC;
+ Battery_cacheTime = now;
+}
diff --git a/linux/Battery.h b/linux/Battery.h
new file mode 100644
index 0000000..4cb22a8
--- /dev/null
+++ b/linux/Battery.h
@@ -0,0 +1,41 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_Battery
+#define HEADER_Battery
+/*
+htop - linux/Battery.h
+(C) 2004-2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+
+Linux battery readings written by Ian P. Hands (iphands@gmail.com, ihands@redhat.com).
+*/
+
+#ifndef _GNU_SOURCE
+#define _GNU_SOURCE
+#endif
+
+#define SYS_POWERSUPPLY_DIR "/sys/class/power_supply"
+
+// ----------------------------------------
+// READ FROM /proc
+// ----------------------------------------
+
+// This implementation reading from from /proc/acpi is really inefficient,
+// but I think this is on the way out so I did not rewrite it.
+// The /sys implementation below does things the right way.
+
+// ----------------------------------------
+// READ FROM /sys
+// ----------------------------------------
+
+/**
+ * Returns a pointer to the suffix of `str` if its beginning matches `prefix`.
+ * Returns NULL if the prefix does not match.
+ * Examples:
+ * match("hello world", "hello "); -> "world"
+ * match("hello world", "goodbye "); -> NULL
+ */
+void Battery_getData(double* level, ACPresence* isOnAC);
+
+#endif
diff --git a/IOPriority.c b/linux/IOPriority.c
index 7b19743..7b19743 100644
--- a/IOPriority.c
+++ b/linux/IOPriority.c
diff --git a/IOPriority.h b/linux/IOPriority.h
index d69e30d..d69e30d 100644
--- a/IOPriority.h
+++ b/linux/IOPriority.h
diff --git a/IOPriorityPanel.c b/linux/IOPriorityPanel.c
index 04d98b1..9e12c75 100644
--- a/IOPriorityPanel.c
+++ b/linux/IOPriorityPanel.c
@@ -14,7 +14,7 @@ in the source distribution for its full text.
}*/
Panel* IOPriorityPanel_new(IOPriority currPrio) {
- Panel* this = Panel_new(1, 1, 1, 1, true, Class(ListItem));
+ Panel* this = Panel_new(1, 1, 1, 1, true, Class(ListItem), FunctionBar_newEnterEsc("Set ", "Cancel "));
Panel_setHeader(this, "IO Priority:");
Panel_add(this, (Object*) ListItem_new("None (based on nice)", IOPriority_None));
@@ -41,3 +41,4 @@ Panel* IOPriorityPanel_new(IOPriority currPrio) {
IOPriority IOPriorityPanel_getIOPriority(Panel* this) {
return (IOPriority) ( ((ListItem*) Panel_getSelected(this))->key );
}
+
diff --git a/IOPriorityPanel.h b/linux/IOPriorityPanel.h
index f87af4e..9f77a4d 100644
--- a/IOPriorityPanel.h
+++ b/linux/IOPriorityPanel.h
@@ -17,4 +17,5 @@ Panel* IOPriorityPanel_new(IOPriority currPrio);
IOPriority IOPriorityPanel_getIOPriority(Panel* this);
+
#endif
diff --git a/linux/LinuxCRT.c b/linux/LinuxCRT.c
new file mode 100644
index 0000000..5b2a21f
--- /dev/null
+++ b/linux/LinuxCRT.c
@@ -0,0 +1,36 @@
+/*
+htop - LinuxCRT.c
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "config.h"
+#include "CRT.h"
+#include <stdio.h>
+#include <stdlib.h>
+#ifdef HAVE_EXECINFO_H
+#include <execinfo.h>
+#endif
+
+void CRT_handleSIGSEGV(int sgn) {
+ (void) sgn;
+ CRT_done();
+ #ifdef __linux
+ fprintf(stderr, "\n\nhtop " VERSION " aborting. Please report bug at http://hisham.hm/htop\n");
+ #ifdef HAVE_EXECINFO_H
+ size_t size = backtrace(backtraceArray, sizeof(backtraceArray) / sizeof(void *));
+ fprintf(stderr, "\n Please include in your report the following backtrace: \n");
+ backtrace_symbols_fd(backtraceArray, size, 2);
+ fprintf(stderr, "\nAdditionally, in order to make the above backtrace useful,");
+ fprintf(stderr, "\nplease also run the following command to generate a disassembly of your binary:");
+ fprintf(stderr, "\n\n objdump -d `which htop` > ~/htop.objdump");
+ fprintf(stderr, "\n\nand then attach the file ~/htop.objdump to your bug report.");
+ fprintf(stderr, "\n\nThank you for helping to improve htop!\n\n");
+ #endif
+ #else
+ fprintf(stderr, "\nUnfortunately, you seem to be using an unsupported platform!");
+ fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n");
+ #endif
+ abort();
+}
diff --git a/linux/LinuxCRT.h b/linux/LinuxCRT.h
new file mode 100644
index 0000000..f8c43e4
--- /dev/null
+++ b/linux/LinuxCRT.h
@@ -0,0 +1,17 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_LinuxCRT
+#define HEADER_LinuxCRT
+/*
+htop - LinuxCRT.h
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#ifdef HAVE_EXECINFO_H
+#endif
+
+void CRT_handleSIGSEGV(int sgn);
+
+#endif
diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c
new file mode 100644
index 0000000..c6c3112
--- /dev/null
+++ b/linux/LinuxProcess.c
@@ -0,0 +1,413 @@
+/*
+htop - LinuxProcess.c
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Process.h"
+#include "ProcessList.h"
+#include "LinuxProcess.h"
+#include "Platform.h"
+#include "CRT.h"
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <string.h>
+#include <sys/syscall.h>
+
+/*{
+
+#define PROCESS_FLAG_LINUX_IOPRIO 0x0100
+#define PROCESS_FLAG_LINUX_OPENVZ 0x0200
+#define PROCESS_FLAG_LINUX_VSERVER 0x0400
+#define PROCESS_FLAG_LINUX_CGROUP 0x0800
+#define PROCESS_FLAG_LINUX_OOM 0x1000
+
+typedef enum UnsupportedProcessFields {
+ FLAGS = 9,
+ ITREALVALUE = 20,
+ VSIZE = 22,
+ RSS = 23,
+ RLIM = 24,
+ STARTCODE = 25,
+ ENDCODE = 26,
+ STARTSTACK = 27,
+ KSTKESP = 28,
+ KSTKEIP = 29,
+ SIGNAL = 30,
+ BLOCKED = 31,
+ SSIGIGNORE = 32,
+ SIGCATCH = 33,
+ WCHAN = 34,
+ NSWAP = 35,
+ CNSWAP = 36,
+ EXIT_SIGNAL = 37,
+} UnsupportedProcessField;
+
+typedef enum LinuxProcessFields {
+ CMINFLT = 11,
+ CMAJFLT = 13,
+ UTIME = 14,
+ STIME = 15,
+ CUTIME = 16,
+ CSTIME = 17,
+ M_SHARE = 41,
+ M_TRS = 42,
+ M_DRS = 43,
+ M_LRS = 44,
+ M_DT = 45,
+ #ifdef HAVE_OPENVZ
+ CTID = 100,
+ VPID = 101,
+ #endif
+ #ifdef HAVE_VSERVER
+ VXID = 102,
+ #endif
+ #ifdef HAVE_TASKSTATS
+ RCHAR = 103,
+ WCHAR = 104,
+ SYSCR = 105,
+ SYSCW = 106,
+ RBYTES = 107,
+ WBYTES = 108,
+ CNCLWB = 109,
+ IO_READ_RATE = 110,
+ IO_WRITE_RATE = 111,
+ IO_RATE = 112,
+ #endif
+ #ifdef HAVE_CGROUP
+ CGROUP = 113,
+ #endif
+ OOM = 114,
+ IO_PRIORITY = 115,
+ LAST_PROCESSFIELD = 116,
+} LinuxProcessField;
+
+#include "IOPriority.h"
+
+typedef struct LinuxProcess_ {
+ Process super;
+ IOPriority ioPriority;
+ unsigned long int cminflt;
+ unsigned long int cmajflt;
+ unsigned long long int utime;
+ unsigned long long int stime;
+ unsigned long long int cutime;
+ unsigned long long int cstime;
+ long m_share;
+ long m_trs;
+ long m_drs;
+ long m_lrs;
+ long m_dt;
+ #ifdef HAVE_TASKSTATS
+ unsigned long long io_rchar;
+ unsigned long long io_wchar;
+ unsigned long long io_syscr;
+ unsigned long long io_syscw;
+ unsigned long long io_read_bytes;
+ unsigned long long io_write_bytes;
+ unsigned long long io_cancelled_write_bytes;
+ unsigned long long io_rate_read_time;
+ unsigned long long io_rate_write_time;
+ double io_rate_read_bps;
+ double io_rate_write_bps;
+ #endif
+ #ifdef HAVE_OPENVZ
+ unsigned int ctid;
+ unsigned int vpid;
+ #endif
+ #ifdef HAVE_VSERVER
+ unsigned int vxid;
+ #endif
+ #ifdef HAVE_CGROUP
+ char* cgroup;
+ #endif
+ unsigned int oom;
+} LinuxProcess;
+
+#ifndef Process_isKernelThread
+#define Process_isKernelThread(_process) (_process->pgrp == 0)
+#endif
+
+#ifndef Process_isUserlandThread
+#define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
+#endif
+
+}*/
+
+ProcessFieldData Process_fields[] = {
+ [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, },
+ [PID] = { .name = "PID", .title = " PID ", .description = "Process/thread ID", .flags = 0, },
+ [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, },
+ [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging)", .flags = 0, },
+ [PPID] = { .name = "PPID", .title = " PPID ", .description = "Parent process ID", .flags = 0, },
+ [PGRP] = { .name = "PGRP", .title = " PGRP ", .description = "Process group ID", .flags = 0, },
+ [SESSION] = { .name = "SESSION", .title = " SESN ", .description = "Process's session ID", .flags = 0, },
+ [TTY_NR] = { .name = "TTY_NR", .title = " TTY ", .description = "Controlling terminal", .flags = 0, },
+ [TPGID] = { .name = "TPGID", .title = " TPGID ", .description = "Process ID of the fg process group of the controlling terminal", .flags = 0, },
+ [FLAGS] = { .name = "FLAGS", .title = NULL, .description = NULL, .flags = 0, },
+ [MINFLT] = { .name = "MINFLT", .title = " MINFLT ", .description = "Number of minor faults which have not required loading a memory page from disk", .flags = 0, },
+ [CMINFLT] = { .name = "CMINFLT", .title = " CMINFLT ", .description = "Children processes' minor faults", .flags = 0, },
+ [MAJFLT] = { .name = "MAJFLT", .title = " MAJFLT ", .description = "Number of major faults which have required loading a memory page from disk", .flags = 0, },
+ [CMAJFLT] = { .name = "CMAJFLT", .title = " CMAJFLT ", .description = "Children processes' major faults", .flags = 0, },
+ [UTIME] = { .name = "UTIME", .title = " UTIME+ ", .description = "User CPU time - time the process spent executing in user mode", .flags = 0, },
+ [STIME] = { .name = "STIME", .title = " STIME+ ", .description = "System CPU time - time the kernel spent running system calls for this process", .flags = 0, },
+ [CUTIME] = { .name = "CUTIME", .title = " CUTIME+ ", .description = "Children processes' user CPU time", .flags = 0, },
+ [CSTIME] = { .name = "CSTIME", .title = " CSTIME+ ", .description = "Children processes' system CPU time", .flags = 0, },
+ [PRIORITY] = { .name = "PRIORITY", .title = "PRI ", .description = "Kernel's internal priority for the process", .flags = 0, },
+ [NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, },
+ [ITREALVALUE] = { .name = "ITREALVALUE", .title = NULL, .description = NULL, .flags = 0, },
+ [STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, },
+ [VSIZE] = { .name = "VSIZE", .title = NULL, .description = NULL, .flags = 0, },
+ [RSS] = { .name = "RSS", .title = NULL, .description = NULL, .flags = 0, },
+ [RLIM] = { .name = "RLIM", .title = NULL, .description = NULL, .flags = 0, },
+ [STARTCODE] = { .name = "STARTCODE", .title = NULL, .description = NULL, .flags = 0, },
+ [ENDCODE] = { .name = "ENDCODE", .title = NULL, .description = NULL, .flags = 0, },
+ [STARTSTACK] = { .name = "STARTSTACK", .title = NULL, .description = NULL, .flags = 0, },
+ [KSTKESP] = { .name = "KSTKESP", .title = NULL, .description = NULL, .flags = 0, },
+ [KSTKEIP] = { .name = "KSTKEIP", .title = NULL, .description = NULL, .flags = 0, },
+ [SIGNAL] = { .name = "SIGNAL", .title = NULL, .description = NULL, .flags = 0, },
+ [BLOCKED] = { .name = "BLOCKED", .title = NULL, .description = NULL, .flags = 0, },
+ [SSIGIGNORE] = { .name = "SIGIGNORE", .title = NULL, .description = NULL, .flags = 0, },
+ [SIGCATCH] = { .name = "SIGCATCH", .title = NULL, .description = NULL, .flags = 0, },
+ [WCHAN] = { .name = "WCHAN", .title = NULL, .description = NULL, .flags = 0, },
+ [NSWAP] = { .name = "NSWAP", .title = NULL, .description = NULL, .flags = 0, },
+ [CNSWAP] = { .name = "CNSWAP", .title = NULL, .description = NULL, .flags = 0, },
+ [EXIT_SIGNAL] = { .name = "EXIT_SIGNAL", .title = NULL, .description = NULL, .flags = 0, },
+ [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, },
+ [M_SIZE] = { .name = "M_SIZE", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, },
+ [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, },
+ [M_SHARE] = { .name = "M_SHARE", .title = " SHR ", .description = "Size of the process's shared pages", .flags = 0, },
+ [M_TRS] = { .name = "M_TRS", .title = " CODE ", .description = "Size of the text segment of the process", .flags = 0, },
+ [M_DRS] = { .name = "M_DRS", .title = " DATA ", .description = "Size of the data segment plus stack usage of the process", .flags = 0, },
+ [M_LRS] = { .name = "M_LRS", .title = " LIB ", .description = "The library size of the process", .flags = 0, },
+ [M_DT] = { .name = "M_DT", .title = " DIRTY ", .description = "Size of the dirty pages of the process", .flags = 0, },
+ [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, },
+ [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, },
+ [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, },
+ [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, },
+ [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, },
+ [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, },
+ [TGID] = { .name = "TGID", .title = " TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, },
+#ifdef HAVE_OPENVZ
+ [CTID] = { .name = "CTID", .title = " CTID ", .description = "OpenVZ container ID (a.k.a. virtual environment ID)", .flags = PROCESS_FLAG_LINUX_OPENVZ, },
+ [VPID] = { .name = "VPID", .title = " VPID ", .description = "OpenVZ process ID", .flags = PROCESS_FLAG_LINUX_OPENVZ, },
+#endif
+#ifdef HAVE_VSERVER
+ [VXID] = { .name = "VXID", .title = " VXID ", .description = "VServer process ID", .flags = PROCESS_FLAG_LINUX_VSERVER, },
+#endif
+#ifdef HAVE_TASKSTATS
+ [RCHAR] = { .name = "RCHAR", .title = " RD_CHAR ", .description = "Number of bytes the process has read", .flags = PROCESS_FLAG_IO, },
+ [WCHAR] = { .name = "WCHAR", .title = " WR_CHAR ", .description = "Number of bytes the process has written", .flags = PROCESS_FLAG_IO, },
+ [SYSCR] = { .name = "SYSCR", .title = " RD_SYSC ", .description = "Number of read(2) syscalls for the process", .flags = PROCESS_FLAG_IO, },
+ [SYSCW] = { .name = "SYSCW", .title = " WR_SYSC ", .description = "Number of write(2) syscalls for the process", .flags = PROCESS_FLAG_IO, },
+ [RBYTES] = { .name = "RBYTES", .title = " IO_RBYTES ", .description = "Bytes of read(2) I/O for the process", .flags = PROCESS_FLAG_IO, },
+ [WBYTES] = { .name = "WBYTES", .title = " IO_WBYTES ", .description = "Bytes of write(2) I/O for the process", .flags = PROCESS_FLAG_IO, },
+ [CNCLWB] = { .name = "CNCLWB", .title = " IO_CANCEL ", .description = "Bytes of cancelled write(2) I/O", .flags = PROCESS_FLAG_IO, },
+ [IO_READ_RATE] = { .name = "IO_READ_RATE", .title = " DISK READ ", .description = "The I/O rate of read(2) in bytes per second for the process", .flags = PROCESS_FLAG_IO, },
+ [IO_WRITE_RATE] = { .name = "IO_WRITE_RATE", .title = " DISK WRITE ", .description = "The I/O rate of write(2) in bytes per second for the process", .flags = PROCESS_FLAG_IO, },
+ [IO_RATE] = { .name = "IO_RATE", .title = " DISK R/W ", .description = "Total I/O rate in bytes per second", .flags = PROCESS_FLAG_IO, },
+#endif
+#ifdef HAVE_CGROUP
+ [CGROUP] = { .name = "CGROUP", .title = " CGROUP ", .description = "Which cgroup the process is in", .flags = PROCESS_FLAG_LINUX_CGROUP, },
+#endif
+ [OOM] = { .name = "OOM", .title = " OOM ", .description = "OOM (Out-of-Memory) killer score", .flags = PROCESS_FLAG_LINUX_OOM, },
+ [IO_PRIORITY] = { .name = "IO_PRIORITY", .title = "IO ", .description = "I/O priority", .flags = PROCESS_FLAG_LINUX_IOPRIO, },
+ [LAST_PROCESSFIELD] = { .name = "*** report bug! ***", .title = NULL, .description = NULL, .flags = 0, },
+};
+
+ProcessPidColumn Process_pidColumns[] = {
+ { .id = PID, .label = "PID" },
+ { .id = PPID, .label = "PPID" },
+ #ifdef HAVE_OPENVZ
+ { .id = VPID, .label = "VPID" },
+ #endif
+ { .id = TPGID, .label = "TPGID" },
+ { .id = TGID, .label = "TGID" },
+ { .id = PGRP, .label = "PGRP" },
+ { .id = SESSION, .label = "SESN" },
+ { .id = OOM, .label = "OOM" },
+ { .id = 0, .label = NULL },
+};
+
+ProcessClass LinuxProcess_class = {
+ .super = {
+ .extends = Class(Process),
+ .display = Process_display,
+ .delete = Process_delete,
+ .compare = LinuxProcess_compare
+ },
+ .writeField = (Process_WriteField) LinuxProcess_writeField,
+};
+
+LinuxProcess* LinuxProcess_new(Settings* settings) {
+ LinuxProcess* this = xCalloc(1, sizeof(LinuxProcess));
+ Object_setClass(this, Class(LinuxProcess));
+ Process_init(&this->super, settings);
+ return this;
+}
+
+void Process_delete(Object* cast) {
+ LinuxProcess* this = (LinuxProcess*) cast;
+ Process_done((Process*)cast);
+#ifdef HAVE_CGROUP
+ free(this->cgroup);
+#endif
+ free(this);
+}
+
+/*
+[1] Note that before kernel 2.6.26 a process that has not asked for
+an io priority formally uses "none" as scheduling class, but the
+io scheduler will treat such processes as if it were in the best
+effort class. The priority within the best effort class will be
+dynamically derived from the cpu nice level of the process:
+io_priority = (cpu_nice + 20) / 5. -- From ionice(1) man page
+*/
+#define LinuxProcess_effectiveIOPriority(p_) (IOPriority_class(p_->ioPriority) == IOPRIO_CLASS_NONE ? IOPriority_tuple(IOPRIO_CLASS_BE, (p_->super.nice + 20) / 5) : p_->ioPriority)
+
+IOPriority LinuxProcess_updateIOPriority(LinuxProcess* this) {
+ IOPriority ioprio = syscall(SYS_ioprio_get, IOPRIO_WHO_PROCESS, this->super.pid);
+ this->ioPriority = ioprio;
+ return ioprio;
+}
+
+bool LinuxProcess_setIOPriority(LinuxProcess* this, IOPriority ioprio) {
+ syscall(SYS_ioprio_set, IOPRIO_WHO_PROCESS, this->super.pid, ioprio);
+ return (LinuxProcess_updateIOPriority(this) == ioprio);
+}
+
+void LinuxProcess_writeField(Process* this, RichString* str, ProcessField field) {
+ LinuxProcess* lp = (LinuxProcess*) this;
+ bool coloring = this->settings->highlightMegabytes;
+ char buffer[256]; buffer[255] = '\0';
+ int attr = CRT_colors[DEFAULT_COLOR];
+ int n = sizeof(buffer) - 1;
+ switch ((int)field) {
+ case CMINFLT: Process_colorNumber(str, lp->cminflt, coloring); return;
+ case CMAJFLT: Process_colorNumber(str, lp->cmajflt, coloring); return;
+ case M_DRS: Process_humanNumber(str, lp->m_drs * PAGE_SIZE_KB, coloring); return;
+ case M_DT: Process_humanNumber(str, lp->m_dt * PAGE_SIZE_KB, coloring); return;
+ case M_LRS: Process_humanNumber(str, lp->m_lrs * PAGE_SIZE_KB, coloring); return;
+ case M_TRS: Process_humanNumber(str, lp->m_trs * PAGE_SIZE_KB, coloring); return;
+ case M_SHARE: Process_humanNumber(str, lp->m_share * PAGE_SIZE_KB, coloring); return;
+ case UTIME: Process_printTime(str, lp->utime); return;
+ case STIME: Process_printTime(str, lp->stime); return;
+ case CUTIME: Process_printTime(str, lp->cutime); return;
+ case CSTIME: Process_printTime(str, lp->cstime); return;
+ #ifdef HAVE_TASKSTATS
+ case RCHAR: Process_colorNumber(str, lp->io_rchar, coloring); return;
+ case WCHAR: Process_colorNumber(str, lp->io_wchar, coloring); return;
+ case SYSCR: Process_colorNumber(str, lp->io_syscr, coloring); return;
+ case SYSCW: Process_colorNumber(str, lp->io_syscw, coloring); return;
+ case RBYTES: Process_colorNumber(str, lp->io_read_bytes, coloring); return;
+ case WBYTES: Process_colorNumber(str, lp->io_write_bytes, coloring); return;
+ case CNCLWB: Process_colorNumber(str, lp->io_cancelled_write_bytes, coloring); return;
+ case IO_READ_RATE: Process_outputRate(str, buffer, n, lp->io_rate_read_bps, coloring); return;
+ case IO_WRITE_RATE: Process_outputRate(str, buffer, n, lp->io_rate_write_bps, coloring); return;
+ case IO_RATE: Process_outputRate(str, buffer, n, lp->io_rate_read_bps + lp->io_rate_write_bps, coloring); return;
+ #endif
+ #ifdef HAVE_OPENVZ
+ case CTID: snprintf(buffer, n, "%7u ", lp->ctid); break;
+ case VPID: snprintf(buffer, n, Process_pidFormat, lp->vpid); break;
+ #endif
+ #ifdef HAVE_VSERVER
+ case VXID: snprintf(buffer, n, "%5u ", lp->vxid); break;
+ #endif
+ #ifdef HAVE_CGROUP
+ case CGROUP: snprintf(buffer, n, "%-10s ", lp->cgroup); break;
+ #endif
+ case OOM: snprintf(buffer, n, Process_pidFormat, lp->oom); break;
+ case IO_PRIORITY: {
+ int klass = IOPriority_class(lp->ioPriority);
+ if (klass == IOPRIO_CLASS_NONE) {
+ // see note [1] above
+ snprintf(buffer, n, "B%1d ", (int) (this->nice + 20) / 5);
+ } else if (klass == IOPRIO_CLASS_BE) {
+ snprintf(buffer, n, "B%1d ", IOPriority_data(lp->ioPriority));
+ } else if (klass == IOPRIO_CLASS_RT) {
+ attr = CRT_colors[PROCESS_HIGH_PRIORITY];
+ snprintf(buffer, n, "R%1d ", IOPriority_data(lp->ioPriority));
+ } else if (lp->ioPriority == IOPriority_Idle) {
+ attr = CRT_colors[PROCESS_LOW_PRIORITY];
+ snprintf(buffer, n, "id ");
+ } else {
+ snprintf(buffer, n, "?? ");
+ }
+ break;
+ }
+ default:
+ Process_writeField((Process*)this, str, field);
+ return;
+ }
+ RichString_append(str, attr, buffer);
+}
+
+long LinuxProcess_compare(const void* v1, const void* v2) {
+ LinuxProcess *p1, *p2;
+ Settings *settings = ((Process*)v1)->settings;
+ if (settings->direction == 1) {
+ p1 = (LinuxProcess*)v1;
+ p2 = (LinuxProcess*)v2;
+ } else {
+ p2 = (LinuxProcess*)v1;
+ p1 = (LinuxProcess*)v2;
+ }
+ long long diff;
+ switch ((int)settings->sortKey) {
+ case M_DRS:
+ return (p2->m_drs - p1->m_drs);
+ case M_DT:
+ return (p2->m_dt - p1->m_dt);
+ case M_LRS:
+ return (p2->m_lrs - p1->m_lrs);
+ case M_TRS:
+ return (p2->m_trs - p1->m_trs);
+ case M_SHARE:
+ return (p2->m_share - p1->m_share);
+ case UTIME: diff = p2->utime - p1->utime; goto test_diff;
+ case CUTIME: diff = p2->cutime - p1->cutime; goto test_diff;
+ case STIME: diff = p2->stime - p1->stime; goto test_diff;
+ case CSTIME: diff = p2->cstime - p1->cstime; goto test_diff;
+ #ifdef HAVE_TASKSTATS
+ case RCHAR: diff = p2->io_rchar - p1->io_rchar; goto test_diff;
+ case WCHAR: diff = p2->io_wchar - p1->io_wchar; goto test_diff;
+ case SYSCR: diff = p2->io_syscr - p1->io_syscr; goto test_diff;
+ case SYSCW: diff = p2->io_syscw - p1->io_syscw; goto test_diff;
+ case RBYTES: diff = p2->io_read_bytes - p1->io_read_bytes; goto test_diff;
+ case WBYTES: diff = p2->io_write_bytes - p1->io_write_bytes; goto test_diff;
+ case CNCLWB: diff = p2->io_cancelled_write_bytes - p1->io_cancelled_write_bytes; goto test_diff;
+ case IO_READ_RATE: diff = p2->io_rate_read_bps - p1->io_rate_read_bps; goto test_diff;
+ case IO_WRITE_RATE: diff = p2->io_rate_write_bps - p1->io_rate_write_bps; goto test_diff;
+ case IO_RATE: diff = (p2->io_rate_read_bps + p2->io_rate_write_bps) - (p1->io_rate_read_bps + p1->io_rate_write_bps); goto test_diff;
+ #endif
+ #ifdef HAVE_OPENVZ
+ case CTID:
+ return (p2->ctid - p1->ctid);
+ case VPID:
+ return (p2->vpid - p1->vpid);
+ #endif
+ #ifdef HAVE_VSERVER
+ case VXID:
+ return (p2->vxid - p1->vxid);
+ #endif
+ #ifdef HAVE_CGROUP
+ case CGROUP:
+ return strcmp(p1->cgroup ? p1->cgroup : "", p2->cgroup ? p2->cgroup : "");
+ #endif
+ case OOM:
+ return (p2->oom - p1->oom);
+ case IO_PRIORITY:
+ return LinuxProcess_effectiveIOPriority(p1) - LinuxProcess_effectiveIOPriority(p2);
+ default:
+ return Process_compare(v1, v2);
+ }
+ test_diff:
+ return (diff > 0) ? 1 : (diff < 0 ? -1 : 0);
+}
+
+bool Process_isThread(Process* this) {
+ return (Process_isUserlandThread(this) || Process_isKernelThread(this));
+}
+
diff --git a/linux/LinuxProcess.h b/linux/LinuxProcess.h
new file mode 100644
index 0000000..f2d81aa
--- /dev/null
+++ b/linux/LinuxProcess.h
@@ -0,0 +1,161 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_LinuxProcess
+#define HEADER_LinuxProcess
+/*
+htop - LinuxProcess.h
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+
+#define PROCESS_FLAG_LINUX_IOPRIO 0x0100
+#define PROCESS_FLAG_LINUX_OPENVZ 0x0200
+#define PROCESS_FLAG_LINUX_VSERVER 0x0400
+#define PROCESS_FLAG_LINUX_CGROUP 0x0800
+#define PROCESS_FLAG_LINUX_OOM 0x1000
+
+typedef enum UnsupportedProcessFields {
+ FLAGS = 9,
+ ITREALVALUE = 20,
+ VSIZE = 22,
+ RSS = 23,
+ RLIM = 24,
+ STARTCODE = 25,
+ ENDCODE = 26,
+ STARTSTACK = 27,
+ KSTKESP = 28,
+ KSTKEIP = 29,
+ SIGNAL = 30,
+ BLOCKED = 31,
+ SSIGIGNORE = 32,
+ SIGCATCH = 33,
+ WCHAN = 34,
+ NSWAP = 35,
+ CNSWAP = 36,
+ EXIT_SIGNAL = 37,
+} UnsupportedProcessField;
+
+typedef enum LinuxProcessFields {
+ CMINFLT = 11,
+ CMAJFLT = 13,
+ UTIME = 14,
+ STIME = 15,
+ CUTIME = 16,
+ CSTIME = 17,
+ M_SHARE = 41,
+ M_TRS = 42,
+ M_DRS = 43,
+ M_LRS = 44,
+ M_DT = 45,
+ #ifdef HAVE_OPENVZ
+ CTID = 100,
+ VPID = 101,
+ #endif
+ #ifdef HAVE_VSERVER
+ VXID = 102,
+ #endif
+ #ifdef HAVE_TASKSTATS
+ RCHAR = 103,
+ WCHAR = 104,
+ SYSCR = 105,
+ SYSCW = 106,
+ RBYTES = 107,
+ WBYTES = 108,
+ CNCLWB = 109,
+ IO_READ_RATE = 110,
+ IO_WRITE_RATE = 111,
+ IO_RATE = 112,
+ #endif
+ #ifdef HAVE_CGROUP
+ CGROUP = 113,
+ #endif
+ OOM = 114,
+ IO_PRIORITY = 115,
+ LAST_PROCESSFIELD = 116,
+} LinuxProcessField;
+
+#include "IOPriority.h"
+
+typedef struct LinuxProcess_ {
+ Process super;
+ IOPriority ioPriority;
+ unsigned long int cminflt;
+ unsigned long int cmajflt;
+ unsigned long long int utime;
+ unsigned long long int stime;
+ unsigned long long int cutime;
+ unsigned long long int cstime;
+ long m_share;
+ long m_trs;
+ long m_drs;
+ long m_lrs;
+ long m_dt;
+ #ifdef HAVE_TASKSTATS
+ unsigned long long io_rchar;
+ unsigned long long io_wchar;
+ unsigned long long io_syscr;
+ unsigned long long io_syscw;
+ unsigned long long io_read_bytes;
+ unsigned long long io_write_bytes;
+ unsigned long long io_cancelled_write_bytes;
+ unsigned long long io_rate_read_time;
+ unsigned long long io_rate_write_time;
+ double io_rate_read_bps;
+ double io_rate_write_bps;
+ #endif
+ #ifdef HAVE_OPENVZ
+ unsigned int ctid;
+ unsigned int vpid;
+ #endif
+ #ifdef HAVE_VSERVER
+ unsigned int vxid;
+ #endif
+ #ifdef HAVE_CGROUP
+ char* cgroup;
+ #endif
+ unsigned int oom;
+} LinuxProcess;
+
+#ifndef Process_isKernelThread
+#define Process_isKernelThread(_process) (_process->pgrp == 0)
+#endif
+
+#ifndef Process_isUserlandThread
+#define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
+#endif
+
+
+extern ProcessFieldData Process_fields[];
+
+extern ProcessPidColumn Process_pidColumns[];
+
+extern ProcessClass LinuxProcess_class;
+
+LinuxProcess* LinuxProcess_new(Settings* settings);
+
+void Process_delete(Object* cast);
+
+/*
+[1] Note that before kernel 2.6.26 a process that has not asked for
+an io priority formally uses "none" as scheduling class, but the
+io scheduler will treat such processes as if it were in the best
+effort class. The priority within the best effort class will be
+dynamically derived from the cpu nice level of the process:
+extern io_priority;
+*/
+#define LinuxProcess_effectiveIOPriority(p_) (IOPriority_class(p_->ioPriority) == IOPRIO_CLASS_NONE ? IOPriority_tuple(IOPRIO_CLASS_BE, (p_->super.nice + 20) / 5) : p_->ioPriority)
+
+IOPriority LinuxProcess_updateIOPriority(LinuxProcess* this);
+
+bool LinuxProcess_setIOPriority(LinuxProcess* this, IOPriority ioprio);
+
+void LinuxProcess_writeField(Process* this, RichString* str, ProcessField field);
+
+long LinuxProcess_compare(const void* v1, const void* v2);
+
+bool Process_isThread(Process* this);
+
+
+#endif
diff --git a/linux/LinuxProcessList.c b/linux/LinuxProcessList.c
new file mode 100644
index 0000000..591210e
--- /dev/null
+++ b/linux/LinuxProcessList.c
@@ -0,0 +1,775 @@
+/*
+htop - LinuxProcessList.c
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "LinuxProcessList.h"
+#include "LinuxProcess.h"
+#include "CRT.h"
+#include "StringUtils.h"
+#include <errno.h>
+#include <sys/time.h>
+#include <sys/utsname.h>
+#include <sys/stat.h>
+#include <unistd.h>
+#include <dirent.h>
+#include <stdlib.h>
+#include <stdio.h>
+#include <signal.h>
+#include <stdbool.h>
+#include <stdarg.h>
+#include <math.h>
+#include <string.h>
+#include <time.h>
+#include <assert.h>
+#include <sys/types.h>
+#include <fcntl.h>
+
+/*{
+
+#include "ProcessList.h"
+
+typedef struct CPUData_ {
+ unsigned long long int totalTime;
+ unsigned long long int userTime;
+ unsigned long long int systemTime;
+ unsigned long long int systemAllTime;
+ unsigned long long int idleAllTime;
+ unsigned long long int idleTime;
+ unsigned long long int niceTime;
+ unsigned long long int ioWaitTime;
+ unsigned long long int irqTime;
+ unsigned long long int softIrqTime;
+ unsigned long long int stealTime;
+ unsigned long long int guestTime;
+
+ unsigned long long int totalPeriod;
+ unsigned long long int userPeriod;
+ unsigned long long int systemPeriod;
+ unsigned long long int systemAllPeriod;
+ unsigned long long int idleAllPeriod;
+ unsigned long long int idlePeriod;
+ unsigned long long int nicePeriod;
+ unsigned long long int ioWaitPeriod;
+ unsigned long long int irqPeriod;
+ unsigned long long int softIrqPeriod;
+ unsigned long long int stealPeriod;
+ unsigned long long int guestPeriod;
+} CPUData;
+
+typedef struct LinuxProcessList_ {
+ ProcessList super;
+
+ CPUData* cpus;
+
+} LinuxProcessList;
+
+#ifndef PROCDIR
+#define PROCDIR "/proc"
+#endif
+
+#ifndef PROCSTATFILE
+#define PROCSTATFILE PROCDIR "/stat"
+#endif
+
+#ifndef PROCMEMINFOFILE
+#define PROCMEMINFOFILE PROCDIR "/meminfo"
+#endif
+
+#ifndef PROC_LINE_LENGTH
+#define PROC_LINE_LENGTH 512
+#endif
+
+}*/
+
+#ifndef CLAMP
+#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
+#endif
+
+ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) {
+ LinuxProcessList* this = xCalloc(1, sizeof(LinuxProcessList));
+ ProcessList* pl = &(this->super);
+ ProcessList_init(pl, Class(LinuxProcess), usersTable, pidWhiteList, userId);
+
+ // Update CPU count:
+ FILE* file = fopen(PROCSTATFILE, "r");
+ if (file == NULL) {
+ CRT_fatalError("Cannot open " PROCSTATFILE);
+ }
+ char buffer[PROC_LINE_LENGTH + 1];
+ int cpus = -1;
+ do {
+ cpus++;
+ char * s = fgets(buffer, PROC_LINE_LENGTH, file);
+ (void) s;
+ } while (String_startsWith(buffer, "cpu"));
+ fclose(file);
+
+ pl->cpuCount = MAX(cpus - 1, 1);
+ this->cpus = xCalloc(cpus, sizeof(CPUData));
+
+ for (int i = 0; i < cpus; i++) {
+ this->cpus[i].totalTime = 1;
+ this->cpus[i].totalPeriod = 1;
+ }
+
+ return pl;
+}
+
+void ProcessList_delete(ProcessList* pl) {
+ LinuxProcessList* this = (LinuxProcessList*) pl;
+ ProcessList_done(pl);
+ free(this->cpus);
+ free(this);
+}
+
+static ssize_t xread(int fd, void *buf, size_t count) {
+ // Read some bytes. Retry on EINTR and when we don't get as many bytes as we requested.
+ size_t alreadyRead = 0;
+ for(;;) {
+ ssize_t res = read(fd, buf, count);
+ if (res == -1 && errno == EINTR) continue;
+ if (res > 0) {
+ buf = ((char*)buf)+res;
+ count -= res;
+ alreadyRead += res;
+ }
+ if (res == -1) return -1;
+ if (count == 0 || res == 0) return alreadyRead;
+ }
+}
+
+static double jiffy = 0.0;
+
+static inline unsigned long long LinuxProcess_adjustTime(unsigned long long t) {
+ if(jiffy == 0.0) jiffy = sysconf(_SC_CLK_TCK);
+ double jiffytime = 1.0 / jiffy;
+ return (unsigned long long) t * jiffytime * 100;
+}
+
+static bool LinuxProcessList_readStatFile(Process *process, const char* dirname, const char* name, char* command, int* commLen) {
+ LinuxProcess* lp = (LinuxProcess*) process;
+ char filename[MAX_NAME+1];
+ snprintf(filename, MAX_NAME, "%s/%s/stat", dirname, name);
+ int fd = open(filename, O_RDONLY);
+ if (fd == -1)
+ return false;
+
+ static char buf[MAX_READ+1];
+
+ int size = xread(fd, buf, MAX_READ);
+ close(fd);
+ if (size <= 0) return false;
+ buf[size] = '\0';
+
+ assert(process->pid == atoi(buf));
+ char *location = strchr(buf, ' ');
+ if (!location) return false;
+
+ location += 2;
+ char *end = strrchr(location, ')');
+ if (!end) return false;
+
+ int commsize = end - location;
+ memcpy(command, location, commsize);
+ command[commsize] = '\0';
+ *commLen = commsize;
+ location = end + 2;
+
+ process->state = location[0];
+ location += 2;
+ process->ppid = strtol(location, &location, 10);
+ location += 1;
+ process->pgrp = strtoul(location, &location, 10);
+ location += 1;
+ process->session = strtoul(location, &location, 10);
+ location += 1;
+ process->tty_nr = strtoul(location, &location, 10);
+ location += 1;
+ process->tpgid = strtol(location, &location, 10);
+ location += 1;
+ process->flags = strtoul(location, &location, 10);
+ location += 1;
+ process->minflt = strtoull(location, &location, 10);
+ location += 1;
+ lp->cminflt = strtoull(location, &location, 10);
+ location += 1;
+ process->majflt = strtoull(location, &location, 10);
+ location += 1;
+ lp->cmajflt = strtoull(location, &location, 10);
+ location += 1;
+ lp->utime = LinuxProcess_adjustTime(strtoull(location, &location, 10));
+ location += 1;
+ lp->stime = LinuxProcess_adjustTime(strtoull(location, &location, 10));
+ location += 1;
+ lp->cutime = LinuxProcess_adjustTime(strtoull(location, &location, 10));
+ location += 1;
+ lp->cstime = LinuxProcess_adjustTime(strtoull(location, &location, 10));
+ location += 1;
+ process->priority = strtol(location, &location, 10);
+ location += 1;
+ process->nice = strtol(location, &location, 10);
+ location += 1;
+ process->nlwp = strtol(location, &location, 10);
+ location += 1;
+ for (int i=0; i<17; i++) location = strchr(location, ' ')+1;
+ process->exit_signal = strtol(location, &location, 10);
+ location += 1;
+ assert(location != NULL);
+ process->processor = strtol(location, &location, 10);
+
+ process->time = lp->utime + lp->stime;
+
+ return true;
+}
+
+
+static bool LinuxProcessList_statProcessDir(Process* process, const char* dirname, char* name, time_t curTime) {
+ char filename[MAX_NAME+1];
+ filename[MAX_NAME] = '\0';
+
+ snprintf(filename, MAX_NAME, "%s/%s", dirname, name);
+ struct stat sstat;
+ int statok = stat(filename, &sstat);
+ if (statok == -1)
+ return false;
+ process->st_uid = sstat.st_uid;
+
+ struct tm date;
+ time_t ctime = sstat.st_ctime;
+ process->starttime_ctime = ctime;
+ (void) localtime_r((time_t*) &ctime, &date);
+ strftime(process->starttime_show, 7, ((ctime > curTime - 86400) ? "%R " : "%b%d "), &date);
+
+ return true;
+}
+
+#ifdef HAVE_TASKSTATS
+
+static void LinuxProcessList_readIoFile(LinuxProcess* process, const char* dirname, char* name, unsigned long long now) {
+ char filename[MAX_NAME+1];
+ filename[MAX_NAME] = '\0';
+
+ snprintf(filename, MAX_NAME, "%s/%s/io", dirname, name);
+ int fd = open(filename, O_RDONLY);
+ if (fd == -1) {
+ process->io_rate_read_bps = -1;
+ process->io_rate_write_bps = -1;
+ return;
+ }
+
+ char buffer[1024];
+ ssize_t buflen = xread(fd, buffer, 1023);
+ close(fd);
+ if (buflen < 1) return;
+ buffer[buflen] = '\0';
+ unsigned long long last_read = process->io_read_bytes;
+ unsigned long long last_write = process->io_write_bytes;
+ char *buf = buffer;
+ char *line = NULL;
+ while ((line = strsep(&buf, "\n")) != NULL) {
+ switch (line[0]) {
+ case 'r':
+ if (line[1] == 'c' && strncmp(line+2, "har: ", 5) == 0)
+ process->io_rchar = strtoull(line+7, NULL, 10);
+ else if (strncmp(line+1, "ead_bytes: ", 11) == 0) {
+ process->io_read_bytes = strtoull(line+12, NULL, 10);
+ process->io_rate_read_bps =
+ ((double)(process->io_read_bytes - last_read))/(((double)(now - process->io_rate_read_time))/1000);
+ process->io_rate_read_time = now;
+ }
+ break;
+ case 'w':
+ if (line[1] == 'c' && strncmp(line+2, "har: ", 5) == 0)
+ process->io_wchar = strtoull(line+7, NULL, 10);
+ else if (strncmp(line+1, "rite_bytes: ", 12) == 0) {
+ process->io_write_bytes = strtoull(line+13, NULL, 10);
+ process->io_rate_write_bps =
+ ((double)(process->io_write_bytes - last_write))/(((double)(now - process->io_rate_write_time))/1000);
+ process->io_rate_write_time = now;
+ }
+ break;
+ case 's':
+ if (line[5] == 'r' && strncmp(line+1, "yscr: ", 6) == 0)
+ process->io_syscr = strtoull(line+7, NULL, 10);
+ else if (strncmp(line+1, "yscw: ", 6) == 0)
+ sscanf(line, "syscw: %32llu", &process->io_syscw);
+ process->io_syscw = strtoull(line+7, NULL, 10);
+ break;
+ case 'c':
+ if (strncmp(line+1, "ancelled_write_bytes: ", 22) == 0)
+ process->io_cancelled_write_bytes = strtoull(line+23, NULL, 10);
+ }
+ }
+}
+
+#endif
+
+
+
+static bool LinuxProcessList_readStatmFile(LinuxProcess* process, const char* dirname, const char* name) {
+ char filename[MAX_NAME+1];
+ snprintf(filename, MAX_NAME, "%s/%s/statm", dirname, name);
+ int fd = open(filename, O_RDONLY);
+ if (fd == -1)
+ return false;
+ char buf[PROC_LINE_LENGTH + 1];
+ ssize_t rres = xread(fd, buf, PROC_LINE_LENGTH);
+ close(fd);
+ if (rres < 1) return false;
+
+ char *p = buf;
+ errno = 0;
+ process->super.m_size = strtol(p, &p, 10); if (*p == ' ') p++;
+ process->super.m_resident = strtol(p, &p, 10); if (*p == ' ') p++;
+ process->m_share = strtol(p, &p, 10); if (*p == ' ') p++;
+ process->m_trs = strtol(p, &p, 10); if (*p == ' ') p++;
+ process->m_lrs = strtol(p, &p, 10); if (*p == ' ') p++;
+ process->m_drs = strtol(p, &p, 10); if (*p == ' ') p++;
+ process->m_dt = strtol(p, &p, 10);
+ return (errno == 0);
+}
+
+#ifdef HAVE_OPENVZ
+
+static void LinuxProcessList_readOpenVZData(LinuxProcess* process, const char* dirname, const char* name) {
+ if ( (access("/proc/vz", R_OK) != 0)) {
+ process->vpid = process->super.pid;
+ process->ctid = 0;
+ return;
+ }
+ char filename[MAX_NAME+1];
+ snprintf(filename, MAX_NAME, "%s/%s/stat", dirname, name);
+ FILE* file = fopen(filename, "r");
+ if (!file)
+ return;
+ (void) fscanf(file,
+ "%*32u %*32s %*1c %*32u %*32u %*32u %*32u %*32u %*32u %*32u "
+ "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u "
+ "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u "
+ "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u "
+ "%*32u %*32u %*32u %*32u %*32u %*32u %*32u %*32u "
+ "%*32u %*32u %*32u %*32u %*32u %*32u %*32u "
+ "%*32u %*32u %32u %32u",
+ &process->vpid, &process->ctid);
+ fclose(file);
+ return;
+}
+
+#endif
+
+#ifdef HAVE_CGROUP
+
+static void LinuxProcessList_readCGroupFile(LinuxProcess* process, const char* dirname, const char* name) {
+ char filename[MAX_NAME+1];
+ snprintf(filename, MAX_NAME, "%s/%s/cgroup", dirname, name);
+ FILE* file = fopen(filename, "r");
+ if (!file) {
+ process->cgroup = xStrdup("");
+ return;
+ }
+ char output[PROC_LINE_LENGTH + 1];
+ output[0] = '\0';
+ char* at = output;
+ int left = PROC_LINE_LENGTH;
+ while (!feof(file) && left > 0) {
+ char buffer[PROC_LINE_LENGTH + 1];
+ char *ok = fgets(buffer, PROC_LINE_LENGTH, file);
+ if (!ok) break;
+ char* group = strchr(buffer, ':');
+ if (!group) break;
+ if (at != output) {
+ *at = ';';
+ at++;
+ left--;
+ }
+ int wrote = snprintf(at, left, "%s", group);
+ left -= wrote;
+ }
+ fclose(file);
+ free(process->cgroup);
+ process->cgroup = xStrdup(output);
+}
+
+#endif
+
+#ifdef HAVE_VSERVER
+
+static void LinuxProcessList_readVServerData(LinuxProcess* process, const char* dirname, const char* name) {
+ char filename[MAX_NAME+1];
+ snprintf(filename, MAX_NAME, "%s/%s/status", dirname, name);
+ FILE* file = fopen(filename, "r");
+ if (!file)
+ return;
+ char buffer[PROC_LINE_LENGTH + 1];
+ process->vxid = 0;
+ while (fgets(buffer, PROC_LINE_LENGTH, file)) {
+ if (String_startsWith(buffer, "VxID:")) {
+ int vxid;
+ int ok = sscanf(buffer, "VxID:\t%32d", &vxid);
+ if (ok >= 1) {
+ process->vxid = vxid;
+ }
+ }
+ #if defined HAVE_ANCIENT_VSERVER
+ else if (String_startsWith(buffer, "s_context:")) {
+ int vxid;
+ int ok = sscanf(buffer, "s_context:\t%32d", &vxid);
+ if (ok >= 1) {
+ process->vxid = vxid;
+ }
+ }
+ #endif
+ }
+ fclose(file);
+}
+
+#endif
+
+static void LinuxProcessList_readOomData(LinuxProcess* process, const char* dirname, const char* name) {
+ char filename[MAX_NAME+1];
+ snprintf(filename, MAX_NAME, "%s/%s/oom_score", dirname, name);
+ FILE* file = fopen(filename, "r");
+ if (!file)
+ return;
+ char buffer[PROC_LINE_LENGTH + 1];
+ if (fgets(buffer, PROC_LINE_LENGTH, file)) {
+ unsigned int oom;
+ int ok = sscanf(buffer, "%32u", &oom);
+ if (ok >= 1) {
+ process->oom = oom;
+ }
+ }
+ fclose(file);
+}
+
+static void setCommand(Process* process, const char* command, int len) {
+ if (process->comm && process->commLen <= len) {
+ strncpy(process->comm, command, len + 1);
+ } else {
+ free(process->comm);
+ process->comm = xStrdup(command);
+ }
+ process->commLen = len;
+}
+
+static bool LinuxProcessList_readCmdlineFile(Process* process, const char* dirname, const char* name) {
+ if (Process_isKernelThread(process))
+ return true;
+
+ char filename[MAX_NAME+1];
+ snprintf(filename, MAX_NAME, "%s/%s/cmdline", dirname, name);
+ int fd = open(filename, O_RDONLY);
+ if (fd == -1)
+ return false;
+
+ char command[4096+1]; // max cmdline length on Linux
+ int amtRead = xread(fd, command, sizeof(command) - 1);
+ close(fd);
+ int tokenEnd = 0;
+ if (amtRead > 0) {
+ for (int i = 0; i < amtRead; i++)
+ if (command[i] == '\0' || command[i] == '\n') {
+ if (tokenEnd == 0) {
+ tokenEnd = i;
+ }
+ command[i] = ' ';
+ }
+ }
+ if (tokenEnd == 0) {
+ tokenEnd = amtRead;
+ }
+ command[amtRead] = '\0';
+ process->basenameOffset = tokenEnd;
+ setCommand(process, command, amtRead);
+
+ return true;
+}
+
+static bool LinuxProcessList_recurseProcTree(LinuxProcessList* this, const char* dirname, Process* parent, double period, struct timeval tv) {
+ ProcessList* pl = (ProcessList*) this;
+ DIR* dir;
+ struct dirent* entry;
+ Settings* settings = pl->settings;
+
+ time_t curTime = tv.tv_sec;
+ #ifdef HAVE_TASKSTATS
+ unsigned long long now = tv.tv_sec*1000LL+tv.tv_usec/1000LL;
+ #endif
+
+ dir = opendir(dirname);
+ if (!dir) return false;
+ int cpus = pl->cpuCount;
+ bool hideKernelThreads = settings->hideKernelThreads;
+ bool hideUserlandThreads = settings->hideUserlandThreads;
+ while ((entry = readdir(dir)) != NULL) {
+ char* name = entry->d_name;
+
+ // The RedHat kernel hides threads with a dot.
+ // I believe this is non-standard.
+ if ((!settings->hideThreads) && name[0] == '.') {
+ name++;
+ }
+
+ // Just skip all non-number directories.
+ if (name[0] < '0' || name[0] > '9') {
+ continue;
+ }
+
+ // filename is a number: process directory
+ int pid = atoi(name);
+
+ if (parent && pid == parent->pid)
+ continue;
+
+ if (pid <= 0)
+ continue;
+
+ bool preExisting = false;
+ Process* proc = ProcessList_getProcess(pl, pid, &preExisting, (Process_New) LinuxProcess_new);
+ proc->tgid = parent ? parent->pid : pid;
+
+ LinuxProcess* lp = (LinuxProcess*) proc;
+
+ char subdirname[MAX_NAME+1];
+ snprintf(subdirname, MAX_NAME, "%s/%s/task", dirname, name);
+ LinuxProcessList_recurseProcTree(this, subdirname, proc, period, tv);
+
+ #ifdef HAVE_TASKSTATS
+ if (settings->flags & PROCESS_FLAG_IO)
+ LinuxProcessList_readIoFile(lp, dirname, name, now);
+ #endif
+
+ if (! LinuxProcessList_readStatmFile(lp, dirname, name))
+ goto errorReadingProcess;
+
+ proc->show = ! ((hideKernelThreads && Process_isKernelThread(proc)) || (hideUserlandThreads && Process_isUserlandThread(proc)));
+
+ char command[MAX_NAME+1];
+ unsigned long long int lasttimes = (lp->utime + lp->stime);
+ int commLen = 0;
+ if (! LinuxProcessList_readStatFile(proc, dirname, name, command, &commLen))
+ goto errorReadingProcess;
+ if (settings->flags & PROCESS_FLAG_LINUX_IOPRIO)
+ LinuxProcess_updateIOPriority(lp);
+ float percent_cpu = (lp->utime + lp->stime - lasttimes) / period * 100.0;
+ proc->percent_cpu = CLAMP(percent_cpu, 0.0, cpus * 100.0);
+ if (isnan(proc->percent_cpu)) proc->percent_cpu = 0.0;
+ proc->percent_mem = (proc->m_resident * PAGE_SIZE_KB) / (double)(pl->totalMem) * 100.0;
+
+ if(!preExisting) {
+
+ if (! LinuxProcessList_statProcessDir(proc, dirname, name, curTime))
+ goto errorReadingProcess;
+
+ proc->user = UsersTable_getRef(pl->usersTable, proc->st_uid);
+
+ #ifdef HAVE_OPENVZ
+ if (settings->flags & PROCESS_FLAG_LINUX_OPENVZ) {
+ LinuxProcessList_readOpenVZData(lp, dirname, name);
+ }
+ #endif
+
+ #ifdef HAVE_VSERVER
+ if (settings->flags & PROCESS_FLAG_LINUX_VSERVER) {
+ LinuxProcessList_readVServerData(lp, dirname, name);
+ }
+ #endif
+
+ if (! LinuxProcessList_readCmdlineFile(proc, dirname, name)) {
+ goto errorReadingProcess;
+ }
+
+ ProcessList_add(pl, proc);
+ } else {
+ if (settings->updateProcessNames) {
+ if (! LinuxProcessList_readCmdlineFile(proc, dirname, name)) {
+ goto errorReadingProcess;
+ }
+ }
+ }
+
+ #ifdef HAVE_CGROUP
+ if (settings->flags & PROCESS_FLAG_LINUX_CGROUP)
+ LinuxProcessList_readCGroupFile(lp, dirname, name);
+ #endif
+
+ if (settings->flags & PROCESS_FLAG_LINUX_OOM)
+ LinuxProcessList_readOomData(lp, dirname, name);
+
+ if (proc->state == 'Z') {
+ proc->basenameOffset = -1;
+ setCommand(proc, command, commLen);
+ } else if (Process_isThread(proc)) {
+ if (settings->showThreadNames || Process_isKernelThread(proc) || proc->state == 'Z') {
+ proc->basenameOffset = -1;
+ setCommand(proc, command, commLen);
+ } else if (settings->showThreadNames) {
+ if (! LinuxProcessList_readCmdlineFile(proc, dirname, name))
+ goto errorReadingProcess;
+ }
+ if (Process_isKernelThread(proc)) {
+ pl->kernelThreads++;
+ } else {
+ pl->userlandThreads++;
+ }
+ }
+
+ pl->totalTasks++;
+ if (proc->state == 'R')
+ pl->runningTasks++;
+ proc->updated = true;
+ continue;
+
+ // Exception handler.
+ errorReadingProcess: {
+ if (preExisting) {
+ ProcessList_remove(pl, proc);
+ } else {
+ Process_delete((Object*)proc);
+ }
+ }
+ }
+ closedir(dir);
+ return true;
+}
+
+static inline void LinuxProcessList_scanMemoryInfo(ProcessList* this) {
+ unsigned long long int swapFree = 0;
+ unsigned long long int shmem = 0;
+ unsigned long long int sreclaimable = 0;
+
+ FILE* file = fopen(PROCMEMINFOFILE, "r");
+ if (file == NULL) {
+ CRT_fatalError("Cannot open " PROCMEMINFOFILE);
+ }
+ char buffer[128];
+ while (fgets(buffer, 128, file)) {
+
+ #define tryRead(label, variable) (String_startsWith(buffer, label) && sscanf(buffer + strlen(label), " %32llu kB", variable))
+ switch (buffer[0]) {
+ case 'M':
+ if (tryRead("MemTotal:", &this->totalMem)) {}
+ else if (tryRead("MemFree:", &this->freeMem)) {}
+ else if (tryRead("MemShared:", &this->sharedMem)) {}
+ break;
+ case 'B':
+ if (tryRead("Buffers:", &this->buffersMem)) {}
+ break;
+ case 'C':
+ if (tryRead("Cached:", &this->cachedMem)) {}
+ break;
+ case 'S':
+ switch (buffer[1]) {
+ case 'w':
+ if (tryRead("SwapTotal:", &this->totalSwap)) {}
+ else if (tryRead("SwapFree:", &swapFree)) {}
+ break;
+ case 'h':
+ if (tryRead("Shmem:", &shmem)) {}
+ break;
+ case 'R':
+ if (tryRead("SReclaimable:", &sreclaimable)) {}
+ break;
+ }
+ break;
+ }
+ #undef tryRead
+ }
+
+ this->usedMem = this->totalMem - this->freeMem;
+ this->cachedMem = this->cachedMem + sreclaimable - shmem;
+ this->usedSwap = this->totalSwap - swapFree;
+ fclose(file);
+}
+
+static inline double LinuxProcessList_scanCPUTime(LinuxProcessList* this) {
+
+ FILE* file = fopen(PROCSTATFILE, "r");
+ if (file == NULL) {
+ CRT_fatalError("Cannot open " PROCSTATFILE);
+ }
+ int cpus = this->super.cpuCount;
+ assert(cpus > 0);
+ for (int i = 0; i <= cpus; i++) {
+ char buffer[PROC_LINE_LENGTH + 1];
+ unsigned long long int usertime, nicetime, systemtime, idletime;
+ unsigned long long int ioWait, irq, softIrq, steal, guest, guestnice;
+ ioWait = irq = softIrq = steal = guest = guestnice = 0;
+ // Depending on your kernel version,
+ // 5, 7, 8 or 9 of these fields will be set.
+ // The rest will remain at zero.
+ char* ok = fgets(buffer, PROC_LINE_LENGTH, file);
+ if (!ok) buffer[0] = '\0';
+ if (i == 0)
+ sscanf(buffer, "cpu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu", &usertime, &nicetime, &systemtime, &idletime, &ioWait, &irq, &softIrq, &steal, &guest, &guestnice);
+ else {
+ int cpuid;
+ sscanf(buffer, "cpu%4d %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu %16llu", &cpuid, &usertime, &nicetime, &systemtime, &idletime, &ioWait, &irq, &softIrq, &steal, &guest, &guestnice);
+ assert(cpuid == i - 1);
+ }
+ // Guest time is already accounted in usertime
+ usertime = usertime - guest;
+ nicetime = nicetime - guestnice;
+ // Fields existing on kernels >= 2.6
+ // (and RHEL's patched kernel 2.4...)
+ unsigned long long int idlealltime = idletime + ioWait;
+ unsigned long long int systemalltime = systemtime + irq + softIrq;
+ unsigned long long int virtalltime = guest + guestnice;
+ unsigned long long int totaltime = usertime + nicetime + systemalltime + idlealltime + steal + virtalltime;
+ CPUData* cpuData = &(this->cpus[i]);
+ assert (systemtime >= cpuData->systemTime);
+ assert (idletime >= cpuData->idleTime);
+ assert (totaltime >= cpuData->totalTime);
+ assert (systemalltime >= cpuData->systemAllTime);
+ assert (idlealltime >= cpuData->idleAllTime);
+ assert (ioWait >= cpuData->ioWaitTime);
+ assert (irq >= cpuData->irqTime);
+ assert (softIrq >= cpuData->softIrqTime);
+ assert (steal >= cpuData->stealTime);
+ assert (virtalltime >= cpuData->guestTime);
+ // Since we do a subtraction (usertime - guest) and cputime64_to_clock_t()
+ // used in /proc/stat rounds down numbers, it can lead to a case where the
+ // integer overflow.
+ cpuData->userPeriod = (usertime > cpuData->userTime) ? usertime - cpuData->userTime : 0;
+ cpuData->nicePeriod = (nicetime > cpuData->niceTime) ? nicetime - cpuData->niceTime : 0;
+ cpuData->systemPeriod = systemtime - cpuData->systemTime;
+ cpuData->systemAllPeriod = systemalltime - cpuData->systemAllTime;
+ cpuData->idleAllPeriod = idlealltime - cpuData->idleAllTime;
+ cpuData->idlePeriod = idletime - cpuData->idleTime;
+ cpuData->ioWaitPeriod = ioWait - cpuData->ioWaitTime;
+ cpuData->irqPeriod = irq - cpuData->irqTime;
+ cpuData->softIrqPeriod = softIrq - cpuData->softIrqTime;
+ cpuData->stealPeriod = steal - cpuData->stealTime;
+ cpuData->guestPeriod = virtalltime - cpuData->guestTime;
+ cpuData->totalPeriod = totaltime - cpuData->totalTime;
+ cpuData->userTime = usertime;
+ cpuData->niceTime = nicetime;
+ cpuData->systemTime = systemtime;
+ cpuData->systemAllTime = systemalltime;
+ cpuData->idleAllTime = idlealltime;
+ cpuData->idleTime = idletime;
+ cpuData->ioWaitTime = ioWait;
+ cpuData->irqTime = irq;
+ cpuData->softIrqTime = softIrq;
+ cpuData->stealTime = steal;
+ cpuData->guestTime = virtalltime;
+ cpuData->totalTime = totaltime;
+ }
+ double period = (double)this->cpus[0].totalPeriod / cpus;
+ fclose(file);
+ return period;
+}
+
+void ProcessList_goThroughEntries(ProcessList* super) {
+ LinuxProcessList* this = (LinuxProcessList*) super;
+
+ LinuxProcessList_scanMemoryInfo(super);
+ double period = LinuxProcessList_scanCPUTime(this);
+
+ struct timeval tv;
+ gettimeofday(&tv, NULL);
+ LinuxProcessList_recurseProcTree(this, PROCDIR, NULL, period, tv);
+}
diff --git a/linux/LinuxProcessList.h b/linux/LinuxProcessList.h
new file mode 100644
index 0000000..9772581
--- /dev/null
+++ b/linux/LinuxProcessList.h
@@ -0,0 +1,94 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_LinuxProcessList
+#define HEADER_LinuxProcessList
+/*
+htop - LinuxProcessList.h
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+
+#include "ProcessList.h"
+
+typedef struct CPUData_ {
+ unsigned long long int totalTime;
+ unsigned long long int userTime;
+ unsigned long long int systemTime;
+ unsigned long long int systemAllTime;
+ unsigned long long int idleAllTime;
+ unsigned long long int idleTime;
+ unsigned long long int niceTime;
+ unsigned long long int ioWaitTime;
+ unsigned long long int irqTime;
+ unsigned long long int softIrqTime;
+ unsigned long long int stealTime;
+ unsigned long long int guestTime;
+
+ unsigned long long int totalPeriod;
+ unsigned long long int userPeriod;
+ unsigned long long int systemPeriod;
+ unsigned long long int systemAllPeriod;
+ unsigned long long int idleAllPeriod;
+ unsigned long long int idlePeriod;
+ unsigned long long int nicePeriod;
+ unsigned long long int ioWaitPeriod;
+ unsigned long long int irqPeriod;
+ unsigned long long int softIrqPeriod;
+ unsigned long long int stealPeriod;
+ unsigned long long int guestPeriod;
+} CPUData;
+
+typedef struct LinuxProcessList_ {
+ ProcessList super;
+
+ CPUData* cpus;
+
+} LinuxProcessList;
+
+#ifndef PROCDIR
+#define PROCDIR "/proc"
+#endif
+
+#ifndef PROCSTATFILE
+#define PROCSTATFILE PROCDIR "/stat"
+#endif
+
+#ifndef PROCMEMINFOFILE
+#define PROCMEMINFOFILE PROCDIR "/meminfo"
+#endif
+
+#ifndef PROC_LINE_LENGTH
+#define PROC_LINE_LENGTH 512
+#endif
+
+
+#ifndef CLAMP
+#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
+#endif
+
+ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId);
+
+void ProcessList_delete(ProcessList* pl);
+
+
+#ifdef HAVE_TASKSTATS
+
+#endif
+
+#ifdef HAVE_OPENVZ
+
+#endif
+
+#ifdef HAVE_CGROUP
+
+#endif
+
+#ifdef HAVE_VSERVER
+
+#endif
+
+void ProcessList_goThroughEntries(ProcessList* super);
+
+#endif
diff --git a/linux/Platform.c b/linux/Platform.c
new file mode 100644
index 0000000..04360ca
--- /dev/null
+++ b/linux/Platform.c
@@ -0,0 +1,239 @@
+/*
+htop - linux/Platform.c
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Platform.h"
+#include "IOPriority.h"
+#include "IOPriorityPanel.h"
+#include "LinuxProcess.h"
+#include "LinuxProcessList.h"
+#include "Battery.h"
+
+#include "Meter.h"
+#include "CPUMeter.h"
+#include "MemoryMeter.h"
+#include "SwapMeter.h"
+#include "TasksMeter.h"
+#include "LoadAverageMeter.h"
+#include "UptimeMeter.h"
+#include "ClockMeter.h"
+#include "HostnameMeter.h"
+#include "LinuxProcess.h"
+
+#include <math.h>
+#include <assert.h>
+#include <limits.h>
+#include <stdio.h>
+#include <stdlib.h>
+
+/*{
+#include "Action.h"
+#include "MainPanel.h"
+#include "BatteryMeter.h"
+#include "LinuxProcess.h"
+#include "SignalsPanel.h"
+}*/
+
+#ifndef CLAMP
+#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
+#endif
+
+ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, M_SHARE, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 };
+
+//static ProcessField defaultIoFields[] = { PID, IO_PRIORITY, USER, IO_READ_RATE, IO_WRITE_RATE, IO_RATE, COMM, 0 };
+
+int Platform_numberOfFields = LAST_PROCESSFIELD;
+
+SignalItem Platform_signals[] = {
+ { .name = " 0 Cancel", .number = 0 },
+ { .name = " 1 SIGHUP", .number = 1 },
+ { .name = " 2 SIGINT", .number = 2 },
+ { .name = " 3 SIGQUIT", .number = 3 },
+ { .name = " 4 SIGILL", .number = 4 },
+ { .name = " 5 SIGTRAP", .number = 5 },
+ { .name = " 6 SIGABRT", .number = 6 },
+ { .name = " 6 SIGIOT", .number = 6 },
+ { .name = " 7 SIGBUS", .number = 7 },
+ { .name = " 8 SIGFPE", .number = 8 },
+ { .name = " 9 SIGKILL", .number = 9 },
+ { .name = "10 SIGUSR1", .number = 10 },
+ { .name = "11 SIGSEGV", .number = 11 },
+ { .name = "12 SIGUSR2", .number = 12 },
+ { .name = "13 SIGPIPE", .number = 13 },
+ { .name = "14 SIGALRM", .number = 14 },
+ { .name = "15 SIGTERM", .number = 15 },
+ { .name = "16 SIGSTKFLT", .number = 16 },
+ { .name = "17 SIGCHLD", .number = 17 },
+ { .name = "18 SIGCONT", .number = 18 },
+ { .name = "19 SIGSTOP", .number = 19 },
+ { .name = "20 SIGTSTP", .number = 20 },
+ { .name = "21 SIGTTIN", .number = 21 },
+ { .name = "22 SIGTTOU", .number = 22 },
+ { .name = "23 SIGURG", .number = 23 },
+ { .name = "24 SIGXCPU", .number = 24 },
+ { .name = "25 SIGXFSZ", .number = 25 },
+ { .name = "26 SIGVTALRM", .number = 26 },
+ { .name = "27 SIGPROF", .number = 27 },
+ { .name = "28 SIGWINCH", .number = 28 },
+ { .name = "29 SIGIO", .number = 29 },
+ { .name = "29 SIGPOLL", .number = 29 },
+ { .name = "30 SIGPWR", .number = 30 },
+ { .name = "31 SIGSYS", .number = 31 },
+};
+
+unsigned int Platform_numberOfSignals = sizeof(Platform_signals)/sizeof(SignalItem);
+
+static Htop_Reaction Platform_actionSetIOPriority(State* st) {
+ Panel* panel = st->panel;
+
+ LinuxProcess* p = (LinuxProcess*) Panel_getSelected(panel);
+ if (!p) return HTOP_OK;
+ IOPriority ioprio = p->ioPriority;
+ Panel* ioprioPanel = IOPriorityPanel_new(ioprio);
+ void* set = Action_pickFromVector(st, ioprioPanel, 21);
+ if (set) {
+ IOPriority ioprio = IOPriorityPanel_getIOPriority(ioprioPanel);
+ bool ok = MainPanel_foreachProcess((MainPanel*)panel, (MainPanel_ForeachProcessFn) LinuxProcess_setIOPriority, (size_t) ioprio, NULL);
+ if (!ok)
+ beep();
+ }
+ Panel_delete((Object*)ioprioPanel);
+ return HTOP_REFRESH | HTOP_REDRAW_BAR | HTOP_UPDATE_PANELHDR;
+}
+
+void Platform_setBindings(Htop_Action* keys) {
+ keys['i'] = Platform_actionSetIOPriority;
+}
+
+MeterClass* Platform_meterTypes[] = {
+ &CPUMeter_class,
+ &ClockMeter_class,
+ &LoadAverageMeter_class,
+ &LoadMeter_class,
+ &MemoryMeter_class,
+ &SwapMeter_class,
+ &TasksMeter_class,
+ &UptimeMeter_class,
+ &BatteryMeter_class,
+ &HostnameMeter_class,
+ &AllCPUsMeter_class,
+ &AllCPUs2Meter_class,
+ &LeftCPUsMeter_class,
+ &RightCPUsMeter_class,
+ &LeftCPUs2Meter_class,
+ &RightCPUs2Meter_class,
+ &BlankMeter_class,
+ NULL
+};
+
+int Platform_getUptime() {
+ double uptime = 0;
+ FILE* fd = fopen(PROCDIR "/uptime", "r");
+ if (fd) {
+ int n = fscanf(fd, "%64lf", &uptime);
+ fclose(fd);
+ if (n <= 0) return 0;
+ }
+ return (int) floor(uptime);
+}
+
+void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
+ int activeProcs, totalProcs, lastProc;
+ *one = 0; *five = 0; *fifteen = 0;
+ FILE *fd = fopen(PROCDIR "/loadavg", "r");
+ if (fd) {
+ int total = fscanf(fd, "%32lf %32lf %32lf %32d/%32d %32d", one, five, fifteen,
+ &activeProcs, &totalProcs, &lastProc);
+ (void) total;
+ assert(total == 6);
+ fclose(fd);
+ }
+}
+
+int Platform_getMaxPid() {
+ FILE* file = fopen(PROCDIR "/sys/kernel/pid_max", "r");
+ if (!file) return -1;
+ int maxPid = 4194303;
+ int match = fscanf(file, "%32d", &maxPid);
+ (void) match;
+ fclose(file);
+ return maxPid;
+}
+
+double Platform_setCPUValues(Meter* this, int cpu) {
+ LinuxProcessList* pl = (LinuxProcessList*) this->pl;
+ CPUData* cpuData = &(pl->cpus[cpu]);
+ double total = (double) ( cpuData->totalPeriod == 0 ? 1 : cpuData->totalPeriod);
+ double percent;
+ double* v = this->values;
+ v[CPU_METER_NICE] = cpuData->nicePeriod / total * 100.0;
+ v[CPU_METER_NORMAL] = cpuData->userPeriod / total * 100.0;
+ if (this->pl->settings->detailedCPUTime) {
+ v[CPU_METER_KERNEL] = cpuData->systemPeriod / total * 100.0;
+ v[CPU_METER_IRQ] = cpuData->irqPeriod / total * 100.0;
+ v[CPU_METER_SOFTIRQ] = cpuData->softIrqPeriod / total * 100.0;
+ v[CPU_METER_STEAL] = cpuData->stealPeriod / total * 100.0;
+ v[CPU_METER_GUEST] = cpuData->guestPeriod / total * 100.0;
+ v[CPU_METER_IOWAIT] = cpuData->ioWaitPeriod / total * 100.0;
+ Meter_setItems(this, 8);
+ if (this->pl->settings->accountGuestInCPUMeter) {
+ percent = v[0]+v[1]+v[2]+v[3]+v[4]+v[5]+v[6];
+ } else {
+ percent = v[0]+v[1]+v[2]+v[3]+v[4];
+ }
+ } else {
+ v[2] = cpuData->systemAllPeriod / total * 100.0;
+ v[3] = (cpuData->stealPeriod + cpuData->guestPeriod) / total * 100.0;
+ Meter_setItems(this, 4);
+ percent = v[0]+v[1]+v[2]+v[3];
+ }
+ percent = CLAMP(percent, 0.0, 100.0);
+ if (isnan(percent)) percent = 0.0;
+ return percent;
+}
+
+void Platform_setMemoryValues(Meter* this) {
+ ProcessList* pl = (ProcessList*) this->pl;
+ long int usedMem = pl->usedMem;
+ long int buffersMem = pl->buffersMem;
+ long int cachedMem = pl->cachedMem;
+ usedMem -= buffersMem + cachedMem;
+ this->total = pl->totalMem;
+ this->values[0] = usedMem;
+ this->values[1] = buffersMem;
+ this->values[2] = cachedMem;
+}
+
+void Platform_setSwapValues(Meter* this) {
+ ProcessList* pl = (ProcessList*) this->pl;
+ this->total = pl->totalSwap;
+ this->values[0] = pl->usedSwap;
+}
+
+char* Platform_getProcessEnv(pid_t pid) {
+ char procname[32+1];
+ snprintf(procname, 32, "/proc/%d/environ", pid);
+ FILE* fd = fopen(procname, "r");
+ char *env = NULL;
+ if (fd) {
+ size_t capacity = 4096, size = 0, bytes;
+ env = xMalloc(capacity);
+ while (env && (bytes = fread(env+size, 1, capacity-size, fd)) > 0) {
+ size += bytes;
+ capacity *= 2;
+ env = xRealloc(env, capacity);
+ }
+ fclose(fd);
+ if (size < 2 || env[size-1] || env[size-2]) {
+ if (size + 2 < capacity) {
+ env = xRealloc(env, capacity+2);
+ }
+ env[size] = 0;
+ env[size+1] = 0;
+ }
+ }
+ return env;
+}
diff --git a/linux/Platform.h b/linux/Platform.h
new file mode 100644
index 0000000..b0d69fb
--- /dev/null
+++ b/linux/Platform.h
@@ -0,0 +1,48 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_Platform
+#define HEADER_Platform
+/*
+htop - linux/Platform.h
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Action.h"
+#include "MainPanel.h"
+#include "BatteryMeter.h"
+#include "LinuxProcess.h"
+#include "SignalsPanel.h"
+
+#ifndef CLAMP
+#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
+#endif
+
+extern ProcessField Platform_defaultFields[];
+
+extern int Platform_numberOfFields;
+
+extern SignalItem Platform_signals[];
+
+extern unsigned int Platform_numberOfSignals;
+
+void Platform_setBindings(Htop_Action* keys);
+
+extern MeterClass* Platform_meterTypes[];
+
+int Platform_getUptime();
+
+void Platform_getLoadAverage(double* one, double* five, double* fifteen);
+
+int Platform_getMaxPid();
+
+double Platform_setCPUValues(Meter* this, int cpu);
+
+void Platform_setMemoryValues(Meter* this);
+
+void Platform_setSwapValues(Meter* this);
+
+char* Platform_getProcessEnv(pid_t pid);
+
+#endif
diff --git a/ltmain.sh b/ltmain.sh
index 39e8c57..63ae69d 100755..100644
--- a/ltmain.sh
+++ b/ltmain.sh
@@ -1,10 +1,9 @@
-# Generated from ltmain.m4sh.
-# libtool (GNU libtool) 2.2.10
+# libtool (GNU libtool) 2.4.2
# Written by Gordon Matzigkeit <gord@gnu.ai.mit.edu>, 1996
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005, 2006,
-# 2007, 2008, 2009, 2010 Free Software Foundation, Inc.
+# 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
# This is free software; see the source for copying conditions. There is NO
# warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
@@ -42,6 +41,7 @@
# --quiet, --silent don't print informational messages
# --no-quiet, --no-silent
# print informational messages (default)
+# --no-warn don't display warning messages
# --tag=TAG use configuration variables from tag TAG
# -v, --verbose print more informational messages than default
# --no-verbose don't print the extra informational messages
@@ -70,17 +70,19 @@
# compiler: $LTCC
# compiler flags: $LTCFLAGS
# linker: $LD (gnu? $with_gnu_ld)
-# $progname: (GNU libtool) 2.2.10
+# $progname: (GNU libtool) 2.4.2
# automake: $automake_version
# autoconf: $autoconf_version
#
# Report bugs to <bug-libtool@gnu.org>.
+# GNU libtool home page: <http://www.gnu.org/software/libtool/>.
+# General help using GNU software: <http://www.gnu.org/gethelp/>.
PROGRAM=libtool
PACKAGE=libtool
-VERSION=2.2.10
+VERSION=2.4.2
TIMESTAMP=""
-package_revision=1.3175
+package_revision=1.3337
# Be Bourne compatible
if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
@@ -135,15 +137,10 @@ progpath="$0"
: ${CP="cp -f"}
test "${ECHO+set}" = set || ECHO=${as_echo-'printf %s\n'}
-: ${EGREP="grep -E"}
-: ${FGREP="grep -F"}
-: ${GREP="grep"}
-: ${LN_S="ln -s"}
: ${MAKE="make"}
: ${MKDIR="mkdir"}
: ${MV="mv -f"}
: ${RM="rm -f"}
-: ${SED="sed"}
: ${SHELL="${CONFIG_SHELL-/bin/sh}"}
: ${Xsed="$SED -e 1s/^X//"}
@@ -163,6 +160,27 @@ IFS=" $lt_nl"
dirname="s,/[^/]*$,,"
basename="s,^.*/,,"
+# func_dirname file append nondir_replacement
+# Compute the dirname of FILE. If nonempty, add APPEND to the result,
+# otherwise set result to NONDIR_REPLACEMENT.
+func_dirname ()
+{
+ func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+} # func_dirname may be replaced by extended shell implementation
+
+
+# func_basename file
+func_basename ()
+{
+ func_basename_result=`$ECHO "${1}" | $SED "$basename"`
+} # func_basename may be replaced by extended shell implementation
+
+
# func_dirname_and_basename file append nondir_replacement
# perform func_basename and func_dirname in a single function
# call:
@@ -177,17 +195,31 @@ basename="s,^.*/,,"
# those functions but instead duplicate the functionality here.
func_dirname_and_basename ()
{
- # Extract subdirectory from the argument.
- func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
- func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
-}
+ # Extract subdirectory from the argument.
+ func_dirname_result=`$ECHO "${1}" | $SED -e "$dirname"`
+ if test "X$func_dirname_result" = "X${1}"; then
+ func_dirname_result="${3}"
+ else
+ func_dirname_result="$func_dirname_result${2}"
+ fi
+ func_basename_result=`$ECHO "${1}" | $SED -e "$basename"`
+} # func_dirname_and_basename may be replaced by extended shell implementation
+
+
+# func_stripname prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+# func_strip_suffix prefix name
+func_stripname ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname may be replaced by extended shell implementation
-# Generated shell functions inserted here.
# These SED scripts presuppose an absolute path with a trailing slash.
pathcar='s,^/\([^/]*\).*$,\1,'
@@ -351,7 +383,7 @@ case $progpath in
;;
*)
save_IFS="$IFS"
- IFS=:
+ IFS=${PATH_SEPARATOR-:}
for progdir in $PATH; do
IFS="$save_IFS"
test -x "$progdir/$progname" && break
@@ -370,6 +402,15 @@ sed_quote_subst='s/\([`"$\\]\)/\\\1/g'
# Same as above, but do not quote variable references.
double_quote_subst='s/\(["`\\]\)/\\\1/g'
+# Sed substitution that turns a string into a regex matching for the
+# string literally.
+sed_make_literal_regex='s,[].[^$\\*\/],\\&,g'
+
+# Sed substitution that converts a w32 file name or path
+# which contains forward slashes, into one that contains
+# (escaped) backslashes. A very naive implementation.
+lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
+
# Re-`\' parameter expansions in output of double_quote_subst that were
# `\'-ed in input to the same. If an odd number of `\' preceded a '$'
# in input to double_quote_subst, that '$' was protected from expansion.
@@ -398,7 +439,7 @@ opt_warning=:
# name if it has been set yet.
func_echo ()
{
- $ECHO "$progname${mode+: }$mode: $*"
+ $ECHO "$progname: ${opt_mode+$opt_mode: }$*"
}
# func_verbose arg...
@@ -424,14 +465,14 @@ func_echo_all ()
# Echo program name prefixed message to standard error.
func_error ()
{
- $ECHO "$progname${mode+: }$mode: "${1+"$@"} 1>&2
+ $ECHO "$progname: ${opt_mode+$opt_mode: }"${1+"$@"} 1>&2
}
# func_warning arg...
# Echo program name prefixed warning message to standard error.
func_warning ()
{
- $opt_warning && $ECHO "$progname${mode+: }$mode: warning: "${1+"$@"} 1>&2
+ $opt_warning && $ECHO "$progname: ${opt_mode+$opt_mode: }warning: "${1+"$@"} 1>&2
# bash bug again:
:
@@ -650,11 +691,30 @@ func_show_eval_locale ()
fi
}
+# func_tr_sh
+# Turn $1 into a string suitable for a shell variable name.
+# Result is stored in $func_tr_sh_result. All characters
+# not in the set a-zA-Z0-9_ are replaced with '_'. Further,
+# if $1 begins with a digit, a '_' is prepended as well.
+func_tr_sh ()
+{
+ case $1 in
+ [0-9]* | *[!a-zA-Z0-9_]*)
+ func_tr_sh_result=`$ECHO "$1" | $SED 's/^\([0-9]\)/_\1/; s/[^a-zA-Z0-9_]/_/g'`
+ ;;
+ * )
+ func_tr_sh_result=$1
+ ;;
+ esac
+}
+
# func_version
# Echo version message to standard output and exit.
func_version ()
{
+ $opt_debug
+
$SED -n '/(C)/!b go
:more
/\./!{
@@ -676,6 +736,8 @@ func_version ()
# Echo short help message to standard output and exit.
func_usage ()
{
+ $opt_debug
+
$SED -n '/^# Usage:/,/^# *.*--help/ {
s/^# //
s/^# *$//
@@ -692,7 +754,10 @@ func_usage ()
# unless 'noexit' is passed as argument.
func_help ()
{
+ $opt_debug
+
$SED -n '/^# Usage:/,/# Report bugs to/ {
+ :print
s/^# //
s/^# *$//
s*\$progname*'$progname'*
@@ -702,10 +767,14 @@ func_help ()
s*\$LTCFLAGS*'"$LTCFLAGS"'*
s*\$LD*'"$LD"'*
s/\$with_gnu_ld/'"$with_gnu_ld"'/
- s/\$automake_version/'"`(automake --version) 2>/dev/null |$SED 1q`"'/
- s/\$autoconf_version/'"`(autoconf --version) 2>/dev/null |$SED 1q`"'/
+ s/\$automake_version/'"`(${AUTOMAKE-automake} --version) 2>/dev/null |$SED 1q`"'/
+ s/\$autoconf_version/'"`(${AUTOCONF-autoconf} --version) 2>/dev/null |$SED 1q`"'/
p
- }' < "$progpath"
+ d
+ }
+ /^# .* home page:/b print
+ /^# General help using/b print
+ ' < "$progpath"
ret=$?
if test -z "$1"; then
exit $ret
@@ -717,12 +786,39 @@ func_help ()
# exit_cmd.
func_missing_arg ()
{
+ $opt_debug
+
func_error "missing argument for $1."
exit_cmd=exit
}
-exit_cmd=:
+# func_split_short_opt shortopt
+# Set func_split_short_opt_name and func_split_short_opt_arg shell
+# variables after splitting SHORTOPT after the 2nd character.
+func_split_short_opt ()
+{
+ my_sed_short_opt='1s/^\(..\).*$/\1/;q'
+ my_sed_short_rest='1s/^..\(.*\)$/\1/;q'
+
+ func_split_short_opt_name=`$ECHO "$1" | $SED "$my_sed_short_opt"`
+ func_split_short_opt_arg=`$ECHO "$1" | $SED "$my_sed_short_rest"`
+} # func_split_short_opt may be replaced by extended shell implementation
+
+
+# func_split_long_opt longopt
+# Set func_split_long_opt_name and func_split_long_opt_arg shell
+# variables after splitting LONGOPT at the `=' sign.
+func_split_long_opt ()
+{
+ my_sed_long_opt='1s/^\(--[^=]*\)=.*/\1/;q'
+ my_sed_long_arg='1s/^--[^=]*=//'
+
+ func_split_long_opt_name=`$ECHO "$1" | $SED "$my_sed_long_opt"`
+ func_split_long_opt_arg=`$ECHO "$1" | $SED "$my_sed_long_arg"`
+} # func_split_long_opt may be replaced by extended shell implementation
+
+exit_cmd=:
@@ -732,25 +828,64 @@ magic="%%%MAGIC variable%%%"
magic_exe="%%%MAGIC EXE variable%%%"
# Global variables.
-# $mode is unset
nonopt=
-execute_dlfiles=
preserve_args=
lo2o="s/\\.lo\$/.${objext}/"
o2lo="s/\\.${objext}\$/.lo/"
extracted_archives=
extracted_serial=0
-opt_dry_run=false
-opt_duplicate_deps=false
-opt_silent=false
-opt_debug=:
-
# If this variable is set in any of the actions, the command in it
# will be execed at the end. This prevents here-documents from being
# left over by shells.
exec_cmd=
+# func_append var value
+# Append VALUE to the end of shell variable VAR.
+func_append ()
+{
+ eval "${1}=\$${1}\${2}"
+} # func_append may be replaced by extended shell implementation
+
+# func_append_quoted var value
+# Quote VALUE and append to the end of shell variable VAR, separated
+# by a space.
+func_append_quoted ()
+{
+ func_quote_for_eval "${2}"
+ eval "${1}=\$${1}\\ \$func_quote_for_eval_result"
+} # func_append_quoted may be replaced by extended shell implementation
+
+
+# func_arith arithmetic-term...
+func_arith ()
+{
+ func_arith_result=`expr "${@}"`
+} # func_arith may be replaced by extended shell implementation
+
+
+# func_len string
+# STRING may not start with a hyphen.
+func_len ()
+{
+ func_len_result=`expr "${1}" : ".*" 2>/dev/null || echo $max_cmd_len`
+} # func_len may be replaced by extended shell implementation
+
+
+# func_lo2o object
+func_lo2o ()
+{
+ func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
+} # func_lo2o may be replaced by extended shell implementation
+
+
+# func_xform libobj-or-source
+func_xform ()
+{
+ func_xform_result=`$ECHO "${1}" | $SED 's/\.[^.]*$/.lo/'`
+} # func_xform may be replaced by extended shell implementation
+
+
# func_fatal_configuration arg...
# Echo program name prefixed message to standard error, followed by
# a configuration failure hint, and exit.
@@ -840,129 +975,209 @@ func_enable_tag ()
esac
}
-# Parse options once, thoroughly. This comes as soon as possible in
-# the script to make things like `libtool --version' happen quickly.
+# func_check_version_match
+# Ensure that we are using m4 macros, and libtool script from the same
+# release of libtool.
+func_check_version_match ()
{
+ if test "$package_revision" != "$macro_revision"; then
+ if test "$VERSION" != "$macro_version"; then
+ if test -z "$macro_version"; then
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from an older release.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
+$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
+$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
+$progname: and run autoconf again.
+_LT_EOF
+ fi
+ else
+ cat >&2 <<_LT_EOF
+$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
+$progname: but the definition of this LT_INIT comes from revision $macro_revision.
+$progname: You should recreate aclocal.m4 with macros from revision $package_revision
+$progname: of $PACKAGE $VERSION and run autoconf again.
+_LT_EOF
+ fi
- # Shorthand for --mode=foo, only valid as the first argument
- case $1 in
- clean|clea|cle|cl)
- shift; set dummy --mode clean ${1+"$@"}; shift
- ;;
- compile|compil|compi|comp|com|co|c)
- shift; set dummy --mode compile ${1+"$@"}; shift
- ;;
- execute|execut|execu|exec|exe|ex|e)
- shift; set dummy --mode execute ${1+"$@"}; shift
- ;;
- finish|finis|fini|fin|fi|f)
- shift; set dummy --mode finish ${1+"$@"}; shift
- ;;
- install|instal|insta|inst|ins|in|i)
- shift; set dummy --mode install ${1+"$@"}; shift
- ;;
- link|lin|li|l)
- shift; set dummy --mode link ${1+"$@"}; shift
- ;;
- uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
- shift; set dummy --mode uninstall ${1+"$@"}; shift
- ;;
- esac
+ exit $EXIT_MISMATCH
+ fi
+}
+
+
+# Shorthand for --mode=foo, only valid as the first argument
+case $1 in
+clean|clea|cle|cl)
+ shift; set dummy --mode clean ${1+"$@"}; shift
+ ;;
+compile|compil|compi|comp|com|co|c)
+ shift; set dummy --mode compile ${1+"$@"}; shift
+ ;;
+execute|execut|execu|exec|exe|ex|e)
+ shift; set dummy --mode execute ${1+"$@"}; shift
+ ;;
+finish|finis|fini|fin|fi|f)
+ shift; set dummy --mode finish ${1+"$@"}; shift
+ ;;
+install|instal|insta|inst|ins|in|i)
+ shift; set dummy --mode install ${1+"$@"}; shift
+ ;;
+link|lin|li|l)
+ shift; set dummy --mode link ${1+"$@"}; shift
+ ;;
+uninstall|uninstal|uninsta|uninst|unins|unin|uni|un|u)
+ shift; set dummy --mode uninstall ${1+"$@"}; shift
+ ;;
+esac
- # Parse non-mode specific arguments:
- while test "$#" -gt 0; do
+
+
+# Option defaults:
+opt_debug=:
+opt_dry_run=false
+opt_config=false
+opt_preserve_dup_deps=false
+opt_features=false
+opt_finish=false
+opt_help=false
+opt_help_all=false
+opt_silent=:
+opt_warning=:
+opt_verbose=:
+opt_silent=false
+opt_verbose=false
+
+
+# Parse options once, thoroughly. This comes as soon as possible in the
+# script to make things like `--version' happen as quickly as we can.
+{
+ # this just eases exit handling
+ while test $# -gt 0; do
opt="$1"
shift
-
case $opt in
- --config) func_config ;;
-
- --debug) preserve_args="$preserve_args $opt"
+ --debug|-x) opt_debug='set -x'
func_echo "enabling shell trace mode"
- opt_debug='set -x'
$opt_debug
;;
-
- -dlopen) test "$#" -eq 0 && func_missing_arg "$opt" && break
- execute_dlfiles="$execute_dlfiles $1"
- shift
+ --dry-run|--dryrun|-n)
+ opt_dry_run=:
;;
-
- --dry-run | -n) opt_dry_run=: ;;
- --features) func_features ;;
- --finish) mode="finish" ;;
-
- --mode) test "$#" -eq 0 && func_missing_arg "$opt" && break
- case $1 in
- # Valid mode arguments:
- clean) ;;
- compile) ;;
- execute) ;;
- finish) ;;
- install) ;;
- link) ;;
- relink) ;;
- uninstall) ;;
-
- # Catch anything else as an error
- *) func_error "invalid argument for $opt"
- exit_cmd=exit
- break
- ;;
- esac
-
- mode="$1"
+ --config)
+ opt_config=:
+func_config
+ ;;
+ --dlopen|-dlopen)
+ optarg="$1"
+ opt_dlopen="${opt_dlopen+$opt_dlopen
+}$optarg"
shift
;;
-
--preserve-dup-deps)
- opt_duplicate_deps=: ;;
-
- --quiet|--silent) preserve_args="$preserve_args $opt"
- opt_silent=:
- opt_verbose=false
+ opt_preserve_dup_deps=:
;;
-
- --no-quiet|--no-silent)
- preserve_args="$preserve_args $opt"
- opt_silent=false
+ --features)
+ opt_features=:
+func_features
;;
-
- --verbose| -v) preserve_args="$preserve_args $opt"
+ --finish)
+ opt_finish=:
+set dummy --mode finish ${1+"$@"}; shift
+ ;;
+ --help)
+ opt_help=:
+ ;;
+ --help-all)
+ opt_help_all=:
+opt_help=': help-all'
+ ;;
+ --mode)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_mode="$optarg"
+case $optarg in
+ # Valid mode arguments:
+ clean|compile|execute|finish|install|link|relink|uninstall) ;;
+
+ # Catch anything else as an error
+ *) func_error "invalid argument for $opt"
+ exit_cmd=exit
+ break
+ ;;
+esac
+ shift
+ ;;
+ --no-silent|--no-quiet)
opt_silent=false
- opt_verbose=:
+func_append preserve_args " $opt"
;;
-
- --no-verbose) preserve_args="$preserve_args $opt"
+ --no-warning|--no-warn)
+ opt_warning=false
+func_append preserve_args " $opt"
+ ;;
+ --no-verbose)
opt_verbose=false
+func_append preserve_args " $opt"
;;
-
- --tag) test "$#" -eq 0 && func_missing_arg "$opt" && break
- preserve_args="$preserve_args $opt $1"
- func_enable_tag "$1" # tagname is set here
+ --silent|--quiet)
+ opt_silent=:
+func_append preserve_args " $opt"
+ opt_verbose=false
+ ;;
+ --verbose|-v)
+ opt_verbose=:
+func_append preserve_args " $opt"
+opt_silent=false
+ ;;
+ --tag)
+ test $# = 0 && func_missing_arg $opt && break
+ optarg="$1"
+ opt_tag="$optarg"
+func_append preserve_args " $opt $optarg"
+func_enable_tag "$optarg"
shift
;;
+ -\?|-h) func_usage ;;
+ --help) func_help ;;
+ --version) func_version ;;
+
# Separate optargs to long options:
- -dlopen=*|--mode=*|--tag=*)
- func_opt_split "$opt"
- set dummy "$func_opt_split_opt" "$func_opt_split_arg" ${1+"$@"}
+ --*=*)
+ func_split_long_opt "$opt"
+ set dummy "$func_split_long_opt_name" "$func_split_long_opt_arg" ${1+"$@"}
shift
;;
- -\?|-h) func_usage ;;
- --help) opt_help=: ;;
- --help-all) opt_help=': help-all' ;;
- --version) func_version ;;
-
- -*) func_fatal_help "unrecognized option \`$opt'" ;;
-
- *) nonopt="$opt"
- break
+ # Separate non-argument short options:
+ -\?*|-h*|-n*|-v*)
+ func_split_short_opt "$opt"
+ set dummy "$func_split_short_opt_name" "-$func_split_short_opt_arg" ${1+"$@"}
+ shift
;;
+
+ --) break ;;
+ -*) func_fatal_help "unrecognized option \`$opt'" ;;
+ *) set dummy "$opt" ${1+"$@"}; shift; break ;;
esac
done
+ # Validate options:
+
+ # save first non-option argument
+ if test "$#" -gt 0; then
+ nonopt="$opt"
+ shift
+ fi
+
+ # preserve --debug
+ test "$opt_debug" = : || func_append preserve_args " --debug"
case $host in
*cygwin* | *mingw* | *pw32* | *cegcc*)
@@ -970,82 +1185,44 @@ func_enable_tag ()
opt_duplicate_compiler_generated_deps=:
;;
*)
- opt_duplicate_compiler_generated_deps=$opt_duplicate_deps
+ opt_duplicate_compiler_generated_deps=$opt_preserve_dup_deps
;;
esac
- # Having warned about all mis-specified options, bail out if
- # anything was wrong.
- $exit_cmd $EXIT_FAILURE
-}
+ $opt_help || {
+ # Sanity checks first:
+ func_check_version_match
-# func_check_version_match
-# Ensure that we are using m4 macros, and libtool script from the same
-# release of libtool.
-func_check_version_match ()
-{
- if test "$package_revision" != "$macro_revision"; then
- if test "$VERSION" != "$macro_version"; then
- if test -z "$macro_version"; then
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from an older release.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
- else
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, but the
-$progname: definition of this LT_INIT comes from $PACKAGE $macro_version.
-$progname: You should recreate aclocal.m4 with macros from $PACKAGE $VERSION
-$progname: and run autoconf again.
-_LT_EOF
- fi
- else
- cat >&2 <<_LT_EOF
-$progname: Version mismatch error. This is $PACKAGE $VERSION, revision $package_revision,
-$progname: but the definition of this LT_INIT comes from revision $macro_revision.
-$progname: You should recreate aclocal.m4 with macros from revision $package_revision
-$progname: of $PACKAGE $VERSION and run autoconf again.
-_LT_EOF
+ if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
+ func_fatal_configuration "not configured to build any kind of library"
fi
- exit $EXIT_MISMATCH
- fi
-}
-
+ # Darwin sucks
+ eval std_shrext=\"$shrext_cmds\"
-## ----------- ##
-## Main. ##
-## ----------- ##
-
-$opt_help || {
- # Sanity checks first:
- func_check_version_match
-
- if test "$build_libtool_libs" != yes && test "$build_old_libs" != yes; then
- func_fatal_configuration "not configured to build any kind of library"
- fi
+ # Only execute mode is allowed to have -dlopen flags.
+ if test -n "$opt_dlopen" && test "$opt_mode" != execute; then
+ func_error "unrecognized option \`-dlopen'"
+ $ECHO "$help" 1>&2
+ exit $EXIT_FAILURE
+ fi
- test -z "$mode" && func_fatal_error "error: you must specify a MODE."
+ # Change the help message to a mode-specific one.
+ generic_help="$help"
+ help="Try \`$progname --help --mode=$opt_mode' for more information."
+ }
- # Darwin sucks
- eval std_shrext=\"$shrext_cmds\"
+ # Bail if the options were screwed
+ $exit_cmd $EXIT_FAILURE
+}
- # Only execute mode is allowed to have -dlopen flags.
- if test -n "$execute_dlfiles" && test "$mode" != execute; then
- func_error "unrecognized option \`-dlopen'"
- $ECHO "$help" 1>&2
- exit $EXIT_FAILURE
- fi
- # Change the help message to a mode-specific one.
- generic_help="$help"
- help="Try \`$progname --help --mode=$mode' for more information."
-}
+## ----------- ##
+## Main. ##
+## ----------- ##
# func_lalib_p file
# True iff FILE is a libtool `.la' library or `.lo' object file.
@@ -1110,12 +1287,9 @@ func_ltwrapper_executable_p ()
# temporary ltwrapper_script.
func_ltwrapper_scriptname ()
{
- func_ltwrapper_scriptname_result=""
- if func_ltwrapper_executable_p "$1"; then
- func_dirname_and_basename "$1" "" "."
- func_stripname '' '.exe' "$func_basename_result"
- func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
- fi
+ func_dirname_and_basename "$1" "" "."
+ func_stripname '' '.exe' "$func_basename_result"
+ func_ltwrapper_scriptname_result="$func_dirname_result/$objdir/${func_stripname_result}_ltshwrapper"
}
# func_ltwrapper_p file
@@ -1161,6 +1335,37 @@ func_source ()
}
+# func_resolve_sysroot PATH
+# Replace a leading = in PATH with a sysroot. Store the result into
+# func_resolve_sysroot_result
+func_resolve_sysroot ()
+{
+ func_resolve_sysroot_result=$1
+ case $func_resolve_sysroot_result in
+ =*)
+ func_stripname '=' '' "$func_resolve_sysroot_result"
+ func_resolve_sysroot_result=$lt_sysroot$func_stripname_result
+ ;;
+ esac
+}
+
+# func_replace_sysroot PATH
+# If PATH begins with the sysroot, replace it with = and
+# store the result into func_replace_sysroot_result.
+func_replace_sysroot ()
+{
+ case "$lt_sysroot:$1" in
+ ?*:"$lt_sysroot"*)
+ func_stripname "$lt_sysroot" '' "$1"
+ func_replace_sysroot_result="=$func_stripname_result"
+ ;;
+ *)
+ # Including no sysroot.
+ func_replace_sysroot_result=$1
+ ;;
+ esac
+}
+
# func_infer_tag arg
# Infer tagged configuration to use if any are available and
# if one wasn't chosen via the "--tag" command line option.
@@ -1173,8 +1378,7 @@ func_infer_tag ()
if test -n "$available_tags" && test -z "$tagname"; then
CC_quoted=
for arg in $CC; do
- func_quote_for_eval "$arg"
- CC_quoted="$CC_quoted $func_quote_for_eval_result"
+ func_append_quoted CC_quoted "$arg"
done
CC_expanded=`func_echo_all $CC`
CC_quoted_expanded=`func_echo_all $CC_quoted`
@@ -1193,8 +1397,7 @@ func_infer_tag ()
CC_quoted=
for arg in $CC; do
# Double-quote args containing other shell metacharacters.
- func_quote_for_eval "$arg"
- CC_quoted="$CC_quoted $func_quote_for_eval_result"
+ func_append_quoted CC_quoted "$arg"
done
CC_expanded=`func_echo_all $CC`
CC_quoted_expanded=`func_echo_all $CC_quoted`
@@ -1263,6 +1466,486 @@ EOF
}
}
+
+##################################################
+# FILE NAME AND PATH CONVERSION HELPER FUNCTIONS #
+##################################################
+
+# func_convert_core_file_wine_to_w32 ARG
+# Helper function used by file name conversion functions when $build is *nix,
+# and $host is mingw, cygwin, or some other w32 environment. Relies on a
+# correctly configured wine environment available, with the winepath program
+# in $build's $PATH.
+#
+# ARG is the $build file name to be converted to w32 format.
+# Result is available in $func_convert_core_file_wine_to_w32_result, and will
+# be empty on error (or when ARG is empty)
+func_convert_core_file_wine_to_w32 ()
+{
+ $opt_debug
+ func_convert_core_file_wine_to_w32_result="$1"
+ if test -n "$1"; then
+ # Unfortunately, winepath does not exit with a non-zero error code, so we
+ # are forced to check the contents of stdout. On the other hand, if the
+ # command is not found, the shell will set an exit code of 127 and print
+ # *an error message* to stdout. So we must check for both error code of
+ # zero AND non-empty stdout, which explains the odd construction:
+ func_convert_core_file_wine_to_w32_tmp=`winepath -w "$1" 2>/dev/null`
+ if test "$?" -eq 0 && test -n "${func_convert_core_file_wine_to_w32_tmp}"; then
+ func_convert_core_file_wine_to_w32_result=`$ECHO "$func_convert_core_file_wine_to_w32_tmp" |
+ $SED -e "$lt_sed_naive_backslashify"`
+ else
+ func_convert_core_file_wine_to_w32_result=
+ fi
+ fi
+}
+# end: func_convert_core_file_wine_to_w32
+
+
+# func_convert_core_path_wine_to_w32 ARG
+# Helper function used by path conversion functions when $build is *nix, and
+# $host is mingw, cygwin, or some other w32 environment. Relies on a correctly
+# configured wine environment available, with the winepath program in $build's
+# $PATH. Assumes ARG has no leading or trailing path separator characters.
+#
+# ARG is path to be converted from $build format to win32.
+# Result is available in $func_convert_core_path_wine_to_w32_result.
+# Unconvertible file (directory) names in ARG are skipped; if no directory names
+# are convertible, then the result may be empty.
+func_convert_core_path_wine_to_w32 ()
+{
+ $opt_debug
+ # unfortunately, winepath doesn't convert paths, only file names
+ func_convert_core_path_wine_to_w32_result=""
+ if test -n "$1"; then
+ oldIFS=$IFS
+ IFS=:
+ for func_convert_core_path_wine_to_w32_f in $1; do
+ IFS=$oldIFS
+ func_convert_core_file_wine_to_w32 "$func_convert_core_path_wine_to_w32_f"
+ if test -n "$func_convert_core_file_wine_to_w32_result" ; then
+ if test -z "$func_convert_core_path_wine_to_w32_result"; then
+ func_convert_core_path_wine_to_w32_result="$func_convert_core_file_wine_to_w32_result"
+ else
+ func_append func_convert_core_path_wine_to_w32_result ";$func_convert_core_file_wine_to_w32_result"
+ fi
+ fi
+ done
+ IFS=$oldIFS
+ fi
+}
+# end: func_convert_core_path_wine_to_w32
+
+
+# func_cygpath ARGS...
+# Wrapper around calling the cygpath program via LT_CYGPATH. This is used when
+# when (1) $build is *nix and Cygwin is hosted via a wine environment; or (2)
+# $build is MSYS and $host is Cygwin, or (3) $build is Cygwin. In case (1) or
+# (2), returns the Cygwin file name or path in func_cygpath_result (input
+# file name or path is assumed to be in w32 format, as previously converted
+# from $build's *nix or MSYS format). In case (3), returns the w32 file name
+# or path in func_cygpath_result (input file name or path is assumed to be in
+# Cygwin format). Returns an empty string on error.
+#
+# ARGS are passed to cygpath, with the last one being the file name or path to
+# be converted.
+#
+# Specify the absolute *nix (or w32) name to cygpath in the LT_CYGPATH
+# environment variable; do not put it in $PATH.
+func_cygpath ()
+{
+ $opt_debug
+ if test -n "$LT_CYGPATH" && test -f "$LT_CYGPATH"; then
+ func_cygpath_result=`$LT_CYGPATH "$@" 2>/dev/null`
+ if test "$?" -ne 0; then
+ # on failure, ensure result is empty
+ func_cygpath_result=
+ fi
+ else
+ func_cygpath_result=
+ func_error "LT_CYGPATH is empty or specifies non-existent file: \`$LT_CYGPATH'"
+ fi
+}
+#end: func_cygpath
+
+
+# func_convert_core_msys_to_w32 ARG
+# Convert file name or path ARG from MSYS format to w32 format. Return
+# result in func_convert_core_msys_to_w32_result.
+func_convert_core_msys_to_w32 ()
+{
+ $opt_debug
+ # awkward: cmd appends spaces to result
+ func_convert_core_msys_to_w32_result=`( cmd //c echo "$1" ) 2>/dev/null |
+ $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
+}
+#end: func_convert_core_msys_to_w32
+
+
+# func_convert_file_check ARG1 ARG2
+# Verify that ARG1 (a file name in $build format) was converted to $host
+# format in ARG2. Otherwise, emit an error message, but continue (resetting
+# func_to_host_file_result to ARG1).
+func_convert_file_check ()
+{
+ $opt_debug
+ if test -z "$2" && test -n "$1" ; then
+ func_error "Could not determine host file name corresponding to"
+ func_error " \`$1'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback:
+ func_to_host_file_result="$1"
+ fi
+}
+# end func_convert_file_check
+
+
+# func_convert_path_check FROM_PATHSEP TO_PATHSEP FROM_PATH TO_PATH
+# Verify that FROM_PATH (a path in $build format) was converted to $host
+# format in TO_PATH. Otherwise, emit an error message, but continue, resetting
+# func_to_host_file_result to a simplistic fallback value (see below).
+func_convert_path_check ()
+{
+ $opt_debug
+ if test -z "$4" && test -n "$3"; then
+ func_error "Could not determine the host path corresponding to"
+ func_error " \`$3'"
+ func_error "Continuing, but uninstalled executables may not work."
+ # Fallback. This is a deliberately simplistic "conversion" and
+ # should not be "improved". See libtool.info.
+ if test "x$1" != "x$2"; then
+ lt_replace_pathsep_chars="s|$1|$2|g"
+ func_to_host_path_result=`echo "$3" |
+ $SED -e "$lt_replace_pathsep_chars"`
+ else
+ func_to_host_path_result="$3"
+ fi
+ fi
+}
+# end func_convert_path_check
+
+
+# func_convert_path_front_back_pathsep FRONTPAT BACKPAT REPL ORIG
+# Modifies func_to_host_path_result by prepending REPL if ORIG matches FRONTPAT
+# and appending REPL if ORIG matches BACKPAT.
+func_convert_path_front_back_pathsep ()
+{
+ $opt_debug
+ case $4 in
+ $1 ) func_to_host_path_result="$3$func_to_host_path_result"
+ ;;
+ esac
+ case $4 in
+ $2 ) func_append func_to_host_path_result "$3"
+ ;;
+ esac
+}
+# end func_convert_path_front_back_pathsep
+
+
+##################################################
+# $build to $host FILE NAME CONVERSION FUNCTIONS #
+##################################################
+# invoked via `$to_host_file_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# Result will be available in $func_to_host_file_result.
+
+
+# func_to_host_file ARG
+# Converts the file name ARG from $build format to $host format. Return result
+# in func_to_host_file_result.
+func_to_host_file ()
+{
+ $opt_debug
+ $to_host_file_cmd "$1"
+}
+# end func_to_host_file
+
+
+# func_to_tool_file ARG LAZY
+# converts the file name ARG from $build format to toolchain format. Return
+# result in func_to_tool_file_result. If the conversion in use is listed
+# in (the comma separated) LAZY, no conversion takes place.
+func_to_tool_file ()
+{
+ $opt_debug
+ case ,$2, in
+ *,"$to_tool_file_cmd",*)
+ func_to_tool_file_result=$1
+ ;;
+ *)
+ $to_tool_file_cmd "$1"
+ func_to_tool_file_result=$func_to_host_file_result
+ ;;
+ esac
+}
+# end func_to_tool_file
+
+
+# func_convert_file_noop ARG
+# Copy ARG to func_to_host_file_result.
+func_convert_file_noop ()
+{
+ func_to_host_file_result="$1"
+}
+# end func_convert_file_noop
+
+
+# func_convert_file_msys_to_w32 ARG
+# Convert file name ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_file_result.
+func_convert_file_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_msys_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_w32
+
+
+# func_convert_file_cygwin_to_w32 ARG
+# Convert file name ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_file_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # because $build is cygwin, we call "the" cygpath in $PATH; no need to use
+ # LT_CYGPATH in this case.
+ func_to_host_file_result=`cygpath -m "$1"`
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_cygwin_to_w32
+
+
+# func_convert_file_nix_to_w32 ARG
+# Convert file name ARG from *nix to w32 format. Requires a wine environment
+# and a working winepath. Returns result in func_to_host_file_result.
+func_convert_file_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_file_wine_to_w32 "$1"
+ func_to_host_file_result="$func_convert_core_file_wine_to_w32_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_w32
+
+
+# func_convert_file_msys_to_cygwin ARG
+# Convert file name ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_file_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ func_convert_core_msys_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_msys_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_msys_to_cygwin
+
+
+# func_convert_file_nix_to_cygwin ARG
+# Convert file name ARG from *nix to Cygwin format. Requires Cygwin installed
+# in a wine environment, working winepath, and LT_CYGPATH set. Returns result
+# in func_to_host_file_result.
+func_convert_file_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_file_result="$1"
+ if test -n "$1"; then
+ # convert from *nix to w32, then use cygpath to convert from w32 to cygwin.
+ func_convert_core_file_wine_to_w32 "$1"
+ func_cygpath -u "$func_convert_core_file_wine_to_w32_result"
+ func_to_host_file_result="$func_cygpath_result"
+ fi
+ func_convert_file_check "$1" "$func_to_host_file_result"
+}
+# end func_convert_file_nix_to_cygwin
+
+
+#############################################
+# $build to $host PATH CONVERSION FUNCTIONS #
+#############################################
+# invoked via `$to_host_path_cmd ARG'
+#
+# In each case, ARG is the path to be converted from $build to $host format.
+# The result will be available in $func_to_host_path_result.
+#
+# Path separators are also converted from $build format to $host format. If
+# ARG begins or ends with a path separator character, it is preserved (but
+# converted to $host format) on output.
+#
+# All path conversion functions are named using the following convention:
+# file name conversion function : func_convert_file_X_to_Y ()
+# path conversion function : func_convert_path_X_to_Y ()
+# where, for any given $build/$host combination the 'X_to_Y' value is the
+# same. If conversion functions are added for new $build/$host combinations,
+# the two new functions must follow this pattern, or func_init_to_host_path_cmd
+# will break.
+
+
+# func_init_to_host_path_cmd
+# Ensures that function "pointer" variable $to_host_path_cmd is set to the
+# appropriate value, based on the value of $to_host_file_cmd.
+to_host_path_cmd=
+func_init_to_host_path_cmd ()
+{
+ $opt_debug
+ if test -z "$to_host_path_cmd"; then
+ func_stripname 'func_convert_file_' '' "$to_host_file_cmd"
+ to_host_path_cmd="func_convert_path_${func_stripname_result}"
+ fi
+}
+
+
+# func_to_host_path ARG
+# Converts the path ARG from $build format to $host format. Return result
+# in func_to_host_path_result.
+func_to_host_path ()
+{
+ $opt_debug
+ func_init_to_host_path_cmd
+ $to_host_path_cmd "$1"
+}
+# end func_to_host_path
+
+
+# func_convert_path_noop ARG
+# Copy ARG to func_to_host_path_result.
+func_convert_path_noop ()
+{
+ func_to_host_path_result="$1"
+}
+# end func_convert_path_noop
+
+
+# func_convert_path_msys_to_w32 ARG
+# Convert path ARG from (mingw) MSYS to (mingw) w32 format; automatic
+# conversion to w32 is not available inside the cwrapper. Returns result in
+# func_to_host_path_result.
+func_convert_path_msys_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from ARG. MSYS
+ # behavior is inconsistent here; cygpath turns them into '.;' and ';.';
+ # and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_msys_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_msys_to_w32
+
+
+# func_convert_path_cygwin_to_w32 ARG
+# Convert path ARG from Cygwin to w32 format. Returns result in
+# func_to_host_file_result.
+func_convert_path_cygwin_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_to_host_path_result=`cygpath -m -p "$func_to_host_path_tmp1"`
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_cygwin_to_w32
+
+
+# func_convert_path_nix_to_w32 ARG
+# Convert path ARG from *nix to w32 format. Requires a wine environment and
+# a working winepath. Returns result in func_to_host_file_result.
+func_convert_path_nix_to_w32 ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_to_host_path_result="$func_convert_core_path_wine_to_w32_result"
+ func_convert_path_check : ";" \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" ";" "$1"
+ fi
+}
+# end func_convert_path_nix_to_w32
+
+
+# func_convert_path_msys_to_cygwin ARG
+# Convert path ARG from MSYS to Cygwin format. Requires LT_CYGPATH set.
+# Returns result in func_to_host_file_result.
+func_convert_path_msys_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # See func_convert_path_msys_to_w32:
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_msys_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_msys_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_msys_to_cygwin
+
+
+# func_convert_path_nix_to_cygwin ARG
+# Convert path ARG from *nix to Cygwin format. Requires Cygwin installed in a
+# a wine environment, working winepath, and LT_CYGPATH set. Returns result in
+# func_to_host_file_result.
+func_convert_path_nix_to_cygwin ()
+{
+ $opt_debug
+ func_to_host_path_result="$1"
+ if test -n "$1"; then
+ # Remove leading and trailing path separator characters from
+ # ARG. msys behavior is inconsistent here, cygpath turns them
+ # into '.;' and ';.', and winepath ignores them completely.
+ func_stripname : : "$1"
+ func_to_host_path_tmp1=$func_stripname_result
+ func_convert_core_path_wine_to_w32 "$func_to_host_path_tmp1"
+ func_cygpath -u -p "$func_convert_core_path_wine_to_w32_result"
+ func_to_host_path_result="$func_cygpath_result"
+ func_convert_path_check : : \
+ "$func_to_host_path_tmp1" "$func_to_host_path_result"
+ func_convert_path_front_back_pathsep ":*" "*:" : "$1"
+ fi
+}
+# end func_convert_path_nix_to_cygwin
+
+
# func_mode_compile arg...
func_mode_compile ()
{
@@ -1303,12 +1986,12 @@ func_mode_compile ()
;;
-pie | -fpie | -fPIE)
- pie_flag="$pie_flag $arg"
+ func_append pie_flag " $arg"
continue
;;
-shared | -static | -prefer-pic | -prefer-non-pic)
- later="$later $arg"
+ func_append later " $arg"
continue
;;
@@ -1329,15 +2012,14 @@ func_mode_compile ()
save_ifs="$IFS"; IFS=','
for arg in $args; do
IFS="$save_ifs"
- func_quote_for_eval "$arg"
- lastarg="$lastarg $func_quote_for_eval_result"
+ func_append_quoted lastarg "$arg"
done
IFS="$save_ifs"
func_stripname ' ' '' "$lastarg"
lastarg=$func_stripname_result
# Add the arguments to base_compile.
- base_compile="$base_compile $lastarg"
+ func_append base_compile " $lastarg"
continue
;;
@@ -1353,8 +2035,7 @@ func_mode_compile ()
esac # case $arg_mode
# Aesthetically quote the previous argument.
- func_quote_for_eval "$lastarg"
- base_compile="$base_compile $func_quote_for_eval_result"
+ func_append_quoted base_compile "$lastarg"
done # for arg
case $arg_mode in
@@ -1379,7 +2060,7 @@ func_mode_compile ()
*.[cCFSifmso] | \
*.ada | *.adb | *.ads | *.asm | \
*.c++ | *.cc | *.ii | *.class | *.cpp | *.cxx | \
- *.[fF][09]? | *.for | *.java | *.obj | *.sx | *.cu | *.cup)
+ *.[fF][09]? | *.for | *.java | *.go | *.obj | *.sx | *.cu | *.cup)
func_xform "$libobj"
libobj=$func_xform_result
;;
@@ -1485,17 +2166,16 @@ compiler."
$opt_dry_run || $RM $removelist
exit $EXIT_FAILURE
fi
- removelist="$removelist $output_obj"
+ func_append removelist " $output_obj"
$ECHO "$srcfile" > "$lockfile"
fi
$opt_dry_run || $RM $removelist
- removelist="$removelist $lockfile"
+ func_append removelist " $lockfile"
trap '$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE' 1 2 15
- if test -n "$fix_srcfile_path"; then
- eval srcfile=\"$fix_srcfile_path\"
- fi
+ func_to_tool_file "$srcfile" func_convert_file_msys_to_w32
+ srcfile=$func_to_tool_file_result
func_quote_for_eval "$srcfile"
qsrcfile=$func_quote_for_eval_result
@@ -1515,7 +2195,7 @@ compiler."
if test -z "$output_obj"; then
# Place PIC objects in $objdir
- command="$command -o $lobj"
+ func_append command " -o $lobj"
fi
func_show_eval_locale "$command" \
@@ -1562,11 +2242,11 @@ compiler."
command="$base_compile $qsrcfile $pic_flag"
fi
if test "$compiler_c_o" = yes; then
- command="$command -o $obj"
+ func_append command " -o $obj"
fi
# Suppress compiler output if we already did a PIC compilation.
- command="$command$suppress_output"
+ func_append command "$suppress_output"
func_show_eval_locale "$command" \
'$opt_dry_run || $RM $removelist; exit $EXIT_FAILURE'
@@ -1611,13 +2291,13 @@ compiler."
}
$opt_help || {
- test "$mode" = compile && func_mode_compile ${1+"$@"}
+ test "$opt_mode" = compile && func_mode_compile ${1+"$@"}
}
func_mode_help ()
{
# We need to display help for each of the modes.
- case $mode in
+ case $opt_mode in
"")
# Generic help is extracted from the usage comments
# at the start of this file.
@@ -1793,7 +2473,7 @@ Otherwise, only FILE itself is deleted using RM."
;;
*)
- func_fatal_help "invalid operation mode \`$mode'"
+ func_fatal_help "invalid operation mode \`$opt_mode'"
;;
esac
@@ -1808,13 +2488,13 @@ if $opt_help; then
else
{
func_help noexit
- for mode in compile link execute install finish uninstall clean; do
+ for opt_mode in compile link execute install finish uninstall clean; do
func_mode_help
done
} | sed -n '1p; 2,$s/^Usage:/ or: /p'
{
func_help noexit
- for mode in compile link execute install finish uninstall clean; do
+ for opt_mode in compile link execute install finish uninstall clean; do
echo
func_mode_help
done
@@ -1843,13 +2523,16 @@ func_mode_execute ()
func_fatal_help "you must specify a COMMAND"
# Handle -dlopen flags immediately.
- for file in $execute_dlfiles; do
+ for file in $opt_dlopen; do
test -f "$file" \
|| func_fatal_help "\`$file' is not a file"
dir=
case $file in
*.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
# Check to see that this really is a libtool archive.
func_lalib_unsafe_p "$file" \
|| func_fatal_help "\`$lib' is not a valid libtool archive"
@@ -1871,7 +2554,7 @@ func_mode_execute ()
dir="$func_dirname_result"
if test -f "$dir/$objdir/$dlname"; then
- dir="$dir/$objdir"
+ func_append dir "/$objdir"
else
if test ! -f "$dir/$dlname"; then
func_fatal_error "cannot find \`$dlname' in \`$dir' or \`$dir/$objdir'"
@@ -1928,8 +2611,7 @@ func_mode_execute ()
;;
esac
# Quote arguments (to preserve shell metacharacters).
- func_quote_for_eval "$file"
- args="$args $func_quote_for_eval_result"
+ func_append_quoted args "$file"
done
if test "X$opt_dry_run" = Xfalse; then
@@ -1961,22 +2643,59 @@ func_mode_execute ()
fi
}
-test "$mode" = execute && func_mode_execute ${1+"$@"}
+test "$opt_mode" = execute && func_mode_execute ${1+"$@"}
# func_mode_finish arg...
func_mode_finish ()
{
$opt_debug
- libdirs="$nonopt"
+ libs=
+ libdirs=
admincmds=
- if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
- for dir
- do
- libdirs="$libdirs $dir"
- done
+ for opt in "$nonopt" ${1+"$@"}
+ do
+ if test -d "$opt"; then
+ func_append libdirs " $opt"
+ elif test -f "$opt"; then
+ if func_lalib_unsafe_p "$opt"; then
+ func_append libs " $opt"
+ else
+ func_warning "\`$opt' is not a valid libtool archive"
+ fi
+
+ else
+ func_fatal_error "invalid argument \`$opt'"
+ fi
+ done
+
+ if test -n "$libs"; then
+ if test -n "$lt_sysroot"; then
+ sysroot_regex=`$ECHO "$lt_sysroot" | $SED "$sed_make_literal_regex"`
+ sysroot_cmd="s/\([ ']\)$sysroot_regex/\1/g;"
+ else
+ sysroot_cmd=
+ fi
+
+ # Remove sysroot references
+ if $opt_dry_run; then
+ for lib in $libs; do
+ echo "removing references to $lt_sysroot and \`=' prefixes from $lib"
+ done
+ else
+ tmpdir=`func_mktempdir`
+ for lib in $libs; do
+ sed -e "${sysroot_cmd} s/\([ ']-[LR]\)=/\1/g; s/\([ ']\)=/\1/g" $lib \
+ > $tmpdir/tmp-la
+ mv -f $tmpdir/tmp-la $lib
+ done
+ ${RM}r "$tmpdir"
+ fi
+ fi
+
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
for libdir in $libdirs; do
if test -n "$finish_cmds"; then
# Do each command in the finish commands.
@@ -1986,7 +2705,7 @@ func_mode_finish ()
if test -n "$finish_eval"; then
# Do the single finish_eval.
eval cmds=\"$finish_eval\"
- $opt_dry_run || eval "$cmds" || admincmds="$admincmds
+ $opt_dry_run || eval "$cmds" || func_append admincmds "
$cmds"
fi
done
@@ -1995,53 +2714,55 @@ func_mode_finish ()
# Exit here if they wanted silent mode.
$opt_silent && exit $EXIT_SUCCESS
- echo "----------------------------------------------------------------------"
- echo "Libraries have been installed in:"
- for libdir in $libdirs; do
- $ECHO " $libdir"
- done
- echo
- echo "If you ever happen to want to link against installed libraries"
- echo "in a given directory, LIBDIR, you must either use libtool, and"
- echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
- echo "flag during linking and do at least one of the following:"
- if test -n "$shlibpath_var"; then
- echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
- echo " during execution"
- fi
- if test -n "$runpath_var"; then
- echo " - add LIBDIR to the \`$runpath_var' environment variable"
- echo " during linking"
- fi
- if test -n "$hardcode_libdir_flag_spec"; then
- libdir=LIBDIR
- eval flag=\"$hardcode_libdir_flag_spec\"
+ if test -n "$finish_cmds$finish_eval" && test -n "$libdirs"; then
+ echo "----------------------------------------------------------------------"
+ echo "Libraries have been installed in:"
+ for libdir in $libdirs; do
+ $ECHO " $libdir"
+ done
+ echo
+ echo "If you ever happen to want to link against installed libraries"
+ echo "in a given directory, LIBDIR, you must either use libtool, and"
+ echo "specify the full pathname of the library, or use the \`-LLIBDIR'"
+ echo "flag during linking and do at least one of the following:"
+ if test -n "$shlibpath_var"; then
+ echo " - add LIBDIR to the \`$shlibpath_var' environment variable"
+ echo " during execution"
+ fi
+ if test -n "$runpath_var"; then
+ echo " - add LIBDIR to the \`$runpath_var' environment variable"
+ echo " during linking"
+ fi
+ if test -n "$hardcode_libdir_flag_spec"; then
+ libdir=LIBDIR
+ eval flag=\"$hardcode_libdir_flag_spec\"
- $ECHO " - use the \`$flag' linker flag"
- fi
- if test -n "$admincmds"; then
- $ECHO " - have your system administrator run these commands:$admincmds"
- fi
- if test -f /etc/ld.so.conf; then
- echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
- fi
- echo
+ $ECHO " - use the \`$flag' linker flag"
+ fi
+ if test -n "$admincmds"; then
+ $ECHO " - have your system administrator run these commands:$admincmds"
+ fi
+ if test -f /etc/ld.so.conf; then
+ echo " - have your system administrator add LIBDIR to \`/etc/ld.so.conf'"
+ fi
+ echo
- echo "See any operating system documentation about shared libraries for"
- case $host in
- solaris2.[6789]|solaris2.1[0-9])
- echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
- echo "pages."
- ;;
- *)
- echo "more information, such as the ld(1) and ld.so(8) manual pages."
- ;;
- esac
- echo "----------------------------------------------------------------------"
+ echo "See any operating system documentation about shared libraries for"
+ case $host in
+ solaris2.[6789]|solaris2.1[0-9])
+ echo "more information, such as the ld(1), crle(1) and ld.so(8) manual"
+ echo "pages."
+ ;;
+ *)
+ echo "more information, such as the ld(1) and ld.so(8) manual pages."
+ ;;
+ esac
+ echo "----------------------------------------------------------------------"
+ fi
exit $EXIT_SUCCESS
}
-test "$mode" = finish && func_mode_finish ${1+"$@"}
+test "$opt_mode" = finish && func_mode_finish ${1+"$@"}
# func_mode_install arg...
@@ -2066,7 +2787,7 @@ func_mode_install ()
# The real first argument should be the name of the installation program.
# Aesthetically quote it.
func_quote_for_eval "$arg"
- install_prog="$install_prog$func_quote_for_eval_result"
+ func_append install_prog "$func_quote_for_eval_result"
install_shared_prog=$install_prog
case " $install_prog " in
*[\\\ /]cp\ *) install_cp=: ;;
@@ -2086,7 +2807,7 @@ func_mode_install ()
do
arg2=
if test -n "$dest"; then
- files="$files $dest"
+ func_append files " $dest"
dest=$arg
continue
fi
@@ -2124,11 +2845,11 @@ func_mode_install ()
# Aesthetically quote the argument.
func_quote_for_eval "$arg"
- install_prog="$install_prog $func_quote_for_eval_result"
+ func_append install_prog " $func_quote_for_eval_result"
if test -n "$arg2"; then
func_quote_for_eval "$arg2"
fi
- install_shared_prog="$install_shared_prog $func_quote_for_eval_result"
+ func_append install_shared_prog " $func_quote_for_eval_result"
done
test -z "$install_prog" && \
@@ -2140,7 +2861,7 @@ func_mode_install ()
if test -n "$install_override_mode" && $no_mode; then
if $install_cp; then :; else
func_quote_for_eval "$install_override_mode"
- install_shared_prog="$install_shared_prog -m $func_quote_for_eval_result"
+ func_append install_shared_prog " -m $func_quote_for_eval_result"
fi
fi
@@ -2198,10 +2919,13 @@ func_mode_install ()
case $file in
*.$libext)
# Do the static libraries later.
- staticlibs="$staticlibs $file"
+ func_append staticlibs " $file"
;;
*.la)
+ func_resolve_sysroot "$file"
+ file=$func_resolve_sysroot_result
+
# Check to see that this really is a libtool archive.
func_lalib_unsafe_p "$file" \
|| func_fatal_help "\`$file' is not a valid libtool archive"
@@ -2215,19 +2939,19 @@ func_mode_install ()
if test "X$destdir" = "X$libdir"; then
case "$current_libdirs " in
*" $libdir "*) ;;
- *) current_libdirs="$current_libdirs $libdir" ;;
+ *) func_append current_libdirs " $libdir" ;;
esac
else
# Note the libdir as a future libdir.
case "$future_libdirs " in
*" $libdir "*) ;;
- *) future_libdirs="$future_libdirs $libdir" ;;
+ *) func_append future_libdirs " $libdir" ;;
esac
fi
func_dirname "$file" "/" ""
dir="$func_dirname_result"
- dir="$dir$objdir"
+ func_append dir "$objdir"
if test -n "$relink_command"; then
# Determine the prefix the user has applied to our future dir.
@@ -2240,7 +2964,7 @@ func_mode_install ()
# are installed into $libdir/../bin (currently, that works fine)
# but it's something to keep an eye on.
test "$inst_prefix_dir" = "$destdir" && \
- func_error "error: cannot install \`$file' to a directory not ending in $libdir"
+ func_fatal_error "error: cannot install \`$file' to a directory not ending in $libdir"
if test -n "$inst_prefix_dir"; then
# Stick the inst_prefix_dir data into the link command.
@@ -2304,7 +3028,7 @@ func_mode_install ()
func_show_eval "$install_prog $instname $destdir/$name" 'exit $?'
# Maybe install the static library, too.
- test -n "$old_library" && staticlibs="$staticlibs $dir/$old_library"
+ test -n "$old_library" && func_append staticlibs " $dir/$old_library"
;;
*.lo)
@@ -2478,11 +3202,13 @@ func_mode_install ()
# Set up the ranlib parameters.
oldlib="$destdir/$name"
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
func_show_eval "$install_prog \$file \$oldlib" 'exit $?'
if test -n "$stripme" && test -n "$old_striplib"; then
- func_show_eval "$old_striplib $oldlib" 'exit $?'
+ func_show_eval "$old_striplib $tool_oldlib" 'exit $?'
fi
# Do each command in the postinstall commands.
@@ -2501,7 +3227,7 @@ func_mode_install ()
fi
}
-test "$mode" = install && func_mode_install ${1+"$@"}
+test "$opt_mode" = install && func_mode_install ${1+"$@"}
# func_generate_dlsyms outputname originator pic_p
@@ -2548,6 +3274,18 @@ extern \"C\" {
#pragma GCC diagnostic ignored \"-Wstrict-prototypes\"
#endif
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT_DLSYM_CONST
+#else
+# define LT_DLSYM_CONST const
+#endif
+
/* External symbol declarations for the compiler. */\
"
@@ -2559,8 +3297,9 @@ extern \"C\" {
# Add our own program objects to the symbol list.
progfiles=`$ECHO "$objs$old_deplibs" | $SP2NL | $SED "$lo2o" | $NL2SP`
for progfile in $progfiles; do
- func_verbose "extracting global C symbols from \`$progfile'"
- $opt_dry_run || eval "$NM $progfile | $global_symbol_pipe >> '$nlist'"
+ func_to_tool_file "$progfile" func_convert_file_msys_to_w32
+ func_verbose "extracting global C symbols from \`$func_to_tool_file_result'"
+ $opt_dry_run || eval "$NM $func_to_tool_file_result | $global_symbol_pipe >> '$nlist'"
done
if test -n "$exclude_expsyms"; then
@@ -2609,10 +3348,52 @@ extern \"C\" {
func_verbose "extracting global C symbols from \`$dlprefile'"
func_basename "$dlprefile"
name="$func_basename_result"
- $opt_dry_run || {
- eval '$ECHO ": $name " >> "$nlist"'
- eval "$NM $dlprefile 2>/dev/null | $global_symbol_pipe >> '$nlist'"
- }
+ case $host in
+ *cygwin* | *mingw* | *cegcc* )
+ # if an import library, we need to obtain dlname
+ if func_win32_import_lib_p "$dlprefile"; then
+ func_tr_sh "$dlprefile"
+ eval "curr_lafile=\$libfile_$func_tr_sh_result"
+ dlprefile_dlbasename=""
+ if test -n "$curr_lafile" && func_lalib_p "$curr_lafile"; then
+ # Use subshell, to avoid clobbering current variable values
+ dlprefile_dlname=`source "$curr_lafile" && echo "$dlname"`
+ if test -n "$dlprefile_dlname" ; then
+ func_basename "$dlprefile_dlname"
+ dlprefile_dlbasename="$func_basename_result"
+ else
+ # no lafile. user explicitly requested -dlpreopen <import library>.
+ $sharedlib_from_linklib_cmd "$dlprefile"
+ dlprefile_dlbasename=$sharedlib_from_linklib_result
+ fi
+ fi
+ $opt_dry_run || {
+ if test -n "$dlprefile_dlbasename" ; then
+ eval '$ECHO ": $dlprefile_dlbasename" >> "$nlist"'
+ else
+ func_warning "Could not compute DLL name from $name"
+ eval '$ECHO ": $name " >> "$nlist"'
+ fi
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe |
+ $SED -e '/I __imp/d' -e 's/I __nm_/D /;s/_nm__//' >> '$nlist'"
+ }
+ else # not an import lib
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ fi
+ ;;
+ *)
+ $opt_dry_run || {
+ eval '$ECHO ": $name " >> "$nlist"'
+ func_to_tool_file "$dlprefile" func_convert_file_msys_to_w32
+ eval "$NM \"$func_to_tool_file_result\" 2>/dev/null | $global_symbol_pipe >> '$nlist'"
+ }
+ ;;
+ esac
done
$opt_dry_run || {
@@ -2650,26 +3431,9 @@ typedef struct {
const char *name;
void *address;
} lt_dlsymlist;
-"
- case $host in
- *cygwin* | *mingw* | *cegcc* )
- echo >> "$output_objdir/$my_dlsyms" "\
-/* DATA imports from DLLs on WIN32 con't be const, because
- runtime relocations are performed -- see ld's documentation
- on pseudo-relocs. */"
- lt_dlsym_const= ;;
- *osf5*)
- echo >> "$output_objdir/$my_dlsyms" "\
-/* This system does not cope well with relocations in const data */"
- lt_dlsym_const= ;;
- *)
- lt_dlsym_const=const ;;
- esac
-
- echo >> "$output_objdir/$my_dlsyms" "\
-extern $lt_dlsym_const lt_dlsymlist
+extern LT_DLSYM_CONST lt_dlsymlist
lt_${my_prefix}_LTX_preloaded_symbols[];
-$lt_dlsym_const lt_dlsymlist
+LT_DLSYM_CONST lt_dlsymlist
lt_${my_prefix}_LTX_preloaded_symbols[] =
{\
{ \"$my_originator\", (void *) 0 },"
@@ -2709,7 +3473,7 @@ static const void *lt_preloaded_setup() {
# linked before any other PIC object. But we must not use
# pic_flag when linking with -static. The problem exists in
# FreeBSD 2.2.6 and is fixed in FreeBSD 3.1.
- *-*-freebsd2*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
+ *-*-freebsd2.*|*-*-freebsd3.0*|*-*-freebsdelf3.0*)
pic_flag_for_symtable=" $pic_flag -DFREEBSD_WORKAROUND" ;;
*-*-hpux*)
pic_flag_for_symtable=" $pic_flag" ;;
@@ -2725,7 +3489,7 @@ static const void *lt_preloaded_setup() {
for arg in $LTCFLAGS; do
case $arg in
-pie | -fpie | -fPIE) ;;
- *) symtab_cflags="$symtab_cflags $arg" ;;
+ *) func_append symtab_cflags " $arg" ;;
esac
done
@@ -2788,7 +3552,8 @@ func_win32_libid ()
# Keep the egrep pattern in sync with the one in _LT_CHECK_MAGIC_METHOD.
if eval $OBJDUMP -f $1 | $SED -e '10q' 2>/dev/null |
$EGREP 'file format (pei*-i386(.*architecture: i386)?|pe-arm-wince|pe-x86-64)' >/dev/null; then
- win32_nmres=`eval $NM -f posix -A $1 |
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ win32_nmres=`eval $NM -f posix -A \"$func_to_tool_file_result\" |
$SED -n -e '
1,100{
/ I /{
@@ -2817,6 +3582,131 @@ func_win32_libid ()
$ECHO "$win32_libid_type"
}
+# func_cygming_dll_for_implib ARG
+#
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib ()
+{
+ $opt_debug
+ sharedlib_from_linklib_result=`$DLLTOOL --identify-strict --identify "$1"`
+}
+
+# func_cygming_dll_for_implib_fallback_core SECTION_NAME LIBNAMEs
+#
+# The is the core of a fallback implementation of a
+# platform-specific function to extract the name of the
+# DLL associated with the specified import library LIBNAME.
+#
+# SECTION_NAME is either .idata$6 or .idata$7, depending
+# on the platform and compiler that created the implib.
+#
+# Echos the name of the DLL associated with the
+# specified import library.
+func_cygming_dll_for_implib_fallback_core ()
+{
+ $opt_debug
+ match_literal=`$ECHO "$1" | $SED "$sed_make_literal_regex"`
+ $OBJDUMP -s --section "$1" "$2" 2>/dev/null |
+ $SED '/^Contents of section '"$match_literal"':/{
+ # Place marker at beginning of archive member dllname section
+ s/.*/====MARK====/
+ p
+ d
+ }
+ # These lines can sometimes be longer than 43 characters, but
+ # are always uninteresting
+ /:[ ]*file format pe[i]\{,1\}-/d
+ /^In archive [^:]*:/d
+ # Ensure marker is printed
+ /^====MARK====/p
+ # Remove all lines with less than 43 characters
+ /^.\{43\}/!d
+ # From remaining lines, remove first 43 characters
+ s/^.\{43\}//' |
+ $SED -n '
+ # Join marker and all lines until next marker into a single line
+ /^====MARK====/ b para
+ H
+ $ b para
+ b
+ :para
+ x
+ s/\n//g
+ # Remove the marker
+ s/^====MARK====//
+ # Remove trailing dots and whitespace
+ s/[\. \t]*$//
+ # Print
+ /./p' |
+ # we now have a list, one entry per line, of the stringified
+ # contents of the appropriate section of all members of the
+ # archive which possess that section. Heuristic: eliminate
+ # all those which have a first or second character that is
+ # a '.' (that is, objdump's representation of an unprintable
+ # character.) This should work for all archives with less than
+ # 0x302f exports -- but will fail for DLLs whose name actually
+ # begins with a literal '.' or a single character followed by
+ # a '.'.
+ #
+ # Of those that remain, print the first one.
+ $SED -e '/^\./d;/^.\./d;q'
+}
+
+# func_cygming_gnu_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is a GNU/binutils-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_gnu_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_gnu_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $EGREP ' (_head_[A-Za-z0-9_]+_[ad]l*|[A-Za-z0-9_]+_[ad]l*_iname)$'`
+ test -n "$func_cygming_gnu_implib_tmp"
+}
+
+# func_cygming_ms_implib_p ARG
+# This predicate returns with zero status (TRUE) if
+# ARG is an MS-style import library. Returns
+# with nonzero status (FALSE) otherwise.
+func_cygming_ms_implib_p ()
+{
+ $opt_debug
+ func_to_tool_file "$1" func_convert_file_msys_to_w32
+ func_cygming_ms_implib_tmp=`$NM "$func_to_tool_file_result" | eval "$global_symbol_pipe" | $GREP '_NULL_IMPORT_DESCRIPTOR'`
+ test -n "$func_cygming_ms_implib_tmp"
+}
+
+# func_cygming_dll_for_implib_fallback ARG
+# Platform-specific function to extract the
+# name of the DLL associated with the specified
+# import library ARG.
+#
+# This fallback implementation is for use when $DLLTOOL
+# does not support the --identify-strict option.
+# Invoked by eval'ing the libtool variable
+# $sharedlib_from_linklib_cmd
+# Result is available in the variable
+# $sharedlib_from_linklib_result
+func_cygming_dll_for_implib_fallback ()
+{
+ $opt_debug
+ if func_cygming_gnu_implib_p "$1" ; then
+ # binutils import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$7' "$1"`
+ elif func_cygming_ms_implib_p "$1" ; then
+ # ms-generated import library
+ sharedlib_from_linklib_result=`func_cygming_dll_for_implib_fallback_core '.idata$6' "$1"`
+ else
+ # unknown
+ sharedlib_from_linklib_result=""
+ fi
+}
# func_extract_an_archive dir oldlib
@@ -3095,14 +3985,17 @@ func_exec_program_core ()
# launches target application with the remaining arguments.
func_exec_program ()
{
- for lt_wr_arg
- do
- case \$lt_wr_arg in
- --lt-*) ;;
- *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
- esac
- shift
- done
+ case \" \$* \" in
+ *\\ --lt-*)
+ for lt_wr_arg
+ do
+ case \$lt_wr_arg in
+ --lt-*) ;;
+ *) set x \"\$@\" \"\$lt_wr_arg\"; shift;;
+ esac
+ shift
+ done ;;
+ esac
func_exec_program_core \${1+\"\$@\"}
}
@@ -3195,6 +4088,18 @@ func_exec_program ()
if test -f \"\$progdir/\$program\"; then"
+ # fixup the dll searchpath if we need to.
+ #
+ # Fix the DLL searchpath if we need to. Do this before prepending
+ # to shlibpath, because on Windows, both are PATH and uninstalled
+ # libraries must come first.
+ if test -n "$dllsearchpath"; then
+ $ECHO "\
+ # Add the dll search path components to the executable PATH
+ PATH=$dllsearchpath:\$PATH
+"
+ fi
+
# Export our shlibpath_var if we have one.
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
$ECHO "\
@@ -3209,14 +4114,6 @@ func_exec_program ()
"
fi
- # fixup the dll searchpath if we need to.
- if test -n "$dllsearchpath"; then
- $ECHO "\
- # Add the dll search path components to the executable PATH
- PATH=$dllsearchpath:\$PATH
-"
- fi
-
$ECHO "\
if test \"\$libtool_execute_magic\" != \"$magic\"; then
# Run the actual program with our arguments.
@@ -3234,166 +4131,6 @@ fi\
}
-# func_to_host_path arg
-#
-# Convert paths to host format when used with build tools.
-# Intended for use with "native" mingw (where libtool itself
-# is running under the msys shell), or in the following cross-
-# build environments:
-# $build $host
-# mingw (msys) mingw [e.g. native]
-# cygwin mingw
-# *nix + wine mingw
-# where wine is equipped with the `winepath' executable.
-# In the native mingw case, the (msys) shell automatically
-# converts paths for any non-msys applications it launches,
-# but that facility isn't available from inside the cwrapper.
-# Similar accommodations are necessary for $host mingw and
-# $build cygwin. Calling this function does no harm for other
-# $host/$build combinations not listed above.
-#
-# ARG is the path (on $build) that should be converted to
-# the proper representation for $host. The result is stored
-# in $func_to_host_path_result.
-func_to_host_path ()
-{
- func_to_host_path_result="$1"
- if test -n "$1"; then
- case $host in
- *mingw* )
- lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
- case $build in
- *mingw* ) # actually, msys
- # awkward: cmd appends spaces to result
- func_to_host_path_result=`( cmd //c echo "$1" ) 2>/dev/null |
- $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
- ;;
- *cygwin* )
- func_to_host_path_result=`cygpath -w "$1" |
- $SED -e "$lt_sed_naive_backslashify"`
- ;;
- * )
- # Unfortunately, winepath does not exit with a non-zero
- # error code, so we are forced to check the contents of
- # stdout. On the other hand, if the command is not
- # found, the shell will set an exit code of 127 and print
- # *an error message* to stdout. So we must check for both
- # error code of zero AND non-empty stdout, which explains
- # the odd construction:
- func_to_host_path_tmp1=`winepath -w "$1" 2>/dev/null`
- if test "$?" -eq 0 && test -n "${func_to_host_path_tmp1}"; then
- func_to_host_path_result=`$ECHO "$func_to_host_path_tmp1" |
- $SED -e "$lt_sed_naive_backslashify"`
- else
- # Allow warning below.
- func_to_host_path_result=
- fi
- ;;
- esac
- if test -z "$func_to_host_path_result" ; then
- func_error "Could not determine host path corresponding to"
- func_error " \`$1'"
- func_error "Continuing, but uninstalled executables may not work."
- # Fallback:
- func_to_host_path_result="$1"
- fi
- ;;
- esac
- fi
-}
-# end: func_to_host_path
-
-# func_to_host_pathlist arg
-#
-# Convert pathlists to host format when used with build tools.
-# See func_to_host_path(), above. This function supports the
-# following $build/$host combinations (but does no harm for
-# combinations not listed here):
-# $build $host
-# mingw (msys) mingw [e.g. native]
-# cygwin mingw
-# *nix + wine mingw
-#
-# Path separators are also converted from $build format to
-# $host format. If ARG begins or ends with a path separator
-# character, it is preserved (but converted to $host format)
-# on output.
-#
-# ARG is a pathlist (on $build) that should be converted to
-# the proper representation on $host. The result is stored
-# in $func_to_host_pathlist_result.
-func_to_host_pathlist ()
-{
- func_to_host_pathlist_result="$1"
- if test -n "$1"; then
- case $host in
- *mingw* )
- lt_sed_naive_backslashify='s|\\\\*|\\|g;s|/|\\|g;s|\\|\\\\|g'
- # Remove leading and trailing path separator characters from
- # ARG. msys behavior is inconsistent here, cygpath turns them
- # into '.;' and ';.', and winepath ignores them completely.
- func_stripname : : "$1"
- func_to_host_pathlist_tmp1=$func_stripname_result
- case $build in
- *mingw* ) # Actually, msys.
- # Awkward: cmd appends spaces to result.
- func_to_host_pathlist_result=`
- ( cmd //c echo "$func_to_host_pathlist_tmp1" ) 2>/dev/null |
- $SED -e 's/[ ]*$//' -e "$lt_sed_naive_backslashify"`
- ;;
- *cygwin* )
- func_to_host_pathlist_result=`cygpath -w -p "$func_to_host_pathlist_tmp1" |
- $SED -e "$lt_sed_naive_backslashify"`
- ;;
- * )
- # unfortunately, winepath doesn't convert pathlists
- func_to_host_pathlist_result=""
- func_to_host_pathlist_oldIFS=$IFS
- IFS=:
- for func_to_host_pathlist_f in $func_to_host_pathlist_tmp1 ; do
- IFS=$func_to_host_pathlist_oldIFS
- if test -n "$func_to_host_pathlist_f" ; then
- func_to_host_path "$func_to_host_pathlist_f"
- if test -n "$func_to_host_path_result" ; then
- if test -z "$func_to_host_pathlist_result" ; then
- func_to_host_pathlist_result="$func_to_host_path_result"
- else
- func_append func_to_host_pathlist_result ";$func_to_host_path_result"
- fi
- fi
- fi
- done
- IFS=$func_to_host_pathlist_oldIFS
- ;;
- esac
- if test -z "$func_to_host_pathlist_result"; then
- func_error "Could not determine the host path(s) corresponding to"
- func_error " \`$1'"
- func_error "Continuing, but uninstalled executables may not work."
- # Fallback. This may break if $1 contains DOS-style drive
- # specifications. The fix is not to complicate the expression
- # below, but for the user to provide a working wine installation
- # with winepath so that path translation in the cross-to-mingw
- # case works properly.
- lt_replace_pathsep_nix_to_dos="s|:|;|g"
- func_to_host_pathlist_result=`echo "$func_to_host_pathlist_tmp1" |\
- $SED -e "$lt_replace_pathsep_nix_to_dos"`
- fi
- # Now, add the leading and trailing path separators back
- case "$1" in
- :* ) func_to_host_pathlist_result=";$func_to_host_pathlist_result"
- ;;
- esac
- case "$1" in
- *: ) func_append func_to_host_pathlist_result ";"
- ;;
- esac
- ;;
- esac
- fi
-}
-# end: func_to_host_pathlist
-
# func_emit_cwrapperexe_src
# emit the source code for a wrapper executable on stdout
# Must ONLY be called from within func_mode_link because
@@ -3563,14 +4300,14 @@ void lt_dump_script (FILE *f);
EOF
cat <<EOF
-const char * MAGIC_EXE = "$magic_exe";
+volatile const char * MAGIC_EXE = "$magic_exe";
const char * LIB_PATH_VARNAME = "$shlibpath_var";
EOF
if test "$shlibpath_overrides_runpath" = yes && test -n "$shlibpath_var" && test -n "$temp_rpath"; then
- func_to_host_pathlist "$temp_rpath"
+ func_to_host_path "$temp_rpath"
cat <<EOF
-const char * LIB_PATH_VALUE = "$func_to_host_pathlist_result";
+const char * LIB_PATH_VALUE = "$func_to_host_path_result";
EOF
else
cat <<"EOF"
@@ -3579,10 +4316,10 @@ EOF
fi
if test -n "$dllsearchpath"; then
- func_to_host_pathlist "$dllsearchpath:"
+ func_to_host_path "$dllsearchpath:"
cat <<EOF
const char * EXE_PATH_VARNAME = "PATH";
-const char * EXE_PATH_VALUE = "$func_to_host_pathlist_result";
+const char * EXE_PATH_VALUE = "$func_to_host_path_result";
EOF
else
cat <<"EOF"
@@ -3765,8 +4502,12 @@ EOF
lt_setenv ("BIN_SH", "xpg4"); /* for Tru64 */
lt_setenv ("DUALCASE", "1"); /* for MSK sh */
- lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
+ /* Update the DLL searchpath. EXE_PATH_VALUE ($dllsearchpath) must
+ be prepended before (that is, appear after) LIB_PATH_VALUE ($temp_rpath)
+ because on Windows, both *_VARNAMEs are PATH but uninstalled
+ libraries must come first. */
lt_update_exe_path (EXE_PATH_VARNAME, EXE_PATH_VALUE);
+ lt_update_lib_path (LIB_PATH_VARNAME, LIB_PATH_VALUE);
lt_debugprintf (__FILE__, __LINE__, "(main) lt_argv_zero: %s\n",
nonnull (lt_argv_zero));
@@ -4322,9 +5063,15 @@ void lt_dump_script (FILE* f)
{
EOF
func_emit_wrapper yes |
- $SED -e 's/\([\\"]\)/\\\1/g' \
- -e 's/^/ fputs ("/' -e 's/$/\\n", f);/'
-
+ $SED -n -e '
+s/^\(.\{79\}\)\(..*\)/\1\
+\2/
+h
+s/\([\\"]\)/\\\1/g
+s/$/\\n/
+s/\([^\n]*\).*/ fputs ("\1", f);/p
+g
+D'
cat <<"EOF"
}
EOF
@@ -4515,9 +5262,9 @@ func_mode_link ()
;;
*)
if test "$prev" = dlfiles; then
- dlfiles="$dlfiles $arg"
+ func_append dlfiles " $arg"
else
- dlprefiles="$dlprefiles $arg"
+ func_append dlprefiles " $arg"
fi
prev=
continue
@@ -4541,7 +5288,7 @@ func_mode_link ()
*-*-darwin*)
case "$deplibs " in
*" $qarg.ltframework "*) ;;
- *) deplibs="$deplibs $qarg.ltframework" # this is fixed later
+ *) func_append deplibs " $qarg.ltframework" # this is fixed later
;;
esac
;;
@@ -4560,7 +5307,7 @@ func_mode_link ()
moreargs=
for fil in `cat "$save_arg"`
do
-# moreargs="$moreargs $fil"
+# func_append moreargs " $fil"
arg=$fil
# A libtool-controlled object.
@@ -4589,7 +5336,7 @@ func_mode_link ()
if test "$prev" = dlfiles; then
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- dlfiles="$dlfiles $pic_object"
+ func_append dlfiles " $pic_object"
prev=
continue
else
@@ -4601,7 +5348,7 @@ func_mode_link ()
# CHECK ME: I think I busted this. -Ossama
if test "$prev" = dlprefiles; then
# Preload the old-style object.
- dlprefiles="$dlprefiles $pic_object"
+ func_append dlprefiles " $pic_object"
prev=
fi
@@ -4671,12 +5418,12 @@ func_mode_link ()
if test "$prev" = rpath; then
case "$rpath " in
*" $arg "*) ;;
- *) rpath="$rpath $arg" ;;
+ *) func_append rpath " $arg" ;;
esac
else
case "$xrpath " in
*" $arg "*) ;;
- *) xrpath="$xrpath $arg" ;;
+ *) func_append xrpath " $arg" ;;
esac
fi
prev=
@@ -4688,28 +5435,28 @@ func_mode_link ()
continue
;;
weak)
- weak_libs="$weak_libs $arg"
+ func_append weak_libs " $arg"
prev=
continue
;;
xcclinker)
- linker_flags="$linker_flags $qarg"
- compiler_flags="$compiler_flags $qarg"
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $qarg"
prev=
func_append compile_command " $qarg"
func_append finalize_command " $qarg"
continue
;;
xcompiler)
- compiler_flags="$compiler_flags $qarg"
+ func_append compiler_flags " $qarg"
prev=
func_append compile_command " $qarg"
func_append finalize_command " $qarg"
continue
;;
xlinker)
- linker_flags="$linker_flags $qarg"
- compiler_flags="$compiler_flags $wl$qarg"
+ func_append linker_flags " $qarg"
+ func_append compiler_flags " $wl$qarg"
prev=
func_append compile_command " $wl$qarg"
func_append finalize_command " $wl$qarg"
@@ -4800,15 +5547,16 @@ func_mode_link ()
;;
-L*)
- func_stripname '-L' '' "$arg"
- dir=$func_stripname_result
- if test -z "$dir"; then
+ func_stripname "-L" '' "$arg"
+ if test -z "$func_stripname_result"; then
if test "$#" -gt 0; then
func_fatal_error "require no space between \`-L' and \`$1'"
else
func_fatal_error "need path for \`-L' option"
fi
fi
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
@@ -4820,10 +5568,16 @@ func_mode_link ()
;;
esac
case "$deplibs " in
- *" -L$dir "*) ;;
+ *" -L$dir "* | *" $arg "*)
+ # Will only happen for absolute or sysroot arguments
+ ;;
*)
- deplibs="$deplibs -L$dir"
- lib_search_path="$lib_search_path $dir"
+ # Preserve sysroot, but never include relative directories
+ case $dir in
+ [\\/]* | [A-Za-z]:[\\/]* | =*) func_append deplibs " $arg" ;;
+ *) func_append deplibs " -L$dir" ;;
+ esac
+ func_append lib_search_path " $dir"
;;
esac
case $host in
@@ -4832,12 +5586,12 @@ func_mode_link ()
case :$dllsearchpath: in
*":$dir:"*) ;;
::) dllsearchpath=$dir;;
- *) dllsearchpath="$dllsearchpath:$dir";;
+ *) func_append dllsearchpath ":$dir";;
esac
case :$dllsearchpath: in
*":$testbindir:"*) ;;
::) dllsearchpath=$testbindir;;
- *) dllsearchpath="$dllsearchpath:$testbindir";;
+ *) func_append dllsearchpath ":$testbindir";;
esac
;;
esac
@@ -4861,7 +5615,7 @@ func_mode_link ()
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C and math libraries are in the System framework
- deplibs="$deplibs System.ltframework"
+ func_append deplibs " System.ltframework"
continue
;;
*-*-sco3.2v5* | *-*-sco5v6*)
@@ -4881,7 +5635,7 @@ func_mode_link ()
;;
esac
fi
- deplibs="$deplibs $arg"
+ func_append deplibs " $arg"
continue
;;
@@ -4893,21 +5647,22 @@ func_mode_link ()
# Tru64 UNIX uses -model [arg] to determine the layout of C++
# classes, name mangling, and exception handling.
# Darwin uses the -arch flag to determine output architecture.
- -model|-arch|-isysroot)
- compiler_flags="$compiler_flags $arg"
+ -model|-arch|-isysroot|--sysroot)
+ func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
prev=xcompiler
continue
;;
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
- compiler_flags="$compiler_flags $arg"
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
+ func_append compiler_flags " $arg"
func_append compile_command " $arg"
func_append finalize_command " $arg"
case "$new_inherited_linker_flags " in
*" $arg "*) ;;
- * ) new_inherited_linker_flags="$new_inherited_linker_flags $arg" ;;
+ * ) func_append new_inherited_linker_flags " $arg" ;;
esac
continue
;;
@@ -4974,13 +5729,17 @@ func_mode_link ()
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) ;;
+ =*)
+ func_stripname '=' '' "$dir"
+ dir=$lt_sysroot$func_stripname_result
+ ;;
*)
func_fatal_error "only absolute run-paths are allowed"
;;
esac
case "$xrpath " in
*" $dir "*) ;;
- *) xrpath="$xrpath $dir" ;;
+ *) func_append xrpath " $dir" ;;
esac
continue
;;
@@ -5033,8 +5792,8 @@ func_mode_link ()
for flag in $args; do
IFS="$save_ifs"
func_quote_for_eval "$flag"
- arg="$arg $func_quote_for_eval_result"
- compiler_flags="$compiler_flags $func_quote_for_eval_result"
+ func_append arg " $func_quote_for_eval_result"
+ func_append compiler_flags " $func_quote_for_eval_result"
done
IFS="$save_ifs"
func_stripname ' ' '' "$arg"
@@ -5049,9 +5808,9 @@ func_mode_link ()
for flag in $args; do
IFS="$save_ifs"
func_quote_for_eval "$flag"
- arg="$arg $wl$func_quote_for_eval_result"
- compiler_flags="$compiler_flags $wl$func_quote_for_eval_result"
- linker_flags="$linker_flags $func_quote_for_eval_result"
+ func_append arg " $wl$func_quote_for_eval_result"
+ func_append compiler_flags " $wl$func_quote_for_eval_result"
+ func_append linker_flags " $func_quote_for_eval_result"
done
IFS="$save_ifs"
func_stripname ' ' '' "$arg"
@@ -5090,13 +5849,16 @@ func_mode_link ()
# -p, -pg, --coverage, -fprofile-* profiling flags for GCC
# @file GCC response files
# -tp=* Portland pgcc target processor selection
+ # --sysroot=* for sysroot support
+ # -O*, -flto*, -fwhopr*, -fuse-linker-plugin GCC link-time optimization
-64|-mips[0-9]|-r[0-9][0-9]*|-xarch=*|-xtarget=*|+DA*|+DD*|-q*|-m*| \
- -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*)
+ -t[45]*|-txscale*|-p|-pg|--coverage|-fprofile-*|-F*|@*|-tp=*|--sysroot=*| \
+ -O*|-flto*|-fwhopr*|-fuse-linker-plugin)
func_quote_for_eval "$arg"
arg="$func_quote_for_eval_result"
func_append compile_command " $arg"
func_append finalize_command " $arg"
- compiler_flags="$compiler_flags $arg"
+ func_append compiler_flags " $arg"
continue
;;
@@ -5108,7 +5870,7 @@ func_mode_link ()
*.$objext)
# A standard object.
- objs="$objs $arg"
+ func_append objs " $arg"
;;
*.lo)
@@ -5139,7 +5901,7 @@ func_mode_link ()
if test "$prev" = dlfiles; then
if test "$build_libtool_libs" = yes && test "$dlopen_support" = yes; then
- dlfiles="$dlfiles $pic_object"
+ func_append dlfiles " $pic_object"
prev=
continue
else
@@ -5151,7 +5913,7 @@ func_mode_link ()
# CHECK ME: I think I busted this. -Ossama
if test "$prev" = dlprefiles; then
# Preload the old-style object.
- dlprefiles="$dlprefiles $pic_object"
+ func_append dlprefiles " $pic_object"
prev=
fi
@@ -5196,24 +5958,25 @@ func_mode_link ()
*.$libext)
# An archive.
- deplibs="$deplibs $arg"
- old_deplibs="$old_deplibs $arg"
+ func_append deplibs " $arg"
+ func_append old_deplibs " $arg"
continue
;;
*.la)
# A libtool-controlled library.
+ func_resolve_sysroot "$arg"
if test "$prev" = dlfiles; then
# This library was specified with -dlopen.
- dlfiles="$dlfiles $arg"
+ func_append dlfiles " $func_resolve_sysroot_result"
prev=
elif test "$prev" = dlprefiles; then
# The library was specified with -dlpreopen.
- dlprefiles="$dlprefiles $arg"
+ func_append dlprefiles " $func_resolve_sysroot_result"
prev=
else
- deplibs="$deplibs $arg"
+ func_append deplibs " $func_resolve_sysroot_result"
fi
continue
;;
@@ -5260,6 +6023,8 @@ func_mode_link ()
func_dirname "$output" "/" ""
output_objdir="$func_dirname_result$objdir"
+ func_to_tool_file "$output_objdir/"
+ tool_output_objdir=$func_to_tool_file_result
# Create the object directory.
func_mkdir_p "$output_objdir"
@@ -5280,12 +6045,12 @@ func_mode_link ()
# Find all interdependent deplibs by searching for libraries
# that are linked more than once (e.g. -la -lb -la)
for deplib in $deplibs; do
- if $opt_duplicate_deps ; then
+ if $opt_preserve_dup_deps ; then
case "$libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
fi
- libs="$libs $deplib"
+ func_append libs " $deplib"
done
if test "$linkmode" = lib; then
@@ -5298,9 +6063,9 @@ func_mode_link ()
if $opt_duplicate_compiler_generated_deps; then
for pre_post_dep in $predeps $postdeps; do
case "$pre_post_deps " in
- *" $pre_post_dep "*) specialdeplibs="$specialdeplibs $pre_post_deps" ;;
+ *" $pre_post_dep "*) func_append specialdeplibs " $pre_post_deps" ;;
esac
- pre_post_deps="$pre_post_deps $pre_post_dep"
+ func_append pre_post_deps " $pre_post_dep"
done
fi
pre_post_deps=
@@ -5367,8 +6132,9 @@ func_mode_link ()
for lib in $dlprefiles; do
# Ignore non-libtool-libs
dependency_libs=
+ func_resolve_sysroot "$lib"
case $lib in
- *.la) func_source "$lib" ;;
+ *.la) func_source "$func_resolve_sysroot_result" ;;
esac
# Collect preopened libtool deplibs, except any this library
@@ -5378,7 +6144,7 @@ func_mode_link ()
deplib_base=$func_basename_result
case " $weak_libs " in
*" $deplib_base "*) ;;
- *) deplibs="$deplibs $deplib" ;;
+ *) func_append deplibs " $deplib" ;;
esac
done
done
@@ -5394,16 +6160,17 @@ func_mode_link ()
lib=
found=no
case $deplib in
- -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe|-threads)
+ -mt|-mthreads|-kthread|-Kthread|-pthread|-pthreads|--thread-safe \
+ |-threads|-fopenmp|-openmp|-mp|-xopenmp|-omp|-qsmp=*)
if test "$linkmode,$pass" = "prog,link"; then
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
- compiler_flags="$compiler_flags $deplib"
+ func_append compiler_flags " $deplib"
if test "$linkmode" = lib ; then
case "$new_inherited_linker_flags " in
*" $deplib "*) ;;
- * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
esac
fi
fi
@@ -5488,7 +6255,7 @@ func_mode_link ()
if test "$linkmode" = lib ; then
case "$new_inherited_linker_flags " in
*" $deplib "*) ;;
- * ) new_inherited_linker_flags="$new_inherited_linker_flags $deplib" ;;
+ * ) func_append new_inherited_linker_flags " $deplib" ;;
esac
fi
fi
@@ -5501,7 +6268,8 @@ func_mode_link ()
test "$pass" = conv && continue
newdependency_libs="$deplib $newdependency_libs"
func_stripname '-L' '' "$deplib"
- newlib_search_path="$newlib_search_path $func_stripname_result"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
;;
prog)
if test "$pass" = conv; then
@@ -5515,7 +6283,8 @@ func_mode_link ()
finalize_deplibs="$deplib $finalize_deplibs"
fi
func_stripname '-L' '' "$deplib"
- newlib_search_path="$newlib_search_path $func_stripname_result"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
;;
*)
func_warning "\`-L' is ignored for archives/objects"
@@ -5526,17 +6295,21 @@ func_mode_link ()
-R*)
if test "$pass" = link; then
func_stripname '-R' '' "$deplib"
- dir=$func_stripname_result
+ func_resolve_sysroot "$func_stripname_result"
+ dir=$func_resolve_sysroot_result
# Make sure the xrpath contains only unique directories.
case "$xrpath " in
*" $dir "*) ;;
- *) xrpath="$xrpath $dir" ;;
+ *) func_append xrpath " $dir" ;;
esac
fi
deplibs="$deplib $deplibs"
continue
;;
- *.la) lib="$deplib" ;;
+ *.la)
+ func_resolve_sysroot "$deplib"
+ lib=$func_resolve_sysroot_result
+ ;;
*.$libext)
if test "$pass" = conv; then
deplibs="$deplib $deplibs"
@@ -5599,11 +6372,11 @@ func_mode_link ()
if test "$pass" = dlpreopen || test "$dlopen_support" != yes || test "$build_libtool_libs" = no; then
# If there is no dlopen support or we're linking statically,
# we need to preload.
- newdlprefiles="$newdlprefiles $deplib"
+ func_append newdlprefiles " $deplib"
compile_deplibs="$deplib $compile_deplibs"
finalize_deplibs="$deplib $finalize_deplibs"
else
- newdlfiles="$newdlfiles $deplib"
+ func_append newdlfiles " $deplib"
fi
fi
continue
@@ -5649,7 +6422,7 @@ func_mode_link ()
for tmp_inherited_linker_flag in $tmp_inherited_linker_flags; do
case " $new_inherited_linker_flags " in
*" $tmp_inherited_linker_flag "*) ;;
- *) new_inherited_linker_flags="$new_inherited_linker_flags $tmp_inherited_linker_flag";;
+ *) func_append new_inherited_linker_flags " $tmp_inherited_linker_flag";;
esac
done
fi
@@ -5657,8 +6430,8 @@ func_mode_link ()
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan" ||
{ test "$linkmode" != prog && test "$linkmode" != lib; }; then
- test -n "$dlopen" && dlfiles="$dlfiles $dlopen"
- test -n "$dlpreopen" && dlprefiles="$dlprefiles $dlpreopen"
+ test -n "$dlopen" && func_append dlfiles " $dlopen"
+ test -n "$dlpreopen" && func_append dlprefiles " $dlpreopen"
fi
if test "$pass" = conv; then
@@ -5669,20 +6442,20 @@ func_mode_link ()
func_fatal_error "cannot find name of link library for \`$lib'"
fi
# It is a libtool convenience library, so add in its objects.
- convenience="$convenience $ladir/$objdir/$old_library"
- old_convenience="$old_convenience $ladir/$objdir/$old_library"
+ func_append convenience " $ladir/$objdir/$old_library"
+ func_append old_convenience " $ladir/$objdir/$old_library"
elif test "$linkmode" != prog && test "$linkmode" != lib; then
func_fatal_error "\`$lib' is not a convenience library"
fi
tmp_libs=
for deplib in $dependency_libs; do
deplibs="$deplib $deplibs"
- if $opt_duplicate_deps ; then
+ if $opt_preserve_dup_deps ; then
case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
fi
- tmp_libs="$tmp_libs $deplib"
+ func_append tmp_libs " $deplib"
done
continue
fi # $pass = conv
@@ -5690,9 +6463,15 @@ func_mode_link ()
# Get the name of the library we link against.
linklib=
- for l in $old_library $library_names; do
- linklib="$l"
- done
+ if test -n "$old_library" &&
+ { test "$prefer_static_libs" = yes ||
+ test "$prefer_static_libs,$installed" = "built,no"; }; then
+ linklib=$old_library
+ else
+ for l in $old_library $library_names; do
+ linklib="$l"
+ done
+ fi
if test -z "$linklib"; then
func_fatal_error "cannot find name of link library for \`$lib'"
fi
@@ -5709,9 +6488,9 @@ func_mode_link ()
# statically, we need to preload. We also need to preload any
# dependent libraries so libltdl's deplib preloader doesn't
# bomb out in the load deplibs phase.
- dlprefiles="$dlprefiles $lib $dependency_libs"
+ func_append dlprefiles " $lib $dependency_libs"
else
- newdlfiles="$newdlfiles $lib"
+ func_append newdlfiles " $lib"
fi
continue
fi # $pass = dlopen
@@ -5733,14 +6512,14 @@ func_mode_link ()
# Find the relevant object directory and library name.
if test "X$installed" = Xyes; then
- if test ! -f "$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
+ if test ! -f "$lt_sysroot$libdir/$linklib" && test -f "$abs_ladir/$linklib"; then
func_warning "library \`$lib' was moved."
dir="$ladir"
absdir="$abs_ladir"
libdir="$abs_ladir"
else
- dir="$libdir"
- absdir="$libdir"
+ dir="$lt_sysroot$libdir"
+ absdir="$lt_sysroot$libdir"
fi
test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
else
@@ -5748,12 +6527,12 @@ func_mode_link ()
dir="$ladir"
absdir="$abs_ladir"
# Remove this search path later
- notinst_path="$notinst_path $abs_ladir"
+ func_append notinst_path " $abs_ladir"
else
dir="$ladir/$objdir"
absdir="$abs_ladir/$objdir"
# Remove this search path later
- notinst_path="$notinst_path $abs_ladir"
+ func_append notinst_path " $abs_ladir"
fi
fi # $installed = yes
func_stripname 'lib' '.la' "$laname"
@@ -5764,20 +6543,46 @@ func_mode_link ()
if test -z "$libdir" && test "$linkmode" = prog; then
func_fatal_error "only libraries may -dlpreopen a convenience library: \`$lib'"
fi
- # Prefer using a static library (so that no silly _DYNAMIC symbols
- # are required to link).
- if test -n "$old_library"; then
- newdlprefiles="$newdlprefiles $dir/$old_library"
- # Keep a list of preopened convenience libraries to check
- # that they are being used correctly in the link pass.
- test -z "$libdir" && \
- dlpreconveniencelibs="$dlpreconveniencelibs $dir/$old_library"
- # Otherwise, use the dlname, so that lt_dlopen finds it.
- elif test -n "$dlname"; then
- newdlprefiles="$newdlprefiles $dir/$dlname"
- else
- newdlprefiles="$newdlprefiles $dir/$linklib"
- fi
+ case "$host" in
+ # special handling for platforms with PE-DLLs.
+ *cygwin* | *mingw* | *cegcc* )
+ # Linker will automatically link against shared library if both
+ # static and shared are present. Therefore, ensure we extract
+ # symbols from the import library if a shared library is present
+ # (otherwise, the dlopen module name will be incorrect). We do
+ # this by putting the import library name into $newdlprefiles.
+ # We recover the dlopen module name by 'saving' the la file
+ # name in a special purpose variable, and (later) extracting the
+ # dlname from the la file.
+ if test -n "$dlname"; then
+ func_tr_sh "$dir/$linklib"
+ eval "libfile_$func_tr_sh_result=\$abs_ladir/\$laname"
+ func_append newdlprefiles " $dir/$linklib"
+ else
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ fi
+ ;;
+ * )
+ # Prefer using a static library (so that no silly _DYNAMIC symbols
+ # are required to link).
+ if test -n "$old_library"; then
+ func_append newdlprefiles " $dir/$old_library"
+ # Keep a list of preopened convenience libraries to check
+ # that they are being used correctly in the link pass.
+ test -z "$libdir" && \
+ func_append dlpreconveniencelibs " $dir/$old_library"
+ # Otherwise, use the dlname, so that lt_dlopen finds it.
+ elif test -n "$dlname"; then
+ func_append newdlprefiles " $dir/$dlname"
+ else
+ func_append newdlprefiles " $dir/$linklib"
+ fi
+ ;;
+ esac
fi # $pass = dlpreopen
if test -z "$libdir"; then
@@ -5795,7 +6600,7 @@ func_mode_link ()
if test "$linkmode" = prog && test "$pass" != link; then
- newlib_search_path="$newlib_search_path $ladir"
+ func_append newlib_search_path " $ladir"
deplibs="$lib $deplibs"
linkalldeplibs=no
@@ -5808,7 +6613,8 @@ func_mode_link ()
for deplib in $dependency_libs; do
case $deplib in
-L*) func_stripname '-L' '' "$deplib"
- newlib_search_path="$newlib_search_path $func_stripname_result"
+ func_resolve_sysroot "$func_stripname_result"
+ func_append newlib_search_path " $func_resolve_sysroot_result"
;;
esac
# Need to link against all dependency_libs?
@@ -5819,12 +6625,12 @@ func_mode_link ()
# or/and link against static libraries
newdependency_libs="$deplib $newdependency_libs"
fi
- if $opt_duplicate_deps ; then
+ if $opt_preserve_dup_deps ; then
case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ *" $deplib "*) func_append specialdeplibs " $deplib" ;;
esac
fi
- tmp_libs="$tmp_libs $deplib"
+ func_append tmp_libs " $deplib"
done # for deplib
continue
fi # $linkmode = prog...
@@ -5839,7 +6645,7 @@ func_mode_link ()
# Make sure the rpath contains only unique directories.
case "$temp_rpath:" in
*"$absdir:"*) ;;
- *) temp_rpath="$temp_rpath$absdir:" ;;
+ *) func_append temp_rpath "$absdir:" ;;
esac
fi
@@ -5851,7 +6657,7 @@ func_mode_link ()
*)
case "$compile_rpath " in
*" $absdir "*) ;;
- *) compile_rpath="$compile_rpath $absdir"
+ *) func_append compile_rpath " $absdir" ;;
esac
;;
esac
@@ -5860,7 +6666,7 @@ func_mode_link ()
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir"
+ *) func_append finalize_rpath " $libdir" ;;
esac
;;
esac
@@ -5885,12 +6691,12 @@ func_mode_link ()
case $host in
*cygwin* | *mingw* | *cegcc*)
# No point in relinking DLLs because paths are not encoded
- notinst_deplibs="$notinst_deplibs $lib"
+ func_append notinst_deplibs " $lib"
need_relink=no
;;
*)
if test "$installed" = no; then
- notinst_deplibs="$notinst_deplibs $lib"
+ func_append notinst_deplibs " $lib"
need_relink=yes
fi
;;
@@ -5925,7 +6731,7 @@ func_mode_link ()
*)
case "$compile_rpath " in
*" $absdir "*) ;;
- *) compile_rpath="$compile_rpath $absdir"
+ *) func_append compile_rpath " $absdir" ;;
esac
;;
esac
@@ -5934,7 +6740,7 @@ func_mode_link ()
*)
case "$finalize_rpath " in
*" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir"
+ *) func_append finalize_rpath " $libdir" ;;
esac
;;
esac
@@ -5988,7 +6794,7 @@ func_mode_link ()
linklib=$newlib
fi # test -n "$old_archive_from_expsyms_cmds"
- if test "$linkmode" = prog || test "$mode" != relink; then
+ if test "$linkmode" = prog || test "$opt_mode" != relink; then
add_shlibpath=
add_dir=
add=
@@ -6039,12 +6845,12 @@ func_mode_link ()
test "$hardcode_direct_absolute" = no; then
add="$dir/$linklib"
elif test "$hardcode_minus_L" = yes; then
- add_dir="-L$dir"
+ add_dir="-L$absdir"
# Try looking first in the location we're being installed to.
if test -n "$inst_prefix_dir"; then
case $libdir in
[\\/]*)
- add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ func_append add_dir " -L$inst_prefix_dir$libdir"
;;
esac
fi
@@ -6066,7 +6872,7 @@ func_mode_link ()
if test -n "$add_shlibpath"; then
case :$compile_shlibpath: in
*":$add_shlibpath:"*) ;;
- *) compile_shlibpath="$compile_shlibpath$add_shlibpath:" ;;
+ *) func_append compile_shlibpath "$add_shlibpath:" ;;
esac
fi
if test "$linkmode" = prog; then
@@ -6080,13 +6886,13 @@ func_mode_link ()
test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
esac
fi
fi
fi
- if test "$linkmode" = prog || test "$mode" = relink; then
+ if test "$linkmode" = prog || test "$opt_mode" = relink; then
add_shlibpath=
add_dir=
add=
@@ -6100,7 +6906,7 @@ func_mode_link ()
elif test "$hardcode_shlibpath_var" = yes; then
case :$finalize_shlibpath: in
*":$libdir:"*) ;;
- *) finalize_shlibpath="$finalize_shlibpath$libdir:" ;;
+ *) func_append finalize_shlibpath "$libdir:" ;;
esac
add="-l$name"
elif test "$hardcode_automatic" = yes; then
@@ -6117,7 +6923,7 @@ func_mode_link ()
if test -n "$inst_prefix_dir"; then
case $libdir in
[\\/]*)
- add_dir="$add_dir -L$inst_prefix_dir$libdir"
+ func_append add_dir " -L$inst_prefix_dir$libdir"
;;
esac
fi
@@ -6194,27 +7000,33 @@ func_mode_link ()
temp_xrpath=$func_stripname_result
case " $xrpath " in
*" $temp_xrpath "*) ;;
- *) xrpath="$xrpath $temp_xrpath";;
+ *) func_append xrpath " $temp_xrpath";;
esac;;
- *) temp_deplibs="$temp_deplibs $libdir";;
+ *) func_append temp_deplibs " $libdir";;
esac
done
dependency_libs="$temp_deplibs"
fi
- newlib_search_path="$newlib_search_path $absdir"
+ func_append newlib_search_path " $absdir"
# Link against this library
test "$link_static" = no && newdependency_libs="$abs_ladir/$laname $newdependency_libs"
# ... and its dependency_libs
tmp_libs=
for deplib in $dependency_libs; do
newdependency_libs="$deplib $newdependency_libs"
- if $opt_duplicate_deps ; then
+ case $deplib in
+ -L*) func_stripname '-L' '' "$deplib"
+ func_resolve_sysroot "$func_stripname_result";;
+ *) func_resolve_sysroot "$deplib" ;;
+ esac
+ if $opt_preserve_dup_deps ; then
case "$tmp_libs " in
- *" $deplib "*) specialdeplibs="$specialdeplibs $deplib" ;;
+ *" $func_resolve_sysroot_result "*)
+ func_append specialdeplibs " $func_resolve_sysroot_result" ;;
esac
fi
- tmp_libs="$tmp_libs $deplib"
+ func_append tmp_libs " $func_resolve_sysroot_result"
done
if test "$link_all_deplibs" != no; then
@@ -6224,8 +7036,10 @@ func_mode_link ()
case $deplib in
-L*) path="$deplib" ;;
*.la)
+ func_resolve_sysroot "$deplib"
+ deplib=$func_resolve_sysroot_result
func_dirname "$deplib" "" "."
- dir="$func_dirname_result"
+ dir=$func_dirname_result
# We need an absolute path.
case $dir in
[\\/]* | [A-Za-z]:[\\/]*) absdir="$dir" ;;
@@ -6252,8 +7066,8 @@ func_mode_link ()
if test -z "$darwin_install_name"; then
darwin_install_name=`${OTOOL64} -L $depdepl | awk '{if (NR == 2) {print $1;exit}}'`
fi
- compiler_flags="$compiler_flags ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
- linker_flags="$linker_flags -dylib_file ${darwin_install_name}:${depdepl}"
+ func_append compiler_flags " ${wl}-dylib_file ${wl}${darwin_install_name}:${depdepl}"
+ func_append linker_flags " -dylib_file ${darwin_install_name}:${depdepl}"
path=
fi
fi
@@ -6303,7 +7117,7 @@ func_mode_link ()
for dir in $newlib_search_path; do
case "$lib_search_path " in
*" $dir "*) ;;
- *) lib_search_path="$lib_search_path $dir" ;;
+ *) func_append lib_search_path " $dir" ;;
esac
done
newlib_search_path=
@@ -6361,10 +7175,10 @@ func_mode_link ()
-L*)
case " $tmp_libs " in
*" $deplib "*) ;;
- *) tmp_libs="$tmp_libs $deplib" ;;
+ *) func_append tmp_libs " $deplib" ;;
esac
;;
- *) tmp_libs="$tmp_libs $deplib" ;;
+ *) func_append tmp_libs " $deplib" ;;
esac
done
eval $var=\"$tmp_libs\"
@@ -6380,7 +7194,7 @@ func_mode_link ()
;;
esac
if test -n "$i" ; then
- tmp_libs="$tmp_libs $i"
+ func_append tmp_libs " $i"
fi
done
dependency_libs=$tmp_libs
@@ -6421,7 +7235,7 @@ func_mode_link ()
# Now set the variables for building old libraries.
build_libtool_libs=no
oldlibs="$output"
- objs="$objs$old_deplibs"
+ func_append objs "$old_deplibs"
;;
lib)
@@ -6457,7 +7271,7 @@ func_mode_link ()
echo
$ECHO "*** Warning: Linking the shared library $output against the non-libtool"
$ECHO "*** objects $objs is not portable!"
- libobjs="$libobjs $objs"
+ func_append libobjs " $objs"
fi
fi
@@ -6516,6 +7330,7 @@ func_mode_link ()
# which has an extra 1 added just for fun
#
case $version_type in
+ # correct linux to gnu/linux during the next big refactor
darwin|linux|osf|windows|none)
func_arith $number_major + $number_minor
current=$func_arith_result
@@ -6632,7 +7447,7 @@ func_mode_link ()
versuffix="$major.$revision"
;;
- linux)
+ linux) # correct to gnu/linux during the next big refactor
func_arith $current - $age
major=.$func_arith_result
versuffix="$major.$age.$revision"
@@ -6655,7 +7470,7 @@ func_mode_link ()
done
# Make executables depend on our current version.
- verstring="$verstring:${current}.0"
+ func_append verstring ":${current}.0"
;;
qnx)
@@ -6723,10 +7538,10 @@ func_mode_link ()
fi
func_generate_dlsyms "$libname" "$libname" "yes"
- libobjs="$libobjs $symfileobj"
+ func_append libobjs " $symfileobj"
test "X$libobjs" = "X " && libobjs=
- if test "$mode" != relink; then
+ if test "$opt_mode" != relink; then
# Remove our outputs, but don't remove object files since they
# may have been created when compiling PIC objects.
removelist=
@@ -6742,7 +7557,7 @@ func_mode_link ()
continue
fi
fi
- removelist="$removelist $p"
+ func_append removelist " $p"
;;
*) ;;
esac
@@ -6753,7 +7568,7 @@ func_mode_link ()
# Now set the variables for building old libraries.
if test "$build_old_libs" = yes && test "$build_libtool_libs" != convenience ; then
- oldlibs="$oldlibs $output_objdir/$libname.$libext"
+ func_append oldlibs " $output_objdir/$libname.$libext"
# Transform .lo files to .o files.
oldobjs="$objs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; $lo2o" | $NL2SP`
@@ -6770,10 +7585,11 @@ func_mode_link ()
# If the user specified any rpath flags, then add them.
temp_xrpath=
for libdir in $xrpath; do
- temp_xrpath="$temp_xrpath -R$libdir"
+ func_replace_sysroot "$libdir"
+ func_append temp_xrpath " -R$func_replace_sysroot_result"
case "$finalize_rpath " in
*" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir" ;;
+ *) func_append finalize_rpath " $libdir" ;;
esac
done
if test "$hardcode_into_libs" != yes || test "$build_old_libs" = yes; then
@@ -6787,7 +7603,7 @@ func_mode_link ()
for lib in $old_dlfiles; do
case " $dlprefiles $dlfiles " in
*" $lib "*) ;;
- *) dlfiles="$dlfiles $lib" ;;
+ *) func_append dlfiles " $lib" ;;
esac
done
@@ -6797,7 +7613,7 @@ func_mode_link ()
for lib in $old_dlprefiles; do
case "$dlprefiles " in
*" $lib "*) ;;
- *) dlprefiles="$dlprefiles $lib" ;;
+ *) func_append dlprefiles " $lib" ;;
esac
done
@@ -6809,7 +7625,7 @@ func_mode_link ()
;;
*-*-rhapsody* | *-*-darwin1.[012])
# Rhapsody C library is in the System framework
- deplibs="$deplibs System.ltframework"
+ func_append deplibs " System.ltframework"
;;
*-*-netbsd*)
# Don't link with libc until the a.out ld.so is fixed.
@@ -6826,7 +7642,7 @@ func_mode_link ()
*)
# Add libc to deplibs on all other systems if necessary.
if test "$build_libtool_need_lc" = "yes"; then
- deplibs="$deplibs -lc"
+ func_append deplibs " -lc"
fi
;;
esac
@@ -6875,7 +7691,7 @@ EOF
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $i "*)
- newdeplibs="$newdeplibs $i"
+ func_append newdeplibs " $i"
i=""
;;
esac
@@ -6886,7 +7702,7 @@ EOF
set dummy $deplib_matches; shift
deplib_match=$1
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
+ func_append newdeplibs " $i"
else
droppeddeps=yes
echo
@@ -6900,7 +7716,7 @@ EOF
fi
;;
*)
- newdeplibs="$newdeplibs $i"
+ func_append newdeplibs " $i"
;;
esac
done
@@ -6918,7 +7734,7 @@ EOF
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $i "*)
- newdeplibs="$newdeplibs $i"
+ func_append newdeplibs " $i"
i=""
;;
esac
@@ -6929,7 +7745,7 @@ EOF
set dummy $deplib_matches; shift
deplib_match=$1
if test `expr "$ldd_output" : ".*$deplib_match"` -ne 0 ; then
- newdeplibs="$newdeplibs $i"
+ func_append newdeplibs " $i"
else
droppeddeps=yes
echo
@@ -6951,7 +7767,7 @@ EOF
fi
;;
*)
- newdeplibs="$newdeplibs $i"
+ func_append newdeplibs " $i"
;;
esac
done
@@ -6968,15 +7784,27 @@ EOF
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $a_deplib "*)
- newdeplibs="$newdeplibs $a_deplib"
+ func_append newdeplibs " $a_deplib"
a_deplib=""
;;
esac
fi
if test -n "$a_deplib" ; then
libname=`eval "\\$ECHO \"$libname_spec\""`
+ if test -n "$file_magic_glob"; then
+ libnameglob=`func_echo_all "$libname" | $SED -e $file_magic_glob`
+ else
+ libnameglob=$libname
+ fi
+ test "$want_nocaseglob" = yes && nocaseglob=`shopt -p nocaseglob`
for i in $lib_search_path $sys_lib_search_path $shlib_search_path; do
- potential_libs=`ls $i/$libname[.-]* 2>/dev/null`
+ if test "$want_nocaseglob" = yes; then
+ shopt -s nocaseglob
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ $nocaseglob
+ else
+ potential_libs=`ls $i/$libnameglob[.-]* 2>/dev/null`
+ fi
for potent_lib in $potential_libs; do
# Follow soft links.
if ls -lLd "$potent_lib" 2>/dev/null |
@@ -6999,7 +7827,7 @@ EOF
if eval $file_magic_cmd \"\$potlib\" 2>/dev/null |
$SED -e 10q |
$EGREP "$file_magic_regex" > /dev/null; then
- newdeplibs="$newdeplibs $a_deplib"
+ func_append newdeplibs " $a_deplib"
a_deplib=""
break 2
fi
@@ -7024,7 +7852,7 @@ EOF
;;
*)
# Add a -L argument.
- newdeplibs="$newdeplibs $a_deplib"
+ func_append newdeplibs " $a_deplib"
;;
esac
done # Gone through all deplibs.
@@ -7040,7 +7868,7 @@ EOF
if test "X$allow_libtool_libs_with_static_runtimes" = "Xyes" ; then
case " $predeps $postdeps " in
*" $a_deplib "*)
- newdeplibs="$newdeplibs $a_deplib"
+ func_append newdeplibs " $a_deplib"
a_deplib=""
;;
esac
@@ -7053,7 +7881,7 @@ EOF
potlib="$potent_lib" # see symlink-check above in file_magic test
if eval "\$ECHO \"$potent_lib\"" 2>/dev/null | $SED 10q | \
$EGREP "$match_pattern_regex" > /dev/null; then
- newdeplibs="$newdeplibs $a_deplib"
+ func_append newdeplibs " $a_deplib"
a_deplib=""
break 2
fi
@@ -7078,7 +7906,7 @@ EOF
;;
*)
# Add a -L argument.
- newdeplibs="$newdeplibs $a_deplib"
+ func_append newdeplibs " $a_deplib"
;;
esac
done # Gone through all deplibs.
@@ -7182,7 +8010,7 @@ EOF
*)
case " $deplibs " in
*" -L$path/$objdir "*)
- new_libs="$new_libs -L$path/$objdir" ;;
+ func_append new_libs " -L$path/$objdir" ;;
esac
;;
esac
@@ -7192,10 +8020,10 @@ EOF
-L*)
case " $new_libs " in
*" $deplib "*) ;;
- *) new_libs="$new_libs $deplib" ;;
+ *) func_append new_libs " $deplib" ;;
esac
;;
- *) new_libs="$new_libs $deplib" ;;
+ *) func_append new_libs " $deplib" ;;
esac
done
deplibs="$new_libs"
@@ -7207,15 +8035,22 @@ EOF
# Test again, we may have decided not to build it any more
if test "$build_libtool_libs" = yes; then
+ # Remove ${wl} instances when linking with ld.
+ # FIXME: should test the right _cmds variable.
+ case $archive_cmds in
+ *\$LD\ *) wl= ;;
+ esac
if test "$hardcode_into_libs" = yes; then
# Hardcode the library paths
hardcode_libdirs=
dep_rpath=
rpath="$finalize_rpath"
- test "$mode" != relink && rpath="$compile_rpath$rpath"
+ test "$opt_mode" != relink && rpath="$compile_rpath$rpath"
for libdir in $rpath; do
if test -n "$hardcode_libdir_flag_spec"; then
if test -n "$hardcode_libdir_separator"; then
+ func_replace_sysroot "$libdir"
+ libdir=$func_replace_sysroot_result
if test -z "$hardcode_libdirs"; then
hardcode_libdirs="$libdir"
else
@@ -7224,18 +8059,18 @@ EOF
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
- dep_rpath="$dep_rpath $flag"
+ func_append dep_rpath " $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
- *) perm_rpath="$perm_rpath $libdir" ;;
+ *) func_append perm_rpath " $libdir" ;;
esac
fi
done
@@ -7243,17 +8078,13 @@ EOF
if test -n "$hardcode_libdir_separator" &&
test -n "$hardcode_libdirs"; then
libdir="$hardcode_libdirs"
- if test -n "$hardcode_libdir_flag_spec_ld"; then
- eval dep_rpath=\"$hardcode_libdir_flag_spec_ld\"
- else
- eval dep_rpath=\"$hardcode_libdir_flag_spec\"
- fi
+ eval "dep_rpath=\"$hardcode_libdir_flag_spec\""
fi
if test -n "$runpath_var" && test -n "$perm_rpath"; then
# We should set the runpath_var.
rpath=
for dir in $perm_rpath; do
- rpath="$rpath$dir:"
+ func_append rpath "$dir:"
done
eval "$runpath_var='$rpath\$$runpath_var'; export $runpath_var"
fi
@@ -7261,7 +8092,7 @@ EOF
fi
shlibpath="$finalize_shlibpath"
- test "$mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
+ test "$opt_mode" != relink && shlibpath="$compile_shlibpath$shlibpath"
if test -n "$shlibpath"; then
eval "$shlibpath_var='$shlibpath\$$shlibpath_var'; export $shlibpath_var"
fi
@@ -7287,7 +8118,7 @@ EOF
linknames=
for link
do
- linknames="$linknames $link"
+ func_append linknames " $link"
done
# Use standard objects if they are pic
@@ -7298,7 +8129,7 @@ EOF
if test -n "$export_symbols" && test -n "$include_expsyms"; then
$opt_dry_run || cp "$export_symbols" "$output_objdir/$libname.uexp"
export_symbols="$output_objdir/$libname.uexp"
- delfiles="$delfiles $export_symbols"
+ func_append delfiles " $export_symbols"
fi
orig_export_symbols=
@@ -7329,14 +8160,46 @@ EOF
$opt_dry_run || $RM $export_symbols
cmds=$export_symbols_cmds
save_ifs="$IFS"; IFS='~'
- for cmd in $cmds; do
+ for cmd1 in $cmds; do
IFS="$save_ifs"
- eval cmd=\"$cmd\"
- func_len " $cmd"
- len=$func_len_result
- if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
+ # Take the normal branch if the nm_file_list_spec branch
+ # doesn't work or if tool conversion is not needed.
+ case $nm_file_list_spec~$to_tool_file_cmd in
+ *~func_convert_file_noop | *~func_convert_file_msys_to_w32 | ~*)
+ try_normal_branch=yes
+ eval cmd=\"$cmd1\"
+ func_len " $cmd"
+ len=$func_len_result
+ ;;
+ *)
+ try_normal_branch=no
+ ;;
+ esac
+ if test "$try_normal_branch" = yes \
+ && { test "$len" -lt "$max_cmd_len" \
+ || test "$max_cmd_len" -le -1; }
+ then
func_show_eval "$cmd" 'exit $?'
skipped_export=false
+ elif test -n "$nm_file_list_spec"; then
+ func_basename "$output"
+ output_la=$func_basename_result
+ save_libobjs=$libobjs
+ save_output=$output
+ output=${output_objdir}/${output_la}.nm
+ func_to_tool_file "$output"
+ libobjs=$nm_file_list_spec$func_to_tool_file_result
+ func_append delfiles " $output"
+ func_verbose "creating $NM input file list: $output"
+ for obj in $save_libobjs; do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > "$output"
+ eval cmd=\"$cmd1\"
+ func_show_eval "$cmd" 'exit $?'
+ output=$save_output
+ libobjs=$save_libobjs
+ skipped_export=false
else
# The command line is too long to execute in one step.
func_verbose "using reloadable object file for export list..."
@@ -7369,7 +8232,7 @@ EOF
# global variables. join(1) would be nice here, but unfortunately
# isn't a blessed tool.
$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
export_symbols=$output_objdir/$libname.def
$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
fi
@@ -7379,7 +8242,7 @@ EOF
case " $convenience " in
*" $test_deplib "*) ;;
*)
- tmp_deplibs="$tmp_deplibs $test_deplib"
+ func_append tmp_deplibs " $test_deplib"
;;
esac
done
@@ -7399,21 +8262,21 @@ EOF
test "X$libobjs" = "X " && libobjs=
else
gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
+ func_append generated " $gentop"
func_extract_archives $gentop $convenience
- libobjs="$libobjs $func_extract_archives_result"
+ func_append libobjs " $func_extract_archives_result"
test "X$libobjs" = "X " && libobjs=
fi
fi
if test "$thread_safe" = yes && test -n "$thread_safe_flag_spec"; then
eval flag=\"$thread_safe_flag_spec\"
- linker_flags="$linker_flags $flag"
+ func_append linker_flags " $flag"
fi
# Make a backup of the uninstalled library when relinking
- if test "$mode" = relink; then
+ if test "$opt_mode" = relink; then
$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}U && $MV $realname ${realname}U)' || exit $?
fi
@@ -7475,10 +8338,13 @@ EOF
echo 'INPUT (' > $output
for obj in $save_libobjs
do
- $ECHO "$obj" >> $output
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
done
echo ')' >> $output
- delfiles="$delfiles $output"
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$func_to_tool_file_result
elif test -n "$save_libobjs" && test "X$skipped_export" != "X:" && test "X$file_list_spec" != X; then
output=${output_objdir}/${output_la}.lnk
func_verbose "creating linker input file list: $output"
@@ -7492,10 +8358,12 @@ EOF
fi
for obj
do
- $ECHO "$obj" >> $output
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result" >> $output
done
- delfiles="$delfiles $output"
- output=$firstobj\"$file_list_spec$output\"
+ func_append delfiles " $output"
+ func_to_tool_file "$output"
+ output=$firstobj\"$file_list_spec$func_to_tool_file_result\"
else
if test -n "$save_libobjs"; then
func_verbose "creating reloadable object files..."
@@ -7546,7 +8414,7 @@ EOF
if test -n "$last_robj"; then
eval concat_cmds=\"\${concat_cmds}~\$RM $last_robj\"
fi
- delfiles="$delfiles $output"
+ func_append delfiles " $output"
else
output=
@@ -7580,7 +8448,7 @@ EOF
lt_exit=$?
# Restore the uninstalled library and exit
- if test "$mode" = relink; then
+ if test "$opt_mode" = relink; then
( cd "$output_objdir" && \
$RM "${realname}T" && \
$MV "${realname}U" "$realname" )
@@ -7613,7 +8481,7 @@ EOF
# global variables. join(1) would be nice here, but unfortunately
# isn't a blessed tool.
$opt_dry_run || $SED -e '/[ ,]DATA/!d;s,\(.*\)\([ \,].*\),s|^\1$|\1\2|,' < $export_symbols > $output_objdir/$libname.filter
- delfiles="$delfiles $export_symbols $output_objdir/$libname.filter"
+ func_append delfiles " $export_symbols $output_objdir/$libname.filter"
export_symbols=$output_objdir/$libname.def
$opt_dry_run || $SED -f $output_objdir/$libname.filter < $orig_export_symbols > $export_symbols
fi
@@ -7654,10 +8522,10 @@ EOF
# Add any objects from preloaded convenience libraries
if test -n "$dlprefiles"; then
gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
+ func_append generated " $gentop"
func_extract_archives $gentop $dlprefiles
- libobjs="$libobjs $func_extract_archives_result"
+ func_append libobjs " $func_extract_archives_result"
test "X$libobjs" = "X " && libobjs=
fi
@@ -7673,7 +8541,7 @@ EOF
lt_exit=$?
# Restore the uninstalled library and exit
- if test "$mode" = relink; then
+ if test "$opt_mode" = relink; then
( cd "$output_objdir" && \
$RM "${realname}T" && \
$MV "${realname}U" "$realname" )
@@ -7685,7 +8553,7 @@ EOF
IFS="$save_ifs"
# Restore the uninstalled library and exit
- if test "$mode" = relink; then
+ if test "$opt_mode" = relink; then
$opt_dry_run || eval '(cd $output_objdir && $RM ${realname}T && $MV $realname ${realname}T && $MV ${realname}U $realname)' || exit $?
if test -n "$convenience"; then
@@ -7769,13 +8637,16 @@ EOF
reload_conv_objs=$reload_objs\ `$ECHO "$tmp_whole_archive_flags" | $SED 's|,| |g'`
else
gentop="$output_objdir/${obj}x"
- generated="$generated $gentop"
+ func_append generated " $gentop"
func_extract_archives $gentop $convenience
reload_conv_objs="$reload_objs $func_extract_archives_result"
fi
fi
+ # If we're not building shared, we need to use non_pic_objs
+ test "$build_libtool_libs" != yes && libobjs="$non_pic_objects"
+
# Create the old-style object.
reload_objs="$objs$old_deplibs "`$ECHO "$libobjs" | $SP2NL | $SED "/\.${libext}$/d; /\.lib$/d; $lo2o" | $NL2SP`" $reload_conv_objs" ### testsuite: skip nested quoting test
@@ -7849,8 +8720,8 @@ EOF
if test "$tagname" = CXX ; then
case ${MACOSX_DEPLOYMENT_TARGET-10.0} in
10.[0123])
- compile_command="$compile_command ${wl}-bind_at_load"
- finalize_command="$finalize_command ${wl}-bind_at_load"
+ func_append compile_command " ${wl}-bind_at_load"
+ func_append finalize_command " ${wl}-bind_at_load"
;;
esac
fi
@@ -7870,7 +8741,7 @@ EOF
*)
case " $compile_deplibs " in
*" -L$path/$objdir "*)
- new_libs="$new_libs -L$path/$objdir" ;;
+ func_append new_libs " -L$path/$objdir" ;;
esac
;;
esac
@@ -7880,17 +8751,17 @@ EOF
-L*)
case " $new_libs " in
*" $deplib "*) ;;
- *) new_libs="$new_libs $deplib" ;;
+ *) func_append new_libs " $deplib" ;;
esac
;;
- *) new_libs="$new_libs $deplib" ;;
+ *) func_append new_libs " $deplib" ;;
esac
done
compile_deplibs="$new_libs"
- compile_command="$compile_command $compile_deplibs"
- finalize_command="$finalize_command $finalize_deplibs"
+ func_append compile_command " $compile_deplibs"
+ func_append finalize_command " $finalize_deplibs"
if test -n "$rpath$xrpath"; then
# If the user specified any rpath flags, then add them.
@@ -7898,7 +8769,7 @@ EOF
# This is the magic to use -rpath.
case "$finalize_rpath " in
*" $libdir "*) ;;
- *) finalize_rpath="$finalize_rpath $libdir" ;;
+ *) func_append finalize_rpath " $libdir" ;;
esac
done
fi
@@ -7917,18 +8788,18 @@ EOF
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
- rpath="$rpath $flag"
+ func_append rpath " $flag"
fi
elif test -n "$runpath_var"; then
case "$perm_rpath " in
*" $libdir "*) ;;
- *) perm_rpath="$perm_rpath $libdir" ;;
+ *) func_append perm_rpath " $libdir" ;;
esac
fi
case $host in
@@ -7937,12 +8808,12 @@ EOF
case :$dllsearchpath: in
*":$libdir:"*) ;;
::) dllsearchpath=$libdir;;
- *) dllsearchpath="$dllsearchpath:$libdir";;
+ *) func_append dllsearchpath ":$libdir";;
esac
case :$dllsearchpath: in
*":$testbindir:"*) ;;
::) dllsearchpath=$testbindir;;
- *) dllsearchpath="$dllsearchpath:$testbindir";;
+ *) func_append dllsearchpath ":$testbindir";;
esac
;;
esac
@@ -7968,18 +8839,18 @@ EOF
*"$hardcode_libdir_separator$libdir$hardcode_libdir_separator"*)
;;
*)
- hardcode_libdirs="$hardcode_libdirs$hardcode_libdir_separator$libdir"
+ func_append hardcode_libdirs "$hardcode_libdir_separator$libdir"
;;
esac
fi
else
eval flag=\"$hardcode_libdir_flag_spec\"
- rpath="$rpath $flag"
+ func_append rpath " $flag"
fi
elif test -n "$runpath_var"; then
case "$finalize_perm_rpath " in
*" $libdir "*) ;;
- *) finalize_perm_rpath="$finalize_perm_rpath $libdir" ;;
+ *) func_append finalize_perm_rpath " $libdir" ;;
esac
fi
done
@@ -8030,6 +8901,12 @@ EOF
exit_status=0
func_show_eval "$link_command" 'exit_status=$?'
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
# Delete the generated files.
if test -f "$output_objdir/${outputname}S.${objext}"; then
func_show_eval '$RM "$output_objdir/${outputname}S.${objext}"'
@@ -8052,7 +8929,7 @@ EOF
# We should set the runpath_var.
rpath=
for dir in $perm_rpath; do
- rpath="$rpath$dir:"
+ func_append rpath "$dir:"
done
compile_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
@@ -8060,7 +8937,7 @@ EOF
# We should set the runpath_var.
rpath=
for dir in $finalize_perm_rpath; do
- rpath="$rpath$dir:"
+ func_append rpath "$dir:"
done
finalize_var="$runpath_var=\"$rpath\$$runpath_var\" "
fi
@@ -8075,6 +8952,13 @@ EOF
$opt_dry_run || $RM $output
# Link the executable and exit
func_show_eval "$link_command" 'exit $?'
+
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
exit $EXIT_SUCCESS
fi
@@ -8108,6 +8992,12 @@ EOF
func_show_eval "$link_command" 'exit $?'
+ if test -n "$postlink_cmds"; then
+ func_to_tool_file "$output_objdir/$outputname"
+ postlink_cmds=`func_echo_all "$postlink_cmds" | $SED -e 's%@OUTPUT@%'"$output_objdir/$outputname"'%g' -e 's%@TOOL_OUTPUT@%'"$func_to_tool_file_result"'%g'`
+ func_execute_cmds "$postlink_cmds" 'exit $?'
+ fi
+
# Now create the wrapper script.
func_verbose "creating $output"
@@ -8205,7 +9095,7 @@ EOF
else
oldobjs="$old_deplibs $non_pic_objects"
if test "$preload" = yes && test -f "$symfileobj"; then
- oldobjs="$oldobjs $symfileobj"
+ func_append oldobjs " $symfileobj"
fi
fi
addlibs="$old_convenience"
@@ -8213,10 +9103,10 @@ EOF
if test -n "$addlibs"; then
gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
+ func_append generated " $gentop"
func_extract_archives $gentop $addlibs
- oldobjs="$oldobjs $func_extract_archives_result"
+ func_append oldobjs " $func_extract_archives_result"
fi
# Do each command in the archive commands.
@@ -8227,10 +9117,10 @@ EOF
# Add any objects from preloaded convenience libraries
if test -n "$dlprefiles"; then
gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
+ func_append generated " $gentop"
func_extract_archives $gentop $dlprefiles
- oldobjs="$oldobjs $func_extract_archives_result"
+ func_append oldobjs " $func_extract_archives_result"
fi
# POSIX demands no paths to be encoded in archives. We have
@@ -8248,7 +9138,7 @@ EOF
else
echo "copying selected object files to avoid basename conflicts..."
gentop="$output_objdir/${outputname}x"
- generated="$generated $gentop"
+ func_append generated " $gentop"
func_mkdir_p "$gentop"
save_oldobjs=$oldobjs
oldobjs=
@@ -8272,18 +9162,30 @@ EOF
esac
done
func_show_eval "ln $obj $gentop/$newobj || cp $obj $gentop/$newobj"
- oldobjs="$oldobjs $gentop/$newobj"
+ func_append oldobjs " $gentop/$newobj"
;;
- *) oldobjs="$oldobjs $obj" ;;
+ *) func_append oldobjs " $obj" ;;
esac
done
fi
+ func_to_tool_file "$oldlib" func_convert_file_msys_to_w32
+ tool_oldlib=$func_to_tool_file_result
eval cmds=\"$old_archive_cmds\"
func_len " $cmds"
len=$func_len_result
if test "$len" -lt "$max_cmd_len" || test "$max_cmd_len" -le -1; then
cmds=$old_archive_cmds
+ elif test -n "$archiver_list_spec"; then
+ func_verbose "using command file archive linking..."
+ for obj in $oldobjs
+ do
+ func_to_tool_file "$obj"
+ $ECHO "$func_to_tool_file_result"
+ done > $output_objdir/$libname.libcmd
+ func_to_tool_file "$output_objdir/$libname.libcmd"
+ oldobjs=" $archiver_list_spec$func_to_tool_file_result"
+ cmds=$old_archive_cmds
else
# the command line is too long to link in one step, link in parts
func_verbose "using piecewise archive linking..."
@@ -8377,12 +9279,23 @@ EOF
*.la)
func_basename "$deplib"
name="$func_basename_result"
- eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $deplib`
+ func_resolve_sysroot "$deplib"
+ eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $func_resolve_sysroot_result`
test -z "$libdir" && \
func_fatal_error "\`$deplib' is not a valid libtool archive"
- newdependency_libs="$newdependency_libs $libdir/$name"
+ func_append newdependency_libs " ${lt_sysroot:+=}$libdir/$name"
+ ;;
+ -L*)
+ func_stripname -L '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -L$func_replace_sysroot_result"
+ ;;
+ -R*)
+ func_stripname -R '' "$deplib"
+ func_replace_sysroot "$func_stripname_result"
+ func_append newdependency_libs " -R$func_replace_sysroot_result"
;;
- *) newdependency_libs="$newdependency_libs $deplib" ;;
+ *) func_append newdependency_libs " $deplib" ;;
esac
done
dependency_libs="$newdependency_libs"
@@ -8396,9 +9309,9 @@ EOF
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
test -z "$libdir" && \
func_fatal_error "\`$lib' is not a valid libtool archive"
- newdlfiles="$newdlfiles $libdir/$name"
+ func_append newdlfiles " ${lt_sysroot:+=}$libdir/$name"
;;
- *) newdlfiles="$newdlfiles $lib" ;;
+ *) func_append newdlfiles " $lib" ;;
esac
done
dlfiles="$newdlfiles"
@@ -8415,7 +9328,7 @@ EOF
eval libdir=`${SED} -n -e 's/^libdir=\(.*\)$/\1/p' $lib`
test -z "$libdir" && \
func_fatal_error "\`$lib' is not a valid libtool archive"
- newdlprefiles="$newdlprefiles $libdir/$name"
+ func_append newdlprefiles " ${lt_sysroot:+=}$libdir/$name"
;;
esac
done
@@ -8427,7 +9340,7 @@ EOF
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
*) abs=`pwd`"/$lib" ;;
esac
- newdlfiles="$newdlfiles $abs"
+ func_append newdlfiles " $abs"
done
dlfiles="$newdlfiles"
newdlprefiles=
@@ -8436,7 +9349,7 @@ EOF
[\\/]* | [A-Za-z]:[\\/]*) abs="$lib" ;;
*) abs=`pwd`"/$lib" ;;
esac
- newdlprefiles="$newdlprefiles $abs"
+ func_append newdlprefiles " $abs"
done
dlprefiles="$newdlprefiles"
fi
@@ -8521,7 +9434,7 @@ relink_command=\"$relink_command\""
exit $EXIT_SUCCESS
}
-{ test "$mode" = link || test "$mode" = relink; } &&
+{ test "$opt_mode" = link || test "$opt_mode" = relink; } &&
func_mode_link ${1+"$@"}
@@ -8541,9 +9454,9 @@ func_mode_uninstall ()
for arg
do
case $arg in
- -f) RM="$RM $arg"; rmforce=yes ;;
- -*) RM="$RM $arg" ;;
- *) files="$files $arg" ;;
+ -f) func_append RM " $arg"; rmforce=yes ;;
+ -*) func_append RM " $arg" ;;
+ *) func_append files " $arg" ;;
esac
done
@@ -8552,24 +9465,23 @@ func_mode_uninstall ()
rmdirs=
- origobjdir="$objdir"
for file in $files; do
func_dirname "$file" "" "."
dir="$func_dirname_result"
if test "X$dir" = X.; then
- objdir="$origobjdir"
+ odir="$objdir"
else
- objdir="$dir/$origobjdir"
+ odir="$dir/$objdir"
fi
func_basename "$file"
name="$func_basename_result"
- test "$mode" = uninstall && objdir="$dir"
+ test "$opt_mode" = uninstall && odir="$dir"
- # Remember objdir for removal later, being careful to avoid duplicates
- if test "$mode" = clean; then
+ # Remember odir for removal later, being careful to avoid duplicates
+ if test "$opt_mode" = clean; then
case " $rmdirs " in
- *" $objdir "*) ;;
- *) rmdirs="$rmdirs $objdir" ;;
+ *" $odir "*) ;;
+ *) func_append rmdirs " $odir" ;;
esac
fi
@@ -8595,18 +9507,17 @@ func_mode_uninstall ()
# Delete the libtool libraries and symlinks.
for n in $library_names; do
- rmfiles="$rmfiles $objdir/$n"
+ func_append rmfiles " $odir/$n"
done
- test -n "$old_library" && rmfiles="$rmfiles $objdir/$old_library"
+ test -n "$old_library" && func_append rmfiles " $odir/$old_library"
- case "$mode" in
+ case "$opt_mode" in
clean)
- case " $library_names " in
- # " " in the beginning catches empty $dlname
+ case " $library_names " in
*" $dlname "*) ;;
- *) rmfiles="$rmfiles $objdir/$dlname" ;;
+ *) test -n "$dlname" && func_append rmfiles " $odir/$dlname" ;;
esac
- test -n "$libdir" && rmfiles="$rmfiles $objdir/$name $objdir/${name}i"
+ test -n "$libdir" && func_append rmfiles " $odir/$name $odir/${name}i"
;;
uninstall)
if test -n "$library_names"; then
@@ -8634,19 +9545,19 @@ func_mode_uninstall ()
# Add PIC object to the list of files to remove.
if test -n "$pic_object" &&
test "$pic_object" != none; then
- rmfiles="$rmfiles $dir/$pic_object"
+ func_append rmfiles " $dir/$pic_object"
fi
# Add non-PIC object to the list of files to remove.
if test -n "$non_pic_object" &&
test "$non_pic_object" != none; then
- rmfiles="$rmfiles $dir/$non_pic_object"
+ func_append rmfiles " $dir/$non_pic_object"
fi
fi
;;
*)
- if test "$mode" = clean ; then
+ if test "$opt_mode" = clean ; then
noexename=$name
case $file in
*.exe)
@@ -8656,7 +9567,7 @@ func_mode_uninstall ()
noexename=$func_stripname_result
# $file with .exe has already been added to rmfiles,
# add $file without .exe
- rmfiles="$rmfiles $file"
+ func_append rmfiles " $file"
;;
esac
# Do a test to see if this is a libtool program.
@@ -8665,7 +9576,7 @@ func_mode_uninstall ()
func_ltwrapper_scriptname "$file"
relink_command=
func_source $func_ltwrapper_scriptname_result
- rmfiles="$rmfiles $func_ltwrapper_scriptname_result"
+ func_append rmfiles " $func_ltwrapper_scriptname_result"
else
relink_command=
func_source $dir/$noexename
@@ -8673,12 +9584,12 @@ func_mode_uninstall ()
# note $name still contains .exe if it was in $file originally
# as does the version of $file that was added into $rmfiles
- rmfiles="$rmfiles $objdir/$name $objdir/${name}S.${objext}"
+ func_append rmfiles " $odir/$name $odir/${name}S.${objext}"
if test "$fast_install" = yes && test -n "$relink_command"; then
- rmfiles="$rmfiles $objdir/lt-$name"
+ func_append rmfiles " $odir/lt-$name"
fi
if test "X$noexename" != "X$name" ; then
- rmfiles="$rmfiles $objdir/lt-${noexename}.c"
+ func_append rmfiles " $odir/lt-${noexename}.c"
fi
fi
fi
@@ -8686,7 +9597,6 @@ func_mode_uninstall ()
esac
func_show_eval "$RM $rmfiles" 'exit_status=1'
done
- objdir="$origobjdir"
# Try to remove the ${objdir}s in the directories where we deleted files
for dir in $rmdirs; do
@@ -8698,16 +9608,16 @@ func_mode_uninstall ()
exit $exit_status
}
-{ test "$mode" = uninstall || test "$mode" = clean; } &&
+{ test "$opt_mode" = uninstall || test "$opt_mode" = clean; } &&
func_mode_uninstall ${1+"$@"}
-test -z "$mode" && {
+test -z "$opt_mode" && {
help="$generic_help"
func_fatal_help "you must specify a MODE"
}
test -z "$exec_cmd" && \
- func_fatal_help "invalid operation mode \`$mode'"
+ func_fatal_help "invalid operation mode \`$opt_mode'"
if test -n "$exec_cmd"; then
eval exec "$exec_cmd"
diff --git a/m4/libtool.m4 b/m4/libtool.m4
index 22924a8..44e0ecf 100644
--- a/m4/libtool.m4
+++ b/m4/libtool.m4
@@ -1,8 +1,8 @@
# libtool.m4 - Configure libtool for the host system. -*-Autoconf-*-
#
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-# Inc.
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is free software; the Free Software Foundation gives
@@ -11,8 +11,8 @@
m4_define([_LT_COPYING], [dnl
# Copyright (C) 1996, 1997, 1998, 1999, 2000, 2001, 2003, 2004, 2005,
-# 2006, 2007, 2008, 2009, 2010 Free Software Foundation,
-# Inc.
+# 2006, 2007, 2008, 2009, 2010, 2011 Free Software
+# Foundation, Inc.
# Written by Gordon Matzigkeit, 1996
#
# This file is part of GNU Libtool.
@@ -146,6 +146,8 @@ AC_REQUIRE([AC_CANONICAL_BUILD])dnl
AC_REQUIRE([_LT_PREPARE_SED_QUOTE_VARS])dnl
AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])dnl
+_LT_DECL([], [PATH_SEPARATOR], [1], [The PATH separator for the build system])dnl
+dnl
_LT_DECL([], [host_alias], [0], [The host system])dnl
_LT_DECL([], [host], [0])dnl
_LT_DECL([], [host_os], [0])dnl
@@ -168,10 +170,13 @@ _LT_DECL([], [exeext], [0], [Executable file suffix (normally "")])dnl
dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_CHECK_SHELL_FEATURES])dnl
+m4_require([_LT_PATH_CONVERSION_FUNCTIONS])dnl
m4_require([_LT_CMD_RELOAD])dnl
m4_require([_LT_CHECK_MAGIC_METHOD])dnl
+m4_require([_LT_CHECK_SHAREDLIB_FROM_LINKLIB])dnl
m4_require([_LT_CMD_OLD_ARCHIVE])dnl
m4_require([_LT_CMD_GLOBAL_SYMBOLS])dnl
+m4_require([_LT_WITH_SYSROOT])dnl
_LT_CONFIG_LIBTOOL_INIT([
# See if we are running on zsh, and set the options which allow our
@@ -634,7 +639,7 @@ m4_ifset([AC_PACKAGE_NAME], [AC_PACKAGE_NAME ])config.lt[]dnl
m4_ifset([AC_PACKAGE_VERSION], [ AC_PACKAGE_VERSION])
configured by $[0], generated by m4_PACKAGE_STRING.
-Copyright (C) 2010 Free Software Foundation, Inc.
+Copyright (C) 2011 Free Software Foundation, Inc.
This config.lt script is free software; the Free Software Foundation
gives unlimited permision to copy, distribute and modify it."
@@ -748,15 +753,12 @@ _LT_EOF
# if finds mixed CR/LF and LF-only lines. Since sed operates in
# text mode, it properly converts lines to CR/LF. This bash problem
# is reportedly fixed, but why not run on old versions too?
- sed '/^# Generated shell functions inserted here/q' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
-
- _LT_PROG_XSI_SHELLFNS
+ sed '$q' "$ltmain" >> "$cfgfile" \
+ || (rm -f "$cfgfile"; exit 1)
- sed -n '/^# Generated shell functions inserted here/,$p' "$ltmain" >> "$cfgfile" \
- || (rm -f "$cfgfile"; exit 1)
+ _LT_PROG_REPLACE_SHELLFNS
- mv -f "$cfgfile" "$ofile" ||
+ mv -f "$cfgfile" "$ofile" ||
(rm -f "$ofile" && cp "$cfgfile" "$ofile" && rm -f "$cfgfile")
chmod +x "$ofile"
],
@@ -801,6 +803,7 @@ AC_DEFUN([LT_LANG],
m4_case([$1],
[C], [_LT_LANG(C)],
[C++], [_LT_LANG(CXX)],
+ [Go], [_LT_LANG(GO)],
[Java], [_LT_LANG(GCJ)],
[Fortran 77], [_LT_LANG(F77)],
[Fortran], [_LT_LANG(FC)],
@@ -822,6 +825,31 @@ m4_defun([_LT_LANG],
])# _LT_LANG
+m4_ifndef([AC_PROG_GO], [
+############################################################
+# NOTE: This macro has been submitted for inclusion into #
+# GNU Autoconf as AC_PROG_GO. When it is available in #
+# a released version of Autoconf we should remove this #
+# macro and use it instead. #
+############################################################
+m4_defun([AC_PROG_GO],
+[AC_LANG_PUSH(Go)dnl
+AC_ARG_VAR([GOC], [Go compiler command])dnl
+AC_ARG_VAR([GOFLAGS], [Go compiler flags])dnl
+_AC_ARG_VAR_LDFLAGS()dnl
+AC_CHECK_TOOL(GOC, gccgo)
+if test -z "$GOC"; then
+ if test -n "$ac_tool_prefix"; then
+ AC_CHECK_PROG(GOC, [${ac_tool_prefix}gccgo], [${ac_tool_prefix}gccgo])
+ fi
+fi
+if test -z "$GOC"; then
+ AC_CHECK_PROG(GOC, gccgo, gccgo, false)
+fi
+])#m4_defun
+])#m4_ifndef
+
+
# _LT_LANG_DEFAULT_CONFIG
# -----------------------
m4_defun([_LT_LANG_DEFAULT_CONFIG],
@@ -852,6 +880,10 @@ AC_PROVIDE_IFELSE([AC_PROG_GCJ],
m4_ifdef([LT_PROG_GCJ],
[m4_define([LT_PROG_GCJ], defn([LT_PROG_GCJ])[LT_LANG(GCJ)])])])])])
+AC_PROVIDE_IFELSE([AC_PROG_GO],
+ [LT_LANG(GO)],
+ [m4_define([AC_PROG_GO], defn([AC_PROG_GO])[LT_LANG(GO)])])
+
AC_PROVIDE_IFELSE([LT_PROG_RC],
[LT_LANG(RC)],
[m4_define([LT_PROG_RC], defn([LT_PROG_RC])[LT_LANG(RC)])])
@@ -954,7 +986,13 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
$LTCC $LTCFLAGS $LDFLAGS -o libconftest.dylib \
-dynamiclib -Wl,-single_module conftest.c 2>conftest.err
_lt_result=$?
- if test -f libconftest.dylib && test ! -s conftest.err && test $_lt_result = 0; then
+ # If there is a non-empty error log, and "single_module"
+ # appears in it, assume the flag caused a linker warning
+ if test -s conftest.err && $GREP single_module conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ # Otherwise, if the output was created with a 0 exit code from
+ # the compiler, it worked.
+ elif test -f libconftest.dylib && test $_lt_result -eq 0; then
lt_cv_apple_cc_single_mod=yes
else
cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -962,6 +1000,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
rm -rf libconftest.dylib*
rm -f conftest.*
fi])
+
AC_CACHE_CHECK([for -exported_symbols_list linker flag],
[lt_cv_ld_exported_symbols_list],
[lt_cv_ld_exported_symbols_list=no
@@ -973,6 +1012,7 @@ m4_defun_once([_LT_REQUIRED_DARWIN_CHECKS],[
[lt_cv_ld_exported_symbols_list=no])
LDFLAGS="$save_LDFLAGS"
])
+
AC_CACHE_CHECK([for -force_load linker flag],[lt_cv_ld_force_load],
[lt_cv_ld_force_load=no
cat > conftest.c << _LT_EOF
@@ -990,7 +1030,9 @@ _LT_EOF
echo "$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a" >&AS_MESSAGE_LOG_FD
$LTCC $LTCFLAGS $LDFLAGS -o conftest conftest.c -Wl,-force_load,./libconftest.a 2>conftest.err
_lt_result=$?
- if test -f conftest && test ! -s conftest.err && test $_lt_result = 0 && $GREP forced_load conftest 2>&1 >/dev/null; then
+ if test -s conftest.err && $GREP force_load conftest.err; then
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ elif test -f conftest && test $_lt_result -eq 0 && $GREP forced_load conftest >/dev/null 2>&1 ; then
lt_cv_ld_force_load=yes
else
cat conftest.err >&AS_MESSAGE_LOG_FD
@@ -1035,8 +1077,8 @@ _LT_EOF
])
-# _LT_DARWIN_LINKER_FEATURES
-# --------------------------
+# _LT_DARWIN_LINKER_FEATURES([TAG])
+# ---------------------------------
# Checks for linker and compiler features on darwin
m4_defun([_LT_DARWIN_LINKER_FEATURES],
[
@@ -1047,6 +1089,8 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
if test "$lt_cv_ld_force_load" = "yes"; then
_LT_TAGVAR(whole_archive_flag_spec, $1)='`for conv in $convenience\"\"; do test -n \"$conv\" && new_convenience=\"$new_convenience ${wl}-force_load,$conv\"; done; func_echo_all \"$new_convenience\"`'
+ m4_case([$1], [F77], [_LT_TAGVAR(compiler_needs_object, $1)=yes],
+ [FC], [_LT_TAGVAR(compiler_needs_object, $1)=yes])
else
_LT_TAGVAR(whole_archive_flag_spec, $1)=''
fi
@@ -1073,30 +1117,41 @@ m4_defun([_LT_DARWIN_LINKER_FEATURES],
fi
])
-# _LT_SYS_MODULE_PATH_AIX
-# -----------------------
+# _LT_SYS_MODULE_PATH_AIX([TAGNAME])
+# ----------------------------------
# Links a minimal program and checks the executable
# for the system default hardcoded library path. In most cases,
# this is /usr/lib:/lib, but when the MPI compilers are used
# the location of the communication and MPI libs are included too.
# If we don't find anything, use the default library path according
# to the aix ld manual.
+# Store the results from the different compilers for each TAGNAME.
+# Allow to override them for all tags through lt_cv_aix_libpath.
m4_defun([_LT_SYS_MODULE_PATH_AIX],
[m4_require([_LT_DECL_SED])dnl
-AC_LINK_IFELSE(AC_LANG_PROGRAM,[
-lt_aix_libpath_sed='
- /Import File Strings/,/^$/ {
- /^0/ {
- s/^0 *\(.*\)$/\1/
- p
- }
- }'
-aix_libpath=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-# Check for a 64-bit object if we didn't find anything.
-if test -z "$aix_libpath"; then
- aix_libpath=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
-fi],[])
-if test -z "$aix_libpath"; then aix_libpath="/usr/lib:/lib"; fi
+if test "${lt_cv_aix_libpath+set}" = set; then
+ aix_libpath=$lt_cv_aix_libpath
+else
+ AC_CACHE_VAL([_LT_TAGVAR([lt_cv_aix_libpath_], [$1])],
+ [AC_LINK_IFELSE([AC_LANG_PROGRAM],[
+ lt_aix_libpath_sed='[
+ /Import File Strings/,/^$/ {
+ /^0/ {
+ s/^0 *\([^ ]*\) *$/\1/
+ p
+ }
+ }]'
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -H conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ # Check for a 64-bit object if we didn't find anything.
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])=`dump -HX64 conftest$ac_exeext 2>/dev/null | $SED -n -e "$lt_aix_libpath_sed"`
+ fi],[])
+ if test -z "$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])"; then
+ _LT_TAGVAR([lt_cv_aix_libpath_], [$1])="/usr/lib:/lib"
+ fi
+ ])
+ aix_libpath=$_LT_TAGVAR([lt_cv_aix_libpath_], [$1])
+fi
])# _LT_SYS_MODULE_PATH_AIX
@@ -1121,7 +1176,7 @@ ECHO=$ECHO$ECHO$ECHO$ECHO$ECHO$ECHO
AC_MSG_CHECKING([how to print strings])
# Test print first, because it will be a builtin if present.
-if test "X`print -r -- -n 2>/dev/null`" = X-n && \
+if test "X`( print -r -- -n ) 2>/dev/null`" = X-n && \
test "X`print -r -- $ECHO 2>/dev/null`" = "X$ECHO"; then
ECHO='print -r --'
elif test "X`printf %s $ECHO 2>/dev/null`" = "X$ECHO"; then
@@ -1165,6 +1220,39 @@ _LT_DECL([], [ECHO], [1], [An echo program that protects backslashes])
])# _LT_PROG_ECHO_BACKSLASH
+# _LT_WITH_SYSROOT
+# ----------------
+AC_DEFUN([_LT_WITH_SYSROOT],
+[AC_MSG_CHECKING([for sysroot])
+AC_ARG_WITH([sysroot],
+[ --with-sysroot[=DIR] Search for dependent libraries within DIR
+ (or the compiler's sysroot if not specified).],
+[], [with_sysroot=no])
+
+dnl lt_sysroot will always be passed unquoted. We quote it here
+dnl in case the user passed a directory name.
+lt_sysroot=
+case ${with_sysroot} in #(
+ yes)
+ if test "$GCC" = yes; then
+ lt_sysroot=`$CC --print-sysroot 2>/dev/null`
+ fi
+ ;; #(
+ /*)
+ lt_sysroot=`echo "$with_sysroot" | sed -e "$sed_quote_subst"`
+ ;; #(
+ no|'')
+ ;; #(
+ *)
+ AC_MSG_RESULT([${with_sysroot}])
+ AC_MSG_ERROR([The sysroot must be an absolute path.])
+ ;;
+esac
+
+ AC_MSG_RESULT([${lt_sysroot:-no}])
+_LT_DECL([], [lt_sysroot], [0], [The root where to search for ]dnl
+[dependent libraries, and in which our libraries should be installed.])])
+
# _LT_ENABLE_LOCK
# ---------------
m4_defun([_LT_ENABLE_LOCK],
@@ -1286,14 +1374,27 @@ s390*-*linux*|s390*-*tpf*|sparc*-*linux*)
CFLAGS="$SAVE_CFLAGS"
fi
;;
-sparc*-*solaris*)
+*-*solaris*)
# Find out which ABI we are using.
echo 'int i;' > conftest.$ac_ext
if AC_TRY_EVAL(ac_compile); then
case `/usr/bin/file conftest.o` in
*64-bit*)
case $lt_cv_prog_gnu_ld in
- yes*) LD="${LD-ld} -m elf64_sparc" ;;
+ yes*)
+ case $host in
+ i?86-*-solaris*)
+ LD="${LD-ld} -m elf_x86_64"
+ ;;
+ sparc*-*-solaris*)
+ LD="${LD-ld} -m elf64_sparc"
+ ;;
+ esac
+ # GNU ld 2.21 introduced _sol2 emulations. Use them if available.
+ if ${LD-ld} -V | grep _sol2 >/dev/null 2>&1; then
+ LD="${LD-ld}_sol2"
+ fi
+ ;;
*)
if ${LD-ld} -64 -r -o conftest2.o conftest.o >/dev/null 2>&1; then
LD="${LD-ld} -64"
@@ -1311,14 +1412,47 @@ need_locks="$enable_libtool_lock"
])# _LT_ENABLE_LOCK
+# _LT_PROG_AR
+# -----------
+m4_defun([_LT_PROG_AR],
+[AC_CHECK_TOOLS(AR, [ar], false)
+: ${AR=ar}
+: ${AR_FLAGS=cru}
+_LT_DECL([], [AR], [1], [The archiver])
+_LT_DECL([], [AR_FLAGS], [1], [Flags to create an archive])
+
+AC_CACHE_CHECK([for archiver @FILE support], [lt_cv_ar_at_file],
+ [lt_cv_ar_at_file=no
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM],
+ [echo conftest.$ac_objext > conftest.lst
+ lt_ar_try='$AR $AR_FLAGS libconftest.a @conftest.lst >&AS_MESSAGE_LOG_FD'
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -eq 0; then
+ # Ensure the archiver fails upon bogus file names.
+ rm -f conftest.$ac_objext libconftest.a
+ AC_TRY_EVAL([lt_ar_try])
+ if test "$ac_status" -ne 0; then
+ lt_cv_ar_at_file=@
+ fi
+ fi
+ rm -f conftest.* libconftest.a
+ ])
+ ])
+
+if test "x$lt_cv_ar_at_file" = xno; then
+ archiver_list_spec=
+else
+ archiver_list_spec=$lt_cv_ar_at_file
+fi
+_LT_DECL([], [archiver_list_spec], [1],
+ [How to feed a file listing to the archiver])
+])# _LT_PROG_AR
+
+
# _LT_CMD_OLD_ARCHIVE
# -------------------
m4_defun([_LT_CMD_OLD_ARCHIVE],
-[AC_CHECK_TOOL(AR, ar, false)
-test -z "$AR" && AR=ar
-test -z "$AR_FLAGS" && AR_FLAGS=cru
-_LT_DECL([], [AR], [1], [The archiver])
-_LT_DECL([], [AR_FLAGS], [1])
+[_LT_PROG_AR
AC_CHECK_TOOL(STRIP, strip, :)
test -z "$STRIP" && STRIP=:
@@ -1337,13 +1471,13 @@ old_postuninstall_cmds=
if test -n "$RANLIB"; then
case $host_os in
openbsd*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$oldlib"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB -t \$tool_oldlib"
;;
*)
- old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$oldlib"
+ old_postinstall_cmds="$old_postinstall_cmds~\$RANLIB \$tool_oldlib"
;;
esac
- old_archive_cmds="$old_archive_cmds~\$RANLIB \$oldlib"
+ old_archive_cmds="$old_archive_cmds~\$RANLIB \$tool_oldlib"
fi
case $host_os in
@@ -1523,6 +1657,11 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
lt_cv_sys_max_cmd_len=196608
;;
+ os2*)
+ # The test takes a long time on OS/2.
+ lt_cv_sys_max_cmd_len=8192
+ ;;
+
osf*)
# Dr. Hans Ekkehard Plesser reports seeing a kernel panic running configure
# due to this test when exec_disable_arg_limit is 1 on Tru64. It is not
@@ -1562,7 +1701,7 @@ AC_CACHE_VAL([lt_cv_sys_max_cmd_len], [dnl
# If test is not a shell built-in, we'll probably end up computing a
# maximum length that is only half of the actual maximum length, but
# we can't tell.
- while { test "X"`func_fallback_echo "$teststring$teststring" 2>/dev/null` \
+ while { test "X"`env echo "$teststring$teststring" 2>/dev/null` \
= "X$teststring$teststring"; } >/dev/null 2>&1 &&
test $i != 17 # 1/2 MB should be enough
do
@@ -1658,10 +1797,10 @@ else
/* When -fvisbility=hidden is used, assume the code has been annotated
correspondingly for the symbols needed. */
#if defined(__GNUC__) && (((__GNUC__ == 3) && (__GNUC_MINOR__ >= 3)) || (__GNUC__ > 3))
-void fnord () __attribute__((visibility("default")));
+int fnord () __attribute__((visibility("default")));
#endif
-void fnord () { int i=42; }
+int fnord () { return 42; }
int main ()
{
void *self = dlopen (0, LT_DLGLOBAL|LT_DLLAZY_OR_NOW);
@@ -2108,7 +2247,7 @@ need_version=unknown
case $host_os in
aix3*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='${libname}${release}${shared_ext}$versuffix $libname.a'
shlibpath_var=LIBPATH
@@ -2117,7 +2256,7 @@ aix3*)
;;
aix[[4-9]]*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
hardcode_into_libs=yes
@@ -2182,7 +2321,7 @@ beos*)
;;
bsdi[[45]]*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
@@ -2201,8 +2340,9 @@ cygwin* | mingw* | pw32* | cegcc*)
need_version=no
need_lib_prefix=no
- case $GCC,$host_os in
- yes,cygwin* | yes,mingw* | yes,pw32* | yes,cegcc*)
+ case $GCC,$cc_basename in
+ yes,*)
+ # gcc
library_names_spec='$libname.dll.a'
# DLL is installed to $(libdir)/../bin by postinstall_cmds
postinstall_cmds='base_file=`basename \${file}`~
@@ -2235,13 +2375,71 @@ m4_if([$1], [],[
library_names_spec='`echo ${libname} | sed -e 's/^lib/pw/'``echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
;;
esac
+ dynamic_linker='Win32 ld.exe'
+ ;;
+
+ *,cl*)
+ # Native MSVC
+ libname_spec='$name'
+ soname_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext}'
+ library_names_spec='${libname}.dll.lib'
+
+ case $build_os in
+ mingw*)
+ sys_lib_search_path_spec=
+ lt_save_ifs=$IFS
+ IFS=';'
+ for lt_path in $LIB
+ do
+ IFS=$lt_save_ifs
+ # Let DOS variable expansion print the short 8.3 style file name.
+ lt_path=`cd "$lt_path" 2>/dev/null && cmd //C "for %i in (".") do @echo %~si"`
+ sys_lib_search_path_spec="$sys_lib_search_path_spec $lt_path"
+ done
+ IFS=$lt_save_ifs
+ # Convert to MSYS style.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | sed -e 's|\\\\|/|g' -e 's| \\([[a-zA-Z]]\\):| /\\1|g' -e 's|^ ||'`
+ ;;
+ cygwin*)
+ # Convert to unix form, then to dos form, then back to unix form
+ # but this time dos style (no spaces!) so that the unix form looks
+ # like /cygdrive/c/PROGRA~1:/cygdr...
+ sys_lib_search_path_spec=`cygpath --path --unix "$LIB"`
+ sys_lib_search_path_spec=`cygpath --path --dos "$sys_lib_search_path_spec" 2>/dev/null`
+ sys_lib_search_path_spec=`cygpath --path --unix "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ ;;
+ *)
+ sys_lib_search_path_spec="$LIB"
+ if $ECHO "$sys_lib_search_path_spec" | [$GREP ';[c-zC-Z]:/' >/dev/null]; then
+ # It is most probably a Windows format PATH.
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e 's/;/ /g'`
+ else
+ sys_lib_search_path_spec=`$ECHO "$sys_lib_search_path_spec" | $SED -e "s/$PATH_SEPARATOR/ /g"`
+ fi
+ # FIXME: find the short name or the path components, as spaces are
+ # common. (e.g. "Program Files" -> "PROGRA~1")
+ ;;
+ esac
+
+ # DLL is installed to $(libdir)/../bin by postinstall_cmds
+ postinstall_cmds='base_file=`basename \${file}`~
+ dlpath=`$SHELL 2>&1 -c '\''. $dir/'\''\${base_file}'\''i; echo \$dlname'\''`~
+ dldir=$destdir/`dirname \$dlpath`~
+ test -d \$dldir || mkdir -p \$dldir~
+ $install_prog $dir/$dlname \$dldir/$dlname'
+ postuninstall_cmds='dldll=`$SHELL 2>&1 -c '\''. $file; echo \$dlname'\''`~
+ dlpath=$dir/\$dldll~
+ $RM \$dlpath'
+ shlibpath_overrides_runpath=yes
+ dynamic_linker='Win32 link.exe'
;;
*)
+ # Assume MSVC wrapper
library_names_spec='${libname}`echo ${release} | $SED -e 's/[[.]]/-/g'`${versuffix}${shared_ext} $libname.lib'
+ dynamic_linker='Win32 ld.exe'
;;
esac
- dynamic_linker='Win32 ld.exe'
# FIXME: first we should search . and the directory the executable is in
shlibpath_var=PATH
;;
@@ -2262,7 +2460,7 @@ m4_if([$1], [],[
;;
dgux*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname$shared_ext'
@@ -2270,10 +2468,6 @@ dgux*)
shlibpath_var=LD_LIBRARY_PATH
;;
-freebsd1*)
- dynamic_linker=no
- ;;
-
freebsd* | dragonfly*)
# DragonFly does not have aout. When/if they implement a new
# versioning mechanism, adjust this.
@@ -2281,7 +2475,7 @@ freebsd* | dragonfly*)
objformat=`/usr/bin/objformat`
else
case $host_os in
- freebsd[[123]]*) objformat=aout ;;
+ freebsd[[23]].*) objformat=aout ;;
*) objformat=elf ;;
esac
fi
@@ -2299,7 +2493,7 @@ freebsd* | dragonfly*)
esac
shlibpath_var=LD_LIBRARY_PATH
case $host_os in
- freebsd2*)
+ freebsd2.*)
shlibpath_overrides_runpath=yes
;;
freebsd3.[[01]]* | freebsdelf3.[[01]]*)
@@ -2319,17 +2513,18 @@ freebsd* | dragonfly*)
;;
gnu*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}${major} ${libname}${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
+ shlibpath_overrides_runpath=no
hardcode_into_libs=yes
;;
haiku*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
dynamic_linker="$host_os runtime_loader"
@@ -2390,7 +2585,7 @@ hpux9* | hpux10* | hpux11*)
;;
interix[[3-9]]*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major ${libname}${shared_ext}'
@@ -2406,7 +2601,7 @@ irix5* | irix6* | nonstopux*)
nonstopux*) version_type=nonstopux ;;
*)
if test "$lt_cv_prog_gnu_ld" = yes; then
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
else
version_type=irix
fi ;;
@@ -2443,9 +2638,9 @@ linux*oldld* | linux*aout* | linux*coff*)
dynamic_linker=no
;;
-# This must be Linux ELF.
+# This must be glibc/ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2508,7 +2703,7 @@ netbsd*)
;;
newsos6)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
shlibpath_var=LD_LIBRARY_PATH
shlibpath_overrides_runpath=yes
@@ -2577,7 +2772,7 @@ rdos*)
;;
solaris*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2602,7 +2797,7 @@ sunos4*)
;;
sysv4 | sysv4.3*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
@@ -2626,7 +2821,7 @@ sysv4 | sysv4.3*)
sysv4*MP*)
if test -d /usr/nec ;then
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='$libname${shared_ext}.$versuffix $libname${shared_ext}.$major $libname${shared_ext}'
soname_spec='$libname${shared_ext}.$major'
shlibpath_var=LD_LIBRARY_PATH
@@ -2657,7 +2852,7 @@ sysv5* | sco3.2v5* | sco5v6* | unixware* | OpenUNIX* | sysv4*uw2*)
tpf*)
# TPF is a cross-target only. Preferred cross-host = GNU/Linux.
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
need_lib_prefix=no
need_version=no
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
@@ -2667,7 +2862,7 @@ tpf*)
;;
uts4*)
- version_type=linux
+ version_type=linux # correct to gnu/linux during the next big refactor
library_names_spec='${libname}${release}${shared_ext}$versuffix ${libname}${release}${shared_ext}$major $libname${shared_ext}'
soname_spec='${libname}${release}${shared_ext}$major'
shlibpath_var=LD_LIBRARY_PATH
@@ -2945,6 +3140,11 @@ case $reload_flag in
esac
reload_cmds='$LD$reload_flag -o $output$reload_objs'
case $host_os in
+ cygwin* | mingw* | pw32* | cegcc*)
+ if test "$GCC" != yes; then
+ reload_cmds=false
+ fi
+ ;;
darwin*)
if test "$GCC" = yes; then
reload_cmds='$LTCC $LTCFLAGS -nostdlib ${wl}-r -o $output$reload_objs'
@@ -3084,7 +3284,7 @@ irix5* | irix6* | nonstopux*)
lt_cv_deplibs_check_method=pass_all
;;
-# This must be Linux ELF.
+# This must be glibc/ELF.
linux* | k*bsd*-gnu | kopensolaris*-gnu)
lt_cv_deplibs_check_method=pass_all
;;
@@ -3163,6 +3363,21 @@ tpf*)
;;
esac
])
+
+file_magic_glob=
+want_nocaseglob=no
+if test "$build" = "$host"; then
+ case $host_os in
+ mingw* | pw32*)
+ if ( shopt | grep nocaseglob ) >/dev/null 2>&1; then
+ want_nocaseglob=yes
+ else
+ file_magic_glob=`echo aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStTuUvVwWxXyYzZ | $SED -e "s/\(..\)/s\/[[\1]]\/[[\1]]\/g;/g"`
+ fi
+ ;;
+ esac
+fi
+
file_magic_cmd=$lt_cv_file_magic_cmd
deplibs_check_method=$lt_cv_deplibs_check_method
test -z "$deplibs_check_method" && deplibs_check_method=unknown
@@ -3170,7 +3385,11 @@ test -z "$deplibs_check_method" && deplibs_check_method=unknown
_LT_DECL([], [deplibs_check_method], [1],
[Method to check whether dependent libraries are shared objects])
_LT_DECL([], [file_magic_cmd], [1],
- [Command to use when deplibs_check_method == "file_magic"])
+ [Command to use when deplibs_check_method = "file_magic"])
+_LT_DECL([], [file_magic_glob], [1],
+ [How to find potential files when deplibs_check_method = "file_magic"])
+_LT_DECL([], [want_nocaseglob], [1],
+ [Find potential files using nocaseglob when deplibs_check_method = "file_magic"])
])# _LT_CHECK_MAGIC_METHOD
@@ -3273,6 +3492,67 @@ dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([AM_PROG_NM], [])
dnl AC_DEFUN([AC_PROG_NM], [])
+# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+# --------------------------------
+# how to determine the name of the shared library
+# associated with a specific link library.
+# -- PORTME fill in with the dynamic library characteristics
+m4_defun([_LT_CHECK_SHAREDLIB_FROM_LINKLIB],
+[m4_require([_LT_DECL_EGREP])
+m4_require([_LT_DECL_OBJDUMP])
+m4_require([_LT_DECL_DLLTOOL])
+AC_CACHE_CHECK([how to associate runtime and link libraries],
+lt_cv_sharedlib_from_linklib_cmd,
+[lt_cv_sharedlib_from_linklib_cmd='unknown'
+
+case $host_os in
+cygwin* | mingw* | pw32* | cegcc*)
+ # two different shell functions defined in ltmain.sh
+ # decide which to use based on capabilities of $DLLTOOL
+ case `$DLLTOOL --help 2>&1` in
+ *--identify-strict*)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib
+ ;;
+ *)
+ lt_cv_sharedlib_from_linklib_cmd=func_cygming_dll_for_implib_fallback
+ ;;
+ esac
+ ;;
+*)
+ # fallback: assume linklib IS sharedlib
+ lt_cv_sharedlib_from_linklib_cmd="$ECHO"
+ ;;
+esac
+])
+sharedlib_from_linklib_cmd=$lt_cv_sharedlib_from_linklib_cmd
+test -z "$sharedlib_from_linklib_cmd" && sharedlib_from_linklib_cmd=$ECHO
+
+_LT_DECL([], [sharedlib_from_linklib_cmd], [1],
+ [Command to associate shared and link libraries])
+])# _LT_CHECK_SHAREDLIB_FROM_LINKLIB
+
+
+# _LT_PATH_MANIFEST_TOOL
+# ----------------------
+# locate the manifest tool
+m4_defun([_LT_PATH_MANIFEST_TOOL],
+[AC_CHECK_TOOL(MANIFEST_TOOL, mt, :)
+test -z "$MANIFEST_TOOL" && MANIFEST_TOOL=mt
+AC_CACHE_CHECK([if $MANIFEST_TOOL is a manifest tool], [lt_cv_path_mainfest_tool],
+ [lt_cv_path_mainfest_tool=no
+ echo "$as_me:$LINENO: $MANIFEST_TOOL '-?'" >&AS_MESSAGE_LOG_FD
+ $MANIFEST_TOOL '-?' 2>conftest.err > conftest.out
+ cat conftest.err >&AS_MESSAGE_LOG_FD
+ if $GREP 'Manifest Tool' conftest.out > /dev/null; then
+ lt_cv_path_mainfest_tool=yes
+ fi
+ rm -f conftest*])
+if test "x$lt_cv_path_mainfest_tool" != xyes; then
+ MANIFEST_TOOL=:
+fi
+_LT_DECL([], [MANIFEST_TOOL], [1], [Manifest tool])dnl
+])# _LT_PATH_MANIFEST_TOOL
+
# LT_LIB_M
# --------
@@ -3399,8 +3679,8 @@ esac
lt_cv_sys_global_symbol_to_cdecl="sed -n -e 's/^T .* \(.*\)$/extern int \1();/p' -e 's/^$symcode* .* \(.*\)$/extern char \1;/p'"
# Transform an extracted symbol line into symbol name and symbol address
-lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
-lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\) $/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p'"
+lt_cv_sys_global_symbol_to_c_name_address_lib_prefix="sed -n -e 's/^: \([[^ ]]*\)[[ ]]*$/ {\\\"\1\\\", (void *) 0},/p' -e 's/^$symcode* \([[^ ]]*\) \(lib[[^ ]]*\)$/ {\"\2\", (void *) \&\2},/p' -e 's/^$symcode* \([[^ ]]*\) \([[^ ]]*\)$/ {\"lib\2\", (void *) \&\2},/p'"
# Handle CRLF in mingw tool chain
opt_cr=
@@ -3424,6 +3704,7 @@ for ac_symprfx in "" "_"; do
# which start with @ or ?.
lt_cv_sys_global_symbol_pipe="$AWK ['"\
" {last_section=section; section=\$ 3};"\
+" /^COFF SYMBOL TABLE/{for(i in hide) delete hide[i]};"\
" /Section length .*#relocs.*(pick any)/{hide[last_section]=1};"\
" \$ 0!~/External *\|/{next};"\
" / 0+ UNDEF /{next}; / UNDEF \([^|]\)*()/{next};"\
@@ -3436,6 +3717,7 @@ for ac_symprfx in "" "_"; do
else
lt_cv_sys_global_symbol_pipe="sed -n -e 's/^.*[[ ]]\($symcode$symcode*\)[[ ]][[ ]]*$ac_symprfx$sympat$opt_cr$/$symxfrm/p'"
fi
+ lt_cv_sys_global_symbol_pipe="$lt_cv_sys_global_symbol_pipe | sed '/ __gnu_lto/d'"
# Check to see that the pipe works correctly.
pipe_works=no
@@ -3469,6 +3751,18 @@ _LT_EOF
if $GREP ' nm_test_var$' "$nlist" >/dev/null; then
if $GREP ' nm_test_func$' "$nlist" >/dev/null; then
cat <<_LT_EOF > conftest.$ac_ext
+/* Keep this code in sync between libtool.m4, ltmain, lt_system.h, and tests. */
+#if defined(_WIN32) || defined(__CYGWIN__) || defined(_WIN32_WCE)
+/* DATA imports from DLLs on WIN32 con't be const, because runtime
+ relocations are performed -- see ld's documentation on pseudo-relocs. */
+# define LT@&t@_DLSYM_CONST
+#elif defined(__osf__)
+/* This system does not cope well with relocations in const data. */
+# define LT@&t@_DLSYM_CONST
+#else
+# define LT@&t@_DLSYM_CONST const
+#endif
+
#ifdef __cplusplus
extern "C" {
#endif
@@ -3480,7 +3774,7 @@ _LT_EOF
cat <<_LT_EOF >> conftest.$ac_ext
/* The mapping between symbol names and symbols. */
-const struct {
+LT@&t@_DLSYM_CONST struct {
const char *name;
void *address;
}
@@ -3506,15 +3800,15 @@ static const void *lt_preloaded_setup() {
_LT_EOF
# Now try linking the two files.
mv conftest.$ac_objext conftstm.$ac_objext
- lt_save_LIBS="$LIBS"
- lt_save_CFLAGS="$CFLAGS"
+ lt_globsym_save_LIBS=$LIBS
+ lt_globsym_save_CFLAGS=$CFLAGS
LIBS="conftstm.$ac_objext"
CFLAGS="$CFLAGS$_LT_TAGVAR(lt_prog_compiler_no_builtin_flag, $1)"
if AC_TRY_EVAL(ac_link) && test -s conftest${ac_exeext}; then
pipe_works=yes
fi
- LIBS="$lt_save_LIBS"
- CFLAGS="$lt_save_CFLAGS"
+ LIBS=$lt_globsym_save_LIBS
+ CFLAGS=$lt_globsym_save_CFLAGS
else
echo "cannot find nm_test_func in $nlist" >&AS_MESSAGE_LOG_FD
fi
@@ -3547,6 +3841,13 @@ else
AC_MSG_RESULT(ok)
fi
+# Response file support.
+if test "$lt_cv_nm_interface" = "MS dumpbin"; then
+ nm_file_list_spec='@'
+elif $NM --help 2>/dev/null | grep '[[@]]FILE' >/dev/null; then
+ nm_file_list_spec='@'
+fi
+
_LT_DECL([global_symbol_pipe], [lt_cv_sys_global_symbol_pipe], [1],
[Take the output of nm and produce a listing of raw symbols and C names])
_LT_DECL([global_symbol_to_cdecl], [lt_cv_sys_global_symbol_to_cdecl], [1],
@@ -3557,6 +3858,8 @@ _LT_DECL([global_symbol_to_c_name_address],
_LT_DECL([global_symbol_to_c_name_address_lib_prefix],
[lt_cv_sys_global_symbol_to_c_name_address_lib_prefix], [1],
[Transform the output of nm in a C name address pair when lib prefix is needed])
+_LT_DECL([], [nm_file_list_spec], [1],
+ [Specify filename containing input files for $NM])
]) # _LT_CMD_GLOBAL_SYMBOLS
@@ -3568,7 +3871,6 @@ _LT_TAGVAR(lt_prog_compiler_wl, $1)=
_LT_TAGVAR(lt_prog_compiler_pic, $1)=
_LT_TAGVAR(lt_prog_compiler_static, $1)=
-AC_MSG_CHECKING([for $compiler option to produce PIC])
m4_if([$1], [CXX], [
# C++ specific cases for pic, static, wl, etc.
if test "$GXX" = yes; then
@@ -3673,6 +3975,12 @@ m4_if([$1], [CXX], [
;;
esac
;;
+ mingw* | cygwin* | os2* | pw32* | cegcc*)
+ # This hack is so that the source file can tell whether it is being
+ # built for inclusion in a dll (and should export symbols for example).
+ m4_if([$1], [GCJ], [],
+ [_LT_TAGVAR(lt_prog_compiler_pic, $1)='-DDLL_EXPORT'])
+ ;;
dgux*)
case $cc_basename in
ec++*)
@@ -3981,7 +4289,9 @@ m4_if([$1], [CXX], [
case $cc_basename in
nvcc*) # Cuda Compiler Driver 2.2
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Xlinker '
- _LT_TAGVAR(lt_prog_compiler_pic, $1)='-Xcompiler -fPIC'
+ if test -n "$_LT_TAGVAR(lt_prog_compiler_pic, $1)"; then
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)="-Xcompiler $_LT_TAGVAR(lt_prog_compiler_pic, $1)"
+ fi
;;
esac
else
@@ -4047,6 +4357,12 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(lt_prog_compiler_pic, $1)='--shared'
_LT_TAGVAR(lt_prog_compiler_static, $1)='--static'
;;
+ nagfor*)
+ # NAG Fortran compiler
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,-Wl,,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-PIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
pgcc* | pgf77* | pgf90* | pgf95* | pgfortran*)
# Portland Group compilers (*not* the Pentium gcc compiler,
# which looks to be a dead project)
@@ -4067,18 +4383,33 @@ m4_if([$1], [CXX], [
;;
*)
case `$CC -V 2>&1 | sed 5q` in
- *Sun\ F* | *Sun*Fortran*)
+ *Sun\ Ceres\ Fortran* | *Sun*Fortran*\ [[1-7]].* | *Sun*Fortran*\ 8.[[0-3]]*)
# Sun Fortran 8.3 passes all unrecognized flags to the linker
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_wl, $1)=''
;;
+ *Sun\ F* | *Sun*Fortran*)
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Qoption ld '
+ ;;
*Sun\ C*)
# Sun C 5.9
_LT_TAGVAR(lt_prog_compiler_pic, $1)='-KPIC'
_LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
_LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
;;
+ *Intel*\ [[CF]]*Compiler*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fPIC'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-static'
+ ;;
+ *Portland\ Group*)
+ _LT_TAGVAR(lt_prog_compiler_wl, $1)='-Wl,'
+ _LT_TAGVAR(lt_prog_compiler_pic, $1)='-fpic'
+ _LT_TAGVAR(lt_prog_compiler_static, $1)='-Bstatic'
+ ;;
esac
;;
esac
@@ -4166,9 +4497,11 @@ case $host_os in
_LT_TAGVAR(lt_prog_compiler_pic, $1)="$_LT_TAGVAR(lt_prog_compiler_pic, $1)@&t@m4_if([$1],[],[ -DPIC],[m4_if([$1],[CXX],[ -DPIC],[])])"
;;
esac
-AC_MSG_RESULT([$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
-_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
- [How to pass a linker flag through the compiler])
+
+AC_CACHE_CHECK([for $compiler option to produce PIC],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)],
+ [_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_prog_compiler_pic, $1)])
+_LT_TAGVAR(lt_prog_compiler_pic, $1)=$_LT_TAGVAR(lt_cv_prog_compiler_pic, $1)
#
# Check to make sure the PIC flag actually works.
@@ -4187,6 +4520,8 @@ fi
_LT_TAGDECL([pic_flag], [lt_prog_compiler_pic], [1],
[Additional compiler flags for building library objects])
+_LT_TAGDECL([wl], [lt_prog_compiler_wl], [1],
+ [How to pass a linker flag through the compiler])
#
# Check to make sure the static flag actually works.
#
@@ -4207,6 +4542,7 @@ _LT_TAGDECL([link_static_flag], [lt_prog_compiler_static], [1],
m4_defun([_LT_LINKER_SHLIBS],
[AC_REQUIRE([LT_PATH_LD])dnl
AC_REQUIRE([LT_PATH_NM])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_EGREP])dnl
m4_require([_LT_DECL_SED])dnl
@@ -4215,6 +4551,7 @@ m4_require([_LT_TAG_COMPILER])dnl
AC_MSG_CHECKING([whether the $compiler linker ($LD) supports shared libraries])
m4_if([$1], [CXX], [
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
case $host_os in
aix[[4-9]]*)
# If we're using GNU nm, then we don't want the "-C" option.
@@ -4229,15 +4566,22 @@ m4_if([$1], [CXX], [
;;
pw32*)
_LT_TAGVAR(export_symbols_cmds, $1)="$ltdll_cmds"
- ;;
+ ;;
cygwin* | mingw* | cegcc*)
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;/^.*[[ ]]__nm__/s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
+ case $cc_basename in
+ cl*)
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ ;;
+ *)
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
+ ;;
+ esac
+ ;;
*)
_LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED '\''s/.* //'\'' | sort | uniq > $export_symbols'
- ;;
+ ;;
esac
- _LT_TAGVAR(exclude_expsyms, $1)=['_GLOBAL_OFFSET_TABLE_|_GLOBAL__F[ID]_.*']
], [
runpath_var=
_LT_TAGVAR(allow_undefined_flag, $1)=
@@ -4252,7 +4596,6 @@ m4_if([$1], [CXX], [
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
_LT_TAGVAR(hardcode_libdir_separator, $1)=
_LT_TAGVAR(hardcode_minus_L, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
@@ -4405,7 +4748,8 @@ _LT_EOF
_LT_TAGVAR(allow_undefined_flag, $1)=unsupported
_LT_TAGVAR(always_export_symbols, $1)=no
_LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
- _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1 DATA/;s/^.*[[ ]]__nm__\([[^ ]]*\)[[ ]][[^ ]]*/\1 DATA/;/^I[[ ]]/d;/^[[AITW]][[ ]]/s/.* //'\'' | sort | uniq > $export_symbols'
+ _LT_TAGVAR(exclude_expsyms, $1)=['[_]+GLOBAL_OFFSET_TABLE_|[_]+GLOBAL__[FID]_.*|[_]+head_[A-Za-z0-9_]+_dll|[A-Za-z0-9_]+_dll_iname']
if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
@@ -4453,7 +4797,7 @@ _LT_EOF
if $LD --help 2>&1 | $EGREP ': supported targets:.* elf' > /dev/null \
&& test "$tmp_diet" = no
then
- tmp_addflag=
+ tmp_addflag=' $pic_flag'
tmp_sharedflag='-shared'
case $cc_basename,$host_cpu in
pgcc*) # Portland Group C compiler
@@ -4502,8 +4846,7 @@ _LT_EOF
xlf* | bgf* | bgxlf* | mpixlf*)
# IBM XL Fortran 10.1 on PPC cannot create shared libs itself
_LT_TAGVAR(whole_archive_flag_spec, $1)='--whole-archive$convenience --no-whole-archive'
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
- _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='-rpath $libdir'
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(archive_cmds, $1)='$LD -shared $libobjs $deplibs $linker_flags -soname $soname -o $lib'
if test "x$supports_anon_versioning" = xyes; then
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $output_objdir/$libname.ver~
@@ -4523,8 +4866,8 @@ _LT_EOF
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable $libobjs $deplibs $linker_flags -o $lib'
wlarc=
else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
fi
;;
@@ -4542,8 +4885,8 @@ _LT_EOF
_LT_EOF
elif $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
@@ -4589,8 +4932,8 @@ _LT_EOF
*)
if $LD --help 2>&1 | $GREP ': supported targets:.* elf' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
else
_LT_TAGVAR(ld_shlibs, $1)=no
fi
@@ -4720,7 +5063,7 @@ _LT_EOF
_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
# Determine the default libpath from the value encoded in an
# empty executable.
- _LT_SYS_MODULE_PATH_AIX
+ _LT_SYS_MODULE_PATH_AIX([$1])
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
else
@@ -4731,7 +5074,7 @@ _LT_EOF
else
# Determine the default libpath from the value encoded in an
# empty executable.
- _LT_SYS_MODULE_PATH_AIX
+ _LT_SYS_MODULE_PATH_AIX([$1])
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
@@ -4775,20 +5118,64 @@ _LT_EOF
# Microsoft Visual C++.
# hardcode_libdir_flag_spec is actually meaningless, as there is
# no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- # Tell ltmain to make .lib files, not .a files.
- libext=lib
- # Tell ltmain to make .dll files, not .so files.
- shrext_cmds=".dll"
- # FIXME: Setting linknames here is a bad hack.
- _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
- # The linker will automatically build a .lib file if we build a DLL.
- _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
- # FIXME: Should let the user specify the lib program.
- _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
- _LT_TAGVAR(fix_srcfile_path, $1)='`cygpath -w "$srcfile"`'
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ case $cc_basename in
+ cl*)
+ # Native MSVC
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ sed -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ sed -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ _LT_TAGVAR(exclude_expsyms, $1)='_NULL_IMPORT_DESCRIPTOR|_IMPORT_DESCRIPTOR_.*'
+ _LT_TAGVAR(export_symbols_cmds, $1)='$NM $libobjs $convenience | $global_symbol_pipe | $SED -e '\''/^[[BCDGRS]][[ ]]/s/.*[[ ]]\([[^ ]]*\)/\1,DATA/'\'' | $SED -e '\''/^[[AITW]][[ ]]/s/.*[[ ]]//'\'' | sort | uniq > $export_symbols'
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # Assume MSVC wrapper
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $lib $libobjs $compiler_flags `func_echo_all "$deplibs" | $SED '\''s/ -lc$//'\''` -link -dll~linknames='
+ # The linker will automatically build a .lib file if we build a DLL.
+ _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ # FIXME: Should let the user specify the lib program.
+ _LT_TAGVAR(old_archive_cmds, $1)='lib -OUT:$oldlib$oldobjs$old_deplibs'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ ;;
+ esac
;;
darwin* | rhapsody*)
@@ -4801,10 +5188,6 @@ _LT_EOF
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
- freebsd1*)
- _LT_TAGVAR(ld_shlibs, $1)=no
- ;;
-
# FreeBSD 2.2.[012] allows us to include c++rt0.o to get C++ constructor
# support. Future versions do this automatically, but an explicit c++rt0.o
# does not break anything, and helps significantly (at the cost of a little
@@ -4817,7 +5200,7 @@ _LT_EOF
;;
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
+ freebsd2.*)
_LT_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_minus_L, $1)=yes
@@ -4826,7 +5209,7 @@ _LT_EOF
# FreeBSD 3 and greater uses gcc -shared to do shared libraries.
freebsd* | dragonfly*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-R$libdir'
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_shlibpath_var, $1)=no
@@ -4834,7 +5217,7 @@ _LT_EOF
hpux9*)
if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $libobjs $deplibs $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
else
_LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$LD -b +b $install_libdir -o $output_objdir/$soname $libobjs $deplibs $linker_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
fi
@@ -4850,13 +5233,12 @@ _LT_EOF
hpux10*)
if test "$GCC" = yes && test "$with_gnu_ld" = no; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
else
_LT_TAGVAR(archive_cmds, $1)='$LD -b +h $soname +b $install_libdir -o $lib $libobjs $deplibs $linker_flags'
fi
if test "$with_gnu_ld" = no; then
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}+b ${wl}$libdir'
- _LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)='+b $libdir'
_LT_TAGVAR(hardcode_libdir_separator, $1)=:
_LT_TAGVAR(hardcode_direct, $1)=yes
_LT_TAGVAR(hardcode_direct_absolute, $1)=yes
@@ -4874,10 +5256,10 @@ _LT_EOF
_LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}+h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
;;
ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $libobjs $deplibs $compiler_flags'
;;
*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $libobjs $deplibs $compiler_flags'
;;
esac
else
@@ -4924,16 +5306,31 @@ _LT_EOF
irix5* | irix6* | nonstopux*)
if test "$GCC" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
# Try to use the -exported_symbol ld option, if it does not
# work, assume that -exports_file does not work either and
# implicitly export all symbols.
- save_LDFLAGS="$LDFLAGS"
- LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
- AC_LINK_IFELSE(int foo(void) {},
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
- )
- LDFLAGS="$save_LDFLAGS"
+ # This should be the same for all languages, so no per-tag cache variable.
+ AC_CACHE_CHECK([whether the $host_os linker accepts -exported_symbol],
+ [lt_cv_irix_exported_symbol],
+ [save_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -shared ${wl}-exported_symbol ${wl}foo ${wl}-update_registry ${wl}/dev/null"
+ AC_LINK_IFELSE(
+ [AC_LANG_SOURCE(
+ [AC_LANG_CASE([C], [[int foo (void) { return 0; }]],
+ [C++], [[int foo (void) { return 0; }]],
+ [Fortran 77], [[
+ subroutine foo
+ end]],
+ [Fortran], [[
+ subroutine foo
+ end]])])],
+ [lt_cv_irix_exported_symbol=yes],
+ [lt_cv_irix_exported_symbol=no])
+ LDFLAGS="$save_LDFLAGS"])
+ if test "$lt_cv_irix_exported_symbol" = yes; then
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $pic_flag $libobjs $deplibs $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations ${wl}-exports_file ${wl}$export_symbols -o $lib'
+ fi
else
_LT_TAGVAR(archive_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared $libobjs $deplibs $compiler_flags -soname $soname `test -n "$verstring" && func_echo_all "-set_version $verstring"` -update_registry ${output_objdir}/so_locations -exports_file $export_symbols -o $lib'
@@ -5018,7 +5415,7 @@ _LT_EOF
osf4* | osf5*) # as osf3* with the addition of -msym flag
if test "$GCC" = yes; then
_LT_TAGVAR(allow_undefined_flag, $1)=' ${wl}-expect_unresolved ${wl}\*'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared${allow_undefined_flag} $pic_flag $libobjs $deplibs $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
else
_LT_TAGVAR(allow_undefined_flag, $1)=' -expect_unresolved \*'
@@ -5037,9 +5434,9 @@ _LT_EOF
_LT_TAGVAR(no_undefined_flag, $1)=' -z defs'
if test "$GCC" = yes; then
wlarc='${wl}'
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
+ $CC -shared $pic_flag ${wl}-z ${wl}text ${wl}-M ${wl}$lib.exp ${wl}-h ${wl}$soname -o $lib $libobjs $deplibs $compiler_flags~$RM $lib.exp'
else
case `$CC -V 2>&1` in
*"Compilers 5.0"*)
@@ -5283,9 +5680,6 @@ _LT_TAGDECL([], [no_undefined_flag], [1],
_LT_TAGDECL([], [hardcode_libdir_flag_spec], [1],
[Flag to hardcode $libdir into a binary during linking.
This must work even if $libdir does not exist])
-_LT_TAGDECL([], [hardcode_libdir_flag_spec_ld], [1],
- [[If ld is used when linking, flag to hardcode $libdir into a binary
- during linking. This must work even if $libdir does not exist]])
_LT_TAGDECL([], [hardcode_libdir_separator], [1],
[Whether we need a single "-rpath" flag with a separated argument])
_LT_TAGDECL([], [hardcode_direct], [0],
@@ -5311,8 +5705,6 @@ _LT_TAGDECL([], [inherit_rpath], [0],
to runtime path list])
_LT_TAGDECL([], [link_all_deplibs], [0],
[Whether libtool must link a program against all its dependency libraries])
-_LT_TAGDECL([], [fix_srcfile_path], [1],
- [Fix the shell variable $srcfile for the compiler])
_LT_TAGDECL([], [always_export_symbols], [0],
[Set to "yes" if exported symbols are required])
_LT_TAGDECL([], [export_symbols_cmds], [2],
@@ -5323,6 +5715,8 @@ _LT_TAGDECL([], [include_expsyms], [1],
[Symbols that must always be exported])
_LT_TAGDECL([], [prelink_cmds], [2],
[Commands necessary for linking programs (against libraries) with templates])
+_LT_TAGDECL([], [postlink_cmds], [2],
+ [Commands necessary for finishing linking programs])
_LT_TAGDECL([], [file_list_spec], [1],
[Specify filename containing input files])
dnl FIXME: Not yet implemented
@@ -5424,6 +5818,7 @@ CC="$lt_save_CC"
m4_defun([_LT_LANG_CXX_CONFIG],
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
m4_require([_LT_DECL_EGREP])dnl
+m4_require([_LT_PATH_MANIFEST_TOOL])dnl
if test -n "$CXX" && ( test "X$CXX" != "Xno" &&
( (test "X$CXX" = "Xg++" && `g++ -v >/dev/null 2>&1` ) ||
(test "X$CXX" != "Xg++"))) ; then
@@ -5442,7 +5837,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
_LT_TAGVAR(hardcode_libdir_separator, $1)=
_LT_TAGVAR(hardcode_minus_L, $1)=no
_LT_TAGVAR(hardcode_shlibpath_var, $1)=unsupported
@@ -5485,6 +5879,7 @@ if test "$_lt_caught_CXX_error" != yes; then
# Allow CC to be a program name with arguments.
lt_save_CC=$CC
+ lt_save_CFLAGS=$CFLAGS
lt_save_LD=$LD
lt_save_GCC=$GCC
GCC=$GXX
@@ -5502,6 +5897,7 @@ if test "$_lt_caught_CXX_error" != yes; then
fi
test -z "${LDCXX+set}" || LD=$LDCXX
CC=${CXX-"c++"}
+ CFLAGS=$CXXFLAGS
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_CC_BASENAME([$compiler])
@@ -5523,8 +5919,8 @@ if test "$_lt_caught_CXX_error" != yes; then
# Check if GNU C++ uses GNU ld as the underlying linker, since the
# archiving commands below assume that GNU ld is being used.
if test "$with_gnu_ld" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
- _LT_TAGVAR(archive_expsym_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname -o $lib'
+ _LT_TAGVAR(archive_expsym_cmds, $1)='$CC $pic_flag -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname $wl$soname ${wl}-retain-symbols-file $wl$export_symbols -o $lib'
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-rpath ${wl}$libdir'
_LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-dynamic'
@@ -5665,7 +6061,7 @@ if test "$_lt_caught_CXX_error" != yes; then
_LT_TAGVAR(allow_undefined_flag, $1)='-berok'
# Determine the default libpath from the value encoded in an empty
# executable.
- _LT_SYS_MODULE_PATH_AIX
+ _LT_SYS_MODULE_PATH_AIX([$1])
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
_LT_TAGVAR(archive_expsym_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $deplibs '"\${wl}$no_entry_flag"' $compiler_flags `if test "x${allow_undefined_flag}" != "x"; then func_echo_all "${wl}${allow_undefined_flag}"; else :; fi` '"\${wl}$exp_sym_flag:\$export_symbols $shared_flag"
@@ -5677,7 +6073,7 @@ if test "$_lt_caught_CXX_error" != yes; then
else
# Determine the default libpath from the value encoded in an
# empty executable.
- _LT_SYS_MODULE_PATH_AIX
+ _LT_SYS_MODULE_PATH_AIX([$1])
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)='${wl}-blibpath:$libdir:'"$aix_libpath"
# Warning - without using the other run time loading flags,
# -berok will link without error, but may produce a broken library.
@@ -5719,29 +6115,75 @@ if test "$_lt_caught_CXX_error" != yes; then
;;
cygwin* | mingw* | pw32* | cegcc*)
- # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
- # as there is no search path for DLLs.
- _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
- _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
- _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
- _LT_TAGVAR(always_export_symbols, $1)=no
- _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
-
- if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- # If the export-symbols file already is a .def file (1st line
- # is EXPORTS), use it as is; otherwise, prepend...
- _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
- cp $export_symbols $output_objdir/$soname.def;
- else
- echo EXPORTS > $output_objdir/$soname.def;
- cat $export_symbols >> $output_objdir/$soname.def;
- fi~
- $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
- else
- _LT_TAGVAR(ld_shlibs, $1)=no
- fi
- ;;
+ case $GXX,$cc_basename in
+ ,cl* | no,cl*)
+ # Native MSVC
+ # hardcode_libdir_flag_spec is actually meaningless, as there is
+ # no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)=' '
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=yes
+ _LT_TAGVAR(file_list_spec, $1)='@'
+ # Tell ltmain to make .lib files, not .a files.
+ libext=lib
+ # Tell ltmain to make .dll files, not .so files.
+ shrext_cmds=".dll"
+ # FIXME: Setting linknames here is a bad hack.
+ _LT_TAGVAR(archive_cmds, $1)='$CC -o $output_objdir/$soname $libobjs $compiler_flags $deplibs -Wl,-dll~linknames='
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ $SED -n -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' -e '1\\\!p' < $export_symbols > $output_objdir/$soname.exp;
+ else
+ $SED -e 's/\\\\\\\(.*\\\\\\\)/-link\\\ -EXPORT:\\\\\\\1/' < $export_symbols > $output_objdir/$soname.exp;
+ fi~
+ $CC -o $tool_output_objdir$soname $libobjs $compiler_flags $deplibs "@$tool_output_objdir$soname.exp" -Wl,-DLL,-IMPLIB:"$tool_output_objdir$libname.dll.lib"~
+ linknames='
+ # The linker will not automatically build a static lib if we build a DLL.
+ # _LT_TAGVAR(old_archive_from_new_cmds, $1)='true'
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+ # Don't use ranlib
+ _LT_TAGVAR(old_postinstall_cmds, $1)='chmod 644 $oldlib'
+ _LT_TAGVAR(postlink_cmds, $1)='lt_outputfile="@OUTPUT@"~
+ lt_tool_outputfile="@TOOL_OUTPUT@"~
+ case $lt_outputfile in
+ *.exe|*.EXE) ;;
+ *)
+ lt_outputfile="$lt_outputfile.exe"
+ lt_tool_outputfile="$lt_tool_outputfile.exe"
+ ;;
+ esac~
+ func_to_tool_file "$lt_outputfile"~
+ if test "$MANIFEST_TOOL" != ":" && test -f "$lt_outputfile.manifest"; then
+ $MANIFEST_TOOL -manifest "$lt_tool_outputfile.manifest" -outputresource:"$lt_tool_outputfile" || exit 1;
+ $RM "$lt_outputfile.manifest";
+ fi'
+ ;;
+ *)
+ # g++
+ # _LT_TAGVAR(hardcode_libdir_flag_spec, $1) is actually meaningless,
+ # as there is no search path for DLLs.
+ _LT_TAGVAR(hardcode_libdir_flag_spec, $1)='-L$libdir'
+ _LT_TAGVAR(export_dynamic_flag_spec, $1)='${wl}--export-all-symbols'
+ _LT_TAGVAR(allow_undefined_flag, $1)=unsupported
+ _LT_TAGVAR(always_export_symbols, $1)=no
+ _LT_TAGVAR(enable_shared_with_static_runtimes, $1)=yes
+
+ if $LD --help 2>&1 | $GREP 'auto-import' > /dev/null; then
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ # If the export-symbols file already is a .def file (1st line
+ # is EXPORTS), use it as is; otherwise, prepend...
+ _LT_TAGVAR(archive_expsym_cmds, $1)='if test "x`$SED 1q $export_symbols`" = xEXPORTS; then
+ cp $export_symbols $output_objdir/$soname.def;
+ else
+ echo EXPORTS > $output_objdir/$soname.def;
+ cat $export_symbols >> $output_objdir/$soname.def;
+ fi~
+ $CC -shared -nostdlib $output_objdir/$soname.def $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags -o $output_objdir/$soname ${wl}--enable-auto-image-base -Xlinker --out-implib -Xlinker $lib'
+ else
+ _LT_TAGVAR(ld_shlibs, $1)=no
+ fi
+ ;;
+ esac
+ ;;
darwin* | rhapsody*)
_LT_DARWIN_LINKER_FEATURES($1)
;;
@@ -5764,7 +6206,7 @@ if test "$_lt_caught_CXX_error" != yes; then
esac
;;
- freebsd[[12]]*)
+ freebsd2.*)
# C++ shared libraries reported to be fairly broken before
# switch to ELF
_LT_TAGVAR(ld_shlibs, $1)=no
@@ -5816,7 +6258,7 @@ if test "$_lt_caught_CXX_error" != yes; then
;;
*)
if test "$GXX" = yes; then
- _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib -fPIC ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$RM $output_objdir/$soname~$CC -shared -nostdlib $pic_flag ${wl}+b ${wl}$install_libdir -o $output_objdir/$soname $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~test $output_objdir/$soname = $lib || mv $output_objdir/$soname $lib'
else
# FIXME: insert proper C++ library support
_LT_TAGVAR(ld_shlibs, $1)=no
@@ -5887,10 +6329,10 @@ if test "$_lt_caught_CXX_error" != yes; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
ia64*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+nodefaultrpath -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib -fPIC ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $pic_flag ${wl}+h ${wl}$soname ${wl}+b ${wl}$install_libdir -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags'
;;
esac
fi
@@ -5931,9 +6373,9 @@ if test "$_lt_caught_CXX_error" != yes; then
*)
if test "$GXX" = yes; then
if test "$with_gnu_ld" = no; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
else
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` -o $lib'
fi
fi
_LT_TAGVAR(link_all_deplibs, $1)=yes
@@ -6211,7 +6653,7 @@ if test "$_lt_caught_CXX_error" != yes; then
_LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
;;
*)
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib ${allow_undefined_flag} $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-msym ${wl}-soname ${wl}$soname `test -n "$verstring" && func_echo_all "${wl}-set_version ${wl}$verstring"` ${wl}-update_registry ${wl}${output_objdir}/so_locations -o $lib'
;;
esac
@@ -6298,9 +6740,9 @@ if test "$_lt_caught_CXX_error" != yes; then
if test "$GXX" = yes && test "$with_gnu_ld" = no; then
_LT_TAGVAR(no_undefined_flag, $1)=' ${wl}-z ${wl}defs'
if $CC --version | $GREP -v '^2\.7' > /dev/null; then
- _LT_TAGVAR(archive_cmds, $1)='$CC -shared -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
+ _LT_TAGVAR(archive_cmds, $1)='$CC -shared $pic_flag -nostdlib $LDFLAGS $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags ${wl}-h $wl$soname -o $lib'
_LT_TAGVAR(archive_expsym_cmds, $1)='echo "{ global:" > $lib.exp~cat $export_symbols | $SED -e "s/\(.*\)/\1;/" >> $lib.exp~echo "local: *; };" >> $lib.exp~
- $CC -shared -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
+ $CC -shared $pic_flag -nostdlib ${wl}-M $wl$lib.exp -o $lib $predep_objects $libobjs $deplibs $postdep_objects $compiler_flags~$RM $lib.exp'
# Commands to make compiler produce verbose output that lists
# what "hidden" libraries, object files and flags are used when
@@ -6429,6 +6871,7 @@ if test "$_lt_caught_CXX_error" != yes; then
fi # test -n "$compiler"
CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
LDCXX=$LD
LD=$lt_save_LD
GCC=$lt_save_GCC
@@ -6443,6 +6886,29 @@ AC_LANG_POP
])# _LT_LANG_CXX_CONFIG
+# _LT_FUNC_STRIPNAME_CNF
+# ----------------------
+# func_stripname_cnf prefix suffix name
+# strip PREFIX and SUFFIX off of NAME.
+# PREFIX and SUFFIX must not contain globbing or regex special
+# characters, hashes, percent signs, but SUFFIX may contain a leading
+# dot (in which case that matches only a dot).
+#
+# This function is identical to the (non-XSI) version of func_stripname,
+# except this one can be used by m4 code that may be executed by configure,
+# rather than the libtool script.
+m4_defun([_LT_FUNC_STRIPNAME_CNF],[dnl
+AC_REQUIRE([_LT_DECL_SED])
+AC_REQUIRE([_LT_PROG_ECHO_BACKSLASH])
+func_stripname_cnf ()
+{
+ case ${2} in
+ .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
+ *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
+ esac
+} # func_stripname_cnf
+])# _LT_FUNC_STRIPNAME_CNF
+
# _LT_SYS_HIDDEN_LIBDEPS([TAGNAME])
# ---------------------------------
# Figure out "hidden" library dependencies from verbose
@@ -6451,6 +6917,7 @@ AC_LANG_POP
# objects, libraries and library flags.
m4_defun([_LT_SYS_HIDDEN_LIBDEPS],
[m4_require([_LT_FILEUTILS_DEFAULTS])dnl
+AC_REQUIRE([_LT_FUNC_STRIPNAME_CNF])dnl
# Dependencies to place before and after the object being linked:
_LT_TAGVAR(predep_objects, $1)=
_LT_TAGVAR(postdep_objects, $1)=
@@ -6500,7 +6967,20 @@ public class foo {
}
};
_LT_EOF
+], [$1], [GO], [cat > conftest.$ac_ext <<_LT_EOF
+package foo
+func foo() {
+}
+_LT_EOF
])
+
+_lt_libdeps_save_CFLAGS=$CFLAGS
+case "$CC $CFLAGS " in #(
+*\ -flto*\ *) CFLAGS="$CFLAGS -fno-lto" ;;
+*\ -fwhopr*\ *) CFLAGS="$CFLAGS -fno-whopr" ;;
+*\ -fuse-linker-plugin*\ *) CFLAGS="$CFLAGS -fno-use-linker-plugin" ;;
+esac
+
dnl Parse the compiler output and extract the necessary
dnl objects, libraries and library flags.
if AC_TRY_EVAL(ac_compile); then
@@ -6512,7 +6992,7 @@ if AC_TRY_EVAL(ac_compile); then
pre_test_object_deps_done=no
for p in `eval "$output_verbose_link_cmd"`; do
- case $p in
+ case ${prev}${p} in
-L* | -R* | -l*)
# Some compilers place space between "-{L,R}" and the path.
@@ -6521,13 +7001,22 @@ if AC_TRY_EVAL(ac_compile); then
test $p = "-R"; then
prev=$p
continue
- else
- prev=
fi
+ # Expand the sysroot to ease extracting the directories later.
+ if test -z "$prev"; then
+ case $p in
+ -L*) func_stripname_cnf '-L' '' "$p"; prev=-L; p=$func_stripname_result ;;
+ -R*) func_stripname_cnf '-R' '' "$p"; prev=-R; p=$func_stripname_result ;;
+ -l*) func_stripname_cnf '-l' '' "$p"; prev=-l; p=$func_stripname_result ;;
+ esac
+ fi
+ case $p in
+ =*) func_stripname_cnf '=' '' "$p"; p=$lt_sysroot$func_stripname_result ;;
+ esac
if test "$pre_test_object_deps_done" = no; then
- case $p in
- -L* | -R*)
+ case ${prev} in
+ -L | -R)
# Internal compiler library paths should come after those
# provided the user. The postdeps already come after the
# user supplied libs so there is no need to process them.
@@ -6547,8 +7036,10 @@ if AC_TRY_EVAL(ac_compile); then
_LT_TAGVAR(postdeps, $1)="${_LT_TAGVAR(postdeps, $1)} ${prev}${p}"
fi
fi
+ prev=
;;
+ *.lto.$objext) ;; # Ignore GCC LTO objects
*.$objext)
# This assumes that the test object file only shows up
# once in the compiler output.
@@ -6584,6 +7075,7 @@ else
fi
$RM -f confest.$objext
+CFLAGS=$_lt_libdeps_save_CFLAGS
# PORTME: override above test on systems where it is broken
m4_if([$1], [CXX],
@@ -6683,7 +7175,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
_LT_TAGVAR(hardcode_libdir_separator, $1)=
_LT_TAGVAR(hardcode_minus_L, $1)=no
_LT_TAGVAR(hardcode_automatic, $1)=no
@@ -6733,7 +7224,9 @@ if test "$_lt_disable_F77" != yes; then
# Allow CC to be a program name with arguments.
lt_save_CC="$CC"
lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
CC=${F77-"f77"}
+ CFLAGS=$FFLAGS
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_CC_BASENAME([$compiler])
@@ -6787,6 +7280,7 @@ if test "$_lt_disable_F77" != yes; then
GCC=$lt_save_GCC
CC="$lt_save_CC"
+ CFLAGS="$lt_save_CFLAGS"
fi # test "$_lt_disable_F77" != yes
AC_LANG_POP
@@ -6813,7 +7307,6 @@ _LT_TAGVAR(export_dynamic_flag_spec, $1)=
_LT_TAGVAR(hardcode_direct, $1)=no
_LT_TAGVAR(hardcode_direct_absolute, $1)=no
_LT_TAGVAR(hardcode_libdir_flag_spec, $1)=
-_LT_TAGVAR(hardcode_libdir_flag_spec_ld, $1)=
_LT_TAGVAR(hardcode_libdir_separator, $1)=
_LT_TAGVAR(hardcode_minus_L, $1)=no
_LT_TAGVAR(hardcode_automatic, $1)=no
@@ -6863,7 +7356,9 @@ if test "$_lt_disable_FC" != yes; then
# Allow CC to be a program name with arguments.
lt_save_CC="$CC"
lt_save_GCC=$GCC
+ lt_save_CFLAGS=$CFLAGS
CC=${FC-"f95"}
+ CFLAGS=$FCFLAGS
compiler=$CC
GCC=$ac_cv_fc_compiler_gnu
@@ -6919,7 +7414,8 @@ if test "$_lt_disable_FC" != yes; then
fi # test -n "$compiler"
GCC=$lt_save_GCC
- CC="$lt_save_CC"
+ CC=$lt_save_CC
+ CFLAGS=$lt_save_CFLAGS
fi # test "$_lt_disable_FC" != yes
AC_LANG_POP
@@ -6956,10 +7452,12 @@ _LT_COMPILER_BOILERPLATE
_LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
-lt_save_CC="$CC"
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
lt_save_GCC=$GCC
GCC=yes
CC=${GCJ-"gcj"}
+CFLAGS=$GCJFLAGS
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_TAGVAR(LD, $1)="$LD"
@@ -6990,10 +7488,82 @@ fi
AC_LANG_RESTORE
GCC=$lt_save_GCC
-CC="$lt_save_CC"
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
])# _LT_LANG_GCJ_CONFIG
+# _LT_LANG_GO_CONFIG([TAG])
+# --------------------------
+# Ensure that the configuration variables for the GNU Go compiler
+# are suitably defined. These variables are subsequently used by _LT_CONFIG
+# to write the compiler configuration to `libtool'.
+m4_defun([_LT_LANG_GO_CONFIG],
+[AC_REQUIRE([LT_PROG_GO])dnl
+AC_LANG_SAVE
+
+# Source file extension for Go test sources.
+ac_ext=go
+
+# Object file extension for compiled Go test sources.
+objext=o
+_LT_TAGVAR(objext, $1)=$objext
+
+# Code to be used in simple compile tests
+lt_simple_compile_test_code="package main; func main() { }"
+
+# Code to be used in simple link tests
+lt_simple_link_test_code='package main; func main() { }'
+
+# ltmain only uses $CC for tagged configurations so make sure $CC is set.
+_LT_TAG_COMPILER
+
+# save warnings/boilerplate of simple test code
+_LT_COMPILER_BOILERPLATE
+_LT_LINKER_BOILERPLATE
+
+# Allow CC to be a program name with arguments.
+lt_save_CC=$CC
+lt_save_CFLAGS=$CFLAGS
+lt_save_GCC=$GCC
+GCC=yes
+CC=${GOC-"gccgo"}
+CFLAGS=$GOFLAGS
+compiler=$CC
+_LT_TAGVAR(compiler, $1)=$CC
+_LT_TAGVAR(LD, $1)="$LD"
+_LT_CC_BASENAME([$compiler])
+
+# Go did not exist at the time GCC didn't implicitly link libc in.
+_LT_TAGVAR(archive_cmds_need_lc, $1)=no
+
+_LT_TAGVAR(old_archive_cmds, $1)=$old_archive_cmds
+_LT_TAGVAR(reload_flag, $1)=$reload_flag
+_LT_TAGVAR(reload_cmds, $1)=$reload_cmds
+
+## CAVEAT EMPTOR:
+## There is no encapsulation within the following macros, do not change
+## the running order or otherwise move them around unless you know exactly
+## what you are doing...
+if test -n "$compiler"; then
+ _LT_COMPILER_NO_RTTI($1)
+ _LT_COMPILER_PIC($1)
+ _LT_COMPILER_C_O($1)
+ _LT_COMPILER_FILE_LOCKS($1)
+ _LT_LINKER_SHLIBS($1)
+ _LT_LINKER_HARDCODE_LIBPATH($1)
+
+ _LT_CONFIG($1)
+fi
+
+AC_LANG_RESTORE
+
+GCC=$lt_save_GCC
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
+])# _LT_LANG_GO_CONFIG
+
+
# _LT_LANG_RC_CONFIG([TAG])
# -------------------------
# Ensure that the configuration variables for the Windows resource compiler
@@ -7025,9 +7595,11 @@ _LT_LINKER_BOILERPLATE
# Allow CC to be a program name with arguments.
lt_save_CC="$CC"
+lt_save_CFLAGS=$CFLAGS
lt_save_GCC=$GCC
GCC=
CC=${RC-"windres"}
+CFLAGS=
compiler=$CC
_LT_TAGVAR(compiler, $1)=$CC
_LT_CC_BASENAME([$compiler])
@@ -7040,7 +7612,8 @@ fi
GCC=$lt_save_GCC
AC_LANG_RESTORE
-CC="$lt_save_CC"
+CC=$lt_save_CC
+CFLAGS=$lt_save_CFLAGS
])# _LT_LANG_RC_CONFIG
@@ -7060,6 +7633,13 @@ dnl aclocal-1.4 backwards compatibility:
dnl AC_DEFUN([LT_AC_PROG_GCJ], [])
+# LT_PROG_GO
+# ----------
+AC_DEFUN([LT_PROG_GO],
+[AC_CHECK_TOOL(GOC, gccgo,)
+])
+
+
# LT_PROG_RC
# ----------
AC_DEFUN([LT_PROG_RC],
@@ -7099,6 +7679,15 @@ _LT_DECL([], [OBJDUMP], [1], [An object symbol dumper])
AC_SUBST([OBJDUMP])
])
+# _LT_DECL_DLLTOOL
+# ----------------
+# Ensure DLLTOOL variable is set.
+m4_defun([_LT_DECL_DLLTOOL],
+[AC_CHECK_TOOL(DLLTOOL, dlltool, false)
+test -z "$DLLTOOL" && DLLTOOL=dlltool
+_LT_DECL([], [DLLTOOL], [1], [DLL creation program])
+AC_SUBST([DLLTOOL])
+])
# _LT_DECL_SED
# ------------
@@ -7192,8 +7781,8 @@ m4_defun([_LT_CHECK_SHELL_FEATURES],
# Try some XSI features
xsi_shell=no
( _lt_dummy="a/b/c"
- test "${_lt_dummy##*/},${_lt_dummy%/*},"${_lt_dummy%"$_lt_dummy"}, \
- = c,a/b,, \
+ test "${_lt_dummy##*/},${_lt_dummy%/*},${_lt_dummy#??}"${_lt_dummy%"$_lt_dummy"}, \
+ = c,a/b,b/c, \
&& eval 'test $(( 1 + 1 )) -eq 2 \
&& test "${#_lt_dummy}" -eq 5' ) >/dev/null 2>&1 \
&& xsi_shell=yes
@@ -7232,206 +7821,162 @@ _LT_DECL([NL2SP], [lt_NL2SP], [1], [turn newlines into spaces])dnl
])# _LT_CHECK_SHELL_FEATURES
-# _LT_PROG_XSI_SHELLFNS
-# ---------------------
-# Bourne and XSI compatible variants of some useful shell functions.
-m4_defun([_LT_PROG_XSI_SHELLFNS],
-[case $xsi_shell in
- yes)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
-}
-
-# func_basename file
-func_basename ()
-{
- func_basename_result="${1##*/}"
-}
-
-# func_dirname_and_basename file append nondir_replacement
-# perform func_basename and func_dirname in a single function
-# call:
-# dirname: Compute the dirname of FILE. If nonempty,
-# add APPEND to the result, otherwise set result
-# to NONDIR_REPLACEMENT.
-# value returned in "$func_dirname_result"
-# basename: Compute filename of FILE.
-# value retuned in "$func_basename_result"
-# Implementation must be kept synchronized with func_dirname
-# and func_basename. For efficiency, we do not delegate to
-# those functions but instead duplicate the functionality here.
-func_dirname_and_basename ()
-{
- case ${1} in
- */*) func_dirname_result="${1%/*}${2}" ;;
- * ) func_dirname_result="${3}" ;;
- esac
- func_basename_result="${1##*/}"
-}
-
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-func_stripname ()
-{
- # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
- # positional parameters, so assign one to ordinary parameter first.
- func_stripname_result=${3}
- func_stripname_result=${func_stripname_result#"${1}"}
- func_stripname_result=${func_stripname_result%"${2}"}
-}
-
-# func_opt_split
-func_opt_split ()
-{
- func_opt_split_opt=${1%%=*}
- func_opt_split_arg=${1#*=}
-}
-
-# func_lo2o object
-func_lo2o ()
-{
- case ${1} in
- *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
- *) func_lo2o_result=${1} ;;
- esac
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=${1%.*}.lo
-}
-
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=$(( $[*] ))
-}
+# _LT_PROG_FUNCTION_REPLACE (FUNCNAME, REPLACEMENT-BODY)
+# ------------------------------------------------------
+# In `$cfgfile', look for function FUNCNAME delimited by `^FUNCNAME ()$' and
+# '^} FUNCNAME ', and replace its body with REPLACEMENT-BODY.
+m4_defun([_LT_PROG_FUNCTION_REPLACE],
+[dnl {
+sed -e '/^$1 ()$/,/^} # $1 /c\
+$1 ()\
+{\
+m4_bpatsubsts([$2], [$], [\\], [^\([ ]\)], [\\\1])
+} # Extended-shell $1 implementation' "$cfgfile" > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+test 0 -eq $? || _lt_function_replace_fail=:
+])
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=${#1}
-}
-_LT_EOF
- ;;
- *) # Bourne compatible functions.
- cat << \_LT_EOF >> "$cfgfile"
+# _LT_PROG_REPLACE_SHELLFNS
+# -------------------------
+# Replace existing portable implementations of several shell functions with
+# equivalent extended shell implementations where those features are available..
+m4_defun([_LT_PROG_REPLACE_SHELLFNS],
+[if test x"$xsi_shell" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_dirname], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac])
+
+ _LT_PROG_FUNCTION_REPLACE([func_basename], [dnl
+ func_basename_result="${1##*/}"])
+
+ _LT_PROG_FUNCTION_REPLACE([func_dirname_and_basename], [dnl
+ case ${1} in
+ */*) func_dirname_result="${1%/*}${2}" ;;
+ * ) func_dirname_result="${3}" ;;
+ esac
+ func_basename_result="${1##*/}"])
-# func_dirname file append nondir_replacement
-# Compute the dirname of FILE. If nonempty, add APPEND to the result,
-# otherwise set result to NONDIR_REPLACEMENT.
-func_dirname ()
-{
- # Extract subdirectory from the argument.
- func_dirname_result=`$ECHO "${1}" | $SED "$dirname"`
- if test "X$func_dirname_result" = "X${1}"; then
- func_dirname_result="${3}"
- else
- func_dirname_result="$func_dirname_result${2}"
- fi
-}
+ _LT_PROG_FUNCTION_REPLACE([func_stripname], [dnl
+ # pdksh 5.2.14 does not do ${X%$Y} correctly if both X and Y are
+ # positional parameters, so assign one to ordinary parameter first.
+ func_stripname_result=${3}
+ func_stripname_result=${func_stripname_result#"${1}"}
+ func_stripname_result=${func_stripname_result%"${2}"}])
-# func_basename file
-func_basename ()
-{
- func_basename_result=`$ECHO "${1}" | $SED "$basename"`
-}
+ _LT_PROG_FUNCTION_REPLACE([func_split_long_opt], [dnl
+ func_split_long_opt_name=${1%%=*}
+ func_split_long_opt_arg=${1#*=}])
-dnl func_dirname_and_basename
-dnl A portable version of this function is already defined in general.m4sh
-dnl so there is no need for it here.
+ _LT_PROG_FUNCTION_REPLACE([func_split_short_opt], [dnl
+ func_split_short_opt_arg=${1#??}
+ func_split_short_opt_name=${1%"$func_split_short_opt_arg"}])
-# func_stripname prefix suffix name
-# strip PREFIX and SUFFIX off of NAME.
-# PREFIX and SUFFIX must not contain globbing or regex special
-# characters, hashes, percent signs, but SUFFIX may contain a leading
-# dot (in which case that matches only a dot).
-# func_strip_suffix prefix name
-func_stripname ()
-{
- case ${2} in
- .*) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%\\\\${2}\$%%"`;;
- *) func_stripname_result=`$ECHO "${3}" | $SED "s%^${1}%%; s%${2}\$%%"`;;
- esac
-}
+ _LT_PROG_FUNCTION_REPLACE([func_lo2o], [dnl
+ case ${1} in
+ *.lo) func_lo2o_result=${1%.lo}.${objext} ;;
+ *) func_lo2o_result=${1} ;;
+ esac])
-# sed scripts:
-my_sed_long_opt='1s/^\(-[[^=]]*\)=.*/\1/;q'
-my_sed_long_arg='1s/^-[[^=]]*=//'
+ _LT_PROG_FUNCTION_REPLACE([func_xform], [ func_xform_result=${1%.*}.lo])
-# func_opt_split
-func_opt_split ()
-{
- func_opt_split_opt=`$ECHO "${1}" | $SED "$my_sed_long_opt"`
- func_opt_split_arg=`$ECHO "${1}" | $SED "$my_sed_long_arg"`
-}
+ _LT_PROG_FUNCTION_REPLACE([func_arith], [ func_arith_result=$(( $[*] ))])
-# func_lo2o object
-func_lo2o ()
-{
- func_lo2o_result=`$ECHO "${1}" | $SED "$lo2o"`
-}
-
-# func_xform libobj-or-source
-func_xform ()
-{
- func_xform_result=`$ECHO "${1}" | $SED 's/\.[[^.]]*$/.lo/'`
-}
+ _LT_PROG_FUNCTION_REPLACE([func_len], [ func_len_result=${#1}])
+fi
-# func_arith arithmetic-term...
-func_arith ()
-{
- func_arith_result=`expr "$[@]"`
-}
+if test x"$lt_shell_append" = xyes; then
+ _LT_PROG_FUNCTION_REPLACE([func_append], [ eval "${1}+=\\${2}"])
-# func_len string
-# STRING may not start with a hyphen.
-func_len ()
-{
- func_len_result=`expr "$[1]" : ".*" 2>/dev/null || echo $max_cmd_len`
-}
+ _LT_PROG_FUNCTION_REPLACE([func_append_quoted], [dnl
+ func_quote_for_eval "${2}"
+dnl m4 expansion turns \\\\ into \\, and then the shell eval turns that into \
+ eval "${1}+=\\\\ \\$func_quote_for_eval_result"])
-_LT_EOF
-esac
+ # Save a `func_append' function call where possible by direct use of '+='
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1+="%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+else
+ # Save a `func_append' function call even when '+=' is not available
+ sed -e 's%func_append \([[a-zA-Z_]]\{1,\}\) "%\1="$\1%g' $cfgfile > $cfgfile.tmp \
+ && mv -f "$cfgfile.tmp" "$cfgfile" \
+ || (rm -f "$cfgfile" && cp "$cfgfile.tmp" "$cfgfile" && rm -f "$cfgfile.tmp")
+ test 0 -eq $? || _lt_function_replace_fail=:
+fi
-case $lt_shell_append in
- yes)
- cat << \_LT_EOF >> "$cfgfile"
+if test x"$_lt_function_replace_fail" = x":"; then
+ AC_MSG_WARN([Unable to substitute extended shell functions in $ofile])
+fi
+])
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "$[1]+=\$[2]"
-}
-_LT_EOF
+# _LT_PATH_CONVERSION_FUNCTIONS
+# -----------------------------
+# Determine which file name conversion functions should be used by
+# func_to_host_file (and, implicitly, by func_to_host_path). These are needed
+# for certain cross-compile configurations and native mingw.
+m4_defun([_LT_PATH_CONVERSION_FUNCTIONS],
+[AC_REQUIRE([AC_CANONICAL_HOST])dnl
+AC_REQUIRE([AC_CANONICAL_BUILD])dnl
+AC_MSG_CHECKING([how to convert $build file names to $host format])
+AC_CACHE_VAL(lt_cv_to_host_file_cmd,
+[case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_cygwin_to_w32
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_w32
+ ;;
+ esac
;;
- *)
- cat << \_LT_EOF >> "$cfgfile"
-
-# func_append var value
-# Append VALUE to the end of shell variable VAR.
-func_append ()
-{
- eval "$[1]=\$$[1]\$[2]"
-}
-
-_LT_EOF
+ *-*-cygwin* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_host_file_cmd=func_convert_file_msys_to_cygwin
+ ;;
+ *-*-cygwin* )
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+ * ) # otherwise, assume *nix
+ lt_cv_to_host_file_cmd=func_convert_file_nix_to_cygwin
+ ;;
+ esac
;;
- esac
+ * ) # unhandled hosts (and "normal" native builds)
+ lt_cv_to_host_file_cmd=func_convert_file_noop
+ ;;
+esac
+])
+to_host_file_cmd=$lt_cv_to_host_file_cmd
+AC_MSG_RESULT([$lt_cv_to_host_file_cmd])
+_LT_DECL([to_host_file_cmd], [lt_cv_to_host_file_cmd],
+ [0], [convert $build file names to $host format])dnl
+
+AC_MSG_CHECKING([how to convert $build file names to toolchain format])
+AC_CACHE_VAL(lt_cv_to_tool_file_cmd,
+[#assume ordinary cross tools, or native build.
+lt_cv_to_tool_file_cmd=func_convert_file_noop
+case $host in
+ *-*-mingw* )
+ case $build in
+ *-*-mingw* ) # actually msys
+ lt_cv_to_tool_file_cmd=func_convert_file_msys_to_w32
+ ;;
+ esac
+ ;;
+esac
])
+to_tool_file_cmd=$lt_cv_to_tool_file_cmd
+AC_MSG_RESULT([$lt_cv_to_tool_file_cmd])
+_LT_DECL([to_tool_file_cmd], [lt_cv_to_tool_file_cmd],
+ [0], [convert $build files to toolchain format])dnl
+])# _LT_PATH_CONVERSION_FUNCTIONS
diff --git a/m4/ltoptions.m4 b/m4/ltoptions.m4
index 17cfd51..5d9acd8 100644
--- a/m4/ltoptions.m4
+++ b/m4/ltoptions.m4
@@ -326,9 +326,24 @@ dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
m4_define([_LT_WITH_PIC],
[AC_ARG_WITH([pic],
- [AS_HELP_STRING([--with-pic],
+ [AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
- [pic_mode="$withval"],
+ [lt_p=${PACKAGE-default}
+ case $withval in
+ yes|no) pic_mode=$withval ;;
+ *)
+ pic_mode=default
+ # Look at the argument we got. We use all the common list separators.
+ lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
+ for lt_pkg in $withval; do
+ IFS="$lt_save_ifs"
+ if test "X$lt_pkg" = "X$lt_p"; then
+ pic_mode=yes
+ fi
+ done
+ IFS="$lt_save_ifs"
+ ;;
+ esac],
[pic_mode=default])
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
diff --git a/m4/ltversion.m4 b/m4/ltversion.m4
index 93fc771..07a8602 100644
--- a/m4/ltversion.m4
+++ b/m4/ltversion.m4
@@ -7,17 +7,17 @@
# unlimited permission to copy and/or distribute it, with or without
# modifications, as long as this notice is preserved.
-# Generated from ltversion.in.
+# @configure_input@
-# serial 3175 ltversion.m4
+# serial 3337 ltversion.m4
# This file is part of GNU Libtool
-m4_define([LT_PACKAGE_VERSION], [2.2.10])
-m4_define([LT_PACKAGE_REVISION], [1.3175])
+m4_define([LT_PACKAGE_VERSION], [2.4.2])
+m4_define([LT_PACKAGE_REVISION], [1.3337])
AC_DEFUN([LTVERSION_VERSION],
-[macro_version='2.2.10'
-macro_revision='1.3175'
+[macro_version='2.4.2'
+macro_revision='1.3337'
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
_LT_DECL(, macro_revision, 0)
])
diff --git a/openbsd/Battery.c b/openbsd/Battery.c
new file mode 100644
index 0000000..f9d0969
--- /dev/null
+++ b/openbsd/Battery.c
@@ -0,0 +1,16 @@
+/*
+htop - openbsd/Battery.c
+(C) 2015 Hisham H. Muhammad
+(C) 2015 Michael McConville
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "BatteryMeter.h"
+
+void Battery_getData(double* level, ACPresence* isOnAC) {
+ // TODO
+ *level = -1;
+ *isOnAC = AC_ERROR;
+}
+
diff --git a/openbsd/Battery.h b/openbsd/Battery.h
new file mode 100644
index 0000000..b1a4982
--- /dev/null
+++ b/openbsd/Battery.h
@@ -0,0 +1,16 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_Battery
+#define HEADER_Battery
+/*
+htop - openbsd/Battery.h
+(C) 2015 Hisham H. Muhammad
+(C) 2015 Michael McConville
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+void Battery_getData(double* level, ACPresence* isOnAC);
+
+
+#endif
diff --git a/openbsd/OpenBSDCRT.c b/openbsd/OpenBSDCRT.c
new file mode 100644
index 0000000..c5dcec4
--- /dev/null
+++ b/openbsd/OpenBSDCRT.c
@@ -0,0 +1,22 @@
+/*
+htop - UnsupportedCRT.c
+(C) 2014 Hisham H. Muhammad
+(C) 2015 Michael McConville
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "config.h"
+#include "CRT.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+void CRT_handleSIGSEGV(int sgn) {
+ (void) sgn;
+ CRT_done();
+ fprintf(stderr, "\n\nhtop " VERSION " aborting.\n");
+ fprintf(stderr, "\nUnfortunately, you seem to be using an unsupported platform!");
+ fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n");
+ abort();
+}
+
diff --git a/openbsd/OpenBSDCRT.h b/openbsd/OpenBSDCRT.h
new file mode 100644
index 0000000..c48309a
--- /dev/null
+++ b/openbsd/OpenBSDCRT.h
@@ -0,0 +1,16 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_OpenBSDCRT
+#define HEADER_OpenBSDCRT
+/*
+htop - UnsupportedCRT.h
+(C) 2014 Hisham H. Muhammad
+(C) 2015 Michael McConville
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+void CRT_handleSIGSEGV(int sgn);
+
+
+#endif
diff --git a/openbsd/OpenBSDProcess.c b/openbsd/OpenBSDProcess.c
new file mode 100644
index 0000000..71c84e8
--- /dev/null
+++ b/openbsd/OpenBSDProcess.c
@@ -0,0 +1,234 @@
+/*
+htop - OpenBSDProcess.c
+(C) 2015 Hisham H. Muhammad
+(C) 2015 Michael McConville
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Process.h"
+#include "ProcessList.h"
+#include "OpenBSDProcess.h"
+#include "Platform.h"
+#include "CRT.h"
+
+#include <stdlib.h>
+#include <unistd.h>
+#include <sys/syscall.h>
+
+/*{
+
+typedef enum OpenBSDProcessFields {
+ // Add platform-specific fields here, with ids >= 100
+ LAST_PROCESSFIELD = 100,
+} OpenBSDProcessField;
+
+typedef struct OpenBSDProcess_ {
+ Process super;
+} OpenBSDProcess;
+
+#ifndef Process_isKernelThread
+#define Process_isKernelThread(_process) (_process->pgrp == 0)
+#endif
+
+#ifndef Process_isUserlandThread
+#define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
+#endif
+
+}*/
+
+ProcessClass OpenBSDProcess_class = {
+ .super = {
+ .extends = Class(Process),
+ .display = Process_display,
+ .delete = Process_delete,
+ .compare = OpenBSDProcess_compare
+ },
+ .writeField = (Process_WriteField) OpenBSDProcess_writeField,
+};
+
+ProcessFieldData Process_fields[] = {
+ [0] = {
+ .name = "",
+ .title = NULL,
+ .description = NULL,
+ .flags = 0, },
+ [PID] = {
+ .name = "PID",
+ .title = " PID ",
+ .description = "Process/thread ID",
+ .flags = 0, },
+ [COMM] = {
+ .name = "Command",
+ .title = "Command ",
+ .description = "Command line",
+ .flags = 0, },
+ [STATE] = {
+ .name = "STATE",
+ .title = "S ",
+ .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging)",
+ .flags = 0, },
+ [PPID] = {
+ .name = "PPID",
+ .title = " PPID ",
+ .description = "Parent process ID",
+ .flags = 0, },
+ [PGRP] = {
+ .name = "PGRP",
+ .title = " PGRP ",
+ .description = "Process group ID",
+ .flags = 0, },
+ [SESSION] = {
+ .name = "SESSION",
+ .title = " SESN ",
+ .description = "Process's session ID",
+ .flags = 0, },
+ [TTY_NR] = {
+ .name = "TTY_NR",
+ .title = " TTY ",
+ .description = "Controlling terminal",
+ .flags = 0, },
+ [TPGID] = {
+ .name = "TPGID",
+ .title = " TPGID ",
+ .description = "Process ID of the fg process group of the controlling terminal",
+ .flags = 0, },
+ [MINFLT] = {
+ .name = "MINFLT",
+ .title = " MINFLT ",
+ .description = "Number of minor faults which have not required loading a memory page from disk",
+ .flags = 0, },
+ [MAJFLT] = {
+ .name = "MAJFLT",
+ .title = " MAJFLT ",
+ .description = "Number of major faults which have required loading a memory page from disk",
+ .flags = 0, },
+ [PRIORITY] = {
+ .name = "PRIORITY",
+ .title = "PRI ",
+ .description = "Kernel's internal priority for the process",
+ .flags = 0, },
+ [NICE] = {
+ .name = "NICE",
+ .title = " NI ",
+ .description = "Nice value (the higher the value, the more it lets other processes take priority)",
+ .flags = 0, },
+ [STARTTIME] = {
+ .name = "STARTTIME",
+ .title = "START ",
+ .description = "Time the process was started",
+ .flags = 0, },
+ [PROCESSOR] = {
+ .name = "PROCESSOR",
+ .title = "CPU ",
+ .description = "Id of the CPU the process last executed on",
+ .flags = 0, },
+ [M_SIZE] = {
+ .name = "M_SIZE",
+ .title = " VIRT ",
+ .description = "Total program size in virtual memory",
+ .flags = 0, },
+ [M_RESIDENT] = {
+ .name = "M_RESIDENT",
+ .title = " RES ",
+ .description = "Resident set size, size of the text and data sections, plus stack usage",
+ .flags = 0, },
+ [ST_UID] = {
+ .name = "ST_UID",
+ .title = " UID ",
+ .description = "User ID of the process owner",
+ .flags = 0, },
+ [PERCENT_CPU] = {
+ .name = "PERCENT_CPU",
+ .title = "CPU% ",
+ .description = "Percentage of the CPU time the process used in the last sampling",
+ .flags = 0, },
+ [PERCENT_MEM] = {
+ .name = "PERCENT_MEM",
+ .title = "MEM% ",
+ .description = "Percentage of the memory the process is using, based on resident memory size",
+ .flags = 0, },
+ [USER] = {
+ .name = "USER",
+ .title = "USER ",
+ .description = "Username of the process owner (or user ID if name cannot be determined)",
+ .flags = 0, },
+ [TIME] = {
+ .name = "TIME",
+ .title = " TIME+ ",
+ .description = "Total time the process has spent in user and system time",
+ .flags = 0, },
+ [NLWP] = {
+ .name = "NLWP",
+ .title = "NLWP ",
+ .description = "Number of threads in the process",
+ .flags = 0, },
+ [TGID] = {
+ .name = "TGID",
+ .title = " TGID ",
+ .description = "Thread group ID (i.e. process ID)",
+ .flags = 0, },
+ [LAST_PROCESSFIELD] = {
+ .name = "*** report bug! ***",
+ .title = NULL,
+ .description = NULL,
+ .flags = 0, },
+};
+
+ProcessPidColumn Process_pidColumns[] = {
+ { .id = PID, .label = "PID" },
+ { .id = PPID, .label = "PPID" },
+ { .id = TPGID, .label = "TPGID" },
+ { .id = TGID, .label = "TGID" },
+ { .id = PGRP, .label = "PGRP" },
+ { .id = SESSION, .label = "SESN" },
+ { .id = 0, .label = NULL },
+};
+
+OpenBSDProcess* OpenBSDProcess_new(Settings* settings) {
+ OpenBSDProcess* this = xCalloc(sizeof(OpenBSDProcess), 1);
+ Object_setClass(this, Class(OpenBSDProcess));
+ Process_init(&this->super, settings);
+ return this;
+}
+
+void Process_delete(Object* cast) {
+ OpenBSDProcess* this = (OpenBSDProcess*) cast;
+ Process_done((Process*)cast);
+ free(this);
+}
+
+void OpenBSDProcess_writeField(Process* this, RichString* str, ProcessField field) {
+ //OpenBSDProcess* fp = (OpenBSDProcess*) this;
+ char buffer[256]; buffer[255] = '\0';
+ int attr = CRT_colors[DEFAULT_COLOR];
+ //int n = sizeof(buffer) - 1;
+ switch (field) {
+ // add OpenBSD-specific fields here
+ default:
+ Process_writeField(this, str, field);
+ return;
+ }
+ RichString_append(str, attr, buffer);
+}
+
+long OpenBSDProcess_compare(const void* v1, const void* v2) {
+ OpenBSDProcess *p1, *p2;
+ Settings *settings = ((Process*)v1)->settings;
+ if (settings->direction == 1) {
+ p1 = (OpenBSDProcess*)v1;
+ p2 = (OpenBSDProcess*)v2;
+ } else {
+ p2 = (OpenBSDProcess*)v1;
+ p1 = (OpenBSDProcess*)v2;
+ }
+ switch (settings->sortKey) {
+ // add OpenBSD-specific fields here
+ default:
+ return Process_compare(v1, v2);
+ }
+}
+
+bool Process_isThread(Process* this) {
+ return (Process_isKernelThread(this));
+}
diff --git a/openbsd/OpenBSDProcess.h b/openbsd/OpenBSDProcess.h
new file mode 100644
index 0000000..ba55e5e
--- /dev/null
+++ b/openbsd/OpenBSDProcess.h
@@ -0,0 +1,48 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_OpenBSDProcess
+#define HEADER_OpenBSDProcess
+/*
+htop - OpenBSDProcess.h
+(C) 2015 Hisham H. Muhammad
+(C) 2015 Michael McConville
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+
+typedef enum OpenBSDProcessFields {
+ // Add platform-specific fields here, with ids >= 100
+ LAST_PROCESSFIELD = 100,
+} OpenBSDProcessField;
+
+typedef struct OpenBSDProcess_ {
+ Process super;
+} OpenBSDProcess;
+
+#ifndef Process_isKernelThread
+#define Process_isKernelThread(_process) (_process->pgrp == 0)
+#endif
+
+#ifndef Process_isUserlandThread
+#define Process_isUserlandThread(_process) (_process->pid != _process->tgid)
+#endif
+
+
+extern ProcessClass OpenBSDProcess_class;
+
+extern ProcessFieldData Process_fields[];
+
+extern ProcessPidColumn Process_pidColumns[];
+
+OpenBSDProcess* OpenBSDProcess_new(Settings* settings);
+
+void Process_delete(Object* cast);
+
+void OpenBSDProcess_writeField(Process* this, RichString* str, ProcessField field);
+
+long OpenBSDProcess_compare(const void* v1, const void* v2);
+
+bool Process_isThread(Process* this);
+
+#endif
diff --git a/openbsd/OpenBSDProcessList.c b/openbsd/OpenBSDProcessList.c
new file mode 100644
index 0000000..97e40cb
--- /dev/null
+++ b/openbsd/OpenBSDProcessList.c
@@ -0,0 +1,266 @@
+/*
+htop - OpenBSDProcessList.c
+(C) 2014 Hisham H. Muhammad
+(C) 2015 Michael McConville
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "ProcessList.h"
+#include "OpenBSDProcessList.h"
+#include "OpenBSDProcess.h"
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <err.h>
+#include <errno.h>
+#include <sys/types.h>
+#include <sys/param.h>
+#include <sys/proc.h>
+#include <sys/sysctl.h>
+#include <sys/user.h>
+#include <fcntl.h>
+#include <string.h>
+#include <sys/resource.h>
+
+/*{
+
+#include <kvm.h>
+
+typedef struct CPUData_ {
+ unsigned long long int totalTime;
+ unsigned long long int totalPeriod;
+} CPUData;
+
+typedef struct OpenBSDProcessList_ {
+ ProcessList super;
+ kvm_t* kd;
+
+ CPUData* cpus;
+
+} OpenBSDProcessList;
+
+}*/
+
+#ifndef CLAMP
+#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
+#endif
+
+static int pageSizeKb;
+static long fscale;
+
+ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) {
+ int mib[] = { CTL_HW, HW_NCPU };
+ int fmib[] = { CTL_KERN, KERN_FSCALE };
+ int i, e;
+ OpenBSDProcessList* opl = xCalloc(1, sizeof(OpenBSDProcessList));
+ ProcessList* pl = (ProcessList*) opl;
+ size_t size = sizeof(pl->cpuCount);
+
+ ProcessList_init(pl, Class(OpenBSDProcess), usersTable, pidWhiteList, userId);
+ e = sysctl(mib, 2, &pl->cpuCount, &size, NULL, 0);
+ if (e == -1 || pl->cpuCount < 1) {
+ pl->cpuCount = 1;
+ }
+ opl->cpus = xRealloc(opl->cpus, pl->cpuCount * sizeof(CPUData));
+
+ size = sizeof(fscale);
+ if (sysctl(fmib, 2, &fscale, &size, NULL, 0) < 0)
+ err(1, "fscale sysctl call failed");
+
+ for (i = 0; i < pl->cpuCount; i++) {
+ opl->cpus[i].totalTime = 1;
+ opl->cpus[i].totalPeriod = 1;
+ }
+
+ pageSizeKb = PAGE_SIZE_KB;
+
+ // XXX: last arg should eventually be an errbuf
+ opl->kd = kvm_open(NULL, NULL, NULL, KVM_NO_FILES, NULL);
+ assert(opl->kd);
+
+ return pl;
+}
+
+void ProcessList_delete(ProcessList* this) {
+ const OpenBSDProcessList* opl = (OpenBSDProcessList*) this;
+ if (opl->kd) kvm_close(opl->kd);
+
+ free(opl->cpus);
+
+ ProcessList_done(this);
+ free(this);
+}
+
+static inline void OpenBSDProcessList_scanMemoryInfo(ProcessList* pl) {
+ static int uvmexp_mib[] = {CTL_VM, VM_UVMEXP};
+ struct uvmexp uvmexp;
+ size_t size = sizeof(uvmexp);
+
+ if (sysctl(uvmexp_mib, 2, &uvmexp, &size, NULL, 0) < 0) {
+ err(1, "uvmexp sysctl call failed");
+ }
+
+ //kb_pagesize = uvmexp.pagesize / 1024;
+ pl->usedMem = uvmexp.active * pageSizeKb;
+ pl->totalMem = uvmexp.npages * pageSizeKb;
+
+ /*
+ const OpenBSDProcessList* opl = (OpenBSDProcessList*) pl;
+
+ size_t len = sizeof(pl->totalMem);
+ sysctl(MIB_hw_physmem, 2, &(pl->totalMem), &len, NULL, 0);
+ pl->totalMem /= 1024;
+ sysctl(MIB_vm_stats_vm_v_wire_count, 4, &(pl->usedMem), &len, NULL, 0);
+ pl->usedMem *= pageSizeKb;
+ pl->freeMem = pl->totalMem - pl->usedMem;
+ sysctl(MIB_vm_stats_vm_v_cache_count, 4, &(pl->cachedMem), &len, NULL, 0);
+ pl->cachedMem *= pageSizeKb;
+
+ struct kvm_swap swap[16];
+ int nswap = kvm_getswapinfo(opl->kd, swap, sizeof(swap)/sizeof(swap[0]), 0);
+ pl->totalSwap = 0;
+ pl->usedSwap = 0;
+ for (int i = 0; i < nswap; i++) {
+ pl->totalSwap += swap[i].ksw_total;
+ pl->usedSwap += swap[i].ksw_used;
+ }
+ pl->totalSwap *= pageSizeKb;
+ pl->usedSwap *= pageSizeKb;
+
+ pl->sharedMem = 0; // currently unused
+ pl->buffersMem = 0; // not exposed to userspace
+ */
+}
+
+char *OpenBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kproc, int* basenameEnd) {
+ char *s, *buf, **arg;
+ size_t cpsz, len = 0, n;
+ int i;
+
+ /*
+ * We attempt to fall back to just the command name (argv[0]) if we
+ * fail to construct the full command at any point.
+ */
+ arg = kvm_getargv(kd, kproc, 500);
+ if (arg == NULL) {
+ if ((s = xStrdup(kproc->p_comm)) == NULL) {
+ err(1, NULL);
+ }
+ return s;
+ }
+ for (i = 0; arg[i] != NULL; i++) {
+ len += strlen(arg[i]) + 1;
+ }
+ if ((buf = s = xMalloc(len)) == NULL) {
+ if ((s = xStrdup(kproc->p_comm)) == NULL) {
+ err(1, NULL);
+ }
+ return s;
+ }
+ for (i = 0; arg[i] != NULL; i++) {
+ n = strlcpy(buf, arg[i], (s + len) - buf);
+ buf += n;
+ if (i == 0) {
+ *basenameEnd = n;
+ }
+ *buf = ' ';
+ buf++;
+ }
+ *(buf - 1) = '\0';
+ return s;
+}
+
+/*
+ * Taken from OpenBSD's ps(1).
+ */
+double getpcpu(const struct kinfo_proc *kp) {
+ if (fscale == 0)
+ return (0.0);
+
+#define fxtofl(fixpt) ((double)(fixpt) / fscale)
+
+ return (100.0 * fxtofl(kp->p_pctcpu));
+}
+
+void ProcessList_goThroughEntries(ProcessList* this) {
+ OpenBSDProcessList* opl = (OpenBSDProcessList*) this;
+ Settings* settings = this->settings;
+ bool hideKernelThreads = settings->hideKernelThreads;
+ bool hideUserlandThreads = settings->hideUserlandThreads;
+ struct kinfo_proc* kproc;
+ bool preExisting;
+ Process* proc;
+ OpenBSDProcess* fp;
+ int count = 0;
+ int i;
+
+ OpenBSDProcessList_scanMemoryInfo(this);
+
+ // use KERN_PROC_KTHREAD to also include kernel threads
+ struct kinfo_proc* kprocs = kvm_getprocs(opl->kd, KERN_PROC_ALL, 0, sizeof(struct kinfo_proc), &count);
+ //struct kinfo_proc* kprocs = getprocs(KERN_PROC_ALL, 0, &count);
+
+ for (i = 0; i < count; i++) {
+ kproc = &kprocs[i];
+
+ preExisting = false;
+ proc = ProcessList_getProcess(this, kproc->p_pid, &preExisting, (Process_New) OpenBSDProcess_new);
+ fp = (OpenBSDProcess*) proc;
+
+ proc->show = ! ((hideKernelThreads && Process_isKernelThread(proc))
+ || (hideUserlandThreads && Process_isUserlandThread(proc)));
+
+ if (!preExisting) {
+ proc->ppid = kproc->p_ppid;
+ proc->tpgid = kproc->p_tpgid;
+ proc->tgid = kproc->p_pid;
+ proc->session = kproc->p_sid;
+ proc->tty_nr = kproc->p_tdev;
+ proc->pgrp = kproc->p__pgid;
+ proc->st_uid = kproc->p_uid;
+ proc->starttime_ctime = kproc->p_ustart_sec;
+ proc->user = UsersTable_getRef(this->usersTable, proc->st_uid);
+ ProcessList_add((ProcessList*)this, proc);
+ proc->comm = OpenBSDProcessList_readProcessName(opl->kd, kproc, &proc->basenameOffset);
+ } else {
+ if (settings->updateProcessNames) {
+ free(proc->comm);
+ proc->comm = OpenBSDProcessList_readProcessName(opl->kd, kproc, &proc->basenameOffset);
+ }
+ }
+
+ proc->m_size = kproc->p_vm_dsize;
+ proc->m_resident = kproc->p_vm_rssize;
+ proc->percent_mem = (proc->m_resident * PAGE_SIZE_KB) / (double)(this->totalMem) * 100.0;
+ proc->percent_cpu = CLAMP(getpcpu(kproc), 0.0, this->cpuCount*100.0);
+ //proc->nlwp = kproc->p_numthreads;
+ //proc->time = kproc->p_rtime_sec + ((kproc->p_rtime_usec + 500000) / 10);
+ proc->nice = kproc->p_nice - 20;
+ proc->time = kproc->p_rtime_sec + ((kproc->p_rtime_usec + 500000) / 1000000);
+ proc->time *= 100;
+ proc->priority = kproc->p_priority - PZERO;
+
+ switch (kproc->p_stat) {
+ case SIDL: proc->state = 'I'; break;
+ case SRUN: proc->state = 'R'; break;
+ case SSLEEP: proc->state = 'S'; break;
+ case SSTOP: proc->state = 'T'; break;
+ case SZOMB: proc->state = 'Z'; break;
+ case SDEAD: proc->state = 'D'; break;
+ case SONPROC: proc->state = 'P'; break;
+ default: proc->state = '?';
+ }
+
+ if (Process_isKernelThread(proc)) {
+ this->kernelThreads++;
+ }
+
+ this->totalTasks++;
+ // SRUN ('R') means runnable, not running
+ if (proc->state == 'P') {
+ this->runningTasks++;
+ }
+ proc->updated = true;
+ }
+}
diff --git a/openbsd/OpenBSDProcessList.h b/openbsd/OpenBSDProcessList.h
new file mode 100644
index 0000000..192fb34
--- /dev/null
+++ b/openbsd/OpenBSDProcessList.h
@@ -0,0 +1,48 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_OpenBSDProcessList
+#define HEADER_OpenBSDProcessList
+/*
+htop - OpenBSDProcessList.h
+(C) 2014 Hisham H. Muhammad
+(C) 2015 Michael McConville
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+
+#include <kvm.h>
+
+typedef struct CPUData_ {
+ unsigned long long int totalTime;
+ unsigned long long int totalPeriod;
+} CPUData;
+
+typedef struct OpenBSDProcessList_ {
+ ProcessList super;
+ kvm_t* kd;
+
+ CPUData* cpus;
+
+} OpenBSDProcessList;
+
+
+#ifndef CLAMP
+#define CLAMP(x,low,high) (((x)>(high))?(high):(((x)<(low))?(low):(x)))
+#endif
+
+
+ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId);
+
+void ProcessList_delete(ProcessList* this);
+
+char *OpenBSDProcessList_readProcessName(kvm_t* kd, struct kinfo_proc* kproc, int* basenameEnd);
+
+/*
+ * Taken from OpenBSD's ps(1).
+ */
+double getpcpu(const struct kinfo_proc *kp);
+
+void ProcessList_goThroughEntries(ProcessList* this);
+
+#endif
diff --git a/openbsd/Platform.c b/openbsd/Platform.c
new file mode 100644
index 0000000..251a713
--- /dev/null
+++ b/openbsd/Platform.c
@@ -0,0 +1,302 @@
+/*
+htop - openbsd/Platform.c
+(C) 2014 Hisham H. Muhammad
+(C) 2015 Michael McConville
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Platform.h"
+#include "Meter.h"
+#include "CPUMeter.h"
+#include "MemoryMeter.h"
+#include "SwapMeter.h"
+#include "TasksMeter.h"
+#include "LoadAverageMeter.h"
+#include "UptimeMeter.h"
+#include "ClockMeter.h"
+#include "HostnameMeter.h"
+#include "SignalsPanel.h"
+#include "OpenBSDProcess.h"
+#include "OpenBSDProcessList.h"
+
+#include <sys/sched.h>
+#include <uvm/uvmexp.h>
+#include <sys/param.h>
+#include <sys/swap.h>
+
+#include <unistd.h>
+#include <stdlib.h>
+#include <stdint.h>
+#include <string.h>
+#include <sys/types.h>
+#include <sys/sysctl.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+#include <time.h>
+
+/*{
+#include "Action.h"
+#include "BatteryMeter.h"
+#include "SignalsPanel.h"
+
+extern ProcessFieldData Process_fields[];
+
+}*/
+
+#define MAXCPU 256
+// XXX: probably should be a struct member
+static int64_t old_v[MAXCPU][5];
+
+/*
+ * Copyright (c) 1984, 1989, William LeFebvre, Rice University
+ * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University
+ *
+ * Taken directly from OpenBSD's top(1).
+ *
+ * percentages(cnt, out, new, old, diffs) - calculate percentage change
+ * between array "old" and "new", putting the percentages in "out".
+ * "cnt" is size of each array and "diffs" is used for scratch space.
+ * The array "old" is updated on each call.
+ * The routine assumes modulo arithmetic. This function is especially
+ * useful on BSD machines for calculating cpu state percentages.
+ */
+static int percentages(int cnt, int64_t *out, int64_t *new, int64_t *old, int64_t *diffs) {
+ int64_t change, total_change, *dp, half_total;
+ int i;
+
+ /* initialization */
+ total_change = 0;
+ dp = diffs;
+
+ /* calculate changes for each state and the overall change */
+ for (i = 0; i < cnt; i++) {
+ if ((change = *new - *old) < 0) {
+ /* this only happens when the counter wraps */
+ change = INT64_MAX - *old + *new;
+ }
+ total_change += (*dp++ = change);
+ *old++ = *new++;
+ }
+
+ /* avoid divide by zero potential */
+ if (total_change == 0)
+ total_change = 1;
+
+ /* calculate percentages based on overall change, rounding up */
+ half_total = total_change / 2l;
+ for (i = 0; i < cnt; i++)
+ *out++ = ((*diffs++ * 1000 + half_total) / total_change);
+
+ /* return the total in case the caller wants to use it */
+ return (total_change);
+}
+
+ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 };
+
+int Platform_numberOfFields = LAST_PROCESSFIELD;
+
+/*
+ * See /usr/include/sys/signal.h
+ */
+SignalItem Platform_signals[] = {
+ { .name = " 0 Cancel", .number = 0 },
+ { .name = " 1 SIGHUP", .number = 1 },
+ { .name = " 2 SIGINT", .number = 2 },
+ { .name = " 3 SIGQUIT", .number = 3 },
+ { .name = " 4 SIGILL", .number = 4 },
+ { .name = " 5 SIGTRAP", .number = 5 },
+ { .name = " 6 SIGABRT", .number = 6 },
+ { .name = " 6 SIGIOT", .number = 6 },
+ { .name = " 7 SIGEMT", .number = 7 },
+ { .name = " 8 SIGFPE", .number = 8 },
+ { .name = " 9 SIGKILL", .number = 9 },
+ { .name = "10 SIGBUS", .number = 10 },
+ { .name = "11 SIGSEGV", .number = 11 },
+ { .name = "12 SIGSYS", .number = 12 },
+ { .name = "13 SIGPIPE", .number = 13 },
+ { .name = "14 SIGALRM", .number = 14 },
+ { .name = "15 SIGTERM", .number = 15 },
+ { .name = "16 SIGURG", .number = 16 },
+ { .name = "17 SIGSTOP", .number = 17 },
+ { .name = "18 SIGTSTP", .number = 18 },
+ { .name = "19 SIGCONT", .number = 19 },
+ { .name = "20 SIGCHLD", .number = 20 },
+ { .name = "21 SIGTTIN", .number = 21 },
+ { .name = "22 SIGTTOU", .number = 22 },
+ { .name = "23 SIGIO", .number = 23 },
+ { .name = "24 SIGXCPU", .number = 24 },
+ { .name = "25 SIGXFSZ", .number = 25 },
+ { .name = "26 SIGVTALRM", .number = 26 },
+ { .name = "27 SIGPROF", .number = 27 },
+ { .name = "28 SIGWINCH", .number = 28 },
+ { .name = "29 SIGINFO", .number = 29 },
+ { .name = "30 SIGUSR1", .number = 30 },
+ { .name = "31 SIGUSR2", .number = 31 },
+ { .name = "32 SIGTHR", .number = 32 },
+};
+
+unsigned int Platform_numberOfSignals = sizeof(Platform_signals)/sizeof(SignalItem);
+
+void Platform_setBindings(Htop_Action* keys) {
+ (void) keys;
+}
+
+MeterClass* Platform_meterTypes[] = {
+ &CPUMeter_class,
+ &ClockMeter_class,
+ &LoadAverageMeter_class,
+ &LoadMeter_class,
+ &MemoryMeter_class,
+ &SwapMeter_class,
+ &TasksMeter_class,
+ &UptimeMeter_class,
+ &BatteryMeter_class,
+ &HostnameMeter_class,
+ &AllCPUsMeter_class,
+ &AllCPUs2Meter_class,
+ &LeftCPUsMeter_class,
+ &RightCPUsMeter_class,
+ &LeftCPUs2Meter_class,
+ &RightCPUs2Meter_class,
+ &BlankMeter_class,
+ NULL
+};
+
+// preserved from FreeBSD port
+int Platform_getUptime() {
+ struct timeval bootTime, currTime;
+ int mib[2] = { CTL_KERN, KERN_BOOTTIME };
+ size_t size = sizeof(bootTime);
+
+ int err = sysctl(mib, 2, &bootTime, &size, NULL, 0);
+ if (err) {
+ return -1;
+ }
+ gettimeofday(&currTime, NULL);
+
+ return (int) difftime(currTime.tv_sec, bootTime.tv_sec);
+}
+
+void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
+ struct loadavg loadAverage;
+ int mib[2] = { CTL_VM, VM_LOADAVG };
+ size_t size = sizeof(loadAverage);
+
+ int err = sysctl(mib, 2, &loadAverage, &size, NULL, 0);
+ if (err) {
+ *one = 0;
+ *five = 0;
+ *fifteen = 0;
+ return;
+ }
+ *one = (double) loadAverage.ldavg[0] / loadAverage.fscale;
+ *five = (double) loadAverage.ldavg[1] / loadAverage.fscale;
+ *fifteen = (double) loadAverage.ldavg[2] / loadAverage.fscale;
+}
+
+int Platform_getMaxPid() {
+ // this is hard-coded in sys/sys/proc.h - no sysctl exists
+ return 32766;
+}
+
+double Platform_setCPUValues(Meter* this, int cpu) {
+ int i;
+ double perc;
+
+ OpenBSDProcessList* pl = (OpenBSDProcessList*) this->pl;
+ CPUData* cpuData = &(pl->cpus[cpu]);
+ int64_t new_v[CPUSTATES], diff_v[CPUSTATES], scratch_v[CPUSTATES];
+ double *v = this->values;
+ size_t size = sizeof(double) * CPUSTATES;
+ int mib[] = { CTL_KERN, KERN_CPTIME2, cpu-1 };
+ if (sysctl(mib, 3, new_v, &size, NULL, 0) == -1) {
+ return 0.;
+ }
+
+ // XXX: why?
+ cpuData->totalPeriod = 1;
+
+ percentages(CPUSTATES, diff_v, new_v,
+ (int64_t *)old_v[cpu-1], scratch_v);
+
+ for (i = 0; i < CPUSTATES; i++) {
+ old_v[cpu-1][i] = new_v[i];
+ v[i] = diff_v[i] / 10.;
+ }
+
+ Meter_setItems(this, 4);
+
+ perc = v[0] + v[1] + v[2] + v[3];
+
+ if (perc <= 100. && perc >= 0.) {
+ return perc;
+ } else {
+ return 0.;
+ }
+}
+
+void Platform_setMemoryValues(Meter* this) {
+ ProcessList* pl = (ProcessList*) this->pl;
+ long int usedMem = pl->usedMem;
+ long int buffersMem = pl->buffersMem;
+ long int cachedMem = pl->cachedMem;
+ usedMem -= buffersMem + cachedMem;
+ this->total = pl->totalMem;
+ this->values[0] = usedMem;
+ this->values[1] = buffersMem;
+ this->values[2] = cachedMem;
+}
+
+/*
+ * Copyright (c) 1994 Thorsten Lockert <tholo@sigmasoft.com>
+ * All rights reserved.
+ *
+ * Taken almost directly from OpenBSD's top(1)
+ */
+void Platform_setSwapValues(Meter* this) {
+ ProcessList* pl = (ProcessList*) this->pl;
+ struct swapent *swdev;
+ unsigned long long int total, used;
+ int nswap, rnswap, i;
+ nswap = swapctl(SWAP_NSWAP, 0, 0);
+ if (nswap == 0) {
+ return;
+ }
+
+ swdev = xCalloc(nswap, sizeof(*swdev));
+ if (swdev == NULL) {
+ return;
+ }
+
+ rnswap = swapctl(SWAP_STATS, swdev, nswap);
+ if (rnswap == -1) {
+ free(swdev);
+ return;
+ }
+
+ // if rnswap != nswap, then what?
+
+ /* Total things up */
+ total = used = 0;
+ for (i = 0; i < nswap; i++) {
+ if (swdev[i].se_flags & SWF_ENABLE) {
+ used += (swdev[i].se_inuse / (1024 / DEV_BSIZE));
+ total += (swdev[i].se_nblks / (1024 / DEV_BSIZE));
+ }
+ }
+
+ this->total = pl->totalSwap = total;
+ this->values[0] = pl->usedSwap = used;
+
+ free(swdev);
+}
+
+void Platform_setTasksValues(Meter* this) {
+ // TODO
+}
+
+char* Platform_getProcessEnv(pid_t pid) {
+ // TODO
+ return NULL;
+}
diff --git a/openbsd/Platform.h b/openbsd/Platform.h
new file mode 100644
index 0000000..6665093
--- /dev/null
+++ b/openbsd/Platform.h
@@ -0,0 +1,73 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_Platform
+#define HEADER_Platform
+/*
+htop - openbsd/Platform.h
+(C) 2014 Hisham H. Muhammad
+(C) 2015 Michael McConville
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Action.h"
+#include "BatteryMeter.h"
+#include "SignalsPanel.h"
+
+extern ProcessFieldData Process_fields[];
+
+
+#define MAXCPU 256
+// XXX: probably should be a struct member
+/*
+ * Copyright (c) 1984, 1989, William LeFebvre, Rice University
+ * Copyright (c) 1989, 1990, 1992, William LeFebvre, Northwestern University
+ *
+ * Taken directly from OpenBSD's top(1).
+ *
+ * percentages(cnt, out, new, old, diffs) - calculate percentage change
+ * between array "old" and "new", putting the percentages in "out".
+ * "cnt" is size of each array and "diffs" is used for scratch space.
+ * The array "old" is updated on each call.
+ * The routine assumes modulo arithmetic. This function is especially
+ * useful on BSD machines for calculating cpu state percentages.
+ */
+extern ProcessField Platform_defaultFields[];
+
+extern int Platform_numberOfFields;
+
+/*
+ * See /usr/include/sys/signal.h
+ */
+extern SignalItem Platform_signals[];
+
+extern unsigned int Platform_numberOfSignals;
+
+void Platform_setBindings(Htop_Action* keys);
+
+extern MeterClass* Platform_meterTypes[];
+
+// preserved from FreeBSD port
+int Platform_getUptime();
+
+void Platform_getLoadAverage(double* one, double* five, double* fifteen);
+
+int Platform_getMaxPid();
+
+double Platform_setCPUValues(Meter* this, int cpu);
+
+void Platform_setMemoryValues(Meter* this);
+
+/*
+ * Copyright (c) 1994 Thorsten Lockert <tholo@sigmasoft.com>
+ * All rights reserved.
+ *
+ * Taken almost directly from OpenBSD's top(1)
+ */
+void Platform_setSwapValues(Meter* this);
+
+void Platform_setTasksValues(Meter* this);
+
+char* Platform_getProcessEnv(pid_t pid);
+
+#endif
diff --git a/scripts/MakeHeader.py b/scripts/MakeHeader.py
index c0fdc85..bcf1005 100755
--- a/scripts/MakeHeader.py
+++ b/scripts/MakeHeader.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/bin/env python
import os, sys, string
@@ -56,6 +56,8 @@ for line in file.readlines():
state = SKIP
elif equals != -1:
out.write("extern " + line[:equals] + ";" )
+ elif line.startswith("typedef struct"):
+ state = SKIP
elif line[-1] == "{":
out.write( line[:-2].replace("inline", "extern") + ";" )
state = SKIP
diff --git a/unsupported/Battery.c b/unsupported/Battery.c
new file mode 100644
index 0000000..6d6e94b
--- /dev/null
+++ b/unsupported/Battery.c
@@ -0,0 +1,8 @@
+
+#include "BatteryMeter.h"
+
+void Battery_getData(double* level, ACPresence* isOnAC) {
+ *level = -1;
+ *isOnAC = AC_ERROR;
+}
+
diff --git a/unsupported/Battery.h b/unsupported/Battery.h
new file mode 100644
index 0000000..8dc0cef
--- /dev/null
+++ b/unsupported/Battery.h
@@ -0,0 +1,9 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_Battery
+#define HEADER_Battery
+
+void Battery_getData(double* level, ACPresence* isOnAC);
+
+
+#endif
diff --git a/unsupported/Platform.c b/unsupported/Platform.c
new file mode 100644
index 0000000..0f1ba97
--- /dev/null
+++ b/unsupported/Platform.c
@@ -0,0 +1,136 @@
+/*
+htop - unsupported/Platform.c
+(C) 2014 Hisham H. Muhammad
+(C) 2015 David C. Hunt
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Platform.h"
+#include "CPUMeter.h"
+#include "MemoryMeter.h"
+#include "SwapMeter.h"
+#include "TasksMeter.h"
+#include "LoadAverageMeter.h"
+#include "ClockMeter.h"
+#include "HostnameMeter.h"
+#include "UptimeMeter.h"
+
+/*{
+#include "Action.h"
+#include "BatteryMeter.h"
+#include "UnsupportedProcess.h"
+}*/
+
+ProcessField Platform_defaultFields[] = { PID, USER, PRIORITY, NICE, M_SIZE, M_RESIDENT, STATE, PERCENT_CPU, PERCENT_MEM, TIME, COMM, 0 };
+
+ProcessFieldData Process_fields[] = {
+ [0] = { .name = "", .title = NULL, .description = NULL, .flags = 0, },
+ [PID] = { .name = "PID", .title = " PID ", .description = "Process/thread ID", .flags = 0, },
+ [COMM] = { .name = "Command", .title = "Command ", .description = "Command line", .flags = 0, },
+ [STATE] = { .name = "STATE", .title = "S ", .description = "Process state (S sleeping, R running, D disk, Z zombie, T traced, W paging)", .flags = 0, },
+ [PPID] = { .name = "PPID", .title = " PPID ", .description = "Parent process ID", .flags = 0, },
+ [PGRP] = { .name = "PGRP", .title = " PGRP ", .description = "Process group ID", .flags = 0, },
+ [SESSION] = { .name = "SESSION", .title = " SESN ", .description = "Process's session ID", .flags = 0, },
+ [TTY_NR] = { .name = "TTY_NR", .title = " TTY ", .description = "Controlling terminal", .flags = 0, },
+ [TPGID] = { .name = "TPGID", .title = " TPGID ", .description = "Process ID of the fg process group of the controlling terminal", .flags = 0, },
+ [MINFLT] = { .name = "MINFLT", .title = " MINFLT ", .description = "Number of minor faults which have not required loading a memory page from disk", .flags = 0, },
+ [MAJFLT] = { .name = "MAJFLT", .title = " MAJFLT ", .description = "Number of major faults which have required loading a memory page from disk", .flags = 0, },
+ [PRIORITY] = { .name = "PRIORITY", .title = "PRI ", .description = "Kernel's internal priority for the process", .flags = 0, },
+ [NICE] = { .name = "NICE", .title = " NI ", .description = "Nice value (the higher the value, the more it lets other processes take priority)", .flags = 0, },
+ [STARTTIME] = { .name = "STARTTIME", .title = "START ", .description = "Time the process was started", .flags = 0, },
+
+ [PROCESSOR] = { .name = "PROCESSOR", .title = "CPU ", .description = "Id of the CPU the process last executed on", .flags = 0, },
+ [M_SIZE] = { .name = "M_SIZE", .title = " VIRT ", .description = "Total program size in virtual memory", .flags = 0, },
+ [M_RESIDENT] = { .name = "M_RESIDENT", .title = " RES ", .description = "Resident set size, size of the text and data sections, plus stack usage", .flags = 0, },
+ [ST_UID] = { .name = "ST_UID", .title = " UID ", .description = "User ID of the process owner", .flags = 0, },
+ [PERCENT_CPU] = { .name = "PERCENT_CPU", .title = "CPU% ", .description = "Percentage of the CPU time the process used in the last sampling", .flags = 0, },
+ [PERCENT_MEM] = { .name = "PERCENT_MEM", .title = "MEM% ", .description = "Percentage of the memory the process is using, based on resident memory size", .flags = 0, },
+ [USER] = { .name = "USER", .title = "USER ", .description = "Username of the process owner (or user ID if name cannot be determined)", .flags = 0, },
+ [TIME] = { .name = "TIME", .title = " TIME+ ", .description = "Total time the process has spent in user and system time", .flags = 0, },
+ [NLWP] = { .name = "NLWP", .title = "NLWP ", .description = "Number of threads in the process", .flags = 0, },
+ [TGID] = { .name = "TGID", .title = " TGID ", .description = "Thread group ID (i.e. process ID)", .flags = 0, },
+ [100] = { .name = "*** report bug! ***", .title = NULL, .description = NULL, .flags = 0, },
+};
+
+MeterClass* Platform_meterTypes[] = {
+ &CPUMeter_class,
+ &ClockMeter_class,
+ &LoadAverageMeter_class,
+ &LoadMeter_class,
+ &MemoryMeter_class,
+ &SwapMeter_class,
+ &TasksMeter_class,
+ &BatteryMeter_class,
+ &HostnameMeter_class,
+ &UptimeMeter_class,
+ &AllCPUsMeter_class,
+ &AllCPUs2Meter_class,
+ &LeftCPUsMeter_class,
+ &RightCPUsMeter_class,
+ &LeftCPUs2Meter_class,
+ &RightCPUs2Meter_class,
+ &BlankMeter_class,
+ NULL
+};
+
+void Platform_setBindings(Htop_Action* keys) {
+ (void) keys;
+}
+
+int Platform_numberOfFields = 100;
+char* Process_pidFormat = "%7u ";
+
+int Platform_getUptime() {
+ return 0;
+}
+
+void Platform_getLoadAverage(double* one, double* five, double* fifteen) {
+ *one = 0;
+ *five = 0;
+ *fifteen = 0;
+}
+
+int Platform_getMaxPid() {
+ return 1;
+}
+
+void Process_setupColumnWidths() {
+ int maxPid = Platform_getMaxPid();
+ if (maxPid == -1) return;
+ if (maxPid > 99999) {
+ Process_fields[PID].title = " PID ";
+ Process_fields[PPID].title = " PPID ";
+ Process_fields[TPGID].title = " TPGID ";
+ Process_fields[TGID].title = " TGID ";
+ Process_fields[PGRP].title = " PGRP ";
+ Process_fields[SESSION].title = " SESN ";
+ Process_pidFormat = "%7u ";
+ } else {
+ Process_fields[PID].title = " PID ";
+ Process_fields[PPID].title = " PPID ";
+ Process_fields[TPGID].title = "TPGID ";
+ Process_fields[TGID].title = " TGID ";
+ Process_fields[PGRP].title = " PGRP ";
+ Process_fields[SESSION].title = " SESN ";
+ Process_pidFormat = "%5u ";
+ }
+}
+
+double Platform_setCPUValues(Meter* this, int cpu) {
+ return 0.0;
+}
+
+void Platform_setMemoryValues(Meter* this) {
+}
+
+void Platform_setSwapValues(Meter* this) {
+}
+
+bool Process_isThread(Process* this) {
+ return false;
+}
+
+char* Platform_getProcessEnv(pid_t pid) {
+ return NULL;
+}
diff --git a/unsupported/Platform.h b/unsupported/Platform.h
new file mode 100644
index 0000000..ec1649d
--- /dev/null
+++ b/unsupported/Platform.h
@@ -0,0 +1,46 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_Platform
+#define HEADER_Platform
+/*
+htop - unsupported/Platform.h
+(C) 2014 Hisham H. Muhammad
+(C) 2015 David C. Hunt
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Action.h"
+#include "BatteryMeter.h"
+#include "UnsupportedProcess.h"
+
+extern ProcessField Platform_defaultFields[];
+
+extern ProcessFieldData Process_fields[];
+
+extern MeterClass* Platform_meterTypes[];
+
+void Platform_setBindings(Htop_Action* keys);
+
+extern int Platform_numberOfFields;
+extern char* Process_pidFormat;
+
+int Platform_getUptime();
+
+void Platform_getLoadAverage(double* one, double* five, double* fifteen);
+
+int Platform_getMaxPid();
+
+void Process_setupColumnWidths();
+
+double Platform_setCPUValues(Meter* this, int cpu);
+
+void Platform_setMemoryValues(Meter* this);
+
+void Platform_setSwapValues(Meter* this);
+
+bool Process_isThread(Process* this);
+
+char* Platform_getProcessEnv(pid_t pid);
+
+#endif
diff --git a/unsupported/UnsupportedCRT.c b/unsupported/UnsupportedCRT.c
new file mode 100644
index 0000000..5c3a9de
--- /dev/null
+++ b/unsupported/UnsupportedCRT.c
@@ -0,0 +1,21 @@
+/*
+htop - UnsupportedCRT.c
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "config.h"
+#include "CRT.h"
+#include <stdio.h>
+#include <stdlib.h>
+
+void CRT_handleSIGSEGV(int sgn) {
+ (void) sgn;
+ CRT_done();
+ fprintf(stderr, "\n\nhtop " VERSION " aborting.\n");
+ fprintf(stderr, "\nUnfortunately, you seem to be using an unsupported platform!");
+ fprintf(stderr, "\nPlease contact your platform package maintainer!\n\n");
+ abort();
+}
+
diff --git a/unsupported/UnsupportedCRT.h b/unsupported/UnsupportedCRT.h
new file mode 100644
index 0000000..3c808ca
--- /dev/null
+++ b/unsupported/UnsupportedCRT.h
@@ -0,0 +1,15 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_UnsupportedCRT
+#define HEADER_UnsupportedCRT
+/*
+htop - UnsupportedCRT.h
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+void CRT_handleSIGSEGV(int sgn);
+
+
+#endif
diff --git a/unsupported/UnsupportedProcess.c b/unsupported/UnsupportedProcess.c
new file mode 100644
index 0000000..ec1de78
--- /dev/null
+++ b/unsupported/UnsupportedProcess.c
@@ -0,0 +1,33 @@
+/*
+htop - UnsupportedProcess.c
+(C) 2015 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Process.h"
+#include "UnsupportedProcess.h"
+#include <stdlib.h>
+
+/*{
+#include "Settings.h"
+
+#define Process_delete UnsupportedProcess_delete
+
+}*/
+
+Process* UnsupportedProcess_new(Settings* settings) {
+ Process* this = xCalloc(1, sizeof(Process));
+ Object_setClass(this, Class(Process));
+ Process_init(this, settings);
+ return this;
+}
+
+void UnsupportedProcess_delete(Object* cast) {
+ Process* this = (Process*) cast;
+ Object_setClass(this, Class(Process));
+ Process_done((Process*)cast);
+ // free platform-specific fields here
+ free(this);
+}
+
diff --git a/unsupported/UnsupportedProcess.h b/unsupported/UnsupportedProcess.h
new file mode 100644
index 0000000..4ca3043
--- /dev/null
+++ b/unsupported/UnsupportedProcess.h
@@ -0,0 +1,22 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_UnsupportedProcess
+#define HEADER_UnsupportedProcess
+/*
+htop - UnsupportedProcess.h
+(C) 2015 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "Settings.h"
+
+#define Process_delete UnsupportedProcess_delete
+
+
+Process* UnsupportedProcess_new(Settings* settings);
+
+void UnsupportedProcess_delete(Object* cast);
+
+
+#endif
diff --git a/unsupported/UnsupportedProcessList.c b/unsupported/UnsupportedProcessList.c
new file mode 100644
index 0000000..b63f267
--- /dev/null
+++ b/unsupported/UnsupportedProcessList.c
@@ -0,0 +1,75 @@
+/*
+htop - UnsupportedProcessList.c
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+#include "ProcessList.h"
+#include "UnsupportedProcess.h"
+
+#include <stdlib.h>
+#include <string.h>
+
+/*{
+
+}*/
+
+ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId) {
+ ProcessList* this = xCalloc(1, sizeof(ProcessList));
+ ProcessList_init(this, Class(Process), usersTable, pidWhiteList, userId);
+
+ return this;
+}
+
+void ProcessList_delete(ProcessList* this) {
+ ProcessList_done(this);
+ free(this);
+}
+
+void ProcessList_goThroughEntries(ProcessList* super) {
+ bool preExisting = true;
+ Process *proc;
+
+ proc = ProcessList_getProcess(super, 1, &preExisting, UnsupportedProcess_new);
+
+ /* Empty values */
+ proc->time = proc->time + 10;
+ proc->pid = 1;
+ proc->ppid = 1;
+ proc->tgid = 0;
+ proc->comm = "<unsupported architecture>";
+ proc->basenameOffset = 0;
+ proc->updated = true;
+
+ proc->state = 'R';
+ proc->show = true; /* Reflected in proc->settings-> "hideXXX" really */
+ proc->pgrp = 0;
+ proc->session = 0;
+ proc->tty_nr = 0;
+ proc->tpgid = 0;
+ proc->st_uid = 0;
+ proc->flags = 0;
+ proc->processor = 0;
+
+ proc->percent_cpu = 2.5;
+ proc->percent_mem = 2.5;
+ proc->user = "nobody";
+
+ proc->priority = 0;
+ proc->nice = 0;
+ proc->nlwp = 1;
+ strncpy(proc->starttime_show, "Jun 01 ", sizeof(proc->starttime_show));
+ proc->starttime_ctime = 1433116800; // Jun 01, 2015
+
+ proc->m_size = 100;
+ proc->m_resident = 100;
+
+ proc->minflt = 20;
+ proc->majflt = 20;
+}
+
+void UnsupportedProcessList_scan(ProcessList* this) {
+ (void) this;
+ // stub!
+}
diff --git a/unsupported/UnsupportedProcessList.h b/unsupported/UnsupportedProcessList.h
new file mode 100644
index 0000000..58ba3d4
--- /dev/null
+++ b/unsupported/UnsupportedProcessList.h
@@ -0,0 +1,22 @@
+/* Do not edit this file. It was automatically generated. */
+
+#ifndef HEADER_UnsupportedProcessList
+#define HEADER_UnsupportedProcessList
+/*
+htop - UnsupportedProcessList.h
+(C) 2014 Hisham H. Muhammad
+Released under the GNU GPL, see the COPYING file
+in the source distribution for its full text.
+*/
+
+
+
+ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, uid_t userId);
+
+void ProcessList_delete(ProcessList* this);
+
+void ProcessList_goThroughEntries(ProcessList* super);
+
+void UnsupportedProcessList_scan(ProcessList* this);
+
+#endif

© 2014-2024 Faster IT GmbH | imprint | privacy policy