summaryrefslogtreecommitdiff
path: root/debian/patches/dyson-config.patch
blob: 0e08d6fb66846ac58e6d31fbf8c7ea0f23394703 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
Index: oss4/configure
===================================================================
--- oss4.orig/configure	2013-05-05 05:22:08.998003945 +0400
+++ oss4/configure	2013-05-05 05:24:51.714479419 +0400
@@ -1,5 +1,7 @@
 #!/bin/sh
 
+eval `dpkg-architecture -s`
+
 CONFIGURE=YES
 COPY_OPTIONS=
 OSSLIBDIR="/usr/lib/oss"
@@ -202,26 +204,12 @@
 case `uname` in
 
 "SunOS")
-	case `uname -r` in
-	"5.9")
-		echo Setting up for Solaris 9
-		SOL9=1
-		GTK1=1
-		export SOL9 GTK1
-		;;
-
-	"5.8")
-		echo Setting up for Solaris 8
-		SOL9=1
-		GTK1=1
-		export SOL9 GTK1
-		;;
-	*)
-		echo Using Solaris10 specific script
-		;;
-	esac
-	exec sh $SRCDIR/setup/SunOS/solsetup.sh
-	;;
+    ISA=""
+    if [ "x$DEB_HOST_ARCH_CPU" = "xamd64" ]; then
+        ISA="-Aamd64"
+    fi
+	exec sh $SRCDIR/setup/setupdir.sh $ISA
+    ;;
 
 "Linux")
 
Index: oss4/setup/SunOS/make.local
===================================================================
--- /dev/null	1970-01-01 00:00:00.000000000 +0000
+++ oss4/setup/SunOS/make.local	2013-05-05 05:24:51.719019812 +0400
@@ -0,0 +1,21 @@
+build: 	kernel/framework/include/buildid.h all
+	sh build.sh
+
+copy:	build
+	#rm -f ${OSSLIBDIR}/modules/*.o
+	(cd prototype; find -L . -type d | xargs -i{} mkdir -p ${DESTDIR}/{})
+	(cd prototype; find -L . -type f | xargs -i{} cp {} ${DESTDIR}/{})
+
+package:	build
+		sh setup/Linux/mkpkg.sh
+
+tarball:	build
+		sh setup/Linux/mktarball.sh
+
+deb:		build
+		sh setup/Linux/mkdeb.sh
+
+install:	copy
+	cd ${OSSLIBDIR}/build && sh install.sh
+	sync
+	soundoff && sync && soundon && echo "OSS has started OK"
Index: oss4/setup/srcconf_solaris.inc
===================================================================
--- oss4.orig/setup/srcconf_solaris.inc	2013-05-05 05:22:08.998357242 +0400
+++ oss4/setup/srcconf_solaris.inc	2013-05-05 05:30:59.417111746 +0400
@@ -10,7 +10,7 @@
  *
  */
 
-/*#define USE_GCC*/
+#define USE_GCC
 #define HAVE_SYSDEP
 /* #define HAVE_KERNEL_FLAGS */
 #include <sys/systeminfo.h>
@@ -21,7 +21,9 @@
 
   conf->flags |= F_USEARCH;
 #ifdef USE_GCC
-  strcpy (conf->ccomp, "gcc -Wall -O");
+  strcpy (conf->ccomp, "gcc -Wall -O2");
+  shlib_cflags = "-fPIC";
+  shlib_ldflags = "-shared";
 #else
 
 # if 0
@@ -63,7 +65,7 @@
 #ifdef USE_GCC
   if (strcmp (tmp, "amd64") == 0)
     {
-      strcpy (conf->OSflags, "-m64 -fno-common  -mcmodel=kernel -mno-red-zone");
+      strcpy (conf->OSflags, "-m64");
       strcpy (conf->platform, "i86pc");
     }
   else if (strcmp (tmp, "sparcv9") == 0)
@@ -140,7 +142,5 @@
 static void
 add_kernel_flags (FILE * f)
 {
-#if 0
-  /* fprintf(f, "CFLAGS += -xmodel=kernel\n"); */
-#endif
+  fprintf(f, "CFLAGS += -fno-common  -mcmodel=kernel -mno-red-zone\n");
 }
