Now it's time to compile and install Asterisk. Let's change to the directory which contains the Asterisk source code.

[root@server dahdi-linux-complete-2.X.Y+2.X.Y]# cd /usr/local/src/asterisk-1.8.X.Y

Next, we'll run a command called ./configure, which will perform a number of checks on the operating system, and get the Asterisk code ready to compile on this particular server.

[root@server asterisk-1.8.X.Y]# ./configure

This will run for a couple of minutes, and warn you of any missing system libraries or other dependencies.

If you have missing dependencies then you should install them now and then run configure again to make sure they are recognized. A helpful way to install most of the dependencies you need is to use the install_prereq script included in the contrib/scripts/ directory of your Asterisk source. It's quite straightforward to use, but may not work on all systems. Run the script with no arguments to see the usage help.

Upon completion of ./configure, you should see a message that looks similar to the one shown below. (Obviously, your host CPU type may be different than the below.)

                .$$$$$$$$$$$$$$$=..      
              .$7$7..        .7$$7:.    
            .$7$7..           .7$$7:.
          .$$:.                 ,$7.7
        .$7.     7$$$$           .$$77
     ..$$.       $$$$$            .$$$7
    ..7$   .?.   $$$$$   .?.       7$$$.
   $.$.   .$$$7. $$$$7 .7$$$.      .$$$.
 .777.   .$$$$$$77$$$77$$$$$7.      $$$,
 $$$~      .7$$$$$$$$$$$$$7.       .$$$.
.$$7          .7$$$$$$$7:          ?$$$.
$$$          ?7$$$$$$$$$$I        .$$$7
$$$       .7$$$$$$$$$$$$$$$$      :$$$.
$$$       $$$$$$7$$$$$$$$$$$$    .$$$.
$$$        $$$   7$$$7  .$$$    .$$$.
$$$$             $$$$7         .$$$.
7$$$7            7$$$$        7$$$
 $$$$$                        $$$
  $$$$7.                       $$  (TM)
   $$$$$$$.           .7$$$$$$  $$
     $$$$$$$$$$$$7$$$$$$$$$.$$$$$$
       $$$$$$$$$$$$$$$$.

configure: Package configured for: 
configure: OS type  : linux-gnu
configure: Host CPU : x86_64
configure: build-cpu:vendor:os: x86_64 : unknown : linux-gnu :
configure: host-cpu:vendor:os: x86_64 : unknown : linux-gnu :
Icon

Cached Data
The ./configure command caches certain data to speed things up if it's invoked multiple times. To clear all the cached data, you can use the following command to completely clear out any cached data from the Asterisk build system.

[root@server asterisk-1.8.X.Y]# make distclean

Comments:

Innocent newbie question. Would one run "make distclean" before or after "./configure" ?? I realize someone with experience would know when or why "make distclean" would be in order.

Posted by howwhi at Nov 04, 2010 13:12

First there is no such thing as an innocent question. Only a fool presumes he/she knows everything.
One good time to run "make distclean" is when you have run the "make" command to compile your sources.
If you had a failure in the process and it crapped out, you would run "make distclean". The "make distclean" command erases all the files created by "./configure" and "make". Running "make clean" would remove the files created by "make" only, So "make distclean" removes the files created by "./configure" and "make".
I hope this helps.

Posted by albro at Nov 04, 2010 14:21

Howard, Albro

make dist-clean is an alias to distclean which removes menuselect, sounds, makeopts and other build settings. The Makefile is a good read for users interested in the build system.

You can look at the source of Makefile and see what it does.

Posted by lathama at Dec 20, 2010 11:57

I cant install the install_prereq, any other way to install the prereq?

 

Posted by Ecaridad0 at Sep 11, 2013 23:24

Not at this time. You can look inside the script to see the various package names, then install them manually via your package manager.

If there are problems with the install_prereq script, feel free to read through Asterisk Issue Guidelines and post an issue on the bug tracker.

Posted by rnewton at Sep 12, 2013 17:08