configure.ac 2.29 KB
Newer Older
johan's avatar
johan committed
1 2 3 4 5
#   -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.



Simon Morlat's avatar
Simon Morlat committed
6
AC_INIT([bcg729],[1.0.0])
7
AC_CANONICAL_SYSTEM
johan's avatar
johan committed
8 9 10 11 12 13
AC_PREREQ(2.63)
AC_CONFIG_SRCDIR([src/encoder.c])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([tar-ustar --warnings=no-portability])
AC_PROG_LIBTOOL
AC_PROG_CC
14
AC_CONFIG_HEADERS(config.h)
johan's avatar
johan committed
15 16 17
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

AC_ARG_ENABLE(strict,
18 19 20
	[  --enable-strict       Enable error on compilation warning [default=yes]],
	[wall_werror=$enableval],
	[wall_werror=yes]
johan's avatar
johan committed
21
)
jehan's avatar
jehan committed
22 23 24 25
# configure option to disable the tests
AC_ARG_ENABLE([tests],
	AS_HELP_STRING([--disable-tests], [Disable the tests]))
	AM_CONDITIONAL([RUN_TESTS], [test "x$enable_tests" != "xno"])
26 27 28 29 30 31
# configure option to disable mediastreamer plugin
AC_ARG_ENABLE([msplugin],
	AS_HELP_STRING([--disable-msplugin], [Disable the mediastreamer plugin]),
	enable_msplugin="$enableval",
	enable_msplugin="yes"
)
johan's avatar
johan committed
32 33 34 35 36 37 38 39

CFLAGS="$CFLAGS -Wall"

if test $GCC = yes && test $wall_werror = yes;  then
	CFLAGS="$CFLAGS -Werror "
fi

# check for libraries that have pkg-config files installed
40 41
PKG_CHECK_MODULES(ORTP, ortp >= 0.21.0,[found_ortp=true],foo=bar)
PKG_CHECK_MODULES(MEDIASTREAMER, mediastreamer >= 2.8.99,[found_ms2=true],foo=bar)
42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57

if test x${found_ms2}x${found_ortp}x${enable_msplugin} = xtruextruexyes ; then
	build_msbcg729=true
else
	ORTP_CFLAGS=
	ORTP_LIBS=
	MEDIASTREAMER_CFLAGS=
	MEDIASTREAMER_LIBS=
fi

AC_SUBST(ORTP_CFLAGS)
AC_SUBST(ORTP_LIBS)
AC_SUBST(MEDIASTREAMER_CFLAGS)
AC_SUBST(MEDIASTREAMER_LIBS)

AM_CONDITIONAL(BUILD_MSBCG729, test x$build_msbcg729 = xtrue)
johan's avatar
johan committed
58

59 60 61 62 63 64 65 66 67 68 69 70 71
VISIBILITY_CFLAGS=
case "$target_os" in
	*mingw*)
		CFLAGS="$CFLAGS -D_WIN32_WINNT=0x0501"
		mingw_found=yes
	;;
	*)
		VISIBILITY_CFLAGS="-fvisibility=hidden"
	;;
esac
AC_SUBST(VISIBILITY_CFLAGS)

# Initialize libtool
72
LT_INIT([win32-dll shared ])
73 74 75 76 77 78 79 80 81 82 83

AC_CONFIG_COMMANDS([libtool-hacking],
	[if test "$mingw_found" = "yes" ; then
		echo "Hacking libtool to work with mingw..."
		sed -e 's/\*\" \$a_deplib \"\*/\*/' < ./libtool > libtool.tmp
		cp -f ./libtool.tmp ./libtool
		rm -f ./libtool.tmp
	fi],
	[mingw_found=$mingw_found]
)

johan's avatar
johan committed
84 85
# Create the following files from their .in counterparts
AC_CONFIG_FILES([
86 87 88 89 90 91 92 93
	Makefile
	src/Makefile 
	include/Makefile 
	include/bcg729/Makefile 
	msbcg729/Makefile 
	test/Makefile 
	test/bin/Makefile 
	libbcg729.pc
Margaux Clerc's avatar
Margaux Clerc committed
94
	bcg729.spec
johan's avatar
johan committed
95 96
])

97

johan's avatar
johan committed
98
AC_OUTPUT