りぬざうスケッチ

tcsh

最終更新:

zauhack

- view
管理者のみ編集可

tcsh のコンパイル


tcsh はここ:

まず最初に libncurses.so が $(CROSSDIR)/arm-linux/lib にあることを確認する。
無い場合 (何もしてなければ無いのが普通) にはインストールしておく (See ライブラリのコピー)。

ここでは tcsh-6.13.00 をインストールする。
現時点での最新版は 6.15.00 だが、私の環境 (FreeBSD / kterm) では 6.14.00 以降でマルチバイト文字が正しく処理されないようなので、あえて古いバージョンを使っている。
(環境の問題か tcsh の問題かは確認していない)。
もしかしたら Zaurus では最新版でもうまく動くかも?

tcsh はクロスコンパイルすることを想定していないようで、make の途中でコケる。
ターゲット用の gethost を作成し、それをホスト側で動かそうとしているのが原因。
gethost はコンパイルの途中で使われるだけなので、まずそれをコンパイルしておく。
gethost さえできればいいので configure のオプションは適当で良い。

tar xvzf $(SRCDIR)/tcsh-6.13.00.tar.gz
mv tcsh-6.13.00 tcsh-6.13.00-host
cd tcsh-6.13.00-host
./configure
make gethost
cd ..

ここからが本番。
arm-linux 用の情報がない (6.15.00 にもない) ので、追加する (host.defs.diff)。
環境変数 (HOSTTYPE, MACHTYPE) だけの問題なので、気にしないのであればそのままでも OK (パッチを当てないと、共に "unknown" になる)。

setenv PATH $(CROSSDIR)/arm-linux/bin:$PATH
tar xvzf $(SRCDIR)/tcsh-6.13.00.tar.gz
cd tcsh-6.13.00
patch < $(SRCDIR)/host.defs.diff
env LDFLAGS=-static-libgcc LIBS=-lncurses ./configure --prefix=/opt/QtPalmtop --host=arm-linux

ここで、お好みで config_f.h ファイルをいじる。
私は config_f.h.diff のようにしている。
そして、ようやく make。

vi config_f.h
make

上にも書いたように、途中で、

./gethost ./host.defs >> tc.defs.c
./gethost: 1: Syntax error: word unexpected (expecting ")")
*** Error code 2

のような感じでコケるので、

../tcsh-6.13.00-host/gethost ./host.defs >> tc.defs.c
make
strip tcsh

とする。


--- host.defs,orig	Sat Sep 29 11:47:08 2007
+++ host.defs	Sat Sep 29 12:27:29 2007
@@ -456,6 +456,8 @@
 machtype: defined(M_mipseb)				: "mipseb"
 machtype: defined(M_mips64el)				: "mips64el"
 machtype: defined(M_mips64eb)				: "mips64eb"
+hosttype: defined(arm) || defined(__arm__)		: "arm"
+machtype: defined(arm) || defined(__arm__)		: "arm"
 enddef	:
 
 

--- config_f.h,orig	Sun Sep 30 19:33:53 2007
+++ config_f.h	Sun Sep 30 19:34:34 2007
@@ -61,7 +61,7 @@
  *		if you don't have <nl_types.h>, you don't want
  *		to define this.
  */
-#undef NLS_CATALOGS
+#define NLS_CATALOGS
 
 /*
  * LOGINFIRST   Source ~/.login before ~/.cshrc
@@ -93,7 +93,7 @@
 /*
  * NODOT	Don't put "." in the default path, for security reasons
  */
-#undef NODOT
+#define NODOT
 
 /*
  * AUTOLOGOUT	tries to determine if it should set autologout depending
@@ -150,7 +150,7 @@
  *		POSIX says to use stat, but stat(2) is less accurate
  *		than access(2) for determining file access.
  */
-#undef USE_ACCESS
+#define USE_ACCESS
 
 /*
  * REMOTEHOST	Try to determine the remote host that we logged in from
@@ -164,7 +164,7 @@
  * COLOR_LS_F Do you want to use builtin color ls-F ?
  *
  */
-#define COLOR_LS_F
+#undef COLOR_LS_F
 
 /*
  * COLORCAT Do you want to colorful message ?



記事メニュー
ウィキ募集バナー