Commit | Line | Data |
---|---|---|
8286cffa WJ |
1 | : |
2 | # Guess values for system-dependent variables and create `Makefile'. | |
3 | # Copyright (C) 1991 Free Software Foundation, Inc. | |
4 | ||
5 | # This program is free software; you can redistribute it and/or modify | |
6 | # it under the terms of the GNU General Public License as published by | |
7 | # the Free Software Foundation; either version 2, or (at your option) | |
8 | # any later version. | |
9 | ||
10 | # This program is distributed in the hope that it will be useful, | |
11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
13 | # GNU General Public License for more details. | |
14 | ||
15 | # You should have received a copy of the GNU General Public License | |
16 | # along with this program; if not, write to the Free Software | |
17 | # Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | |
18 | ||
19 | # Usage: | |
20 | #configure [--srcdir=DIR] [--prefix=DIR] [--host=HOST] [--gas] [--nfp] [TARGET] | |
21 | #All args except --srcdir=DIR, --prefix=DIR, and --exec_prefix=DIR are ignored. | |
22 | ||
23 | # @(#)configure 1.26 92/04/10 | |
24 | ||
25 | trap 'rm -f conftest* core* uttest; exit 1' 1 2 3 15 | |
26 | ||
27 | # Uncomment out the next line if your sh aborts if an unset variable | |
28 | # is referenced; some popular systems do not understand +u and most | |
29 | # bourne shells should already have this set as the default... | |
30 | #set +u | |
31 | ||
32 | # Make sure we don't find the System V /etc/install. | |
33 | PATH=`echo $PATH|sed ' | |
34 | s,^:,|, | |
35 | s,:$,|, | |
36 | s,:/usr/etc\([:|]\),\1,g | |
37 | s,:/usr/etc$,,g | |
38 | s,\([:|]\)/usr/etc:,\1,g | |
39 | s,^/usr/etc:,,g | |
40 | s,:/usr/sbin\([:|]\),\1,g | |
41 | s,:/usr/sbin$,,g | |
42 | s,\([:|]\)/usr/sbin:,\1,g | |
43 | s,^/usr/sbin:,,g | |
44 | s,:/etc\([:|]\),\1,g | |
45 | s,:/etc$,,g | |
46 | s,\([:|]\)/etc:,\1,g | |
47 | s,^/etc:,,g | |
48 | s,|,:,g'` | |
49 | ||
50 | # A filename unique to this package, relative to the directory that | |
51 | # configure is in, which we can look for to find out if srcdir is correct. | |
52 | unique_file=src/update.c | |
53 | ||
54 | # Default destination directory is /usr/local | |
55 | # Binaries go in "bin", libraries in "lib", manual pages in "man". | |
56 | prefix=/usr/local | |
57 | ||
58 | for arg in $*; do | |
59 | # Handle --srcdir with a space before the argument. | |
60 | if [ x$next_srcdir = xyes ]; then srcdir=$arg; next_srcdir= | |
61 | # Handle --prefix with a space before the argument. | |
62 | elif [ x$next_prefix = xyes ]; then prefix=$arg; next_prefix= | |
63 | # Handle --exec_prefix with a space before the argument. | |
64 | elif [ x$next_exec_prefix = xyes ]; then exec_prefix=$arg; next_prefix= | |
65 | # Handle --host with a space before the argument. | |
66 | elif [ x$next_host = xyes ]; then next_host= | |
67 | else | |
68 | case $arg in | |
69 | -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*) | |
70 | srcdir=`echo $arg | sed 's/^[-a-z]*=//'` ;; | |
71 | -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s) | |
72 | next_srcdir=yes ;; | |
73 | -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) | |
74 | prefix=`echo $arg | sed 's/^[-a-z]*=//'` ;; | |
75 | -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) | |
76 | next_prefix=yes ;; | |
77 | -exec_prefix=* | --exec_prefix=* | --exec_prefi=* | --exec_pref=* | --exec_pre=* | --exec_pr=* | --exec_p=* | --exec_=* | --exec=* | --exe=* | --ex=* | --e=*) | |
78 | exec_prefix=`echo $arg | sed 's/^[-a-z_]*=//'` ;; | |
79 | -exec_prefix | --exec_prefix | --exec_prefi | --exec_pref | --exec_pre | --exec_pr | --exec_p | --exec_ | --exec | --exe | --ex | --e) | |
80 | next_exec_prefix=yes ;; | |
81 | -host=* | --host=* | --hos=* | --ho=* | --h=*) ;; | |
82 | -host | --host | --hos | --ho | --h) | |
83 | next_host=yes ;; | |
84 | -gas | --gas | --ga | --g) ;; | |
85 | -nfp | --nfp | --nf | --n) ;; | |
86 | *) ;; | |
87 | esac | |
88 | fi | |
89 | done | |
90 | ||
91 | if [ -z "${exec_prefix}" ] ; then exec_prefix=${prefix} ; fi | |
92 | ||
93 | vpsub='s@\$\([-./a-zA-Z0-9]*\)<@\1@g' | |
94 | # Find the source files, if location was not specified. | |
95 | if [ x$srcdir = x ]; then | |
96 | srcdirdefaulted=yes; srcdir=. | |
97 | if [ ! -r $unique_file ]; then srcdir=`pwd`/..; fi | |
98 | fi | |
99 | if [ $srcdir != . ]; then | |
100 | VPATH='VPATH = $(srcdir)' | |
101 | vpsub='s@\$\([-./a-zA-Z0-9]*\)<@\$<@g' | |
102 | fi | |
103 | ||
104 | if [ ! -r $srcdir/$unique_file ]; then | |
105 | if [ x$srcdirdefaulted = xyes ]; then | |
106 | echo "$0: Can not find sources in \`.' or \`..'." 1>&2 | |
107 | else | |
108 | echo "$0: Can not find sources in \`${srcdir}'." 1>&2 | |
109 | fi | |
110 | exit 1 | |
111 | fi | |
112 | ||
113 | if grep '^#.*define.*MY_NDBM' ${srcdir}/src/config.h >/dev/null 2>/dev/null; then : | |
114 | CC1=gcc | |
115 | CC2=cc | |
116 | else | |
117 | CC1=cc | |
118 | CC2=gcc | |
119 | fi | |
120 | ||
121 | if test "$RANDOM" = "$RANDOM"; then | |
122 | # Plain old Bourne shell. | |
123 | if test -z "$CC"; then | |
124 | echo checking for cc/gcc | |
125 | test -n "`$CC1 / 2>&1`" && CC="$CC1" | |
126 | if test -z "$CC"; then | |
127 | test -n "`$CC2 2>&1`" && CC="$CC2" | |
128 | fi | |
129 | fi | |
130 | ||
131 | echo checking for install | |
132 | if test -z "$INSTALL" && test -n "`install 2>&1`"; then | |
133 | INSTALL="install -c" | |
134 | INSTALLDATA="install -c -m 644" | |
135 | fi | |
136 | ||
137 | echo checking for ranlib | |
138 | test -z "$RANLIB" && test -n "`ranlib conftest 2>&1`" && RANLIB=ranlib | |
139 | rm -f conftest* | |
140 | ||
141 | echo checking for bison/yacc | |
142 | test -z "$YACC" && test -n "`bison 2>&1`" && YACC="bison -y" | |
143 | else | |
144 | # ksh, bash or zsh. ksh and zsh write "command not found" to stderr. | |
145 | if test -z "$CC"; then | |
146 | echo checking for cc/gcc | |
147 | type $CC1 && CC="$CC1" | |
148 | test -z "$CC" && type $CC2 && CC="$CC2" | |
149 | fi | |
150 | ||
151 | echo checking for install | |
152 | if test -z "$INSTALL" && type install; then | |
153 | INSTALL="install -c" | |
154 | INSTALLDATA="install -c -m 644" | |
155 | fi | |
156 | ||
157 | echo checking for ranlib | |
158 | test -z "$RANLIB" && type ranlib && RANLIB=ranlib | |
159 | ||
160 | echo checking for bison/yacc | |
161 | test -z "$YACC" && type bison && YACC="bison -y" | |
162 | fi | |
163 | ||
164 | CC=${CC-cc} | |
165 | INSTALL=${INSTALL-cp} | |
166 | INSTALLDATA=${INSTALLDATA-cp} | |
167 | RANLIB=${RANLIB-echo} | |
168 | YACC=${YACC-yacc} | |
169 | ||
170 | rm -f conftest* | |
171 | compile='$CC $DEFS $TDEFS conftest.c -o conftest $TLIBS $LIBS >/dev/null 2>&1' | |
172 | ||
173 | # Check for various header files. | |
174 | ||
175 | echo checking for Minix | |
176 | if test -d /usr/include/minix; then | |
177 | DEFS="$DEFS -UUSG -D_POSIX_SOURCE -D_POSIX_1_SOURCE=2 -D_POSIX_C_SOURCE=2 -D_MINIX" | |
178 | else | |
179 | echo checking for BSD string and memory functions | |
180 | echo " | |
181 | #include <strings.h> | |
182 | main() { exit(0); } t() { rindex(0, 0); bzero(0, 0); }" > conftest.c | |
183 | eval $compile | |
184 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then : | |
185 | else DEFS="$DEFS -DUSG" | |
186 | fi | |
187 | rm -f conftest* | |
188 | fi | |
189 | ||
190 | echo checking signal handler return type | |
191 | echo " | |
192 | #include <sys/types.h> | |
193 | #include <signal.h> | |
194 | void foo() { exit(0); } | |
195 | main() { exit(0); } t() { signal(SIGINT, foo); kill(getpid(), SIGINT); }" > conftest.c | |
196 | eval $compile | |
197 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then : | |
198 | else DEFS="$DEFS -DSIGTYPE=int" | |
199 | fi | |
200 | rm -f conftest* | |
201 | ||
202 | echo checking for directory library header | |
203 | echo ' | |
204 | #include <sys/types.h> | |
205 | #ifdef DIRENT | |
206 | #include <dirent.h> | |
207 | #ifdef direct | |
208 | #undef direct | |
209 | #endif | |
210 | #define direct dirent | |
211 | #else | |
212 | #ifdef SYSNDIR | |
213 | #include <sys/ndir.h> | |
214 | #else | |
215 | #ifdef NDIR | |
216 | #include <ndir.h> | |
217 | #else /* must be BSD */ | |
218 | #include <sys/dir.h> | |
219 | #endif | |
220 | #endif | |
221 | #endif | |
222 | main() { DIR *d = opendir("."); | |
223 | struct direct *e; | |
224 | while ((e = readdir(d))) | |
225 | if (strcmp(e->d_name, "conftestfile") == 0) | |
226 | exit(0); | |
227 | exit(1); | |
228 | }' > conftest.c | |
229 | > conftestfile | |
230 | TDEFS=-DDIRENT | |
231 | eval $compile | |
232 | TDEFS= | |
233 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then | |
234 | DEFS="$DEFS -DDIRENT" | |
235 | else | |
236 | rm -f conftest | |
237 | TDEFS=-DDIRENT | |
238 | TLIBS=-ldir | |
239 | eval $compile | |
240 | TDEFS= | |
241 | TLIBS= | |
242 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then | |
243 | DEFS="$DEFS -DDIRENT" | |
244 | LIBS="-ldir $LIBS" | |
245 | else | |
246 | rm -f conftest | |
247 | TDEFS=-DSYSNDIR | |
248 | eval $compile | |
249 | TDEFS= | |
250 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then | |
251 | DEFS="$DEFS -DSYSNDIR" | |
252 | else | |
253 | rm -f conftest | |
254 | TDEFS=-DSYSNDIR | |
255 | TLIBS=-lx | |
256 | eval $compile | |
257 | TDEFS= | |
258 | TLIBS= | |
259 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then | |
260 | DEFS="$DEFS -DSYSNDIR" | |
261 | LIBS="$LIBS -lx" | |
262 | else | |
263 | rm -f conftest | |
264 | TDEFS=-DNDIR | |
265 | eval $compile | |
266 | TDEFS= | |
267 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then | |
268 | DEFS="$DEFS -DNDIR" | |
269 | else | |
270 | eval $compile | |
271 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then : | |
272 | else | |
273 | echo >&2 "configure: opendir() is missing; cannot continue" | |
274 | rm -f conftest* | |
275 | exit 1 | |
276 | fi | |
277 | fi | |
278 | fi | |
279 | fi | |
280 | fi | |
281 | fi | |
282 | rm -f foo conftest* | |
283 | ||
284 | echo checking for ANSI C header files | |
285 | echo "#include <stddef.h> | |
286 | #include <stdlib.h> | |
287 | #include <string.h> | |
288 | main() { exit(0); }" > conftest.c | |
289 | eval $compile | |
290 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then | |
291 | DEFS="$DEFS -DSTDC_HEADERS" | |
292 | fi | |
293 | rm -f conftest* | |
294 | ||
295 | echo checking for POSIX.1 header files | |
296 | echo "#include <unistd.h> | |
297 | main() { | |
298 | #ifdef _POSIX_VERSION | |
299 | exit(0); | |
300 | #else | |
301 | exit(1); | |
302 | #endif | |
303 | }" > conftest.c | |
304 | eval $compile | |
305 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then | |
306 | DEFS="$DEFS -DPOSIX" | |
307 | fi | |
308 | rm -f conftest* | |
309 | ||
310 | echo checking for uid_t in sys/types.h | |
311 | echo "#include <sys/types.h> | |
312 | main() { exit(0); } t() { uid_t x; }" > conftest.c | |
313 | eval $compile | |
314 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then : | |
315 | else | |
316 | DEFS="$DEFS -Duid_t=int -Dgid_t=int" | |
317 | fi | |
318 | rm -f conftest* | |
319 | ||
320 | echo checking for mode_t in sys/types.h | |
321 | echo "#include <sys/types.h> | |
322 | main() { exit(0); } t() { mode_t x; }" > conftest.c | |
323 | eval $compile | |
324 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then : | |
325 | else | |
326 | DEFS="$DEFS -Dmode_t=int" | |
327 | fi | |
328 | rm -f conftest* | |
329 | ||
330 | echo checking for size_t in sys/types.h | |
331 | echo "#include <sys/types.h> | |
332 | main() { exit(0); } t() { size_t x; }" > conftest.c | |
333 | eval $compile | |
334 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then : | |
335 | else | |
336 | DEFS="$DEFS -Dsize_t=unsigned" | |
337 | fi | |
338 | rm -f conftest* | |
339 | ||
340 | echo checking for unsigned characters | |
341 | echo 'main() { char c = 255; exit(c < 0); }' > conftest.c | |
342 | eval $compile | |
343 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then | |
344 | DEFS="$DEFS -D__CHAR_UNSIGNED__" | |
345 | fi | |
346 | rm -f conftest* | |
347 | ||
348 | echo checking whether time.h has struct tm | |
349 | echo '#include <sys/types.h> | |
350 | #include <time.h> | |
351 | main() { struct tm *tp; exit(0); }' > conftest.c | |
352 | eval $compile | |
353 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then : | |
354 | else DEFS="$DEFS -DTM_IN_SYS_TIME" | |
355 | fi | |
356 | rm -f conftest* | |
357 | ||
358 | # Check whether various functions exist. | |
359 | ||
360 | # Functions we provide replacements for. | |
361 | for func in fnmatch getwd mkdir rename strdup | |
362 | do | |
363 | echo checking for $func | |
364 | echo "main() { exit(0); } t() { ${func}(); }" > conftest.c | |
365 | eval $compile | |
366 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then : | |
367 | else LIBOBJS="$LIBOBJS ${func}.o" | |
368 | fi | |
369 | rm -f conftest* | |
370 | done | |
371 | ||
372 | func=gethostname | |
373 | echo checking for $func | |
374 | echo "main() { exit(0); } t() { ${func}(); }" > conftest.c | |
375 | eval $compile | |
376 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then : | |
377 | else LIBOBJS="$LIBOBJS hostname.o" | |
378 | fi | |
379 | rm -f conftest* | |
380 | ||
381 | func=re_exec | |
382 | echo checking for $func | |
383 | echo "main() { exit(0); } t() { ${func}(); }" > conftest.c | |
384 | eval $compile | |
385 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then : | |
386 | else LIBOBJS="$LIBOBJS regex.o" | |
387 | fi | |
388 | rm -f conftest* | |
389 | ||
390 | func=dup2 | |
391 | echo checking for $func | |
392 | echo "main() { exit(0); } t() { ${func}(); }" > conftest.c | |
393 | eval $compile | |
394 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then : | |
395 | else LIBOBJS="$LIBOBJS dup2.o" | |
396 | fi | |
397 | rm -f conftest* | |
398 | ||
399 | # Functions whose absence we work around. | |
400 | for func in fchmod fsync ftime mkfifo putenv strerror setvbuf vfork vprintf | |
401 | do | |
402 | echo checking for $func | |
403 | echo "main() { exit(0); } t() { ${func}(); }" > conftest.c | |
404 | eval $compile | |
405 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then : | |
406 | else DEFS="$DEFS -D`echo $func|tr '[a-z]' '[A-Z]'`_MISSING" | |
407 | fi | |
408 | rm -f conftest* | |
409 | done | |
410 | ||
411 | echo checking for timeb.h header file | |
412 | echo ' | |
413 | #include <stdio.h> | |
414 | #include <sys/types.h> | |
415 | #ifdef TM_IN_SYS_TIME | |
416 | #include <sys/time.h> | |
417 | #else | |
418 | #include <time.h> | |
419 | #endif | |
420 | #include <sys/timeb.h> | |
421 | main() { exit(0); } t() { struct timeb tb; printf("%d", sizeof(tb)); }' > conftest.c | |
422 | eval $compile | |
423 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then : | |
424 | else | |
425 | DEFS="$DEFS -DTIMEB_H_MISSING" | |
426 | fi | |
427 | rm -f conftest* | |
428 | ||
429 | case "$DEFS" in | |
430 | *VPRINTF_MISSING*) | |
431 | func=_doprnt | |
432 | echo checking for $func | |
433 | echo "main() { exit(0); } t() { ${func}(); }" > conftest.c | |
434 | eval $compile | |
435 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then : | |
436 | else DEFS="$DEFS -DDOPRNT_MISSING" | |
437 | fi | |
438 | rm -f conftest* | |
439 | ;; | |
440 | esac | |
441 | ||
442 | case "$DEFS" in | |
443 | *FTIME_MISSING*) | |
444 | echo checking for timezone | |
445 | echo "main() { extern char *timezone(); printf(\"%s\",timezone(0,0)); exit(0); }" > conftest.c | |
446 | eval $compile | |
447 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then | |
448 | DEFS="$DEFS -DHAVE_TIMEZONE" | |
449 | fi | |
450 | rm -f conftest* core* | |
451 | ;; | |
452 | esac | |
453 | ||
454 | case "$DEFS" in | |
455 | *POSIX*) | |
456 | ;; | |
457 | *) | |
458 | echo checking for BSD signals | |
459 | echo " | |
460 | #include <signal.h> | |
461 | main() { exit(0); } t() { sigvec(); sigblock(); }" > conftest.c | |
462 | eval $compile | |
463 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then | |
464 | DEFS="$DEFS -DBSD_SIGNALS" | |
465 | fi | |
466 | rm -f conftest* | |
467 | ;; | |
468 | esac | |
469 | ||
470 | func=ftruncate | |
471 | echo checking for $func | |
472 | echo "main() { exit(0); } t() { ${func}(); }" > conftest.c | |
473 | eval $compile | |
474 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then : | |
475 | else | |
476 | rm -f conftest* | |
477 | echo " | |
478 | #include <sys/types.h> | |
479 | #include <fcntl.h> | |
480 | main() { exit(0); } | |
481 | #if !defined(F_CHSIZE) && !defined(F_FREESP) | |
482 | t() { chsize(); } | |
483 | #endif | |
484 | " > conftest.c | |
485 | eval $compile | |
486 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then | |
487 | LIBOBJS="$LIBOBJS ${func}.o" | |
488 | else DEFS="$DEFS -D`echo $func|tr '[a-z]' '[A-Z]'`_MISSING" | |
489 | fi | |
490 | fi | |
491 | rm -f conftest* | |
492 | ||
493 | # Check other misc. things. | |
494 | ||
495 | echo checking utime with null argument | |
496 | rm -f uttest; > uttest | |
497 | # Sequent interprets utime(file, 0) to mean use start of epoch. Wrong. | |
498 | echo '#include <sys/types.h> | |
499 | #include <sys/stat.h> | |
500 | main() { | |
501 | struct stat s, t; | |
502 | exit(!(stat ("uttest", &s) == 0 && utime("uttest", (long *)0) == 0 | |
503 | && stat("uttest", &t) == 0 && t.st_mtime - s.st_mtime < 120)); | |
504 | }' > conftest.c | |
505 | eval $compile | |
506 | test -s conftest && (./conftest) >/dev/null 2>/dev/null || DEFS="$DEFS -DUTIME_NULL_MISSING" | |
507 | rm -f conftest* core* uttest | |
508 | ||
509 | case "$LIBOBJS" in | |
510 | *rename.o*) | |
511 | LIBPROGS="$LIBPROGS mvdir" | |
512 | DEFS="$DEFS -DMVDIR="'\\"$(libdir)/mvdir\\"' | |
513 | ;; | |
514 | esac | |
515 | ||
516 | echo checking how to get alloca | |
517 | echo ' | |
518 | #ifdef __GNUC__ | |
519 | #define alloca __builtin_alloca | |
520 | #else | |
521 | #ifdef sparc | |
522 | #include <alloca.h> | |
523 | #else | |
524 | #ifdef _AIX | |
525 | #pragma alloca | |
526 | #else | |
527 | char *alloca (); | |
528 | #endif | |
529 | #endif | |
530 | #endif | |
531 | main() { char *p = (char *) alloca(1); exit(0); }' > conftest.c | |
532 | eval $compile | |
533 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then : | |
534 | else | |
535 | # I've had some problems with this stuff. If you need -lPW for some | |
536 | # reason, try uncommenting the lines below | |
537 | # rm -f conftest* | |
538 | # echo 'char *alloca(); | |
539 | #main() { char *p = alloca(1); exit(0); }' > conftest.c | |
540 | # eval $compile -lPW | |
541 | # if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then LIBS="$LIBS -lPW" | |
542 | # else | |
543 | LIBOBJS="$LIBOBJS alloca.o" | |
544 | # fi | |
545 | fi | |
546 | rm -f conftest* | |
547 | ||
548 | if grep '^#.*define.*MY_NDBM' ${srcdir}/src/config.h >/dev/null 2>/dev/null; then : | |
549 | else | |
550 | echo checking for ndbm support | |
551 | echo '#include <ndbm.h> | |
552 | main() { exit(0); } t() { dbm_open(0); dbm_close(0); }' > conftest.c | |
553 | eval $compile | |
554 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then : | |
555 | else | |
556 | TLIBS=-lgdbm | |
557 | eval $compile | |
558 | TLIBS= | |
559 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then | |
560 | LIBS="$LIBS -lgdbm" | |
561 | else | |
562 | TDEFS="-I${prefix}/include" | |
563 | TLIBS="-L${prefix}/lib -lgdbm" | |
564 | eval $compile | |
565 | TDEFS= | |
566 | TLIBS= | |
567 | if test -s conftest && (./conftest) >/dev/null 2>/dev/null; then | |
568 | DEFS="$DEFS -I${prefix}/include" | |
569 | LIBS="$LIBS -L${prefix}/lib -lgdbm" | |
570 | else | |
571 | echo 'configure: Warning: you will likely have to install GNU dbm' | |
572 | echo ' (including the <ndbm.h> header file)' | |
573 | echo ' and re-run this configure script' | |
574 | fi | |
575 | fi | |
576 | fi | |
577 | rm -f conftest* | |
578 | fi | |
579 | ||
580 | echo checking for $CC -g -O combination | |
581 | echo "main() { exit(0); }" > conftest.c | |
582 | if test -n "`$CC -g -O -o conftest conftest.c 2>&1`"; then | |
583 | if test -n "`$CC -g -o conftest conftest.c 2>&1`"; then | |
584 | CDEBUG= | |
585 | else | |
586 | CDEBUG="-g" | |
587 | fi | |
588 | else | |
589 | CDEBUG="-g -O" | |
590 | fi | |
591 | rm -f conftest* | |
592 | ||
593 | trap 'rm -f Makefile lib/Makefile src/Makefile man/Makefile doc/Makefile examples/Makefile contrib/Makefile config.status conftest*; exit 1' 1 2 3 15 | |
594 | ||
595 | for dir in . lib src man doc examples contrib | |
596 | do | |
597 | test -d $dir || mkdir $dir | |
598 | if test "$srcdir" = "."; then | |
599 | xsrcdir="." | |
600 | includeopt= | |
601 | else | |
602 | case $srcdir in | |
603 | /*) | |
604 | xsrcdir=$srcdir/$dir | |
605 | includeopt="-I$srcdir/lib" | |
606 | ;; | |
607 | *) | |
608 | xsrcdir=../$srcdir/$dir | |
609 | includeopt="-I../$srcdir/lib" | |
610 | ;; | |
611 | esac | |
612 | if test "$dir" = "."; then | |
613 | xsrcdir=$srcdir | |
614 | fi | |
615 | fi | |
616 | echo '# Generated automatically from Makefile.in by configure.' > $dir/Makefile | |
617 | sed -e " | |
618 | $vpsub | |
619 | s,@srcdir@,$xsrcdir, | |
620 | s,@prefix@,$prefix, | |
621 | s,@exec_prefix@,$exec_prefix, | |
622 | s,@includeopt@,$includeopt, | |
623 | s,@VPATH@,$VPATH, | |
624 | s,@CC@,$CC, | |
625 | s,@RANLIB@,$RANLIB, | |
626 | s,@YACC@,$YACC, | |
627 | s,@INSTALL@,$INSTALL, | |
628 | s,@INSTALLDATA@,$INSTALLDATA, | |
629 | s,@DEFS@,$DEFS, | |
630 | s,@LIBS@,$LIBS, | |
631 | s,@LIBPROGS@,$LIBPROGS, | |
632 | s,@LIBOBJS@,$LIBOBJS, | |
633 | s,@CDEBUG@,$CDEBUG, | |
634 | " $srcdir/$dir/Makefile.in >> $dir/Makefile | |
635 | done | |
636 | ||
637 | echo "srcdir = $srcdir | |
638 | prefix = $prefix | |
639 | exec_prefix = $exec_prefix | |
640 | includeopt = $includeopt | |
641 | VPATH = $VPATH | |
642 | CC = $CC | |
643 | RANLIB = $RANLIB | |
644 | YACC = $YACC | |
645 | INSTALL = $INSTALL | |
646 | INSTALLDATA = $INSTALLDATA | |
647 | DEFS = $DEFS | |
648 | LIBS = $LIBS | |
649 | LIBPROGS = $LIBPROGS | |
650 | LIBOBJS = $LIBOBJS | |
651 | CDEBUG = $CDEBUG" > config.status |