diff options
-rwxr-xr-x | configure | 44 |
1 files changed, 30 insertions, 14 deletions
@@ -97,6 +97,22 @@ case "$1" in | |||
97 | done | 97 | done |
98 | 98 | ||
99 | test=ztest$$ | 99 | test=ztest$$ |
100 | |||
101 | cat > $test.c <<EOF | ||
102 | #error error | ||
103 | EOF | ||
104 | if ($CC -c $CFLAGS $test.c) 2>/dev/null; then | ||
105 | try() | ||
106 | { | ||
107 | test "`( $* ) 2>&1`" = "" | ||
108 | } | ||
109 | else | ||
110 | try() | ||
111 | { | ||
112 | ( $* ) 2>/dev/null | ||
113 | } | ||
114 | fi | ||
115 | |||
100 | cat > $test.c <<EOF | 116 | cat > $test.c <<EOF |
101 | extern int getchar(); | 117 | extern int getchar(); |
102 | int hello() {return getchar();} | 118 | int hello() {return getchar();} |
@@ -249,8 +265,8 @@ SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"} | |||
249 | if test $shared -eq 1; then | 265 | if test $shared -eq 1; then |
250 | echo Checking for shared library support... | 266 | echo Checking for shared library support... |
251 | # we must test in two steps (cc then ld), required at least on SunOS 4.x | 267 | # we must test in two steps (cc then ld), required at least on SunOS 4.x |
252 | if test "`($CC -w -c $SFLAGS $test.c) 2>&1`" = "" && | 268 | if try $CC -w -c $SFLAGS $test.c && |
253 | test "`($LDSHARED $SFLAGS -o $test$shared_ext $test.o) 2>&1`" = ""; then | 269 | try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then |
254 | echo Building shared library $SHAREDLIBV with $CC. | 270 | echo Building shared library $SHAREDLIBV with $CC. |
255 | elif test -z "$old_cc" -a -z "$old_cflags"; then | 271 | elif test -z "$old_cc" -a -z "$old_cflags"; then |
256 | echo No shared library support. | 272 | echo No shared library support. |
@@ -281,7 +297,7 @@ cat > $test.c <<EOF | |||
281 | #include <sys/types.h> | 297 | #include <sys/types.h> |
282 | off64_t dummy = 0; | 298 | off64_t dummy = 0; |
283 | EOF | 299 | EOF |
284 | if test "`($CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c) 2>&1`" = ""; then | 300 | if try $CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c; then |
285 | CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1" | 301 | CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1" |
286 | SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1" | 302 | SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1" |
287 | ALL="${ALL} all64" | 303 | ALL="${ALL} all64" |
@@ -297,7 +313,7 @@ int main(void) { | |||
297 | return 0; | 313 | return 0; |
298 | } | 314 | } |
299 | EOF | 315 | EOF |
300 | if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then | 316 | if try $CC $CFLAGS -o $test $test.c; then |
301 | echo "Checking for fseeko... Yes." | 317 | echo "Checking for fseeko... Yes." |
302 | else | 318 | else |
303 | CFLAGS="${CFLAGS} -DNO_FSEEKO" | 319 | CFLAGS="${CFLAGS} -DNO_FSEEKO" |
@@ -312,7 +328,7 @@ cat > $test.c <<EOF | |||
312 | #include <unistd.h> | 328 | #include <unistd.h> |
313 | int main() { return 0; } | 329 | int main() { return 0; } |
314 | EOF | 330 | EOF |
315 | if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | 331 | if try $CC -c $CFLAGS $test.c; then |
316 | sed < zconf.h "/^#ifdef HAVE_UNISTD_H.* may be/s/def HAVE_UNISTD_H\(.*\) may be/ 1\1 was/" > zconf.temp.h | 332 | sed < zconf.h "/^#ifdef HAVE_UNISTD_H.* may be/s/def HAVE_UNISTD_H\(.*\) may be/ 1\1 was/" > zconf.temp.h |
317 | mv zconf.temp.h zconf.h | 333 | mv zconf.temp.h zconf.h |
318 | echo "Checking for unistd.h... Yes." | 334 | echo "Checking for unistd.h... Yes." |
@@ -324,7 +340,7 @@ cat > $test.c <<EOF | |||
324 | #include <stdarg.h> | 340 | #include <stdarg.h> |
325 | int main() { return 0; } | 341 | int main() { return 0; } |
326 | EOF | 342 | EOF |
327 | if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | 343 | if try $CC -c $CFLAGS $test.c; then |
328 | sed < zconf.h "/^#ifdef HAVE_STDARG_H.* may be/s/def HAVE_STDARG_H\(.*\) may be/ 1\1 was/" > zconf.temp.h | 344 | sed < zconf.h "/^#ifdef HAVE_STDARG_H.* may be/s/def HAVE_STDARG_H\(.*\) may be/ 1\1 was/" > zconf.temp.h |
329 | mv zconf.temp.h zconf.h | 345 | mv zconf.temp.h zconf.h |
330 | echo "Checking for stdarg.h... Yes." | 346 | echo "Checking for stdarg.h... Yes." |
@@ -367,7 +383,7 @@ int main() | |||
367 | } | 383 | } |
368 | EOF | 384 | EOF |
369 | 385 | ||
370 | if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | 386 | if try $CC -c $CFLAGS $test.c; then |
371 | echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | 387 | echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." |
372 | 388 | ||
373 | cat > $test.c <<EOF | 389 | cat > $test.c <<EOF |
@@ -390,7 +406,7 @@ int main() | |||
390 | return (mytest("Hello%d\n", 1)); | 406 | return (mytest("Hello%d\n", 1)); |
391 | } | 407 | } |
392 | EOF | 408 | EOF |
393 | if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then | 409 | if try $CC $CFLAGS -o $test $test.c; then |
394 | echo "Checking for vsnprintf() in stdio.h... Yes." | 410 | echo "Checking for vsnprintf() in stdio.h... Yes." |
395 | 411 | ||
396 | cat >$test.c <<EOF | 412 | cat >$test.c <<EOF |
@@ -415,7 +431,7 @@ int main() | |||
415 | } | 431 | } |
416 | EOF | 432 | EOF |
417 | 433 | ||
418 | if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | 434 | if try $CC -c $CFLAGS $test.c; then |
419 | echo "Checking for return value of vsnprintf()... Yes." | 435 | echo "Checking for return value of vsnprintf()... Yes." |
420 | else | 436 | else |
421 | CFLAGS="$CFLAGS -DHAS_vsnprintf_void" | 437 | CFLAGS="$CFLAGS -DHAS_vsnprintf_void" |
@@ -455,7 +471,7 @@ int main() | |||
455 | } | 471 | } |
456 | EOF | 472 | EOF |
457 | 473 | ||
458 | if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | 474 | if try $CC -c $CFLAGS $test.c; then |
459 | echo "Checking for return value of vsprintf()... Yes." | 475 | echo "Checking for return value of vsprintf()... Yes." |
460 | else | 476 | else |
461 | CFLAGS="$CFLAGS -DHAS_vsprintf_void" | 477 | CFLAGS="$CFLAGS -DHAS_vsprintf_void" |
@@ -486,7 +502,7 @@ int main() | |||
486 | } | 502 | } |
487 | EOF | 503 | EOF |
488 | 504 | ||
489 | if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then | 505 | if try $CC $CFLAGS -o $test $test.c; then |
490 | echo "Checking for snprintf() in stdio.h... Yes." | 506 | echo "Checking for snprintf() in stdio.h... Yes." |
491 | 507 | ||
492 | cat >$test.c <<EOF | 508 | cat >$test.c <<EOF |
@@ -505,7 +521,7 @@ int main() | |||
505 | } | 521 | } |
506 | EOF | 522 | EOF |
507 | 523 | ||
508 | if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | 524 | if try $CC -c $CFLAGS $test.c; then |
509 | echo "Checking for return value of snprintf()... Yes." | 525 | echo "Checking for return value of snprintf()... Yes." |
510 | else | 526 | else |
511 | CFLAGS="$CFLAGS -DHAS_snprintf_void" | 527 | CFLAGS="$CFLAGS -DHAS_snprintf_void" |
@@ -539,7 +555,7 @@ int main() | |||
539 | } | 555 | } |
540 | EOF | 556 | EOF |
541 | 557 | ||
542 | if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | 558 | if try $CC -c $CFLAGS $test.c; then |
543 | echo "Checking for return value of sprintf()... Yes." | 559 | echo "Checking for return value of sprintf()... Yes." |
544 | else | 560 | else |
545 | CFLAGS="$CFLAGS -DHAS_sprintf_void" | 561 | CFLAGS="$CFLAGS -DHAS_sprintf_void" |
@@ -565,7 +581,7 @@ int main() | |||
565 | return 0; | 581 | return 0; |
566 | } | 582 | } |
567 | EOF | 583 | EOF |
568 | if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | 584 | if try $CC -c $CFLAGS $test.c; then |
569 | echo "Checking for attribute(visibility) support... Yes." | 585 | echo "Checking for attribute(visibility) support... Yes." |
570 | else | 586 | else |
571 | CFLAGS="$CFLAGS -DNO_VIZ" | 587 | CFLAGS="$CFLAGS -DNO_VIZ" |