~ubuntu-branches/ubuntu/vivid/oss4/vivid-proposed

« back to all changes in this revision

Viewing changes to .pc/txt2man.patch/setup/Linux/build.sh

  • Committer: Package Import Robot
  • Author(s): Sebastien NOEL
  • Date: 2012-11-19 11:47:24 UTC
  • mfrom: (1.1.6)
  • Revision ID: package-import@ubuntu.com-20121119114724-svu8mq7x3pk64nez
Tags: 4.2-build2007-1
* New upstream release.
* Acknowledge NMU, thanks Michael Gilbert.
* Add debian/patches/110_ld-as-needed.patch: Rearrange order of linker
  arguments to fix building with "ld --as-needed" (closes: #630737).
* Add missing dependency on dpkg-dev to oss4-dkms and oss4-source
  (closes: #687086).
* Fix typo in the changelog (closes: #628876, #675933)
* Add debian/patches/002_fix-linux-oss_native_word.patch (closes: #693657).
  Thanks to Ben Hutchings.
* Add debian/patches/003_linux-error-logging-fixes.patch (closes: #693657).
  Thanks to Ben Hutchings.
* check for /lib/modules/${kernelver}/build in addition of
  /lib/modules/${kernelver}/source (closes: #587191).
* oss4-dkms.dkms.in: fix 'CLEAN' rules (closes: #653374).

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#!/bin/sh
2
 
 
3
 
. ./.directories
4
 
 
5
 
if gawk '' >/dev/null
6
 
then
7
 
   TXT2MAN=$SRCDIR/setup/txt2man
8
 
else
9
 
   echo "No gawk found. Using lesser replacement" >&2
10
 
   cc -o txt2man origdir/setup/txt2man.c
11
 
   TXT2MAN=./txt2man
12
 
fi
13
 
 
14
 
[ -z "$LD" ] && LD=ld
15
 
 
16
 
rm -rf prototype
17
 
 
18
 
mkdir prototype
19
 
mkdir prototype/etc
20
 
echo "OSSLIBDIR=$OSSLIBDIR" > prototype/etc/oss.conf
21
 
mkdir prototype/usr
22
 
mkdir prototype/usr/bin
23
 
mkdir prototype/usr/share
24
 
mkdir prototype/usr/share/man
25
 
mkdir prototype/usr/share/man/man1
26
 
mkdir prototype/usr/share/man/man7
27
 
mkdir prototype/usr/share/man/man8
28
 
mkdir prototype/usr/sbin
29
 
mkdir -p prototype/$OSSLIBDIR
30
 
mkdir prototype/$OSSLIBDIR/etc
31
 
mkdir prototype/$OSSLIBDIR/save
32
 
mkdir prototype/$OSSLIBDIR/conf.tmpl
33
 
mkdir prototype/$OSSLIBDIR/lib
34
 
mkdir prototype/$OSSLIBDIR/modules.regparm
35
 
mkdir prototype/$OSSLIBDIR/modules.noregparm
36
 
mkdir prototype/$OSSLIBDIR/objects.regparm
37
 
mkdir prototype/$OSSLIBDIR/objects.noregparm
38
 
mkdir prototype/$OSSLIBDIR/include
39
 
mkdir prototype/$OSSLIBDIR/include/sys
40
 
mkdir prototype/$OSSLIBDIR/include/internals
41
 
mkdir prototype/$OSSLIBDIR/build
42
 
 
43
 
chmod 700 prototype/$OSSLIBDIR/modules.*
44
 
chmod 700 prototype/$OSSLIBDIR/objects.*
45
 
chmod 700 prototype/$OSSLIBDIR/build
46
 
chmod 700 prototype/$OSSLIBDIR/save
47
 
 
48
 
if test -f regparm && test "`cat regparm` " = "1 "
49
 
then
50
 
  MODULES=modules.regparm
51
 
  OBJECTS=objects.regparm
52
 
else
53
 
  MODULES=modules.noregparm
54
 
  OBJECTS=objects.noregparm
55
 
fi
56
 
 
57
 
cp .version prototype/$OSSLIBDIR/version.dat
58
 
 
59
 
if test "`uname -m` " != "arm "
60
 
then
61
 
        if ! test -f regparm
62
 
        then
63
 
          echo Error: ./regparm is missing
64
 
          exit 1
65
 
        fi
66
 
        cp regparm prototype/$OSSLIBDIR/build
67
 
fi
68
 
 
69
 
# Regenerating the config file templates
70
 
rm -f /tmp/confgen
71
 
if ! cc -o /tmp/confgen ./setup/Linux/confgen.c
72
 
then
73
 
        echo Building confgen failed
74
 
        exit 1
75
 
fi
76
 
 
77
 
if ! /tmp/confgen prototype/$OSSLIBDIR/conf.tmpl $OSSLIBDIR/conf kernel/drv/* kernel/nonfree/drv/*
78
 
then
79
 
        echo Running confgen failed
80
 
        exit 1
81
 
fi
82
 
 
83
 
rm -f /tmp/confgen
84
 
 
85
 
cp $SRCDIR/include/*.h prototype/$OSSLIBDIR/include/sys/
86
 
cp $SRCDIR/kernel/framework/include/midiparser.h prototype/$OSSLIBDIR/include/
87
 
cp -f $SRCDIR/kernel/OS/Linux/wrapper/wrap.h prototype/$OSSLIBDIR/build/
88
 
cp -f $SRCDIR/kernel/framework/include/udi.h prototype/$OSSLIBDIR/build/
89
 
cp -a $SRCDIR/kernel/framework/include/*_core.h kernel/framework/include/local_config.h prototype/$OSSLIBDIR/include/internals
90
 
cp $SRCDIR/kernel/framework/include/ossddk/*.h prototype/$OSSLIBDIR/include/internals
91
 
cp kernel/framework/include/timestamp.h prototype/$OSSLIBDIR/include/internals
92
 
cp kernel/framework/include/ossddk/oss_limits.h prototype/$OSSLIBDIR/include/internals
93
 
 
94
 
cat > prototype/$OSSLIBDIR/include/internals/WARNING.txt << EOF
95
 
Caution: All header files included in this directory are there only because
96
 
         some parts of OSS may need to be re-compiled. It is not safe to use
97
 
         these files for any purposes because they will change between OSS
98
 
         versions/builds.
99
 
EOF
100
 
 
101
 
(cd target/bin; rm -f ossrecord; ln -s ossplay ossrecord)
102
 
cp -f target/build/* prototype/$OSSLIBDIR/build/
103
 
cp -f target/bin/* prototype/usr/bin
104
 
cp -f target/sbin/* prototype/usr/sbin
105
 
 
106
 
cp -a $SRCDIR/setup/Linux/oss/* prototype/$OSSLIBDIR/
107
 
cp -a $SRCDIR/setup/Linux/sbin prototype/usr/
108
 
chmod +x prototype/$OSSLIBDIR/scripts/*
109
 
 
110
 
if ! $LD -r -o prototype/$OSSLIBDIR/$OBJECTS/osscore.o target/objects/*.o
111
 
then
112
 
  echo Linking osscore failed!
113
 
  exit 1
114
 
fi
115
 
 
116
 
rm -f devlist.txt devices.list
117
 
 
118
 
for n in `find kernel/ -name .devices`
119
 
do
120
 
  cat $n >> devices.list
121
 
done
122
 
 
123
 
for n in target/modules/*.o
124
 
do
125
 
        N=`basename $n .o`
126
 
        $LD -r -o prototype/$OSSLIBDIR/$MODULES/$N.o $n
127
 
        echo Check devices for $N
128
 
        grep "^$N[      ]" ./devices.list >> devlist.txt
129
 
 
130
 
        rm -f /tmp/ossman.txt
131
 
 
132
 
        if test -f $SRCDIR/kernel/drv/$N/$N.man
133
 
        then
134
 
          sed "s:CONFIGFILEPATH:$OSSLIBDIR/conf:g" < $SRCDIR/kernel/drv/$N/$N.man > /tmp/ossman.txt
135
 
          $TXT2MAN -t "$CMD" -v "OSS Devices" -s 7 /tmp/ossman.txt | gzip -9 > prototype/usr/share/man/man7/$N.7.gz
136
 
        else
137
 
                if test -f $SRCDIR/kernel/nonfree/drv/$N/$N.man
138
 
                then
139
 
                        sed "s:CONFIGFILEPATH:$OSSLIBDIR/conf:g" < $SRCDIR/kernel/nonfree/drv/$N/$N.man > /tmp/ossman.txt
140
 
                        $TXT2MAN -t "$CMD" -v "OSS Devices" -s 7 $SRCDIR/kernel/nonfree/drv/$N/$N.man | gzip -9 > prototype/usr/share/man/man7/$N.7.gz
141
 
                fi
142
 
        fi
143
 
done
144
 
 
145
 
sed "s:CONFIGFILEPATH:$OSSLIBDIR/conf:g" < $SRCDIR/kernel/drv/osscore/osscore.man > /tmp/ossman.txt
146
 
$TXT2MAN -t "osscore" -v "OSS Devices" -s 7 /tmp/ossman.txt | gzip -9 > prototype/usr/share/man/man7/osscore.7.gz
147
 
rm -f /tmp/ossman.txt
148
 
 
149
 
# Link the optional NOREGPARM modules
150
 
if test -d noregparm
151
 
then
152
 
   $LD -r -o prototype/$OSSLIBDIR/objects.noregparm/osscore.o noregparm/target/objects/*.o
153
 
 
154
 
   for n in noregparm/target/modules/*.o
155
 
   do
156
 
        N=`basename $n .o`
157
 
        $LD -r -o prototype/$OSSLIBDIR/modules.noregparm/$N.o $n
158
 
   done
159
 
fi
160
 
 
161
 
for n in $SRCDIR/misc/man7/*.man
162
 
do
163
 
        N=`basename $n .man`
164
 
 
165
 
        $TXT2MAN -t "$CMD" -v "OSS Devices" -s 7 $n | gzip -9 > prototype/usr/share/man/man7/$N.7.gz
166
 
done
167
 
 
168
 
for n in $SRCDIR/misc/man1m/*.man
169
 
do
170
 
        N=`basename $n .man`
171
 
        $TXT2MAN -t "$CMD" -v "OSS System Administration Commands" -s 1 $n | gzip -9 > prototype/usr/share/man/man1/$N.1.gz
172
 
done
173
 
 
174
 
if ! cp lib/libOSSlib/libOSSlib.so lib/libsalsa/.libs/libsalsa.so.2.0.0 prototype/$OSSLIBDIR/lib
175
 
then
176
 
  echo Warning: No libsalsa library compiled
177
 
fi
178
 
 
179
 
cp target/lib/* prototype/$OSSLIBDIR/lib
180
 
 
181
 
cp devlist.txt prototype/$OSSLIBDIR/etc/devices.list
182
 
 
183
 
if test -d kernel/nonfree
184
 
then
185
 
        cp devlist.txt $SRCDIR/devlists/Linux
186
 
fi
187
 
 
188
 
# Generate Man pages for commands
189
 
for i in target/bin/*
190
 
do
191
 
CMD=`basename $i`
192
 
$TXT2MAN -t "$CMD" -v "OSS User Commands" -s 1 cmd/$CMD/$CMD.man | gzip -9 > prototype/usr/share/man/man1/$CMD.1.gz
193
 
echo done $CMD
194
 
done
195
 
 
196
 
for i in target/sbin/*
197
 
do
198
 
  CMD=`basename $i`
199
 
  if test -f cmd/$CMD/$CMD.man
200
 
  then
201
 
        $TXT2MAN -t "$CMD" -v "OSS System Administration Commands" -s 8 cmd/$CMD/$CMD.man | gzip -9 > prototype/usr/share/man/man8/$CMD.8.gz
202
 
        echo done $CMD
203
 
  fi
204
 
done
205
 
 
206
 
$TXT2MAN -t "ossdetect" -v "User Commands" -s 8 os_cmd/Linux/ossdetect/ossdetect.man | gzip -9 > prototype/usr/share/man/man8/ossdetect.8.gz
207
 
echo done ossdetect
208
 
 
209
 
cp -f $SRCDIR/oss/lib/flashsupport.c prototype/$OSSLIBDIR/lib
210
 
 
211
 
# Licensing stuff
212
 
if test -f 4front-private/osslic.c
213
 
then
214
 
        cc -o prototype/usr/sbin/osslic -Isetup -Ikernel/nonfree/include -Ikernel/framework/include -Iinclude -Ikernel/OS/Linux -I$SRCDIR $SRCDIR/4front-private/osslic.c
215
 
        strip prototype/usr/sbin/osslic
216
 
        
217
 
        BITS=3 # Default to 32 bit ELF format
218
 
        if test "`uname -m` " = "x86_64 "
219
 
        then
220
 
           BITS=6 # Use 64 bit ELF format
221
 
        fi
222
 
        prototype/usr/sbin/osslic -q -u -$BITS./prototype/$OSSLIBDIR/objects.regparm/osscore.o
223
 
        prototype/usr/sbin/osslic -q -u -$BITS./prototype/$OSSLIBDIR/objects.noregparm/osscore.o
224
 
        
225
 
fi
226
 
 
227
 
if test -f 4front-private/ossupdate.c
228
 
then
229
 
  #ossupdate
230
 
  cc -I. 4front-private/ossupdate.c -s -o prototype/usr/sbin/ossupdate
231
 
fi
232
 
 
233
 
sh $SRCDIR/setup/build_common.sh $SRCDIR $OSSLIBDIR
234
 
 
235
 
chmod 700 prototype/usr/sbin/*
236
 
chmod 755 prototype/usr/bin/*
237
 
 
238
 
(cd prototype;ls usr/sbin/* usr/bin/* etc/* usr/share/man/man*/*) > prototype/$OSSLIBDIR/sysfiles.list
239
 
 
240
 
exit 0