Sponsored Content
Full Discussion: Tmux on AIX
Operating Systems AIX Tmux on AIX Post 303038626 by topcat on Sunday 8th of September 2019 06:03:45 PM
Old 09-08-2019
Thanks! I have successfully compiled tmux on my AIX 7.1 machine Smilie. Here's a run down of what needs to be done:

1. Download latest tmux source code from github:
Code:
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.

2. Download the dependency libevent:
Code:
wget https://github.com/libevent/libevent/releases/download/release-2.1.11-stable/libevent-2.1.11-stable.tar.gz

3. Patch libevent code using the following diff (using patch command or by hand):
Code:
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

4. Compile libevent:
Code:
./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).

6. 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
Code:
which yacc

5. Patch tmux code using the following diffs:
Code:
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 */

Code:
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.

6. Build tmux:
Code:
./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.


7. tmux requires the UTF-8 locale. You can install it from the AIX install DVD 1 using:
Code:
installp -acgYd /cdmnt bos.loc.utf.EN_US

Assuming you have mounted the DVD on /cdmnt. Next set the locale in your shell:
Code:
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.
These 2 Users Gave Thanks to topcat For This Post:
 

4 More Discussions You Might Find Interesting

1. AIX

Nim on AIX 7.1 used to migrate AIX 5.3 to AIX 6.1...is possible?

Using nimadm: nimadm -j nimadmvg -c sap024 -s spot_6100 -l lpp_6100 -d "hdisk1" -Y Initializing the NIM master. Initializing NIM client sap024. 0505-205 nimadm: The level of bos.alt_disk_install.rte installed in SPOT spot_6100 (6.1.3.4) does not match the NIM master's level (7.1.1.2).... (2 Replies)
Discussion started by: sciacca75
2 Replies

2. AIX

Will it affect my AIX LPAR security, when i set up email alerts on AIX server.

Hello, I've set up email alerts on AIX Servers. so that i can get email notifications (via mail relay server) when ever there is abnormal behavior. for example 1) my script monitors CPU/disk/memory etc... when it reaches high water ark, it will send an email alert. 2) disk usage alerts 3)... (5 Replies)
Discussion started by: System Admin 77
5 Replies

3. UNIX for Beginners Questions & Answers

Tmux - pane current command - help !

Hello Experts ! i have started using tmux recent past . So far so good . while exploring the option , i found an option as I log into terminal where i enabled the tmux , and then i log onto a taxi server and then to my application server. My expectation is when i going aound the paths on... (1 Reply)
Discussion started by: radha254
1 Replies

4. UNIX for Beginners Questions & Answers

Installing tmux on RHEL 6.5

Hi, I am trying to install tmux on vm allocated to me in my company . i am very new to linux. I have the root access on it. Can someone please provide the exact steps to get it installed. I tried: 1. Using yum, i get the below message. # yum install tmux Loaded plugins: security... (6 Replies)
Discussion started by: kunwar
6 Replies
All times are GMT -4. The time now is 11:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy