1 | dnl Autoconf script for tcsh |
---|
2 | dnl To rebuild the `configure' script from this, execute the command |
---|
3 | dnl autoconf |
---|
4 | dnl in the directory containing this script. |
---|
5 | dnl |
---|
6 | dnl You'll also need a version of config.guess from a gnu package |
---|
7 | dnl |
---|
8 | dnl Written by Kaveh Ghazi (ghazi@caip.rutgers.edu) 5/11/96. |
---|
9 | dnl |
---|
10 | |
---|
11 | AC_PREREQ([2.59])dnl Minimum Autoconf version required. |
---|
12 | AC_INIT |
---|
13 | AC_CONFIG_SRCDIR([tc.vers.c]) |
---|
14 | AC_CONFIG_HEADERS([config.h]) |
---|
15 | |
---|
16 | AC_CANONICAL_HOST |
---|
17 | |
---|
18 | AC_MSG_CHECKING([cached host tuple]) |
---|
19 | if { test x"${ac_cv_host_system_type+set}" = x"set" && |
---|
20 | test x"$ac_cv_host_system_type" != x"$host"; }; then |
---|
21 | AC_MSG_RESULT([different]) |
---|
22 | AC_MSG_ERROR([remove config.cache and re-run configure]) |
---|
23 | else |
---|
24 | AC_MSG_RESULT(ok) |
---|
25 | fi |
---|
26 | ac_cv_host_system_type="$host" |
---|
27 | |
---|
28 | |
---|
29 | changequote(, )dnl |
---|
30 | |
---|
31 | case "${host}" in |
---|
32 | |
---|
33 | ## Alpha (DEC) machines. |
---|
34 | alpha*-dec-osf* ) |
---|
35 | tcsh_config_file=decosf1 |
---|
36 | ;; |
---|
37 | |
---|
38 | ## Ultrix |
---|
39 | *-dec-ultrix* ) |
---|
40 | tcsh_config_file=ultrix |
---|
41 | ;; |
---|
42 | |
---|
43 | ## DGUX |
---|
44 | *-dg-dguxR4* ) |
---|
45 | tcsh_config_file=dgux5.4 |
---|
46 | ;; |
---|
47 | m88k-dg-dgux5.4R* ) |
---|
48 | tcsh_config_file=dgux5.4 |
---|
49 | ;; |
---|
50 | |
---|
51 | ## HP/UX |
---|
52 | *-hp-hpux7* ) |
---|
53 | tcsh_config_file=hpux7 |
---|
54 | ;; |
---|
55 | *-hp-hpux[89]* ) |
---|
56 | tcsh_config_file=hpux8 |
---|
57 | ;; |
---|
58 | *-hp-hpux1[0-9]* ) |
---|
59 | tcsh_config_file=hpux11 |
---|
60 | ;; |
---|
61 | |
---|
62 | ## IBM AIX systems |
---|
63 | *-ibm-aix*) |
---|
64 | tcsh_config_file=aix |
---|
65 | ;; |
---|
66 | |
---|
67 | ## SX-4 |
---|
68 | sx4-nec-*) |
---|
69 | CC='cc -h0,ansi,novector,float0' |
---|
70 | LDFLAGS='-Gsmall' |
---|
71 | tcsh_config_file=superux8 |
---|
72 | ;; |
---|
73 | |
---|
74 | ## IBM OS/390 systems |
---|
75 | *-ibm-os390*) |
---|
76 | CC='c89' |
---|
77 | tcsh_config_file=os390 |
---|
78 | ;; |
---|
79 | |
---|
80 | ## Linux |
---|
81 | *-*-linux* | *-*-gnu* | *-*-k*bsd*-gnu) |
---|
82 | tcsh_config_file=linux |
---|
83 | ;; |
---|
84 | |
---|
85 | ## Motorola systems |
---|
86 | m68k-motorola-sysv* ) |
---|
87 | tcsh_config_file=sysV68 |
---|
88 | ;; |
---|
89 | m88k-motorola-sysv3* ) |
---|
90 | tcsh_config_file=sysV88 |
---|
91 | ;; |
---|
92 | |
---|
93 | ## NetBSD systems |
---|
94 | *-*-netbsd*) |
---|
95 | tcsh_config_file=bsd4.4 |
---|
96 | ;; |
---|
97 | |
---|
98 | ## FreeBSD systems |
---|
99 | *-*-freebsd*) |
---|
100 | tcsh_config_file=bsd4.4 |
---|
101 | ;; |
---|
102 | |
---|
103 | ## OpenBSD systems |
---|
104 | *-*-openbsd*) |
---|
105 | tcsh_config_file=bsd4.4 |
---|
106 | ;; |
---|
107 | |
---|
108 | ## BSDI systems |
---|
109 | *-*-bsdi*) |
---|
110 | tcsh_config_file=bsd4.4 |
---|
111 | ;; |
---|
112 | |
---|
113 | ## Mac OS X Server |
---|
114 | *-*-rhapsody* ) |
---|
115 | tcsh_config_file=bsd4.4 |
---|
116 | ;; |
---|
117 | |
---|
118 | ## Mac OS X Server |
---|
119 | *-*-darwin* ) |
---|
120 | tcsh_config_file=bsd4.4 |
---|
121 | ;; |
---|
122 | |
---|
123 | ## Silicon Graphics machines |
---|
124 | *-sgi-iri* ) |
---|
125 | tcsh_config_file=irix |
---|
126 | case "${host_os}" in |
---|
127 | irix[34]*) # Irix-3.x - Irix 4.x |
---|
128 | NON_GNU_DFLAGS='-D__STDC__' |
---|
129 | LIBS='-lsun -lbsd -lc_s' |
---|
130 | ;; |
---|
131 | irix5* | irix6.[01]*) # Irix 5.x, Irix 6.0 - 6.1 |
---|
132 | LIBS='-lbsd' |
---|
133 | ;; |
---|
134 | irix6.[2-9]*) # Irix 6.2 and later |
---|
135 | tcsh_config_file=irix62 |
---|
136 | ;; |
---|
137 | esac |
---|
138 | ;; |
---|
139 | |
---|
140 | ## Suns |
---|
141 | *-sun-sunos3* ) |
---|
142 | tcsh_config_file=sunos35 |
---|
143 | ;; |
---|
144 | *-sun-sunos4.0* ) |
---|
145 | tcsh_config_file=sunos40 |
---|
146 | ;; |
---|
147 | *-sun-sunos4.1.[12]* ) |
---|
148 | tcsh_config_file=sunos41 |
---|
149 | ;; |
---|
150 | *-sun-sunos4.1.[3456]* ) |
---|
151 | tcsh_config_file=sunos413 |
---|
152 | ;; |
---|
153 | *-*-solaris2.[01]* ) # Should handle sparc or x86 |
---|
154 | tcsh_config_file=sol2 |
---|
155 | ;; |
---|
156 | *-sun-solaris2.2* ) # Sparc only release |
---|
157 | tcsh_config_file=sol22 |
---|
158 | ;; |
---|
159 | *-sun-solaris2.3* ) # Sparc only release |
---|
160 | tcsh_config_file=sol23 |
---|
161 | ;; |
---|
162 | *-*-solaris2.[45]* ) # Should handle sparc, x86 and powerpc |
---|
163 | tcsh_config_file=sol24 |
---|
164 | ;; |
---|
165 | *-*-solaris2.* ) # Should handle sparc, x86 and powerpc |
---|
166 | tcsh_config_file=sol26 |
---|
167 | ;; |
---|
168 | |
---|
169 | ## Dell SVR4 |
---|
170 | *-dell-sysv4* ) |
---|
171 | tcsh_config_file=sysv4 |
---|
172 | DFLAGS="$DFLAGS -DDELL" |
---|
173 | ;; |
---|
174 | |
---|
175 | ## SVR4 (Generic and otherwise) |
---|
176 | *-*-sysv4* ) |
---|
177 | tcsh_config_file=sysv4 |
---|
178 | ;; |
---|
179 | |
---|
180 | ## Tektronix systems |
---|
181 | m68k-tektronix-bsd* ) |
---|
182 | tcsh_config_file=bsd |
---|
183 | NON_GNU_DFLAGS='-DBSD -DUTek' |
---|
184 | ;; |
---|
185 | m88k-tektronix-sysv3* ) |
---|
186 | tcsh_config_file=tekXD88 |
---|
187 | ;; |
---|
188 | |
---|
189 | ## SCO |
---|
190 | *-sco3.2v5*) |
---|
191 | tcsh_config_file=sco32v5 |
---|
192 | ;; |
---|
193 | *-sco3.2v4*) |
---|
194 | tcsh_config_file=sco32v4 |
---|
195 | ;; |
---|
196 | *-sco3.2v2*) |
---|
197 | tcsh_config_file=sco32v2 |
---|
198 | ;; |
---|
199 | |
---|
200 | ## Siemens BS2000 Mainframe |
---|
201 | bs2000-siemens-*) |
---|
202 | tcsh_config_file=bs2000 |
---|
203 | ;; |
---|
204 | |
---|
205 | ## Convex |
---|
206 | *-convex*) |
---|
207 | tcsh_config_file=convex |
---|
208 | ;; |
---|
209 | |
---|
210 | ## Cray |
---|
211 | *-cray-unicos*) |
---|
212 | tcsh_config_file=cray |
---|
213 | ;; |
---|
214 | |
---|
215 | ## Red Hat Cygwin |
---|
216 | *-cygwin) |
---|
217 | tcsh_config_file=cygwin32 |
---|
218 | ;; |
---|
219 | |
---|
220 | ## mips-compaq-nonstopux |
---|
221 | *-*-nonstopux) |
---|
222 | tcsh_config_file=sysv4 |
---|
223 | ;; |
---|
224 | |
---|
225 | ## Apollo Domain/OS |
---|
226 | *-apollo-*) |
---|
227 | tcsh_config_file=apollo |
---|
228 | ;; |
---|
229 | |
---|
230 | * ) |
---|
231 | changequote([, ])dnl |
---|
232 | AC_MSG_ERROR([Tcsh can't guess the configuration file name |
---|
233 | for `${host}' systems. |
---|
234 | Check tcsh's `Ported' file for manual configuration instructions.]) |
---|
235 | changequote(, )dnl |
---|
236 | ;; |
---|
237 | |
---|
238 | esac |
---|
239 | |
---|
240 | echo "Tcsh will use configuration file \`$tcsh_config_file'." |
---|
241 | changequote([, ])dnl |
---|
242 | cp ${srcdir}/config/${tcsh_config_file} config_p.h |
---|
243 | AH_BOTTOM( |
---|
244 | [#include "config_p.h" |
---|
245 | #include "config_f.h"]) |
---|
246 | |
---|
247 | dnl Checks for programs |
---|
248 | AC_PROG_CC |
---|
249 | AC_PROG_CPP |
---|
250 | AC_PROG_GCC_TRADITIONAL |
---|
251 | |
---|
252 | if test "x$GCC" != xyes ; then |
---|
253 | DFLAGS="$DFLAGS $NON_GNU_DFLAGS" |
---|
254 | CFLAGS="$CFLAGS $NON_GNU_CFLAGS" |
---|
255 | fi |
---|
256 | |
---|
257 | dnl Checks for libraries |
---|
258 | AC_SEARCH_LIBS(crypt, crypt) |
---|
259 | AC_SEARCH_LIBS(getspnam, sec) |
---|
260 | AC_SEARCH_LIBS(tgetent, termlib termcap curses ncurses) |
---|
261 | AC_SEARCH_LIBS(gethostbyname, nsl) |
---|
262 | AC_SEARCH_LIBS(connect, socket) |
---|
263 | AC_SEARCH_LIBS([iconv], [iconv], [AC_DEFINE([HAVE_ICONV], [1], |
---|
264 | [Define to 1 if you have the iconv () interface])]) |
---|
265 | |
---|
266 | dnl Checks for header files |
---|
267 | AC_CHECK_HEADERS([auth.h inttypes.h shadow.h stdint.h]) |
---|
268 | AC_CHECK_HEADERS([utmpx.h utmp.h]) |
---|
269 | AC_CHECK_HEADERS([wchar.h], |
---|
270 | [AC_CHECK_SIZEOF([wchar_t], [], [dnl |
---|
271 | #include <stdio.h> |
---|
272 | #include <wchar.h>]) |
---|
273 | AC_CHECK_HEADERS([wctype.h])]) |
---|
274 | AC_HEADER_DIRENT |
---|
275 | AC_HEADER_STAT |
---|
276 | AC_HEADER_STDC |
---|
277 | |
---|
278 | dnl Checks for types |
---|
279 | AC_CHECK_TYPES([long long]) |
---|
280 | AC_TYPE_GETGROUPS |
---|
281 | AC_TYPE_MODE_T |
---|
282 | AC_TYPE_SIGNAL |
---|
283 | AC_TYPE_SIZE_T |
---|
284 | AC_TYPE_UID_T |
---|
285 | |
---|
286 | AC_DEFUN([AC_TYPE_SOCKLEN_T], [ |
---|
287 | AC_CHECK_TYPE(socklen_t,, |
---|
288 | AC_DEFINE(socklen_t, int, [Define to `int' if neither <sys/types.h> nor <sys/socket.h> define.]), |
---|
289 | [ |
---|
290 | #include <sys/types.h> |
---|
291 | #include <sys/socket.h> |
---|
292 | ]) |
---|
293 | ]) |
---|
294 | AC_TYPE_SOCKLEN_T |
---|
295 | |
---|
296 | |
---|
297 | dnl Checks for structures |
---|
298 | AC_CHECK_MEMBERS([struct dirent.d_ino], , , |
---|
299 | [#ifdef HAVE_DIRENT_H |
---|
300 | # include <dirent.h> |
---|
301 | #else |
---|
302 | # ifdef HAVE_NDIR_H |
---|
303 | # include <ndir.h> |
---|
304 | # else |
---|
305 | # include <sys/dir.h> |
---|
306 | # endif |
---|
307 | # define dirent direct |
---|
308 | #endif]) |
---|
309 | AC_CHECK_MEMBERS([struct utmp.ut_host, struct utmp.ut_user, struct utmp.ut_tv, |
---|
310 | struct utmp.ut_xtime], , , |
---|
311 | [#ifdef HAVE_UTMPX_H |
---|
312 | #include <utmpx.h> |
---|
313 | #define utmp utmpx |
---|
314 | #elif defined HAVE_UTMP_H |
---|
315 | #include <utmp.h> |
---|
316 | #endif]) |
---|
317 | AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family], , , |
---|
318 | [#include <sys/types.h> |
---|
319 | #include <sys/socket.h>]) |
---|
320 | |
---|
321 | dnl Checks for compiler characteristics |
---|
322 | AC_C_CONST |
---|
323 | AC_C_PROTOTYPES |
---|
324 | AC_C_VOLATILE |
---|
325 | |
---|
326 | dnl checks for library functions |
---|
327 | AC_CHECK_DECLS([gethostname]) |
---|
328 | AC_CHECK_FUNCS([dup2 getcwd gethostname getpwent getutent memmove memset] dnl |
---|
329 | [nice nl_langinfo sbrk setpgid setpriority strerror strstr sysconf] dnl |
---|
330 | [wcwidth]) |
---|
331 | AC_FUNC_GETPGRP |
---|
332 | AC_FUNC_SETPGRP |
---|
333 | |
---|
334 | dnl This is not good enough; we need sockaddr_storage too. |
---|
335 | dnl See whether we can use IPv6 related functions |
---|
336 | dnl AC_DEFUN([IPv6_CHECK_FUNC], [ |
---|
337 | dnl changequote(, )dnl |
---|
338 | dnl ac_tr_lib=HAVE_`echo $1 | sed -e 's/[^a-zA-Z0-9_]/_/g' \ |
---|
339 | dnl -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'` |
---|
340 | dnl changequote([, ])dnl |
---|
341 | dnl AC_CHECK_FUNC($1, [dnl |
---|
342 | dnl AC_DEFINE_UNQUOTED($ac_tr_lib) |
---|
343 | dnl ac_cv_lib_inet6_$1=no], [dnl |
---|
344 | dnl AC_MSG_CHECKING([whether your system has IPv6 directory]) |
---|
345 | dnl AC_CACHE_VAL(ipv6_cv_dir, [dnl |
---|
346 | dnl for ipv6_cv_dir in /usr/local/v6 /usr/inet6 no; do |
---|
347 | dnl if test $ipv6_cv_dir = no -o -d $ipv6_cv_dir; then |
---|
348 | dnl break |
---|
349 | dnl fi |
---|
350 | dnl done])dnl |
---|
351 | dnl AC_MSG_RESULT($ipv6_cv_dir) |
---|
352 | dnl if test $ipv6_cv_dir = no; then |
---|
353 | dnl ac_cv_lib_inet6_$1=no |
---|
354 | dnl else |
---|
355 | dnl if test x$ipv6_libinet6 = x; then |
---|
356 | dnl ipv6_libinet6=no |
---|
357 | dnl SAVELDFLAGS="$LDFLAGS" |
---|
358 | dnl LDFLAGS="-L$ipv6_cv_dir/lib" |
---|
359 | dnl fi |
---|
360 | dnl AC_CHECK_LIB(inet6, $1, [dnl |
---|
361 | dnl AC_DEFINE_UNQUOTED($ac_tr_lib) |
---|
362 | dnl if test $ipv6_libinet6 = no; then |
---|
363 | dnl ipv6_libinet6=yes |
---|
364 | dnl LIBS="$LIBS -linet6" |
---|
365 | dnl fi],)dnl |
---|
366 | dnl if test $ipv6_libinet6 = no; then |
---|
367 | dnl LDFLAGS="$SAVELDFLAGS" |
---|
368 | dnl fi |
---|
369 | dnl fi])dnl |
---|
370 | dnl if test $ac_cv_func_$1 = yes -o $ac_cv_lib_inet6_$1 = yes |
---|
371 | dnl then |
---|
372 | dnl ipv6_cv_$1=yes |
---|
373 | dnl ifelse([$2], , :, [$2]) |
---|
374 | dnl else |
---|
375 | dnl ipv6_cv_$1=no |
---|
376 | dnl ifelse([$3], , :, [$3]) |
---|
377 | dnl fi]) |
---|
378 | dnl IPv6_CHECK_FUNC(getnameinfo, DFLAGS="$DFLAGS -DINET6") |
---|
379 | |
---|
380 | AC_SUBST(DFLAGS) |
---|
381 | |
---|
382 | AC_ARG_WITH(hesiod, |
---|
383 | [ --with-hesiod=PREFIX Use Hesiod lookup for ~ expansion], |
---|
384 | [hesiod="$withval"], [hesiod=no]) |
---|
385 | if test "$hesiod" != no; then |
---|
386 | HESLIB="-lhesiod" |
---|
387 | AC_CHECK_FUNC(res_send, :, |
---|
388 | AC_CHECK_LIB(resolv, res_send, HESLIB="$HESLIB -lresolv")) |
---|
389 | HESDEF=-DHESIOD |
---|
390 | if test "$hesiod" != yes; then |
---|
391 | HESDEF="$HESDEF -I$hesiod/include" |
---|
392 | HESLIB="-L$hesiod/lib $HESLIB" |
---|
393 | fi |
---|
394 | fi |
---|
395 | AC_SUBST(HESDEF) |
---|
396 | AC_SUBST(HESLIB) |
---|
397 | |
---|
398 | AC_SUBST(lbindir) |
---|
399 | AC_CONFIG_FILES([Makefile]) |
---|
400 | AC_OUTPUT |
---|