Compile Asterisk w/CentOS v5.2

Hello Forum,

I have just finished the training class in Huntsville.

I got a copy of the iso for CentOS (used in the class).

I have installed and compiled libpri and dahdi - a couple of issues that required getting some updates. As best as I could tell, the compile is clean.

So, then I started on asterisk. The first line (after the extraction) is “./configure” and it gives me the following error:

configure: error: C++ preprocessor “/lib/cpp” fails sanity check

Help!!

Thanks.

Hey GregoryCW,

This is most likely because you haven’t installed the gcc-c++ library. I forget what they call it on CentOS but a “yum search gcc” or “yum search cpp” should return the correct library in the list somewhere.

~ CS

Hi Gregory,
I would recommend updating your system first until there are no more updates to install:

Rinse and repeat until you don’t see anything else. Note: you may need to reboot the server if a kernel update is included.

Once that’s done, running the following will get you a majority of what you will need to build Asterisk and most other tools you may need to set up:

yum -y install gcc gcc-c++ kernel-devel bison openssl-devel \ libtermcap-devel ncurses-devel doxygen curl-devel newt-devel \ mlocate libtool lynx tar wget nmap bzip2 mod_ssl crontabs vixie-cron \ speex speex-devel unixODBC unixODBC-devel libtool-ltdl \ libtool-ltdl-devel mysql-connector-odbc mysql mysql-devel \ mysql-server php-mysql php-mbstring php-mcrypt flex screen \ ruby ruby-devel ruby-docs ruby-ri ruby-irb ruby-rdoc subversion

You don’t necessarily need all of them, for example, no need for php or mysql if you’re not installing freepbx, no need for ruby if you’re not installing adhearsion, no need for unixODBC or mysql if you’re not setting up asterisk to use the database server, etc.

Does CentOS have an equivalent to Debian’s ‘apt-get build-dep asterisk’ command?

Thanks for the help. I still had to do some digging to get menuselect to work but you got me started.

Unfortunately, I’m not sure what all I installed but GTK and GTK2 (std & devel) were required.

At this point, I have not installed the database or Ruby modules. Once I get the basic working, I’ll come back for these.

[quote=“theflashdrive”]Hi Gregory,
I would recommend updating your system first until there are no more updates to install:

Rinse and repeat until you don’t see anything else. Note: you may need to reboot the server if a kernel update is included.

Once that’s done, running the following will get you a majority of what you will need to build Asterisk and most other tools you may need to set up:

yum -y install gcc gcc-c++ kernel-devel bison openssl-devel \ libtermcap-devel ncurses-devel doxygen curl-devel newt-devel \ mlocate libtool lynx tar wget nmap bzip2 mod_ssl crontabs vixie-cron \ speex speex-devel unixODBC unixODBC-devel libtool-ltdl \ libtool-ltdl-devel mysql-connector-odbc mysql mysql-devel \ mysql-server php-mysql php-mbstring php-mcrypt flex screen \ ruby ruby-devel ruby-docs ruby-ri ruby-irb ruby-rdoc subversion

You don’t necessarily need all of them, for example, no need for php or mysql if you’re not installing freepbx, no need for ruby if you’re not installing adhearsion, no need for unixODBC or mysql if you’re not setting up asterisk to use the database server, etc.[/quote]

Yes it is called yum. Not sure if asterisk is out there. I know you can get it if the system is set up to trixbox’s repo.

Glad to help.
A bit of that stuff is general tools that aren’t installed by default, or that may have been deselected for some reason or another. Some is needed to download and extract stuff you want to build (for example tar, bzip2, wget & subversion) and others are just to make life easier on an admin (i.e. mlocate, nmap, screen, etc.) Other things, like gcc, ncurses, libtermcap, kernel-devel, gcc, openssl, & libtool are required for building certain parts of asterisk.

That line comes straight from my own documentation. Yeah, it is a bit on the unordered side, but at least it gets you where you’re going.

Thanks for pointing out the GTK thing, makes me want to build another box to see what’s missing from my documentation. :smiley: