Thursday, March 12, 2009

Asterisk 1.6.1 + OpenSSL: Save your hair! Timesaver

While compiling Asterisk 1.6.1 from source, if you come across a "no such File or directory" compile error (through chan_sip.c and tcptls.h) try using the ASTCFLAGS instead of or in addition to CFLAGS.

This error is most likely to show up if:
  • ./configure runs fine, even with --with-ssl=/usr/local/ssl (or your path)
  • openssl is installed in a non-standard path (common when compiled from source)
  • you know that ssl.h and err.h exist on your system -- asterisk's build simply doesn't find it during make (arguably not asterisk's job)
If ssl.h and err.h are under /usr/local/ssl/include/ssl.h and /usr/local/ssl/include/err.h, respectively, this might get Asterisk compiling when other methods don't:

ASTCFLAGS="-I/usr/local/ssl/include" CFLAGS="-I/usr/local/ssl/include" /usr/local/bin/make

No comments: