debian下如何源码安装tmux

一.源码安装ncurses库

  1.1 获取源码

    wget https://invisible-island.net/datafiles/release/ncurses.tar.gz

    tar xvf ncurses.tar.gz ~/

    cd ~/ncurses-6.1

  1.2 进行配置(安装到家目录的ncurses目录下)

    ./configure --prefix=/home/jello/ncurses  

  1.3 编译

    make -j4

  1.4 安装

    make install

    libtool --finish ~/ncurses/lib

二.源码安装libevent库

  2.1 获取源码

    git clone https://github.com/libevent/libevent.git ~/libevent

    cd ~/libevent

  2.2 生成配置

    ./autogen.sh

  2.3 进行配置(安装到家目录的libevent目录下,--disable-samples不编译样例程序)

    ./configure --prefix=/home/jello/libevent  --disable-samples 

  2.4 编译 

    make -j4

  2.5 安装

    make install

    libtool --finish ~/libevent/lib

三.源码安装tmux

  3.1 获取源码

    git clone https://github.com/tmux/tmux.git ~/tmux

    cd ~/tmux

  3.2 生成配置

    ./autogen.sh

  3.3 进行配置(安装到家目录的tmux目录下)

    ./configure --prefix=/home/jello/tmux CFLAGS="-I/usr/local/include -I/home/jello/libevent/include -I/home/jello/ncurses/include" LDFLAGS="-L/usr/local/lib -L/home/jello/libevent/lib -L/home/jello/ncurses/lib"

  3.4 编译

    make -j4

  3.5 安装

    make install

  3.6 指定共享库的搜索路径

    export LD_LIBRARY_PATH=/home/jello/libevent/lib:/home/jello/ncurses/lib:$LD_LIBRARY_PATH

    

原文地址:https://www.cnblogs.com/dakewei/p/10682724.html