configure.ac 1.85 KB
Newer Older
1 2 3 4 5 6 7 8 9 10
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.61])
AC_INIT([belle-sip], [0.0.1], [jehan.monnier@linphone.org])
AC_CONFIG_SRCDIR([src/belle_sip_utils.c])

AC_CONFIG_HEADERS([config.h])

AM_INIT_AUTOMAKE
Simon Morlat's avatar
Simon Morlat committed
11
AM_SILENT_RULES(yes)
12 13 14 15 16 17 18 19 20 21 22

# Checks for programs.
AC_PROG_CC
LT_INIT(disable-static win32-dll)

if test -f /etc/debian_version ; then
	use_deb=true;
else
	use_rpm=true;
fi

Simon Morlat's avatar
Simon Morlat committed
23 24 25 26 27 28 29 30 31 32 33 34 35
AC_ARG_ENABLE(debug,
		[  --enable-debug    Turn on debug mode (default=yes)],
		[case "${enableval}" in
		yes) debug=true ;;
		no)  debug=false ;;
		*) AC_MSG_ERROR(bad value ${enableval} for --enable-debug) ;;
		esac],[debug=true])

if test "$debug" = "no" ; then
	CFLAGS="-g -O2"
else
	CFLAGS="-g"
fi
36 37 38 39

if test x$GCC = xyes ; then
	STRICT_OPTIONS=" -Wall -Werror"
dnl because of antlr3 we must accept a few warnings...
40 41 42
	LESS_STRICT_OPTIONS="$STRICT_OPTIONS -Wno-error=unused-function \
	 -Wno-error=uninitialized -Wno-error=unused-variable \
	 -Wno-error=unused-but-set-variable "
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70

fi

AC_SUBST(STRICT_OPTIONS)
AC_SUBST(LESS_STRICT_OPTIONS)

# Checks for libraries.

# Checks for header files.

found_antlr3=no
AC_CHECK_HEADERS([antlr3.h], [found_antlr3=yes])

if test x$found_antlr3 = xno ; then
	AC_MSG_ERROR([Could not find antlr3 development files. Please install antlr3 (libantlr3c-dev on debian/ubuntu systems)])
fi

found_cunit=no
AC_CHECK_HEADERS([CUnit/Basic.h], [found_cunit=yes])

if test x$found_cunit = xno ; then
	AC_MSG_WARN([Could not find cunit framework, tests are not compiled.])
fi

# Checks for typedefs, structures, and compiler characteristics.


# Checks for library functions.
71
AC_CHECK_LIB(rt, clock_gettime)
Simon Morlat's avatar
Simon Morlat committed
72
AC_CHECK_LIB(dl, dlopen)
73 74 75 76 77 78 79 80 81 82 83 84

AM_CONDITIONAL(BUILD_TESTS,test x$found_cunit = xyes)

AC_CONFIG_FILES(
[
Makefile
include/Makefile
include/belle-sip/Makefile
src/Makefile
tester/Makefile
])
AC_OUTPUT