Thanks! I have successfully compiled tmux on my AIX 7.1 machine :). Here's a run down of what needs to be done:
- Download latest tmux source code from github:
git clone https://github.com/tmux/tmux.git
git is available from the AIX Toolbox. The best way to install is to set up yum. I can help if you get into trouble here.
- Download the dependency libevent:
wget https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz
- Patch libevent code using the following diff (using patch command or by hand):
diff libevent/libevent-2.1.11-stable/include/event2/event-config.h.original libevent/libevent-2.1.11-stable/include/event2/event-config.h
524c524
< #define _LARGE_FILES 1
---
> //#define _LARGE_FILES 1
- Compile libevent:
./configure CFLAGS="-g0" CXXFLAGS="-g0" --prefix=/home/users/software
make
make install
Note that my version of AIX has an issue with the as assembler which requires the CFLAGS="-g0" CXXFLAGS="-g0"
flags. If your OS is fully up to date at the latest TL then it should not be necessary (please test first without the flags, and if it works I'd appreciate a post with the oslevel -s
output).
- Install (using yum) the following tmux dependencies: automake, pkg-config, bison (for yacc). Then add
/usr/linux/bin
to PATH
. To test your path run
which yacc
- Patch tmux code using the following diffs:
diff --git a/tmux.h b/tmux.h
index 41a09351..df5ba6cc 100644
--- a/tmux.h
+++ b/tmux.h
@@ -2666,4 +2666,9 @@ struct window_pane *spawn_pane(struct spawn_context *, char **);
/* regsub.c */
char *regsub(const char *, const char *, const char *, int);
+/* define missing symbols */
+#define FNM_CASEFOLD 0x10 /* Case insensitive search. */
+#define REG_STARTEND (1 << 2)
+#define _PATH_DEFPATH "/usr/bin:/etc:/usr/sbin:/usr/ucb:$HOME/bin:/usr/bin/X11:/sbin:/usr/linux/bin"
+
#endif /* TMUX_H */
diff --git a/tty.c b/tty.c
index 1658fb74..2068c459 100644
--- a/tty.c
+++ b/tty.c
@@ -744,11 +744,11 @@ tty_window_offset1(struct tty *tty, u_int *ox, u_int *oy, u_int *sx, u_int *sy)
struct client *c = tty->client;
struct window *w = c->session->curw->window;
struct window_pane *wp = w->active;
- u_int cx, cy, lines;
+ u_int cx, cy, newlines;
- lines = status_line_size(c);
+ newlines = status_line_size(c);
- if (tty->sx >= w->sx && tty->sy - lines >= w->sy) {
+ if (tty->sx >= w->sx && tty->sy - newlines >= w->sy) {
*ox = 0;
*oy = 0;
*sx = w->sx;
@@ -759,7 +759,7 @@ tty_window_offset1(struct tty *tty, u_int *ox, u_int *oy, u_int *sx, u_int *sy)
}
*sx = tty->sx;
- *sy = tty->sy - lines;
+ *sy = tty->sy - newlines;
if (c->pan_window == w) {
if (*sx >= w->sx)
@@ -910,18 +910,18 @@ static int
tty_is_visible(struct tty *tty, const struct tty_ctx *ctx, u_int px, u_int py,
u_int nx, u_int ny)
{
- u_int xoff = ctx->xoff + px, yoff = ctx->yoff + py, lines;
+ u_int xoff = ctx->xoff + px, yoff = ctx->yoff + py, newlines;
if (!ctx->bigger)
return (1);
if (status_at_line(tty->client) == 0)
- lines = status_line_size(tty->client);
+ newlines = status_line_size(tty->client);
else
- lines = 0;
+ newlines = 0;
if (xoff + nx <= ctx->ox || xoff >= ctx->ox + ctx->sx ||
- yoff + ny <= ctx->oy || yoff >= lines + ctx->oy + ctx->sy)
+ yoff + ny <= ctx->oy || yoff >= newlines + ctx->oy + ctx->sy)
return (0);
return (1);
}
In the above we are simple renaming the variable lines to newlines to avoid a conflict.
- Build tmux:
./configure CFLAGS="-g0" CXXFLAGS="-g0" --prefix=/home/users/software LDFLAGS=-L/home/users/software/lib CPPFLAGS=-I/home/users/software/include/
make
make install
Once again, please test first without the CFLAGS="-g0" CXXFLAGS="-g0"
flags.
- tmux requires the UTF-8 locale. You can install it from the AIX install DVD 1 using:
installp -acgYd /cdmnt bos.loc.utf.EN_US
Assuming you have mounted the DVD on /cdmnt. Next set the locale in your shell:
export LANG=EN_US.UTF-8
export LC_ALL=EN_US.UTF-8
Check using the locale
command.
The install is now complete. Please read the next post for information about how to use 256 colours.