Skip to contentSkip to conversation

How to build alsa-driver for sparc?

DISCUSSION Martin Habets 2 participants 4 messages Sep 27, 2004 – Sep 28, 2004 Kbuild

lore
Share & tools
lore
#0 lore raw

I'm trying to build alsa-driver-1.0.7rc1 for SPARC32, but have found that CONFIG_SPARC32 is not set in toplevel.config.
After initial failure, I have tried the steps from cvscompile, and rebuild utils/mod-deps.

After I hand-edit toplevel.config and apply the patch attached, it does start building. But the whole generation of toplevel.config leaves my wondering how to make it work properly.

Any hints?

Signature · 28 lines
Martin
---------------------------------------------------------------------------
30 years from now GNU/Linux will be as redundant a term as UNIX/MERT is 
today. - Martin Habets
---------------------------------------------------------------------------

--- alsa-driver-1.0.7rc1/Makefile.orig	2004-09-27 17:34:05.000000000 +0100
+++ alsa-driver-1.0.7rc1/Makefile	2004-09-27 17:35:21.000000000 +0100
@@ -65,6 +65,12 @@
 ifeq (y,$(CONFIG_PARISC))
 SUBDIRS  += parisc
 endif
+ifeq (y,$(CONFIG_SPARC32))
+SUBDIRS  += sparc
+endif
+ifeq (y,$(CONFIG_SPARC64))
+SUBDIRS  += sparc
+endif
 CSUBDIRS += include test utils
 
 KCONFIG_FILES = $(shell find $(SND_TOPDIR) -name Kconfig) $(shell find $(SND_TOPDIR)/alsa-kernel/ -name Kconfig)


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
#1 lore raw

At Mon, 27 Sep 2004 20:14:38 +0100,

Quoted 11 lines · Martin Habets

I'm trying to build alsa-driver-1.0.7rc1 for SPARC32, but have found that CONFIG_SPARC32 is not set in toplevel.config.
After initial failure, I have tried the steps from cvscompile, and rebuild utils/mod-deps.

After I hand-edit toplevel.config and apply the patch attached, it does start building. But the whole generation of toplevel.config leaves my wondering how to make it work properly.

Any hints?

How about the attached patch?

Takashi

Index: alsa-driver/Makefile
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-driver/Makefile,v retrieving revision 1.74

Makefile +7 -0
diff -u -r1.74 Makefile
@@ -53,6 +53,13 @@
 ifeq (y,$(CONFIG_PPC))
 SUBDIRS  += ppc
 endif
+ifeq (y,$(CONFIG_SPARC32))
+SUBDIRS  += sparc
+else
+ifeq (y,$(CONFIG_SPARC64))
+SUBDIRS  += sparc
+endif
+endif
 ifeq (y,$(CONFIG_SGI))
 SUBDIRS  += hal2
 endif

Index: alsa-driver/configure.in
===================================================================
RCS file: /suse/tiwai/cvs/alsa/alsa-driver/configure.in,v retrieving revision 1.195

configure.in +6 -0
diff -u -r1.195 configure.in
@@ -698,6 +698,8 @@
 CONFIG_L3=
 CONFIG_ARM=
 CONFIG_PPC=
+CONFIG_SPARC32=
+CONFIG_SPARC64=
 CONFIG_SND_BIT32_EMUL=
 processor=""
 rm -f processor.id
@@ -920,6 +922,7 @@
     test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
     ;;
   sparc)
+    CONFIG_SPARC32=y
     IS_EGCS=n
     NEW_GAS=n
     test $CC -m32 -S -o /dev/null -xc /dev/null >/dev/null 2>&1 && IS_EGCS=y
@@ -936,6 +939,7 @@
     test "$CONFIG_ISA" = "probe" && CONFIG_ISA=
     ;;
   sparc64)
+    CONFIG_SPARC64=y
     CC=gcc
     test gcc -m64 -S -o /dev/null -xc /dev/null >/dev/null 2>&1 || CC=sparc64-linux-gcc
     NEW_GCC=n
@@ -1044,6 +1048,8 @@
 AC_SUBST(CONFIG_L3)
 AC_SUBST(CONFIG_ARM)
 AC_SUBST(CONFIG_PPC)
+AC_SUBST(CONFIG_SPARC32)
+AC_SUBST(CONFIG_SPARC64)
 AC_SUBST(CONFIG_ISA)
 AC_SUBST(CONFIG_PARISC)
 AC_SUBST(CONFIG_SND_BIT32_EMUL)
#2 lore raw

Takashi,