Index: oss4/setup/SunOS/build.sh
===================================================================
--- oss4.orig/setup/SunOS/build.sh	2013-05-05 05:22:08.998555722 +0400
+++ oss4/setup/SunOS/build.sh	2013-05-05 05:24:51.726523208 +0400
@@ -11,29 +11,6 @@
    TXT2MAN=./txt2man
 fi
 
-if test "`uname -p`" = "sparc"
-then
-	KERNEL32=sparc
-	KERNEL64=sparcv9
-	MACH=sun4u
-else
-	case `uname -r` in
-	"5.8")
-		KERNEL32=i386
-		KERNEL64=NULL
-		;;
-	"5.9")
-		KERNEL32=i386
-		KERNEL64=NULL
-		;;
-	*)
-		KERNEL32=i386
-		KERNEL64=amd64
-		;;
-	esac
-	MACH=i86pc
-fi
-
 if test "`uname -r`" = "5.9" || test "`uname -r`" = "5.8"
 then
 	AMSRC=amsrc1
@@ -45,12 +22,15 @@
 # Re-create the prototype directory
 rm -rf prototype
 
+# use dpkg-architecture, when we support more than amd64 ;-)
+KERNELDIR=amd64
+
 mkdir prototype
 mkdir prototype/kernel
 mkdir prototype/kernel/drv
-mkdir prototype/kernel/drv/$KERNEL64
+mkdir prototype/kernel/drv/$KERNELDIR
 mkdir prototype/kernel/misc
-mkdir prototype/kernel/misc/$KERNEL64
+mkdir prototype/kernel/misc/$KERNELDIR
 
 mkdir prototype/etc
 mkdir prototype/etc/oss
@@ -74,16 +54,16 @@
 /var/log/soundon.log.
 EOF
 
-cp $KERNEL32/.version prototype/etc/oss/version.dat
+cp .version prototype/etc/oss/version.dat
 
 # Copy the files to their right place
 
 cp $SRCDIR/include/soundcard.h prototype/usr/include/sys
 cp $SRCDIR/include/oss_userdev_exports.h prototype/usr/include/oss
