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
|
dnl Autoconf script for tcsh
dnl To rebuild the `configure' script from this, execute the command
dnl autoconf
dnl in the directory containing this script.
dnl
dnl You'll also need a version of config.guess from a gnu package
dnl
dnl Written by Kaveh Ghazi (ghazi@caip.rutgers.edu) 5/11/96.
dnl
AC_PREREQ(2.13)dnl Minimum Autoconf version required.
AC_INIT(tc.vers.c)
AC_CANONICAL_HOST
dnl We don't use AC_VALIDATE_CACHED_SYSTEM_TUPLE here because we only
dnl care about the HOST value, not the HOST/BUILD/TARGET triplet.
AC_MSG_CHECKING([cached host tuple])
if { test x"${ac_cv_host_system_type+set}" = x"set" &&
test x"$ac_cv_host_system_type" != x"$host"; }; then
AC_MSG_RESULT([different])
AC_MSG_ERROR([remove config.cache and re-run configure])
else
AC_MSG_RESULT(ok)
fi
ac_cv_host_system_type="$host"
changequote(, )dnl
case "${host}" in
## Alpha (DEC) machines.
alpha*-dec-osf* )
tcsh_config_file=decosf1
;;
## Ultrix
*-dec-ultrix* )
tcsh_config_file=ultrix
;;
## DGUX
*-dg-dguxR4* )
tcsh_config_file=dgux5.4
;;
m88k-dg-dgux5.4R* )
tcsh_config_file=dgux5.4
;;
## HP/UX
*-hp-hpux7* )
tcsh_config_file=hpux7
;;
*-hp-hpux[89]* )
tcsh_config_file=hpux8
;;
*-hp-hpux1[0-9]* )
tcsh_config_file=hpux11
;;
## IBM AIX systems
*-ibm-aix*)
tcsh_config_file=aix
;;
## SX-4
sx4-nec-*)
CC='cc -h0,ansi,novector,float0'
LDFLAGS='-Gsmall'
tcsh_config_file=superux8
;;
## IBM OS/390 systems
*-ibm-os390*)
CC='c89'
tcsh_config_file=os390
;;
## Linux
*-*-linux* )
tcsh_config_file=linux
;;
## Motorola systems
m68k-motorola-sysv* )
tcsh_config_file=sysV68
;;
m88k-motorola-sysv3* )
tcsh_config_file=sysV88
;;
## NetBSD systems
*-*-netbsd*)
tcsh_config_file=bsd4.4
;;
## FreeBSD systems
*-*-freebsd*)
tcsh_config_file=bsd4.4
;;
## OpenBSD systems
*-*-openbsd*)
tcsh_config_file=bsd4.4
;;
## BSDI systems
*-*-bsdi*)
tcsh_config_file=bsd4.4
;;
## Mac OS X Server
*-*-rhapsody* )
tcsh_config_file=bsd4.4
;;
## Mac OS X Server
*-*-darwin* )
tcsh_config_file=bsd4.4
;;
## Silicon Graphics machines
*-sgi-iri* )
tcsh_config_file=irix
case "${host_os}" in
irix[34]*) # Irix-3.x - Irix 4.x
NON_GNU_DFLAGS='-D__STDC__'
LIBS='-lsun -lbsd -lc_s'
;;
irix5* | irix6.[01]*) # Irix 5.x, Irix 6.0 - 6.1
LIBS='-lbsd'
;;
irix6.[2-9]*) # Irix 6.2 and later
tcsh_config_file=irix62
;;
esac
;;
## Suns
*-sun-sunos3* )
tcsh_config_file=sunos35
;;
*-sun-sunos4.0* )
tcsh_config_file=sunos40
;;
*-sun-sunos4.1.[12]* )
tcsh_config_file=sunos41
;;
*-sun-sunos4.1.[3456]* )
tcsh_config_file=sunos413
;;
*-*-solaris2.[01]* ) # Should handle sparc or x86
tcsh_config_file=sol2
;;
*-sun-solaris2.2* ) # Sparc only release
tcsh_config_file=sol22
;;
*-sun-solaris2.3* ) # Sparc only release
tcsh_config_file=sol23
;;
*-*-solaris2.[45]* ) # Should handle sparc, x86 and powerpc
tcsh_config_file=sol24
;;
*-*-solaris2.* ) # Should handle sparc, x86 and powerpc
tcsh_config_file=sol26
;;
## Dell SVR4
*-dell-sysv4* )
tcsh_config_file=sysv4
DFLAGS="$DFLAGS -DDELL"
;;
## SVR4 (Generic and otherwise)
*-*-sysv4* )
tcsh_config_file=sysv4
;;
## Tektronix systems
m68k-tektronix-bsd* )
tcsh_config_file=bsd
NON_GNU_DFLAGS='-DBSD -DUTek'
;;
m88k-tektronix-sysv3* )
tcsh_config_file=tekXD88
;;
## SCO
*-sco3.2v5*)
tcsh_config_file=sco32v5
;;
*-sco3.2v4*)
tcsh_config_file=sco32v4
;;
*-sco3.2v2*)
tcsh_config_file=sco32v2
;;
## Siemens BS2000 Mainframe
bs2000-siemens-posix)
tcsh_config_file=bs2000
;;
## Convex
*-convex*)
tcsh_config_file=convex
;;
## Cray
*-cray-unicos*)
tcsh_config_file=cray
;;
## Cygnus GNU Win32
*-cygwin)
tcsh_config_file=cygwin32
;;
## mips-compaq-nonstopux
*-*-nonstopux)
tcsh_config_file=sysv4
;;
## Apollo Domain/OS
*-apollo-*)
tcsh_config_file=apollo
;;
* )
changequote([, ])dnl
AC_MSG_ERROR([Tcsh can't guess the configuration file name
for \`${host}' systems.
Check tcsh's \`Ported' file for manual configuration instructions.])
changequote(, )dnl
;;
esac
echo "Tcsh will use configuration file \`$tcsh_config_file'."
changequote([, ])dnl
AC_CONFIG_HEADER(config.h:config/${tcsh_config_file}:config.h.in)
AC_PROG_CC
AC_PROG_CPP
AC_PROG_GCC_TRADITIONAL
if test $ac_cv_prog_gcc = no ; then
DFLAGS="$DFLAGS $NON_GNU_DFLAGS"
CFLAGS="$CFLAGS $NON_GNU_CFLAGS"
fi
case "${host}" in
## Cygnus GNU Win32
*-cygwin)
CFLAGS="$CFLAGS -mno-win32"
;;
esac
AC_SEARCH_LIBS(crypt, crypt)
AC_SEARCH_LIBS(tgetent, termlib curses termcap)
AC_SEARCH_LIBS(gethostbyname, nsl)
AC_SEARCH_LIBS(connect, socket)
dnl This is not good enough; we need sockaddr_storage too.
dnl See whether we can use IPv6 related functions
dnl AC_DEFUN(IPv6_CHECK_FUNC, [
dnl changequote(, )dnl
dnl ac_tr_lib=HAVE_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \
dnl -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
dnl changequote([, ])dnl
dnl AC_CHECK_FUNC($1, [dnl
dnl AC_DEFINE_UNQUOTED($ac_tr_lib)
dnl ac_cv_lib_inet6_$1=no], [dnl
dnl AC_MSG_CHECKING([whether your system has IPv6 directory])
dnl AC_CACHE_VAL(ipv6_cv_dir, [dnl
dnl for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do
dnl if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then
dnl break
dnl fi
dnl done])dnl
dnl AC_MSG_RESULT($ipv6_cv_dir)
dnl if test $ipv6_cv_dir = no; then
dnl ac_cv_lib_inet6_$1=no
dnl else
dnl if test x$ipv6_libinet6 = x; then
dnl ipv6_libinet6=no
dnl SAVELDFLAGS="$LDFLAGS"
dnl LDFLAGS="-L$ipv6_cv_dir/lib"
dnl fi
dnl AC_CHECK_LIB(inet6, $1, [dnl
dnl AC_DEFINE_UNQUOTED($ac_tr_lib)
dnl if test $ipv6_libinet6 = no; then
dnl ipv6_libinet6=yes
dnl LIBS="$LIBS -linet6"
dnl fi],)dnl
dnl if test $ipv6_libinet6 = no; then
dnl LDFLAGS="$SAVELDFLAGS"
dnl fi
dnl fi])dnl
dnl if test $ac_cv_func_$1 = yes -o $ac_cv_lib_inet6_$1 = yes
dnl then
dnl ipv6_cv_$1=yes
dnl ifelse([$2], , :, [$2])
dnl else
dnl ipv6_cv_$1=no
dnl ifelse([$3], , :, [$3])
dnl fi])
dnl IPv6_CHECK_FUNC(getnameinfo, DFLAGS="$DFLAGS -DINET6")
AC_CACHE_CHECK([ss_family in sockaddr_storage], ac_cv_ss_family,
[AC_TRY_COMPILE([#include <sys/types.h>
#include <sys/socket.h>], [struct sockaddr_storage ss; ss.ss_family;],
ac_cv_ss_family=yes, ac_cv_ss_family=no)]
if test "$ac_cv_ss_family" = no; then
DFLAGS="$DFLAGS -DNO_SS_FAMILY"
fi
)
AC_SUBST(DFLAGS)
AC_ARG_WITH(hesiod,
[ --with-hesiod=PREFIX Use Hesiod lookup for ~ expansion],
[hesiod="$withval"], [hesiod=no])
if test "$hesiod" != no; then
HESLIB="-lhesiod"
AC_CHECK_FUNC(res_send, :,
AC_CHECK_LIB(resolv, res_send, HESLIB="$HESLIB -lresolv"))
HESDEF=-DHESIOD
if test "$hesiod" != yes; then
HESDEF="$HESDEF -I$hesiod/include"
HESLIB="-L$hesiod/lib $HESLIB"
fi
fi
AC_SUBST(HESDEF)
AC_SUBST(HESLIB)
AC_EXEEXT
AC_OUTPUT(Makefile)
|