30 September 2010

Compiling OpenSSL for gp2x Wiz

The GP2X Wiz handheld game machine linux based

For compile OpenSSL in Cross compiler with GPESDK for ARM cpu do this:

Download the GP2X OpenWIZ SDK or Download the GP2X WIZ SDK official of GamePark Holdings (recommended)
Download OpenSSL from sources

unpack all two, and go to OpenSSL source code path

Read INSTALL ;)

Run
./config no-asm --openssldir=/opt/GPH_SDK --prefix=/opt/GPH_SDK
After this step, edit Makefile to use the GP2X SDK cross compiler
Replace tis three values with path and binary of cross compiler, in my case:

CC= /opt/GPH_SDK/tools/gcc-4.0.2-glibc-2.3.6/arm-linux/bin/arm-linux-gcc
AR= /opt/GPH_SDK/tools/gcc-4.0.2-glibc-2.3.6/arm-linux/bin/arm-linux-ar $(ARFLAGS) r
RANLIB= /opt/GPH_SDK/tools/gcc-4.0.2-glibc-2.3.6/arm-linux/bin/arm-linux-ranlib
Compile and enjoy with OpenSSL libraries for your GP2X Wiz (and make software for them!)

(actualisation)

The following code is suitable for testing library on GP2X Wiz:
#include "/opt/arm-openwiz-linux-gnu/include/openssl/md5.h"
#include <stdlib.h>
#include <stdio.h>

int main(int argc, char *argv[])
{
 const unsigned char * originalText = (unsigned char *)"Hello world";
 unsigned char * outputBuffer = malloc(4096);
 unsigned long originalTextLen = 11;
 int len;

 MD5( originalText, originalTextLen, outputBuffer);
 
 for (len=0;len<=15; len++)
 {
  printf("%02x", outputBuffer[len]);
 }
 free(outputBuffer);
 printf("\n");
 return EXIT_SUCCESS;
}
Remember compile them with:
/opt/GPH_SDK/tools/gcc-4.0.2-glibc-2.3.6/arm-linux/bin/arm-linux-gcc main.c -o testOpenSSLarm -lcrypto -L /opt/GPH_SDK/lib -I /opt/GPH_SDK/include -static

Posted at BinaryCell

No comments:

Post a Comment


Disclaimer: In no event shall the blog owner, be liable for any damages, including without limitation, special, indirect or consequential damages, or any damages, whatsoever resulting from access or use, or inability to access or use this Website or arising out of any materials, information, qualifications or recommendations on this Website.