Author Archive

Cross Compiling Python 2.6.2 For ARM Cross Compiling Python for Embedded Linux

Tried to Cross Compile Python 2.6.2 For my ARM board, got success to successfully port python on ARM board, On ARM board Embedded Linux is already ported and running fine.

https://i0.wp.com/www.python.org/images/python-logo.gif?resize=123%2C40 ==>>  https://i2.wp.com/www.arm.com/images/site/arm_logo.gif?resize=115%2C37

Here are simple steps to Cross compile python for ARM target board.

1) setup ARM tool chain with X11
2) export PKG_CONFIG_PATH

install dependencies
====================

Dependencies taken from DEBIAN
——————————
1) libdb
copy

2) libsqlite3
copy and change prefix in sqlite3.pc

3) ncursesw
copy

Dependencies installed from source
———————————–
1) bzip2
edit Makefile

CC=arm-linux-gcc
AR=arm-linux-ar
RANLIB=arm-linux-ranlib
PREFIX=your_toolchain_prefix_path

make
make install

2) gdbm
./configure –host=arm-linux –target=arm-linux –prefix=/xxx/yyy –enable-shared
make
make install
3) tcl-8.4.19
cd to unix folder

export ac_cv_func_strtod=yes
export tcl_cv_strtod_buggy=1

CC=arm-linux-gcc ./configure –host=arm-linux –prefix=/xxx/yyy

make
make install DESTDIR=/xxx/yyy

Note: dont install in prefix otherwise tk is not compiling.

4) tk-8.4.19

./configure –host=arm-linux CC=arm-linux-gcc
–prefix=/xxx/yyy –with-tcl=<path to unix folder in source of tcl>

make

make install

Note: you may have to move X11R6 from toolchain to /usr because its looking  in /usr for the X11 libs. if you do so remember to take backup of your /usr/X11R6 and then restore when you are done cross compiling python. Later find out why Makefiles are looking for X11R6 in /usr and change the path in those Makefiles..

5) readline-6.1
./configure
make
make install

6) openssl-0.9.8
There is no need to type configure, a Makefile is already existing. We just need to edit it and change it with way:

INSTALLTOP=/opt/external_packages/openssl/0.9.8g/compiled/xxx-yyy-linux-gnu
OPENSSLDIR=/opt/external_packages/openssl/0.9.8g/compiled/xxx-yyy-linux-gnu

CC= xxx-yyy-linux-gnu-gcc
AR=xxx-yyy-linux-gnu-ar $(ARFLAGS) r
RANLIB= xxx-yyy-linux-gnu-ranlib
To compile and install the OpenSSL project, type successively make and make install. You should find the directories and files listed above under /opt/external_packages/openssl/0.9.8g/compiled/xxx-yyy-linux-gnu/.

change pkg-config files

Patching Python-2.6.2 before crosscompile
—————————————–
1) ./configure
2) make python Parser/pgen
3) mv python hostpython
4) mv Parser/pgen Parser/hostpgen
5) make distclean

6) apply the patch Python-2.6.2-xcompile.patch
patch -p1 < Python-2.6.2-xcompile.patch

7) In Modules/Setup.config and setup.py according to
Setup.config and setup.py (TODO: make patches for setup.py and Setup.config).
8) edit Modules/getaddrinfo.c and change “u_” to “unsigned ”

Compiling Python-2.6.2
———————-
CC=arm-linux-gcc CXX=arm-linux-g++ AR=arm-linux-ar RANLIB=arm-linux-ranlib ./configure –host=arm-linux –build=i686-pc-linux-gnu –prefix=/xxx/yyy
make HOSTPYTHON=./hostpython HOSTPGEN=./Parser/hostpgen BLDSHARED=”arm-linux-gcc -shared” CROSS_COMPILE=arm-linux- CROSS_COMPILE_TARGET=yes
make  install HOSTPYTHON=./hostpython BLDSHARED=”arm-linux-gcc -shared” CROSS_COMPILE=arm-linux- CROSS_COMPILE_TARGET=yes prefix=~/Python-3.1.2

Dependencies – Setup.config and setup.py are configuration files are required to be modify for ARM board.

Downloads required for Cross Compiling Python for Embedded Linux

  1. Setup.config
  2. setup.py

Note -Rename python_setup_file to setup.py
Links –  Download Python

python corss compile patch used.

Number of View :6051

Tags: ,

2 Comments


Steps To Install And Use RSYNC

These are some simple steps to install and use RSYNC client.

1) Download RSYNC and its dependencies from
http://packages.debian.org/etch/rsync

2) Copy all binaries in /sbin folder

3) Copy all libraries in /lib folder

4) If some library is missing download it from debian,
or compile from source if available and copy in /lib folder.

5) create /root/.ssh directories

6) Now you need to create a key,type the following command:

ssh-keygen -t dsa

If it asks you for a passphrase, just hit , to avoid putting one in.

This will create three files

id_dsa
id_dsa.pub
known_hosts

7) To run rsync client run

rsync -a [email protected]:/source/ /destination/

example:

rsync -a [email protected]:/client_pc/media /home/sami/

8) Enter the password.

In the above example,all the files in 192.168.2.145:/client_pc/media
will be copied in /home/sami/media/

Running RSYNC without prompting for password.
———————————————
1) Copy the contents of id_dsa.pub created in step 6 above on the server pc in
file ~/.ssh/authorized_keys.

$ cat id_dsa.pub >>~/.ssh/authorized_keys
$ chmod 700 ~/.ssh/authorized_keys

2) Run rsync from client and test.It will not ask for password.

Number of View :2290

Tags:

No Comments


Cricket Script To Get Score From Cricinfo

###############
score.awk file
###############
#!/bin/sh
#
# Desktop Ticker
#
# dependencies —
# 1) links (‘lynx’ can also be used with slight modification in the script)
# 2) kdialog (comes with kde. script can be modified to use ‘xosd’, which will make it workable on any machine running X)
# 3) score.awk (awk file responsible parsing. contents of the file is pasted below the script)
#
#
# Instructions to use —
# 2) In ‘url’ variable only thing which is to be changed is the number before ‘.html’. The match number of currently running match can be obtained from

http://www.cricinfo.com

url=”http://content-ind.cricinfo.com/wc2007/engine/match/247464.html?view=scorecard;wrappertype=mainframe

while [ 1 ]
do
links -enable-javascript 0 -dump $url > dump
info=`cat dump | awk -f score.awk | tail -3`
kdialog –passivepopup “$info” 30
#echo “$info” > dump
#osd_cat -f -adobe-times-medium-r-normal-*-20-*-*-*-p-*-iso8859-1 -s 1 -o 30 -d 30 -i 0 dump
done
###############
score.awk file
###############
/innings/ {if($2 == “innings”) print $1, $2}
/not out/ {if($1 == “captain”) print $2, $3, “\t”, $6, $7, $8, $9, $10;
else if($1 == “wicket-keeper”) print $2, $3, “\t”, $6, $7, $8, $9, $10;
else print $1, $2, “\t”, $5, $6, $7, $8, $9;}
/Total/ {print $0}

Number of View :4073

Tags:

2 Comments



SetPageWidth
Content Protected Using Blog Protector By: PcDrome.

Mahol Dot Org is Stephen Fry proof thanks to caching by WP Super Cache