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.12)dnl Minimum Autoconf version required. |
---|
12 | AC_INIT(tc.vers.c) |
---|
13 | |
---|
14 | tcsh_configure_args="$@" |
---|
15 | # Shift out arguments leaving the optional platform name. |
---|
16 | while test -n "$1" ; do |
---|
17 | case "$1" in |
---|
18 | -*) shift ;; |
---|
19 | *) break ;; |
---|
20 | esac |
---|
21 | done |
---|
22 | |
---|
23 | AC_MSG_CHECKING(for the canonical name of this system) |
---|
24 | if test "$1" = '' ; then |
---|
25 | PATH=$srcdir:$PATH # Prefer the tcsh source directory, it might be there. |
---|
26 | export PATH |
---|
27 | new_canonical=`(config.guess) 2>/dev/null` || new_canonical=unknown |
---|
28 | else |
---|
29 | new_canonical="$1" |
---|
30 | fi |
---|
31 | AC_CACHE_VAL(tcsh_cv_canonical, tcsh_cv_canonical=${new_canonical}) |
---|
32 | AC_MSG_RESULT($tcsh_cv_canonical) |
---|
33 | |
---|
34 | if test "$tcsh_cv_canonical" != "$new_canonical" |
---|
35 | then |
---|
36 | AC_MSG_WARN([Cache configured for \`${tcsh_cv_canonical}'.]) |
---|
37 | AC_MSG_WARN([This system is \`${new_canonical}'.]) |
---|
38 | AC_MSG_WARN([Assuming invalid cache - removing \`${cache_file}'.]) |
---|
39 | AC_MSG_WARN([Restarting...]) |
---|
40 | rm -f "$cache_file" |
---|
41 | exec ${CONFIG_SHELL-/bin/sh} $0 "$tcsh_configure_args" |
---|
42 | fi |
---|
43 | |
---|
44 | changequote(, )dnl |
---|
45 | |
---|
46 | case "${tcsh_cv_canonical}" in |
---|
47 | |
---|
48 | ## Alpha (DEC) machines. |
---|
49 | alpha-dec-osf* ) |
---|
50 | tcsh_config_file=decosf1 |
---|
51 | ;; |
---|
52 | |
---|
53 | ## Ultrix |
---|
54 | *-dec-ultrix* ) |
---|
55 | tcsh_config_file=ultrix |
---|
56 | ;; |
---|
57 | |
---|
58 | ## DGUX |
---|
59 | *-dg-dguxR4* ) |
---|
60 | tcsh_config_file=dgux5.4 |
---|
61 | ;; |
---|
62 | m88k-dg-dgux5.4R* ) |
---|
63 | tcsh_config_file=dgux5.4 |
---|
64 | ;; |
---|
65 | |
---|
66 | ## HP/UX |
---|
67 | *-hp-hpux7* ) |
---|
68 | tcsh_config_file=hpux7 |
---|
69 | ;; |
---|
70 | *-hp-hpux[89]* ) |
---|
71 | tcsh_config_file=hpux8 |
---|
72 | ;; |
---|
73 | *-hp-hpux10* ) |
---|
74 | tcsh_config_file=hpux8 |
---|
75 | ;; |
---|
76 | |
---|
77 | ## IBM AIX systems |
---|
78 | *-ibm-aix*) |
---|
79 | tcsh_config_file=aix |
---|
80 | ;; |
---|
81 | |
---|
82 | ## Linux |
---|
83 | *-*-linux* ) |
---|
84 | tcsh_config_file=linux |
---|
85 | ;; |
---|
86 | |
---|
87 | ## Motorola systems |
---|
88 | m68k-motorola-sysv* ) |
---|
89 | tcsh_config_file=sysV68 |
---|
90 | ;; |
---|
91 | m88k-motorola-sysv3* ) |
---|
92 | tcsh_config_file=sysV88 |
---|
93 | ;; |
---|
94 | |
---|
95 | ## NetBSD systems |
---|
96 | *-*-netbsd*) |
---|
97 | tcsh_config_file=bsd4.4 |
---|
98 | ;; |
---|
99 | |
---|
100 | ## FreeBSD systems |
---|
101 | *-*-freebsd*) |
---|
102 | tcsh_config_file=bsd4.4 |
---|
103 | ;; |
---|
104 | |
---|
105 | ## OpenBSD systems |
---|
106 | *-*-openbsd*) |
---|
107 | tcsh_config_file=bsd4.4 |
---|
108 | ;; |
---|
109 | |
---|
110 | ## BSDI systems |
---|
111 | *-*-bsdi*) |
---|
112 | tcsh_config_file=bsd4.4 |
---|
113 | ;; |
---|
114 | |
---|
115 | ## Silicon Graphics machines |
---|
116 | *-sgi-iri* ) |
---|
117 | tcsh_config_file=sgi |
---|
118 | NON_GNU_DFLAGS='-D__STDC__' |
---|
119 | case "${tcsh_cv_canonical}" in |
---|
120 | *-irix[34]*) |
---|
121 | LIBS='-lsun -lbsd -lc_s' |
---|
122 | ;; |
---|
123 | esac |
---|
124 | ;; |
---|
125 | |
---|
126 | ## Suns |
---|
127 | *-sun-sunos3* ) |
---|
128 | tcsh_config_file=sunos35 |
---|
129 | ;; |
---|
130 | *-sun-sunos4.0* ) |
---|
131 | tcsh_config_file=sunos40 |
---|
132 | ;; |
---|
133 | *-sun-sunos4.1.[12]* ) |
---|
134 | tcsh_config_file=sunos41 |
---|
135 | ;; |
---|
136 | *-sun-sunos4.1.[3456]* ) |
---|
137 | tcsh_config_file=sunos413 |
---|
138 | ;; |
---|
139 | *-*-solaris2.[01]* ) # Should handle sparc or x86 |
---|
140 | tcsh_config_file=sol2 |
---|
141 | ;; |
---|
142 | *-sun-solaris2.2* ) # Sparc only release |
---|
143 | tcsh_config_file=sol22 |
---|
144 | ;; |
---|
145 | *-sun-solaris2.3* ) # Sparc only release |
---|
146 | tcsh_config_file=sol23 |
---|
147 | ;; |
---|
148 | *-*-solaris2.[45]* ) # Should handle sparc, x86 and powerpc |
---|
149 | tcsh_config_file=sol24 |
---|
150 | ;; |
---|
151 | *-*-solaris2.[67]* ) # Should handle sparc, x86 and powerpc |
---|
152 | tcsh_config_file=sol26 |
---|
153 | ;; |
---|
154 | |
---|
155 | ## Dell SVR4 |
---|
156 | *-dell-sysv4* ) |
---|
157 | tcsh_config_file=sysv4 |
---|
158 | DFLAGS="$DFLAGS -DDELL" |
---|
159 | ;; |
---|
160 | |
---|
161 | ## SVR4 (Generic and otherwise) |
---|
162 | *-*-sysv4* ) |
---|
163 | tcsh_config_file=sysv4 |
---|
164 | ;; |
---|
165 | |
---|
166 | ## Tektronix systems |
---|
167 | m68k-tektronix-bsd* ) |
---|
168 | tcsh_config_file=bsd |
---|
169 | NON_GNU_DFLAGS='-DBSD -DUTek' |
---|
170 | ;; |
---|
171 | m88k-tektronix-sysv3* ) |
---|
172 | tcsh_config_file=tekXD88 |
---|
173 | ;; |
---|
174 | |
---|
175 | ## SCO |
---|
176 | *-sco3.2v5*) |
---|
177 | tcsh_config_file=sco32v5 |
---|
178 | ;; |
---|
179 | *-sco3.2v4*) |
---|
180 | tcsh_config_file=sco32v4 |
---|
181 | ;; |
---|
182 | *-sco3.2v2*) |
---|
183 | tcsh_config_file=sco32v2 |
---|
184 | ;; |
---|
185 | |
---|
186 | ## Siemens Nixdorf BS2000 |
---|
187 | bs2000-sni-posix) |
---|
188 | tcsh_config_file=bs2000 |
---|
189 | ;; |
---|
190 | ## Cray |
---|
191 | *-cray-unicos*) |
---|
192 | tcsh_config_file=cray |
---|
193 | ;; |
---|
194 | |
---|
195 | * ) |
---|
196 | changequote([, ])dnl |
---|
197 | AC_MSG_ERROR([Tcsh can't guess the configuration file name |
---|
198 | for \`${tcsh_cv_canonical}' systems. |
---|
199 | Check tcsh's \`Ported' file for manual configuration instructions.]) |
---|
200 | changequote(, )dnl |
---|
201 | ;; |
---|
202 | |
---|
203 | esac |
---|
204 | |
---|
205 | echo "Tcsh will use configuration file \`$tcsh_config_file'." |
---|
206 | changequote([, ])dnl |
---|
207 | |
---|
208 | AC_CONFIG_HEADER(config.h:config/${tcsh_config_file}:config.h.in) |
---|
209 | AC_PROG_CC |
---|
210 | AC_PROG_CPP |
---|
211 | AC_PROG_GCC_TRADITIONAL |
---|
212 | |
---|
213 | if test $ac_cv_prog_gcc = no ; then |
---|
214 | DFLAGS="$DFLAGS $NON_GNU_DFLAGS" |
---|
215 | CFLAGS="$CFLAGS $NON_GNU_CFLAGS" |
---|
216 | fi |
---|
217 | |
---|
218 | AC_CHECK_FUNC(crypt) |
---|
219 | if test $ac_cv_func_crypt = no; then |
---|
220 | AC_CHECK_LIB(crypt, crypt) |
---|
221 | fi |
---|
222 | AC_CHECK_LIB(termlib, tgetent) |
---|
223 | if test $ac_cv_lib_termlib_tgetent = no ; then |
---|
224 | AC_CHECK_LIB(curses, tgetent) |
---|
225 | if test $ac_cv_lib_curses_tgetent = no ; then |
---|
226 | AC_CHECK_LIB(termcap, tgetent) |
---|
227 | fi |
---|
228 | fi |
---|
229 | AC_CHECK_FUNC(gethostbyname) |
---|
230 | if test $ac_cv_func_gethostbyname = no; then |
---|
231 | AC_CHECK_LIB(nsl, gethostbyname) |
---|
232 | fi |
---|
233 | AC_CHECK_FUNC(connect) |
---|
234 | if test $ac_cv_func_connect = no; then |
---|
235 | AC_CHECK_LIB(socket, connect) |
---|
236 | fi |
---|
237 | AC_SUBST(DFLAGS) |
---|
238 | |
---|
239 | AC_CHECK_FUNC(res_send, :, AC_CHECK_LIB(resolv, res_send, HES_RES_LIB=-lresolv)) |
---|
240 | AC_SUBST(HES_RES_LIB) |
---|
241 | AC_SUBST(lbindir) |
---|
242 | |
---|
243 | AC_OUTPUT(Makefile) |
---|