Yes this works (and in record-breaking time!), but revealed another problem when running configure:

checking for which soundcards to compile driver for... ./configure: line 8479: ((: ( test y = y -o y = m ) ||

      ( test  = y -o  = m ): missing `)' (error token is "y = y -o y = m ) ||
      ( test  = y -o  = m )")
./configure: line 8491: ((: ( test y = y -o y = m ) ||
      ( test  = y -o  = m ): missing `)' (error token is "y = y -o y = m ) ||
      ( test  = y -o  = m )")
./configure: line 8502: ((: ( test y = y -o y = m ) ||
      ( test  = y -o  = m ): missing `)' (error token is "y = y -o y = m ) ||
      ( test  = y -o  = m )")

all

configure has:
if test "$card" = "all" -o "$card" = "sun-amd7930"; then

    if ((( test "$CONFIG_SPARC32" = "y" -o "$CONFIG_SPARC32" = "m" ) ||
      ( test "$CONFIG_SPARC64" = "y" -o "$CONFIG_SPARC64" = "m" ))) &&
      ( test "$CONFIG_SBUS" = "y" -o "$CONFIG_SBUS" = "m" ); then

The "((" puts bash into math mode... The first patch attached circumvents this problem.
After that it turned out CONFIG_SBUS was not set either in toplevel.config, and the 2nd patch is my attempt to resolve that.

Thanks!
Martin

utils/mod-deps.c renamed from utils/mod-deps.c.orig +2 -2
@@ -929,10 +929,10 @@
 			if (cond->not)
 				printf(" ! ");
 			for (j = 0; j < cond->left; j++)
-				printf("(");
+				printf("( ");
 			printf("( test \"$CONFIG_%s\" = \"y\" -o \"$CONFIG_%s\" = \"m\" )", cond->name, cond->name);
 			for (j = 0; j < cond->right; j++)
-				printf(")");
+				printf(" )");
 			put_if = 1;
 			cond_prev = cond;
 		}
configure.in renamed from configure.in.orig +4 -0
@@ -683,6 +683,9 @@
 CONFIG_ISA=probe
 fi
 
+dnl Check for SBUS support...
+CHECK_KERNEL_CONFIG(CONFIG_SBUS, [SBUS support in kernel])
+
 dnl Check processor type...
 AC_MSG_CHECKING(for processor type)
 CONFIG_X86=
@@ -1042,6 +1045,7 @@
 AC_SUBST(CONFIG_PPC)
 AC_SUBST(CONFIG_SPARC32)
 AC_SUBST(CONFIG_SPARC64)
+AC_SUBST(CONFIG_SBUS)
 AC_SUBST(CONFIG_ISA)
 AC_SUBST(CONFIG_PARISC)
 AC_SUBST(CONFIG_SND_BIT32_EMUL)

-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php

#3 lore raw

At Tue, 28 Sep 2004 01:25:21 +0100,

Quoted 19 lines · Martin Habets

Takashi,

Yes this works (and in record-breaking time!), but revealed another problem when running configure:

checking for which soundcards to compile driver for... ./configure: line 8479: ((: ( test y = y -o y = m ) ||

      ( test  = y -o  = m ): missing `)' (error token is "y = y -o y = m ) ||
      ( test  = y -o  = m )")
./configure: line 8491: ((: ( test y = y -o y = m ) ||
      ( test  = y -o  = m ): missing `)' (error token is "y = y -o y = m ) ||
      ( test  = y -o  = m )")
./configure: line 8502: ((: ( test y = y -o y = m ) ||
      ( test  = y -o  = m ): missing `)' (error token is "y = y -o y = m ) ||
      ( test  = y -o  = m )")

all

configure has:
if test "$card" = "all" -o "$card" = "sun-amd7930"; then

Quoted 8 lines
    if ((( test "$CONFIG_SPARC32" = "y" -o "$CONFIG_SPARC32" = "m" ) ||
      ( test "$CONFIG_SPARC64" = "y" -o "$CONFIG_SPARC64" = "m" ))) &&
      ( test "$CONFIG_SBUS" = "y" -o "$CONFIG_SBUS" = "m" ); then

The "((" puts bash into math mode... The first patch attached circumvents this problem.
After that it turned out CONFIG_SBUS was not set either in toplevel.config, and the 2nd patch is my attempt to resolve that.

Thanks, I applied all patches to CVS.

I changed slightly that CONFIG_SBUS is checked only when CONFIG_SPARC32 or CONFIG_SPARC64 is set.

Takashi

-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170 Project Admins to receive an Apple iPod Mini FREE for your judgement on who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php