3
if test "$CONFIGURE " != "YES "
6
echo Error: Wrong usage
8
echo You must run `dirname $0`/configure instead of $0
19
if test "$TARGETOS " != " "
24
# Use the same source directories for SCO UnixWare and SCO OSR
25
if test "$OS " = "UnixWare "
30
# Use the same source directories for Haiku and BeOS
31
if test "$OS " = "Haiku "
36
# Use Linux24 as the OS name for Linux 2.4.x
37
if test "$OS " = "Linux "
39
if test "`uname -r|sed 's/2.//'|sed 's/\..*//'` " = "4 "
45
# pkg-config seems to crash in some systems so disable core dumps
46
ulimit -c 0 >/dev/null 2>&1
48
if pkg-config gtk+-2.0 --cflags > /dev/null 2>&1
54
if gtk-config --cflags > /dev/null 2>&1
62
if test "`ls .` " != " " && test "`ls .` " != ".makefile "
64
echo Error: Current directory must be empty
68
if test -f $SRCDIR/setup/setupdir.sh
70
echo Source directory is $SRCDIR
71
echo Build directory is $BLDDIR
73
echo Error: Invalid source directory $SRCDIR
77
# Copy the ".devices" files for all drivers to devices.list
78
cat `find $SRCDIR/kernel/drv -name .devices`|grep -v '^#' > devices.list
80
if test -d $SRCDIR/kernel/nonfree/drv
82
cat `find $SRCDIR/kernel/nonfree/drv -name .devices`|grep -v '^#' >> devices.list
85
echo BLDDIR=$BLDDIR > .directories
86
echo SRCDIR=$SRCDIR >> .directories
87
echo OSSLIBDIR=$OSSLIBDIR >> .directories
89
$CC $LDFLAGS -o dirsetup $SRCDIR/setup/dirsetup.c
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
95
if ./dirsetup "$SRCDIR" "$BLDDIR" $* $COPY_OPTIONS
97
echo Build tree created OK
99
echo Cannot create the build tree
106
if test "$CLOSED_SOURCE " != "YES "
108
rm -rf kernel/nonfree 4front-private
111
if test "$ONLY_DRVS " != " "
116
if echo $ONLY_DRVS | grep ",$drv" >/dev/null
125
if test "$CLOSED_SOURCE " = "YES "
127
cd kernel/nonfree/drv
130
if echo $ONLY_DRVS | grep ",$drv" >/dev/null
142
if ! test -z $TARGETOS
144
DTARGETOS="-D$TARGETOS"
147
$CC $LDFLAGS -D`uname -s` $DTARGETOS -o srcconf $SRCDIR/setup/srcconf.c
151
echo Source configuration OK
153
echo Source configuration failed
156
if test "$CLOSED_SOURCE " != "YES " && test -d $SRCDIR/.hg
158
HGID=`(cd $SRCDIR && hg tip|grep changeset) 2>/dev/null`
160
if test "$HGID " != " "
162
echo '#define' OSS_HG_INFO \"$HGID, \" \\ >> kernel/framework/include/local_config.h
164
HGID=`(cd $SRCDIR && hg tip|grep tag) 2>/dev/null`
165
echo ' ' \"$HGID, \" \\ >> kernel/framework/include/local_config.h
167
HGID=`(cd $SRCDIR && hg tip|grep date) 2>/dev/null`
168
echo ' ' \"$HGID, \" \\ >> kernel/framework/include/local_config.h
170
HGID=`(cd $SRCDIR && hg tip|grep summary) 2>/dev/null`
171
echo ' ' \"$HGID\" >> kernel/framework/include/local_config.h
176
if test ! "$OSS_CONFIG_OPTIONS " = " " && test ! "$OSS_CONFIG_OPTIONS " = "--include-closed-source "
178
echo '#define OSS_CONFIG_OPTIONS '\"$OSS_CONFIG_OPTIONS\" >> kernel/framework/include/local_config.h
191
mkdir target/tmpobjects
195
if date -u +%Y%m%d%H%M > build.id.new 2>/dev/null
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
202
echo Build ID will become `cat build.id`
204
echo Failed to create the build timestamp
208
if test "$CLOSED_SOURCE " = "YES "
210
echo "#define LICENSED_VERSION" >> kernel/framework/include/local_config.h
213
if test -f $SRCDIR/buildid.dat
215
echo '#define 'OSS_BUILD_ID \"`cat $SRCDIR/buildid.dat`\" > kernel/framework/include/buildid.h
217
echo $SRCDIR/buildid.dat is missing
221
if test ! -d kernel/nonfree || test -f $SRCDIR/kernel/nonfree/.nomake
223
echo '#define __OPENOSS__' >> kernel/framework/include/buildid.h
224
if test -f $SRCDIR/.license
226
echo '#define OSS_LICENSE "'`cat $SRCDIR/.license`'"' >> kernel/framework/include/buildid.h
228
echo '#define OSS_LICENSE "OSS_HG"' >> kernel/framework/include/buildid.h
232
if test "$uOSS " = "1 "
234
echo '#define uOSS' >> kernel/framework/include/buildid.h
237
if test "$USE_REGPARM " = "1 "
242
if test "$NO_REGPARM " = "1 "
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)
250
$CC $LDFLAGS -o ossvers -I./kernel/framework/include setup/ossvers.c
254
ln -s $SRCDIR origdir
256
if test -f setup/$OS/build_`uname -m`.sh
258
ln -s setup/$OS/build_`uname -m`.sh build.sh
260
if test -f setup/$OS/build.sh
262
ln -s setup/$OS/build.sh build.sh
266
if test -f setup/$OS/make.local
268
if test -f Makefile.php
271
echo include setup/$OS/make.local >> Makefile.php
274
echo include setup/$OS/make.local >> Makefile
279
if test ! -d phpmake && test -d ../phpmake
284
if test -f Makefile.php && test -d $PHPMAKE
286
echo Running phpmake for all subdirectories - please wait
288
if test "$PHPMAKE_LIBPATH " = " "
290
PHPMAKE_LIBPATH="`pwd`/$PHPMAKE/"
292
export PHPMAKE_LIBPATH
293
echo PHPMAKE_LIBPATH not set - assuming $PHPMAKE_LIBPATH
296
if test "$PHPMAKE_PROJECT " = " "
298
echo PHPMAKE_PROJECT not set - cannot continue
304
(cd targetos && phpmake)
306
make kernel/framework/include/ossddk/oss_limits.h # Generate this file from PHh
308
ln -s oss_limits.PHh kernel/framework/include/ossddk/oss_limits.h
313
echo Directory preparation complete.
314
echo Build ID will be `cat $SRCDIR/buildid.dat`