On Wed, 03 Apr 2002, Andy Wingo wrote:
> On Wed, 03 Apr 2002, Denis Vlasenko wrote:
>
> > configure uses this to test whether there are alsa libs.
> > But this will fail always since nested functions are not
> > supported by C:
> >
> > int main() {
> > void main(void) { // !?
> > ...
> > }
> > }
>
> from the autoconf 2.53 manual:
>
> - Macro: AC_TRY_COMPILE (INCLUDES, FUNCTION-BODY, [ACTION-IF-FOUND],
> [ACTION-IF-NOT-FOUND])
> Create a test program in the current language (*note Language
> Choice::) to see whether a function whose body consists of
> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> FUNCTION-BODY can be compiled. If the file compiles successfully,
> run shell commands ACTION-IF-FOUND, otherwise run
> ACTION-IF-NOT-FOUND.
>
> This is from within alsa.m4. Change the AC_TRY_CONPILE to AC_TRY_RUN and
> it should work.
>
> So, I suppose this is a 'virtual patch' against alsa.m4 :-)
a better patch is attached. i tested it and it seems to work.
regards,
wingo.
Index: alsa.m4
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/utils/alsa.m4,v
retrieving revision 1.19
diff -u -r1.19 alsa.m4
--- alsa.m4 19 Dec 2001 07:28:40 -0000 1.19
+++ alsa.m4 3 Apr 2002 20:27:54 -0000
@@ -76,8 +76,6 @@
AC_TRY_COMPILE([
#include <alsa/asoundlib.h>
], [
-void main(void)
-{
/* ensure backward compatibility */
#if !defined(SND_LIB_MAJOR) && defined(SOUNDLIB_VERSION_MAJOR)
#define SND_LIB_MAJOR SOUNDLIB_VERSION_MAJOR
@@ -109,7 +107,6 @@
# endif
# endif
exit(0);
-}
],
[AC_MSG_RESULT(found.)],
[AC_MSG_RESULT(not present.)