aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFumitoshi UKAI <ukai@debian.or.jp>2001-11-27 18:29:24 +0000
committerFumitoshi UKAI <ukai@debian.or.jp>2001-11-27 18:29:24 +0000
commit600a6bbd4bc23e295e602f05d400663a3241be41 (patch)
treee4a3b782a51b61ec0ccf6bb532e8e45fc17ce873
parent[w3m-dev 02578] (diff)
downloadw3m-600a6bbd4bc23e295e602f05d400663a3241be41.tar.gz
w3m-600a6bbd4bc23e295e602f05d400663a3241be41.zip
[w3m-dev 02574] sysconfdir
From: Fumitoshi UKAI <ukai@debian.or.jp>
-rw-r--r--ChangeLog11
-rwxr-xr-xconfigure30
-rw-r--r--indep.c8
-rw-r--r--indep.h3
-rw-r--r--proto.h3
-rw-r--r--rc.c13
6 files changed, 62 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index b88dd1b..d7c046f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,16 @@
2001-11-28 Fumitoshi UKAI <ukai@debian.or.jp>
+ * [w3m-dev 02574] sysconfdir
+ * configure: add -bindir=* -libdir=* -helpdir=* -sysconfdir=*
+ * configure: add ETC_DIR
+ * indep.c (w3m_etc_dir): added
+ * indep.h: ditto
+ * rc.c (init_rc): use etcFile() instead of libFile()
+ * rc.c (etcFile): added
+ * proto.h: ditto
+
+2001-11-28 Fumitoshi UKAI <ukai@debian.or.jp>
+
* [w3m-dev 02578]
* file.c (process_anchor): support <input type="image">
* html.c (ALST_INPUT): add ATTR_SRC, ATTR_WIDTH, ATTR_HEIGHT
diff --git a/configure b/configure
index bc45262..5ab5ce0 100755
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
#!/bin/sh
-# $Id: configure,v 1.22 2001/11/27 17:00:41 ukai Exp $
+# $Id: configure,v 1.23 2001/11/27 18:29:24 ukai Exp $
# Configuration.
#
@@ -55,6 +55,18 @@ do
-prefix=*|--prefix=*)
prefix=`expr "$1" : "-*prefix=\(.*\)"`
;;
+ -bindir=*|--bindir=*)
+ bindir=`expr "$1" : "-*bindir=\(.*\)"`
+ ;;
+ -libdir=*|--libdir=*)
+ libdir=`expr "$1" : "-*libdir=\(.*\)"`
+ ;;
+ -helpdir=*|--helpdir=*)
+ helpdir=`expr "$1" : "-*helpdir=\(.*\)"`
+ ;;
+ -sysconfdir=*|--sysconfdir=*)
+ sysconfdir=`expr "$1" : "-*sysconfdir=\(.*\)"`
+ ;;
-lang=en|--lang=en|-lang=EN|--lang=EN)
lang=EN
;;
@@ -104,6 +116,10 @@ do
-help|--help)
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 "-helpdir=DIR help file in DIR (default: PREFIX/share/w3m)"
+ echo "-sysconfdir=DIR w3mconfig in DIR [PREFIX/etc/w3m]"
echo "-lang=(en|ja) Specify default language"
echo "-model=(baby|little|mouse|cookie|monster|custom)"
echo " Specify default model"
@@ -502,6 +518,16 @@ readdir "$d_helpdir"
helpdir=$_dir
echo "helpdir='$helpdir'" >> config.param
+d_sysconfdir=$sysconfdir
+if [ -z "$d_sysconfdir" ]; then
+ d_sysconfdir="$topdir/etc/w3m"
+fi
+echo "Which directory do you want to put the system wide w3m configuration file?"
+Echo "(default: $d_sysconfdir) "
+readdir "$d_sysconfdir"
+sysconfdir=$_dir
+echo "sysconfdir='$sysconfdir'" >> config.param
+
ask_choice "Which language do you prefer?" lang \
1 JA "Japanese (charset ISO-2022-JP, EUC-JP, Shift_JIS)" . \
2 EN "English (charset US_ASCII, ISO-8859-1, etc)" .
@@ -1889,6 +1915,7 @@ $def_matrix
BIN_DIR = $bindir
HELP_DIR = $helpdir
LIB_DIR = $libdir
+ETC_DIR = $sysconfdir
HELP_FILE = $helpfile
SYS_LIBRARIES = $gpmlib $extlib $termlib $ssllib $v6lib
LOCAL_LIBRARIES = $bsdlib $ldflags
@@ -1945,6 +1972,7 @@ $def_use_alarm
#define LIB_DIR "$libdir"
#define HELP_DIR "$helpdir"
+#define ETC_DIR "$sysconfdir"
#define HELP_FILE "w3mhelp.html"
#define W3MCONFIG "w3mconfig"
diff --git a/indep.c b/indep.c
index 9284a39..5f5a2f5 100644
--- a/indep.c
+++ b/indep.c
@@ -1,4 +1,4 @@
-/* $Id: indep.c,v 1.12 2001/11/27 16:55:46 ukai Exp $ */
+/* $Id: indep.c,v 1.13 2001/11/27 18:29:24 ukai Exp $ */
#include "fm.h"
#include <stdio.h>
#include <pwd.h>
@@ -696,6 +696,12 @@ w3m_lib_dir()
}
char *
+w3m_etc_dir()
+{
+ return w3m_dir("W3M_ETC_DIR", ETC_DIR);
+}
+
+char *
w3m_help_dir()
{
return w3m_dir("W3M_HELP_DIR", HELP_DIR);
diff --git a/indep.h b/indep.h
index 4a5ac61..d701d5c 100644
--- a/indep.h
+++ b/indep.h
@@ -1,4 +1,4 @@
-/* $Id: indep.h,v 1.6 2001/11/26 09:01:08 ukai Exp $ */
+/* $Id: indep.h,v 1.7 2001/11/27 18:29:24 ukai Exp $ */
#ifndef INDEP_H
#define INDEP_H
#include "gc.h"
@@ -43,6 +43,7 @@ extern Str Str_form_unquote(Str x);
extern char *shell_quote(char *str);
extern char *w3m_lib_dir();
+extern char *w3m_etc_dir();
extern char *w3m_help_dir();
#define New(type) ((type*)GC_MALLOC(sizeof(type)))
diff --git a/proto.h b/proto.h
index 0c36b31..e428f03 100644
--- a/proto.h
+++ b/proto.h
@@ -1,4 +1,4 @@
-/* $Id: proto.h,v 1.8 2001/11/24 02:01:26 ukai Exp $ */
+/* $Id: proto.h,v 1.9 2001/11/27 18:29:24 ukai Exp $ */
/*
* This file was automatically generated by version 1.7 of cextract.
* Manual editing not recommended.
@@ -461,6 +461,7 @@ extern Buffer *load_option_panel(void);
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 *libFile(char *base);
extern char *helpFile(char *base);
extern void setLocalCookie(void);
diff --git a/rc.c b/rc.c
index 4d5dad6..6368998 100644
--- a/rc.c
+++ b/rc.c
@@ -1,4 +1,4 @@
-/* $Id: rc.c,v 1.14 2001/11/24 02:01:26 ukai Exp $ */
+/* $Id: rc.c,v 1.15 2001/11/27 18:29:24 ukai Exp $ */
/*
* Initialization file etc.
*/
@@ -1196,7 +1196,7 @@ init_rc(char *config_file)
}
/* open config file */
- if ((f = fopen(libFile(W3MCONFIG), "rt")) != NULL) {
+ if ((f = fopen(etcFile(W3MCONFIG), "rt")) != NULL) {
interpret_rc(f);
fclose(f);
}
@@ -1371,6 +1371,15 @@ libFile(char *base)
}
char *
+etcFile(char *base)
+{
+ Str file = Strnew_charp(w3m_etc_dir());
+ Strcat_char(file, '/');
+ Strcat_charp(file, base);
+ return expandName(file->ptr);
+}
+
+char *
helpFile(char *base)
{
Str file = Strnew_charp(w3m_help_dir());