CentOS7でインストールできないため、ソールからインストール。
# tar xzfv w3m-0.5.3.tar.gz # cd w3m-0.5.3 # yum install ncurses* # ./configure --with-termlib=ncurses --disable-mouse # make
ここでエラー
gcc -I. -I. -g -O2 -I./libwc -I/usr/local/openssl/include/openssl -I/usr/local/openssl/include -DHAVE_CONFIG_H -DAUXBIN_DIR=\"/usr/local/libexec/w3m\" -DCGIBIN_DIR=\"/usr/local/libexec/w3m/cgi-bin\" -DHELP_DIR=\"/usr/local/share/w3m\" -DETC_DIR=\"/usr/local/etc\" -DCONF_DIR=\"/usr/local/etc/w3m\" -DRC_DIR=\"~/.w3m\" -DLOCALEDIR=\"/usr/local/share/locale\" -c -o main.o main.c In file included from html.h:10:0, from fm.h:39, from main.c:3: istream.h:23:8: error: redefinition of 'struct file_handle' struct file_handle { ^ In file included from /usr/include/bits/fcntl.h:61:0, from /usr/include/fcntl.h:35, from istream.h:14, from html.h:10, from fm.h:39, from main.c:3: /usr/include/bits/fcntl-linux.h:300:8: note: originally defined here struct file_handle ^ main.c: In function 'main': main.c:836:23: error: void value not ignored as it ought to be orig_GC_warn_proc = GC_set_warn_proc(wrap_GC_warn_proc); ^ main.c: In function 'getChar': main.c:2264:5: warning: passing argument 1 of 'wtf_parse1' from incompatible pointer type [enabled by default] return wc_any_to_ucs(wtf_parse1(&p)); ^ In file included from fm.h:44:0, from main.c:3: ./libwc/wtf.h:71:19: note: expected 'wc_uchar **' but argument is of type 'char **' extern wc_wchar_t wtf_parse1(wc_uchar **p); ^ gmake: *** [main.o] Error 1
調べた結果以下を参照し、パッチをDL
https://build.opensuse.org/package/view_file?file=w3m-fh-def.patch&package=w3m&project=network&rev=02bc48adba1f62318d8c93eacb2aaab6
--- istream.c.orig +++ istream.c @@ -22,8 +22,8 @@ static void basic_close(int *handle); static int basic_read(int *handle, char *buf, int len); -static void file_close(struct file_handle *handle); -static int file_read(struct file_handle *handle, char *buf, int len); +static void file_close(struct w3m_file_handle *handle); +static int file_read(struct w3m_file_handle *handle, char *buf, int len); static int str_read(Str handle, char *buf, int len); @@ -114,7 +114,7 @@ newFileStream(FILE * f, void (*closep) ( stream = New(union input_stream); init_base_stream(&stream->base, STREAM_BUF_SIZE); stream->file.type = IST_FILE; - stream->file.handle = New(struct file_handle); + stream->file.handle = New(struct w3m_file_handle); stream->file.handle->f = f; if (closep) stream->file.handle->close = closep; @@ -658,13 +658,13 @@ basic_read(int *handle, char *buf, int l } static void -file_close(struct file_handle *handle) +file_close(struct w3m_file_handle *handle) { handle->close(handle->f); } static int -file_read(struct file_handle *handle, char *buf, int len) +file_read(struct w3m_file_handle *handle, char *buf, int len) { return fread(buf, 1, len, handle->f); } --- istream.h.orig +++ istream.h @@ -20,7 +20,7 @@ struct stream_buffer { typedef struct stream_buffer *StreamBuffer; -struct file_handle { +struct w3m_file_handle { FILE *f; void (*close) (); }; @@ -53,7 +53,7 @@ struct base_stream { struct file_stream { struct stream_buffer stream; - struct file_handle *handle; + struct w3m_file_handle *handle; char type; char iseos; int (*read) ();
https://lists.freebsd.org/pipermail/freebsd-ports-bugs/2013-October/264429.html
--- main.c.orig 2011-01-04 10:42:19.000000000 +0100 +++ main.c 2013-10-21 13:43:11.000000000 +0200 @@ -833,7 +833,8 @@ mySignal(SIGPIPE, SigPipe); #endif - orig_GC_warn_proc = GC_set_warn_proc(wrap_GC_warn_proc); + orig_GC_warn_proc = GC_get_warn_proc(); + GC_set_warn_proc(wrap_GC_warn_proc); err_msg = Strnew(); if (load_argc == 0) { /* no URL specified */
https://lists.freebsd.org/pipermail/svn-ports-head/2013-October/032845.html
※不要かも
--- www/w3m/files/patch-main.c (revision 0) +++ www/w3m/files/patch-main.c (working copy) @@ -0,0 +1,15 @@ +--- main.c ++++ main.c +@@ -833,7 +833,12 @@ main(int argc, char **argv, char **envp) + mySignal(SIGPIPE, SigPipe); + #endif + ++#if GC_VERSION_MAJOR >= 7 && GC_VERSION_MINOR >= 2 ++ orig_GC_warn_proc = GC_get_warn_proc(); ++ GC_set_warn_proc(wrap_GC_warn_proc); ++#else + orig_GC_warn_proc = GC_set_warn_proc(wrap_GC_warn_proc); ++#endif + err_msg = Strnew(); + if (load_argc == 0) { + /* no URL specified */