w3m

Unnamed repository; edit this file to name it for gitweb.
git clone https://logand.com/git/w3m.git/
Log | Files | Refs | README

commit 64ac77236e2cd75cbf5153c112c968b6f8286de5
parent f1007ffe1e6be4539686c2d01f9b47ce74263729
Author: ukai <ukai>
Date:   Sat,  9 Nov 2002 21:55:24 +0000

[w3m-dev 03398] auxbindir
* XMakefile: EXT_TARGETS -> LIB_TARGETS, AUXBIN_TARGETS
* config.h.dist: add AUXBIN_DIR
		LIB_DIR is cgi-bin
* configure: add -auxbindir
		add AUXBIN_DIR
		LIB_DIR is cgi-bin
		EXT_TARGETS -> LIB_TARGETS, AUXBIN_TARGETS
* file.c (compression_decoder): libfile_p -> auxbin_p
	(check_command): libfile_p -> auxbin_p
			use w3m_auxbin_dir() instead of w3m_lib_dir()
	(acceptableEncoding): libfile_p -> auxbin_p
	(xface2xpm): use auxbinFile() instead of libFile()
	(uncompress_stream): libfile_p -> auxbin_p
			use auxbinFile() instead of libFile()
* image.c (getCharSize): use w3m_auxbin_dir() instead of w3m_lib_dir()
	(openImgdisplay): use w3m_auxbin_dir() instead of w3m_lib_dir()
* indep.c (w3m_auxbin_dir): added
* indep.h (w3m_auxbin_dir): added
* proto.h (auxbinFile): added
* rc.c (auxbinFile): added
	(libFile): #if 0, no longer used
	(helpFile): used only #ifndef USE_HELP_CGI
