configure.ac 2.43 KB
Newer Older
Simon Morlat's avatar
Simon Morlat committed
1 2 3
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

4
AC_PREREQ([2.63])
5
AC_INIT([belr], [0.1.2], [simon.morlat@linphone.org])
6 7 8 9 10 11 12 13 14 15

BELR_SO_CURRENT=0 dnl increment this number when you add/change/remove an interface
BELR_SO_REVISION=1 dnl increment this number when you change source code, without changing interfaces; set to 0 when incrementing CURRENT
BELR_SO_AGE=1 dnl increment this number when you add an interface, set to 0 if you remove an interface

BELR_SO_VERSION=$BELR_SO_CURRENT:$BELR_SO_REVISION:$BELR_SO_AGE

AC_SUBST(BELR_SO_CURRENT, $BELR_SO_CURRENT)
AC_SUBST(BELR_SO_VERSION)

Sylvain Berfini's avatar
Sylvain Berfini committed
16
AC_CONFIG_SRCDIR([src/])
17 18 19

AC_CONFIG_MACRO_DIR([m4])

Simon Morlat's avatar
Simon Morlat committed
20 21
AC_CONFIG_HEADERS([config.h])

22 23 24 25 26 27 28 29
AC_CANONICAL_SYSTEM

LT_INIT([shared disable-static])

dnl initialize pkg-config so that we can use it within if else fi statements.
PKG_PROG_PKG_CONFIG()

AM_INIT_AUTOMAKE(subdir-objects)
Simon Morlat's avatar
Simon Morlat committed
30
AM_SILENT_RULES(yes)
Simon Morlat's avatar
Simon Morlat committed
31 32 33 34

# Checks for programs.
AC_PROG_CXX

Simon Morlat's avatar
Simon Morlat committed
35
CXXFLAGS="$CXXFLAGS -std=c++11 -Wall -Werror -Wextra -Wno-unused-parameter"
Simon Morlat's avatar
Simon Morlat committed
36 37 38

# Checks for libraries.

Sylvain Berfini's avatar
Sylvain Berfini committed
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56
dnl ##################################################
dnl # Check for BcToolbox
dnl ##################################################

dnl check bctoolbox
PKG_CHECK_MODULES(BCTOOLBOX, [bctoolbox],[libbctoolbox_found=yes],foo=bar)
if test "$libbctoolbox_found" != "yes" ; then
        dnl Check the lib presence in case the PKG-CONFIG version is not found
        AC_LANG_CPLUSPLUS
        AC_CHECK_LIB(bctoolbox, main, [BCTOOLBOX_LIBS+=" -lbctoolbox"; libbctoolbox_found=yes], [foo=bar])
        AC_LANG_C
fi
if test "$libbctoolbox_found" != "yes" ; then
        AC_MSG_ERROR([libbctoolbox not found. Install it and try again])
fi

AC_SUBST(BCTOOLBOX_LIBS)

Simon Morlat's avatar
Simon Morlat committed
57 58 59 60 61
# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_SSIZE_T

62 63 64 65 66 67 68 69 70
dnl substitute variables used by .pc files
if test "$prefix" = "NONE" ; then
	install_prefix=/usr
else
	install_prefix=$prefix
fi

PROJECT_VERSION=$VERSION
CMAKE_INSTALL_PREFIX=$install_prefix
71
CMAKE_INSTALL_FULL_LIBDIR=${libdir}
72 73 74 75 76 77 78 79
CMAKE_INSTALL_FULL_INCLUDEDIR=${install_prefix}/include

AC_SUBST(PROJECT_VERSION)
AC_SUBST(CMAKE_INSTALL_PREFIX)
AC_SUBST(CMAKE_INSTALL_FULL_LIBDIR)
AC_SUBST(CMAKE_INSTALL_FULL_INCLUDEDIR)
AC_SUBST(TESTER_REQUIRES_PRIVATE)

Simon Morlat's avatar
Simon Morlat committed
80 81 82 83
# Checks for library functions.
AC_CONFIG_FILES(
Makefile
src/Makefile
Sylvain Berfini's avatar
Sylvain Berfini committed
84
tools/Makefile
85 86
include/Makefile
include/belr/Makefile
87
belr.pc
François Grisez's avatar
François Grisez committed
88
cmake/BelrConfig.cmake
Simon Morlat's avatar
Simon Morlat committed
89 90 91
)

AC_OUTPUT