Ignore:
Timestamp:
Oct 24, 2012, 7:56:20 PM (13 years ago)
Author:
Silvan Scherrer
Message:

SMplayer: update vendor to 0.8.1

Location:
smplayer/vendor/current/zlib
Files:
1 edited
1 moved

Legend:

Unmodified
Added
Removed
  • smplayer/vendor/current/zlib/configure

    r121 r133  
    1414# an error.
    1515
     16# start off configure.log
    1617echo -------------------- >> configure.log
    1718echo $0 $* >> configure.log
    1819date >> configure.log
    1920
     21# set command prefix for cross-compilation
    2022if [ -n "${CHOST}" ]; then
    2123    uname="`echo "${CHOST}" | sed -e 's/^[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)$/\1/' -e 's/^[^-]*-[^-]*-\([^-]*\)-.*$/\1/'`"
     
    2325fi
    2426
     27# destination name for static library
    2528STATICLIB=libz.a
     29
     30# extract zlib version numbers from zlib.h
    2631VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
    2732VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < zlib.h`
    2833VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h`
    2934VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h`
     35
     36# establish commands for library building
    3037if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then
    3138    AR=${AR-"${CROSS_PREFIX}ar"}
     
    4855    NM=${NM-"nm"}
    4956fi
     57
     58# set defaults before processing command line options
    5059LDCONFIG=${LDCONFIG-"ldconfig"}
    5160LDSHAREDLIBC="${LDSHAREDLIBC--lc}"
     
    6978PIC_OBJC='$(PIC_OBJZ) $(PIC_OBJG)'
    7079
     80# process command line options
    7181while test $# -ge 1
    7282do
     
    101111done
    102112
     113# define functions for testing compiler and library characteristics and logging the results
    103114test=ztest$$
    104115
     
    137148fi
    138149
    139 echo >> configure.log
    140 
     150tryboth()
     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
     162echo >> configure.log
     163
     164# check for gcc vs. cc and set compile and link flags based on the system identified by uname
    141165cat > $test.c <<EOF
    142166extern int getchar();
     
    150174case "$cc" in
    151175  *gcc*) gcc=1 ;;
     176  *clang*) gcc=1 ;;
    152177esac
    153178case `$cc -v 2>&1` in
     
    207232             SHAREDLIBM=libz.$VER1$shared_ext
    208233             LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"}
    209              AR="libtool"
     234             AR="/usr/bin/libtool"
    210235             ARFLAGS="-o" ;;
    211236  *)             LDSHARED=${LDSHARED-"$cc -shared"} ;;
     
    252277             LDSHARED=${LDSHARED-"cc -dy -KPIC -G"} ;;
    253278  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         ;;
    263301  SunOS\ 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
    264302             CFLAGS=${CFLAGS-"-O2"}
     
    290328fi
    291329
     330# destination names for shared library if not defined above
    292331SHAREDLIB=${SHAREDLIB-"libz$shared_ext"}
    293332SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"}
     
    296335echo >> configure.log
    297336
     337# see if shared library build supported
    298338if test $shared -eq 1; then
    299339  echo Checking for shared library support... | tee -a configure.log
     
    323363fi
    324364
     365echo >> configure.log
     366
     367# check for underscores in external names for use by assembler code
    325368CPP=${CPP-"$CC -E"}
    326369case $CFLAGS in
     
    338381echo >> configure.log
    339382
     383# check for large file support, and if none, check for fseeko()
    340384cat > $test.c <<EOF
    341385#include <sys/types.h>
     
    368412fi
    369413
     414echo >> configure.log
     415
     416# check for strerror() for use by gz* functions
     417cat > $test.c <<EOF
     418#include <string.h>
     419#include <errno.h>
     420int main() { return strlen(strerror(errno)); }
     421EOF
     422if try $CC $CFLAGS -o $test $test.c; then
     423  echo "Checking for strerror... Yes." | tee -a configure.log
     424else
     425  CFLAGS="${CFLAGS} -DNO_STRERROR"
     426  SFLAGS="${SFLAGS} -DNO_STRERROR"
     427  echo "Checking for strerror... No." | tee -a configure.log
     428fi
     429
     430# copy clean zconf.h for subsequent edits
    370431cp -p zconf.h.in zconf.h
    371432
    372433echo >> configure.log
    373434
     435# check for unistd.h and save result in zconf.h
    374436cat > $test.c <<EOF
    375437#include <unistd.h>
     
    386448echo >> configure.log
    387449
     450# check for stdarg.h and save result in zconf.h
    388451cat > $test.c <<EOF
    389452#include <stdarg.h>
     
    398461fi
    399462
     463# if the z_ prefix was requested, save that in zconf.h
    400464if test $zprefix -eq 1; then
    401465  sed < zconf.h "/#ifdef Z_PREFIX.* may be/s/def Z_PREFIX\(.*\) may be/ 1\1 was/" > zconf.temp.h
     
    405469fi
    406470
     471# if --solo compilation was requested, save that in zconf.h and remove gz stuff from object lists
    407472if test $solo -eq 1; then
    408473  sed '/#define ZCONF_H/a\
     
    415480fi
    416481
     482# if code coverage testing was requested, use older gcc if defined, e.g. "gcc-4.2" on Mac OS X
    417483if test $cover -eq 1; then
    418484  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
     488fi
     489
     490echo >> 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.
    423496cat > $test.c <<EOF
    424497#include <stdio.h>
     
    433506}
    434507EOF
    435 
    436508if try $CC -c $CFLAGS $test.c; then
    437509  echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()." | tee -a configure.log
     
    607679fi
    608680
     681# see if we can hide zlib internal symbols that are linked between separate source files
    609682if test "$gcc" -eq 1; then
    610683  echo >> configure.log
    611684  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")))
    617686int ZLIB_INTERNAL foo;
    618687int main()
     
    621690}
    622691EOF
    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"
    624695    echo "Checking for attribute(visibility) support... Yes." | tee -a configure.log
    625696  else
    626     CFLAGS="$CFLAGS -DNO_VIZ"
    627     SFLAGS="$SFLAGS -DNO_VIZ"
    628697    echo "Checking for attribute(visibility) support... No." | tee -a configure.log
    629698  fi
    630699fi
    631700
     701echo >> configure.log
     702
     703# find a four-byte unsiged integer type for crc calculations
     704cat > $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;}
     707int 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}
     717EOF
     718Z_U4=""
     719if 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
     723else
     724  echo "Looking for a four-byte integer type... Not found." | tee -a configure.log
     725fi
     726
     727# clean up files produced by running the compiler and linker
    632728rm -f $test.[co] $test $test$shared_ext $test.gcno
    633729
     
    655751echo TEST = $TEST >> configure.log
    656752echo VER = $VER >> configure.log
     753echo Z_U4 = $Z_U4 >> configure.log
    657754echo exec_prefix = $exec_prefix >> configure.log
    658755echo includedir = $includedir >> configure.log
     
    666763echo >> configure.log
    667764
    668 # udpate Makefile
     765# udpate Makefile with the configure results
    669766sed < Makefile.in "
    670767/^CC *=/s#=.*#=$CC#
     
    696793" > Makefile
    697794
     795# create zlib.pc with the configure results
    698796sed < zlib.pc.in "
    699797/^CC *=/s#=.*#=$CC#
Note: See TracChangeset for help on using the changeset viewer.