aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-09-09 23:34:45 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-09-09 23:34:45 -0700
commita7d70663cf4a7d4013ff7d285da01a164ed9b207 (patch)
treebbf446cac984191a2bcae6390f366886d0a3de18 /configure
parentf4498bea2865325dce71189af47a047529229f22 (diff)
downloadzlib-a7d70663cf4a7d4013ff7d285da01a164ed9b207.tar.gz
zlib-a7d70663cf4a7d4013ff7d285da01a164ed9b207.tar.bz2
zlib-a7d70663cf4a7d4013ff7d285da01a164ed9b207.zip
zlib 1.2.4.4v1.2.4.4
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure74
1 files changed, 35 insertions, 39 deletions
diff --git a/configure b/configure
index 7ff484b..e729c6c 100755
--- a/configure
+++ b/configure
@@ -13,37 +13,8 @@
13# If you have problems, try without defining CC and CFLAGS before reporting 13# If you have problems, try without defining CC and CFLAGS before reporting
14# an error. 14# an error.
15 15
16# make sure we are running under a compatible shell (stolen from ffmpeg and libnfo,
17# except their's wasn't portable enough due to ! usage, so this is better)
18if test "0$ZLIB_CONFIGURE_EXEC" -lt 1; then
19 unset foo
20 try=0
21 (: ${foo%%bar}) 2>/dev/null
22 if test "$?" -ne 0; then
23 try=1
24 else
25 (: ${foo?}) 2>/dev/null
26 if test "$?" -eq 0; then
27 try=1
28 fi
29 fi
30 if test "$try" -eq 1; then
31 ZLIB_CONFIGURE_EXEC=1
32 export ZLIB_CONFIGURE_EXEC
33 type "bash" > /dev/null 2>&1 && exec bash "$0" "$@"
34 type "ksh" > /dev/null 2>&1 && exec ksh "$0" "$@"
35 if test -x /usr/xpg4/bin/sh; then
36 exec /usr/xpg4/bin/sh "$0" "$@"
37 fi
38# echo "No compatible shell script interpreter found."
39# exit 1
40# we could give up here, but go ahead and give their old sh a try
41 fi
42 unset try
43fi
44
45if [ -n "${CHOST}" ]; then 16if [ -n "${CHOST}" ]; then
46 uname="$(echo "${CHOST}" | sed 's/.*-.*-\(.*\)-.*/\1/')" 17 uname="$(echo "${CHOST}" | sed -e 's/.*-.*-\(.*\)-.*$/\1/' -e 's/.*-\(.*\)-.*/\1/' -e 's/.*-\(.*\)$/\1/')"
47 CROSS_PREFIX="${CHOST}-" 18 CROSS_PREFIX="${CHOST}-"
48fi 19fi
49 20
@@ -53,24 +24,28 @@ VER=`sed -n -e '/VERSION "/s/.*"\(.*\)".*/\1/p' < zlib.h`
53VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < zlib.h` 24VER3=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\\.[0-9]*\).*/\1/p' < zlib.h`
54VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h` 25VER2=`sed -n -e '/VERSION "/s/.*"\([0-9]*\\.[0-9]*\)\\..*/\1/p' < zlib.h`
55VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h` 26VER1=`sed -n -e '/VERSION "/s/.*"\([0-9]*\)\\..*/\1/p' < zlib.h`
56if [ -x "${CROSS_PREFIX}ar" ]; then 27if "${CROSS_PREFIX}ar" --version >/dev/null 2>/dev/null || test $? -lt 126; then
57 AR=${AR-"${CROSS_PREFIX}ar"} 28 AR=${AR-"${CROSS_PREFIX}ar"}
29 test -n "${CROSS_PREFIX}" && echo Using ${AR}
58else 30else
59 AR=${AR-"ar"} 31 AR=${AR-"ar"}
32 test -n "${CROSS_PREFIX}" && echo Using ${AR}
60fi 33fi
61AR_RC="${AR} rc" 34AR_RC="${AR} rc"
62if [ -x "${CROSS_PREFIX}ranlib" ]; then 35if "${CROSS_PREFIX}ranlib" --version >/dev/null 2>/dev/null || test $? -lt 126; then
63 RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"} 36 RANLIB=${RANLIB-"${CROSS_PREFIX}ranlib"}
37 test -n "${CROSS_PREFIX}" && echo Using ${RANLIB}
64else 38else
65 RANLIB=${RANLIB-"ranlib"} 39 RANLIB=${RANLIB-"ranlib"}
66fi 40fi
67if [ -x "${CROSS_PREFIX}nm" ]; then 41if "${CROSS_PREFIX}nm" --version >/dev/null 2>/dev/null || test $? -lt 126; then
68 NM=${NM-"${CROSS_PREFIX}nm"} 42 NM=${NM-"${CROSS_PREFIX}nm"}
43 test -n "${CROSS_PREFIX}" && echo Using ${NM}
69else 44else
70 NM=${NM-"nm"} 45 NM=${NM-"nm"}
71fi 46fi
72LDCONFIG=${LDCONFIG-"ldconfig"} 47LDCONFIG=${LDCONFIG-"ldconfig"}
73LDSHAREDLIBC="${LDSHAREDLIBC-"-lc"}" 48LDSHAREDLIBC="${LDSHAREDLIBC--lc}"
74prefix=${prefix-/usr/local} 49prefix=${prefix-/usr/local}
75exec_prefix=${exec_prefix-'${prefix}'} 50exec_prefix=${exec_prefix-'${prefix}'}
76libdir=${libdir-'${exec_prefix}/lib'} 51libdir=${libdir-'${exec_prefix}/lib'}
@@ -90,11 +65,13 @@ case "$1" in
90 -h* | --help) 65 -h* | --help)
91 echo 'usage:' 66 echo 'usage:'
92 echo ' configure [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX]' 67 echo ' configure [--zprefix] [--prefix=PREFIX] [--eprefix=EXPREFIX]'
93 echo ' [--static] [--64] [--libdir=LIBDIR] [--includedir=INCLUDEDIR]' 68 echo ' [--static] [--64] [--libdir=LIBDIR] [--sharedlibdir=LIBDIR]'
69 echo ' [--includedir=INCLUDEDIR]'
94 exit 0 ;; 70 exit 0 ;;
95 -p*=* | --prefix=*) prefix=`echo $1 | sed 's/.*=//'`; shift ;; 71 -p*=* | --prefix=*) prefix=`echo $1 | sed 's/.*=//'`; shift ;;
96 -e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/.*=//'`; shift ;; 72 -e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/.*=//'`; shift ;;
97 -l*=* | --libdir=*) libdir=`echo $1 | sed 's/.*=//'`; shift ;; 73 -l*=* | --libdir=*) libdir=`echo $1 | sed 's/.*=//'`; shift ;;
74 --sharedlibdir=*) sharedlibdir=`echo $1 | sed 's/.*=//'`; shift ;;
98 -i*=* | --includedir=*) includedir=`echo $1 | sed 's/.*=//'`;shift ;; 75 -i*=* | --includedir=*) includedir=`echo $1 | sed 's/.*=//'`;shift ;;
99 -u*=* | --uname=*) uname=`echo $1 | sed 's/.*=//'`;shift ;; 76 -u*=* | --uname=*) uname=`echo $1 | sed 's/.*=//'`;shift ;;
100 -p* | --prefix) prefix="$2"; shift; shift ;; 77 -p* | --prefix) prefix="$2"; shift; shift ;;
@@ -117,7 +94,7 @@ extern int getchar();
117int hello() {return getchar();} 94int hello() {return getchar();}
118EOF 95EOF
119 96
120test -z "$CC" && echo Checking for gcc... 97test -z "$CC" && echo Checking for ${CROSS_PREFIX}gcc...
121cc=${CC-${CROSS_PREFIX}gcc} 98cc=${CC-${CROSS_PREFIX}gcc}
122cflags=${CFLAGS-"-O3"} 99cflags=${CFLAGS-"-O3"}
123# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure 100# to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
@@ -127,8 +104,8 @@ esac
127 104
128if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then 105if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
129 CC="$cc" 106 CC="$cc"
130 SFLAGS="${CFLAGS-"-O3"} -fPIC" 107 SFLAGS="${CFLAGS--O3} -fPIC"
131 CFLAGS="${CFLAGS-"-O3"}" 108 CFLAGS="${CFLAGS--O3}"
132 if test $build64 -eq 1; then 109 if test $build64 -eq 1; then
133 CFLAGS="${CFLAGS} -m64" 110 CFLAGS="${CFLAGS} -m64"
134 SFLAGS="${SFLAGS} -m64" 111 SFLAGS="${SFLAGS} -m64"
@@ -143,7 +120,7 @@ if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
143 Linux* | linux* | GNU | GNU/* | *BSD | DragonFly) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;; 120 Linux* | linux* | GNU | GNU/* | *BSD | DragonFly) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;;
144 CYGWIN* | Cygwin* | cygwin* | OS/2*) 121 CYGWIN* | Cygwin* | cygwin* | OS/2*)
145 EXE='.exe' ;; 122 EXE='.exe' ;;
146 MINGW*) 123 MINGW*|mingw*)
147 LDSHARED=${LDSHARED-"$cc -shared"} 124 LDSHARED=${LDSHARED-"$cc -shared"}
148 LDSHAREDLIBC="" 125 LDSHAREDLIBC=""
149 EXE='.exe' ;; 126 EXE='.exe' ;;
@@ -527,6 +504,23 @@ EOF
527 fi 504 fi
528fi 505fi
529 506
507cat > $test.c <<EOF
508int foo __attribute__ ((visibility ("hidden")));
509int main()
510{
511 return 0;
512}
513EOF
514if test "`($CC -c -fvisibility=hidden $CFLAGS $test.c) 2>&1`" = ""; then
515 CFLAGS="$CFLAGS -fvisibility=hidden"
516 SFLAGS="$SFLAGS -fvisibility=hidden"
517 echo "Checking for attribute(visibility) support... Yes."
518else
519 CFLAGS="$CFLAGS -DNO_VIZ"
520 SFLAGS="$SFLAGS -DNO_VIZ"
521 echo "Checking for attribute(visibility) support... No."
522fi
523
530CPP=${CPP-"$CC -E"} 524CPP=${CPP-"$CC -E"}
531case $CFLAGS in 525case $CFLAGS in
532 *ASMV*) 526 *ASMV*)
@@ -560,6 +554,7 @@ sed < Makefile.in "
560/^prefix *=/s#=.*#=$prefix# 554/^prefix *=/s#=.*#=$prefix#
561/^exec_prefix *=/s#=.*#=$exec_prefix# 555/^exec_prefix *=/s#=.*#=$exec_prefix#
562/^libdir *=/s#=.*#=$libdir# 556/^libdir *=/s#=.*#=$libdir#
557/^sharedlibdir *=/s#=.*#=$sharedlibdir#
563/^includedir *=/s#=.*#=$includedir# 558/^includedir *=/s#=.*#=$includedir#
564/^mandir *=/s#=.*#=$mandir# 559/^mandir *=/s#=.*#=$mandir#
565/^all: */s#:.*#: $ALL# 560/^all: */s#:.*#: $ALL#
@@ -581,6 +576,7 @@ sed < zlib.pc.in "
581/^prefix *=/s#=.*#=$prefix# 576/^prefix *=/s#=.*#=$prefix#
582/^exec_prefix *=/s#=.*#=$exec_prefix# 577/^exec_prefix *=/s#=.*#=$exec_prefix#
583/^libdir *=/s#=.*#=$libdir# 578/^libdir *=/s#=.*#=$libdir#
579/^sharedlibdir *=/s#=.*#=$sharedlibdir#
584/^includedir *=/s#=.*#=$includedir# 580/^includedir *=/s#=.*#=$includedir#
585/^mandir *=/s#=.*#=$mandir# 581/^mandir *=/s#=.*#=$mandir#
586/^LDFLAGS *=/s#=.*#=$LDFLAGS# 582/^LDFLAGS *=/s#=.*#=$LDFLAGS#