dnl dnl ref: http://www.gnu.org/software/autoconf/manual/autoconf.info.gz dnl AC_PREREQ(2.57) dnl information on the package dnl --------------------------- AC_INIT([sofia-sip-2543], [1.12.2]) AC_CONFIG_SRCDIR([lib/rfc2543.c]) dnl Init automake dnl ---------------------------- SAC_CANONICAL_SYSTEM_CACHE_CHECK AM_INIT_AUTOMAKE([foreign 1.6.2]) AM_MAINTAINER_MODE AM_CONFIG_HEADER(config.h) dnl checks for unix variants dnl ------------------------ AC_GNU_SOURCE dnl checks for programs dnl ------------------- AX_TOOL_CC AC_PROG_INSTALL AC_PROG_CPP AC_CHECK_PROG(ETAGS, etags, etags, echo) AC_CHECK_TOOL(AR, ar, ar) AC_CHECK_TOOL(LD, ld, ld) AC_PROG_LIBTOOL dnl checks for libraries dnl -------------------- AC_ARG_WITH([include-sofiadir], [ --with-include-sofiadir use directory to install includes],, with_include_sofiadir=yes) AC_DEFUN([SAC_INCLUDE_SOFIADIR],[dnl case $with_include_sofiadir in yes | "" ) include_sofiadir="$1" ;; no) include_sofiadir='${prefix}/include' ;; *) include_sofiadir=${with_include_sofiadir} ;; esac]) AC_ARG_WITH([sofia-sip], [ --with-sofia-sip=prefix use sofia-sip with configure prefix],, with_sofia_sip=pkg-config) AC_ARG_WITH([sofia-sip-exec], [ --with-sofia-sip-exec use sofia-sip with exec-prefix], [ if test "$with_sofia_sip" = pkg-config ; then AC_MSG_ERROR([You need to use --with-sofia-sip, too]) fi ], with_sofia_sip_exec=$with_sofia_sip) if test "$with_sofia_sip" = pkg-config; then PKG_CHECK_MODULES(SIP, sofia-sip-ua >= 1.12,,[ if test "$PKG_CONFIG" = "no" ; then AC_MSG_ERROR([There is no pkg-config. Try using --with-sofia-sip-prefix.]) else AC_MSG_ERROR([sofia-sip-ua >= 1.12 not found by pkg-config; consider adjusting the PKG_CONFIG_PATH environment variable if your libraries are in a nonstandard prefix so pkg-config can find them.]) fi ]) SAC_INCLUDE_SOFIADIR(`pkg-config --variable=include_sofiadir sofia-sip-ua`) else SAC_INCLUDE_SOFIADIR(${with_sofia_sip}/include/sofia-sip-1.12) SIP_CFLAGS="-I${include_sofiadir}" SIP_LIBS="-L${with_sofia_sip_exec}/lib -lsofia-sip-ua" fi AC_SUBST(SIP_CFLAGS) AC_SUBST(SIP_LIBS) AC_SUBST([DISTCHECK_CONFIGURE_FLAGS], [--without-include-sofiadir]) AC_SUBST([include_sofiadir]) sofiaawkdir=`pkg-config --variable=sofiaawkdir sofia-sip-ua` test -z $sofiaawkdir && sofiaawkdir=`pkg-config --variable=libexecdir sofia-sip-ua`/sofia AC_SUBST([sofiaawkdir]) dnl checks for header files dnl ----------------------- dnl XXX dnl checks for types dnl ---------------- AC_TYPE_LONGLONG([ AC_DEFINE([LLU], ["%llu"], [Define as format (%llu) for unsigned longlong]) AC_DEFINE([LLI], ["%lli"], [Define as format (%lli) for longlong]) AC_DEFINE([LLX], ["%llx"], [Define as format (%llx) for longlong hex]) ]) dnl checks for structures dnl --------------------- dnl checks for typedefs, structures, and compiler characteristics. dnl -------------------------------------------------------------- AC_C_CONST AC_C_INLINE AC_C_BIGENDIAN dnl AC_C_VAR_FUNC dnl AC_C_MACRO_FUNCTION dnl checks for library functions dnl ---------------------------- dnl checks for system services dnl -------------------------- dnl output dnl ------ cat << EOF Configuration for ${PACKAGE}-${VERSION}: sofia-sip-ua cflags: ${SIP_CFLAGS} sofia-sip-ua libraries: ${SIP_LIBS} installation prefix is ${prefix} exec-prefix is ${exec_prefix} installing headers to: ${include_sofiadir} installing library to: ${libdir} EOF AC_CONFIG_FILES([ Makefile include/Makefile lib/Makefile packages/sofia-sip-2543.spec packages/sofia-sip-2543.pc ]) AC_OUTPUT