0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

MSYS2でscreenのビルド&インストール

0
Posted at

MSYS2環境にはscreenのパッケージは用意されていないので自分でビルドしてインストールしないと使えない。分かってしまえばさほど大変じゃない。

前提

  • MSYS2がインストールされている
  • gccコマンドが利用できる (pacman -S gccで入るはず)
  • makeコマンドが利用できる (pacman -S makeで入るはず)

筆者の環境にはWindows用の別のmakeコマンドが入っていて、それが原因でmakeが失敗した。なんかおかしいと思ったらShellから正しいコマンドが実行されているか確認すると良いと思う。

必要ライブラリのインストール

筆者の環境だと以下のライブラリをインストールする必要があった。

$ pacman -S ncurses-devel
$ pacman -S libcrypt-devel

ソースの取得と展開

$ wget https://ftp.gnu.org/gnu/screen/screen-4.7.0.tar.gz
$ tar xzvf screen-4.7.0.tar.gz
$ cd screen-4.7.0

ソースの修正

http://proglab.blog.fc2.com/blog-entry-35.html とかにも書いてあるが、フォルダのパーミッションチェックのコードがMSYS2環境だとうまく動かないのでその部分をコメントアウトする。screen.cファイルを以下のように修正。(多分バージョンによって行数は変わるので同じ部分を探す)

screen.c
  1109         n = (eff_uid == 0 && (real_uid || (st.st_mode & 0775) != 0775)) ? 0755 :
  1110             (eff_gid == (int)st.st_gid && eff_gid != real_gid) ? 0775 : 0777;
  1111         /* コメントアウト
  1112         if (((int)st.st_mode & 0777) != n)
  1113           Panic(0, "Directory '%s' must have mode %03o.", SockDir, n);
  1114           */
  1115       }
  1116       sprintf(SockPath, "%s/S-%s", SockDir, LoginName);
...

  1147   }
  1148
  1149   /* コメントアウト
  1150   if ((st.st_mode & 0777) != 0700)
  1151     Panic(0, "Directory %s must have mode 700.", SockPath);
  1152     */
  1153   if (SockMatch && index(SockMatch, '/'))
  1154     Panic(0, "Bad session name '%s'", SockMatch);

configure & make & make install

$ ./configure --enable-colors256
$ make
$ make install

起動

$ screen

で起動すればOK

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?