blob: 38bd47884558367c0d88dcaf9e9365b88a661150 [file] [log] [blame]
Quinn Male2e883752019-03-22 11:28:54 -07001# -*- Autoconf -*-
2# configure.ac -- Autoconf script for sound_trigger
3#
4
5# Process this file with autoconf to produce a configure script
6
7# Requires autoconf tool later than 2.61
8AC_PREREQ(2.61)
9# Initialize the sound_trigger package version 1.0.0
10AC_INIT([sound_trigger],1.0.0)
11# Does not strictly follow GNU Coding standards
12AM_INIT_AUTOMAKE([foreign])
13# Disables auto rebuilding of configure, Makefile.ins
14AM_MAINTAINER_MODE
15# Verifies the --srcdir is correct by checking for the path
16AC_CONFIG_SRCDIR([sound_trigger_hw.c])
17# defines some macros variable to be included by source
18AC_CONFIG_HEADERS([config.h])
19AC_CONFIG_MACRO_DIR([m4])
20
21# Checks for programs.
22AC_PROG_CC
23AM_PROG_CC_C_O
24AC_PROG_CXX
25AC_PROG_LIBTOOL
26AC_PROG_AWK
27AC_PROG_CPP
28AC_PROG_INSTALL
29AC_PROG_LN_S
30AC_PROG_MAKE_SET
31PKG_PROG_PKG_CONFIG
32
33PKG_CHECK_MODULES([TINYALSA],[tinyalsa])
34AC_SUBST([TINYALSA_CFLAGS])
35PKG_CHECK_MODULES([HARDWARE],[hardware])
36AC_SUBST([HARDWARE_CFLAGS])
37AC_SUBST([SYSTEM_MEDIA_CFLAGS],[-I$(includedir)/])
38PKG_CHECK_MODULES([AUDIO_ROUTE],[audio_route])
39AC_SUBST([AUDIO_ROUTE_CFLAGS])
40
41AC_ARG_WITH(sanitized-headers,
42 AS_HELP_STRING([--with-sanitized-headers=DIR],
43 [Specify the location of the sanitized Linux headers]),
44 [CPPFLAGS="$CPPFLAGS -idirafter $withval"])
45
46AM_CONDITIONAL([QSTHW_API],[test x$BOARD_SUPPORTS_QSTHW_API = xtrue])
47AM_CONDITIONAL([TEST_APP],[test x$BUILD_APP = xtrue])
48AM_CONDITIONAL([USE_KEEP_ALIVE],[test x$ENABLE_KEEP_ALIVE = xtrue])
49AM_CONDITIONAL([SOUND_TRIGGER_CPU_AFFINITY_SET],[test x$BOARD_SUPPORTS_SOUND_TRIGGER_CPU_AFFINITY_SET = xtrue])
50
51AC_ARG_WITH([glib],
52 AC_HELP_STRING([--with-glib],
53 [enable glib, Build against glib. Use this when building for HLOS systems which use glib]))
54
55if (test "x${with_glib}" = "xyes"); then
56 PKG_CHECK_MODULES(GTHREAD, gthread-2.0 >= 2.16, dummy=yes,
57 AC_MSG_ERROR(GThread >= 2.16 is required))
58 PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.16, dummy=yes,
59 AC_MSG_ERROR(GLib >= 2.16 is required))
60 GLIB_CFLAGS="$GLIB_CFLAGS $GTHREAD_CFLAGS"
61 GLIB_LIBS="$GLIB_LIBS $GTHREAD_LIBS"
62
63 AC_SUBST(GLIB_CFLAGS)
64 AC_SUBST(GLIB_LIBS)
65fi
66
67AM_CONDITIONAL(USE_GLIB, test "x${with_glib}" = "xyes")
68
69AC_CONFIG_FILES([ \
70 Makefile \
71 sound_trigger.pc
72 ])
73
74AC_OUTPUT