Debian Codegraph @

unix/configure

raw ◀ ▶
3 Debian patches touch this file
1 :
2 #!/bin/sh -x
3 # The above : is necessary on some buggy systems.
4
5 # configure: Guess values for system-dependent variables
6 # Output the flag definitions to the file "flags".
7 #
8 # Parameters: $1 = $CC, $2 = $CFLAGS, $3 = $IZ_BZIP2
9 #
10 # This file is typically called from Makefile rather than executed
11 # from the command line.
12 #
13 # To construct zip automatically using this file, type
14 # "make -f unix/Makefile generic".
15 # If this fails, then type "make list" to get a list of special targets.
16
17 trap "rm -f conftest* core a.out; exit 1" 1 2 3 15
18
19 CC=${1-cc}
20 CFLAGS=${2-"-I. -DUNIX"}
•21 LFLAGS1=${LDFLAGS}
22 LFLAGS2=''
23 LN="ln -s"
24
25 CFLAGS_OPT=''
26
27 # bzip2
28 IZ_BZIP2=${3-}
29 CFLAGS_BZ=''
30
31
32 echo 'Check C compiler type (optimization options)'
33 # Sun C?
34 cat > conftest.c << _EOF_
35 int main()
36 {
37 #ifndef __SUNPRO_C
38 bad code
39 #endif
40 return 0;
41 }
42 _EOF_
43 $CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
44 if test $? -eq 0; then
45 CFLAGS_OPT='-xO3'
46 echo " Sun C ($CFLAGS_OPT)"
47 else
48 # Tru64 DEC/Compaq/HP C?
49 cat > conftest.c << _EOF_
50 int main()
51 {
52 #ifndef __DECC
53 bad code
54 #endif
55 return 0;
56 }
57 _EOF_
58 $CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
59 if test $? -eq 0; then
60 CFLAGS_OPT='-O3'
61 echo " DEC C ($CFLAGS_OPT)"
62 else
63 # HP-UX HP C?
64 cat > conftest.c << _EOF_
65 int main()
66 {
67 #ifdef __GNUC__
68 bad code
69 #endif
70 #ifndef __hpux
71 bad code
72 #endif
73 return 0;
74 }
75 _EOF_
76 $CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
77 if test $? -eq 0; then
78 # HP-UX, not GCC. Lame bundled or real ANSI compiler?
79 CFLAGS_OPT_TRY="+O3 +Onolimit"
80 $CC $CFLAGS $CFLAGS_OPT_TRY -c conftest.c 2>&1 | \
81 grep '(Bundled)' > /dev/null
82 if test $? -ne 0; then
83 CFLAGS_OPT="$CFLAGS_OPT_TRY"
84 echo " HP-UX ANSI C ($CFLAGS_OPT)"
85 else
86 echo ' HP-UX Bundled C (no opt)'
87 fi
88 else
89 # GNU C?
90 cat > conftest.c << _EOF_
91 int main()
92 {
93 #ifndef __GNUC__
94 bad code
95 #endif
96 return 0;
97 }
98 _EOF_
99 $CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
100 if test $? -eq 0; then
•101 # CFLAGS_OPT='-O3'
102 echo " GNU C ($CFLAGS_OPT)"
103 # Special Mac OS X shared library "ld" option?
104 if test ` uname -s 2> /dev/null ` = 'Darwin'; then
105 lf='-Wl,-search_paths_first'
106 $CC $CFLAGS $lf conftest.c > /dev/null 2>/dev/null
107 if test $? -eq 0; then
108 LFLAGS2="${LFLAGS2} ${lf}"
109 fi
110 rm -f conftest
111 fi
112 else
113 CFLAGS_OPT='-O'
114 echo " Other-unknown C ($CFLAGS_OPT)"
115 fi
116 fi
117 fi
118 fi
119
120 # optimization flags
121 if test -n "${CFLAGS_OPT}"; then
122 CFLAGS="${CFLAGS} ${CFLAGS_OPT}"
123 CFLAGS_BZ="${CFLAGS_BZ} ${CFLAGS_OPT}"
124 fi
125
126
127 # bzip2
128
129 echo "Check bzip2 support"
130 CC_BZ="${CC}"
131 LIB_BZ=''
132 if test -n "${IZ_BZIP2}"; then
133 echo " Check for bzip2 compiled library in IZ_BZIP2 (${IZ_BZIP2})"
134 if test -f "${IZ_BZIP2}/libbz2.a"; then
135 #
136 # A bzip2 library built with BZ_NO_STDIO should have an
137 # unresolved external, "bz_internal_error". The default,
138 # full-function library will not mention it.
139 #
140 nm ${IZ_BZIP2}/libbz2.a | grep bz_internal_error > /dev/null
141 if test $? -eq 0; then
142 echo " Found bzip2 BZ_NO_STDIO library, ${IZ_BZIP2}/libbz2.a"
143 else
144 echo " Found bzip2 library, ${IZ_BZIP2}/libbz2.a,"
145 echo " but library not compiled with BZ_NO_STDIO"
146 echo " WARNING: We recommend using a bzip2 library compiled"
147 echo " with BZ_NO_STDIO defined for proper error handling"
148 echo " Please see the Zip installation instructions in bzip2/install.txt"
149 echo " Continuing anyway with standard bzip2 library..."
150 fi
151 if test -f "${IZ_BZIP2}/bzlib.h"; then
152 CFLAGS="${CFLAGS} -I${IZ_BZIP2} -DBZIP2_SUPPORT"
153 LFLAGS2="${LFLAGS2} -L${IZ_BZIP2} -lbz2"
154 echo "-- Found bzip2 library - linking in bzip2"
155 else
156 echo " ${IZ_BZIP2}/bzlib.h not found"
157 echo "-- Since IZ_BZIP2 defined, skipping OS and bzip2 dir checks - no bzip2"
158 fi
159 else
160 echo " ${IZ_BZIP2}/libbz2.a not found"
161 echo "-- Since IZ_BZIP2 defined, skipping OS and bzip2 checks - no bzip2"
162 fi
163 else
164 echo " Check for bzip2 in bzip2 directory"
165 IZ_BZIP2=bzip2
166 if test -f "${IZ_BZIP2}/libbz2.a"; then
167 nm ${IZ_BZIP2}/libbz2.a | grep bz_internal_error > /dev/null
168 if test $? -eq 0; then
169 echo " Found bzip2 BZ_NO_STDIO library in bzip2 directory"
170 else
171 echo " Found bzip2 library in bzip2 directory,"
172 echo " but not built with the BZ_NO_STDIO option"
173 echo " WARNING: We recommend using a bzip2 library compiled"
174 echo " with BZ_NO_STDIO defined for proper error handling"
175 echo " Please see the Zip installation instructions"
176 echo " Continuing anyway with standard bzip2 library..."
177 fi
178 fi
179 if test -f "bzip2/bzlib.h" -a -f "bzip2/libbz2.a"; then
180 CFLAGS="${CFLAGS} -I${IZ_BZIP2} -DBZIP2_SUPPORT"
181 LFLAGS2="${LFLAGS2} -Lbzip2 -lbz2"
182 echo "-- Found bzip2 library - linking in bzip2"
183 else
184 if test -f "bzip2/bzlib.c" -a -f "bzip2/bzlib.h"; then
185 echo "-- No library, but found bzip2 source in bzip2 directory"
186 echo "-- Will try to build bzip2 library from source and link in"
187 #
188 # Arrange to build a BZ_NO_STDIO bzip2 object library using the
189 # same compiler and optimization options as used for Zip, and
190 # to compile and link Zip with bzip2.
191 #
192 CFLAGS_BZ="${CFLAGS_BZ} -DBZ_NO_STDIO"
193 LIB_BZ="bzip2/libbz2.a"
194 CFLAGS="${CFLAGS} -Ibzip2 -DBZIP2_SUPPORT"
195 LFLAGS2="${LFLAGS2} -Lbzip2 -lbz2"
196 else
197 echo " Check if OS already has bzip2 library installed"
198 cat > conftest.c << _EOF_
199 #include "bzlib.h"
200 int main()
201 {
202 bz_stream strm;
203 BZ2_bzCompressEnd(&strm);
204 return 0;
205 }
206 _EOF_
207 $CC $CFLAGS -o conftest conftest.c -lbz2 > /dev/null 2>/dev/null
208 if test $? -eq 0; then
209 echo "-- OS supports bzip2 - linking in bzip2"
210 CFLAGS="${CFLAGS} -DBZIP2_SUPPORT"
211 LFLAGS2="${LFLAGS2} -lbz2"
212 else
213 echo "-- Either bzlib.h or libbz2.a not found - no bzip2"
214 fi
215 fi
216 fi
217 fi
218
219
220 echo Check for the C preprocessor
221 # on SVR4, cc -E does not produce correct assembler files. Need /lib/cpp.
222 CPP="${CC} -E"
223 # solaris as(1) needs -P, maybe others as well ?
224 [ -f /usr/ccs/lib/cpp ] && CPP="/usr/ccs/lib/cpp -P"
225 [ -f /usr/lib/cpp ] && CPP=/usr/lib/cpp
226 [ -f /lib/cpp ] && CPP=/lib/cpp
227 [ -f /usr/bin/cpp ] && CPP=/usr/bin/cpp
228 [ -f /xenix ] && CPP="${CC} -E"
229 [ -f /lynx.os ] && CPP="${CC} -E"
230
231 echo "#include <stdio.h>" > conftest.c
232 $CPP conftest.c >/dev/null 2>/dev/null || CPP="${CC} -E"
233
234
235 echo Check if we can use asm code
236 OBJA=""
237 OCRCU8=""
238 if eval "$CPP match.S > _match.s 2>/dev/null"; then
239 if test ! -s _match.s || grep error < _match.s > /dev/null; then
240 :
241 elif eval "$CC -c _match.s >/dev/null 2>/dev/null" && [ -f _match.o ]; then
242 CFLAGS="${CFLAGS} -DASMV"
243 OBJA="match.o"
244 echo "int foo() { return 0;}" > conftest.c
245 $CC -c conftest.c >/dev/null 2>/dev/null
246 echo Check if compiler generates underlines
247 nm conftest.o | grep "(^|[^_])foo" >/dev/null 2>/dev/null
248 [ $? -eq 0 ] && CPP="${CPP} -DNO_UNDERLINE"
249 if eval "$CPP crc_i386.S > _crc_i386.s 2>/dev/null"; then
250 if eval "$CC -c _crc_i386.s >/dev/null 2>/dev/null" && [ -f _crc_i386.o ]
251 then
252 OBJA="$OBJA crc_i386.o"
253 OCRCU8="crc_i386.o"
254 CFLAGS="${CFLAGS} -DASM_CRC"
255 fi
256 fi
257 fi
258 fi
259 rm -f _match.s _match.o _crc_i386.s _crc_i386.o
260
261
262 # ANSI options for compilers that don't have __STDC__ defined by default
263 # Currently HPUX, pyramid, Dynix, AIX, OSF/1 and ultrix
264
265 echo Check for ANSI options
266 cat > conftest.c << _EOF_
267 int main()
268 {
269 #ifndef __STDC__
270 forget it
271 #endif
272 return 0;
273 }
274 _EOF_
275 $CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
276 if [ $? -ne 0 ]; then
277 for OPT in -Ae -Xa -qlanglvl=ansi -std1 -std
278 do
279 $CC $CFLAGS $OPT -c conftest.c > /dev/null 2>/dev/null
280 [ $? -eq 0 ] && CFLAGS="${CFLAGS} ${OPT}" && break
281 done
282 fi
283
284
285 echo Check for prototypes
286 echo "int main(int argc, char *argv[]) { return 0; }" > conftest.c
287 $CC $CFLAGS -c conftest.c > /dev/null 2>/dev/null
288 [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_PROTO"
289
290 # const check currently handles mips cc and non ANSI compilers.
291 # does it need more ?
292 echo Check the handling of const
293 cat > conftest.c << _EOF_
294 typedef int charset[2];
295 int main()
296 {
297 const charset x;
298 const char *foo;
299 return 0;
300 }
301 _EOF_
302 $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
303 [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_CONST"
304
305
306 echo Check for time_t
307 cat > conftest.c << _EOF_
308 #include <sys/types.h>
309 #include <time.h>
310 int main()
311 {
312 time_t t;
313 return 0;
314 }
315 _EOF_
316 $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
317 [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_TIME_T"
318
319
320 echo Check for size_t
321 cat > conftest.c << _EOF_
322 #include <sys/types.h>
323 int main()
324 {
325 size_t s;
326 return 0;
327 }
328 _EOF_
329 $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
330 [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_SIZE_T"
331
332
333 echo Check for off_t
334 cat > conftest.c << _EOF_
335 #include <sys/types.h>
336 int main()
337 {
338 off_t s;
339 return 0;
340 }
341 _EOF_
342 $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
343 [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_OFF_T"
344
345
346 echo Check size of UIDs and GIDs
347 echo "(Now zip stores variable size UIDs/GIDs using a new extra field. This"
348 echo " tests if this OS uses 16-bit UIDs/GIDs and so if the old 16-bit storage"
349 echo " should also be used for backward compatibility.)"
350 # Added 2008-04-15 CS
351 cat > conftest.c << _EOF_
352 # define _LARGEFILE_SOURCE /* some OSes need this for fseeko */
353 # define _LARGEFILE64_SOURCE
354 # define _FILE_OFFSET_BITS 64 /* select default interface as 64 bit */
355 # define _LARGE_FILES /* some OSes need this for 64-bit off_t */
356 #include <sys/types.h>
357 #include <sys/stat.h>
358 #include <unistd.h>
359 #include <stdio.h>
360 int main()
361 {
362 struct stat s;
363
364 printf(" s.st_uid is %u bytes\n", sizeof(s.st_uid));
365 printf(" s.st_gid is %u bytes\n", sizeof(s.st_gid));
366
367 /* see if have 16-bit UID */
368 if (sizeof(s.st_uid) != 2) {
369 return 1;
370 }
371 /* see if have 16-bit GID */
372 if (sizeof(s.st_gid) != 2) {
373 return 2;
374 }
375 return 3;
376 }
377 _EOF_
378 # compile it
379 $CC -o conftest conftest.c >/dev/null 2>/dev/null
380 if [ $? -ne 0 ]; then
381 echo -- UID/GID test failed on compile - disabling old 16-bit UID/GID support
382 CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
383 else
384 # run it
385 ./conftest
386 r=$?
387 if [ $r -eq 1 ]; then
388 echo -- UID not 2 bytes - disabling old 16-bit UID/GID support
389 CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
390 elif [ $r -eq 2 ]; then
391 echo -- GID not 2 bytes - disabling old 16-bit UID/GID support
392 CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
393 elif [ $r -eq 3 ]; then
394 echo -- 16-bit UIDs and GIDs - keeping old 16-bit UID/GID support
395 else
396 echo -- test failed - conftest returned $r - disabling old 16-bit UID/GID support
397 CFLAGS="${CFLAGS} -DUIDGID_NOT_16BIT"
398 fi
399 fi
400
401
402 # Now we set the 64-bit file environment and check the size of off_t
403 # Added 11/4/2003 EG
404 # Revised 8/12/2004 EG
405
406 echo Check for Large File Support
407 cat > conftest.c << _EOF_
408 # define _LARGEFILE_SOURCE /* some OSes need this for fseeko */
409 # define _LARGEFILE64_SOURCE
410 # define _FILE_OFFSET_BITS 64 /* select default interface as 64 bit */
411 # define _LARGE_FILES /* some OSes need this for 64-bit off_t */
412 #include <sys/types.h>
413 #include <sys/stat.h>
414 #include <unistd.h>
415 #include <stdio.h>
416 int main()
417 {
418 off_t offset;
419 struct stat s;
420 /* see if have 64-bit off_t */
421 if (sizeof(offset) < 8)
422 return 1;
423 printf(" off_t is %d bytes\n", sizeof(off_t));
424 /* see if have 64-bit stat */
425 if (sizeof(s.st_size) < 8) {
426 printf(" s.st_size is %d bytes\n", sizeof(s.st_size));
427 return 2;
428 }
429 return 3;
430 }
431 _EOF_
432 # compile it
433 $CC -o conftest conftest.c >/dev/null 2>/dev/null
434 if [ $? -ne 0 ]; then
435 echo -- no Large File Support
436 else
437 # run it
438 ./conftest
439 r=$?
440 if [ $r -eq 1 ]; then
441 echo -- no Large File Support - no 64-bit off_t
442 elif [ $r -eq 2 ]; then
443 echo -- no Large File Support - no 64-bit stat
444 elif [ $r -eq 3 ]; then
445 echo -- yes we have Large File Support!
446 CFLAGS="${CFLAGS} -DLARGE_FILE_SUPPORT"
447 else
448 echo -- no Large File Support - conftest returned $r
449 fi
450 fi
451
452
453 # Check for wide char for Unicode support
454 # Added 11/24/2005 EG
455
456 echo Check for wide char support
457 cat > conftest.c << _EOF_
458 #include <stdlib.h>
459 #include <stdio.h>
460 int main()
461 {
462 int wsize;
463 wchar_t *wide_string;
464
465 if ((wide_string = (wchar_t *)malloc(4 * sizeof(wchar_t))) == NULL) {
466 return 0;
467 }
468 /* get wide string */
469 wsize = mbstowcs(wide_string, "foo", 3);
470 wide_string[wsize] = (wchar_t) NULL;
471 return 1;
472 }
473 _EOF_
474 # compile it
475 $CC -o conftest conftest.c >/dev/null 2>/dev/null
476 # OCRCU8 is used by all utilities if Unicode is enabled
477 # OCRCTB is only used by zipcloak
478 if [ $? -ne 0 ]; then
479 echo -- no Unicode support
480 OCRCU8=""
481 OCRCTB="crc32_.o"
482 else
483 # have wide char support
484 echo -- have wchar_t - enabling Unicode support
485 CFLAGS="${CFLAGS} -DUNICODE_SUPPORT"
486 OCRCU8="crc32_.o ${OCRCU8}"
487 OCRCTB=""
488 fi
489
490
491 # from configure 2.4i (Onno) 12/5/04
492
493 echo Check for gcc no-builtin flag
494 # -fno-builtin since version 2
495 cat > conftest.c << _EOF_
496 int main()
497 {
498 #if __GNUC__ >= 2
499 return 0;
500 #else
501 forget it
502 #endif
503 }
504 _EOF_
505 $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
506 [ $? -eq 0 ] && BFLAG="-fno-builtin"
507
508
509 # Check for missing functions
510 # add NO_'function_name' to flags if missing
511
512 for func in rmdir strchr strrchr rename mktemp mktime mkstemp
513 do
514 echo Check for $func
515 echo "int main(){ $func(); return 0; }" > conftest.c
516 $CC $BFLAG -o conftest conftest.c >/dev/null 2>/dev/null
•517 # glibc-based systems do not need this
518 # [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_`echo $func | tr '[a-z]' '[A-Z]'`"
519 done
520
521
522 echo Check for memset
523 echo "int main(){ char k; memset(&k,0,0); return 0; }" > conftest.c
524 $CC -o conftest conftest.c >/dev/null 2>/dev/null
•525 # glibc-based systems do not need this
526 # [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DZMEM"
527
528
529 echo Check for memmove
530 cat > conftest.c << _EOF_
531 #include <string.h>
532 int main() { int a; int b = 0; memmove( &a, &b, sizeof( a)); return a; }
533 _EOF_
534 $CC -o conftest conftest.c >/dev/null 2>/dev/null
535 [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNEED_MEMMOVE"
536
537
538 echo Check for strerror
539 cat > conftest.c << _EOF_
540 #include <string.h>
541 int main() { strerror( 0); return 0; }
542 _EOF_
543 $CC -o conftest conftest.c >/dev/null 2>/dev/null
544 [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNEED_STRERROR"
545
546 echo Check for errno declaration
547 cat > conftest.c << _EOF_
548 #include <errno.h>
549 main()
550 {
551 errno = 0;
552 return 0;
553 }
554 _EOF_
555 $CC $CFLAGS -c conftest.c >/dev/null 2>/dev/null
•556 # glibc-based systems do not need this
557 # [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_ERRNO"
558
559
560 echo Check for directory libraries
561 cat > conftest.c << _EOF_
562 int main() { return closedir(opendir(".")); }
563 _EOF_
564
565 $CC -o conftest conftest.c >/dev/null 2>/dev/null
566 if [ $? -ne 0 ]; then
567 OPT=""
568 for lib in ndir dir ucb bsd BSD PW x dirent
569 do
570 $CC -o conftest conftest.c -l$lib >/dev/null 2>/dev/null
571 [ $? -eq 0 ] && OPT=-l$lib && break
572 done
•573 # glibc-based systems do not need this
574 if true; then
575 LFLAGS2="${LFLAGS2} ${OPT}"
576 else
577 CFLAGS="${CFLAGS} -DNO_DIR"
578 fi
579 fi
580
581
582 # Dynix/ptx 1.3 needed this
583
584 echo Check for readlink
585 echo "int main(){ return readlink(); }" > conftest.c
586 $CC -o conftest conftest.c >/dev/null 2>/dev/null
587 if [ $? -ne 0 ]; then
588 $CC -o conftest conftest.c -lseq >/dev/null 2>/dev/null
589 [ $? -eq 0 ] && LFLAGS2="${LFLAGS2} -lseq"
590 fi
591
592
593 echo Check for directory include file
594 OPT=""
595 for inc in dirent.h sys/ndir.h ndir.h sys/dir.h
596 do
597 echo "#include <$inc>" > conftest.c
598 $CPP conftest.c > /dev/null 2>/dev/null
599 [ $? -eq 0 ] && OPT="-DHAVE_`echo $inc | tr '[a-z]./' '[A-Z]__'`" && break
600 done
601 CFLAGS="${CFLAGS} ${OPT}"
602
603
604 echo Check for nonexistent include files
605 for inc in stdlib.h stddef.h unistd.h fcntl.h string.h
606 do
607 echo "#include <$inc>" > conftest.c
608 $CPP conftest.c >/dev/null 2>/dev/null
609 [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_`echo $inc | tr '[a-z]./' '[A-Z]__'`"
610 done
611
612
613 echo Check for term I/O include file
614 OPT=""
615 for inc in termios.h termio.h sgtty.h
616 do
617 echo "#include <$inc>" > conftest.c
618 $CPP conftest.c > /dev/null 2>/dev/null
619 [ $? -eq 0 ] && OPT="-DHAVE_`echo $inc | tr '[a-z]./' '[A-Z]__'`" && break
620 done
621 CFLAGS="${CFLAGS} ${OPT}"
622
623
624 # needed for AIX (and others ?) when mmap is used
625
626 echo Check for valloc
627 cat > conftest.c << _EOF_
628 main()
629 {
630 #ifdef MMAP
631 valloc();
632 #endif
633 }
634 _EOF_
635 $CC ${CFLAGS} -c conftest.c > /dev/null 2>/dev/null
•636 # glibc-based systems do not need this
637 # [ $? -ne 0 ] && CFLAGS="${CFLAGS} -DNO_VALLOC"
638
639
640 echo Check for /usr/local/bin and /usr/local/man
641 BINDIR=$HOME/bin
642 [ -d /usr/local/bin ] && BINDIR=/usr/local/bin
643
644 MANDIR=manl
645 [ -d /usr/man/manl ] && MANDIR=/usr/man/manl
646 [ -d /usr/local/man/manl ] && MANDIR=/usr/local/man/manl
647 [ -d /usr/local/man/man1 ] && MANDIR=/usr/local/man/man1
648
649
650 echo Check for OS-specific flags
651 if [ -f /usr/bin/hostinfo ]; then
652 if /usr/bin/hostinfo | grep NeXT > /dev/null; then
653 CFLAGS="${CFLAGS} -posix"
654 LFLAGS1="${LFLAGS1} -posix -object"
655 fi
656 # XXX ATT6300, Cray
657 elif [ -f /xenix ]; then
658 if uname -p | grep 286 > /dev/null; then
659 CFLAGS="${CFLAGS} -LARGE -Mel2 -DMEDIUM_MEM -DWSIZE=16384 -DNO_VOID"
660 LFLAGS1="${LFLAGS1} -LARGE -Mel2"
661 fi
662 elif uname -X >/dev/null 2>/dev/null; then
663 # SCO shared library check
664 echo "int main() { return 0;}" > conftest.c
665 $CC -o conftest conftest.c -lc_s -nointl >/dev/null 2> /dev/null
666 [ $? -eq 0 ] && LFLAGS2="-lc_s -nointl"
667 else
668 SYSTEM=`uname -s 2>/dev/null` || SYSTEM="unknown"
669 echo "int main() { return 0;}" > conftest.c
670 case $SYSTEM in
671 OSF1|ULTRIX)
672 echo Check for -Olimit option
673 $CC ${CFLAGS} -Olimit 1000 -o conftest conftest.c >/dev/null 2>/dev/null
674 [ $? -eq 0 ] && CFLAGS="${CFLAGS} -Olimit 1000"
675 ;;
676 ### HP-UX)
677 ### echo Check for +Onolimit option
678 ### $CC ${CFLAGS} +Onolimit -o conftest conftest.c >/dev/null 2>/dev/null
679 ### [ $? -eq 0 ] && CFLAGS="${CFLAGS} +Onolimit"
680 ### ;;
681 ### SunOS)
682 ### CFLAGS="${CFLAGS} -D_FILE_OFFSET_BITS=64"
683 ### ;;
684 esac
685 fi
686
687
688 echo Check for symbolic links
689 ln -s /dev/null null > /dev/null 2>/dev/null || LN=ln
690
691
692 rm -f a.out conftest.c conftest.o conftest null
693
694 echo CC=\"${CC}\" CFLAGS=\"${CFLAGS}\" CPP=\"${CPP}\" OBJA=\"${OBJA}\" \
695 OCRCU8=\"${OCRCU8}\" OCRCTB=\"${OCRCTB}\" \
696 BINDIR=${BINDIR} MANDIR=${MANDIR} LFLAGS1=\"${LFLAGS1}\" \
697 LFLAGS2=\"${LFLAGS2}\" LN=\"${LN}\" \
698 CC_BZ=\"${CC_BZ}\" CFLAGS_BZ=\"${CFLAGS_BZ}\" \
699 IZ_BZIP2=\"${IZ_BZIP2}\" LIB_BZ=\"${LIB_BZ}\" > flags
700