Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 108 lines (95 sloc) 2.37 KB
#!/bin/sh
topdir='../..'
common='common'
target='kernel'
debug=0
sched=0
## cflags for each driver
nvrm_CFLAGS=''
pscnv_CFLAGS=''
nouveau_CFLAGS="-I /usr/include/libdrm"
barra_CFLAGS=''
## object for each driver
nvrm_OBJS="nvrm_gdev.o nvrm.o ioctl.o mthd.o handle.o channel.o memory.o"
pscnv_OBJS="pscnv_gdev.o libpscnv.o libpscnv_ib.o"
nouveau_OBJS="nouveau_gdev.o libnouveau.o libnouveau_ib.o"
barra_OBJS="barra_gdev.o"
## library for each driver
nvrm_LIBS=''
pscnv_LIBS=''
nouveau_LIBS="-ldrm_nouveau"
barra_LIBS="-lbarra"
# parse the given options.
for option
do
case "$option" in
-*=*) optarg=`echo "$option" | sed 's/[-_a-zA-Z0-9]*=//'` ;;
*) optarg= ;;
esac
case "$option" in
--target=*)
target="$optarg" ;;
--debug)
debug=1 ;;
--enable-sched)
sched=1 ;;
--with-barra=*)
barra_LIBS="-L$optarg/lib $barra_LIBS" ;;
esac
done
if [ $target = 'kernel' ] ; then
# all files are driver-independent
cp -f $topdir/$common/*.h .
cp -f $topdir/util/* .
cp -f ../kernel/* .
elif [ $target = 'user' ] ; then
# copy driver-independent files
cp -f $topdir/$common/* .
cp -f $topdir/util/* .
cp -f ../user/gdev/* .
cp -f ../user/usched/* .
# detect which driver to be used
sh ./autogen.sh
# get $DRIVER_NAME
. ./Driver.mk
# copy driver-dependent files
cp -f ../user/$DRIVER_NAME/* .
# extra flags for Makefile
eval EXTRA_CFLAGS="EXTRA_CFLAGS?="'$'$DRIVER_NAME"_CFLAGS"
eval EXTRA_OBJS="EXTRA_OBJS="'$'$DRIVER_NAME"_OBJS"
eval EXTRA_LIBS="EXTRA_LIBS="'$'$DRIVER_NAME"_LIBS"
if [ $sched != 1 ] ; then
eval EXTRA_CFLAGS2="EXTRA_CFLAGS+=""-DGDEV_SCHED_DISABLED"
fi
elif [ $target = 'barra' ] ; then
# Barra in user-mode
# copy driver-independent files
cp -f $topdir/$common/* .
cp -f $topdir/util/* .
cp -f ../user/gdev/* .
# set barra as the driver
sh ./autogen.sh barra
# get $DRIVER_NAME
. ./Driver.mk
# copy driver-dependent files
cp -f ../user/$DRIVER_NAME/* .
eval EXTRA_CFLAGS="EXTRA_CFLAGS?="'$'$DRIVER_NAME"_CFLAGS"
eval EXTRA_OBJS="EXTRA_OBJS="'$'$DRIVER_NAME"_OBJS"
eval EXTRA_LIBS="EXTRA_LIBS="'$'$DRIVER_NAME"_LIBS"
eval EXTRA_CFLAGS2="EXTRA_CFLAGS+=""-DGDEV_SCHED_DISABLED"
else
echo "Error: invalid target '$target'"
fi
# create Extra.mk
cat > Extra.mk << EOF
#
# Copyright (C) Shinpei Kato
# All Rights Reserved
#
# This is automatically generated by configure script.
#
$EXTRA_CFLAGS
$EXTRA_CFLAGS2
$EXTRA_OBJS
$EXTRA_LIBS
EOF
Something went wrong with that request. Please try again.