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

« back to all changes in this revision

Viewing changes to .pc/kfreebsd-gnu.patch/setup/setupdir.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 -e
2
 
 
3
 
if test "$CONFIGURE " != "YES "
4
 
then
5
 
        echo
6
 
        echo Error: Wrong usage
7
 
        echo
8
 
        echo You must run `dirname $0`/configure instead of $0
9
 
        exit 1
10
 
fi
11
 
 
12
 
[ -z "$CC" ] && CC=cc
13
 
 
14
 
echo srcdir=$SRCDIR
15
 
 
16
 
BLDDIR=`pwd`
17
 
OS=`uname -s`
18
 
 
19
 
if test "$TARGETOS " != " "
20
 
then
21
 
  OS=$TARGETOS
22
 
fi
23
 
 
24
 
# Use the same source directories for SCO UnixWare and SCO OSR
25
 
if test "$OS " = "UnixWare "
26
 
then
27
 
        OS=SCO_SV
28
 
fi
29
 
 
30
 
# Use the same source directories for Haiku and BeOS
31
 
if test "$OS " = "Haiku "
32
 
then
33
 
        OS=BeOS
34
 
fi
35
 
 
36
 
# Use Linux24 as the OS name for Linux 2.4.x
37
 
if test "$OS " = "Linux "
38
 
then
39
 
  if test "`uname -r|sed 's/2.//'|sed 's/\..*//'` " = "4 "
40
 
  then
41
 
        OS=Linux24
42
 
  fi
43
 
fi
44
 
 
45
 
# pkg-config seems to crash in some systems so disable core dumps
46
 
ulimit -c 0 >/dev/null 2>&1
47
 
 
48
 
if pkg-config gtk+-2.0 --cflags > /dev/null 2>&1
49
 
then
50
 
  HAVE_GTK=y
51
 
  GTK2=1
52
 
  export HAVE_GTK GTK2
53
 
else
54
 
    if gtk-config --cflags > /dev/null 2>&1
55
 
    then
56
 
        HAVE_GTK=y
57
 
        GTK1=1
58
 
        export HAVE_GTK GTK1
59
 
    fi
60
 
fi
61
 
 
62
 
if test "`ls .` " != " " && test "`ls .` " != ".makefile "
63
 
then
64
 
        echo Error: Current directory must be empty
65
 
        exit 1
66
 
fi
67
 
 
68
 
if test -f $SRCDIR/setup/setupdir.sh
69
 
then
70
 
        echo Source directory is $SRCDIR
71
 
        echo Build directory is $BLDDIR
72
 
else
73
 
        echo Error: Invalid source directory $SRCDIR
74
 
        exit 2
75
 
fi
76
 
 
77
 
# Copy the ".devices" files for all drivers to devices.list
78
 
cat `find $SRCDIR/kernel/drv -name .devices`|grep -v '^#' > devices.list
79
 
 
80
 
if test -d $SRCDIR/kernel/nonfree/drv
81
 
then
82
 
  cat `find $SRCDIR/kernel/nonfree/drv -name .devices`|grep -v '^#' >> devices.list
83
 
fi
84
 
 
85
 
echo BLDDIR=$BLDDIR > .directories
86
 
echo SRCDIR=$SRCDIR >> .directories
87
 
echo OSSLIBDIR=$OSSLIBDIR >> .directories
88
 
 
89
 
$CC $LDFLAGS -o dirsetup $SRCDIR/setup/dirsetup.c
90
 
 
91
 
# Make sure the latest soundcard.h version is installed in the system
92
 
#rm /usr/include/sys/soundcard.h
93
 
#cp $SRCDIR/include/soundcard.h /usr/include/sys/soundcard.h
94
 
 
95
 
if ./dirsetup "$SRCDIR" "$BLDDIR" $* $COPY_OPTIONS
96
 
then
97
 
        echo Build tree created OK
98
 
else
99
 
        echo Cannot create the build tree
100
 
        rm -f dirsetup
101
 
        exit 3
102
 
fi
103
 
 
104
 
rm -f dirsetup
105
 
 
106
 
if test "$CLOSED_SOURCE " != "YES "
107
 
then
108
 
        rm -rf kernel/nonfree 4front-private
