aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorKhem Raj <raj.khem@gmail.com>2022-03-08 22:38:47 -0800
committerMark Adler <git@madler.net>2026-01-29 00:59:54 -0800
commit9eadab425834142aed28c51129681ed31a09577d (patch)
tree9fcd3670741224b14e4cc04c4421d092f6dc28a1 /configure
parentd380a71462f6207eaebdd9b2cb28eac8bd77c687 (diff)
downloadzlib-9eadab425834142aed28c51129681ed31a09577d.tar.gz
zlib-9eadab425834142aed28c51129681ed31a09577d.tar.bz2
zlib-9eadab425834142aed28c51129681ed31a09577d.zip
Pass LDFLAGS to link tests in configure.
LDFLAGS may contain critical flags without which linking won't succeed. Ensure that all configure tests involving link-time checks use LDFLAGS along with CFLAGS so that the tests perform correctly. Without this some tests may fail, resulting in incorrect configure results.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure12
1 files changed, 6 insertions, 6 deletions
diff --git a/configure b/configure
index fa539830..e183abb7 100755
--- a/configure
+++ b/configure
@@ -495,7 +495,7 @@ if test $shared -eq 1; then
495 echo Checking for shared library support... | tee -a configure.log 495 echo Checking for shared library support... | tee -a configure.log
496 # we must test in two steps (cc then ld), required at least on SunOS 4.x 496 # we must test in two steps (cc then ld), required at least on SunOS 4.x
497 if try $CC -c $SFLAGS $test.c && 497 if try $CC -c $SFLAGS $test.c &&
498 try $LDSHARED $SFLAGS -o $test$shared_ext $test.o; then 498 try $LDSHARED $SFLAGS $LDFLAGS -o $test$shared_ext $test.o; then
499 echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log 499 echo Building shared library $SHAREDLIBV with $CC. | tee -a configure.log
500 elif test -z "$old_cc" -a -z "$old_cflags"; then 500 elif test -z "$old_cc" -a -z "$old_cflags"; then
501 echo No shared library support. | tee -a configure.log 501 echo No shared library support. | tee -a configure.log
@@ -557,7 +557,7 @@ int main(void) {
557} 557}
558EOF 558EOF
559 fi 559 fi
560 if try $CC $CFLAGS -o $test $test.c; then 560 if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
561 sizet=`./$test` 561 sizet=`./$test`
562 echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log 562 echo "Checking for a pointer-size integer type..." $sizet"." | tee -a configure.log
563 CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}" 563 CFLAGS="${CFLAGS} -DNO_SIZE_T=${sizet}"
@@ -591,7 +591,7 @@ int main(void) {
591 return 0; 591 return 0;
592} 592}
593EOF 593EOF
594 if try $CC $CFLAGS -o $test $test.c; then 594 if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
595 echo "Checking for fseeko... Yes." | tee -a configure.log 595 echo "Checking for fseeko... Yes." | tee -a configure.log
596 else 596 else
597 CFLAGS="${CFLAGS} -DNO_FSEEKO" 597 CFLAGS="${CFLAGS} -DNO_FSEEKO"
@@ -608,7 +608,7 @@ cat > $test.c <<EOF
608#include <errno.h> 608#include <errno.h>
609int main() { return strlen(strerror(errno)); } 609int main() { return strlen(strerror(errno)); }
610EOF 610EOF
611if try $CC $CFLAGS -o $test $test.c; then 611if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
612 echo "Checking for strerror... Yes." | tee -a configure.log 612 echo "Checking for strerror... Yes." | tee -a configure.log
613else 613else
614 CFLAGS="${CFLAGS} -DNO_STRERROR" 614 CFLAGS="${CFLAGS} -DNO_STRERROR"
@@ -714,7 +714,7 @@ int main()
714 return (mytest("Hello%d\n", 1)); 714 return (mytest("Hello%d\n", 1));
715} 715}
716EOF 716EOF
717 if try $CC $CFLAGS -o $test $test.c; then 717 if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
718 echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log 718 echo "Checking for vsnprintf() in stdio.h... Yes." | tee -a configure.log
719 719
720 echo >> configure.log 720 echo >> configure.log
@@ -807,7 +807,7 @@ int main()
807} 807}
808EOF 808EOF
809 809
810 if try $CC $CFLAGS -o $test $test.c; then 810 if try $CC $CFLAGS $LDFLAGS -o $test $test.c; then
811 echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log 811 echo "Checking for snprintf() in stdio.h... Yes." | tee -a configure.log
812 812
813 echo >> configure.log 813 echo >> configure.log