xref: /aosp_15_r20/external/rnnoise/configure.ac (revision 1295d6828459cc82c3c29cc5d7d297215250a74b)
1*1295d682SXin Li# autoconf source script for generating configure
2*1295d682SXin Li
3*1295d682SXin Lidnl The package_version file will be automatically synced to the git revision
4*1295d682SXin Lidnl by the update_version script when configured in the repository, but will
5*1295d682SXin Lidnl remain constant in tarball releases unless it is manually edited.
6*1295d682SXin Lim4_define([CURRENT_VERSION],
7*1295d682SXin Li          m4_esyscmd([ ./update_version 2>/dev/null || true
8*1295d682SXin Li                       if test -e package_version; then
9*1295d682SXin Li                           . ./package_version
10*1295d682SXin Li                           printf "$PACKAGE_VERSION"
11*1295d682SXin Li                       else
12*1295d682SXin Li                           printf "unknown"
13*1295d682SXin Li                       fi ]))
14*1295d682SXin Li
15*1295d682SXin LiAC_INIT([rnnoise],[CURRENT_VERSION],[[email protected]])
16*1295d682SXin LiAC_CONFIG_SRCDIR([src/denoise.c])
17*1295d682SXin LiAC_CONFIG_MACRO_DIR([m4])
18*1295d682SXin Li
19*1295d682SXin LiAC_USE_SYSTEM_EXTENSIONS
20*1295d682SXin LiAC_SYS_LARGEFILE
21*1295d682SXin Li
22*1295d682SXin LiAM_INIT_AUTOMAKE([1.11 foreign no-define dist-zip subdir-objects])
23*1295d682SXin LiAM_MAINTAINER_MODE([enable])
24*1295d682SXin Li
25*1295d682SXin LiAC_C_INLINE
26*1295d682SXin Li
27*1295d682SXin LiLT_INIT
28*1295d682SXin Li
29*1295d682SXin Lim4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
30*1295d682SXin Li
31*1295d682SXin LiAC_DEFINE([RNNOISE_BUILD], [], [This is a build of the library])
32*1295d682SXin Li
33*1295d682SXin Lidnl Library versioning for libtool.
34*1295d682SXin Lidnl Please update these for releases.
35*1295d682SXin Lidnl CURRENT, REVISION, AGE
36*1295d682SXin Lidnl - library source changed -> increment REVISION
37*1295d682SXin Lidnl - interfaces added/removed/changed -> increment CURRENT, REVISION = 0
38*1295d682SXin Lidnl - interfaces added -> increment AGE
39*1295d682SXin Lidnl - interfaces removed -> AGE = 0
40*1295d682SXin Li
41*1295d682SXin LiOP_LT_CURRENT=4
42*1295d682SXin LiOP_LT_REVISION=1
43*1295d682SXin LiOP_LT_AGE=4
44*1295d682SXin Li
45*1295d682SXin LiAC_SUBST(OP_LT_CURRENT)
46*1295d682SXin LiAC_SUBST(OP_LT_REVISION)
47*1295d682SXin LiAC_SUBST(OP_LT_AGE)
48*1295d682SXin Li
49*1295d682SXin LiCC_CHECK_CFLAGS_APPEND(
50*1295d682SXin Li  [-pedantic -Wall -Wextra -Wno-sign-compare -Wno-parentheses -Wno-long-long])
51*1295d682SXin Li
52*1295d682SXin Li# Platform-specific tweaks
53*1295d682SXin Licase $host in
54*1295d682SXin Li  *-mingw*)
55*1295d682SXin Li    # -std=c89 causes some warnings under mingw.
56*1295d682SXin Li    CC_CHECK_CFLAGS_APPEND([-U__STRICT_ANSI__])
57*1295d682SXin Li    # We need WINNT>=0x501 (WindowsXP) for getaddrinfo/freeaddrinfo.
58*1295d682SXin Li    # It's okay to define this even when HTTP support is disabled, as it only
59*1295d682SXin Li    #  affects header declarations, not linking (unless we actually use some
60*1295d682SXin Li    #  XP-only functions).
61*1295d682SXin Li    AC_DEFINE_UNQUOTED(_WIN32_WINNT,0x501,
62*1295d682SXin Li     [We need at least WindowsXP for getaddrinfo/freeaddrinfo])
63*1295d682SXin Li    host_mingw=true
64*1295d682SXin Li    ;;
65*1295d682SXin Liesac
66*1295d682SXin LiAM_CONDITIONAL(OP_WIN32, test "$host_mingw" = "true")
67*1295d682SXin Li
68*1295d682SXin LiAC_ARG_ENABLE([assertions],
69*1295d682SXin Li  AS_HELP_STRING([--enable-assertions], [Enable assertions in code]),,
70*1295d682SXin Li  enable_assertions=no)
71*1295d682SXin Li
72*1295d682SXin LiAS_IF([test "$enable_assertions" = "yes"], [
73*1295d682SXin Li  AC_DEFINE([OP_ENABLE_ASSERTIONS], [1], [Enable assertions in code])
74*1295d682SXin Li])
75*1295d682SXin Li
76*1295d682SXin LiAC_ARG_ENABLE([examples],
77*1295d682SXin Li  AS_HELP_STRING([--disable-examples], [Do not build example applications]),,
78*1295d682SXin Li  enable_examples=yes)
79*1295d682SXin LiAM_CONDITIONAL([OP_ENABLE_EXAMPLES], [test "$enable_examples" = "yes"])
80*1295d682SXin Li
81*1295d682SXin LiAS_CASE(["$ac_cv_search_lrintf"],
82*1295d682SXin Li  ["no"],[],
83*1295d682SXin Li  ["none required"],[],
84*1295d682SXin Li  [lrintf_lib="$ac_cv_search_lrintf"])
85*1295d682SXin Li
86*1295d682SXin LiLT_LIB_M
87*1295d682SXin Li
88*1295d682SXin LiAC_SUBST([lrintf_lib])
89*1295d682SXin Li
90*1295d682SXin LiCC_ATTRIBUTE_VISIBILITY([default], [
91*1295d682SXin Li  CC_FLAG_VISIBILITY([CFLAGS="${CFLAGS} -fvisibility=hidden"])
92*1295d682SXin Li])
93*1295d682SXin Li
94*1295d682SXin Lidnl Check for doxygen
95*1295d682SXin LiAC_ARG_ENABLE([doc],
96*1295d682SXin Li  AS_HELP_STRING([--disable-doc], [Do not build API documentation]),,
97*1295d682SXin Li  [enable_doc=yes]
98*1295d682SXin Li)
99*1295d682SXin Li
100*1295d682SXin LiAS_IF([test "$enable_doc" = "yes"], [
101*1295d682SXin Li  AC_CHECK_PROG([HAVE_DOXYGEN], [doxygen], [yes], [no])
102*1295d682SXin Li  AC_CHECK_PROG([HAVE_DOT], [dot], [yes], [no])
103*1295d682SXin Li],[
104*1295d682SXin Li  HAVE_DOXYGEN=no
105*1295d682SXin Li])
106*1295d682SXin Li
107*1295d682SXin LiAM_CONDITIONAL([HAVE_DOXYGEN], [test "$HAVE_DOXYGEN" = "yes"])
108*1295d682SXin Li
109*1295d682SXin LiAC_CONFIG_FILES([
110*1295d682SXin Li  Makefile
111*1295d682SXin Li  rnnoise.pc
112*1295d682SXin Li  rnnoise-uninstalled.pc
113*1295d682SXin Li  doc/Doxyfile
114*1295d682SXin Li])
115*1295d682SXin LiAC_CONFIG_HEADERS([config.h])
116*1295d682SXin LiAC_OUTPUT
117*1295d682SXin Li
118*1295d682SXin LiAC_MSG_NOTICE([
119*1295d682SXin Li------------------------------------------------------------------------
120*1295d682SXin Li  $PACKAGE_NAME $PACKAGE_VERSION: Automatic configuration OK.
121*1295d682SXin Li
122*1295d682SXin Li    Assertions ................... ${enable_assertions}
123*1295d682SXin Li
124*1295d682SXin Li    Hidden visibility ............ ${cc_cv_flag_visibility}
125*1295d682SXin Li
126*1295d682SXin Li    API code examples ............ ${enable_examples}
127*1295d682SXin Li    API documentation ............ ${enable_doc}
128*1295d682SXin Li------------------------------------------------------------------------
129*1295d682SXin Li])
130