スポンサード リンク
cygwinにはどうやらWakeOnLanのためのクライアントが無いようだ。そこで, wol コマンドをコンパイルして使えるようにする。なお,環境は以下のとおり。
$ uname -a
CYGWIN_NT-6.3 User-PC 1.7.34(0.285/5/3) 2015-02-04 12:14 x86_64 Cygwin
まず, wol | SourceForge.net からソースコードをダウンロードしてくる。で,configureするのだが,そのままでは
~/wol-0.7.1 $ ./configure
checking build system type... ./config.guess: unable to guess system type
This script, last modified 2004-01-05, has failed to recognize
the operating system you are using. It is advised that you
download the most up to date version of the config scripts from
ftp://ftp.gnu.org/pub/gnu/config/
If the version you run (./config.guess) is already up to date, please
send the following data and any information you think might be
pertinent to <config-patches@gnu.org> in order to provide the needed
information to handle your system.
config.guess timestamp = 2004-01-05
uname -m = x86_64
uname -r = 1.7.34(0.285/5/3)
uname -s = CYGWIN_NT-6.3
uname -v = 2015-02-04 12:14
/usr/bin/uname -p = unknown
/bin/uname -X =
hostinfo =
/bin/universe =
/usr/bin/arch -k =
/bin/arch = x86_64
/usr/bin/oslevel =
/usr/convex/getsysinfo =
UNAME_MACHINE = x86_64
UNAME_RELEASE = 1.7.34(0.285/5/3)
UNAME_SYSTEM = CYGWIN_NT-6.3
UNAME_VERSION = 2015-02-04 12:14
configure: error: cannot guess build type; you must specify one
Error : ./conifigure
となり,アーキテクチャを判定できないようだ。そこで --build オプションで明示的に64bitのCygwinだと教えてあげることにする。
~/wol-0.7.1 $ ./configure --build=x86_64-unknown-cygwin
これで configure は通るようになったが,今度は make でエラーがでた。
~/wol-0.7.1 $ make
~~~~ 上略 ~~~~
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -I../include -g -O2 -W -Wall -Wpointer-arith -Wimplicit-function-declaration -MT realloc.o -MD -MP -MF ".deps/realloc.Tpo" \
-c -o realloc.o `test -f 'realloc.c' || echo './'`realloc.c; \
then mv -f ".deps/realloc.Tpo" ".deps/realloc.Po"; \
else rm -f ".deps/realloc.Tpo"; exit 1; \
fi
realloc.c:27:7: 警告: 組み込み関数 ‘malloc’ と型が競合しています
char *malloc ();
^
realloc.c:28:7: 警告: 組み込み関数 ‘realloc’ と型が競合しています
char *realloc ();
^
if gcc -DHAVE_CONFIG_H -I. -I. -I.. -I../intl -I../include -g -O2 -W -Wall -Wpointer-arith -Wimplicit-function-declaration -MT getpass4.o -MD -MP -MF ".deps/getpass4.Tpo" \
-c -o getpass4.o `test -f 'getpass4.c' || echo './'`getpass4.c; \
then mv -f ".deps/getpass4.Tpo" ".deps/getpass4.Po"; \
else rm -f ".deps/getpass4.Tpo"; exit 1; \
fi
In file included from getpass4.c:7:0:
getline.h:32:1: エラー: ‘getline’ と型が競合しています
getline PARAMS ((char **_lineptr, size_t *_n, FILE *_stream));
^
In file included from /usr/include/stdio.h:29:0,
from getpass4.c:3:
/usr/include/sys/stdio.h:37:9: 備考: 前の ‘getline’ の宣言はここです
ssize_t _EXFUN(getline, (char **, size_t *, FILE *));
^
In file included from getpass4.c:7:0:
getline.h:35:1: エラー: ‘getdelim’ と型が競合しています
getdelim PARAMS ((char **_lineptr, size_t *_n, int _delimiter, FILE *_stream));
^
In file included from /usr/include/stdio.h:29:0,
from getpass4.c:3:
/usr/include/sys/stdio.h:38:9: 備考: 前の ‘getdelim’ の宣言はここです
ssize_t _EXFUN(getdelim, (char **, size_t *, int, FILE *));
^
Makefile:240: ターゲット 'getpass4.o' のレシピで失敗しました
make[2]: *** [getpass4.o] エラー 1
make[2]: ディレクトリ '/home/tm/wol-0.7.1/lib' から出ます
Makefile:230: ターゲット 'all-recursive' のレシピで失敗しました
make[1]: *** [all-recursive] エラー 1
make[1]: ディレクトリ '/home/tm/wol-0.7.1' から出ます
Makefile:183: ターゲット 'all' のレシピで失敗しました
make: *** [all] エラー 2
ERROR : make
どうやら stdio.h の内容と競合しているようだ。システム標準のファイルに手を加えるのは心が引けるが, /usr/include/sys/stdio.h の該当する2行をコメントアウトする。
// ssize_t _EXFUN(getline, (char **, size_t *, FILE *));
// ssize_t _EXFUN(getdelim, (char **, size_t *, int, FILE *));
あとはすんなりと make が通る。
~/wol-0.7.1 $ make
~/wol-0.7.1 $ make install
なお,今回のようにソースから make するときは stow を使って管理すると楽。 stow は paco のようなものだがpacoのように開発が混乱していないし,cygwinのsetup.exeでインストールできる点で優れている。 stow の使い方については別記事 stowでソースからmakeしたプログラムを管理する | 電脳手帳 に書いた。
Comments !