2014-01-15 202 views
1

我正在嘗試爲MAC OSX上的powerpc嵌入式目標交叉編譯zlib庫。如何在MAC OSX上與共享庫交叉編譯zlib?

我嘗試了建議: - http://liwende.blogspot.com/2008/02/how-to-cross-compile-zlib-openssl.html - http://www.ailis.de/~k/archives/19-arm-cross-compiling-howto.html - http://www.cnx-software.com/2011/10/06/cross-comping-zlib-for-arm-target/

但是,當庫名稱是不是沒有是.so這是名爲.dylib。

zlib-1.2.8]$ CC=powerpc-linux-gcc \ 
> AR=powerpc-linux-ar RANLIB=powerpc-linux-ranlib \ 
> AS=powerpc-linux-as LD=powerpc-linux-ld \ 
> LDSHARED="powerpc-linux-gcc -shared -Wl,-soname,libz.so.1" \ 
> ./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. 

回答

2

不像其他的GNU軟件沒有--host,--build,--target選項,同時配置zlib庫。

你將不得不通過CHOST變量在配置zlib的

CHOST=powerpc-linux ./configure --prefix=/usr --enable-shared 
make 
make install 
+0

哇!那很快。謝謝@MuraliPaluru,工作! – user1436087