Results 1 to 12 of 12

Thread: Compiling Asterisk for ASUS Platforms

  1. #1

    Compiling Asterisk for ASUS Platforms

    A comparison of ASUS Routers shows that the

    * RT-N16 uses the BCM 4716 CPU
    * WL500G uses the BCM 4710 CPU

    I am hoping that the the process used to compile \ make an application is the same or at least very similar, because I can not find info on how to compile Asterisk for the RT-N16. Fortunately there is a large and knowledgable WL500 community.

    I am forced to compile Asterisk (running on an ASUS RT-N16) because Google made a change to the Gtalk service. Details regarding this change can be found by clicking on this URL.

    If anyone has a success story compiling Asterisk (for ASUS platforms) and any lessons learned, I look forward to your posting. Bonus round if you can point to a good process & make file. Thank you.
    ASUS RT-N16 with DD-WRT | Free Asterisk Book| Asterisk 1.8.4 | Optware | Linksys SPA2102 | G729a codec bandwidth

  2. #2
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    basicly you need linux, the cross-compiler and source-code.

    just download the correct cross compiler here http://code.google.com/p/wl500g/down...+DownloadCount

    then just follow chapter 1 and 3.3 from this how-to: http://code.google.com/p/wl500g/wiki...CustomFirmware

    and do the toolchain stuff:
    mkdir -p /opt/brcm
    tar -C /opt/brcm -jxvf hndtools-mipsel-uclibc-4.3.5-2.tar.bz2
    ln -sf /opt/brcm/hndtools-mipsel-uclibc-4.3.5 /opt/brcm/hndtools-mipsel-uclibc
    and you have yourself a ready to build system

    ./configure --prefix=/opt --host=mipsel-linux --disable-xmldoc
    this configure is probably a good start for compiling, but you need a lot of libraries...
    I'd recommend you just use ipkg packages to get the correct header files, otherwise it's madness to compile everything yourself

  3. #3
    @wpte: Thank you for the quick response. My goal is to recompile Asterisk for an ASUS RT-N16 running DD-WRT. Not the router firmware (kernel). Because I have limited experience compiling embedded linux apps, I have a few questions.

    Have you had success compiling apps / firmware using the prescribed tools for the RT-N16?

    Is there any reason to think that the compiled Asterisk software, use your prescribed process, will not work on an ASUS RT-N16 running DD-WRT?

    Thank you.
    ASUS RT-N16 with DD-WRT | Free Asterisk Book| Asterisk 1.8.4 | Optware | Linksys SPA2102 | G729a codec bandwidth

  4. #4
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    Quote Originally Posted by gatorback View Post
    @wpte: Thank you for the quick response. My goal is to recompile Asterisk for an ASUS RT-N16 running DD-WRT. Not the router firmware (kernel). Because I have limited experience compiling embedded linux apps, I have a few questions.

    Have you had success compiling apps / firmware using the prescribed tools for the RT-N16?

    Is there any reason to think that the compiled Asterisk software, use your prescribed process, will not work on an ASUS RT-N16 running DD-WRT?

    Thank you.
    the howto does not only explain how to compile firmware, but also how to install the toolchain, that's why I linked it

    Yes, I've cross compiled applications, you can do it on the router as well... sometimes... but it takes a long long time, especially when you have 50MB of sources.

    little writing on how to install build utilities on the router via ipkg: http://wl500g.info/showpost.php?p=98535&postcount=1

    It'll most likely work, unless dd-wrt uses a different/incompatible uclibc (which I doubt)

  5. but why do you want to compile it yourself? It already exists in optware

  6. #6
    @shantanugoel: I am forced to compile Asterisk (running on an ASUS RT-N16) because Google made a change to the Gtalk service. This recent change on the Gtalk side prevents outbound dialing from the handset. Details regarding this change can be found by clicking on this URL.
    Last edited by gatorback; 28-08-2011 at 04:41.
    ASUS RT-N16 with DD-WRT | Free Asterisk Book| Asterisk 1.8.4 | Optware | Linksys SPA2102 | G729a codec bandwidth

  7. Ah so there is yet another change. I thought you were talking about a change that happened a few months ago and was pulled in with 1.8.2.x already..

  8. #8
    Configuration script and errors found.

    @wpte: I have downloaded the cross compiler from Google to my Archlinux box, ran the tar commmand and created the link. Asterisk 1.8.5 was downloaded. These steps seem to have gone well. Here are the results:

    Code:
    -rwxr--r--  1 root   public 27321208 2011-08-27 23:39 ARCH hndtools-mipsel-uclibc-4.4.6-K26-r3189.tar.bz2
    drwxrwxrwx  3 mythtv public     4096 2011-08-27 21:24 Asterisk 1.8.5.0
    lrwxrwxrwx  1 root   public       42 2011-08-27 23:42 hndtools-mipsel-uclibc -> /opt/brcm/hndtools-mipsel-uclibc-4.4.6-K26
    drwxrwxrwx 12 rchiu  public     4096 2011-08-28 02:01 hndtools-mipsel-uclibc-4.4.6-K26
    I download 1.8.5 and searched for files with 'configure':
    [root@mythtv asterisk-1.8.5.0]# find . | grep configure
    ./main/editline/configure.in
    ./main/editline/configure
    ./configure.ac
    ./menuselect/configure.ac
    ./menuselect/mxml/configure.in
    ./menuselect/mxml/configure
    ./menuselect/configure
    ./configure_original
    ./configure

    [root@mythtv brcm]# find . | grep make
    ./Asterisk 1.8.5.0/asterisk-1.8.5.0/autoconf/ast_check_gnu_make.m4
    ./Asterisk 1.8.5.0/asterisk-1.8.5.0/makeopts.in
    ./Asterisk 1.8.5.0/asterisk-1.8.5.0/main/editline/makelist.in
    ./Asterisk 1.8.5.0/asterisk-1.8.5.0/BSDmakefile
    ./Asterisk 1.8.5.0/asterisk-1.8.5.0/build_tools/make_linker_version_script
    ./Asterisk 1.8.5.0/asterisk-1.8.5.0/build_tools/make_buildopts_h
    ./Asterisk 1.8.5.0/asterisk-1.8.5.0/build_tools/make_sample_voicemail
    ./Asterisk 1.8.5.0/asterisk-1.8.5.0/build_tools/make_version
    ./Asterisk 1.8.5.0/asterisk-1.8.5.0/build_tools/make_defaults_h
    ./Asterisk 1.8.5.0/asterisk-1.8.5.0/build_tools/make_version_h
    ./Asterisk 1.8.5.0/asterisk-1.8.5.0/build_tools/make_linker_eo_script
    ./Asterisk 1.8.5.0/asterisk-1.8.5.0/build_tools/get_makeopts
    ./Asterisk 1.8.5.0/asterisk-1.8.5.0/build_tools/make_build_h
    ./Asterisk 1.8.5.0/asterisk-1.8.5.0/build_tools/make_version_c
    ./Asterisk 1.8.5.0/asterisk-1.8.5.0/menuselect/makeopts.in
    ./Asterisk 1.8.5.0/asterisk-1.8.5.0/menuselect/make_version
    @wpte: I think that the following command:

    ./configure --prefix=/opt --host=mipsel-linux --disable-xmldoc
    Is to be used with the configure file supplied by Asterisk:
    [root@mythtv asterisk-1.8.5.0]# pwd
    /opt/brcm/Asterisk 1.8.5.0/asterisk-1.8.5.0
    [root@mythtv asterisk-1.8.5.0]# ls configure -l
    -rwxrwxrwx 1 mythtv public 831907 2011-05-23 12:19 configure
    I ran the command:
    [root@mythtv asterisk-1.8.5.0]# pwd
    /opt/brcm/Asterisk 1.8.5.0/asterisk-1.8.5.0

    [root@mythtv asterisk-1.8.5.0]# ./configure --prefix=/opt --host=mipsel-linux --disable-xmldoc --srcdir ='/opt/brcm/Asterisk 1.8.5.0/asterisk-1.8.5.0/'
    configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
    configure: error: cannot find sources (main/asterisk.c) in =/opt/brcm/Asterisk 1.8.5.0/asterisk-1.8.5.0/

    [root@mythtv asterisk-1.8.5.0]# find . | grep asterisk.c
    ./sounds/asterisk-core-sounds-en-gsm-1.4.21.tar.gz
    ./main/asterisk.c
    ./configs/asterisk.conf.sample
    ./res/res_rtp_asterisk.c
    I the variable $srcdir in the configure file to /opt/brcm/Asterisk 1.8.5.0/asterisk-1.8.5.0: why can't it 'see' /main/asterisk.c Maybe my syntax is not right?
    I am not sure how to address the error above or if this is something that needs to be addressed.
    I think that we are configuring a make file? If so I am not sure where it or its name.


    I am not sure what needs to be done to compile the code in the cross compiler. I think that I need to configure a 'make' file. I am not sure which files should be edited, nor do I know how to do this. I am hoping that someone an point me in the right direction and focus my attention on the right files \ questions. Any help is appreciated. If I can get this compiled and working, I would like to share the results with the community.
    Last edited by gatorback; 14-10-2011 at 05:49.
    ASUS RT-N16 with DD-WRT | Free Asterisk Book| Asterisk 1.8.4 | Optware | Linksys SPA2102 | G729a codec bandwidth

  9. #9
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    should be
    --srcdir =/opt/brcm/Asterisk 1.8.5.0/asterisk-1.8.5.0/
    I guess?
    the ' is not required as far as I'm aware

    I'm at work currently and I have no linux to check it atm

  10. #10

    Removed quotes from directory name and retried (unsuccessful)

    Quote Originally Posted by wpte View Post
    should be

    I guess?
    the ' is not required as far as I'm aware

    I'm at work currently and I have no linux to check it atm

    I tried the suggestion to remove the single quote character ['] around the directory:

    ./configure --prefix=/opt --host=mipsel-linux --disable-xmldoc --srcdir=/opt/brcm/Asterisk 1.8.5.0/asterisk-1.8.5.0
    configure: WARNING: you should use --build, --host, --target
    configure: WARNING: invalid host type: 1.8.5.0/asterisk-1.8.5.0
    configure: error: cannot find sources (main/asterisk.c) in /opt/brcm/Asterisk
    Unfortunately, the same error persists. I also tried not use the ' and adding a \ before the space in the directory. This made things worse:

    [root@mythtv asterisk-1.8.5.0]# ./configure --prefix=/opt --host=mipsel-linux --disable-xmldoc --srcdir=/opt/brcm/Asterisk\ 1.8.5.0/asterisk-1.8.5.0
    configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
    checking build system type... i686-pc-linux-gnu
    checking host system type... mipsel-unknown-linux-gnu
    configure: error: cannot find install-sh, install.sh, or shtool in `pwd` "."/`pwd`
    I think that you are right and that the single quotes are not needed.

    I noticed that having a space in the directory name can causes interesting problems. This can be resolved by placing the directory in single quotes or placing a \ before a space character:

    [root@mythtv asterisk-1.8.5.0]# cd /
    [root@mythtv /]# cd /opt/brcm/Asterisk 1.8.5.0/asterisk-1.8.5.0
    -bash: cd: /opt/brcm/Asterisk: No such file or directory
    [root@mythtv /]# cd '/opt/brcm/Asterisk 1.8.5.0/asterisk-1.8.5.0'
    [root@mythtv asterisk-1.8.5.0]# pwd
    /opt/brcm/Asterisk 1.8.5.0/asterisk-1.8.5.0

    [root@mythtv asterisk-1.8.5.0]# cd /
    [root@mythtv /]# cd /opt/brcm/Asterisk\ 1.8.5.0/asterisk-1.8.5.0
    [root@mythtv asterisk-1.8.5.0]# pwd
    /opt/brcm/Asterisk 1.8.5.0/asterisk-1.8.5.0
    I also tried adding a / to the end of the directory but this only made things worse:

    [root@mythtv asterisk-1.8.5.0]# ./configure --prefix=/opt --host=mipsel-linux --disable-xmldoc --srcdir='/opt/brcm/Asterisk 1.8.5.0/asterisk-1.8.5.0/'
    configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
    checking build system type... i686-pc-linux-gnu
    checking host system type... mipsel-unknown-linux-gnu
    configure: error: cannot find install-sh, install.sh, or shtool in `pwd` "."/`pwd`
    [root@mythtv asterisk-1.8.5.0]# ./configure --prefix=/opt --host=mipsel-linux --disable-xmldoc --srcdir=/opt/brcm/Asterisk\ 1.8.5.0/asterisk-1.8.5.0/
    configure: WARNING: If you wanted to set the --build type, don't use --host.
    If a cross compiler is detected then cross compile mode will be used.
    checking build system type... i686-pc-linux-gnu
    checking host system type... mipsel-unknown-linux-gnu
    configure: error: cannot find install-sh, install.sh, or shtool in `pwd` "."/`pwd`
    [root@mythtv asterisk-1.8.5.0]# ./configure --prefix=/opt --host=mipsel-linux --disable-xmldoc --srcdir=/opt/brcm/Asterisk 1.8.5.0/asterisk-1.8.5.0/
    configure: WARNING: you should use --build, --host, --target
    configure: WARNING: invalid host type: 1.8.5.0/asterisk-1.8.5.0/
    configure: error: cannot find sources (main/asterisk.c) in /opt/brcm/Asterisk
    @wpte: in your first reponse, you recommended:
    this configure is probably a good start for compiling, but you need a lot of libraries...
    I'd recommend you just use ipkg packages to get the correct header files, otherwise it's madness to compile everything yourself
    I did not do this (because I have not figured out how): could this (lack of correct header files) be the cause of the configure errors?

    Any suggestions would be appreciated.

    @wpte: I appreciate you taking the time to look at my questions.
    Last edited by gatorback; 29-08-2011 at 18:40.
    ASUS RT-N16 with DD-WRT | Free Asterisk Book| Asterisk 1.8.4 | Optware | Linksys SPA2102 | G729a codec bandwidth

  11. #11
    Join Date
    Dec 2007
    Location
    The Netherlands - Eindhoven
    Posts
    1,767
    ok... so actually, you don't need to use "--srcdir=/opt/brcm/Asterisk 1.8.5.0/asterisk-1.8.5.0" at all, it auto detects that...

    so, you only have to compile asterisk and the required libraries, or just grab the headers from the ipkg package.
    If I recall correctly, ncurses doesn't come with headers in ipkg tho...

    so you can just grab the packages here: http://ipkg.nslu2-linux.org/feeds/op.../cross/stable/
    and since they are actually .tar.gz archives you can open them on linux quite easily

    after you placed the headers somewhere on your pc, you can use a configure parameter to point to the headers. you don't want to install them in the regular folders I guess

    usually the parameter is something like:
    --with-packagename=/path/to
    --with-ncurses=/path/to/curses
    etc.

  12. #12
    Quote Originally Posted by wpte View Post
    ok... so actually, you don't need to use "--srcdir=/opt/brcm/Asterisk 1.8.5.0/asterisk-1.8.5.0" at all, it auto detects that...

    so, you only have to compile asterisk and the required libraries, or just grab the headers from the ipkg package.
    If I recall correctly, ncurses doesn't come with headers in ipkg tho...

    so you can just grab the packages here: http://ipkg.nslu2-linux.org/feeds/op.../cross/stable/
    and since they are actually .tar.gz archives you can open them on linux quite easily

    after you placed the headers somewhere on your pc, you can use a configure parameter to point to the headers. you don't want to install them in the regular folders I guess

    usually the parameter is something like:

    etc.
    I thought that my goal is to create a 'make' file from the configure script.

    configure (script) ==> make (file)

    As I understand it, the make file is the set of instructions to compile the source code into executable and provides the location to install the executable.

    I am not sure I understand what you have written. Are the packages a substitute for having the libraries? Which packages and why? Where should I place these packages? Should they be installed on the router using the ipkg command? How do I know which packages I need? Thank you for your patience.
    Last edited by gatorback; 14-10-2011 at 06:28.
    ASUS RT-N16 with DD-WRT | Free Asterisk Book| Asterisk 1.8.4 | Optware | Linksys SPA2102 | G729a codec bandwidth

Similar Threads

  1. compiling errors related to openssl..
    By outlaw11 in forum WL-500gP Q&A
    Replies: 4
    Last Post: 20-05-2011, 00:21
  2. [HOWTO] Asterisk Server
    By thejew in forum German Discussion - Deutsch (DE)
    Replies: 33
    Last Post: 23-01-2010, 17:38
  3. Need help compiling helloworld.c
    By FabWL500 in forum WL-500g Custom Development
    Replies: 0
    Last Post: 04-08-2009, 19:13
  4. Replies: 3
    Last Post: 05-02-2008, 08:59
  5. Compiling imageMagick with Magick++ support
    By neil in forum WL-500g Q&A
    Replies: 0
    Last Post: 04-02-2008, 12:14

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •