~ubuntu-branches/ubuntu/oneiric/oss4/oneiric-proposed

« back to all changes in this revision

Viewing changes to setup/FreeBSD/oss/build/install.sh

  • Committer: Bazaar Package Importer
  • Author(s): Stefano Rivera
  • Date: 2011-06-16 20:37:48 UTC
  • mfrom: (5.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20110616203748-jbrxik6ql33z54co
Tags: 4.2-build2004-1ubuntu1
* Merge from Debian unstable.
  - Supports our current kernel (LP: #746048)
  Remaining changes:
  - debian/oss4-dkms.dkms.in: s/source/build/ in Kernel headers paths.
* ld-as-needed.patch: Re-order CC arguments to enable building with ld
  --as-needed (LP: #770972)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
if test -f /etc/oss.conf
 
4
then
 
5
  . /etc/oss.conf
 
6
else
 
7
  OSSLIBDIR=/usr/lib/oss
 
8
fi
 
9
 
 
10
rm -f osscore_mainline.o
 
11
ln -s osscore.lib osscore_mainline.o
 
12
 
 
13
rm -f Makefile
 
14
ln -s Makefile.osscore Makefile
 
15
 
 
16
echo Compiling module osscore 
 
17
 
 
18
if ! make > compile.list 2>&1
 
19
then
 
20
  echo Compiling osscore module failed
 
21
  cat compile.list
 
22
  exit 1
 
23
fi
 
24
 
 
25
if ! test -d ../modules
 
26
then
 
27
   mkdir ../modules
 
28
fi
 
29
 
 
30
if ! test -d ../logs
 
31
then
 
32
  mkdir ../logs
 
33
fi
 
34
 
 
35
mv osscore.ko ../modules/
 
36
make clean > /dev/null 2>&1
 
37
 
 
38
for n in ../objects/*.o
 
39
do
 
40
        N=`basename $n .o`
 
41
 
 
42
        rm -f $N"_mainline.o"
 
43
        ln -s $n $N"_mainline.o"
 
44
 
 
45
        rm -f Makefile
 
46
        sed "s/MODNAME/$N/g" < Makefile.tmpl > Makefile
 
47
 
 
48
        echo Compiling module $N
 
49
 
 
50
        if ! make > compile.list 2>&1
 
51
        then
 
52
                echo Compiling module $N failed
 
53
                cat compile.list
 
54
                exit 2
 
55
        fi
 
56
 
 
57
        mv $N.ko* ../modules/
 
58
        make clean > /dev/null 2>&1
 
59
        rm -f Makefile
 
60
done
 
61
 
 
62
if ! test -f $OSSLIBDIR/etc/installed_drivers
 
63
then
 
64
   echo "-----------------------------"
 
65
   /usr/sbin/ossdetect -v
 
66
   echo "-----------------------------"
 
67
   echo ""
 
68
fi
 
69
 
 
70
if test ! -f $OSSLIBDIR/etc/userdefs
 
71
then
 
72
  echo "autosave_mixer yes" > $OSSLIBDIR/etc/userdefs
 
73
fi
 
74
 
 
75
exit 0