aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2002-11-09 21:55:24 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2002-11-09 21:55:24 +0000
commitd7ed8ae7d7525b4e2e6896f5980fd2069656fcc6 (patch)
tree6a233307a4025b421101836f0a12b17e57d280e1
parent[w3m-dev 03396] Re: meta refresh problem (diff)
downloadw3m-d7ed8ae7d7525b4e2e6896f5980fd2069656fcc6.tar.gz
w3m-d7ed8ae7d7525b4e2e6896f5980fd2069656fcc6.zip
[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>
-rw-r--r--ChangeLog29
-rw-r--r--NEWS2
-rw-r--r--XMakefile26
-rw-r--r--config.h.dist9
-rwxr-xr-xconfigure36
-rw-r--r--file.c18
-rw-r--r--image.c6
-rw-r--r--indep.c8
-rw-r--r--indep.h3
-rw-r--r--proto.h3
-rw-r--r--rc.c16
11 files changed, 122 insertions, 34 deletions
diff --git a/ChangeLog b/ChangeLog
index a98e144..ff74303 100644
--- 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
@@ -4446,4 +4473,4 @@ a * [w3m-dev 03276] compile error on EWS4800
* release-0-2-1
* import w3m-0.2.1
-$Id: ChangeLog,v 1.490 2002/11/08 17:32:50 ukai Exp $
+$Id: ChangeLog,v 1.491 2002/11/09 21:55:24 ukai Exp $
diff --git a/NEWS b/NEWS
index 862e2d7..8bc2c03 100644
--- 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
index 59a4e2a..704faf2 100644
--- a/XMakefile
+++ b/XMakefile
@@ -1,4 +1,4 @@
-# $Id: XMakefile,v 1.30 2002/11/06 03:50:49 ukai Exp $
+# $Id: XMakefile,v 1.31 2002/11/09 21:55:24 ukai Exp $
SRCS=main.c file.c buffer.c display.c etc.c search.c linein.c table.c local.c \
form.c map.c frame.c rc.c menu.c mailcap.c image.c\
func.c cookie.c history.c backend.c $(KEYBIND_SRC)
@@ -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
index 22c94f7..71d094b 100644
--- 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
index 3e1a990..06b8875 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: configure,v 1.84 2002/11/06 14:58:03 ukai Exp $
+# $Id: configure,v 1.85 2002/11/09 21:55:24 ukai Exp $
# Configuration.
#
@@ -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
index 960f2af..fbf9f1c 100644
--- a/file.c
+++ b/file.c
@@ -1,4 +1,4 @@
-/* $Id: file.c,v 1.113 2002/11/08 15:46:06 ukai Exp $ */
+/* $Id: file.c,v 1.114 2002/11/09 21:55:24 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
#include "myctype.h"
@@ -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
index c41a1ef..099b13f 100644
--- a/image.c
+++ b/image.c
@@ -1,4 +1,4 @@
-/* $Id: image.c,v 1.15 2002/11/06 15:05:35 ukai Exp $ */
+/* $Id: image.c,v 1.16 2002/11/09 21:55:24 ukai Exp $ */
#include "fm.h"
#include <sys/types.h>
@@ -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
index 8ae6963..cc9185a 100644
--- a/indep.c
+++ b/indep.c
@@ -1,4 +1,4 @@
-/* $Id: indep.c,v 1.24 2002/08/27 16:35:15 ukai Exp $ */
+/* $Id: indep.c,v 1.25 2002/11/09 21:55:24 ukai Exp $ */
#include "fm.h"
#include <stdio.h>
#include <pwd.h>
@@ -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
index 9f5fa1b..1ada968 100644
--- a/indep.h
+++ b/indep.h
@@ -1,4 +1,4 @@
-/* $Id: indep.h,v 1.9 2002/08/20 17:49:39 ukai Exp $ */
+/* $Id: indep.h,v 1.10 2002/11/09 21:55:24 ukai Exp $ */
#ifndef INDEP_H
#define INDEP_H
#include "gc.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
index c5bcc12..40796ed 100644
--- a/proto.h
+++ b/proto.h
@@ -1,4 +1,4 @@
-/* $Id: proto.h,v 1.52 2002/11/06 03:50:49 ukai Exp $ */
+/* $Id: proto.h,v 1.53 2002/11/09 21:55:24 ukai Exp $ */
/*
* This file was automatically generated by version 1.7 of cextract.
* Manual editing not recommended.
@@ -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
index 057909c..4cc0444 100644
--- a/rc.c
+++ b/rc.c
@@ -1,4 +1,4 @@
-/* $Id: rc.c,v 1.59 2002/11/06 03:27:04 ukai Exp $ */
+/* $Id: rc.c,v 1.60 2002/11/09 21:55:24 ukai Exp $ */
/*
* Initialization file etc.
*/
@@ -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
+