[alsa-devel] alsa-lib-1.0.18 doesn't build with option '--with-softfloat'
Takashi Iwai
tiwai at suse.de
Wed Jan 7 10:18:42 CET 2009
At Wed, 7 Jan 2009 17:02:40 +0800,
Cliff Cai wrote:
>
> Hi all,
>
> I'm trying to build the latest release alsa-lib-1.0.18 on Blackfin
> with option '--with-softfloat',
> but it failed with message:
>
> libtool: install: warning: remember to run `libtool --finish
> /usr/lib/alsa-lib/smixer'
> ../src/.libs/libasound.so: undefined reference to `_sqrtf'
> ../src/.libs/libasound.so: undefined reference to `_exp'
> ../src/.libs/libasound.so: undefined reference to `_log'
> ../src/.libs/libasound.so: undefined reference to `_sqrt'
> ../src/.libs/libasound.so: undefined reference to `_fmod'
> ../src/.libs/libasound.so: undefined reference to `_floor'
>
> Since I've selected --with-softfloat, '-lm' should be excluded from
> ALSA_DEPLIBS.
> but some source files still depend on libm, such as
> .../pcm/pcm_ladspa.c;.../mixer/ simple_none.c
> .../alisp/alisp.c.These there files cause undefined reference as above.
Bah, at least, simple_none.c should be without math stuff.
pcm_ladspa.c can't be build without libm, I guess. This should be
excluded with the softfload option. Ditto for alisp.
How about the patch below?
thanks,
Takashi
---
diff --git a/configure.in b/configure.in
index 5bc0c01..cc1109f 100644
--- a/configure.in
+++ b/configure.in
@@ -367,6 +367,7 @@ AC_ARG_ENABLE(seq,
AC_ARG_ENABLE(alisp,
AS_HELP_STRING([--disable-alisp], [disable the alisp component]),
[build_alisp="$enableval"], [build_alisp="yes"])
+test "$softfloat" = "yes" && build_alisp="no"
AC_ARG_ENABLE(old-symbols,
AS_HELP_STRING([--disable-old-symbols], [disable old obsoleted symbols]),
[keep_old_symbols="$enableval"], [keep_old_symbols="yes"])
@@ -474,6 +475,7 @@ fi
if test "$softfloat" = "yes"; then
build_pcm_lfloat="no"
+ build_pcm_ladspa="no"
fi
AM_CONDITIONAL(BUILD_PCM_PLUGIN, test x$build_pcm_plugin = xyes)
diff --git a/src/mixer/simple_none.c b/src/mixer/simple_none.c
index 0f4dd3a..a65619d 100644
--- a/src/mixer/simple_none.c
+++ b/src/mixer/simple_none.c
@@ -1450,7 +1450,14 @@ static int simple_add1(snd_mixer_class_t *class, const char *name,
}
if (ctype != SND_CTL_ELEM_TYPE_BOOLEAN)
return 0;
+#ifdef HAVE_SOFT_FLOAT
+ /* up to 256 channels */
+ for (n = 1; n < 256; n++)
+ if (n * n == values)
+ break;
+#else
n = sqrt((double)values);
+#endif
if (n * n != values)
return 0;
values = n;
More information about the Alsa-devel
mailing list