diff options
author | Fumitoshi UKAI <ukai@debian.or.jp> | 2001-11-27 18:29:24 +0000 |
---|---|---|
committer | Fumitoshi UKAI <ukai@debian.or.jp> | 2001-11-27 18:29:24 +0000 |
commit | 600a6bbd4bc23e295e602f05d400663a3241be41 (patch) | |
tree | e4a3b782a51b61ec0ccf6bb532e8e45fc17ce873 | |
parent | [w3m-dev 02578] (diff) | |
download | w3m-600a6bbd4bc23e295e602f05d400663a3241be41.tar.gz w3m-600a6bbd4bc23e295e602f05d400663a3241be41.zip |
[w3m-dev 02574] sysconfdir
From: Fumitoshi UKAI <ukai@debian.or.jp>
Diffstat (limited to '')
-rw-r--r-- | ChangeLog | 11 | ||||
-rwxr-xr-x | configure | 30 | ||||
-rw-r--r-- | indep.c | 8 | ||||
-rw-r--r-- | indep.h | 3 | ||||
-rw-r--r-- | proto.h | 3 | ||||
-rw-r--r-- | rc.c | 13 |
6 files changed, 62 insertions, 6 deletions
@@ -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 @@ -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" @@ -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); @@ -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))) @@ -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); @@ -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()); |