diff options
| author | Marcin Juszkiewicz <hrw@openedhand.com> | 2007-10-19 12:19:42 +0000 |
|---|---|---|
| committer | Marcin Juszkiewicz <hrw@openedhand.com> | 2007-10-19 12:19:42 +0000 |
| commit | ad9ae098612856bceb94a7713056f3b061db3848 (patch) | |
| tree | 7f451a6716ce06e81076643c03513b217cbd54d3 /meta/packages/zlib/files/autotools.patch | |
| parent | 286da62fb5c5e2e98443235c8a7c330077fe7519 (diff) | |
| download | poky-ad9ae098612856bceb94a7713056f3b061db3848.tar.gz | |
zlib: cleanup and sync with OE
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@2924 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/zlib/files/autotools.patch')
| -rw-r--r-- | meta/packages/zlib/files/autotools.patch | 651 |
1 files changed, 651 insertions, 0 deletions
diff --git a/meta/packages/zlib/files/autotools.patch b/meta/packages/zlib/files/autotools.patch new file mode 100644 index 0000000000..d1dc8dd8d4 --- /dev/null +++ b/meta/packages/zlib/files/autotools.patch | |||
| @@ -0,0 +1,651 @@ | |||
| 1 | diff -Naur zlib-1.2.3/configure zlib-1.2.3new/configure | ||
| 2 | --- zlib-1.2.3/configure 2005-07-11 22:11:57.000000000 +0200 | ||
| 3 | +++ zlib-1.2.3new/configure 1970-01-01 01:00:00.000000000 +0100 | ||
| 4 | @@ -1,459 +0,0 @@ | ||
| 5 | -#!/bin/sh | ||
| 6 | -# configure script for zlib. This script is needed only if | ||
| 7 | -# you wish to build a shared library and your system supports them, | ||
| 8 | -# of if you need special compiler, flags or install directory. | ||
| 9 | -# Otherwise, you can just use directly "make test; make install" | ||
| 10 | -# | ||
| 11 | -# To create a shared library, use "configure --shared"; by default a static | ||
| 12 | -# library is created. If the primitive shared library support provided here | ||
| 13 | -# does not work, use ftp://prep.ai.mit.edu/pub/gnu/libtool-*.tar.gz | ||
| 14 | -# | ||
| 15 | -# To impose specific compiler or flags or install directory, use for example: | ||
| 16 | -# prefix=$HOME CC=cc CFLAGS="-O4" ./configure | ||
| 17 | -# or for csh/tcsh users: | ||
| 18 | -# (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure) | ||
| 19 | -# LDSHARED is the command to be used to create a shared library | ||
| 20 | - | ||
| 21 | -# Incorrect settings of CC or CFLAGS may prevent creating a shared library. | ||
| 22 | -# If you have problems, try without defining CC and CFLAGS before reporting | ||
| 23 | -# an error. | ||
| 24 | - | ||
| 25 | -LIBS=libz.a | ||
| 26 | -LDFLAGS="-L. ${LIBS}" | ||
| 27 | -VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h` | ||
| 28 | -VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h` | ||
| 29 | -VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h` | ||
| 30 | -AR=${AR-"ar rc"} | ||
| 31 | -RANLIB=${RANLIB-"ranlib"} | ||
| 32 | -prefix=${prefix-/usr/local} | ||
| 33 | -exec_prefix=${exec_prefix-'${prefix}'} | ||
| 34 | -libdir=${libdir-'${exec_prefix}/lib'} | ||
| 35 | -includedir=${includedir-'${prefix}/include'} | ||
| 36 | -mandir=${mandir-'${prefix}/share/man'} | ||
| 37 | -shared_ext='.so' | ||
| 38 | -shared=0 | ||
| 39 | -gcc=0 | ||
| 40 | -old_cc="$CC" | ||
| 41 | -old_cflags="$CFLAGS" | ||
| 42 | - | ||
| 43 | -while test $# -ge 1 | ||
| 44 | -do | ||
| 45 | -case "$1" in | ||
| 46 | - -h* | --h*) | ||
| 47 | - echo 'usage:' | ||
| 48 | - echo ' configure [--shared] [--prefix=PREFIX] [--exec_prefix=EXPREFIX]' | ||
| 49 | - echo ' [--libdir=LIBDIR] [--includedir=INCLUDEDIR]' | ||
| 50 | - exit 0;; | ||
| 51 | - -p*=* | --p*=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;; | ||
| 52 | - -e*=* | --e*=*) exec_prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift;; | ||
| 53 | - -l*=* | --libdir=*) libdir=`echo $1 | sed 's/[-a-z_]*=//'`; shift;; | ||
| 54 | - -i*=* | --includedir=*) includedir=`echo $1 | sed 's/[-a-z_]*=//'`;shift;; | ||
| 55 | - -p* | --p*) prefix="$2"; shift; shift;; | ||
| 56 | - -e* | --e*) exec_prefix="$2"; shift; shift;; | ||
| 57 | - -l* | --l*) libdir="$2"; shift; shift;; | ||
| 58 | - -i* | --i*) includedir="$2"; shift; shift;; | ||
| 59 | - -s* | --s*) shared=1; shift;; | ||
| 60 | - *) echo "unknown option: $1"; echo "$0 --help for help"; exit 1;; | ||
| 61 | - esac | ||
| 62 | -done | ||
| 63 | - | ||
| 64 | -test=ztest$$ | ||
| 65 | -cat > $test.c <<EOF | ||
| 66 | -extern int getchar(); | ||
| 67 | -int hello() {return getchar();} | ||
| 68 | -EOF | ||
| 69 | - | ||
| 70 | -test -z "$CC" && echo Checking for gcc... | ||
| 71 | -cc=${CC-gcc} | ||
| 72 | -cflags=${CFLAGS-"-O3"} | ||
| 73 | -# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure | ||
| 74 | -case "$cc" in | ||
| 75 | - *gcc*) gcc=1;; | ||
| 76 | -esac | ||
| 77 | - | ||
| 78 | -if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then | ||
| 79 | - CC="$cc" | ||
| 80 | - SFLAGS=${CFLAGS-"-fPIC -O3"} | ||
| 81 | - CFLAGS="$cflags" | ||
| 82 | - case `(uname -s || echo unknown) 2>/dev/null` in | ||
| 83 | - Linux | linux | GNU | GNU/*) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1"};; | ||
| 84 | - CYGWIN* | Cygwin* | cygwin* | OS/2* ) | ||
| 85 | - EXE='.exe';; | ||
| 86 | - QNX*) # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4 | ||
| 87 | - # (alain.bonnefoy@icbt.com) | ||
| 88 | - LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"};; | ||
| 89 | - HP-UX*) | ||
| 90 | - LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"} | ||
| 91 | - case `(uname -m || echo unknown) 2>/dev/null` in | ||
| 92 | - ia64) | ||
| 93 | - shared_ext='.so' | ||
| 94 | - SHAREDLIB='libz.so';; | ||
| 95 | - *) | ||
| 96 | - shared_ext='.sl' | ||
| 97 | - SHAREDLIB='libz.sl';; | ||
| 98 | - esac;; | ||
| 99 | - Darwin*) shared_ext='.dylib' | ||
| 100 | - SHAREDLIB=libz$shared_ext | ||
| 101 | - SHAREDLIBV=libz.$VER$shared_ext | ||
| 102 | - SHAREDLIBM=libz.$VER1$shared_ext | ||
| 103 | - LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER"};; | ||
| 104 | - *) LDSHARED=${LDSHARED-"$cc -shared"};; | ||
| 105 | - esac | ||
| 106 | -else | ||
| 107 | - # find system name and corresponding cc options | ||
| 108 | - CC=${CC-cc} | ||
| 109 | - case `(uname -sr || echo unknown) 2>/dev/null` in | ||
| 110 | - HP-UX*) SFLAGS=${CFLAGS-"-O +z"} | ||
| 111 | - CFLAGS=${CFLAGS-"-O"} | ||
| 112 | -# LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"} | ||
| 113 | - LDSHARED=${LDSHARED-"ld -b"} | ||
| 114 | - case `(uname -m || echo unknown) 2>/dev/null` in | ||
| 115 | - ia64) | ||
| 116 | - shared_ext='.so' | ||
| 117 | - SHAREDLIB='libz.so';; | ||
| 118 | - *) | ||
| 119 | - shared_ext='.sl' | ||
| 120 | - SHAREDLIB='libz.sl';; | ||
| 121 | - esac;; | ||
| 122 | - IRIX*) SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."} | ||
| 123 | - CFLAGS=${CFLAGS-"-ansi -O2"} | ||
| 124 | - LDSHARED=${LDSHARED-"cc -shared"};; | ||
| 125 | - OSF1\ V4*) SFLAGS=${CFLAGS-"-O -std1"} | ||
| 126 | - CFLAGS=${CFLAGS-"-O -std1"} | ||
| 127 | - LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"};; | ||
| 128 | - OSF1*) SFLAGS=${CFLAGS-"-O -std1"} | ||
| 129 | - CFLAGS=${CFLAGS-"-O -std1"} | ||
| 130 | - LDSHARED=${LDSHARED-"cc -shared"};; | ||
| 131 | - QNX*) SFLAGS=${CFLAGS-"-4 -O"} | ||
| 132 | - CFLAGS=${CFLAGS-"-4 -O"} | ||
| 133 | - LDSHARED=${LDSHARED-"cc"} | ||
| 134 | - RANLIB=${RANLIB-"true"} | ||
| 135 | - AR="cc -A";; | ||
| 136 | - SCO_SV\ 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "} | ||
| 137 | - CFLAGS=${CFLAGS-"-O3"} | ||
| 138 | - LDSHARED=${LDSHARED-"cc -dy -KPIC -G"};; | ||
| 139 | - SunOS\ 5*) SFLAGS=${CFLAGS-"-fast -xcg89 -KPIC -R."} | ||
| 140 | - CFLAGS=${CFLAGS-"-fast -xcg89"} | ||
| 141 | - LDSHARED=${LDSHARED-"cc -G"};; | ||
| 142 | - SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"} | ||
| 143 | - CFLAGS=${CFLAGS-"-O2"} | ||
| 144 | - LDSHARED=${LDSHARED-"ld"};; | ||
| 145 | - SunStudio\ 9*) SFLAGS=${CFLAGS-"-DUSE_MMAP -fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"} | ||
| 146 | - CFLAGS=${CFLAGS-"-DUSE_MMAP -fast -xtarget=ultra3 -xarch=v9b"} | ||
| 147 | - LDSHARED=${LDSHARED-"cc -xarch=v9b"};; | ||
| 148 | - UNIX_System_V\ 4.2.0) | ||
| 149 | - SFLAGS=${CFLAGS-"-KPIC -O"} | ||
| 150 | - CFLAGS=${CFLAGS-"-O"} | ||
| 151 | - LDSHARED=${LDSHARED-"cc -G"};; | ||
| 152 | - UNIX_SV\ 4.2MP) | ||
| 153 | - SFLAGS=${CFLAGS-"-Kconform_pic -O"} | ||
| 154 | - CFLAGS=${CFLAGS-"-O"} | ||
| 155 | - LDSHARED=${LDSHARED-"cc -G"};; | ||
| 156 | - OpenUNIX\ 5) | ||
| 157 | - SFLAGS=${CFLAGS-"-KPIC -O"} | ||
| 158 | - CFLAGS=${CFLAGS-"-O"} | ||
| 159 | - LDSHARED=${LDSHARED-"cc -G"};; | ||
| 160 | - AIX*) # Courtesy of dbakker@arrayasolutions.com | ||
| 161 | - SFLAGS=${CFLAGS-"-O -qmaxmem=8192"} | ||
| 162 | - CFLAGS=${CFLAGS-"-O -qmaxmem=8192"} | ||
| 163 | - LDSHARED=${LDSHARED-"xlc -G"};; | ||
| 164 | - # send working options for other systems to support@gzip.org | ||
| 165 | - *) SFLAGS=${CFLAGS-"-O"} | ||
| 166 | - CFLAGS=${CFLAGS-"-O"} | ||
| 167 | - LDSHARED=${LDSHARED-"cc -shared"};; | ||
| 168 | - esac | ||
| 169 | -fi | ||
| 170 | - | ||
| 171 | -SHAREDLIB=${SHAREDLIB-"libz$shared_ext"} | ||
| 172 | -SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"} | ||
| 173 | -SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"} | ||
| 174 | - | ||
| 175 | -if test $shared -eq 1; then | ||
| 176 | - echo Checking for shared library support... | ||
| 177 | - # we must test in two steps (cc then ld), required at least on SunOS 4.x | ||
| 178 | - if test "`($CC -c $SFLAGS $test.c) 2>&1`" = "" && | ||
| 179 | - test "`($LDSHARED -o $test$shared_ext $test.o) 2>&1`" = ""; then | ||
| 180 | - CFLAGS="$SFLAGS" | ||
| 181 | - LIBS="$SHAREDLIBV" | ||
| 182 | - echo Building shared library $SHAREDLIBV with $CC. | ||
| 183 | - elif test -z "$old_cc" -a -z "$old_cflags"; then | ||
| 184 | - echo No shared library support. | ||
| 185 | - shared=0; | ||
| 186 | - else | ||
| 187 | - echo 'No shared library support; try without defining CC and CFLAGS' | ||
| 188 | - shared=0; | ||
| 189 | - fi | ||
| 190 | -fi | ||
| 191 | -if test $shared -eq 0; then | ||
| 192 | - LDSHARED="$CC" | ||
| 193 | - echo Building static library $LIBS version $VER with $CC. | ||
| 194 | -else | ||
| 195 | - LDFLAGS="-L. ${SHAREDLIBV}" | ||
| 196 | -fi | ||
| 197 | - | ||
| 198 | -cat > $test.c <<EOF | ||
| 199 | -#include <unistd.h> | ||
| 200 | -int main() { return 0; } | ||
| 201 | -EOF | ||
| 202 | -if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | ||
| 203 | - sed < zconf.in.h "/HAVE_UNISTD_H/s%0%1%" > zconf.h | ||
| 204 | - echo "Checking for unistd.h... Yes." | ||
| 205 | -else | ||
| 206 | - cp -p zconf.in.h zconf.h | ||
| 207 | - echo "Checking for unistd.h... No." | ||
| 208 | -fi | ||
| 209 | - | ||
| 210 | -cat > $test.c <<EOF | ||
| 211 | -#include <stdio.h> | ||
| 212 | -#include <stdarg.h> | ||
| 213 | -#include "zconf.h" | ||
| 214 | - | ||
| 215 | -int main() | ||
| 216 | -{ | ||
| 217 | -#ifndef STDC | ||
| 218 | - choke me | ||
| 219 | -#endif | ||
| 220 | - | ||
| 221 | - return 0; | ||
| 222 | -} | ||
| 223 | -EOF | ||
| 224 | - | ||
| 225 | -if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | ||
| 226 | - echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()" | ||
| 227 | - | ||
| 228 | - cat > $test.c <<EOF | ||
| 229 | -#include <stdio.h> | ||
| 230 | -#include <stdarg.h> | ||
| 231 | - | ||
| 232 | -int mytest(char *fmt, ...) | ||
| 233 | -{ | ||
| 234 | - char buf[20]; | ||
| 235 | - va_list ap; | ||
| 236 | - | ||
| 237 | - va_start(ap, fmt); | ||
| 238 | - vsnprintf(buf, sizeof(buf), fmt, ap); | ||
| 239 | - va_end(ap); | ||
| 240 | - return 0; | ||
| 241 | -} | ||
| 242 | - | ||
| 243 | -int main() | ||
| 244 | -{ | ||
| 245 | - return (mytest("Hello%d\n", 1)); | ||
| 246 | -} | ||
| 247 | -EOF | ||
| 248 | - | ||
| 249 | - if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then | ||
| 250 | - echo "Checking for vsnprintf() in stdio.h... Yes." | ||
| 251 | - | ||
| 252 | - cat >$test.c <<EOF | ||
| 253 | -#include <stdio.h> | ||
| 254 | -#include <stdarg.h> | ||
| 255 | - | ||
| 256 | -int mytest(char *fmt, ...) | ||
| 257 | -{ | ||
| 258 | - int n; | ||
| 259 | - char buf[20]; | ||
| 260 | - va_list ap; | ||
| 261 | - | ||
| 262 | - va_start(ap, fmt); | ||
| 263 | - n = vsnprintf(buf, sizeof(buf), fmt, ap); | ||
| 264 | - va_end(ap); | ||
| 265 | - return n; | ||
| 266 | -} | ||
| 267 | - | ||
| 268 | -int main() | ||
| 269 | -{ | ||
| 270 | - return (mytest("Hello%d\n", 1)); | ||
| 271 | -} | ||
| 272 | -EOF | ||
| 273 | - | ||
| 274 | - if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | ||
| 275 | - echo "Checking for return value of vsnprintf()... Yes." | ||
| 276 | - else | ||
| 277 | - CFLAGS="$CFLAGS -DHAS_vsnprintf_void" | ||
| 278 | - echo "Checking for return value of vsnprintf()... No." | ||
| 279 | - echo " WARNING: apparently vsnprintf() does not return a value. zlib" | ||
| 280 | - echo " can build but will be open to possible string-format security" | ||
| 281 | - echo " vulnerabilities." | ||
| 282 | - fi | ||
| 283 | - else | ||
| 284 | - CFLAGS="$CFLAGS -DNO_vsnprintf" | ||
| 285 | - echo "Checking for vsnprintf() in stdio.h... No." | ||
| 286 | - echo " WARNING: vsnprintf() not found, falling back to vsprintf(). zlib" | ||
| 287 | - echo " can build but will be open to possible buffer-overflow security" | ||
| 288 | - echo " vulnerabilities." | ||
| 289 | - | ||
| 290 | - cat >$test.c <<EOF | ||
| 291 | -#include <stdio.h> | ||
| 292 | -#include <stdarg.h> | ||
| 293 | - | ||
| 294 | -int mytest(char *fmt, ...) | ||
| 295 | -{ | ||
| 296 | - int n; | ||
| 297 | - char buf[20]; | ||
| 298 | - va_list ap; | ||
| 299 | - | ||
| 300 | - va_start(ap, fmt); | ||
| 301 | - n = vsprintf(buf, fmt, ap); | ||
| 302 | - va_end(ap); | ||
| 303 | - return n; | ||
| 304 | -} | ||
| 305 | - | ||
| 306 | -int main() | ||
| 307 | -{ | ||
| 308 | - return (mytest("Hello%d\n", 1)); | ||
| 309 | -} | ||
| 310 | -EOF | ||
| 311 | - | ||
| 312 | - if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | ||
| 313 | - echo "Checking for return value of vsprintf()... Yes." | ||
| 314 | - else | ||
| 315 | - CFLAGS="$CFLAGS -DHAS_vsprintf_void" | ||
| 316 | - echo "Checking for return value of vsprintf()... No." | ||
| 317 | - echo " WARNING: apparently vsprintf() does not return a value. zlib" | ||
| 318 | - echo " can build but will be open to possible string-format security" | ||
| 319 | - echo " vulnerabilities." | ||
| 320 | - fi | ||
| 321 | - fi | ||
| 322 | -else | ||
| 323 | - echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()" | ||
| 324 | - | ||
| 325 | - cat >$test.c <<EOF | ||
| 326 | -#include <stdio.h> | ||
| 327 | - | ||
| 328 | -int mytest() | ||
| 329 | -{ | ||
| 330 | - char buf[20]; | ||
| 331 | - | ||
| 332 | - snprintf(buf, sizeof(buf), "%s", "foo"); | ||
| 333 | - return 0; | ||
| 334 | -} | ||
| 335 | - | ||
| 336 | -int main() | ||
| 337 | -{ | ||
| 338 | - return (mytest()); | ||
| 339 | -} | ||
| 340 | -EOF | ||
| 341 | - | ||
| 342 | - if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then | ||
| 343 | - echo "Checking for snprintf() in stdio.h... Yes." | ||
| 344 | - | ||
| 345 | - cat >$test.c <<EOF | ||
| 346 | -#include <stdio.h> | ||
| 347 | - | ||
| 348 | -int mytest() | ||
| 349 | -{ | ||
| 350 | - char buf[20]; | ||
| 351 | - | ||
| 352 | - return snprintf(buf, sizeof(buf), "%s", "foo"); | ||
| 353 | -} | ||
| 354 | - | ||
| 355 | -int main() | ||
| 356 | -{ | ||
| 357 | - return (mytest()); | ||
| 358 | -} | ||
| 359 | -EOF | ||
| 360 | - | ||
| 361 | - if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | ||
| 362 | - echo "Checking for return value of snprintf()... Yes." | ||
| 363 | - else | ||
| 364 | - CFLAGS="$CFLAGS -DHAS_snprintf_void" | ||
| 365 | - echo "Checking for return value of snprintf()... No." | ||
| 366 | - echo " WARNING: apparently snprintf() does not return a value. zlib" | ||
| 367 | - echo " can build but will be open to possible string-format security" | ||
| 368 | - echo " vulnerabilities." | ||
| 369 | - fi | ||
| 370 | - else | ||
| 371 | - CFLAGS="$CFLAGS -DNO_snprintf" | ||
| 372 | - echo "Checking for snprintf() in stdio.h... No." | ||
| 373 | - echo " WARNING: snprintf() not found, falling back to sprintf(). zlib" | ||
| 374 | - echo " can build but will be open to possible buffer-overflow security" | ||
| 375 | - echo " vulnerabilities." | ||
| 376 | - | ||
| 377 | - cat >$test.c <<EOF | ||
| 378 | -#include <stdio.h> | ||
| 379 | - | ||
| 380 | -int mytest() | ||
| 381 | -{ | ||
| 382 | - char buf[20]; | ||
| 383 | - | ||
| 384 | - return sprintf(buf, "%s", "foo"); | ||
| 385 | -} | ||
| 386 | - | ||
| 387 | -int main() | ||
| 388 | -{ | ||
| 389 | - return (mytest()); | ||
| 390 | -} | ||
| 391 | -EOF | ||
| 392 | - | ||
| 393 | - if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | ||
| 394 | - echo "Checking for return value of sprintf()... Yes." | ||
| 395 | - else | ||
| 396 | - CFLAGS="$CFLAGS -DHAS_sprintf_void" | ||
| 397 | - echo "Checking for return value of sprintf()... No." | ||
| 398 | - echo " WARNING: apparently sprintf() does not return a value. zlib" | ||
| 399 | - echo " can build but will be open to possible string-format security" | ||
| 400 | - echo " vulnerabilities." | ||
| 401 | - fi | ||
| 402 | - fi | ||
| 403 | -fi | ||
| 404 | - | ||
| 405 | -cat >$test.c <<EOF | ||
| 406 | -#include <errno.h> | ||
| 407 | -int main() { return 0; } | ||
| 408 | -EOF | ||
| 409 | -if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | ||
| 410 | - echo "Checking for errno.h... Yes." | ||
| 411 | -else | ||
| 412 | - echo "Checking for errno.h... No." | ||
| 413 | - CFLAGS="$CFLAGS -DNO_ERRNO_H" | ||
| 414 | -fi | ||
| 415 | - | ||
| 416 | -cat > $test.c <<EOF | ||
| 417 | -#include <sys/types.h> | ||
| 418 | -#include <sys/mman.h> | ||
| 419 | -#include <sys/stat.h> | ||
| 420 | -caddr_t hello() { | ||
| 421 | - return mmap((caddr_t)0, (off_t)0, PROT_READ, MAP_SHARED, 0, (off_t)0); | ||
| 422 | -} | ||
| 423 | -EOF | ||
| 424 | -if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then | ||
| 425 | - CFLAGS="$CFLAGS -DUSE_MMAP" | ||
| 426 | - echo Checking for mmap support... Yes. | ||
| 427 | -else | ||
| 428 | - echo Checking for mmap support... No. | ||
| 429 | -fi | ||
| 430 | - | ||
| 431 | -CPP=${CPP-"$CC -E"} | ||
| 432 | -case $CFLAGS in | ||
| 433 | - *ASMV*) | ||
| 434 | - if test "`nm $test.o | grep _hello`" = ""; then | ||
| 435 | - CPP="$CPP -DNO_UNDERLINE" | ||
| 436 | - echo Checking for underline in external names... No. | ||
| 437 | - else | ||
| 438 | - echo Checking for underline in external names... Yes. | ||
| 439 | - fi;; | ||
| 440 | -esac | ||
| 441 | - | ||
| 442 | -rm -f $test.[co] $test $test$shared_ext | ||
| 443 | - | ||
| 444 | -# udpate Makefile | ||
| 445 | -sed < Makefile.in " | ||
| 446 | -/^CC *=/s#=.*#=$CC# | ||
| 447 | -/^CFLAGS *=/s#=.*#=$CFLAGS# | ||
| 448 | -/^CPP *=/s#=.*#=$CPP# | ||
| 449 | -/^LDSHARED *=/s#=.*#=$LDSHARED# | ||
| 450 | -/^LIBS *=/s#=.*#=$LIBS# | ||
| 451 | -/^SHAREDLIB *=/s#=.*#=$SHAREDLIB# | ||
| 452 | -/^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV# | ||
| 453 | -/^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM# | ||
| 454 | -/^AR *=/s#=.*#=$AR# | ||
| 455 | -/^RANLIB *=/s#=.*#=$RANLIB# | ||
| 456 | -/^EXE *=/s#=.*#=$EXE# | ||
| 457 | -/^prefix *=/s#=.*#=$prefix# | ||
| 458 | -/^exec_prefix *=/s#=.*#=$exec_prefix# | ||
| 459 | -/^libdir *=/s#=.*#=$libdir# | ||
| 460 | -/^includedir *=/s#=.*#=$includedir# | ||
| 461 | -/^mandir *=/s#=.*#=$mandir# | ||
| 462 | -/^LDFLAGS *=/s#=.*#=$LDFLAGS# | ||
| 463 | -" > Makefile | ||
| 464 | diff -Naur zlib-1.2.3/configure.ac zlib-1.2.3new/configure.ac | ||
| 465 | --- zlib-1.2.3/configure.ac 1970-01-01 01:00:00.000000000 +0100 | ||
| 466 | +++ zlib-1.2.3new/configure.ac 2006-08-07 20:38:31.612402750 +0200 | ||
| 467 | @@ -0,0 +1,14 @@ | ||
| 468 | +AC_INIT(zlib,1.2.3) | ||
| 469 | +AC_CONFIG_SRCDIR(adler32.c) | ||
| 470 | +AM_INIT_AUTOMAKE(zlibs,1.2.3) | ||
| 471 | + | ||
| 472 | +AC_PREREQ([2.59]) | ||
| 473 | + | ||
| 474 | +AC_PROG_CC([gcc]) | ||
| 475 | +AC_PROG_LIBTOOL | ||
| 476 | + | ||
| 477 | +AC_HEADER_STDC | ||
| 478 | + | ||
| 479 | +AC_CONFIG_FILES([Makefile]) | ||
| 480 | + | ||
| 481 | +AC_OUTPUT | ||
| 482 | diff -Naur zlib-1.2.3/Makefile.am zlib-1.2.3new/Makefile.am | ||
| 483 | --- zlib-1.2.3/Makefile.am 2006/10/14 05:35:40 1.1 | ||
| 484 | +++ zlib-1.2.3new/Makefile.am 2006/10/14 05:36:49 | ||
| 485 | @@ -0,0 +1,8 @@ | ||
| 486 | +lib_LTLIBRARIES = libz.la | ||
| 487 | + | ||
| 488 | +libz_la_SOURCES = adler32.c compress.c crc32.c gzio.c uncompr.c deflate.c \ | ||
| 489 | + trees.c zutil.c inflate.c infback.c inftrees.c inffast.c | ||
| 490 | + | ||
| 491 | +libz_la_LDFLAGS = -version-number 1:2:3 | ||
| 492 | + | ||
| 493 | +include_HEADERS = zconf.h zlib.h | ||
| 494 | diff -Naur zlib-1.2.3/Makefile.in zlib-1.2.3new/Makefile.in | ||
| 495 | --- zlib-1.2.3/Makefile.in 2005-07-18 04:25:21.000000000 +0200 | ||
| 496 | +++ zlib-1.2.3new/Makefile.in 1970-01-01 01:00:00.000000000 +0100 | ||
| 497 | @@ -1,154 +0,0 @@ | ||
| 498 | -# Makefile for zlib | ||
| 499 | -# Copyright (C) 1995-2005 Jean-loup Gailly. | ||
| 500 | -# For conditions of distribution and use, see copyright notice in zlib.h | ||
| 501 | - | ||
| 502 | -# To compile and test, type: | ||
| 503 | -# ./configure; make test | ||
| 504 | -# The call of configure is optional if you don't have special requirements | ||
| 505 | -# If you wish to build zlib as a shared library, use: ./configure -s | ||
| 506 | - | ||
| 507 | -# To use the asm code, type: | ||
| 508 | -# cp contrib/asm?86/match.S ./match.S | ||
| 509 | -# make LOC=-DASMV OBJA=match.o | ||
| 510 | - | ||
| 511 | -# To install /usr/local/lib/libz.* and /usr/local/include/zlib.h, type: | ||
| 512 | -# make install | ||
| 513 | -# To install in $HOME instead of /usr/local, use: | ||
| 514 | -# make install prefix=$HOME | ||
| 515 | - | ||
| 516 | -CC=cc | ||
| 517 | - | ||
| 518 | -CFLAGS=-O | ||
| 519 | -#CFLAGS=-O -DMAX_WBITS=14 -DMAX_MEM_LEVEL=7 | ||
| 520 | -#CFLAGS=-g -DDEBUG | ||
| 521 | -#CFLAGS=-O3 -Wall -Wwrite-strings -Wpointer-arith -Wconversion \ | ||
| 522 | -# -Wstrict-prototypes -Wmissing-prototypes | ||
| 523 | - | ||
| 524 | -LDFLAGS=libz.a | ||
| 525 | -LDSHARED=$(CC) | ||
| 526 | -CPP=$(CC) -E | ||
| 527 | - | ||
| 528 | -LIBS=libz.a | ||
| 529 | -SHAREDLIB=libz.so | ||
| 530 | -SHAREDLIBV=libz.so.1.2.3 | ||
| 531 | -SHAREDLIBM=libz.so.1 | ||
| 532 | - | ||
| 533 | -AR=ar rc | ||
| 534 | -RANLIB=ranlib | ||
| 535 | -TAR=tar | ||
| 536 | -SHELL=/bin/sh | ||
| 537 | -EXE= | ||
| 538 | - | ||
| 539 | -prefix = /usr/local | ||
| 540 | -exec_prefix = ${prefix} | ||
| 541 | -libdir = ${exec_prefix}/lib | ||
| 542 | -includedir = ${prefix}/include | ||
| 543 | -mandir = ${prefix}/share/man | ||
| 544 | -man3dir = ${mandir}/man3 | ||
| 545 | - | ||
| 546 | -OBJS = adler32.o compress.o crc32.o gzio.o uncompr.o deflate.o trees.o \ | ||
| 547 | - zutil.o inflate.o infback.o inftrees.o inffast.o | ||
| 548 | - | ||
| 549 | -OBJA = | ||
| 550 | -# to use the asm code: make OBJA=match.o | ||
| 551 | - | ||
| 552 | -TEST_OBJS = example.o minigzip.o | ||
| 553 | - | ||
| 554 | -all: example$(EXE) minigzip$(EXE) | ||
| 555 | - | ||
| 556 | -check: test | ||
| 557 | -test: all | ||
| 558 | - @LD_LIBRARY_PATH=.:$(LD_LIBRARY_PATH) ; export LD_LIBRARY_PATH; \ | ||
| 559 | - echo hello world | ./minigzip | ./minigzip -d || \ | ||
| 560 | - echo ' *** minigzip test FAILED ***' ; \ | ||
| 561 | - if ./example; then \ | ||
| 562 | - echo ' *** zlib test OK ***'; \ | ||
| 563 | - else \ | ||
| 564 | - echo ' *** zlib test FAILED ***'; \ | ||
| 565 | - fi | ||
| 566 | - | ||
| 567 | -libz.a: $(OBJS) $(OBJA) | ||
| 568 | - $(AR) $@ $(OBJS) $(OBJA) | ||
| 569 | - -@ ($(RANLIB) $@ || true) >/dev/null 2>&1 | ||
| 570 | - | ||
| 571 | -match.o: match.S | ||
| 572 | - $(CPP) match.S > _match.s | ||
| 573 | - $(CC) -c _match.s | ||
| 574 | - mv _match.o match.o | ||
| 575 | - rm -f _match.s | ||
| 576 | - | ||
| 577 | -$(SHAREDLIBV): $(OBJS) | ||
| 578 | - $(LDSHARED) -o $@ $(OBJS) | ||
| 579 | - rm -f $(SHAREDLIB) $(SHAREDLIBM) | ||
| 580 | - ln -s $@ $(SHAREDLIB) | ||
| 581 | - ln -s $@ $(SHAREDLIBM) | ||
| 582 | - | ||
| 583 | -example$(EXE): example.o $(LIBS) | ||
| 584 | - $(CC) $(CFLAGS) -o $@ example.o $(LDFLAGS) | ||
| 585 | - | ||
| 586 | -minigzip$(EXE): minigzip.o $(LIBS) | ||
| 587 | - $(CC) $(CFLAGS) -o $@ minigzip.o $(LDFLAGS) | ||
| 588 | - | ||
| 589 | -install: $(LIBS) | ||
| 590 | - -@if [ ! -d $(exec_prefix) ]; then mkdir -p $(exec_prefix); fi | ||
| 591 | - -@if [ ! -d $(includedir) ]; then mkdir -p $(includedir); fi | ||
| 592 | - -@if [ ! -d $(libdir) ]; then mkdir -p $(libdir); fi | ||
| 593 | - -@if [ ! -d $(man3dir) ]; then mkdir -p $(man3dir); fi | ||
| 594 | - cp zlib.h zconf.h $(includedir) | ||
| 595 | - chmod 644 $(includedir)/zlib.h $(includedir)/zconf.h | ||
| 596 | - cp $(LIBS) $(libdir) | ||
| 597 | - cd $(libdir); chmod 755 $(LIBS) | ||
| 598 | - -@(cd $(libdir); $(RANLIB) libz.a || true) >/dev/null 2>&1 | ||
| 599 | - cd $(libdir); if test -f $(SHAREDLIBV); then \ | ||
| 600 | - rm -f $(SHAREDLIB) $(SHAREDLIBM); \ | ||
| 601 | - ln -s $(SHAREDLIBV) $(SHAREDLIB); \ | ||
| 602 | - ln -s $(SHAREDLIBV) $(SHAREDLIBM); \ | ||
| 603 | - (ldconfig || true) >/dev/null 2>&1; \ | ||
| 604 | - fi | ||
| 605 | - cp zlib.3 $(man3dir) | ||
| 606 | - chmod 644 $(man3dir)/zlib.3 | ||
| 607 | -# The ranlib in install is needed on NeXTSTEP which checks file times | ||
| 608 | -# ldconfig is for Linux | ||
| 609 | - | ||
| 610 | -uninstall: | ||
| 611 | - cd $(includedir); \ | ||
| 612 | - cd $(libdir); rm -f libz.a; \ | ||
| 613 | - if test -f $(SHAREDLIBV); then \ | ||
| 614 | - rm -f $(SHAREDLIBV) $(SHAREDLIB) $(SHAREDLIBM); \ | ||
| 615 | - fi | ||
| 616 | - cd $(man3dir); rm -f zlib.3 | ||
| 617 | - | ||
| 618 | -mostlyclean: clean | ||
| 619 | -clean: | ||
| 620 | - rm -f *.o *~ example$(EXE) minigzip$(EXE) \ | ||
| 621 | - libz.* foo.gz so_locations \ | ||
| 622 | - _match.s maketree contrib/infback9/*.o | ||
| 623 | - | ||
| 624 | -maintainer-clean: distclean | ||
| 625 | -distclean: clean | ||
| 626 | - cp -p Makefile.in Makefile | ||
| 627 | - cp -p zconf.in.h zconf.h | ||
| 628 | - rm -f .DS_Store | ||
| 629 | - | ||
| 630 | -tags: | ||
| 631 | - etags *.[ch] | ||
| 632 | - | ||
| 633 | -depend: | ||
| 634 | - makedepend -- $(CFLAGS) -- *.[ch] | ||
| 635 | - | ||
| 636 | -# DO NOT DELETE THIS LINE -- make depend depends on it. | ||
| 637 | - | ||
| 638 | -adler32.o: zlib.h zconf.h | ||
| 639 | -compress.o: zlib.h zconf.h | ||
| 640 | -crc32.o: crc32.h zlib.h zconf.h | ||
| 641 | -deflate.o: deflate.h zutil.h zlib.h zconf.h | ||
| 642 | -example.o: zlib.h zconf.h | ||
| 643 | -gzio.o: zutil.h zlib.h zconf.h | ||
| 644 | -inffast.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h | ||
| 645 | -inflate.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h | ||
| 646 | -infback.o: zutil.h zlib.h zconf.h inftrees.h inflate.h inffast.h | ||
| 647 | -inftrees.o: zutil.h zlib.h zconf.h inftrees.h | ||
| 648 | -minigzip.o: zlib.h zconf.h | ||
| 649 | -trees.o: deflate.h zutil.h zlib.h zconf.h trees.h | ||
| 650 | -uncompr.o: zlib.h zconf.h | ||
| 651 | -zutil.o: zutil.h zlib.h zconf.h | ||
