diff options
author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:25:38 -0700 |
---|---|---|
committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-09 23:25:38 -0700 |
commit | d6231142d2b883a8c3b253fa34992b5cdb4ac2fe (patch) | |
tree | 74e07c6ca624264cec9284e25dfd11bd8f877801 /configure | |
parent | b1c19ca6d82c98a8be6cd9cad7a9c5fa5e8e634e (diff) | |
download | zlib-d6231142d2b883a8c3b253fa34992b5cdb4ac2fe.tar.gz zlib-d6231142d2b883a8c3b253fa34992b5cdb4ac2fe.tar.bz2 zlib-d6231142d2b883a8c3b253fa34992b5cdb4ac2fe.zip |
zlib 1.2.3.2v1.2.3.2
Diffstat (limited to 'configure')
-rwxr-xr-x | configure | 41 |
1 files changed, 35 insertions, 6 deletions
@@ -79,7 +79,7 @@ esac | |||
79 | if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then | 79 | if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then |
80 | CC="$cc" | 80 | CC="$cc" |
81 | SFLAGS="${CFLAGS-"-O3"} -fPIC" | 81 | SFLAGS="${CFLAGS-"-O3"} -fPIC" |
82 | CFLAGS="$cflags" | 82 | CFLAGS="${CFLAGS-"-O3"}" |
83 | case `(uname -s || echo unknown) 2>/dev/null` in | 83 | case `(uname -s || echo unknown) 2>/dev/null` in |
84 | Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"};; | 84 | Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"};; |
85 | CYGWIN* | Cygwin* | cygwin* | OS/2* ) | 85 | CYGWIN* | Cygwin* | cygwin* | OS/2* ) |
@@ -184,8 +184,7 @@ if test $shared -eq 1; then | |||
184 | # we must test in two steps (cc then ld), required at least on SunOS 4.x | 184 | # we must test in two steps (cc then ld), required at least on SunOS 4.x |
185 | if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" && | 185 | if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" && |
186 | test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then | 186 | test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then |
187 | CFLAGS="$SFLAGS" | 187 | LIBS="$LIBS $SHAREDLIBV" |
188 | LIBS="$SHAREDLIBV" | ||
189 | echo Building shared library $SHAREDLIBV with $CC. | 188 | echo Building shared library $SHAREDLIBV with $CC. |
190 | elif test -z "$old_cc" -a -z "$old_cflags"; then | 189 | elif test -z "$old_cc" -a -z "$old_cflags"; then |
191 | echo No shared library support. | 190 | echo No shared library support. |
@@ -202,8 +201,29 @@ fi | |||
202 | if test $shared -eq 0; then | 201 | if test $shared -eq 0; then |
203 | LDSHARED="$CC" | 202 | LDSHARED="$CC" |
204 | echo Building static library $LIBS version $VER with $CC. | 203 | echo Building static library $LIBS version $VER with $CC. |
204 | fi | ||
205 | |||
206 | cat > zlibdefs.h << EOF | ||
207 | /* zlibdefs.h -- compile-time definitions for the zlib compression library | ||
208 | * Copyright (C) 1995-2006 Jean-loup Gailly. | ||
209 | * For conditions of distribution and use, see copyright notice in zlib.h | ||
210 | */ | ||
211 | |||
212 | EOF | ||
213 | |||
214 | cat > $test.c <<EOF | ||
215 | #include <sys/types.h> | ||
216 | off64_t dummy = 0; | ||
217 | EOF | ||
218 | if test "`($CC -c $CFLAGS -D_LARGEFILE64_SOURCE $test.c) 2>&1`" = ""; then | ||
219 | cat >> zlibdefs.h <<EOF | ||
220 | #define z_off_t off64_t | ||
221 | EOF | ||
222 | CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE" | ||
223 | SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE" | ||
224 | echo "Checking for off64_t... Yes." | ||
205 | else | 225 | else |
206 | LDFLAGS="-L. ${SHAREDLIBV}" | 226 | echo "Checking for off64_t... No." |
207 | fi | 227 | fi |
208 | 228 | ||
209 | cat > $test.c <<EOF | 229 | cat > $test.c <<EOF |
@@ -211,10 +231,18 @@ cat > $test.c <<EOF | |||
211 | int main() { return 0; } | 231 | int main() { return 0; } |
212 | EOF | 232 | EOF |
213 | if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | 233 | if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then |
214 | sed < zconf.in.h "/HAVE_UNISTD_H/s%0%1%" > zconf.h | 234 | cat >> zlibdefs.h <<EOF |
235 | #include <sys/types.h> /* for off_t */ | ||
236 | #include <unistd.h> /* for SEEK_* and off_t */ | ||
237 | #ifdef VMS | ||
238 | # include <unixio.h> /* for off_t */ | ||
239 | #endif | ||
240 | #ifndef z_off_t | ||
241 | # define z_off_t off_t | ||
242 | #endif | ||
243 | EOF | ||
215 | echo "Checking for unistd.h... Yes." | 244 | echo "Checking for unistd.h... Yes." |
216 | else | 245 | else |
217 | cp -p zconf.in.h zconf.h | ||
218 | echo "Checking for unistd.h... No." | 246 | echo "Checking for unistd.h... No." |
219 | fi | 247 | fi |
220 | 248 | ||
@@ -462,6 +490,7 @@ rm -f $test.[co] $test $test$shared_ext | |||
462 | sed < Makefile.in " | 490 | sed < Makefile.in " |
463 | /^CC *=/s#=.*#=$CC# | 491 | /^CC *=/s#=.*#=$CC# |
464 | /^CFLAGS *=/s#=.*#=$CFLAGS# | 492 | /^CFLAGS *=/s#=.*#=$CFLAGS# |
493 | /^SFLAGS *=/s#=.*#=$SFLAGS# | ||
465 | /^CPP *=/s#=.*#=$CPP# | 494 | /^CPP *=/s#=.*#=$CPP# |
466 | /^LDSHARED *=/s#=.*#=$LDSHARED# | 495 | /^LDSHARED *=/s#=.*#=$LDSHARED# |
467 | /^LIBS *=/s#=.*#=$LIBS# | 496 | /^LIBS *=/s#=.*#=$LIBS# |