* NEWS: separate auxbindir and libdir (local-CGI, file:///$LIB/)
From: Fumitoshi UKAI  <ukai@debian.or.jp>

Diffstat:
MChangeLog | 27+++++++++++++++++++++++++++
MNEWS | 2++
MXMakefile | 24+++++++++++++++++-------
Mconfig.h.dist | 9++++++---
Mconfigure | 34+++++++++++++++++++++++++++++-----
Mfile.c | 16++++++++--------
Mimage.c | 4++--
Mindep.c | 6++++++
Mindep.h | 1+
Mproto.h | 1+
Mrc.c | 14++++++++++++++
11 files changed, 113 insertions(+), 25 deletions(-)

diff --git a/ChangeLog b/ChangeLog @@ -1,3 +1,30 @@ +2002-11-10 Fumitoshi UKAI <ukai@debian.or.jp> + + * [w3m-dev 03398] auxbindir + * XMakefile: EXT_TARGETS -> LIB_TARGETS, AUXBIN_TARGETS + * config.h.dist: add AUXBIN_DIR + LIB_DIR is cgi-bin + * configure: add -auxbindir + add AUXBIN_DIR + LIB_DIR is cgi-bin + EXT_TARGETS -> LIB_TARGETS, AUXBIN_TARGETS + * file.c (compression_decoder): libfile_p -> auxbin_p + (check_command): libfile_p -> auxbin_p + use w3m_auxbin_dir() instead of w3m_lib_dir() + (acceptableEncoding): libfile_p -> auxbin_p + (xface2xpm): use auxbinFile() instead of libFile() + (uncompress_stream): libfile_p -> auxbin_p + use auxbinFile() instead of libFile() + * image.c (getCharSize): use w3m_auxbin_dir() instead of w3m_lib_dir() + (openImgdisplay): use w3m_auxbin_dir() instead of w3m_lib_dir() + * indep.c (w3m_auxbin_dir): added + * indep.h (w3m_auxbin_dir): added + * proto.h (auxbinFile): added + * rc.c (auxbinFile): added + (libFile): #if 0, no longer used + (helpFile): used only #ifndef USE_HELP_CGI + * NEWS: separate auxbindir and libdir (local-CGI, file:///$LIB/) + 2002-11-09 Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp> * [w3m-dev 03396] Re: meta refresh problem diff --git a/NEWS b/NEWS @@ -1,5 +1,7 @@ w3m 0.3.3 or 0.4? +* separate auxbindir and libdir (local-CGI, file:///$LIB/) +* configure: -auxbindir * rc: disable_secret_security_check (for windows?) * tab browsing * rc: open_tab_blank, close_tab_back diff --git a/XMakefile b/XMakefile @@ -21,7 +21,7 @@ INFLATE=inflate$(EXT) IMGDISPLAY=w3mimgdisplay$(EXT) MAN1=doc/w3m.1 MAN1_JA=doc-jp/w3m.1 -TARGETS=$(TARGET) $(EXT_TARGETS) +TARGETS=$(TARGET) $(LIB_TARGETS) $(AUXBIN_TARGETS) HELP_ALLFILES=w3mhelp-w3m_en.html w3mhelp-w3m_ja.html \ w3mhelp-lynx_en.html w3mhelp-lynx_ja.html @@ -121,6 +121,7 @@ install: install-core install-scripts install-core: $(TARGETS) -$(MKDIR) $(DESTDIR)$(BIN_DIR) + -$(MKDIR) $(DESTDIR)$(AUXBIN_DIR) -$(MKDIR) $(DESTDIR)$(LIB_DIR) -$(MKDIR) $(DESTDIR)$(HELP_DIR) -$(MKDIR) $(DESTDIR)$(MAN1_DIR) @@ -129,13 +130,18 @@ install-core: $(TARGETS) $(INSTALL_DATA) $(HELP_FILE) $(DESTDIR)$(HELP_DIR)/w3mhelp.html $(INSTALL_DATA) $(MAN1) $(DESTDIR)$(MAN1_DIR)/$(TARGET).1 $(INSTALL_DATA) $(MAN1_JA) $(DESTDIR)$(MAN1_JA_DIR)/$(TARGET).1 - for file in $(EXT_TARGETS); \ + for file in $(AUXBIN_TARGETS); \ do \ case $$file in \ - $(IMGDISPLAY)) $(INSTALL_W3MIMGDISPLAY) $$file $(DESTDIR)$(LIB_DIR)/$$file;; \ - *) $(INSTALL_PROGRAM) $$file $(DESTDIR)$(LIB_DIR)/$$file;; \ + $(IMGDISPLAY)) $(INSTALL_W3MIMGDISPLAY) $$file $(DESTDIR)$(AUXBIN_DIR)/$$file;; \ + *) $(INSTALL_PROGRAM) $$file $(DESTDIR)$(AUXBIN_DIR)/$$file;; \ esac; \ done + for file in $(LIB_TARGETS); \ + do \ + $(INSTALL_PROGRAM) $$file $(DESTDIR)$(LIB_DIR)/$$file;; \ + done + install-helpfile: -$(MKDIR) $(DESTDIR)$(HELP_DIR) @@ -147,19 +153,23 @@ install-helpfile: all-scripts: for dir in $(SCRIPTSUBDIRS); \ do \ - (cd $$dir; $(MAKE) PERL='$(PERL)' BIN_DIR='$(BIN_DIR)' LIB_DIR='$(LIB_DIR)' HELP_DIR='$(HELP_DIR)' RC_DIR='$(RC_DIR)' KEYBIND_SRC='$(KEYBIND_SRC)'); \ + (cd $$dir; $(MAKE) PERL='$(PERL)' BIN_DIR='$(BIN_DIR)' AUXBIN_DIR='$(AUXBIN_DIR)' LIB_DIR='$(LIB_DIR)' HELP_DIR='$(HELP_DIR)' RC_DIR='$(RC_DIR)' KEYBIND_SRC='$(KEYBIND_SRC)'); \ done install-scripts: all-scripts topdir=`pwd`; \ for dir in $(SCRIPTSUBDIRS); \ do \ - (cd $$dir; $(MAKE) PERL='$(PERL)' MKDIR='$(MKDIR)' BIN_DIR='$(BIN_DIR)' LIB_DIR='$(LIB_DIR)' HELP_DIR='$(HELP_DIR)' MAN_DIR='$(MAN_DIR)' DESTDIR='$(DESTDIR)' INSTALL="sh $$topdir/install-sh" install); \ + (cd $$dir; $(MAKE) PERL='$(PERL)' MKDIR='$(MKDIR)' BIN_DIR='$(BIN_DIR)' AUXBIN_DIR='$(AUXBIN_DIR)' LIB_DIR='$(LIB_DIR)' HELP_DIR='$(HELP_DIR)' MAN_DIR='$(MAN_DIR)' DESTDIR='$(DESTDIR)' INSTALL="sh $$topdir/install-sh" install); \ done uninstall: -rm -f $(BIN_DIR)/$(TARGET) - -for file in $(EXT_TARGETS); \ + -for file in $(AUXBIN_TARGETS); \ + do \ + rm -f $(AUXBIN_DIR)/$$file; \ + done + -for file in $(LIB_TARGETS); \ do \ rm -f $(LIB_DIR)/$$file; \ done diff --git a/config.h.dist b/config.h.dist @@ -65,7 +65,8 @@ #ifdef makefile_parameter BIN_DIR = /usr/local/bin -LIB_DIR = /usr/local/lib/w3m +AUXBIN_DIR = /usr/local/lib/w3m +LIB_DIR = /usr/local/lib/w3m/cgi-bin HELP_DIR = /usr/local/share/w3m MAN_DIR = /usr/local/man MAN1_DIR = $(MAN_DIR)/man1 @@ -84,7 +85,8 @@ EXT= MATHLIB=-lm Z_CFLAGS=-I/usr/include ZLIB=-L/usr/lib -lz -EXT_TARGETS=$(BOOKMARKER) $(HELPER) $(INFLATE) +AUXBIN_TARGETS=$(INFLATE) +LIB_TARGETS=$(BOOKMARKER) $(HELPER) IMGCFLAGS= IMGLDFLAGS= IMGX11CFLAGS= @@ -150,7 +152,8 @@ INSTALL_W3MIMGDISPLAY=$(INSTALL_PROGRAM) /* for USE_MIGEMO */ #define DEF_MIGEMO_COMMAND "migemo -t egrep /usr/share/migemo/migemo-dict" -#define LIB_DIR "/usr/local/lib/w3m" +#define AUXBIN_DIR "/usr/local/lib/w3m" +#define LIB_DIR "/usr/local/lib/w3m/cgi-bin" #define HELP_DIR "/usr/local/lib/w3m" #define ETC_DIR "/usr/local/etc/w3m" #define HELP_FILE "w3mhelp.html" diff --git a/configure b/configure @@ -58,6 +58,9 @@ do -bindir=*|--bindir=*) bindir=`expr "$1" : "-*bindir=\(.*\)"` ;; + -auxbindir=*|--auxbindir=*) + auxbindir=`expr "$1" : "-*auxbindir=\(.*\)"` + ;; -libdir=*|--libdir=*) libdir=`expr "$1" : "-*libdir=\(.*\)"` ;; @@ -123,7 +126,8 @@ do echo "-yes, -nonstop Set all parameters to the default" echo "-prefix=DIR Specify prefix (default: /usr/local)" echo "-bindir=DIR user executable in DIR (default: PREFIX/bin)" - echo "-libdir=DIR program executables in DIR (default: PREFIX/lib/w3m)" + echo "-auxbindir=DIR support programs in DIR (default: PREFIX/lib/w3m)" + echo "-libdir=DIR local cgi in DIR (default: PREFIX/lib/w3m/cgi-bin)" echo "-helpdir=DIR help file in DIR (default: PREFIX/share/w3m)" echo "-mandir=DIR manual in DIR (default: PREFIX/man)" echo "-sysconfdir=DIR w3mconfig in DIR [PREFIX/etc/w3m]" @@ -577,18 +581,35 @@ readdir "$d_bindir" bindir=$_dir echo "bindir='$bindir'" >> config.param +d_auxbindir=$auxbindir +if [ -z "$d_auxbindir" ]; then + case "$sysname" in + *BSD) + d_auxbindir="$topdir/libexec/w3m" + ;; + *) + d_auxbindir="$topdir/lib/w3m" + ;; + esac +fi +echo "Which directory do you want to put the support binary files?" +Echo "(default: $d_auxbindir) " +readdir "$d_auxbindir" +auxbindir=$_dir +echo "auxbindir='$auxbindir'" >> config.param + d_libdir=$libdir if [ -z "$d_libdir" ]; then case "$sysname" in *BSD) - d_libdir="$topdir/libexec/w3m" + d_libdir="$topdir/libexec/w3m/cgi-bin" ;; *) - d_libdir="$topdir/lib/w3m" + d_libdir="$topdir/lib/w3m/cgi-bin" ;; esac fi -echo "Which directory do you want to put the support binary files?" +echo "Which directory do you want to use local cgi?" Echo "(default: $d_libdir) " readdir "$d_libdir" libdir=$_dir @@ -2292,6 +2313,7 @@ $def_matrix #ifdef makefile_parameter BIN_DIR = $bindir +AUXBIN_DIR = $auxbindir LIB_DIR = $libdir HELP_DIR = $helpdir MAN_DIR = $mandir @@ -2312,7 +2334,8 @@ EXT=$extension MATHLIB=$mathlib Z_CFLAGS=$z_cflags ZLIB=$zlib -EXT_TARGETS=\$(BOOKMARKER) \$(HELPER) $inflate $imgtarget +AUXBIN_TARGETS=$inflate $imgtarget +LIB_TARGETS=\$(BOOKMARKER) \$(HELPER) IMGCFLAGS=$imgx11cflags $imgfbcflags IMGLDFLAGS=$imgx11ldflags $imgfbldflags IMGX11CFLAGS=$imgx11cflags @@ -2380,6 +2403,7 @@ $def_use_xface /* for USE_MIGEMO */ #define DEF_MIGEMO_COMMAND "$def_migemo_command" +#define AUXBIN_DIR "$auxbindir" #define LIB_DIR "$libdir" #define HELP_DIR "$helpdir" #define ETC_DIR "$sysconfdir" diff --git a/file.c b/file.c @@ -163,7 +163,7 @@ static struct compression_decoder { int type; char *ext; char *mime_type; - int libfile_p; + int auxbin_p; char *cmd; char *name; char *encoding; @@ -372,7 +372,7 @@ examineFile(char *path, URLFile *uf) #define S_IXANY (S_IXUSR|S_IXGRP|S_IXOTH) int -check_command(char *cmd, int libfile_p) +check_command(char *cmd, int auxbin_p) { static char *path = NULL; Str dirs; @@ -382,8 +382,8 @@ check_command(char *cmd, int libfile_p) if (path == NULL) path = getenv("PATH"); - if (libfile_p) - dirs = Strnew_charp(w3m_lib_dir()); + if (auxbin_p) + dirs = Strnew_charp(w3m_auxbin_dir()); else dirs = Strnew_charp(path); for (p = dirs->ptr; p != NULL; p = np) { @@ -413,7 +413,7 @@ acceptableEncoding() return encodings->ptr; l = newTextList(); for (d = compression_decoders; d->type != CMP_NOCOMPRESS; d++) { - if (check_command(d->cmd, d->libfile_p)) { + if (check_command(d->cmd, d->auxbin_p)) { pushText(l, d->encoding); } } @@ -514,7 +514,7 @@ xface2xpm(char *xface) struct stat st; xpm = tmpfname(TMPF_DFL, ".xpm")->ptr; - f = popen(Sprintf("%s > %s", libFile(XFACE2XPM), xpm)->ptr, "w"); + f = popen(Sprintf("%s > %s", auxbinFile(XFACE2XPM), xpm)->ptr, "w"); if (!f) return NULL; fprintf(f, "%s", xface); @@ -7383,8 +7383,8 @@ uncompress_stream(URLFile *uf) } for (d = compression_decoders; d->type != CMP_NOCOMPRESS; d++) { if (uf->compression == d->type) { - if (d->libfile_p) - expand_cmd = libFile(d->cmd); + if (d->auxbin_p) + expand_cmd = auxbinFile(d->cmd); else expand_cmd = d->cmd; expand_name = d->name; diff --git a/image.c b/image.c @@ -57,7 +57,7 @@ getCharSize() tmp = Strnew(); if (!strchr(Imgdisplay, '/')) - Strcat_m_charp(tmp, w3m_lib_dir(), "/", NULL); + Strcat_m_charp(tmp, w3m_auxbin_dir(), "/", NULL); Strcat_m_charp(tmp, Imgdisplay, " -test 2> /dev/null", NULL); f = popen(tmp->ptr, "r"); if (!f) @@ -127,7 +127,7 @@ openImgdisplay() for (i = 3; i < FOPEN_MAX; i++) close(i); if (!strchr(Imgdisplay, '/')) - cmd = Strnew_m_charp(w3m_lib_dir(), "/", Imgdisplay, NULL)->ptr; + cmd = Strnew_m_charp(w3m_auxbin_dir(), "/", Imgdisplay, NULL)->ptr; else cmd = Imgdisplay; execl("/bin/sh", "sh", "-c", cmd, NULL); diff --git a/indep.c b/indep.c @@ -749,6 +749,12 @@ w3m_dir(const char *name, char *dft) } char * +w3m_auxbin_dir() +{ + return w3m_dir("W3M_AUXBIN_DIR", AUXBIN_DIR); +} + +char * w3m_lib_dir() { return w3m_dir("W3M_LIB_DIR", LIB_DIR); diff --git a/indep.h b/indep.h @@ -50,6 +50,7 @@ extern Str Str_form_quote(Str x); extern Str Str_form_unquote(Str x); extern char *shell_quote(char *str); +extern char *w3m_auxbin_dir(); extern char *w3m_lib_dir(); extern char *w3m_etc_dir(); extern char *w3m_help_dir(); diff --git a/proto.h b/proto.h @@ -528,6 +528,7 @@ extern void panel_set_option(struct parsed_tagarg *); extern void sync_with_option(void); extern char *rcFile(char *base); extern char *etcFile(char *base); +extern char *auxbinFile(char *base); extern char *libFile(char *base); extern char *helpFile(char *base); extern void setLocalCookie(void); diff --git a/rc.c b/rc.c @@ -1484,6 +1484,16 @@ rcFile(char *base) } char * +auxbinFile(char *base) +{ + Str file = Strnew_charp(w3m_auxbin_dir()); + Strcat_char(file, '/'); + Strcat_charp(file, base); + return expandName(file->ptr); +} + +#if 0 /* not used */ +char * libFile(char *base) { Str file = Strnew_charp(w3m_lib_dir()); @@ -1491,6 +1501,7 @@ libFile(char *base) Strcat_charp(file, base); return expandName(file->ptr); } +#endif char * etcFile(char *base) @@ -1501,6 +1512,7 @@ etcFile(char *base) return expandName(file->ptr); } +#ifndef USE_HELP_CGI char * helpFile(char *base) { @@ -1509,3 +1521,5 @@ helpFile(char *base) Strcat_charp(file, base); return expandName(file->ptr); } +#endif +