109
 
fi
110
 
 
111
 
if test "$ONLY_DRVS " != " "
112
 
then
113
 
        cd kernel/drv
114
 
        for drv in *
115
 
        do
116
 
                if echo $ONLY_DRVS | grep ",$drv" >/dev/null
117
 
                then
118
 
                        :
119
 
                else
120
 
                        touch "$drv"/.nomake
121
 
                fi
122
 
        done
123
 
        cd ../..
124
 
 
125
 
        if test "$CLOSED_SOURCE " = "YES "
126
 
        then
127
 
                cd kernel/nonfree/drv
128
 
                for drv in *
129
 
                do
130
 
                        if echo $ONLY_DRVS | grep ",$drv" >/dev/null
131
 
                        then
132
 
                                :
133
 
                        else
134
 
                                touch "$drv"/.nomake
135
 
                        fi
136
 
                done
137
 
                cd ../../../
138
 
        fi
139
 
fi
140
 
 
141
 
DTARGETOS=
142
 
if ! test -z $TARGETOS
143
 
then
144
 
  DTARGETOS="-D$TARGETOS"
145
 
fi
146
 
 
147
 
$CC $LDFLAGS -D`uname -s` $DTARGETOS -o srcconf $SRCDIR/setup/srcconf.c
148
 
 
149
 
if ./srcconf $*
150
 
then
151
 
        echo Source configuration OK
152
 
else
153
 
        echo Source configuration failed
154
 
fi
155
 
 
156
 
if test "$CLOSED_SOURCE " != "YES " && test -d $SRCDIR/.hg
157
 
then
158
 
  HGID=`(cd $SRCDIR && hg tip|grep changeset) 2>/dev/null`
159
 
  
160
 
  if test "$HGID " != " "
161
 
  then
162
 
        echo '#define' OSS_HG_INFO \"$HGID, \" \\ >> kernel/framework/include/local_config.h
163
 
  
164
 
        HGID=`(cd $SRCDIR && hg tip|grep tag) 2>/dev/null`
165
 
        echo '                   ' \"$HGID, \" \\ >> kernel/framework/include/local_config.h
166
 
  
167
 
        HGID=`(cd $SRCDIR && hg tip|grep date) 2>/dev/null`
168
 
        echo '                   ' \"$HGID, \" \\ >> kernel/framework/include/local_config.h
169
 
  
170
 
        HGID=`(cd $SRCDIR && hg tip|grep summary) 2>/dev/null`
171
 
        echo '                   ' \"$HGID\" >> kernel/framework/include/local_config.h
172
 
  fi
173
 
 
174
 
fi
175
 
 
176
 
if test ! "$OSS_CONFIG_OPTIONS " = " " && test ! "$OSS_CONFIG_OPTIONS " = "--include-closed-source "
177
 
then
178
 
        echo '#define OSS_CONFIG_OPTIONS '\"$OSS_CONFIG_OPTIONS\" >> kernel/framework/include/local_config.h
179
 
fi
180
 
 
181
 
if test ! -d target
182
 
then
183
 
        mkdir target
184
 
fi
185
 
 
186
 
mkdir target/bin
187
 
mkdir target/lib
188
 
mkdir target/sbin
189
 
mkdir target/modules
190
 
mkdir target/objects
191
 
mkdir target/tmpobjects
192
 
 
193
 
touch .depend
194
 
 
195
 
if date -u +%Y%m%d%H%M > build.id.new 2>/dev/null
196
 
then
197
 
        rm -f build.id
198
 
        mv build.id.new build.id
199
 
        echo "#define OSS_COMPILE_DATE \""`cat build.id`"\"" >> kernel/framework/include/timestamp.h
200
 
        echo "#define osdev_create osdev_create_`cat build.id`" >> kernel/framework/include/timestamp.h
201
 
        echo
202
 
        echo Build ID will become `cat build.id`
203
 
else
204
 
        echo Failed to create the build timestamp
205
 
        exit 254
206
 
fi
207
 
 
208
 
if test "$CLOSED_SOURCE " = "YES "
209
 
then
210
 
        echo "#define LICENSED_VERSION" >> kernel/framework/include/local_config.h
211
 
