2011年2月27日 星期日

liboauth for cross-compiler

ubuntu 10.10

after download liboauth-0.9.4.tar.gz

$./configure

checking for CURL... no
configure: error: Package requirements (libcurl) were not met:

No package 'libcurl' found

If see above error, u should install libcurl4-openssl-dev as follows below comma liboauth configured:

$sudo apt-get install libcurl4-openssl-dev

install completed! you shall got the configuration success message:

To configure the liboauth for cross-compile as shown below:

[configure without curl]
./configure --prefix=/home/joe/project/test_program/liboauth/liboauth-0.9.4/out CC=arm-none-linux-gnueabi-gcc AR=arm-none-linux-gnueabi-ar AS=arm-none-linux-gnueabi-as RANLIB=arm-none-linux-gnueabi-ranlib OBJDUMP=arm-none-linux-gnueabi-objdump STRIP=arm-none-linux-gnueabi-strip CPPFLAGS=-I/home/joe/project/test_program/liboauth/openssl-1.0.0d/include --disable-curl --disable-libcurl --host=arm LDFLAGS=-L/home/joe/project/test_program/liboauth/openssl-1.0.0d/

[configure with curl]
./configure --prefix=/home/joe/test_program/liboauth-0.9.2/out CC=arm-none-linux-gnueabi-gcc AR=arm-none-linux-gnueabi-ar AS=aarm-none-linux-gnueabi-as RANLIB=aarm-none-linux-gnueabi-ranlib OBJDUMP=arm-none-linux-gnueabi-objdump STRIP=arm-none-linux-gnueabi-strip CPPFLAGS=-I/home/joe/test_program/openssl-1.0.0d/include --host=arm LDFLAGS=-L/home/joe/test_program/openssl-1.0.0d/out/lib CURL_CFLAGS=-I/home/joe/test_program/curl-7.21.4/out/include


note that, must to cross-compile and install openssl before. in this case, the curl is disabled.
more information could see by ./configuration --help

building tests program by cross-compile:

in liboauth-0.9.4/tests folder, if we need to compile example of oauthexample.c

it needs three components including liboauth.a, libcrypto.a and header file of oauth.h.

i didn't try the other examples, it maybe needs the other static library or header file from openssl, just remember that liboauth is depend on openssl.

build oauthexample.c by manual,

arm-none-linux-gnueabi-gcc -c oauthexample.c -I[oauth.h directory]

ex:
arm-none-linux-gnueabi-gcc -c oauthexample.c -I../include

after compiling, the object file oauthexample.o is generated.

and...

arm-none-linux-gnueabi-gcc -o oauthexample oauthexample.o libpath/liboauth.a libpath/libcrypto.a
note that the ordering dependency.

rebuild libcurl, curl source code can be downloaded from http://curl.haxx.se/download.html

configure first,

./configure --prefix=/home/joe/test_program/curl-7.21.4/out CC=arm-hisi-linux-gcc AR=arm-hisi-linux-ar AS=arm-hisi-linux-as RANLIB=arm-hisi-linux-ranlib OBJDUMP=arm-hisi-linux-objdump STRIP=arm-hisi-linux-strip






沒有留言:

張貼留言