Reputation: 378
I'm trying to cross-compile asterisk for ARM.
Everything's fine when I cross compile mandatory modules like sqlite3, ncurses and openssl and then including them when cross-compiling asterisk with their respective option --with-sqlite3, --with-ncurses --with-crypto and --with-ssl.
But when I tried to include dahdi, nothing came true. This happened when --with-dahdi=$(DAHDI_DIR)/linux:
checking for tone_zone_find_by_num in -ltonezone...no
checking for tone_zone_find in -ltonezone... no
I know it went right when it can check the tonezone and then looking for the dahdi/tonezone.h. I then see no error, but chan_dahdi cannot be selected when run make menuconfig
And this happened when --with-dahdi=$(DAHDI_BUILD_RESULT_DIR) :
checking for mandatory modules: CRYPTO DAHDI NCURSES SQLITE3 OPENSSL... fail
configure: ***
configure: *** The DAHDI installation appears to be missing or broken.
configure: *** Either correct the installation, or run configure
configure: *** including --without-dahdi.
Note that $(DAHDI_BUILD_RESULT_DIR) contains my result when building dahdi, assume that I did it correctly, because this is one of the drivers in the result:
$(DAHDI_BUILD_RESULT_DIR)/lib/modules/3.8.13/dahdi/dahdi.ko: ELF 32-bit LSB relocatable, ARM, EABI5 version 1 (SYSV), BuildID[sha1]=2b16a606c922ca5f10288dba98f2b365e8316748, not stripped
Things used in my process :
1. dahdi 2.10 complete
2. linaro cross compile toolchain
3. Linux kernel 3.8.13
4. Asterisk 11.11.0
5. Hardware : Beagleboneblack
If anybody have an idea, or know how to cross compile asterisk with dahdi, your help would be appreciated.
Best Regard.
Loi Dang
Upvotes: 4
Views: 1295
Reputation: 378
My many thanks to @viktike who helping me out the stuck. Adding CFLAGS
point to DAHDI C header files and LDFLAGS
point to lib files as arguments when running configure script of asterisk solve my issue pretty well.
./configure [other argument] CFLAGS="-g -I/home/thanhloi/workspace/asterisk/dahdi-linux-complete-2.10.1+2.10.1/RESULT/usr/include/" LDFLAGS="-L/home/thanhloi/workspace/asterisk/dahdi-linux-complete-2.10.1+2.10.1/RESULT/usr/lib/ -lpthread -ldl"
Asterisk then configured and built with dahdi installed.
Best Regard
Loi Dang
Upvotes: 1
Reputation: 733
Looking at asterisk's configure.ac, it checks the dahdi-tools part (userspace) of dahdi complete, the dahdi-linux part (kernel-modules) are not required for compilation. Make sure the header files are installed in the correct place, usually /usr/include.
Upvotes: 1