1 dnl Process this file with autoconf to produce a configure script.
3 AC_INIT(src/ascenario.c)
4 dnl *************************************************
5 dnl current:revision:age
6 dnl change (without API) = c:r+1:a
7 dnl change API = c+1:0:a
8 dnl add API = c+1:0:a+1
9 dnl remove API = c+1:0:0
10 dnl *************************************************
13 ASCENARIO_MAJOR_VERSION=0
14 ASCENARIO_MINOR_VERSION=2
15 ASCENARIO_MICRO_VERSION=0
16 ASCENARIO_VERSION=$ASCENARIO_MAJOR_VERSION.$ASCENARIO_MINOR_VERSION.$ASCENARIO_MICRO_VERSION
17 AC_SUBST(ASCENARIO_MAJOR_VERSION)
18 AC_SUBST(ASCENARIO_MINOR_VERSION)
19 AC_SUBST(ASCENARIO_MICRO_VERSION)
20 AC_SUBST(ASCENARIO_VERSION)
22 LT_VERSION=$ASCENARIO_MICRO_VERSION
23 LT_RELEASE=$ASCENARIO_MAJOR_VERSION.$ASCENARIO_MINOR_VERSION
28 AM_INIT_AUTOMAKE(scenario-lib, $ASCENARIO_VERSION)
29 eval LIBTOOL_VERSION_INFO="2:0:0"
30 dnl *************************************************
31 AM_CONDITIONAL(INSTALL_M4, test -n "${ACLOCAL}")
33 # Test for new silent rules
34 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
36 AC_PREFIX_DEFAULT(/usr)
38 dnl Checks for programs.
40 dnl try to gues cross-compiler if not set
41 if test "x$target" != "x$host" -a -z "`echo $CC | grep -e '-gcc'`";
43 AC_MSG_CHECKING(for cross-compiler)
45 which ${program_prefix}gcc >/dev/null 2>&1 && CC=${program_prefix}gcc
46 which ${target_cpu}-${target_os}-gcc >/dev/null 2>&1 \
47 && CC=${target_cpu}-${target-os}-gcc
48 which ${target_cpu}-${target_vendor}-${target_os}-gcc >/dev/null 2>&1 \
49 && CC=${target_cpu}-${target_vendor}-${target_os}-gcc
62 dnl Checks for header files.
64 AM_CONFIG_HEADER(include/config.h)
66 dnl Checks for typedefs, structures, and compiler characteristics.
72 AC_SUBST(LIBTOOL_VERSION_INFO)
74 test "x$prefix" = xNONE && prefix=$ac_default_prefix
76 PKG_CHECK_MODULES(ALSA, alsa)
78 dnl ALSA configuration directory
79 AC_ARG_WITH(configdir,
80 AS_HELP_STRING([--with-configdir=dir],
81 [path where ALSA config files are stored]),
82 confdir="$withval", confdir="")
83 if test -z "$confdir"; then
87 *) dir="$prefix/share"
91 ALSA_CONFIG_DIR="$confdir"
92 AC_DEFINE_UNQUOTED(ALSA_CONFIG_DIR, "$confdir", [directory containing ALSA configuration database])
93 AC_SUBST(ALSA_CONFIG_DIR)
95 dnl ALSA plugin directory
96 test "x$exec_prefix" = xNONE && exec_prefix=$prefix
98 AC_ARG_WITH(plugindir,
99 AS_HELP_STRING([--with-plugindir=dir],
100 [path where ALSA plugin files are stored]),
101 plugindir="$withval", plugindir="")
102 if test -z "$plugindir"; then
108 plugindir="$dir/$PACKAGE"
110 AC_DEFINE_UNQUOTED(ALSA_PLUGIN_DIR, "$plugindir", [directory containing ALSA add-on modules])
111 ALSA_PLUGIN_DIR="$plugindir"
112 AC_SUBST(ALSA_PLUGIN_DIR)
114 dnl Check for versioned symbols
115 AC_MSG_CHECKING(for versioned symbols)
116 AC_ARG_WITH(versioned,
117 AS_HELP_STRING([--with-versioned],
118 [shared library will be compiled with versioned symbols (default = yes)]),
119 versioned="$withval", versioned="yes")
120 if test "$versioned" = "yes"; then
121 # it seems that GNU ld versions since 2.10 are not broken
122 xres=`grep '^VERSION=' libtool | cut -d = -f 2 | cut -d \" -f 2`
123 major=`echo $xres | cut -d . -f 1`
124 minor=`echo $xres | cut -d . -f 2`
126 if test $major -eq 1 -a $minor -gt 3; then
129 if test $major -gt 1; then
133 if test $pass -eq 1; then
134 AC_DEFINE(VERSIONED_SYMBOLS,,[compiled with versioned symbols])
137 AC_MSG_RESULT(broken libtool - use libtool v1.4+; no versions)
142 AM_CONDITIONAL(VERSIONED_SYMBOLS, test x$versioned = xyes)
144 dnl Check for symbolic-functions
145 AC_MSG_CHECKING(for symbolic-functions)
146 AC_ARG_ENABLE(symbolic-functions,
147 AS_HELP_STRING([--enable-symbolic-functions],
148 [use -Bsymbolic-functions option if available (optmization for size and speed)]),
149 symfuncs="$enableval", symfuncs="no")
150 if test "$symfuncs" = "yes"; then
151 if ld --help | grep -q -- '-Bsymbolic-functions'; then
154 AC_MSG_RESULT(not supported by ld)
160 AM_CONDITIONAL(SYMBOLIC_FUNCTIONS, test x"$symfuncs" = xyes)
162 dnl See if toolchain has a custom prefix for symbols ...
163 AC_MSG_CHECKING(for custom symbol prefixes)
165 echo "PREFIX=__USER_LABEL_PREFIX__" \
166 | ${CPP-${CC-gcc} -E} - 2>&1 \
167 | ${EGREP-grep} "^PREFIX=" \
168 | ${SED-sed} "s:^PREFIX=::"`
169 AC_DEFINE_UNQUOTED([__SYMBOL_PREFIX], "$SYMBOL_PREFIX", [Toolchain Symbol Prefix])
170 AC_SUBST(SYMBOL_PREFIX)
171 AC_MSG_RESULT($SYMBOL_PREFIX)
173 dnl Check for debug...
174 AC_MSG_CHECKING(for debug)
176 AS_HELP_STRING([--with-debug],
177 [library will be compiled with asserts (default = yes)]),
178 debug="$withval", debug="yes")
179 if test "$debug" = "yes"; then
182 AC_DEFINE(NDEBUG,,[No assert debug])
186 if test "$debug" = "yes"; then
187 AC_MSG_CHECKING(for debug assert)
188 AC_ARG_ENABLE(debug-assert,
189 AS_HELP_STRING([--enable-debug],
190 [enable assert call at the default error message handler]),
191 debug_assert="$enableval", debug_assert="no")
192 if test "$debug_assert" = "yes"; then
194 AC_DEFINE(ALSA_DEBUG_ASSERT,,[Enable assert at error message handler])
200 AC_SUBST(ALSA_DEPLIBS)
202 dnl Check for architecture
203 AC_MSG_CHECKING(for architecture)
216 CPPFLAGS="$CPPFLAGS -D__ppc__"
220 CPPFLAGS="$CPPFLAGS -D__ia64__"
224 CPPFLAGS="$CPPFLAGS -D__mips__"
228 CPPFLAGS="$CPPFLAGS -D__arm__"
231 AC_MSG_RESULT($host_cpu)
232 echo "No atomic operations supported.."
236 dnl Check for wordexp.h
237 AC_CHECK_HEADERS([wordexp.h])
239 dnl Make a symlink for inclusion of alsa/xxx.h
240 #if test ! -L "$srcdir"/include/alsa ; then
241 # echo "Making a symlink include/alsa"
242 # rm -f "$srcdir"/include/alsa
243 # ln -sf . "$srcdir"/include/alsa
246 AC_OUTPUT(Makefile include/Makefile src/Makefile examples/Makefile pkgconfig/Makefile pkgconfig/libascenario.pc)