File: configure.ac

package info (click to toggle)
libcmtspeechdata 2.1.1%2Bgit20160721~8efc468-2.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, trixie
  • size: 640 kB
  • sloc: ansic: 4,657; makefile: 156; sh: 8
file content (158 lines) | stat: -rw-r--r-- 4,162 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
dnl Copyright (C) 2008,2010,2011 Nokia Corporation
dnl Contact: Kai Vehmanen <kai.vehmanen@nokia.com>
dnl Licensed under LGPL. See file COPYING.

dnl 
dnl ref: http://www.gnu.org/software/autoconf/manual/autoconf.info.gz
dnl
AC_PREREQ(2.57)

dnl information on the package
dnl ---------------------------

AC_INIT([libcmtspeechdata], [2.1.1])
AC_CONFIG_MACRO_DIR([m4])
AC_CONFIG_SRCDIR([cmtspeech.h])
AM_INIT_AUTOMAKE([foreign subdir-objects])
AM_MAINTAINER_MODE

VERSION_MAJOR=`echo $VERSION |cut -f1 -d.`
VERSION_LIBRARY_API=`echo $VERSION |cut -f2 -d.`
VERSION_MINOR=`echo $VERSION |cut -f3 -d.`
VERSION_PROTOCOL=2
AC_SUBST(VERSION_MAJOR)
AC_SUBST(VERSION_LIBRARY_API)
AC_SUBST(VERSION_MINOR)
AC_SUBST(VERSION_PROTOCOL)

dnl checks for programs
dnl -------------------
AC_PROG_CC
AC_PROG_INSTALL
AC_PROG_CPP
AC_CHECK_TOOL(AR, ar, ar)
AC_CHECK_TOOL(LD, ld, ld)
AC_PROG_LIBTOOL
AM_PROG_CC_C_O

dnl check for debugging options
dnl -------------------
AC_MSG_CHECKING([whether to enable asserts and other debug facilities])
AC_ARG_ENABLE([extra-debug], 
              AC_HELP_STRING([--disable-extra-debug], [Disable asserts and debug traces]),
              AC_MSG_RESULT([no])
               AC_DEFINE(NDEBUG, 1, [Define to 1 if debug facilities should be disabled]),
              AC_MSG_RESULT([yes]))

dnl check for doxygen
dnl -----------------

AC_ARG_ENABLE(docs, AC_HELP_STRING([--enable-docs], [Build DOXYGEN documentation (requires Doxygen)]),
                    enable_docs=$enableval,enable_docs=auto)

AC_PATH_PROG(DOXYGEN, doxygen, no)
AC_MSG_CHECKING([whether to build Doxygen documentation])

if test x$DOXYGEN = xno ; then
    have_doxygen=no
else
    have_doxygen=yes
fi
if test x$enable_docs = xauto ; then
    if test x$have_doxygen = xno ; then
        enable_docs=no
    else
        enable_docs=yes
    fi
fi
if test x$enable_docs = xyes; then
    if test x$have_doxygen = xno; then
        AC_MSG_ERROR([Building Doxygen docs explicitly required, but Doxygen not found])
    else
    AC_MSG_RESULT(yes)
    fi
else
    AC_MSG_RESULT(no)
fi

AM_CONDITIONAL(DOXYGEN_DOCS_ENABLED, test x$enable_docs = xyes)
AC_SUBST(DOXYGEN)

dnl checks for libraries
dnl --------------------

PKG_CHECK_MODULES([CHECK], [check >= 0.9.4])

PKG_CHECK_MODULES([DBUS], [dbus-1 >= 1.0])
AC_SUBST(DBUS_CFLAGS)
AC_SUBST(DBUS_LIBS)

PKG_CHECK_MODULES([PULSE], [libpulse-simple >= 9.0])
AC_SUBST(PULSE_CFLAGS)
AC_SUBST(PULSE_LIBS)

dnl note: this affects the main library build (the dummy
dnl       library is built always under dummy-backend/ )
default_backend="nokiamodem"
AC_ARG_WITH([backend], 
  AC_HELP_STRING([--with-backend=BACKEND],
    [select which backend to use]),
    [
      case "$withval" in
          dummy)
          backend="dummy"
	  ;;
        nokiamodem)
          backend="nokiamodem"
	  ;;
        null)
          backend="null"
	  ;;
	*)
	  AC_MSG_ERROR([unsupported backend: $withval])
	  ;;
      esac
    ])
if test "x$backend" = "x" ; then
  backend="$default_backend"
fi
AM_CONDITIONAL(USE_BACKEND_DUMMY, [test "x$backend" = "xdummy"])
AM_CONDITIONAL(USE_BACKEND_NOKIAMODEM, [test "x$backend" = "xnokiamodem"])
AM_CONDITIONAL(USE_BACKEND_NULL, [test "x$backend" = "xnull"])
AC_MSG_RESULT([selecting default backend: $backend])

AC_ARG_ENABLE(nokiamodem-vdd2lock, 
  AC_HELP_STRING([--enable-nokiamodem-vdd2lock],
    [nokiamodem: Utilize Maemo5 kernel interface for memory/vdd2 locking]),
  nokiamodem_vdd2lock=$enableval,nokiamodem_vdd2lock=no)
if test "x$nokiamodem_vdd2lock" = "xyes" ; then
  AC_DEFINE(NOKIAMODEM_VDD2LOCK, 1, [Define to 1 if debug facilities should be disabled])
fi

dnl checks for types
dnl ----------------

dnl checks for structures
dnl ---------------------
AC_CHECK_HEADERS(stdio.h)
AC_CHECK_HEADERS(sched.h sys/stat.h sys/mman.h)
AC_CHECK_HEADERS(mcheck.h syslog.h)
AC_CHECK_HEADERS(linux/cs-protocol.h)

dnl checks for typedefs, structures, and compiler characteristics.
dnl --------------------------------------------------------------
AC_C_CONST

dnl output
dnl ------

AC_CONFIG_FILES([
Makefile
cmtspeech_config.h
libcmtspeechdata.pc
doc/Makefile
doc/doxygen.cfg
dummy-backend/Makefile
])

AC_OUTPUT