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
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
|
#!/bin/sh
# $Id: configure,v 1.64 2002/03/13 17:04:56 ukai Exp $
# Configuration.
#
#
if ./which uname > /dev/null ; then
sysname=`uname -s`
sysversion=`uname -r`
platform=`uname -m`
elif [ -f /usr/sony/bin/machine -a -f /etc/osversion ]; then
sysname='NEWS-OS'
sysversion=`sed 's/[^ ]* [^ ]* //' /etc/osversion`
platform=`/usr/sony/bin/machine`
fi
host=`hostname`
sysversion1=`echo $sysversion | awk -F. '{print $1}'`
sysversion2=`echo $sysversion | awk -F. '{print $2}'`
sysversion3=`echo $sysversion | awk -F. '{print $3}'`
echo $sysname $sysversion1 $sysversion2 $sysversion3 /$platform at $host
if [ -f config.param ] ; then
confhost=`awk 'NR==1{print $4}' config.param`
if [ "$confhost" = "$host" ] ; then
. ./config.param
fi
fi
echo "# Configuration at $host" > config.param
# parameters:
prefix=/usr/local
ssl_includedir=
ssl_libdir=
gc_includedir=
gc_libdir=
mimetypes=
all_yes=0
while [ $# -gt 0 ]
do
case "$1" in
-yes|--yes|-nonstop|--nonstop)
all_yes=1
echo "Setting all parameters to the default..."
;;
-prefix|--prefix)
prefix=$2
shift
;;
-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
;;
-lang=ja|--lang=ja|-lang=ja|--lang=JA)
lang=JA
;;
-model=baby|--model=baby)
dmodel=1
;;
-model=little|--model=little)
dmodel=2
;;
-model=mouse|--model=mouse)
dmodel=3
;;
-model=cookie|--model=cookie)
dmodel=4
;;
-model=monster|--model=monster)
dmodel=5
;;
-model=custom|--model=custom)
dmodel=6
;;
-code=*|--code=*)
display_code=`expr "$1" : "-*code=\(.*\)"`
;;
-cflags=*|--cflags=*)
dcflags=`echo $1 | sed -e 's/-*cflags=//'`
;;
-ldflags=*|--ldflags=*)
dldflags=`echo $1 | sed -e 's/-*ldflags=//'`
;;
--ssl-includedir=*)
ssl_includedir=`expr "$1" : "--ssl-includedir=\(.*\)"`
;;
--ssl-libdir=*)
ssl_libdir=`expr "$1" : "--ssl-libdir=\(.*\)"`
;;
--gc-includedir=*)
gc_includedir=`expr "$1" : "--gc-includedir=\(.*\)"`
;;
--gc-libdir=*)
gc_libdir=`expr "$1" : "--gc-libdir=\(.*\)"`
;;
--mimetypes=*)
mimetypes=`expr "$1" : "--mimetypes=\(.*\)"`
;;
-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"
echo "-code=(S|E|j|N|n|m)"
echo " Specify default kanji code"
echo "-cflags=FLAGS Specify C flags"
echo "-ldflags=FLAGS Specify LD flags"
echo "--ssl-includedir=DIR specify OpenSSL include dir"
echo "--ssl-libdir=DIR specify OpenSSL lib dir"
echo "--gc-includedir=DIR specify Boehm-GC include dir"
echo "--gc-libdir=DIR specify Boehm-GC lib dir"
echo "--mimetypes=PATH specify mime.types path"
echo "-help Display help"
exit 0
;;
esac
shift
done
if [ -z "`echo -n aho | grep n`" ] ; then
Echo()
{
echo -n "$*"
}
else
Echo()
{
echo "$*\c"
}
fi
do_sigtest()
{
echo "#include <signal.h>" > _zmachdep.c
if [ "$2" = void ]; then
echo "$1 _handler($2) {}" >> _zmachdep.c
else
echo "$1 _handler($2 x) {}" >> _zmachdep.c
fi
echo "int main(void) { $1 (*hdl)($2); hdl = signal(SIGINT,_handler); return 0; }" >> _zmachdep.c
$cc $cflags -o _zmachdep _zmachdep.c > _zwarning 2>&1
stat=$?
warning=`cat _zwarning`
rm -f _zwarning
}
readdir() {
if [ "$all_yes" = 0 ]; then
read __dir
else
__dir=$1
echo "$1"
fi
if [ -z "$__dir" ]; then
_dir=$1
else
_dir=`echo "$__dir"|sed -e "s;^~;$HOME;"`
fi
}
readanswer() {
var=$1
dflt=$2
ok=$3
if [ "$all_yes" = 0 -o -z "$dflt$ok" ]; then
read ans
if [ -z "$ans" ]; then
ans=$dflt
fi
else
ans=$dflt
echo "$ans"
fi
eval $var='$ans'
}
yesno() {
var=$1
dflt=$2
ddflt=$3
if [ -z "$dflt" ]; then
dflt=$ddflt
fi
if [ "$dflt" = y ]; then
ndflt=n
else
ndflt=y
fi
Echo "[$dflt]? "
if [ "$all_yes" = 0 ]; then
read ks_ans
else
ks_ans=$dflt
echo "$dflt"
fi
if [ "$ks_ans" = "$ndflt" ]; then
eval $var='$ndflt'
else
eval $var='$dflt'
fi
}
#
# def_param "name" "default_value"
# =>
# $name=${name:-$default_value}
# def_$name='#define $NAME' (if $name=y)
# def_$name='#undef $NAME' (otherwise)
#
def_param() {
flag=$1
eval "fvar=\$$flag"
dflt=$2
if [ -z "$fvar" ]; then
fvar=$dflt
eval $flag='$fvar'
fi
def=`echo $flag | tr '[a-z]' '[A-Z]'`
if [ "$fvar" = "y" ]; then
eval "def_$flag='#define $def'"
else
eval "def_$flag='#undef $def'"
fi
echo "$flag=$fvar" >> config.param
}
#
# ask_choice "prompt" "var"
# "choice-1" "value-1" "description-1" .. .
# "choice-2" "value-2" "description-2" .. .
# =>
# $var=${value-<n>}
# def_$var='#define $VAR ${value-<n>}'
#
ask_choice() {
prompt=$1
var=$2
def=`echo $var | tr '[a-z]' '[A-Z]'`
shift; shift
list="$@"
echo "$prompt"
varvar=
# check old value
eval "old_dvar=\$$var"
set -- $list
while [ -n "$1" -a -n "$2" ]; do
c=$1; v=$2; shift; shift;
case $v in
$old_dvar) dc=$c; dvar=$old_dvar;;
*) ;;
esac
while [ "$1" != "." ]; do
shift;
done
shift
done
if [ "$all_yes" = 1 ]; then
eval "varvar=$dc"
fi
while [ -z "$varvar" ];
do
set -- $list
prompt="["
while [ -n "$1" -a -n "$2" ]; do
c=$1; v=$2;
shift; shift;
Echo "$c .."
while [ "$1" != "." ]; do
Echo " $1"; shift
done
echo " ($def=$v)"
shift
prompt="$prompt$c"
done
prompt="$prompt]? "
Echo "$prompt"
if [ -n "$dvar" ]; then
Echo "(default: $dc - $dvar)"
fi
read REPLY
if [ -z "$REPLY" ]; then
REPLY=$dc
fi
set -- $list
while [ -n "$1" -a -n "$2" ]; do
case $REPLY in
$1) eval "varvar=$1"
break
;;
esac
shift; shift;
while [ "$1" != "." ]; do
shift;
done
shift
done
done
Echo "You select"
set -- $list
while [ -n "$1" -a -n "$2" ]; do
c=$1; v=$2; shift; shift
case $varvar in
$c)
while [ "$1" != "." ]; do
Echo " $1"; shift
done
shift
eval "def_$var='#define $def $v'"
eval "$var=$v"
echo "$var=$v" >> config.param
echo " $def=$v"
break
;;
*) while [ "$1" != "." ]; do
shift;
done
shift
;;
esac
done
}
#
# ask_param "prompt" "name" "default_value"
# =>
# ask user
# def_param "name" "default_value"
#
ask_param() {
prompt=$1
flag=$2
eval "fvar=\$$flag"
dflt=$3
Echo "$prompt "
if [ "$all_yes" = 0 ]; then
yesno $flag $fvar $dflt
fi
def_param $flag $dflt
if [ "$all_yes" = 1 ]; then
eval "fvar=\$$flag"
if [ "$fvar" = y ]; then
echo ".... yes"
else
echo ".... no"
fi
fi
}
find_ssl() {
sslinclude=""
for i1 in $ssl_includedir /usr /usr/local $prefix
do
for i2 in /openssl /ssl /
do
if [ "$i2" = "/" ]; then i2=''; fi
dirname=${i1}${i2}
if [ -f $dirname/include/ssl.h ]; then
sslinclude="-I${dirname}/include"
elif [ -f $dirname/include/openssl/ssl.h ]; then
sslinclude="-I${dirname}/include/openssl -I${dirname}/include"
fi
for i3 in lib/openssl lib
do
dirname=${i1}${i2}/${i3}
for ext in a $so_ext
do
if [ -f $dirname/libssl.$ext -o -f $dirname/libcrypto.$ext ]; then
if [ "$ssllib" = -L${dirname} ]; then
ssllib="-L${dirname}"
else
ssllib="$ssllib -L${dirname}"
fi
fi
done
done
done
done
if [ -f "$ssl_libdir/libssl.$ext" -o -f "$ssl_libdir/libcrypto.$ext" ]; then
ssllib="-L$ssl_libdir $ssllib"
fi
ssllib="$ssllib -lssl -lcrypto"
if [ "$sslinclude" = "" ]; then
echo "Where is ssl.h? (for example, /usr/crypto/include)"
Echo ":"
read ks_ans
sslinclude="-I${ks_ans}"
if [ -d $ks_ans/openssl ]; then
sslinclude="${sslinclude} -I${ks_ans}/openssl"
fi
echo "Where is libssl.a? (for example, /usr/crypto/lib)"
Echo ":"
read ks_ans
ssllib="-L${ks_ans} -lssl -lcrypto"
fi
}
find_imlib() {
imlib_major=1
imlib_minor=9
imlib_micro=8
imlib_version=$imlib_major.$imlib_minor.$imlib_micro
echo "Checking Imlib."
if [ "x$IMLIB_CONFIG" = x ]; then
IMLIB_CONFIG=imlib-config
fi
version=`$IMLIB_CONFIG --version`
if [ "x$version" = x ]; then
echo "You don't have Imlib. Install Imlib (version >= $imlib_version)."
exit 1
fi
major=`echo "$version" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\1/'`
minor=`echo "$version" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\2/'`
micro=`echo "$version" | sed 's/\([0-9]*\)\.\([0-9]*\)\.\([0-9]*\).*/\3/'`
echo "The version of Imlib is $version."
if [ "$major" -ne $imlib_major -o "$minor" -ne $imlib_minor -o "$micro" -lt $imlib_micro ]; then
echo "Imlib is too old. Install Imlib (version >= $imlib_version)."
exit 1
fi
}
#--------------------------------------------------------------
if [ -n "$USER" ]; then
user=$USER
elif [ -n "$LOGNAME" ]; then
user=$LOGNAME
elif [ -n "`whoami`" ]; then
user=`whoami`
else
# Echo "Who are you? "
# read user
user=nobody
fi
echo "%"
echo "% Hello $user. Let's start configuration process for w3m."
echo "% Please answer some questions."
echo "%"
extension=
def_use_binstream='#undef USE_BINMODE_STREAM'
topdir=$prefix
special_sys=''
case "$sysname" in
aix | AIX )
special_sys="#define AIX"
;;
CYGWIN* )
sysname='CYGWIN'
special_sys="#define CYGWIN $sysversion1"
if [ $sysversion1 -eq 0 ]; then
topdir=/cygnus/cygwin-b20/H-i586-cygwin32
fi
extension='.exe'
def_use_binstream='#define USE_BINMODE_STREAM'
;;
OS/2 )
extension='.exe'
def_use_binstream='#define USE_BINMODE_STREAM'
;;
NetBSD )
# Newer NetBSD system doesn't define 'unix' symbol anymore, but GC library
# requires it.
special_sys="#define unix"
;;
esac
# determine shared object extension
so_ext=so
case "$sysname" in
HP-UX )
so_ext=sl
;;
Darwin )
so_ext=dylib
;;
esac
d_bindir=$bindir
if [ -z "$d_bindir" ]; then
d_bindir="$topdir/bin"
fi
echo "Which directory do you want to put the binary?"
Echo "(default: $d_bindir) "
readdir "$d_bindir"
bindir=$_dir
echo "bindir='$bindir'" >> config.param
d_libdir=$libdir
if [ -z "$d_libdir" ]; then
case "$sysname" in
*BSD)
d_libdir="$topdir/libexec/w3m"
;;
*)
d_libdir="$topdir/lib/w3m"
;;
esac
fi
echo "Which directory do you want to put the support binary files?"
Echo "(default: $d_libdir) "
readdir "$d_libdir"
libdir=$_dir
echo "libdir='$libdir'" >> config.param
d_helpdir=$helpdir
if [ -z "$d_helpdir" ]; then
d_helpdir="$topdir/share/w3m"
fi
echo "Which directory do you want to put the helpfile?"
Echo "(default: $d_helpdir) "
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)" .
if [ "$lang" = JA ]; then
ask_choice "What is your display kanji code?" display_code \
S S "Shift JIS" . \
E E "EUC-JP" . \
j j 'JIS: ESC $@ - ESC (J' . \
N N 'JIS: ESC $B - ESC (J' . \
n n 'JIS: ESC $B - ESC (B' . \
m m 'JIS: ESC $@ - ESC (B' .
system_code=
if [ "$display_code" = "S" ]; then
system_code=S
def_param system_code S
else
system_code=E
def_param system_code E
fi
else
display_code=x
system_code=x
def_param display_code x
def_param system_code x
fi
if [ "$lang" = "JA" ]; then
ask_param "Use 2-byte character for table border, item, etc." kanji_symbols y
else
kanji_symbols=n
def_param kanji_symbols n
fi
ask_param "Use Lynx-like key binding as default" use_lynx_key n
if [ "$use_lynx_key" = y ]; then
keymap_file="keybind_lynx"
else
keymap_file="keybind"
fi
if [ "$lang" = "JA" ]; then
if [ "$use_lynx_key" = y ]; then
helpfile="w3mhelp-lynx_ja.html"
else
helpfile="w3mhelp-w3m_ja.html"
fi
else
if [ "$use_lynx_key" = y ]; then
helpfile="w3mhelp-lynx_en.html"
else
helpfile="w3mhelp-w3m_en.html"
fi
fi
###
echo ""
echo "Let's do some configurations. Choose config option among the list."
echo ""
echo "1 - Baby model (no color, no menu, no mouse, no cookie, no SSL)"
echo "2 - Little model (color, menu, no mouse, no cookie, no SSL)"
echo "3 - Mouse model (color, menu, mouse, no cookie, no SSL)"
echo "4 - Cookie model (color, menu, mouse, cookie, no SSL)"
echo "5 - Monster model (with everything; you need openSSL library)"
echo "6 - Customize"
echo ""
Echo "Which? "
if [ -n "$dmodel" ]; then
Echo "(default: $dmodel) "
fi
include_opt=y
while :
do
readanswer ans "$dmodel"
if [ -z "$ans" -a -n "$dmodel" ]; then
ans=$dmodel
fi
dmodel_save="$dmodel"
dmodel=$ans
case "$ans" in
1)
use_color=n;
use_menu=n;
use_mouse=n;
use_cookie=n;
use_ssl=n;
include_opt=n
customized=y
;;
2)
use_color=y;
use_menu=y;
use_mouse=n;
use_cookie=n;
use_ssl=n;
customized=y
;;
3)
use_color=y;
use_menu=y;
use_mouse=y;
use_cookie=n;
use_ssl=n;
customized=y
;;
4)
use_color=y;
use_menu=y;
use_mouse=y;
use_cookie=y;
use_ssl=n;
customized=y
;;
5)
use_color=y;
use_menu=y;
use_mouse=y;
use_cookie=y;
use_ssl=y;
customized=y
;;
6)
if [ "$dmodel_save" = 6 ]; then
customized=y
else
customized=n
fi
;;
*)
echo "Please input 1-6."
Echo "Which? "
continue
;;
esac
break
done
if [ -n "$dmodel" ]; then
echo "dmodel=$dmodel" >> config.param
fi
save_all_yes=$all_yes
if [ "$customized" = y ]; then
all_yes=1
fi
ask_param "Use color ESC sequence for kterm/pxvt" use_color y
ask_param "Use mouse (requires xterm/kterm/gpm/sysmouse)" use_mouse n
ask_param "Use popup menu" use_menu y
ask_param "Use cookie" use_cookie n
ask_param "Use SSL (need OpenSSL library; Please see http://www.openssl.org/)" use_ssl n
all_yes=$save_all_yes
if [ "$use_ssl" = y ]; then
find_ssl
fi
if [ "$use_ssl" = y ]; then
ask_param "SSL verification support (SSL library >= version 0.8)" use_ssl_verify n
ask_param "Digest Auth support" use_digest_auth y
else
use_ssl_verify=n
def_param "use_ssl_verify" n
use_digest_auth=n
def_param "use_digest_auth" n
fi
ask_param "Inline image support (you need Imlib library)" use_image n
if [ "$use_image" = y ]; then
def_use_image="#define USE_IMAGE"
imgtarget='$(IMGDISPLAY) $(IMGSIZE)'
else
def_use_image="#undef USE_IMAGE"
imgtarget=''
fi
if [ "$use_color" = y ]; then
ask_param "ANSI color escape sequences support" use_ansi_color n
else
use_ansi_color=n
def_param "use_ansi_color" n
fi
ask_param "Use Migemo (Roma-ji search; Please see http://migemo.namazu.org/)" use_migemo n
def_migemo_command=${def_migemo_command:-"migemo -t egrep /usr/local/share/migemo/migemo-dict"}
echo "def_migemo_command='$def_migemo_command'" >> config.param
# protocols?
ask_param "External URI loader support" use_external_uri_loader y
if [ "$use_external_uri_loader" = y ]; then
ask_param "Use w3mmail.cgi" use_w3mmailer y
fi
ask_param "NNTP support" use_nntp $include_opt
ask_param "Gopher support" use_gopher $include_opt
# obsoleted?
# ask_param "Use matrix in rendering table" use_matrix n
ask_param "Use alarm support code" use_alarm $include_opt
ask_param "Use mark operation" use_mark $include_opt
### only use config.param
def_param use_dict n
def_param use_history y
def_param use_bg_color y
def_param format_nice n
def_param id_ext y
def_param use_bufinfo y
def_param use_egd y
def_param enable_remove_trailingspaces n
def_param menu_thin_frame n
def_param emacs_like_lineedit $include_opt
def_param vi_prec_num $include_opt
def_param label_topline $include_opt
def_param nextpage_topline $include_opt
def_param ftppass_hostnamegen $include_opt
def_param use_xface $use_image
def_param table_expand n
def_param table_no_compact n
def_param nowrap y
def_param matrix y
if [ -z "$ded" ] ; then ded=`./which \vi` ; fi
if [ -n "`echo $ded | grep 'no'`" ] ; then ded=vi ; fi
echo "Input your favorite editor program."
Echo "(Default: $ded) "
readdir "$ded"
editor=$_dir
echo "ded='$editor'" >> config.param
if [ "$use_w3mmailer" != 'y' ]; then
if [ -z "$dmail" ] ; then
if ./which \mailx > /dev/null
then
dmail=`./which \mailx`
else
dmail=`./which \mail`
fi
if [ -n "`echo $dmail | grep 'no'`" ] ; then dmail=mailx ; fi
fi
echo "Input your favorite mailer program."
Echo "(Default: $dmail) "
readdir "$dmail"
mailer=$_dir
else
mailer="$dmail"
fi
echo "dmail='$mailer'" >> config.param
if [ -z "$dbrowser" ] ; then
if ./which netscape > /dev/null
then
dbrowser=`./which netscape`
elif ./which iexplore > /dev/null
then
dbrowser=`./which iexplore`
else
dbrowser=`./which lynx`
fi
if [ -n "`echo $dbrowser | grep 'no'`" ] ; then dbrowser=netscape ; fi
fi
echo "Input your favorite external browser program."
Echo "(Default: $dbrowser) "
readdir "$dbrowser"
brz=$_dir
echo "dbrowser='$brz'" >> config.param
def_image_viewer=${def_image_viewer:-xv}
echo "def_image_viewer='$def_image_viewer'" >> config.param
def_audio_player=${def_audio_player:-showaudio}
echo "def_audio_player='$def_audio_player'" >> config.param
if [ -z "$dcc" ]; then
if [ -n "$CC" ]; then
dcc="$CC"
elif ./which gcc >/dev/null ; then
dcc=gcc
else
dcc=cc
fi
fi
echo "Input your favorite C-compiler."
Echo "(Default: $dcc) "
readanswer cc "$dcc"
echo "dcc='$cc'" >> config.param
if [ -z "$dcflags" ]; then
dcflags=${CFLAGS-"-O"}
fi
echo "Input your favorite C flags."
Echo "(Default: $dcflags) "
readanswer cflags "$dcflags"
echo "dcflags='$cflags'" >> config.param
bsdinclude=''
if [ ! -f /usr/include/netinet/in.h ] ; then
if [ -f /usr/include/bsd/netinet/in.h ] ; then
bsdinclude='-I/usr/include/bsd'
elif [ -f /usr/bsdinclude/netinet/in.h ] ; then
bsdinclude='-I/usr/bsdinclude'
else
echo "It seems you don't have some include files for networking."
fi
fi
termlib=''
cat > _zmachdep.c << EOF
main()
{
char bp[100];
tgetent(bp,getenv("TERM"));
}
EOF
if [ -z "$dtermlib" ]; then
TERM_LIBS='termcap termlib terminfo mytinfo curses ncurses'
for lib in $TERM_LIBS
do
for tlibdir in /lib /usr/lib /usr/local/lib /usr/ucblib /usr/ccslib /usr/ccs/lib $prefix/lib
do
if [ -f $tlibdir/lib$lib.a -o -f $tlibdir/lib$lib.$so_ext ] ; then
# check if the lib works...
Echo "Terminal library -l$lib found at $tlibdir, "
if $cc $cflags -o _zmachdep _zmachdep.c -l$lib > /dev/null 2>&1
then
echo "and it seems to work."
termlib=-l$lib
else
echo "but it doesn't seem to work."
fi
fi
done
done
if [ -z "$termlib" ]; then
Echo "termcap/curses library not found; I hope -ltermcap works."
termlib='-ltermcap'
fi
dtermlib=$termlib
fi
echo 'Which terminal library do you want to use? (type "none" if you do not need one)'
Echo "(default: $dtermlib) "
readanswer termlib "$dtermlib"
if [ "$termlib" = none ]; then
termlib=""
else
echo "dtermlib='$termlib'" >> config.param
fi
## Setup for math library
if [ $sysname = Rhapsody -o $sysname = "Mac OS" ]; then
echo "MacOS X doesn't need -lm."
mathlib=""
else
mathlib="-lm"
fi
## look for GPM library
use_gpm=""
gpmlib=""
if [ "$use_mouse" = y ]; then
for tlibdir in /lib /usr/lib /usr/local/lib $prefix/lib
do
if [ -f $tlibdir/libgpm.a -o -f $tlibdir/libgpm.so ]; then
echo "GPM library found."
def_use_gpm="#define USE_GPM"
gpmlib="-lgpm"
fi
done
fi
case $sysname in
freebsd|FreeBSD)
def_use_sysmouse="#define USE_SYSMOUSE"
;;
*)
def_use_sysmouse="#undef USE_SYSMOUSE"
;;
esac
extlib=''
case $sysname in
*bsd|*BSD)
searchlibs=""
;;
*)
searchlibs="bsd BSD 44bsd socket nsl"
;;
esac
for lib in $searchlibs
do
for tlibdir in /lib /usr/lib /usr/local/lib /usr/ucblib /usr/ccslib /usr/ccs/lib $prefix/lib
do
if [ -f $tlibdir/lib$lib.a -o -f $tlibdir/lib$lib.$so_ext ] ; then
extlib="$extlib -l$lib"
break
fi
done
done
if [ $sysname = "HP-UX" ]; then
extlib="$extlib -ldld"
fi
if [ -n "$extlib" ]; then
echo "additional library found: $extlib"
fi
extlib="$extlib $ldflags"
## Search zlib
zlib=
for tlibdir in /lib /usr/lib /usr/local/lib /usr/ucblib /usr/ccslib /usr/ccs/lib /usr/X11R6/lib $prefix/lib ${HOME}/lib
do
if [ -f $tlibdir/libz.a -o -f $tlibdir/libz.$so_ext ] ; then
echo "$tlibdir/libz found"
zlib="-L$tlibdir -lz"
break
fi
done
z_cflags=
for inc in /usr/include /usr/local/include $prefix/include ${HOME}/include
do
if [ -f $inc/zlib.h ]; then
echo "$inc/zlib.h found"
z_cflags="-I$inc"
break
fi
done
if [ -n "$zlib" -a -n "$z_cflags" ]; then
inflate='$(INFLATE)'
else
echo "Warning: It seems you don't have zlib. Inflate cannot be installed."
inflate=
fi
## Search pthread, Linux requires this (at least ia64,alpha,s390?).
## Other platform?
pthreadlib=
case $sysname in
Linux|linux|LINUX)
for tlibdir in /lib /usr/lib
do
if [ -f $tlibdir/libpthread.a -o -f $tlibdir/libpthread.$so_ext ]; then
echo "$tlibdir/libpthread found"
pthreadlib="-L$tlibdir -lpthread"
break
fi
done
;;
esac
gclib=''
gcinclude=''
gctarget=''
for tlibdir in ${gc_libdir} /lib /usr/lib /usr/local/lib /usr/ucblib /usr/ccslib /usr/ccs/lib $prefix/lib ${HOME}/lib
do
if [ -f $tlibdir/libgc.a -o -f $tlibdir/libgc.$so_ext ] ; then
echo "$tlibdir/libgc found"
gclib="-L$tlibdir -lgc"
break
fi
done
for inc in ${gc_includedir} /usr/include /usr/include/gc /usr/local/include /usr/local/include/gc $prefix/include ${HOME}/include
do
if [ -f $inc/gc.h ]; then
echo "$inc/gc.h found"
gcinclude=$inc
break
fi
done
case $sysname in
linux|Linux|LINUX|aix|Aix|AIX)
if [ ! -f "$gcinclude/private/gc_priv.h" ]; then
case $cflags in
*DEBIAN*)
# on Debian, we can use libgc*.deb
:;;
*)
# these OS requires gcmain.c, which include gc/gc_priv.h
# therefore we use gc library comes with w3m
echo "Your OS is $sysname; using gc library comes with w3m."
gcinclude=""
gclib=""
;;
esac
fi
;;
esac
if [ -n "$gclib" -a -n "$gcinclude" ]; then
Echo GC library found on your system...
cat > _zmachdep.c << EOF
#include "gc/version.h"
main()
{
printf("%d%02d%03d\n",(GC_version>>16)&0xff,(GC_version>>8)&0xff,GC_version&0xff);
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
mygcversion=`./_zmachdep`
else
mygcversion=0
fi
cat > _zmachdep.c << EOF
#include <gc.h>
main()
{
extern unsigned GC_version;
printf("%d%02d%03d\n",(GC_version>>16)&0xff,(GC_version>>8)&0xff,GC_version&0xff);
}
EOF
if $cc $cflags -I$gcinclude -o _zmachdep _zmachdep.c $gclib > /dev/null 2>&1
then
echo "and it seems to work."
gcversion=`./_zmachdep`
echo "GC_version is $gcversion."
if [ $gcversion -lt $mygcversion ]; then
echo "GC library on your system seems to be old."
ask_param "Do you want to use GC library comes with w3m?" "use_bundled_gclib" y
if [ "$use_bundled_gclib" = 'n' -o "$use_bundled_gclib" = 'N' ]; then
cflags="$cflags -I$gcinclude"
else
cflags="$cflags -I./gc/include"
gclib="gc/gc.a"
gctarget=$gclib
echo "GC_version is $mygcversion."
fi
else
cflags="$cflags -I$gcinclude"
fi
elif [ $mygcversion -gt 0 ]; then
echo "but it doesn't seem to work."
cflags="$cflags -I./gc/include"
gclib="gc/gc.a"
gctarget=$gclib
echo "GC_version is $mygcversion."
else
echo "It seems you don't have GC library."
echo "Stop."
exit 1
fi
fi
if [ -z "$gclib" -o -z "$gcinclude" ]; then
cflags="$cflags -I./gc/include"
gclib="gc/gc.a"
gctarget="$gclib"
fi
# arch specific flags for libgc
gc_cflags=''
if [ "$gclib" = "gc/gc.a" ]; then
patchfile=""
case "$platform:$sysname" in
ia64:Linux|alpha:Linux|s390*:Linux)
gc_cflags="-DGC_LINUX_THREADS -D_REENTRANT"
;;
R3000:*System_V*|R4000:UNIX_SYSV|R*000:UNIX_SV)
# EWS-4800
# patchfile=Patches/ews4800
gc_cflags=-Dmips
;;
esac
# Apply patch.
if [ ! -f patch_done -a -n "$patchfile" -a -f "$patchfile" ]; then
patch -lp0 < $patchfile
echo "dpatch='$patch'" >> config.param
touch patch_done
fi
fi
echo "Input additional LD flags other than listed above, if any:"
if [ -z "$dldflags" ]; then
dldflags=${LDFLAGS-""}
fi
if [ -n "$dldflags" ]; then
Echo "(default: $dldflags) : "
else
Echo ": "
fi
readanswer ldflags "$dldflags" ok
if [ -z "$ldflags" ]; then
ldflags=$dldflags
fi
echo "dldflags='$ldflags'" >> config.param
echo "Checking machine dependency."
###### mime.types
MIME_TYPES=""
if [ -n "$mimetypes" ]; then
MIME_TYPES=$mimetypes
else
for d in /etc /usr/lib /usr/local/lib /usr/local/etc $prefix/lib /usr/local/etc/apache /usr/local/lib/mosaic /usr/local/mosaic /usr/local/netscape /usr/local/lib/netscape
do
if [ -f $d/mime.types ]; then
MIME_TYPES="$d/mime.types"
break
fi
done
fi
if [ -z "$MIME_TYPES" ]; then
echo "Global mime.types not found; Hope /usr/local/lib/mime.types works."
MIME_TYPES=/usr/local/lib/mime.types
fi
####### ranlib
if ./which ranlib > /dev/null
then
echo "You have ranlib."
ranlib_cmd=ranlib
else
if [ $sysname = "OS/2" ]; then
ranlib_cmd=rem
else
echo "You don't have ranlib."
ranlib_cmd=:
fi
fi
####### mkdir -p
if mkdir -p hogege
then
echo "You have mkdir -p."
MKDIR="mkdir -p"
else
MKDIR="mkdir"
fi
rm -rf hogege 2>&1 >/dev/null
####### perl
perl=`./which perl`
if [ `expr "$perl" : 'not found'` != 0 ]; then
echo "You don't have perl."
perl=/usr/local/bin/perl
have_perl=n
else
echo "You have perl."
have_perl=y
fi
def_param use_help_cgi $have_perl
####### strcasecmp
cat > _zmachdep.c << EOF
#include <string.h>
main()
{
int i;
i = strcasecmp("abc","def");
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have strcasecmp()."
def_have_strcasecmp="#define HAVE_STRCASECMP"
else
echo "You don't have strcasecmp()."
def_have_strcasecmp="#undef HAVE_STRCASECMP"
fi
####### strcasestr
cat > _zmachdep.c << EOF
#include <string.h>
main()
{
int i;
i = strcasestr("abc","def");
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have strcasestr()."
def_have_strcasestr="#define HAVE_STRCASESTR"
else
echo "You don't have strcasestr()."
def_have_strcasestr="#undef HAVE_STRCASESTR"
fi
####### strchr
cat > _zmachdep.c << EOF
#include <string.h>
main()
{
char *p, *q = "abc";
p = strchr(q,'c');
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have strchr()."
def_have_strchr="#define HAVE_STRCHR"
else
echo "You don't have strchr()."
def_have_strchr="#undef HAVE_STRCHR"
fi
####### strerror
cat > _zmachdep.c << EOF
main()
{
int i;
i = strerror(0);
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have strerror()."
def_have_strerror="#define HAVE_STRERROR"
else
echo "You don't have strerror()."
def_have_strerror="#undef HAVE_STRERROR"
fi
####### sys_errlist
cat > _zmachdep.c << EOF
main()
{
extern char sys_errlist[];
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have sys_errlist[]."
def_have_syserrlist="#define HAVE_SYS_ERRLIST"
else
echo "You don't have sys_errlist[]."
def_have_syserrlist="#undef HAVE_SYS_ERRLIST"
fi
####### bcopy
cat > _zmachdep.c << EOF
main()
{
char x[1],y[1];
bzero(x,1);
bcopy(x,y,1);
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have bcopy()."
def_have_bcopy="#define HAVE_BCOPY"
else
echo "You don't have bcopy()."
def_have_bcopy="#undef HAVE_BCOPY"
fi
####### waitpid
cat > _zmachdep.c << EOF
#include <sys/types.h>
#include <sys/wait.h>
main()
{
pid_t pid;
int status;
if ((pid = fork()) == 0) {
sleep(10);
exit(1);
}
while(waitpid(pid,&status,WNOHANG));
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have waitpid()."
def_have_waitpid="#define HAVE_WAITPID"
else
echo "You don't have waitpid()."
def_have_waitpid="#undef HAVE_WAITPID"
fi
####### wait3
cat > _zmachdep.c << EOF
#include <sys/types.h>
#include <time.h>
#include <sys/time.h>
#include <sys/resource.h>
#include <sys/wait.h>
#ifndef NULL
#define NULL 0
#endif
main()
{
int pid;
int status;
if ((pid = fork()) == 0) {
sleep(10);
exit(1);
}
while(wait3(&status,WNOHANG,NULL) > 0);
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have wait3()."
def_have_wait3="#define HAVE_WAIT3"
else
echo "You don't have wait3()."
def_have_wait3="#undef HAVE_WAIT3"
fi
####### strftime
cat > _zmachdep.c << EOF
#include <time.h>
main()
{
time_t ct;
struct tm *tm;
char t[80];
time(&ct);
strftime(t, 80, "%a, %d %b %Y %H:%M:%S GMT",gmtime(&ct));
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have strftime()."
def_have_strftime="#define HAVE_STRFTIME"
else
echo "You don't have strftime()."
def_have_strftime="#undef HAVE_STRFTIME"
fi
####### getcwd
cat > _zmachdep.c << EOF
#include <sys/param.h>
#include <unistd.h>
main()
{
#ifdef MAXPATHLEN
char path[MAXPATHLEN];
getcwd(path,MAXPATHLEN);
#else
gwtcwd(NULL, 0);
#endif
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have getcwd()."
def_have_getcwd="#define HAVE_GETCWD"
else
echo "You don't have getcwd()."
def_have_getcwd="#undef HAVE_GETCWD"
fi
####### getwd
cat > _zmachdep.c << EOF
main()
{
char path[64];
getwd(path);
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have getwd()."
def_have_getwd="#define HAVE_GETWD"
else
echo "You don't have getwd()."
def_have_getwd="#undef HAVE_GETWD"
fi
####### symlink
cat > _zmachdep.c << EOF
main()
{
char path[64],lpath[64];
symlink(path,lpath);
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have symlink()."
def_have_symlink="#define HAVE_SYMLINK"
else
echo "You don't have symlink()."
def_have_symlink="#undef HAVE_SYMLINK"
fi
####### readlink
cat > _zmachdep.c << EOF
main()
{
char path[64],lpath[64];
readlink(path,lpath,64);
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have readlink()."
def_have_readlink="#define HAVE_READLINK"
else
echo "You don't have readlink()."
def_have_readlink="#undef HAVE_READLINK"
fi
####### lstat
cat > _zmachdep.c << EOF
#include <sys/types.h>
#include <sys/stat.h>
main()
{
struct stat st;
char path[64];
lstat(path,&st);
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have lstat()."
def_have_lstat="#define HAVE_LSTAT"
else
echo "You don't have lstat()."
def_have_lstat="#undef HAVE_LSTAT"
fi
####### setenv
cat > _zmachdep.c << EOF
#include <stdlib.h>
main()
{
setenv("HOGE","hoge",1);
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have setenv()."
def_have_setenv="#define HAVE_SETENV"
else
echo "You don't have setenv()."
def_have_setenv="#undef HAVE_SETENV"
fi
####### putenv
cat > _zmachdep.c << EOF
#include <stdlib.h>
main()
{
putenv("HOGE=hoge");
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have putenv()."
def_have_putenv="#define HAVE_PUTENV"
else
echo "You don't have putenv()."
def_have_putenv="#undef HAVE_PUTENV"
fi
####### sigsetjmp
cat > _zmachdep.c << EOF
#include <setjmp.h>
main()
{
jmp_buf env;
if (sigsetjmp(env,1) != 0) {
exit(0);
}
siglongjmp(env,1);
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have sigsetjmp()."
def_setjmp="#define SETJMP(env) sigsetjmp(env,1)"
def_longjmp="#define LONGJMP(env,val) siglongjmp(env,val)"
def_jmpbuf="#define JMP_BUF sigjmp_buf"
else
echo "You don't have sigsetjmp()."
def_setjmp="#define SETJMP(env) setjmp(env)"
def_longjmp="#define LONGJMP(env,val) longjmp(env,val)"
def_jmpbuf="#define JMP_BUF jmp_buf"
fi
####### srand48
cat > _zmachdep.c << EOF
#include <stdlib.h>
main()
{
srand48(0);
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have srand48()."
def_have_srand48="#define HAVE_SRAND48"
else
echo "You don't have srand48()."
def_have_srand48="#undef HAVE_SRAND48"
fi
####### srandom
cat > _zmachdep.c << EOF
#include <stdlib.h>
main()
{
srandom(0);
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have srandom()."
def_have_srandom="#define HAVE_SRANDOM"
else
echo "You don't have srandom()."
def_have_srandom="#undef HAVE_SRANDOM"
fi
####### getpassphrase
cat > _zmachdep.c << EOF
#include <unistd.h>
main()
{
getpassphrase("");
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have getpassphrase()."
def_have_getpassphrase="#define HAVE_GETPASSPHRASE"
else
echo "You don't have getpassphrase()."
def_have_getpassphrase="#undef HAVE_GETPASSPHRASE"
fi
####### chdir
cat > _zmachdep.c <<EOF
#include <stdio.h>
#include <unistd.h>
main()
{
int (*c)() = chdir;
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have chdir()."
def_have_chdir="#define HAVE_CHDIR"
else
echo "You don't have chdir()."
def_have_chdir="#undef HAVE_CHDIR"
fi
####### fclose
cat > _zmachdep.c << EOF
#include <stdio.h>
#include <stdlib.h>
main()
{
void (*c)() = fclose;
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "fclose() is declared."
dcl_fclose=''
else
echo "fclose() is not declared."
dcl_fclose='void fclose(FILE*);'
fi
####### pclose
cat > _zmachdep.c << EOF
#include <stdio.h>
#include <stdlib.h>
main()
{
void (*c)() = pclose;
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "pclose() is declared."
dcl_pclose=''
else
echo "pclose() is not declared."
dcl_pclose='void pclose(FILE*);'
fi
####### termios/termio/sgtty
def_term_if='#define HAVE_SGTTY_H'
if [ $sysname = "HP-UX" ]; then
echo "Your OS is HP-UX; using termio"
def_term_if="#define HAVE_TERMIO_H"
elif [ $sysname = "CYGWIN" ]; then
echo "Your OS is CYGWIN; using termios"
def_term_if="#define HAVE_TERMIOS_H"
elif [ $sysname = "OS/2" ]; then
echo "Your OS is OS/2; using termios"
def_term_if='#define HAVE_TERMIOS_H'
elif [ -r /usr/include/termios.h ]; then
echo "You have termios."
def_term_if='#define HAVE_TERMIOS_H'
elif [ -r /usr/include/termio.h ]; then
echo "You have termio."
def_term_if='#define HAVE_TERMIO_H'
elif [ -r /usr/include/sgtty.h ]; then
echo "You have sgtty."
def_term_if='#define HAVE_SGTTY_H'
else
echo "Do you have tty interface? I can't find one but I hope sgtty works..."
fi
####### dirent/direct
def_dir_if=''
if [ $sysname = "CYGWIN" ]; then
echo "Your OS is CYGWIN; using dirent.h"
def_dir_if='#define HAVE_DIRENT_H'
elif [ $sysname = "OS/2" ]; then
echo "Your OS is OS/2; using dirent.h"
def_dir_if='#define HAVE_DIRENT_H'
elif [ -r /usr/include/dirent.h ]; then
echo "You have dirent.h."
def_dir_if='#define HAVE_DIRENT_H'
elif [ -r /usr/include/sys/dir.h ]; then
echo "You have sys/dir.h."
def_dir_if=''
else
echo "Do you have directory interface? I can't find one but I hope sys/dir.h works..."
fi
# check signal handler
do_sigtest int int
if [ $stat = 0 -a -z "$warning" ]
then
echo 'signal handler is int handler(int).'
def_sighandler='typedef int MySignalHandler;'
def_sig_arg='#define SIGNAL_ARG int _dummy'
def_sig_arglist='#define SIGNAL_ARGLIST 0'
def_sig_return='#define SIGNAL_RETURN return 0'
else
do_sigtest int void
if [ $stat = 0 -a -z "$warning" ]
then
echo 'signal handler is int handler(void).'
def_sighandler='typedef int MySignalHandler;'
def_sig_arg='#define SIGNAL_ARG void'
def_sig_arglist='#define SIGNAL_ARGLIST'
def_sig_return='#define SIGNAL_RETURN return 0'
else
do_sigtest void int
if [ $stat = 0 -a -z "$warning" ]
then
echo 'signal handler is void handler(int).'
def_sighandler='typedef void MySignalHandler;'
def_sig_arg='#define SIGNAL_ARG int _dummy'
def_sig_arglist='#define SIGNAL_ARGLIST 0'
def_sig_return='#define SIGNAL_RETURN return'
else
do_sigtest void void
if [ $stat = 0 -a -z "$warning" ]
then
echo 'signal handler is void handler(void).'
else
echo 'I could not find the type of signal handler. I hope void handler(void) works.'
fi
def_sighandler='typedef void MySignalHandler;'
def_sig_arg='#define SIGNAL_ARG void'
def_sig_arglist='#define SIGNAL_ARGLIST'
def_sig_return='#define SIGNAL_RETURN return'
fi
fi
fi
# check alarm()
if [ "$use_alarm" = y ]; then
cat > _zmachdep.c <<EOF
#include <unistd.h>
#include <signal.h>
main()
{
int sa = SIGALRM;
void (*a)() = alarm;
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have alarm()."
else
echo "You don't have alarm(), disable USE_ALARM"
use_alarm=n
def_use_alarm="#undef USE_ALARM"
fi
fi
# check for float.h
cat > _zmachdep.c << EOF
#include <float.h>
main()
{
;
}
EOF
if $cc $cflags -c _zmachdep.c > /dev/null 2>&1
then
echo "You have float.h."
def_have_float_h='#define HAVE_FLOAT_H'
else
def_have_float_h='#undef HAVE_FLOAT_H'
fi
####### check for sys/select.h
cat > _zmachdep.c <<EOF
#include <sys/select.h>
main()
{
;
}
EOF
if $cc $cflags -c _zmachdep.c > /dev/null 2>&1
then
echo "You have sys/select.h."
def_have_sys_select_h='#define HAVE_SYS_SELECT_H'
else
def_have_sys_select_h='#undef HAVE_SYS_SELECT_H'
fi
####### setpgrp(pid, pgrp) or setpgrp() ?
cat > _zmachdep.c << EOF
#include <unistd.h>
int main(){
int pid;
if((pid = fork()) == 0 )
setpgrp();
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
then
echo "You have setpgrp()."
def_have_setpgrp='#define HAVE_SETPGRP'
def_setpgrp='#define SETPGRP() setpgrp()'
else
cat > _zmachdep.c << EOF
#include <unistd.h>
int main(){
int pid;
if((pid = fork()) == 0 )
setpgrp( 0, 0 );
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c $extlib > /dev/null 2>&1
then
echo "You have setpgrp( pid, pgrp )."
def_have_setpgrp='#define HAVE_SETPGRP'
def_setpgrp='#define SETPGRP() setpgrp( 0, 0 )'
else
def_have_setpgrp=''
fi
fi
###### atexit/on_exit
# cat > _zmachdep.c <<EOF
# main()
# {
# atexit( sleep(1) );
# }
# EOF
# if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
# then
# echo "You have atexit()."
# atexit_flg="#define HAVE_ATEXIT"
# else
# cat > _zmachdep.c <<EOF
# #include <stdio.h>
# main()
# {
# on_exit( sleep(1), NULL );
# }
# EOF
# if $cc $cflags -o _zmachdep _zmachdep.c > /dev/null 2>&1
# then
# echo "You have on_exit()."
# atexit_flg="#define atexit(x) on_exit(x, NULL)"
# else
# echo "You don't have atexit()/on_exit()"
# fi
# fi
###### IPv6 support check
cat > _zmachdep.c <<EOF
#include <sys/types.h>
#include <sys/socket.h>
main()
{
if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
exit(1);
else
exit(0);
}
EOF
def_ipv6="#undef INET6"
v6_ss_family=""
v6lib=''
if $cc $cflags -o _zmachdep _zmachdep.c $extlib > /dev/null 2>&1
then
if ./_zmachdep; then
def_ipv6="#define INET6"
else
# even if build machine doesnt have IPv6 support, it may works
# Required for package builds
if [ "$use_ipv6" = "y" ]; then
echo "Your build machine doesn't have IPv6 support, but it is enabled by config.param"
def_ipv6="#define INET6"
echo "use_ipv6=y" >> config.param
fi
fi
case $sysname in
*BSD|*bsd)
cat > _zmachdep.c <<EOF
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
struct addrinfo *hints, **res;
int main() {
getaddrinfo("null", "null", hints, res);
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c $extlib > /dev/null 2>&1
then
echo "You have getaddrinfo() in libc."
else
for tlibdir in /usr/local/v6/lib /usr/local/lib /usr/lib $prefix/lib
do
if [ -e $tlibdir/libinet6.a ]; then
if [ "$tlibdir" != "/usr/lib" ]; then
v6lib="-L$tlibdir"
fi
v6lib="$v6lib -linet6"
if $cc $cflags -o _zmachdep _zmachdep.c $extlib $v6lib > /dev/null 2>&1
then
echo "You have getaddrinfo() in libinet6."
fi
break
fi
done
if [ "X$v6lib" = "X" ]; then
echo "You don't have getaddrinfo()."
def_ipv6="#undef INET6"
fi
fi
;;
CYGWIN*)
def_ipv6="#undef INET6"
;;
esac
fi
####### ss_family or __ss_family ?
if [ "$def_ipv6" = "#define INET6" ]; then
cat > _zmachdep.c <<EOF
#include <sys/types.h>
#include <sys/socket.h>
int main() {
struct sockaddr_storage ss;
int i = ss.ss_family;
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c $extlib > /dev/null 2>&1
then
echo "You have ss_family."
else
cat > _zmachdep.c <<EOF
#include <sys/types.h>
#include <sys/socket.h>
int main() {
struct sockaddr_storage ss;
int i = ss.__ss_family;
}
EOF
if $cc $cflags -o _zmachdep _zmachdep.c $extlib > /dev/null 2>&1
then
echo "You have __ss_family."
def_ipv6_ss_family="#define ss_family __ss_family"
else
echo "You don't have ss_family."
def_ipv6="#undef INET6"
fi
fi
fi
if [ "$def_ipv6" = "#undef INET6" ]; then
echo "You don't have IPv6 support."
else
echo "You have IPv6 support."
fi
if [ "$use_image" = y ]; then
find_imlib
fi
rm -f _zmachdep$extension _zmachdep.c _zmachdep.o
echo "------------ Configuration done ------------"
# set model name
case $dmodel in
1) modelname=baby;;
2) modelname=little;;
3) modelname=mouse;;
4) modelname=cookie;;
5) modelname=monster;;
6) modelname=custom;;
esac
cvsver=`awk '\$1 ~ /[$]Id:/ { print \$3}' ChangeLog`
sed -e 's/^#define CURRENT_VERSION "\(.*\)+cvs/#define CURRENT_VERSION "\1+cvs-'$cvsver'/' version.c.in > version.c
cur_ver=`sed -n 's/^#define CURRENT_VERSION *"w3m\/\([^"]*\)".*$/\1/p' version.c`
for h_in in w3mhelp-*_*.html.in
do
h=`expr "$h_in" : '\(.*\)\.in'`
sed -e 's/@CURRENT_VERSION@/'$cur_ver'/' $h_in > $h
done
cat > extrvers.c << EOF
#include <stdio.h>
#include <string.h>
#include "version.c"
main()
{
char *p = strchr(w3m_version,'/');
if (p == NULL)
printf("unknown\n");
else
printf("%s\n",p+1);
}
EOF
$cc $cflags -o extrvers extrvers.c > /dev/null 2>&1
w3mversion=`./extrvers`
echo "Current w3m version is $w3mversion."
rm -f extrvers.c extrvers$extension
echo "Extracting config.h"
cat > config.h << END_OF_CONFIG_H
/*
* Configuration for w3m
*/
#ifndef _CONFIGURED_
#define _CONFIGURED_
/* User Configuration */
/*
If you define DICT, you can use dictionary look-up function
in w3m. See README.dict for detail.
*/
$def_use_dict
/*
If you want to load and save URL history.
*/
$def_use_history
/*
USE_BG_COLOR enables w3m to set background color.
*/
$def_use_bg_color
/*
* Do word fill
*/
$def_format_nice
/*
* Enable id attribute
*/
$def_id_ext
/*
* Save Current-buffer Information
*/
$def_use_bufinfo
/*
* Support EGD (Entropy Gathering Daemon)
*/
$def_use_egd
/*
* Remove line trailing spaces in html buffer.
*/
$def_enable_remove_trailingspaces
/*
* thin chars for menu frame
*/
$def_menu_thin_frame
/*
*/
$def_table_expand
$def_table_no_compact
$def_nowrap
$def_matrix
/**********************************************************/
#ifdef makefile_parameter
BIN_DIR = $bindir
HELP_DIR = $helpdir
LIB_DIR = $libdir
ETC_DIR = $sysconfdir
RC_DIR = ~/.w3m
HELP_FILE = $helpfile
SYS_LIBRARIES = $gpmlib $termlib $ssllib $v6lib
LOCAL_LIBRARIES = $extlib
CC = $cc
MYCFLAGS = $cflags $bsdinclude $sslinclude
LDFLAGS = $ldflags
GCCFLAGS = $cflags -I./\$(srcdir)/include -DATOMIC_UNCOLLECTABLE -DNO_SIGNALS -DNO_EXECUTE_PERMISSION -DSILENT -DALL_INTERIOR_POINTERS
KEYBIND_SRC = $keymap_file.c
KEYBIND_OBJ = $keymap_file.o
EXT=$extension
MATHLIB=$mathlib
Z_CFLAGS=$z_cflags
ZLIB=$zlib
EXT_TARGETS=\$(BOOKMARKER) \$(HELPER) $inflate $imgtarget
GC_CFLAGS=$gc_cflags
GCLIB=$gclib $pthreadlib
GCTARGET=$gctarget
RANLIB=$ranlib_cmd
MKDIR=$MKDIR
PERL=$perl
VERSION=$w3mversion
MODEL=$sysname.$platform-$modelname-$lang
#else
$special_sys
#define DISPLAY_CODE '$display_code'
#define SYSTEM_CODE '$system_code'
#define JA 0
#define EN 1
$def_lang
$def_kanji_symbols
$def_use_color
$def_use_ansi_color
$def_use_migemo
$def_emacs_like_lineedit
$def_vi_prec_num
$def_use_mark
$def_label_topline
$def_nextpage_topline
$def_use_mouse
$def_use_gpm
$def_use_sysmouse
$def_use_menu
$def_use_cookie
$def_use_digest_auth
$def_use_ssl
$def_use_ssl_verify
$def_ftppass_hostnamegen
$def_use_external_uri_loader
$def_use_w3mmailer
$def_use_nntp
$def_use_gopher
$def_use_alarm
$def_use_image
$def_use_help_cgi
$def_use_xface
#define DEF_EDITOR "$editor"
#define DEF_MAILER "$mailer"
#define DEF_EXT_BROWSER "$brz"
/* fallback viewer. mailcap override these configuration */
#define DEF_IMAGE_VIEWER "$def_image_viewer"
#define DEF_AUDIO_PLAYER "$def_audio_player"
/* for USE_MIGEMO */
#define DEF_MIGEMO_COMMAND "$def_migemo_command"
#define LIB_DIR "$libdir"
#define HELP_DIR "$helpdir"
#define ETC_DIR "$sysconfdir"
#define HELP_FILE "w3mhelp.html"
#define HELP_CGI "w3mhelp"
#define W3MCONFIG "w3mconfig"
#define IMGSIZE "w3mimgsize"
#define IMGDISPLAY "w3mimgdisplay"
#define XFACE2XBM "xface2xbm"
#define RC_DIR "~/.w3m"
#define BOOKMARK "bookmark.html"
#define CONFIG_FILE "config"
#define KEYMAP_FILE "keymap"
#define MENU_FILE "menu"
#define COOKIE_FILE "cookie"
#define HISTORY_FILE "history"
#define USER_MAILCAP RC_DIR "/mailcap"
#define SYS_MAILCAP "/etc/mailcap"
#define USER_MIMETYPES "~/.mime.types"
#define SYS_MIMETYPES "$MIME_TYPES"
#define USER_URIMETHODMAP RC_DIR "/urimethodmap"
#define SYS_URIMETHODMAP ETC_DIR "/urimethodmap"
#define DEF_SAVE_FILE "index.html"
$def_use_binstream
$def_term_if
$def_dir_if
$def_have_strcasecmp
$def_have_strcasestr
$def_have_strchr
$def_have_strerror
$def_have_syserrlist
$def_have_bcopy
$def_have_waitpid
$def_have_wait3
$def_have_strftime
$def_have_getcwd
$def_have_getwd
$def_have_symlink
$def_have_readlink
$def_have_lstat
$def_have_setenv
$def_have_putenv
$def_have_srand48
$def_have_srandom
$def_have_getpassphrase
$def_have_chdir
$dcl_fclose
$dcl_pclose
$def_setjmp
$def_longjmp
$def_jmpbuf
$def_have_float_h
$def_have_sys_select_h
$def_sighandler
$def_sig_arg
$def_sig_arglist
$def_sig_return
$def_have_setpgrp
$def_setpgrp
/*
If you want to use IPv6, define this symbol.
*/
$def_ipv6
$def_ipv6_ss_family
/** dont edit below **/
#ifndef HAVE_SRAND48
#ifdef HAVE_SRANDOM
#define srand48 srandom
#define lrand48 random
#else /* HAVE_SRANDOM */
#define USE_INCLUDED_SRAND48
#endif /* HAVE_SRANDOM */
#endif
#if defined( __CYGWIN32__ ) && !defined( __CYGWIN__ )
#define __CYGWIN__
#endif
#if defined( __CYGWIN__ ) || defined( __EMX__ )
#define SUPPORT_DOS_DRIVE_PREFIX 1
#endif
#if defined( __CYGWIN__ )
#define SUPPORT_NETBIOS_SHARE 1
#endif
#if defined(__DJGPP__)
#define DEFAULT_TERM "dosansi"
#else
#define DEFAULT_TERM 0 /* XXX */
#endif
#if defined(__EMX__) /* use \$extension? */
#define GUNZIP_CMDNAME "gzip"
#define BUNZIP2_CMDNAME "bzip2"
#define INFLATE_CMDNAME "inflate.exe"
#define W3MBOOKMARK_CMDNAME "w3mbookmark.exe"
#define W3MHELPERPANEL_CMDNAME "w3mhelperpanel.exe"
#define DEV_NULL_PATH "nul"
#define DEV_TTY_PATH "con"
#define CGI_EXTENSION ".cmd"
#define USE_PATH_ENVVAR
#else
#define GUNZIP_CMDNAME "gunzip"
#define BUNZIP2_CMDNAME "bunzip2"
#define INFLATE_CMDNAME "inflate"
#define W3MBOOKMARK_CMDNAME "w3mbookmark"
#define W3MHELPERPANEL_CMDNAME "w3mhelperpanel"
#define DEV_NULL_PATH "/dev/null"
#define DEV_TTY_PATH "/dev/tty"
#define CGI_EXTENSION ".cgi"
#endif
#define PATH_SEPARATOR ':'
#define GUNZIP_NAME "gunzip"
#define BUNZIP2_NAME "bunzip2"
#define INFLATE_NAME "inflate"
#endif /* makefile_parameter */
#endif /* _CONFIGURED_ */
END_OF_CONFIG_H
echo ''
echo 'config.h is created. See config.h for further configuration.'
echo ''
echo 'Configuration done. Just type "make".'
|