Newer
Older
AC_PREREQ(2.60a)
Kevin P. Fleming
committed
AC_INIT([asterisk], [trunk], [https://issues.asterisk.org])
Kevin P. Fleming
committed
# cross-compile macros
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
# check existence of the package
AC_CONFIG_SRCDIR([main/asterisk.c])
Kevin P. Fleming
committed
AC_COPYRIGHT("Asterisk")
Kevin P. Fleming
committed
# preserve any CFLAGS or LDFLAGS that may be set
# NOTE: This must be done before calling any macros that end up
# calling AC_PROG_CC or the like, since they will set a default
# set of CFLAGS ("-g -O2") if the user did not supply any, and
# we don't want those default flags to be carried over into the
# rest of the build system since we have other means of controlling
# debugging symbol generation and optimization.
Kevin P. Fleming
committed
CONFIG_CFLAGS="${CFLAGS}"
CONFIG_LDFLAGS="${LDFLAGS}"
AC_SUBST(CONFIG_CFLAGS)
AC_SUBST(CONFIG_LDFLAGS)
# specify output header file
AC_CONFIG_HEADER(include/asterisk/autoconfig.h)
# Note: AC_PROG_CC *must* be specified before AC_USE_SYSTEM_EXTENSIONS or any
# other macro that uses the C compiler, or the default order will be used.
AC_USE_SYSTEM_EXTENSIONS dnl note- does not work on FreeBSD
# System default paths
AC_SUBST([astsbindir], ['${sbindir}'])dnl
AC_SUBST([astcachedir], ['${localstatedir}/cache/asterisk'])dnl
AC_SUBST([astetcdir], ['${sysconfdir}/asterisk'])dnl
AC_SUBST([astheaderdir], ['${includedir}/asterisk'])dnl
AC_SUBST([astlibdir], ['${libdir}'])dnl
AC_SUBST([astmoddir], ['${libdir}/asterisk/modules'])dnl
AC_SUBST([astmandir], ['${mandir}'])dnl
AC_SUBST([astvarlibdir], ['${localstatedir}/lib/asterisk'])dnl
AC_SUBST([astdatadir], ['${astvarlibdir}'])dnl
AC_SUBST([astdbdir], ['${astvarlibdir}'])dnl
AC_SUBST([astkeydir], ['${astvarlibdir}'])dnl
AC_SUBST([astspooldir], ['${localstatedir}/spool/asterisk'])dnl
AC_SUBST([astlogdir], ['${localstatedir}/log/asterisk'])dnl
AC_SUBST([astvarrundir], ['${localstatedir}/run/asterisk'])dnl
case "${host_os}" in
*bsd*)
Alexander Traud
committed
if test ${prefix} != 'NONE'; then
astvarlibdir='${prefix}/share/asterisk'
astdbdir='${localstatedir}/db/asterisk'
fi
;;
darwin*)
if test ${prefix} = 'NONE'; then
astvarrundir='/Library/Application Support/Asterisk/Run'
fi
;;
esac
case "${host_os}" in
netbsd*)
ac_default_prefix=/usr/pkg
CPPFLAGS=-I/usr/pkg/include
LDFLAGS=-L/usr/pkg/lib
;;
CPPFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib
Russell Bryant
committed
;;
openbsd*)
if test ${prefix} = '/usr/local' || test ${prefix} = 'NONE'; then
if test ${sysconfdir} = '${prefix}/etc'; then
fi
if test ${mandir} = '${prefix}/man'; then
fi
fi
CPPFLAGS=-I/usr/local/include
LDFLAGS=-L/usr/local/lib
;;
if test ${prefix} = 'NONE'; then
astmoddir='/Library/Application Support/Asterisk/Modules'
astvarlibdir='/Library/Application Support/Asterisk'
astlogdir=/Library/Logs/Asterisk
astvarrundir='/Library/Application Support/Asterisk/Run'
AC_DEFINE([AST_POLL_COMPAT], 1, [Define to 1 if internal poll should be used.])
AC_DEFINE([_DARWIN_UNLIMITED_SELECT], 1, [Define to 1 if running on Darwin.])
solaris*)
if test ${prefix} = 'NONE'; then
astcachedir=/var/cache/asterisk
astetcdir=/var/etc/asterisk
astsbindir=/opt/asterisk/sbin
astlibdir=/opt/asterisk/lib
astmoddir=/opt/asterisk/lib/modules
astheaderdir=/opt/asterisk/include
astmandir=/opt/asterisk/man
astvarlibdir=/var/opt/asterisk
astspooldir=/var/spool/asterisk
astlogdir=/var/log/asterisk
astvarrundir=/var/run/asterisk
fi
;;
Russell Bryant
committed
*)
if test ${prefix} = '/usr' || test ${prefix} = 'NONE'; then
if test ${sysconfdir} = '${prefix}/etc'; then
sysconfdir=/etc
fi
if test ${mandir} = '${prefix}/man'; then
mandir=/usr/share/man
fi
fi
Russell Bryant
committed
;;
esac
if test ${prefix} = ${ac_default_prefix} || test ${prefix} = 'NONE'; then
if test ${localstatedir} = '${prefix}/var'; then
localstatedir=/var
fi
Russell Bryant
committed
fi
Kevin P. Fleming
committed
BUILD_PLATFORM=${build}
BUILD_CPU=${build_cpu}
BUILD_VENDOR=${build_vendor}
BUILD_OS=${build_os}
AC_SUBST(BUILD_PLATFORM)
AC_SUBST(BUILD_CPU)
AC_SUBST(BUILD_VENDOR)
AC_SUBST(BUILD_OS)
HOST_PLATFORM=${host}
HOST_CPU=${host_cpu}
HOST_VENDOR=${host_vendor}
HOST_OS=${host_os}
AC_SUBST(HOST_PLATFORM)
AC_SUBST(HOST_CPU)
AC_SUBST(HOST_VENDOR)
AC_SUBST(HOST_OS)
Kevin P. Fleming
committed
Kevin P. Fleming
committed
PBX_WINARCH=0
Kevin P. Fleming
committed
Kevin P. Fleming
committed
case "${host_os}" in
Kevin P. Fleming
committed
OSARCH=FreeBSD
;;
Kevin P. Fleming
committed
mingw32)
OSARCH=mingw32
Kevin P. Fleming
committed
PBX_WINARCH=1
Kevin P. Fleming
committed
;;
cygwin)
OSARCH=cygwin
Kevin P. Fleming
committed
PBX_WINARCH=1
Kevin P. Fleming
committed
;;
OSARCH=linux-gnu
;;
linux-musl*)
OSARCH=linux-musl
;;
Kevin P. Fleming
committed
*)
Kevin P. Fleming
committed
;;
esac
AC_SUBST(OSARCH)
Kevin P. Fleming
committed
AC_SUBST(PBX_WINARCH)
Kevin P. Fleming
committed
George Joseph
committed
AC_MSG_CHECKING(whether char is unsigned)
AC_COMPILE_IFELSE(
[
AC_LANG_SOURCE(
#include <limits.h>
#if CHAR_MIN == 0
#error
Loading
Loading full blame...