fi
212
 
 
213
 
if test -f $SRCDIR/buildid.dat
214
 
then
215
 
        echo '#define 'OSS_BUILD_ID \"`cat $SRCDIR/buildid.dat`\" > kernel/framework/include/buildid.h
216
 
else
217
 
        echo $SRCDIR/buildid.dat is missing
218
 
        exit 10
219
 
fi
220
 
 
221
 
if test ! -d kernel/nonfree || test -f $SRCDIR/kernel/nonfree/.nomake
222
 
then
223
 
        echo '#define __OPENOSS__' >> kernel/framework/include/buildid.h
224
 
        if test -f $SRCDIR/.license
225
 
        then
226
 
           echo '#define OSS_LICENSE "'`cat $SRCDIR/.license`'"' >> kernel/framework/include/buildid.h
227
 
        else
228
 
           echo '#define OSS_LICENSE "OSS_HG"' >> kernel/framework/include/buildid.h
229
 
        fi
230
 
fi
231
 
 
232
 
if test "$uOSS " = "1 "
233
 
then
234
 
        echo '#define uOSS' >> kernel/framework/include/buildid.h
235
 
fi
236
 
 
237
 
if test "$USE_REGPARM " = "1 "
238
 
then
239
 
        echo "1" > ./regparm
240
 
fi
241
 
 
242
 
if test "$NO_REGPARM " = "1 "
243
 
then
244
 
        echo "0" > ./regparm
245
 
fi
246
 
 
247
 
# Setup the link to the right os.h file for this operating system.
248
 
(cd kernel/framework/include;ln -s ../../../kernel/OS/$OS/os_*.h os.h)
249
 
 
250
 
$CC $LDFLAGS -o ossvers -I./kernel/framework/include  setup/ossvers.c
251
 
./ossvers > .version
252
 
rm ./ossvers
253
 
 
254
 
ln -s $SRCDIR origdir
255
 
 
256
 
if test -f setup/$OS/build_`uname -m`.sh
257
 
then
258
 
        ln -s setup/$OS/build_`uname -m`.sh build.sh
259
 
else
260
 
        if test -f setup/$OS/build.sh
261
 
        then
262
 
                ln -s setup/$OS/build.sh build.sh
263
 
        fi
264
 
fi
265
 
 
266
 
if test -f setup/$OS/make.local
267
 
then
268
 
  if test -f Makefile.php
269
 
  then
270
 
        echo >> Makefile.php
271
 
        echo include setup/$OS/make.local >> Makefile.php
272
 
  else
273
 
        echo >> Makefile
274
 
        echo include setup/$OS/make.local >> Makefile
275
 
  fi
276
 
fi
277
 
PHPMAKE=phpmake
278
 
 
279
 
if test ! -d phpmake && test -d ../phpmake
280
 
then
281
 
        PHPMAKE=../phpmake
282
 
fi
283
 
 
284
 
if test -f Makefile.php && test -d $PHPMAKE
285
 
then
286
 
        echo Running phpmake for all subdirectories - please wait
287
 
 
288
 
        if test "$PHPMAKE_LIBPATH " = " "
289
 
        then
290
 
           PHPMAKE_LIBPATH="`pwd`/$PHPMAKE/"
291
 
 
292
 
           export PHPMAKE_LIBPATH
293
 
           echo PHPMAKE_LIBPATH not set - assuming $PHPMAKE_LIBPATH
294
 
        fi
295
 
 
296
 
        if test "$PHPMAKE_PROJECT " = " "
297
 
        then
298
 
           echo PHPMAKE_PROJECT not set - cannot continue
299
 
           exit 1
300
 
        fi
301
 
 
302
 
        phpmake
303
 
 
304
 
        (cd targetos && phpmake)
305
 
 
306
 
        make kernel/framework/include/ossddk/oss_limits.h       # Generate this file from PHh
307
 
else
308
 
        ln -s oss_limits.PHh kernel/framework/include/ossddk/oss_limits.h
309
 
fi 
310
 
 
311
 
make dep
312
 
 
313
 
echo Directory preparation complete.
314
 
echo Build ID will be `cat $SRCDIR/buildid.dat`
315
 
 
316
 
exit 0