title: How do I cross compile zlib with shared library on MAC OSX?
body: <p>I am trying to cross compile zlib library for a powerpc embedded target on MAC OSX. </p>
  
  <p>I tried the suggestions:
  - <a href="http://liwende.blogspot.com/2008/02/how-to-cross-compile-zlib-openssl.html" rel="nofollow">http://liwende.blogspot.com/2008/02/how-to-cross-compile-zlib-openssl.html</a>
  - <a href="http://www.ailis.de/~k/archives/19-arm-cross-compiling-howto.html" rel="nofollow">http://www.ailis.de/~k/archives/19-arm-cross-compiling-howto.html</a>
  - <a href="http://www.cnx-software.com/2011/10/06/cross-comping-zlib-for-arm-target/" rel="nofollow">http://www.cnx-software.com/2011/10/06/cross-comping-zlib-for-arm-target/</a></p>
  
  <p>But when the library name is not .so instead it's .dylib.</p>
  
  <pre><code>zlib-1.2.8]$ CC=powerpc-linux-gcc \
  &gt; AR=powerpc-linux-ar RANLIB=powerpc-linux-ranlib \
  &gt; AS=powerpc-linux-as LD=powerpc-linux-ld \
  &gt; LDSHARED="powerpc-linux-gcc -shared -Wl,-soname,libz.so.1" \
  &gt; ./configure --prefix=/usr --shared
  Checking for shared library support...
  Building shared library libz.1.2.8.dylib with powerpc-linux-gcc.
  Checking for off64_t... Yes.
  Checking for fseeko... Yes.
  Checking for strerror... Yes.
  Checking for unistd.h... Yes.
  Checking for stdarg.h... Yes.
  Checking whether to use vs[n]printf() or s[n]printf()... using vs[n]printf().
  Checking for vsnprintf() in stdio.h... Yes.
  Checking for return value of vsnprintf()... Yes.
  Checking for attribute(visibility) support... Yes.
  </code></pre>