OSDN Git Service

build: Add option to disable SBC tools
[android-x86/external-bluetooth-sbc.git] / configure.ac
1 AC_PREREQ(2.60)
2 AC_INIT(sbc, 0.0)
3
4 AM_INIT_AUTOMAKE([foreign subdir-objects color-tests])
5 AM_CONFIG_HEADER(config.h)
6
7 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
8
9 AM_MAINTAINER_MODE
10
11 AC_PREFIX_DEFAULT(/usr/local)
12
13 COMPILER_FLAGS
14
15 AC_LANG_C
16
17 AC_PROG_CC
18 AC_PROG_CC_PIE
19 AC_PROG_INSTALL
20
21 LT_INIT
22
23 AC_ARG_ENABLE(optimization, AC_HELP_STRING([--disable-optimization],
24                         [disable code optimization through compiler]), [
25         if (test "${enableval}" = "no"); then
26                 CFLAGS="$CFLAGS -O0"
27         fi
28 ])
29
30 AC_ARG_ENABLE(debug, AC_HELP_STRING([--enable-debug],
31                         [enable compiling with debugging information]), [
32         if (test "${enableval}" = "yes" &&
33                                 test "${ac_cv_prog_cc_g}" = "yes"); then
34                 CFLAGS="$CFLAGS -g"
35         fi
36 ])
37
38 AC_ARG_ENABLE(pie, AC_HELP_STRING([--enable-pie],
39                         [enable position independent executables flag]), [
40         if (test "${enableval}" = "yes" &&
41                                 test "${ac_cv_prog_cc_pie}" = "yes"); then
42                 CFLAGS="$CFLAGS -fPIE"
43                 LDFLAGS="$LDFLAGS -pie"
44         fi
45 ])
46
47 AC_ARG_ENABLE(tools, AC_HELP_STRING([--disable-tools],
48                 [disable SBC tools]), [enable_tools=${enableval}])
49 AM_CONDITIONAL(TOOLS, test "${enable_tools}" != "no")
50
51 AC_ARG_ENABLE(sbctester, AC_HELP_STRING([--disable-sbctester],
52                 [disable SBC tester]), [enable_sbctester=${enableval}])
53 if (test "${enable_sbctester}" != "no"); then
54         PKG_CHECK_MODULES(SNDFILE, sndfile, dummy=yes,
55                                 AC_MSG_ERROR(sndfile library is required))
56         AC_SUBST(SNDFILE_CFLAGS)
57         AC_SUBST(SNDFILE_LIBS)
58 fi
59 AM_CONDITIONAL(SBCTESTER, test "${enable_sbctester}" != "no")
60
61 AC_OUTPUT(Makefile)