-(cd $KERNEL32/target/bin; rm -f ossrecord; ln -s ossplay ossrecord)
-cp $KERNEL32/target/bin/* prototype/usr/bin
-cp $KERNEL32/target/sbin/* prototype/usr/sbin
-cp $KERNEL32/setup/SunOS/sbin/* prototype/usr/sbin
+(cd target/bin; rm -f ossrecord; ln -s ossplay ossrecord)
+cp target/bin/* prototype/usr/bin
+cp target/sbin/* prototype/usr/sbin
+cp setup/SunOS/sbin/* prototype/usr/sbin
 cp origdir/setup/SunOS/S89oss prototype/etc/init.d/oss
 chmod 500 prototype/usr/sbin/*
 echo "autosave_mixer yes" > prototype/etc/oss/userdefs
@@ -92,12 +72,12 @@
 
 # Create the driver modules (for 64 bit)
 
-if test "`ls $KERNEL64/target/modules/*.o 2>/dev/null` " != " "
+if test "`ls target/modules/*.o 2>/dev/null` " != " "
 then
 	# osscommon
-	if ld -64 -dy -r -Nmisc/usba -o prototype/kernel/misc/$KERNEL64/osscommon $KERNEL64/target/objects/*.o
+	if sunld -dy -r -Nmisc/usba -o prototype/kernel/misc/$KERNELDIR/osscommon target/objects/*.o
 	then
-		$TXT2MAN -v "OSS Devices" -s 7 $KERNEL64/kernel/drv/osscore/osscore.man > prototype/usr/man/man7d/osscore.7d
+		$TXT2MAN -v "OSS Devices" -s 7 $KERNELDIR/kernel/drv/osscore/osscore.man > prototype/usr/man/man7d/osscore.7d
 	else
 		exit 1
 	fi
@@ -118,26 +98,26 @@
 	done
 
 	# Other modules for 64bit kernel
-	for n in $KERNEL64/target/modules/*.o
+	for n in target/modules/*.o
 	do
   		N=`basename $n .o`
-  		if ld -64 -dy -r -Nmisc/osscommon -o prototype/kernel/drv/$KERNEL64/$N $n 
+  		if sunld -dy -r -Nmisc/osscommon -o prototype/kernel/drv/$KERNELDIR/$N $n
   		then
    			OK=1
 		else
    			exit 1
 		fi
 
-  		if test $KERNEL64 = "sparcv9"
+  		if test $KERNELDIR = "sparcv9"
 		then
-			grep "^$N[ 	]" $KERNEL64/devices.list >> devlist.txt
+			grep "^$N[ 	]" $KERNELDIR/devices.list >> devlist.txt
   		fi
 	done
 
 	# USB Module
-	if test -f $KERNEL64/target/modules/oss_usb.o
+	if test -f target/modules/oss_usb.o
 	then
-		if ld -64 -dy -r -Nmisc/osscommon -Nmisc/usba -o prototype/kernel/drv/$KERNEL64/oss_usb $KERNEL64/target/modules/oss_usb.o
+		if sunld -dy -r -Nmisc/osscommon -Nmisc/usba -o prototype/kernel/drv/$KERNELDIR/oss_usb target/modules/oss_usb.o
  		then
   			OK=1
  		else
@@ -146,9 +126,9 @@
  	fi
 
 	# SADA compatibility module
-	if test -r $KERNEL64/target/modules/oss_sadasupport.o
+	if test -r target/modules/oss_sadasupport.o
 	then
-		if ld -64 -dy -r -Nmisc/osscommon -Nmisc/$AMSRC -Nmisc/audiosup -Nmisc/mixer -o prototype/kernel/drv/$KERNEL64/oss_sadasupport $KERNEL64/target/modules/oss_sadasupport.o
+		if sunld -dy -r -Nmisc/osscommon -Nmisc/$AMSRC -Nmisc/audiosup -Nmisc/mixer -o prototype/kernel/drv/$KERNELDIR/oss_sadasupport target/modules/oss_sadasupport.o
 		then
   			OK=1
 		else
@@ -159,70 +139,6 @@
 	fi
 fi # 64 bit modules done
 
-# Handle 32 bit modules
-
-if test "`ls $KERNEL32/target/modules/*.o 2>/dev/null` " != " "
-then
-
-	# osscommon
-
-	if ld -dy -r -Nmisc/usba -o prototype/kernel/misc/osscommon $KERNEL32/target/objects/*.o
-	then
-		$TXT2MAN -v "OSS Devices" -s 7 $KERNEL32/kernel/drv/osscore/osscore.man > prototype/usr/man/man7d/osscore.7d
-	else
-		exit 1
-	fi
-
-	rm -f fpsupport.o __xtol.o
-
-	# Other modules for 32bit kernel
-	for n in $KERNEL32/target/modules/*.o
-	do
-		N=`basename $n .o`
-		if ld -dy -r -Nmisc/osscommon -o prototype/kernel/drv/$N $n
-		then
-			OK=1
-		else
-			exit 1
-		fi
-		grep "^$N[ 	]" $KERNEL32/devices.list >> devlist.txt
-	done
-
-	# USB Modules
-	if test -f $KERNEL32/target/modules/oss_usb.o
-	then
-		if ld -dy -r -Nmisc/osscommon -Nmisc/usba -o prototype/kernel/drv/oss_usb $KERNEL32/target/modules/oss_usb.o
-		then
-			OK=1
-		else
-			exit 1
-		fi
-	fi
-	
-	# SADA Compatibility
-	if test -r $KERNEL32/target/modules/oss_sadasupport.o
-	then
-		if ld -dy -r -Nmisc/osscommon -Nmisc/$AMSRC -Nmisc/audiosup -Nmisc/mixer -o prototype/kernel/drv/oss_sadasupport $KERNEL32/target/modules/oss_sadasupport.o
-		then
-			OK=1
-		else
-			exit 1
-		fi
-	else
-		OK=1
-	fi
-
-fi # 32 bit modules done
-
-if test "$KERNEL64 " = "sparcv9 "
-then
-	# Drop SB Live! from the list of supported devices for Sparc
-	rm -f tmplist
-	mv devlist.txt tmplist
-	grep -v "Sound Blaster Live" < tmplist|sort|uniq >devlist.txt
-	rm -f tmplist
-fi
-
 cp devlist.txt prototype/etc/oss/devices.list
 
 if test -d $KERNEL32/kernel/nonfree
@@ -232,39 +148,39 @@
 
 # Generate the config files
 rm -f confgen
-cc -o confgen -DTXT2MAN=\"$TXT2MAN\" $OSFLAGS $KERNEL32/setup/SunOS/confgen.c
+cc -o confgen -DTXT2MAN=\"$TXT2MAN\" $OSFLAGS setup/SunOS/confgen.c
 
-./confgen prototype/kernel/drv \\/kernel\\/drv $KERNEL32/kernel/drv/* $KERNEL32/kernel/nonfree/drv/* $KERNEL32/kernel/framework/*
+./confgen prototype/kernel/drv \\/kernel\\/drv kernel/drv/* kernel/nonfree/drv/* kernel/framework/*
 rm -f confgen
 
 # Generate Man pages for user commands
-for i in $KERNEL32/target/bin/*
+for i in target/bin/*
 do
 	CMD=`basename $i`
-	$TXT2MAN -t "$CMD" -v "OSS User Commands" -s 1 $KERNEL32/cmd/$CMD/$CMD.man > prototype/usr/man/man1/$CMD.1
+	$TXT2MAN -t "$CMD" -v "OSS User Commands" -s 1 cmd/$CMD/$CMD.man > prototype/usr/man/man1/$CMD.1
 	echo done $CMD
 done
 
 # Generate Man pages for system commands
-for i in $KERNEL32/target/sbin/*
+for i in target/sbin/*
 do
 	CMD=`basename $i`
-	if test -f $KERNEL32/cmd/$CMD/$CMD.man
+	if test -f cmd/$CMD/$CMD.man
 	then
-		$TXT2MAN -t "$CMD" -v "OSS System Administration Commands" -s 1m $KERNEL32/cmd/$CMD/$CMD.man > prototype/usr/man/man1m/$CMD.1m
+		$TXT2MAN -t "$CMD" -v "OSS System Administration Commands" -s 1m cmd/$CMD/$CMD.man > prototype/usr/man/man1m/$CMD.1m
 		echo done $CMD
 	fi
 done
 
 # Generate pages for Maintenance Commands 
 rm -f prototype/usr/man/man1m/ossdetect.1m
-$TXT2MAN -t "ossdetect" -v "OSS User Commands" -s 1m $KERNEL32/os_cmd/SunOS/ossdetect/ossdetect.man > prototype/usr/man/man1m/ossdetect.1m
+$TXT2MAN -t "ossdetect" -v "OSS User Commands" -s 1m os_cmd/SunOS/ossdetect/ossdetect.man > prototype/usr/man/man1m/ossdetect.1m
 echo done ossdetect
 
 # Licensing stuff
-if test -f $KERNEL32/4front-private/osslic.c
+if test -f 4front-private/osslic.c
 then
-	cc $OSFLAGS -o prototype/usr/sbin/osslic -I$KERNEL32/setup -I$KERNEL32/kernel/nonfree/include -I$KERNEL32/kernel/framework/include -I$KERNEL32/include -I$KERNEL32/kernel/OS/SunOS $KERNEL32/4front-private/osslic.c
+	cc $OSFLAGS -o prototype/usr/sbin/osslic -Isetup -Ikernel/nonfree/include -Ikernel/framework/include -Iinclude -Ikernel/OS/SunOS 4front-private/osslic.c
 	strip prototype/usr/sbin/osslic
 	
 	if test -f prototype/kernel/misc/osscommon
@@ -272,16 +188,16 @@
 		prototype/usr/sbin/osslic -q -u -3prototype/kernel/misc/osscommon
 	fi
 	
-	if test -f prototype/kernel/misc/$KERNEL64/osscommon
+	if test -f prototype/kernel/misc/$KERNELDIR/osscommon
 	then
-		prototype/usr/sbin/osslic -q -u -6prototype/kernel/misc/$KERNEL64/osscommon
+		prototype/usr/sbin/osslic -q -u -6prototype/kernel/misc/$KERNELDIR/osscommon
 	fi
 fi
 
-if test -f $KERNEL32/4front-private/ossupdate.c
+if test -f 4front-private/ossupdate.c
 then
   # ossupdate
-  cc -I$KERNEL32 $KERNEL32/4front-private/ossupdate.c -s -o prototype/usr/sbin/ossupdate -lsocket -lnsl
+  cc -I. 4front-private/ossupdate.c -s -o prototype/usr/sbin/ossupdate -lsocket -lnsl
 fi
 
 sh $SRCDIR/setup/build_common.sh $SRCDIR $OSSLIBDIR