summaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure41
1 files changed, 35 insertions, 6 deletions
diff --git a/configure b/configure
index f1b769b..6e8060e 100755
--- a/configure
+++ b/configure
@@ -79,7 +79,7 @@ esac
79if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then 79if 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
202if test $shared -eq 0; then 201if 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.
204fi
205
206cat > 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
212EOF
213
214cat > $test.c <<EOF
215#include <sys/types.h>
216off64_t dummy = 0;
217EOF
218if test "`($CC -c $CFLAGS -D_LARGEFILE64_SOURCE $test.c) 2>&1`" = ""; then
219 cat >> zlibdefs.h <<EOF
220#define z_off_t off64_t
221EOF
222 CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE"
223 SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE"
224 echo "Checking for off64_t... Yes."
205else 225else
206 LDFLAGS="-L. ${SHAREDLIBV}" 226 echo "Checking for off64_t... No."
207fi 227fi
208 228
209cat > $test.c <<EOF 229cat > $test.c <<EOF
@@ -211,10 +231,18 @@ cat > $test.c <<EOF
211int main() { return 0; } 231int main() { return 0; }
212EOF 232EOF
213if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then 233if 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
243EOF
215 echo "Checking for unistd.h... Yes." 244 echo "Checking for unistd.h... Yes."
216else 245else
217 cp -p zconf.in.h zconf.h
218 echo "Checking for unistd.h... No." 246 echo "Checking for unistd.h... No."
219fi 247fi
220 248
@@ -462,6 +490,7 @@ rm -f $test.[co] $test $test$shared_ext
462sed < Makefile.in " 490sed < 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#