Changeset 133 for smplayer/vendor/current/zlib/configure
- Timestamp:
- Oct 24, 2012, 7:56:20 PM (13 years ago)
- Location:
- smplayer/vendor/current/zlib
- Files:
-
- 1 edited
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
smplayer/vendor/current/zlib/configure
r121 r133 14 14 # an error. 15 15 16 # start off configure.log 16 17 echo -------------------- >> configure.log 17 18 echo $0 $* >> configure.log 18 19 date >> configure.log 19 20 21 # set command prefix for cross-compilation 20 22 if [ -n "${CHOST}" ]; then 21 23 uname="`echo "${CHOST}" | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/'`" … … 23 25 fi 24 26 27 # destination name for static library 25 28 STATICLIB=libz.a 29 30 # extract zlib version numbers from zlib.h 26 31 VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h` 27 32 VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < zlib.h` 28 33 VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h` 29 34 VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h` 35 36 # establish commands for library building 30 37 if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then 31 38 AR=${AR-"${CROSS_PREFIX}ar"} … … 48 55 NM=${NM-"nm"} 49 56 fi 57 58 # set defaults before processing command line options 50 59 LDCONFIG=${LDCONFIG-"ldconfig"} 51 60 LDSHAREDLIBC="${LDSHAREDLIBC--lc}" … … 69 78 PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)' 70 79 80 # process command line options 71 81 while test $# -ge 1 72 82 do … … 101 111 done 102 112 113 # define functions for testing compiler and library characteristics and logging the results 103 114 test=ztest$$ 104 115 … … 137 148 fi 138 149 139 echo >> configure.log 140 150 tryboth() 151 { 152 show $* 153 got=`( $* ) 2>&1` 154 ret=$? 155 printf %s "$got" >> configure.log 156 if test $ret -ne 0; then 157 return $ret 158 fi 159 test "$got" = "" 160 } 161 162 echo >> configure.log 163 164 # check for gcc vs. cc and set compile and link flags based on the system identified by uname 141 165 cat > $test.c <<EOF 142 166 extern int getchar(); … … 150 174 case "$cc" in 151 175 *gcc*) gcc=1 ;; 176 *clang*) gcc=1 ;; 152 177 esac 153 178 case `$cc -v 2>&1` in … … 207 232 SHAREDLIBM=libz.$VER1$shared_ext 208 233 LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"} 209 AR=" libtool"234 AR="/usr/bin/libtool" 210 235 ARFLAGS="-o" ;; 211 236 *) LDSHARED=${LDSHARED-"$cc -shared"} ;; … … 252 277 LDSHARED=${LDSHARED-"cc -dy -KPIC -G"} ;; 253 278 SunOS\ 5* | solaris*) 254 LDSHARED=${LDSHARED-"cc -G"} 255 case `(uname -m || echo unknown) 2>/dev/null` in 256 i86*) 257 SFLAGS=${CFLAGS-"-xpentium -fast -KPIC -R."} 258 CFLAGS=${CFLAGS-"-xpentium -fast"} ;; 259 *) 260 SFLAGS=${CFLAGS-"-fast -xcg92 -KPIC -R."} 261 CFLAGS=${CFLAGS-"-fast -xcg92"} ;; 262 esac ;; 279 LDSHARED=${LDSHARED-"cc -G -h libz$shared_ext.$VER1"} 280 SFLAGS=${CFLAGS-"-fast -KPIC"} 281 CFLAGS=${CFLAGS-"-fast"} 282 if test $build64 -eq 1; then 283 # old versions of SunPRO/Workshop/Studio don't support -m64, 284 # but newer ones do. Check for it. 285 flag64=`$CC -flags | egrep -- '^-m64'` 286 if test x"$flag64" != x"" ; then 287 CFLAGS="${CFLAGS} -m64" 288 SFLAGS="${SFLAGS} -m64" 289 else 290 case `(uname -m || echo unknown) 2>/dev/null` in 291 i86*) 292 SFLAGS="$SFLAGS -xarch=amd64" 293 CFLAGS="$CFLAGS -xarch=amd64" ;; 294 *) 295 SFLAGS="$SFLAGS -xarch=v9" 296 CFLAGS="$CFLAGS -xarch=v9" ;; 297 esac 298 fi 299 fi 300 ;; 263 301 SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"} 264 302 CFLAGS=${CFLAGS-"-O2"} … … 290 328 fi 291 329 330 # destination names for shared library if not defined above 292 331 SHAREDLIB=${SHAREDLIB-"libz$shared_ext"} 293 332 SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"} … … 296 335 echo >> configure.log 297 336 337 # see if shared library build supported 298 338 if test $shared -eq 1; then 299 339 echo Checking for shared library support... | tee -a configure.log … … 323 363 fi 324 364 365 echo >> configure.log 366 367 # check for underscores in external names for use by assembler code 325 368 CPP=${CPP-"$CC -E"} 326 369 case $CFLAGS in … … 338 381 echo >> configure.log 339 382 383 # check for large file support, and if none, check for fseeko() 340 384 cat > $test.c <<EOF 341 385 #include <sys/types.h> … … 368 412 fi 369 413 414 echo >> configure.log 415 416 # check for strerror() for use by gz* functions 417 cat > $test.c <<EOF 418 #include <string.h> 419 #include <errno.h> 420 int main() { return strlen(strerror(errno)); } 421 EOF 422 if try $CC $CFLAGS -o $test $test.c; then 423 echo "Checking for strerror... Yes." | tee -a configure.log 424 else 425 CFLAGS="${CFLAGS} -DNO_STRERROR" 426 SFLAGS="${SFLAGS} -DNO_STRERROR" 427 echo "Checking for strerror... No." | tee -a configure.log 428 fi 429 430 # copy clean zconf.h for subsequent edits 370 431 cp -p zconf.h.in zconf.h 371 432 372 433 echo >> configure.log 373 434 435 # check for unistd.h and save result in zconf.h 374 436 cat > $test.c <<EOF 375 437 #include <unistd.h> … … 386 448 echo >> configure.log 387 449 450 # check for stdarg.h and save result in zconf.h 388 451 cat > $test.c <<EOF 389 452 #include <stdarg.h> … … 398 461 fi 399 462 463 # if the z_ prefix was requested, save that in zconf.h 400 464 if test $zprefix -eq 1; then 401 465 sed < zconf.h "/#ifdef Z_PREFIX.* may be/s/def Z_PREFIX\(.*\) may be/ 1\1 was/" > zconf.temp.h … … 405 469 fi 406 470 471 # if --solo compilation was requested, save that in zconf.h and remove gz stuff from object lists 407 472 if test $solo -eq 1; then 408 473 sed '/#define ZCONF_H/a\ … … 415 480 fi 416 481 482 # if code coverage testing was requested, use older gcc if defined, e.g. "gcc-4.2" on Mac OS X 417 483 if test $cover -eq 1; then 418 484 CFLAGS="${CFLAGS} -fprofile-arcs -ftest-coverage" 419 fi 420 421 echo >> configure.log 422 485 if test -n "$GCC_CLASSIC"; then 486 CC=$GCC_CLASSIC 487 fi 488 fi 489 490 echo >> configure.log 491 492 # conduct a series of tests to resolve eight possible cases of using "vs" or "s" printf functions 493 # (using stdarg or not), with or without "n" (proving size of buffer), and with or without a 494 # return value. The most secure result is vsnprintf() with a return value. snprintf() with a 495 # return value is secure as well, but then gzprintf() will be limited to 20 arguments. 423 496 cat > $test.c <<EOF 424 497 #include <stdio.h> … … 433 506 } 434 507 EOF 435 436 508 if try $CC -c $CFLAGS $test.c; then 437 509 echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a configure.log … … 607 679 fi 608 680 681 # see if we can hide zlib internal symbols that are linked between separate source files 609 682 if test "$gcc" -eq 1; then 610 683 echo >> configure.log 611 684 cat > $test.c <<EOF 612 #if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33) 613 # define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) 614 #else 615 # define ZLIB_INTERNAL 616 #endif 685 #define ZLIB_INTERNAL __attribute__((visibility ("hidden"))) 617 686 int ZLIB_INTERNAL foo; 618 687 int main() … … 621 690 } 622 691 EOF 623 if try $CC -c $CFLAGS $test.c; then 692 if tryboth $CC -c $CFLAGS $test.c; then 693 CFLAGS="$CFLAGS -DHAVE_HIDDEN" 694 SFLAGS="$SFLAGS -DHAVE_HIDDEN" 624 695 echo "Checking for attribute(visibility) support... Yes." | tee -a configure.log 625 696 else 626 CFLAGS="$CFLAGS -DNO_VIZ"627 SFLAGS="$SFLAGS -DNO_VIZ"628 697 echo "Checking for attribute(visibility) support... No." | tee -a configure.log 629 698 fi 630 699 fi 631 700 701 echo >> configure.log 702 703 # find a four-byte unsiged integer type for crc calculations 704 cat > $test.c <<EOF 705 #include <stdio.h> 706 #define is32(n,t) for(n=1,k=0;n;n<<=1,k++);if(k==32){puts(t);return 0;} 707 int main() { 708 int k; 709 unsigned i; 710 unsigned long l; 711 unsigned short s; 712 is32(i, "unsigned") 713 is32(l, "unsigned long") 714 is32(s, "unsigned short") 715 return 1; 716 } 717 EOF 718 Z_U4="" 719 if try $CC $CFLAGS $test.c -o $test && Z_U4=`./$test` && test -n "$Z_U4"; then 720 sed < zconf.h "/#define Z_U4/s/\/\* \.\/configure may/#define Z_U4 $Z_U4 \/* .\/configure put the/" > zconf.temp.h 721 mv zconf.temp.h zconf.h 722 echo "Looking for a four-byte integer type... Found." | tee -a configure.log 723 else 724 echo "Looking for a four-byte integer type... Not found." | tee -a configure.log 725 fi 726 727 # clean up files produced by running the compiler and linker 632 728 rm -f $test.[co] $test $test$shared_ext $test.gcno 633 729 … … 655 751 echo TEST = $TEST >> configure.log 656 752 echo VER = $VER >> configure.log 753 echo Z_U4 = $Z_U4 >> configure.log 657 754 echo exec_prefix = $exec_prefix >> configure.log 658 755 echo includedir = $includedir >> configure.log … … 666 763 echo >> configure.log 667 764 668 # udpate Makefile 765 # udpate Makefile with the configure results 669 766 sed < Makefile.in " 670 767 /^CC *=/s#=.*#=$CC# … … 696 793 " > Makefile 697 794 795 # create zlib.pc with the configure results 698 796 sed < zlib.pc.in " 699 797 /^CC *=/s#=.*#=$CC#
Note:
See TracChangeset
for help on using the changeset viewer.