configure.ac 2.07 KB
Newer Older
1 2 3 4 5
#                                               -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_INIT([msisac],[1.0.0])
AC_PREREQ(2.63)
6

7 8 9
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_MACRO_DIR([m4])

10
AC_CANONICAL_TARGET
11 12
AC_CANONICAL_SYSTEM

13 14
AM_INIT_AUTOMAKE([tar-ustar --warnings=no-portability])

15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
AC_ARG_ENABLE(strict,
[  --enable-strict       Enable error on compilation warning [default=no]],
[wall_werror=$enableval],
[wall_werror=yes]
)


CFLAGS="$CFLAGS -Wall"

if test "$wall_werror" = "yes" ; then
	STRICT_CFLAGS="-Werror"
fi

AC_SUBST(STRICT_CFLAGS)

# we use fixed point implementation for speed
ISAC_FLAVOUR=fix

AC_SUBST([ISAC_FLAVOUR])
AM_CONDITIONAL(ISAC_FLAVOUR_MAIN, test $ISAC_FLAVOUR = main)

# Checks for programs.
AC_PATH_PROG([GIT],[git])
if test -z "$GIT"; then
   AC_MSG_ERROR(['git' is required to build this package])
fi

# check for libraries that have pkg-config files installed
PKG_CHECK_MODULES(MEDIASTREAMER, mediastreamer >= 2.0.0)

# Checks for libraries.
# AC_CHECK_LIB([m],[cosf])

# initialize libtool
AC_LIBTOOL_WIN32_DLL
LT_INIT([disable-static])

52 53 54
# enable to debug cross-compilation
# AC_MSG_NOTICE([Target OS: $target_os])

55 56 57
case $target_os in 
	*mingw*)
		mingw_found=yes
58 59 60 61 62
		CFLAGS="$CFLAGS -DWEBRTC_WIN"
	;;
	*linux*)
		CFLAGS="$CFLAGS -DWEBRTC_LINUX -DWEBRTC_THREAD_RR"
	;;
63
	*darwin*)
64 65 66 67
		CFLAGS="$CFLAGS -DWEBRTC_MAC -DWEBRTC_THREAD_RR -DWEBRTC_CLOCK_TYPE_REALTIME"
	;;
	*android*)
		CFLAGS="$CFLAGS -DWEBRTC_LINUX -DWEBRTC_ANDROID -DWEBRTC_THREAD_RR -DWEBRTC_CLOCK_TYPE_REALTIME"
68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95
	;;
esac

AM_CONDITIONAL(BUILD_WIN32, test x$mingw_found = xyes)


AC_CONFIG_COMMANDS([libtool-hacking],[
if test "$mingw_found" = "yes" ; then
	AC_MSG_NOTICE([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])

# Checks for library functions.

# Create the following files from their .in counterparts
AC_CONFIG_FILES([
  Makefile
  msisac.iss
])

#  src/Makefile
#  pkgconfig/Makefile
#  pkgconfig/silk.pc
#  man/Makefile
AC_OUTPUT