MOXA linux-2.6.x / linux-2.6.9-uc0 from sdlinux-moxaart.tgz
[linux-2.6.9-moxart.git] / drivers / net / wireless / rtlink / Module / Configure
blob15fe92e88449025c67e8a6c2f61b3cc78598ec5d
1 #! /bin/bash
3 # Configure
6 # * Ralink Tech Inc. *
7 # * 4F, No. 2 Technology 5th Rd. *
8 # * Science-based Industrial Park *
9 # * Hsin-chu, Taiwan, R.O.C. *
10 # * *
11 # * (c) Copyright 2002, Ralink Technology, Inc. *
12 # * *
13 # * This program is free software; you can redistribute it and/or modify *
14 # * it under the terms of the GNU General Public License as published by *
15 # * the Free Software Foundation; either version 2 of the License, or *
16 # * (at your option) any later version. *
17 # * *
18 # * This program is distributed in the hope that it will be useful, *
19 # * but WITHOUT ANY WARRANTY; without even the implied warranty of *
20 # * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
21 # * GNU General Public License for more details. *
22 # * *
23 # * You should have received a copy of the GNU General Public License *
24 # * along with this program; if not, write to the *
25 # * Free Software Foundation, Inc., *
26 # * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
27 # * *
29 ECHO="/bin/echo -e "
30 fail ()
32 $ECHO ""
33 $ECHO "Configuration failed"
34 $ECHO ""
35 exit 1
39 PROMPT=y
41 #=======================================================================
43 CONFIG=config.new
44 CONFIG_MK=config.mk
45 rm -f $CONFIG $CONFIG_MK $MODVER
46 cat << 'EOF' > $CONFIG
48 # Automatically generated by 'make config' -- don't edit!
50 EOF
52 write_str () {
53 value=`eval $ECHO '$'$1`
54 $ECHO "$1"=\"$value\" >> $CONFIG
55 $ECHO "$1=$value" >> $CONFIG_MK
59 prompt () {
60 eval $3=\"$2\"
61 if [ "$PROMPT" = "y" ] ; then
62 $ECHO "$1 [$2]: \c"
63 read tmp
64 if [ -n "$tmp" ] ; then eval $3=\"$tmp\" ; fi
65 else
66 $ECHO "$1 [$2]"
70 ask_str () {
71 default=`eval $ECHO '$'$2`
72 prompt "$1" "`$ECHO $default`" answer
73 eval $2=\"$answer\"
74 write_str $2
78 $ECHO ""
79 $ECHO ""
80 $ECHO "-------------------- Ralink RT2500 Station Configuration -------------------- "
81 $ECHO ""
83 CUR_RELEASE=`uname -r`
84 LINUX_SRC=/usr/src/linux-$CUR_RELEASE
86 if [ ! -d $LINUX_SRC ] ; then
87 ask_str " Linux kernel source directory" LINUX_SRC
88 $ECHO " "
89 if [ ! -d $LINUX_SRC ] ; then
90 $ECHO "Linux source tree '$LINUX_SRC' is incomplete or missing!"
91 fail
93 fi
95 $ECHO " Linux kernel source directory : $LINUX_SRC"
96 $ECHO " "
97 write_str LINUX_SRC
100 # What kernel are we compiling for?
101 version () {
102 $ECHO ""
103 expr $1 \* 65536 + $2 \* 256 + $3
106 for TAG in VERSION PATCHLEVEL SUBLEVEL ; do
107 eval `sed -ne "/^$TAG/s/[ ]//gp" $LINUX_SRC/Makefile`
108 done
110 VERSION_CODE=`version $VERSION $PATCHLEVEL $SUBLEVEL`
111 if [ $VERSION_CODE -lt `version 2 2 0` ] ; then
112 $ECHO "This package requires at least a 2.2.x series kernel."
113 fail
116 MODDIR=/lib/modules/$CUR_RELEASE
117 TARGET_MODDIR=$MODDIR
119 if [ -d $MODDIR/kernel/drivers/net ] ; then
120 MODDIR=$MODDIR/kernel/drivers/net
121 else
122 ask_str " Module install directory" MODDIR
123 if [ ! -d $MODDIR ] ; then
124 $ECHO "Module install directory '$MODDIR' is incomplete or missing!"
125 fail
129 $ECHO " Module install directory : $MODDIR"
130 $ECHO " "
132 TARGET_MODDIR=$MODDIR
133 write_str TARGET_MODDIR