Cross compiling asterisk

Hi guys,

I’ve been trying to cross compile asterisk to arm platform, more exactly to xscale processor. So i have a problem, with termcap and i don’t know how to solve. A first i tried to configure with this command:

./configure --build=i686-linux --host=arm-none-linux-gnueabi --without-pwlib --without-curl --prefix=$PWD/build_cross 

But i got a problem to found termcap support as you can see:

checking for tgetent in -ltinfo... no
checking for tone_zone_find in -ltonezone... no
checking for usb_init in -lusb... no
checking for vorbis_info_init in -lvorbis... no
checking for vpb_open in -lvpb... no
checking for compress in -lz... no
checking for ZT_DIAL_OP_CANCEL in zaptel/zaptel.h... no
configure: error: *** termcap support not found

So i downloaded the libtermcap and cross compile it e execute the configure with option --with-termcap=my_cross_compile_termcappath

I don’t have the error during the config phase any more, what should mean that lib termcap was found, right ?

well, but executing the command make to compile, i got the follow result:

cd editline && test -f config.h || CFLAGS="-pthread -I../..//include -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g3 -ffunction-sections -O6" LDFLAGS="" ./configure --build=i686-pc-linux-gnu --host=arm-none-linux-gnueabi --with-ncurses= --with-curses= --with-termcap=/home/anaum/Projetos/AsteriskEmbbeded/termcap-1.3.1/build_cross --with-tinfo=
loading cache ./config.cache
checking for gcc... arm-none-linux-gnueabi-gcc
checking whether the C compiler (arm-none-linux-gnueabi-gcc -pthread -I../..//include -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g3 -ffunction-sections -O6 ) works... yes
checking whether the C compiler (arm-none-linux-gnueabi-gcc -pthread -I../..//include -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g3 -ffunction-sections -O6 ) is a cross-compiler... yes
checking whether we are using GNU C... yes
checking whether arm-none-linux-gnueabi-gcc accepts -g... yes
checking how to run the C preprocessor... arm-none-linux-gnueabi-gcc -E
checking for mawk... /usr/bin/awk
checking host system type... arm-none-linux-gnueabi
checking for a BSD compatible install... /usr/bin/install -c
checking for ranlib... arm-none-linux-gnueabi-ranlib
checking for ar... /home/anaum/CodeSourcery/Sourcery_G++/bin//arm-none-linux-gnueabi-ar
checking for tgetent in -ltermcap... no
checking for tgetent in -ltinfo... no
checking for tgetent in -lcurses... no
checking for tgetent in -lncurses... no
configure: error: termcap support not found
make[1]: *** [editline/libedit.a] Error 1
make[1]: Leaving directory `/home/anaum/Projetos/AsteriskEmbbeded/asterisk-1.4.26.2/main'
make: *** [main] Error 2

I can note that the termcap path is rigth in the line:

cd editline && test -f config.h || CFLAGS="-pthread -I../..//include -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g3 -ffunction-sections -O6" LDFLAGS="" ./configure --build=i686-pc-linux-gnu --host=arm-none-linux-gnueabi --with-ncurses= --with-curses= --with-termcap=/home/anaum/Projetos/AsteriskEmbbeded/termcap-1.3.1/build_cross --with-tinfo=

Should be a problem in libtermcap cross compilation ?

What should i do to solve this problem ?

Thanks in advance

Felipe

Cross compilation is hard task.
I did it for Cirrus ARM EP 9302 - I used 1.09, also I had success with 1.4
I put library (dont remember now whether I used termcap, or ncurses - I think ncurses) in all places where arm compiler looked.
It was hard task really.

With cross compile you used ?

I’m using CodeSourcery, you think that could be a problem ?
Well , i’d like to run it on xscale , but no problem about use another processor. I want to cross compile for arm platform at least.

Let me see if i undestood, Can i use termcap or ncurses ?

I guess it will be more dificult that i imagine !!!

Thanks

Felipe

I checked my builds - I used ncurses-5.2
Cirrus Arm has one thing called linux-crater.
It contains everything to build image for any of their processors.
I used linux-crater_20080104_d
You can start with
arm.cirrus.com/
There is forum, where lot of things were described. As I remember I had serious problems with cross compiling ncurses - may be it is good to start from:
ailis.de/~k/archives/19-ARM- … howto.html

Thanks !!

I cross compiled successfully the lib ncurses and termcap for arm platform , but the thing that i couldn’t understand is, during the configure step , both library ncurses and termcap are verified OK as you can see

configure:21944: checking for initscr in -lncurses
configure:21979: arm-none-linux-gnueabi-gcc -o conftest -g -O2   conftest.c -lncurses -L/home/anaum/Projetos/AsteriskEmbbeded/ncurses-5.7/build_cross//lib   >&5
configure:21986: $? = 0
configure:22007: result: yes
configure:22037: checking curses.h usability
configure:22054: arm-none-linux-gnueabi-gcc -c -g -O2  -I/home/anaum/Projetos/AsteriskEmbbeded/ncurses-5.7/build_cross//include  conftest.c >&5
configure:22061: $? = 0
configure:22075: result: yes
configure:22079: checking curses.h presence
configure:22094: arm-none-linux-gnueabi-gcc -E  -I/home/anaum/Projetos/AsteriskEmbbeded/ncurses-5.7/build_cross//include  conftest.c
configure:22101: $? = 0
configure:22115: result: yes
configure:22148: checking for curses.h
configure:22155: result: yes

configure:29502: checking for tgetent in -ltermcap
configure:29537: arm-none-linux-gnueabi-gcc -o conftest -g -O2   conftest.c -ltermcap -L/home/anaum/Projetos/AsteriskEmbbeded/termcap-1.3.1/build_cross/lib   >&5
configure:29544: $? = 0
configure:29565: result: yes

but running make the same error, neither ncurses and termcap were found!
There are something to change in make file ?? any suggestion ?


cd editline && test -f config.h || CFLAGS="-pthread -I../..//include -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g3 -ffunction-sections" LDFLAGS="" ./configure --build=i686-pc-linux-gnu --host=arm-none-linux-gnueabi --with-ncurses=/home/anaum/Projetos/AsteriskEmbbeded/ncurses-5.7/build_cross/ --with-curses= --with-termcap=/home/anaum/Projetos/AsteriskEmbbeded/termcap-1.3.1/build_cross --with-tinfo=
loading cache ./config.cache
checking for gcc... arm-none-linux-gnueabi-gcc
checking whether the C compiler (arm-none-linux-gnueabi-gcc -pthread -I../..//include -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g3 -ffunction-sections ) works... yes
checking whether the C compiler (arm-none-linux-gnueabi-gcc -pthread -I../..//include -pipe -Wall -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -g3 -ffunction-sections ) is a cross-compiler... yes
checking whether we are using GNU C... yes
checking whether arm-none-linux-gnueabi-gcc accepts -g... yes
checking how to run the C preprocessor... arm-none-linux-gnueabi-gcc -E
checking for mawk... /usr/bin/awk
checking host system type... arm-none-linux-gnueabi
checking for a BSD compatible install... /usr/bin/install -c
checking for ranlib... arm-none-linux-gnueabi-ranlib
checking for ar... /home/anaum/CodeSourcery/Sourcery_G++/bin//arm-none-linux-gnueabi-ar
checking for tgetent in -ltermcap... no
checking for tgetent in -ltinfo... no
checking for tgetent in -lcurses... no
checking for tgetent in -lncurses... no
configure: error: termcap support not found
make[1]: *** [editline/libedit.a] Error 1
make[1]: Leaving directory `/home/anaum/Projetos/AsteriskEmbbeded/asterisk-1.4.26.2/main'
make: *** [main] Error 2

Thanks in advance

Felipe[/code]

Normally you have couple of things with libraries:
./configure
make
make install
I think you did not done last step, or at least did not done it correctly.
Then - may be during configure (of asterisk) it finds something, but make needs other parts.
I have no deep knowledge with compiling and merging of libraries. I did my project more on intuition then of knowledge and it was small project with small money and I just did it…
You can go deep in make file and see when and why it gives that it cant find libraries.
There is also something like library cache - may be you have library but it is not in cache?

Are you perhaps targeting the NSLU2 or FSG-3 platforms? Oddly enough, I’ve just been playing with this myself today, on my FSG. After mucking about with termcap-related madness for a while, I deleted everything and just did a ipkg install asterisk16 and it worked first time. A couple of config tweaks and the phones were working.

Actually i want to port asterisk to xscale processor, because is the only development kit that i have to test it !!

So , I solved the problem with termcap editing makefile, actually the Makefile.in and configure file.

I’ve been doing something wrong , when the asterisk execute the configure for editlib , that edit file auto generate the make file that will be used to compile, so i was editing the makefile and correct way is edit the configure file or Makefile.in .

Now i’m having a problem with ncurses library, i just cross compile it … let’s see what happen … LOL

Well it’s really a hard work cross compile asterisk … :open_mouth:

Any news i’ll post here !

Thanks

If termcap is OK - I think you dont need ncurses also. You need one of them - at least I think so, but…