1
# Local macros for the SDL configure.in script
3
dnl Function to link an architecture specific file
4
dnl LINK_ARCH_SRC(source_dir, arch, source_file)
5
AC_DEFUN([COPY_ARCH_SRC],
10
echo "Creating directory $1"
13
echo "Copying $old -> $new"
15
/* WARNING: This file was automatically generated!
21
##############################################################################
22
dnl Configure Paths for Alsa
23
dnl Some modifications by Richard Boulton <richard-alsa@tartarus.org>
24
dnl Christopher Lansdown <lansdoct@cs.alfred.edu>
25
dnl Jaroslav Kysela <perex@suse.cz>
26
dnl Last modification: alsa.m4,v 1.23 2004/01/16 18:14:22 tiwai Exp
27
dnl AM_PATH_ALSA([MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
28
dnl Test for libasound, and define ALSA_CFLAGS and ALSA_LIBS as appropriate.
29
dnl enables arguments --with-alsa-prefix=
30
dnl --with-alsa-enc-prefix=
31
dnl --disable-alsatest
33
dnl For backwards compatibility, if ACTION_IF_NOT_FOUND is not specified,
34
dnl and the alsa libraries are not found, a fatal AC_MSG_ERROR() will result.
36
AC_DEFUN([AM_PATH_ALSA],
37
[dnl Save the original CFLAGS, LDFLAGS, and LIBS
38
alsa_save_CFLAGS="$CFLAGS"
39
alsa_save_LDFLAGS="$LDFLAGS"
40
alsa_save_LIBS="$LIBS"
44
dnl Get the cflags and libraries for alsa
46
AC_ARG_WITH(alsa-prefix,
47
[ --with-alsa-prefix=PFX Prefix where Alsa library is installed(optional)],
48
[alsa_prefix="$withval"], [alsa_prefix=""])
50
AC_ARG_WITH(alsa-inc-prefix,
51
[ --with-alsa-inc-prefix=PFX Prefix where include libraries are (optional)],
52
[alsa_inc_prefix="$withval"], [alsa_inc_prefix=""])
54
dnl FIXME: this is not yet implemented
55
AC_ARG_ENABLE(alsatest,
56
[ --disable-alsatest Do not try to compile and run a test Alsa program],
57
[enable_alsatest="$enableval"],
58
[enable_alsatest=yes])
60
dnl Add any special include directories
61
AC_MSG_CHECKING(for ALSA CFLAGS)
62
if test "$alsa_inc_prefix" != "" ; then
63
ALSA_CFLAGS="$ALSA_CFLAGS -I$alsa_inc_prefix"
64
CFLAGS="$CFLAGS -I$alsa_inc_prefix"
66
AC_MSG_RESULT($ALSA_CFLAGS)
68
dnl add any special lib dirs
69
AC_MSG_CHECKING(for ALSA LDFLAGS)
70
if test "$alsa_prefix" != "" ; then
71
ALSA_LIBS="$ALSA_LIBS -L$alsa_prefix"
72
LDFLAGS="$LDFLAGS $ALSA_LIBS"
75
dnl add the alsa library
76
ALSA_LIBS="$ALSA_LIBS -lasound -lm -ldl -lpthread"
77
LIBS=`echo $LIBS | sed 's/-lm//'`
78
LIBS=`echo $LIBS | sed 's/-ldl//'`
79
LIBS=`echo $LIBS | sed 's/-lpthread//'`
80
LIBS=`echo $LIBS | sed 's/ //'`
81
LIBS="$ALSA_LIBS $LIBS"
82
AC_MSG_RESULT($ALSA_LIBS)
84
dnl Check for a working version of libasound that is of the right version.
85
min_alsa_version=ifelse([$1], ,0.1.1,$1)
86
AC_MSG_CHECKING(for libasound headers version >= $min_alsa_version)
88
alsa_min_major_version=`echo $min_alsa_version | \
89
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
90
alsa_min_minor_version=`echo $min_alsa_version | \
91
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
92
alsa_min_micro_version=`echo $min_alsa_version | \
93
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
98
#include <alsa/asoundlib.h>
100
/* ensure backward compatibility */
101
#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
102
#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
104
#if !defined(SND_LIB_MINOR) && defined(SOUNDLIB_VERSION_MINOR)
105
#define SND_LIB_MINOR SOUNDLIB_VERSION_MINOR
107
#if !defined(SND_LIB_SUBMINOR) && defined(SOUNDLIB_VERSION_SUBMINOR)
108
#define SND_LIB_SUBMINOR SOUNDLIB_VERSION_SUBMINOR
111
# if(SND_LIB_MAJOR > $alsa_min_major_version)
114
# if(SND_LIB_MAJOR < $alsa_min_major_version)
118
# if(SND_LIB_MINOR > $alsa_min_minor_version)
121
# if(SND_LIB_MINOR < $alsa_min_minor_version)
125
# if(SND_LIB_SUBMINOR < $alsa_min_micro_version)
132
[AC_MSG_RESULT(found.)],
133
[AC_MSG_RESULT(not present.)
134
ifelse([$3], , [AC_MSG_ERROR(Sufficiently new version of libasound not found.)])
139
dnl Now that we know that we have the right version, let's see if we have the library and not just the headers.
140
if test "x$enable_alsatest" = "xyes"; then
141
AC_CHECK_LIB([asound], [snd_ctl_open],,
142
[ifelse([$3], , [AC_MSG_ERROR(No linkable libasound was found.)])
147
if test "x$alsa_found" = "xyes" ; then
148
ifelse([$2], , :, [$2])
149
LIBS=`echo $LIBS | sed 's/-lasound//g'`
150
LIBS=`echo $LIBS | sed 's/ //'`
151
LIBS="-lasound $LIBS"
153
if test "x$alsa_found" = "xno" ; then
154
ifelse([$3], , :, [$3])
155
CFLAGS="$alsa_save_CFLAGS"
156
LDFLAGS="$alsa_save_LDFLAGS"
157
LIBS="$alsa_save_LIBS"
162
dnl That should be it. Now just export out symbols:
163
AC_SUBST(ALSA_CFLAGS)
170
# Configure paths for ESD
171
# Manish Singh 98-9-30
172
# stolen back from Frank Belew
173
# stolen from Manish Singh
174
# Shamelessly stolen from Owen Taylor
176
dnl AM_PATH_ESD([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
177
dnl Test for ESD, and define ESD_CFLAGS and ESD_LIBS
179
AC_DEFUN([AM_PATH_ESD],
181
dnl Get the cflags and libraries from the esd-config script
183
AC_ARG_WITH(esd-prefix,[ --with-esd-prefix=PFX Prefix where ESD is installed (optional)],
184
esd_prefix="$withval", esd_prefix="")
185
AC_ARG_WITH(esd-exec-prefix,[ --with-esd-exec-prefix=PFX Exec prefix where ESD is installed (optional)],
186
esd_exec_prefix="$withval", esd_exec_prefix="")
187
AC_ARG_ENABLE(esdtest, [ --disable-esdtest Do not try to compile and run a test ESD program],
188
, enable_esdtest=yes)
190
if test x$esd_exec_prefix != x ; then
191
esd_args="$esd_args --exec-prefix=$esd_exec_prefix"
192
if test x${ESD_CONFIG+set} != xset ; then
193
ESD_CONFIG=$esd_exec_prefix/bin/esd-config
196
if test x$esd_prefix != x ; then
197
esd_args="$esd_args --prefix=$esd_prefix"
198
if test x${ESD_CONFIG+set} != xset ; then
199
ESD_CONFIG=$esd_prefix/bin/esd-config
203
AC_PATH_PROG(ESD_CONFIG, esd-config, no)
204
min_esd_version=ifelse([$1], ,0.2.7,$1)
205
AC_MSG_CHECKING(for ESD - version >= $min_esd_version)
207
if test "$ESD_CONFIG" = "no" ; then
210
ESD_CFLAGS=`$ESD_CONFIG $esdconf_args --cflags`
211
ESD_LIBS=`$ESD_CONFIG $esdconf_args --libs`
213
esd_major_version=`$ESD_CONFIG $esd_args --version | \
214
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
215
esd_minor_version=`$ESD_CONFIG $esd_args --version | \
216
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
217
esd_micro_version=`$ESD_CONFIG $esd_config_args --version | \
218
sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
219
if test "x$enable_esdtest" = "xyes" ; then
220
ac_save_CFLAGS="$CFLAGS"
222
CFLAGS="$CFLAGS $ESD_CFLAGS"
223
LIBS="$LIBS $ESD_LIBS"
225
dnl Now check if the installed ESD is sufficiently new. (Also sanity
226
dnl checks the results of esd-config to some extent
236
my_strdup (char *str)
242
new_str = malloc ((strlen (str) + 1) * sizeof(char));
243
strcpy (new_str, str);
253
int major, minor, micro;
256
system ("touch conf.esdtest");
258
/* HP/UX 9 (%@#!) writes to sscanf strings */
259
tmp_version = my_strdup("$min_esd_version");
260
if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, µ) != 3) {
261
printf("%s, bad version string\n", "$min_esd_version");
265
if (($esd_major_version > major) ||
266
(($esd_major_version == major) && ($esd_minor_version > minor)) ||
267
(($esd_major_version == major) && ($esd_minor_version == minor) && ($esd_micro_version >= micro)))
273
printf("\n*** 'esd-config --version' returned %d.%d.%d, but the minimum version\n", $esd_major_version, $esd_minor_version, $esd_micro_version);
274
printf("*** of ESD required is %d.%d.%d. If esd-config is correct, then it is\n", major, minor, micro);
275
printf("*** best to upgrade to the required version.\n");
276
printf("*** If esd-config was wrong, set the environment variable ESD_CONFIG\n");
277
printf("*** to point to the correct copy of esd-config, and remove the file\n");
278
printf("*** config.cache before re-running configure\n");
283
],, no_esd=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
284
CFLAGS="$ac_save_CFLAGS"
288
if test "x$no_esd" = x ; then
290
ifelse([$2], , :, [$2])
293
if test "$ESD_CONFIG" = "no" ; then
294
echo "*** The esd-config script installed by ESD could not be found"
295
echo "*** If ESD was installed in PREFIX, make sure PREFIX/bin is in"
296
echo "*** your path, or set the ESD_CONFIG environment variable to the"
297
echo "*** full path to esd-config."
299
if test -f conf.esdtest ; then
302
echo "*** Could not run ESD test program, checking why..."
303
CFLAGS="$CFLAGS $ESD_CFLAGS"
304
LIBS="$LIBS $ESD_LIBS"
309
[ echo "*** The test program compiled, but did not run. This usually means"
310
echo "*** that the run-time linker is not finding ESD or finding the wrong"
311
echo "*** version of ESD. If it is not finding ESD, you'll need to set your"
312
echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
313
echo "*** to the installed location Also, make sure you have run ldconfig if that"
314
echo "*** is required on your system"
316
echo "*** If you have an old version installed, it is best to remove it, although"
317
echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH"],
318
[ echo "*** The test program failed to compile or link. See the file config.log for the"
319
echo "*** exact error that occured. This usually means ESD was incorrectly installed"
320
echo "*** or that you have moved ESD since it was installed. In the latter case, you"
321
echo "*** may want to edit the esd-config script: $ESD_CONFIG" ])
322
CFLAGS="$ac_save_CFLAGS"
328
ifelse([$3], , :, [$3])