configure.ac 3.4 KB
Newer Older
Arun Raghavan's avatar
Arun Raghavan committed
1
# Revision changelog (version - date, svn rev. from upstream that was merged)
2
#    0.1 - 21 Oct 2011, r789
Arun Raghavan's avatar
Arun Raghavan committed
3
AC_INIT([webrtc-audio-processing], [0.1])
Arun Raghavan's avatar
Arun Raghavan committed
4
AM_INIT_AUTOMAKE([dist-xz subdir-objects tar-ustar])
Arun Raghavan's avatar
Arun Raghavan committed
5
6
7
8
9

AC_SUBST(LIBWEBRTC_AUDIO_PROCESSING_VERSION_INFO, [0:0:0])

AM_SILENT_RULES([yes])

10
11
12
# Set up the host_* variables
AC_CANONICAL_HOST

Arun Raghavan's avatar
Arun Raghavan committed
13
14
15
16
AC_PROG_CC
AC_PROG_CXX
AC_PROG_LIBTOOL
AC_PROG_INSTALL
17
AM_PROG_AS
Arun Raghavan's avatar
Arun Raghavan committed
18
19
20
21
22
23
24
25
26
27
28
29
30

AC_LANG_C
AC_LANG_CPLUSPLUS

AC_ARG_WITH([ns-mode],
	    AS_HELP_STRING([--with-ns-mode=float|fixed], [Noise suppresion mode to use. Default is float]))

AS_CASE(["x${with_ns_mode}"],
	["fixed"], [NS_FIXED=1],
	["float"], [NS_FIXED=0],
	[NS_FIXED=0])
AM_CONDITIONAL(NS_FIXED, [test "x${NS_FIXED}" = "x1"])

31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59

# Borrowed from gst-plugins-bad
AC_CHECK_HEADER(MobileCoreServices/MobileCoreServices.h, HAVE_IOS="yes", HAVE_IOS="no", [-])

# Based on gst-plugins-bad configure.ac and defines in
# <chromium source>/build/config/BUILDCONFIG.gn and
# webrtc/BUILD.gn
AS_CASE(["${host}"],
    [*android*],
        [
         OS_CFLAGS="-DWEBRTC_ANDROID -DWEBRTC_LINUX"
         PLATFORM_CFLAGS="-DWEBRTC_POSIX"
        ],
    [*-*linux*],
        [
         OS_CFLAGS="-DWEBRTC_LINUX"
         PLATFORM_CFLAGS="-DWEBRTC_POSIX"
        ],
    [*-*darwin*],
        [
         AS_IF([test "$HAVE_IOS" = "yes"],
             [OS_FLAGS="-DWEBRTC_MAC -DWEBRTC_IOS"],
             [OS_FLAGS="-DWEBRTC_MAC"])
         PLATFORM_CFLAGS="-DWEBRTC_POSIX"
        ]
    # FIXME: Add Windows support
)
AC_SUBST(PLATFORM_CFLAGS)

60
61
62
63
64
65
66
67
68
AS_CASE(["${host_cpu}"],
    [i?86|x86_64],
        [
         HAVE_X86=1
        ],
    [armv7*|armv8*],
        [
         HAVE_ARM=1
         HAVE_ARMV7=1
69
         ARCH_CFLAGS="-DWEBRTC_ARCH_ARM -DWEBRTC_ARCH_ARM_V7"
70
71
72
73
        ],
    [arm*],
        [
         HAVE_ARM=1
74
         ARCH_CFLAGS="-DWEBRTC_ARCH_ARM"
75
76
77
78
79
80
81
82
83
84
85
86
87
88
        ]
    # FIXME: Add MIPS support, see webrtc/BUILD.gn for defines
)
AM_CONDITIONAL(HAVE_X86, [test "x${HAVE_X86}" = "x1"])
AM_CONDITIONAL(HAVE_ARM, [test "x${HAVE_ARM}" = "x1"])
AM_CONDITIONAL(HAVE_ARMV7, [test "x${HAVE_ARMV7}" = "x1"])

# Borrowed from pulseaudio's configure.ac
AC_ARG_ENABLE([neon],
    AS_HELP_STRING([--enable-neon], [Enable NEON optimisations on ARM CPUs that support it (yes|no|auto|runtime)]))

AS_IF([test "x$enable_neon" != "xno"],
    AS_IF([test "x$enable_neon" != "xruntime"],
        [
89
         save_CXXFLAGS="$CXXFLAGS"; CXXFLAGS="-mfpu=neon $CXXFLAGS"
90
         AC_COMPILE_IFELSE(
91
92
93
94
            [AC_LANG_PROGRAM(
                [
                 #include <arm_neon.h>
                ], [])],
95
96
            [
             HAVE_NEON=1
97
             ARCH_CFLAGS="$ARCH_CFLAGS -DWEBRTC_HAS_NEON -mfpu=neon"
98
            ])
99
         CXXFLAGS="$save_CXXFLAGS"
100
101
102
        ],
        [
         HAVE_NEON=1
103
         ARCH_CFLAGS="$ARCH_CFLAGS -DWEBRTC_DETECT_NEON -mfpu=neon"
104
105
106
107
108
109
        ])
)
AM_CONDITIONAL([HAVE_NEON], [test "x$HAVE_NEON" = "x1"])

COMMON_CFLAGS="-DWEBRTC_AUDIO_PROCESSING_ONLY_BUILD ${PLATFORM_CFLAGS} ${OS_CFLAGS} ${ARCH_CFLAGS} -DNDEBUG -I\$(top_srcdir)"
COMMON_CXXFLAGS="-std=c++11 -DWEBRTC_AUDIO_PROCESSING_ONLY_BUILD ${PLATFORM_CFLAGS} ${OS_CFLAGS} ${ARCH_CFLAGS} -DNDEBUG -I\$(top_srcdir)"
Arun Raghavan's avatar
Arun Raghavan committed
110
111
112
113
AC_SUBST([COMMON_CFLAGS])
AC_SUBST([COMMON_CXXFLAGS])

AC_CONFIG_FILES([
114
webrtc-audio-processing.pc
Arun Raghavan's avatar
Arun Raghavan committed
115
Makefile
Arun Raghavan's avatar
Arun Raghavan committed
116
webrtc/Makefile
Arun Raghavan's avatar
Arun Raghavan committed
117
webrtc/base/Makefile
Arun Raghavan's avatar
Arun Raghavan committed
118
119
120
webrtc/common_audio/Makefile
webrtc/system_wrappers/Makefile
webrtc/modules/Makefile
Arun Raghavan's avatar
Arun Raghavan committed
121
webrtc/modules/audio_coding/Makefile
Arun Raghavan's avatar
Arun Raghavan committed
122
webrtc/modules/audio_processing/Makefile
Arun Raghavan's avatar
Arun Raghavan committed
123
124
125
])

AC_OUTPUT