Use configure to determine the prefixes and include directories properly.

This ensures cross-platform compatibility, even among Linux distributions,
which don't always put headers in the same place.

(closes issue #17391)
 Reported by: loloski


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@265747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Tilghman Lesher
2010-05-26 00:29:40 +00:00
parent 01db62bdbe
commit a7498ae02e
8 changed files with 301 additions and 300 deletions

View File

@@ -921,10 +921,13 @@ AST_EXT_LIB_CHECK([ICONV], [iconv], [iconv_open], [iconv.h])
# Some versions of Linux package iconv in glibc
AST_EXT_LIB_CHECK([ICONV], [c], [iconv_close], [iconv.h])
AST_EXT_LIB_CHECK([ICAL], [ical], [icaltimezone_new], [ical.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}])
# Some distributions (like RedHat) add a libical subdirectory for the headers
AST_EXT_LIB_CHECK([ICAL], [ical], [icaltimezone_get_utc_timezone], [libical/ical.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}])
if test x"${PBX_ICAL}" = x1; then
ICAL_INCLUDE+=-I/usr/include/libical
fi
AST_EXT_LIB_CHECK([ICAL], [ical], [icaltimezone_new], [ical.h], [${PTHREAD_LIBS}], [${PTHREAD_CFLAGS}])
AST_EXT_LIB_CHECK([IKSEMEL], [iksemel], [iks_start_sasl], [iksemel.h])
@@ -1662,7 +1665,11 @@ fi
AST_EXT_LIB_CHECK([LUA], [lua5.1], [luaL_newstate], [lua5.1/lua.h], [-lm])
if test "x${PBX_LUA}" = "x1" ; then
AC_DEFINE_UNQUOTED([LUA51_PREFIX], [1], [Define to 1 if lua is found with a lua5.1 prefix])
if test x"${LUA_DIR}" = x; then
LUA_INCLUDE="${LUA_INCLUDE} -I/usr/include/lua5.1"
else
LUA_INCLUDE="${LUA_INCLUDE} -I${LUA_DIR}/lua5.1"
fi
fi
# Some distributions (like SuSE) remove the 5.1 suffix.