aboutsummaryrefslogtreecommitdiffstats
path: root/Bonus/oldconfigure.sh
blob: afa91caf96b24948a6ae04fcaf1062564d45c196 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#! /bin/sh
#
# oldconfig.sh: convert a config.param file and execute configure
#

# functions
opt_enable_set () {
  val=""
  if test x"$1" = xy; then
    val="--enable-$2"
  elif test x"$1" = xn; then
    val="--disable-$2"
  fi
  if test x"$val" != x; then
    OPT="${OPT} $val"
  fi
}

opt_with_set () {
  val=""
  if test x"$1" != x; then
    val="--with-$2='$1'"
  else
    val="--without-$2"
  fi
  if test x"$val" != x; then
    OPT="${OPT} $val"
  fi
}

env_set () {
  # no overwrite
  if test x"$1" != x && eval "test -z \"\$$1\"" > /dev/null; then
    echo "$1='$2'; export $1"
    eval "$1='$2'; export $1"
  fi
}

# main
topdir="`dirname $0`/.."

if test x"$1" = x-v; then
  echo_only=yes
  shift
fi
if test x"$1" = x; then
  echo "USAGE: $0 [-v] <config.param file>"
  echo "    option: -v ... echo only"
  exit 1
fi

if expr "$1" : '.*/' > /dev/null; then
  conffile="$1"
else
  conffile=./"$1"
fi
. "$conffile" # read config.param

OPT="--bindir='$bindir' --libexecdir='$auxbindir' --datadir='$helpdir' --sysconfdir='$sysconfdir' --libdir='$libdir' --mandir='$mandir'"

#case "$dmodel" in
#  1) val=baby;;
#  2) val=little;;
#  3) val=mouse;;
#  4) val=cookie;;
#  5) val=monster;;
#  *) echo "ERROR: Illegal model type (model=$dmodel)."
#     exit 1;;
#esac
#OPT="${OPT} --enable-model=$val"

case "$lang" in
  JA)
    if test x$display_code != x; then
      OPT="${OPT} --enable-japanese='$display_code'"
    else
      OPT="${OPT} --enable-japanese"
    fi
    opt_enable_set "$kanji_symbols" kanjisymbols
    ;;
  *)
    ;;
esac

opt_enable_set "$use_color" color
opt_enable_set "$use_ansi_color" ansi-color
opt_enable_set "$use_bg_color" bgcolor
if test x"$use_migemo" = xy; then
  if test x"$def_migemo_command" != x; then
    OPT="${OPT} --with-migemo='$def_migemo_command'"
  fi
elif test x"$use_migemo" = xn; then
  OPT="${OPT} --without-migemo"
fi
opt_enable_set "$use_mouse" mouse
opt_enable_set "$use_menu" menu
opt_enable_set "$use_cookie" cookie
opt_enable_set "$use_dict" dict
opt_enable_set "$use_history" history
opt_enable_set "$use_digest_auth" digest-auth
opt_enable_set "$use_nntp" nntp
opt_enable_set "$use_gopher" gopher
opt_enable_set "$use_lynx_key" keymap=lynx
opt_with_set "$ded" editor
opt_with_set "$dmail" mailer
opt_with_set "$dbrowser" browser
opt_enable_set "$use_help_cgi" help-cgi
opt_enable_set "$use_external_uri_loader" external-uri-loader
opt_enable_set "$use_w3mmailer" w3mmailer
opt_enable_set "$use_alarm" alarm
if test x"$use_image" = xy; then
  val_x11=""
  val_fb=""
  if test x"$use_w3mimg_x11" = xy; then
    val_x11="x11"
  fi
  if test x"$use_w3mimg_fb" = xy; then
    if test x"$w3mimgdisplay_setuid" = xy; then
      val_fb="fb+s"
    else
      val_fb="fb"
    fi
  fi
  if test x"$val_x11" != x; then
    if test x"$val_fb" != x; then
      val="$val_x11,$val_fb"
    else
      val="$val_x11"
    fi
  elif test x"$val_fb" != x; then
    val="$val_fb"
  fi

  if test x"$val" = x; then
    OPT="${OPT} --enable-image"
  else
    OPT="${OPT} --enable-image='$val'"
  fi

  opt_enable_set "$use_xface" xface
elif test x"$use_image" = xn; then
  OPT="${OPT} --disable-image"
fi
if test x"$use_ssl" = xy; then
  OPT="${OPT} --with-ssl"

  opt_enable_set "$use_ssl_verify" sslverify
elif test x"$use_ssl" = xn; then
  OPT="${OPT} --without-ssl"
fi
opt_enable_set "$use_ipv6" ipv6

env_set CC "$dcc"
env_set CFLAGS "$dcflags"
env_set LDFLAGS "$dldflags"

echo "( cd '$topdir'; sh configure ${OPT} )"
if test "${echo_only+set}" != set; then
  echo "( cd '$topdir'; sh configure ${OPT} )" | sh
fi