configure
Upload User: shengde
Upload Date: 2021-02-21
Package Size: 638k
Code Size: 15k
Development Platform:

Visual C++

  1. #!/bin/sh
  2. # configure script for zlib.
  3. #
  4. # Normally configure builds both a static and a shared library.
  5. # If you want to build just a static library, use: ./configure --static
  6. #
  7. # To impose specific compiler or flags or install directory, use for example:
  8. #    prefix=$HOME CC=cc CFLAGS="-O4" ./configure
  9. # or for csh/tcsh users:
  10. #    (setenv prefix $HOME; setenv CC cc; setenv CFLAGS "-O4"; ./configure)
  11. # Incorrect settings of CC or CFLAGS may prevent creating a shared library.
  12. # If you have problems, try without defining CC and CFLAGS before reporting
  13. # an error.
  14. STATICLIB=libz.a
  15. LDFLAGS="${LDFLAGS} -L. ${STATICLIB}"
  16. VER=`sed -n -e '/VERSION "/s/.*"(.*)".*/1/p' < zlib.h`
  17. VER3=`sed -n -e '/VERSION "/s/.*"([0-9]*\.[0-9]*\.[0-9]*).*/1/p' < zlib.h`
  18. VER2=`sed -n -e '/VERSION "/s/.*"([0-9]*\.[0-9]*)\..*/1/p' < zlib.h`
  19. VER1=`sed -n -e '/VERSION "/s/.*"([0-9]*)\..*/1/p' < zlib.h`
  20. AR=${AR-"ar"}
  21. AR_RC="${AR} rc"
  22. RANLIB=${RANLIB-"ranlib"}
  23. prefix=${prefix-/usr/local}
  24. exec_prefix=${exec_prefix-'${prefix}'}
  25. libdir=${libdir-'${exec_prefix}/lib'}
  26. includedir=${includedir-'${prefix}/include'}
  27. mandir=${mandir-'${prefix}/share/man'}
  28. shared_ext='.so'
  29. shared=1
  30. zprefix=0
  31. build64=0
  32. gcc=0
  33. old_cc="$CC"
  34. old_cflags="$CFLAGS"
  35. while test $# -ge 1
  36. do
  37. case "$1" in
  38.     -h* | --help)
  39.       echo 'usage:'
  40.       echo '  configure [--zprefix] [--prefix=PREFIX]  [--eprefix=EXPREFIX]'
  41.       echo '    [--static] [--64] [--libdir=LIBDIR] [--includedir=INCLUDEDIR]'
  42.         exit 0 ;;
  43.     -p*=* | --prefix=*) prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift ;;
  44.     -e*=* | --eprefix=*) exec_prefix=`echo $1 | sed 's/[-a-z_]*=//'`; shift ;;
  45.     -l*=* | --libdir=*) libdir=`echo $1 | sed 's/[-a-z_]*=//'`; shift ;;
  46.     -i*=* | --includedir=*) includedir=`echo $1 | sed 's/[-a-z_]*=//'`;shift ;;
  47.     -u*=* | --uname=*) uname=`echo $1 | sed 's/[-a-z_]*=//'`;shift ;;
  48.     -p* | --prefix) prefix="$2"; shift; shift ;;
  49.     -e* | --eprefix) exec_prefix="$2"; shift; shift ;;
  50.     -l* | --libdir) libdir="$2"; shift; shift ;;
  51.     -i* | --includedir) includedir="$2"; shift; shift ;;
  52.     -s* | --shared | --enable-shared) shared=1; shift ;;
  53.     -t | --static) shared=0; shift ;;
  54.     -z* | --zprefix) zprefix=1; shift ;;
  55.     -6* | --64) build64=1; shift ;;
  56.     --sysconfdir=*) echo "ignored option: --sysconfdir"; shift ;;
  57.     --localstatedir=*) echo "ignored option: --localstatedir"; shift ;;
  58.     *) echo "unknown option: $1"; echo "$0 --help for help"; exit 1 ;;
  59.     esac
  60. done
  61. test=ztest$$
  62. cat > $test.c <<EOF
  63. extern int getchar();
  64. int hello() {return getchar();}
  65. EOF
  66. test -z "$CC" && echo Checking for gcc...
  67. cc=${CC-gcc}
  68. cflags=${CFLAGS-"-O3"}
  69. # to force the asm version use: CFLAGS="-O3 -DASMV" ./configure
  70. case "$cc" in
  71.   *gcc*) gcc=1 ;;
  72. esac
  73. if test "$gcc" -eq 1 && ($cc -c $cflags $test.c) 2>/dev/null; then
  74.   CC="$cc"
  75.   SFLAGS="${CFLAGS-"-O3"} -fPIC"
  76.   CFLAGS="${CFLAGS-"-O3"}"
  77.   if test $build64 -eq 1; then
  78.     CFLAGS="${CFLAGS} -m64"
  79.     SFLAGS="${SFLAGS} -m64"
  80.   fi
  81.   if test "${ZLIBGCCWARN}" = "YES"; then
  82.     CFLAGS="${CFLAGS} -Wall -Wextra -pedantic"
  83.   fi
  84.   if test -z "$uname"; then
  85.     uname=`(uname -s || echo unknown) 2>/dev/null`
  86.   fi
  87.   case "$uname" in
  88.   Linux | linux | GNU | GNU/* | *BSD | DragonFly) LDSHARED=${LDSHARED-"$cc -shared -Wl,-soname,libz.so.1,--version-script,zlib.map"} ;;
  89.   CYGWIN* | Cygwin* | cygwin* | OS/2* )
  90.              EXE='.exe' ;;
  91.   QNX*)  # This is for QNX6. I suppose that the QNX rule below is for QNX2,QNX4
  92.          # (alain.bonnefoy@icbt.com)
  93.                  LDSHARED=${LDSHARED-"$cc -shared -Wl,-hlibz.so.1"} ;;
  94.   HP-UX*)
  95.          LDSHARED=${LDSHARED-"$cc -shared $SFLAGS"}
  96.          case `(uname -m || echo unknown) 2>/dev/null` in
  97.          ia64)
  98.                  shared_ext='.so'
  99.                  SHAREDLIB='libz.so' ;;
  100.          *)
  101.                  shared_ext='.sl'
  102.                  SHAREDLIB='libz.sl' ;;
  103.          esac ;;
  104.   Darwin*)   shared_ext='.dylib'
  105.              SHAREDLIB=libz$shared_ext
  106.              SHAREDLIBV=libz.$VER$shared_ext
  107.              SHAREDLIBM=libz.$VER1$shared_ext
  108.              LDSHARED=${LDSHARED-"$cc -dynamiclib -install_name $libdir/$SHAREDLIBM -compatibility_version $VER1 -current_version $VER3"} ;;
  109.   *)             LDSHARED=${LDSHARED-"$cc -shared"} ;;
  110.   esac
  111. else
  112.   # find system name and corresponding cc options
  113.   CC=${CC-cc}
  114.   if test -z "$uname"; then
  115.     uname=`(uname -sr || echo unknown) 2>/dev/null`
  116.   fi
  117.   case "$uname" in
  118.   HP-UX*)    SFLAGS=${CFLAGS-"-O +z"}
  119.              CFLAGS=${CFLAGS-"-O"}
  120. #            LDSHARED=${LDSHARED-"ld -b +vnocompatwarnings"}
  121.              LDSHARED=${LDSHARED-"ld -b"}
  122.          case `(uname -m || echo unknown) 2>/dev/null` in
  123.          ia64)
  124.              shared_ext='.so'
  125.              SHAREDLIB='libz.so' ;;
  126.          *)
  127.              shared_ext='.sl'
  128.              SHAREDLIB='libz.sl' ;;
  129.          esac ;;
  130.   IRIX*)     SFLAGS=${CFLAGS-"-ansi -O2 -rpath ."}
  131.              CFLAGS=${CFLAGS-"-ansi -O2"}
  132.              LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
  133.   OSF1 V4*) SFLAGS=${CFLAGS-"-O -std1"}
  134.              CFLAGS=${CFLAGS-"-O -std1"}
  135.              LDFLAGS="${LDFLAGS} -Wl,-rpath,."
  136.              LDSHARED=${LDSHARED-"cc -shared  -Wl,-soname,libz.so -Wl,-msym -Wl,-rpath,$(libdir) -Wl,-set_version,${VER}:1.0"} ;;
  137.   OSF1*)     SFLAGS=${CFLAGS-"-O -std1"}
  138.              CFLAGS=${CFLAGS-"-O -std1"}
  139.              LDSHARED=${LDSHARED-"cc -shared -Wl,-soname,libz.so.1"} ;;
  140.   QNX*)      SFLAGS=${CFLAGS-"-4 -O"}
  141.              CFLAGS=${CFLAGS-"-4 -O"}
  142.              LDSHARED=${LDSHARED-"cc"}
  143.              RANLIB=${RANLIB-"true"}
  144.              AR_RC="cc -A" ;;
  145.   SCO_SV 3.2*) SFLAGS=${CFLAGS-"-O3 -dy -KPIC "}
  146.              CFLAGS=${CFLAGS-"-O3"}
  147.              LDSHARED=${LDSHARED-"cc -dy -KPIC -G"} ;;
  148.   SunOS 5*) LDSHARED=${LDSHARED-"cc -G"}
  149.          case `(uname -m || echo unknown) 2>/dev/null` in
  150.          i86*)
  151.              SFLAGS=${CFLAGS-"-xpentium -fast -KPIC -R."}
  152.              CFLAGS=${CFLAGS-"-xpentium -fast"} ;;
  153.          *)
  154.              SFLAGS=${CFLAGS-"-fast -xcg92 -KPIC -R."}
  155.              CFLAGS=${CFLAGS-"-fast -xcg92"} ;;
  156.          esac ;;
  157.   SunOS 4*) SFLAGS=${CFLAGS-"-O2 -PIC"}
  158.              CFLAGS=${CFLAGS-"-O2"}
  159.              LDSHARED=${LDSHARED-"ld"} ;;
  160.   SunStudio 9*) SFLAGS=${CFLAGS-"-fast -xcode=pic32 -xtarget=ultra3 -xarch=v9b"}
  161.              CFLAGS=${CFLAGS-"-fast -xtarget=ultra3 -xarch=v9b"}
  162.              LDSHARED=${LDSHARED-"cc -xarch=v9b"} ;;
  163.   UNIX_System_V 4.2.0)
  164.              SFLAGS=${CFLAGS-"-KPIC -O"}
  165.              CFLAGS=${CFLAGS-"-O"}
  166.              LDSHARED=${LDSHARED-"cc -G"} ;;
  167.   UNIX_SV 4.2MP)
  168.              SFLAGS=${CFLAGS-"-Kconform_pic -O"}
  169.              CFLAGS=${CFLAGS-"-O"}
  170.              LDSHARED=${LDSHARED-"cc -G"} ;;
  171.   OpenUNIX 5)
  172.              SFLAGS=${CFLAGS-"-KPIC -O"}
  173.              CFLAGS=${CFLAGS-"-O"}
  174.              LDSHARED=${LDSHARED-"cc -G"} ;;
  175.   AIX*)  # Courtesy of dbakker@arrayasolutions.com
  176.              SFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
  177.              CFLAGS=${CFLAGS-"-O -qmaxmem=8192"}
  178.              LDSHARED=${LDSHARED-"xlc -G"} ;;
  179.   # send working options for other systems to zlib@gzip.org
  180.   *)         SFLAGS=${CFLAGS-"-O"}
  181.              CFLAGS=${CFLAGS-"-O"}
  182.              LDSHARED=${LDSHARED-"cc -shared"} ;;
  183.   esac
  184. fi
  185. SHAREDLIB=${SHAREDLIB-"libz$shared_ext"}
  186. SHAREDLIBV=${SHAREDLIBV-"libz$shared_ext.$VER"}
  187. SHAREDLIBM=${SHAREDLIBM-"libz$shared_ext.$VER1"}
  188. if test $shared -eq 1; then
  189.   echo Checking for shared library support...
  190.   # we must test in two steps (cc then ld), required at least on SunOS 4.x
  191.   if test "`($CC -w -c $SFLAGS $test.c) 2>&1`" = "" &&
  192.      test "`($LDSHARED $SFLAGS -o $test$shared_ext $test.o) 2>&1`" = ""; then
  193.     echo Building shared library $SHAREDLIBV with $CC.
  194.   elif test -z "$old_cc" -a -z "$old_cflags"; then
  195.     echo No shared library support.
  196.     shared=0;
  197.   else
  198.     echo Tested $CC -w -c $SFLAGS $test.c
  199.     $CC -w -c $SFLAGS $test.c
  200.     echo Tested $LDSHARED $SFLAGS -o $test$shared_ext $test.o
  201.     $LDSHARED $SFLAGS -o $test$shared_ext $test.o
  202.     echo 'No shared library support; try without defining CC and CFLAGS'
  203.     shared=0;
  204.   fi
  205. fi
  206. if test $shared -eq 0; then
  207.   LDSHARED="$CC"
  208.   ALL="static"
  209.   TEST="all teststatic"
  210.   SHAREDLIB=""
  211.   SHAREDLIBV=""
  212.   SHAREDLIBM=""
  213.   echo Building static library $STATICLIB version $VER with $CC.
  214. else
  215.   ALL="static shared"
  216.   TEST="all teststatic testshared"
  217. fi
  218. cat > $test.c <<EOF
  219. #include <sys/types.h>
  220. off64_t dummy = 0;
  221. EOF
  222. if test "`($CC -c $CFLAGS -D_LARGEFILE64_SOURCE=1 $test.c) 2>&1`" = ""; then
  223.   CFLAGS="${CFLAGS} -D_LARGEFILE64_SOURCE=1"
  224.   SFLAGS="${SFLAGS} -D_LARGEFILE64_SOURCE=1"
  225.   ALL="${ALL} all64"
  226.   TEST="${TEST} test64"
  227.   echo "Checking for off64_t... Yes."
  228.   echo "Checking for fseeko... Yes."
  229. else
  230.   echo "Checking for off64_t... No."
  231.   cat > $test.c <<EOF
  232. #include <stdio.h>
  233. int main(void) {
  234.   fseeko(NULL, 0, 0);
  235.   return 0;
  236. }
  237. EOF
  238.   if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then
  239.     echo "Checking for fseeko... Yes."
  240.   else
  241.     CFLAGS="${CFLAGS} -DNO_FSEEKO"
  242.     SFLAGS="${SFLAGS} -DNO_FSEEKO"
  243.     echo "Checking for fseeko... No."
  244.   fi
  245. fi
  246. cp -p zconf.h.in zconf.h
  247. cat > $test.c <<EOF
  248. #include <unistd.h>
  249. int main() { return 0; }
  250. EOF
  251. if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
  252.   sed < zconf.h "/^#ifdef HAVE_UNISTD_H.* may be/s/def HAVE_UNISTD_H(.*) may be/ 11 was/" > zconf.temp.h
  253.   mv zconf.temp.h zconf.h
  254.   echo "Checking for unistd.h... Yes."
  255. else
  256.   echo "Checking for unistd.h... No."
  257. fi
  258. if test $zprefix -eq 1; then
  259.   sed < zconf.h "/#ifdef Z_PREFIX.* may be/s/def Z_PREFIX(.*) may be/ 11 was/" > zconf.temp.h
  260.   mv zconf.temp.h zconf.h
  261.   echo "Using z_ prefix on all symbols."
  262. fi
  263. cat > $test.c <<EOF
  264. #include <stdio.h>
  265. #include <stdarg.h>
  266. #include "zconf.h"
  267. int main()
  268. {
  269. #ifndef STDC
  270.   choke me
  271. #endif
  272.   return 0;
  273. }
  274. EOF
  275. if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
  276.   echo "Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf()."
  277.   cat > $test.c <<EOF
  278. #include <stdio.h>
  279. #include <stdarg.h>
  280. int mytest(const char *fmt, ...)
  281. {
  282.   char buf[20];
  283.   va_list ap;
  284.   va_start(ap, fmt);
  285.   vsnprintf(buf, sizeof(buf), fmt, ap);
  286.   va_end(ap);
  287.   return 0;
  288. }
  289. int main()
  290. {
  291.   return (mytest("Hello%dn", 1));
  292. }
  293. EOF
  294.   if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then
  295.     echo "Checking for vsnprintf() in stdio.h... Yes."
  296.     cat >$test.c <<EOF
  297. #include <stdio.h>
  298. #include <stdarg.h>
  299. int mytest(const char *fmt, ...)
  300. {
  301.   int n;
  302.   char buf[20];
  303.   va_list ap;
  304.   va_start(ap, fmt);
  305.   n = vsnprintf(buf, sizeof(buf), fmt, ap);
  306.   va_end(ap);
  307.   return n;
  308. }
  309. int main()
  310. {
  311.   return (mytest("Hello%dn", 1));
  312. }
  313. EOF
  314.     if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
  315.       echo "Checking for return value of vsnprintf()... Yes."
  316.     else
  317.       CFLAGS="$CFLAGS -DHAS_vsnprintf_void"
  318.       SFLAGS="$SFLAGS -DHAS_vsnprintf_void"
  319.       echo "Checking for return value of vsnprintf()... No."
  320.       echo "  WARNING: apparently vsnprintf() does not return a value. zlib"
  321.       echo "  can build but will be open to possible string-format security"
  322.       echo "  vulnerabilities."
  323.     fi
  324.   else
  325.     CFLAGS="$CFLAGS -DNO_vsnprintf"
  326.     SFLAGS="$SFLAGS -DNO_vsnprintf"
  327.     echo "Checking for vsnprintf() in stdio.h... No."
  328.     echo "  WARNING: vsnprintf() not found, falling back to vsprintf(). zlib"
  329.     echo "  can build but will be open to possible buffer-overflow security"
  330.     echo "  vulnerabilities."
  331.     cat >$test.c <<EOF
  332. #include <stdio.h>
  333. #include <stdarg.h>
  334. int mytest(const char *fmt, ...)
  335. {
  336.   int n;
  337.   char buf[20];
  338.   va_list ap;
  339.   va_start(ap, fmt);
  340.   n = vsprintf(buf, fmt, ap);
  341.   va_end(ap);
  342.   return n;
  343. }
  344. int main()
  345. {
  346.   return (mytest("Hello%dn", 1));
  347. }
  348. EOF
  349.     if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
  350.       echo "Checking for return value of vsprintf()... Yes."
  351.     else
  352.       CFLAGS="$CFLAGS -DHAS_vsprintf_void"
  353.       SFLAGS="$SFLAGS -DHAS_vsprintf_void"
  354.       echo "Checking for return value of vsprintf()... No."
  355.       echo "  WARNING: apparently vsprintf() does not return a value. zlib"
  356.       echo "  can build but will be open to possible string-format security"
  357.       echo "  vulnerabilities."
  358.     fi
  359.   fi
  360. else
  361.   echo "Checking whether to use vs[n]printf() or s[n]printf()... using s[n]printf()."
  362.   cat >$test.c <<EOF
  363. #include <stdio.h>
  364. int mytest()
  365. {
  366.   char buf[20];
  367.   snprintf(buf, sizeof(buf), "%s", "foo");
  368.   return 0;
  369. }
  370. int main()
  371. {
  372.   return (mytest());
  373. }
  374. EOF
  375.   if test "`($CC $CFLAGS -o $test $test.c) 2>&1`" = ""; then
  376.     echo "Checking for snprintf() in stdio.h... Yes."
  377.     cat >$test.c <<EOF
  378. #include <stdio.h>
  379. int mytest()
  380. {
  381.   char buf[20];
  382.   return snprintf(buf, sizeof(buf), "%s", "foo");
  383. }
  384. int main()
  385. {
  386.   return (mytest());
  387. }
  388. EOF
  389.     if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
  390.       echo "Checking for return value of snprintf()... Yes."
  391.     else
  392.       CFLAGS="$CFLAGS -DHAS_snprintf_void"
  393.       SFLAGS="$SFLAGS -DHAS_snprintf_void"
  394.       echo "Checking for return value of snprintf()... No."
  395.       echo "  WARNING: apparently snprintf() does not return a value. zlib"
  396.       echo "  can build but will be open to possible string-format security"
  397.       echo "  vulnerabilities."
  398.     fi
  399.   else
  400.     CFLAGS="$CFLAGS -DNO_snprintf"
  401.     SFLAGS="$SFLAGS -DNO_snprintf"
  402.     echo "Checking for snprintf() in stdio.h... No."
  403.     echo "  WARNING: snprintf() not found, falling back to sprintf(). zlib"
  404.     echo "  can build but will be open to possible buffer-overflow security"
  405.     echo "  vulnerabilities."
  406.     cat >$test.c <<EOF
  407. #include <stdio.h>
  408. int mytest()
  409. {
  410.   char buf[20];
  411.   return sprintf(buf, "%s", "foo");
  412. }
  413. int main()
  414. {
  415.   return (mytest());
  416. }
  417. EOF
  418.     if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
  419.       echo "Checking for return value of sprintf()... Yes."
  420.     else
  421.       CFLAGS="$CFLAGS -DHAS_sprintf_void"
  422.       SFLAGS="$SFLAGS -DHAS_sprintf_void"
  423.       echo "Checking for return value of sprintf()... No."
  424.       echo "  WARNING: apparently sprintf() does not return a value. zlib"
  425.       echo "  can build but will be open to possible string-format security"
  426.       echo "  vulnerabilities."
  427.     fi
  428.   fi
  429. fi
  430. cat >$test.c <<EOF
  431. #include <errno.h>
  432. int main() { return 0; }
  433. EOF
  434. if test "`($CC -c $CFLAGS $test.c) 2>&1`" = ""; then
  435.   echo "Checking for errno.h... Yes."
  436. else
  437.   echo "Checking for errno.h... No."
  438.   CFLAGS="$CFLAGS -DNO_ERRNO_H"
  439.   SFLAGS="$SFLAGS -DNO_ERRNO_H"
  440. fi
  441. CPP=${CPP-"$CC -E"}
  442. case $CFLAGS in
  443.   *ASMV*)
  444.     if test "`nm $test.o | grep _hello`" = ""; then
  445.       CPP="$CPP -DNO_UNDERLINE"
  446.       echo Checking for underline in external names... No.
  447.     else
  448.       echo Checking for underline in external names... Yes.
  449.     fi ;;
  450. esac
  451. rm -f $test.[co] $test $test$shared_ext
  452. # udpate Makefile
  453. sed < Makefile.in "
  454. /^CC *=/s#=.*#=$CC#
  455. /^CFLAGS *=/s#=.*#=$CFLAGS#
  456. /^SFLAGS *=/s#=.*#=$SFLAGS#
  457. /^LDFLAGS *=/s#=.*#=$LDFLAGS#
  458. /^LDSHARED *=/s#=.*#=$LDSHARED#
  459. /^CPP *=/s#=.*#=$CPP#
  460. /^STATICLIB *=/s#=.*#=$STATICLIB#
  461. /^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
  462. /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
  463. /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
  464. /^AR *=/s#=.*#=$AR_RC#
  465. /^RANLIB *=/s#=.*#=$RANLIB#
  466. /^EXE *=/s#=.*#=$EXE#
  467. /^prefix *=/s#=.*#=$prefix#
  468. /^exec_prefix *=/s#=.*#=$exec_prefix#
  469. /^libdir *=/s#=.*#=$libdir#
  470. /^includedir *=/s#=.*#=$includedir#
  471. /^mandir *=/s#=.*#=$mandir#
  472. /^all: */s#:.*#: $ALL#
  473. /^test: */s#:.*#: $TEST#
  474. " > Makefile
  475. sed < zlib.pc.in "
  476. /^CC *=/s#=.*#=$CC#
  477. /^CFLAGS *=/s#=.*#=$CFLAGS#
  478. /^CPP *=/s#=.*#=$CPP#
  479. /^LDSHARED *=/s#=.*#=$LDSHARED#
  480. /^STATICLIB *=/s#=.*#=$STATICLIB#
  481. /^SHAREDLIB *=/s#=.*#=$SHAREDLIB#
  482. /^SHAREDLIBV *=/s#=.*#=$SHAREDLIBV#
  483. /^SHAREDLIBM *=/s#=.*#=$SHAREDLIBM#
  484. /^AR *=/s#=.*#=$AR_RC#
  485. /^RANLIB *=/s#=.*#=$RANLIB#
  486. /^EXE *=/s#=.*#=$EXE#
  487. /^prefix *=/s#=.*#=$prefix#
  488. /^exec_prefix *=/s#=.*#=$exec_prefix#
  489. /^libdir *=/s#=.*#=$libdir#
  490. /^includedir *=/s#=.*#=$includedir#
  491. /^mandir *=/s#=.*#=$mandir#
  492. /^LDFLAGS *=/s#=.*#=$LDFLAGS#
  493. " | sed -e "
  494. s/@VERSION@/$VER/g;
  495. " > zlib.pc