2002-04-06 13:39:32 -05:00
|
|
|
#!/bin/bash
|
2000-02-07 22:35:44 -05:00
|
|
|
#
|
2000-07-05 00:57:04 -04:00
|
|
|
# Configure
|
2000-07-03 01:44:54 -04:00
|
|
|
#
|
2000-07-05 00:57:04 -04:00
|
|
|
# linux-wlan Open Sourc Project
|
2000-02-07 22:35:44 -05:00
|
|
|
#
|
2000-07-05 00:57:04 -04:00
|
|
|
# Copyright (C) 1999 AbsoluteValue Systems, Inc. All Rights Reserved.
|
|
|
|
# -------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# Inquiries regarding the linux-wlan Open Source Project can be
|
|
|
|
# made directly to:
|
2000-07-06 00:40:21 -04:00
|
|
|
#
|
2000-07-05 00:57:04 -04:00
|
|
|
# AbsoluteValue Systems Inc.
|
|
|
|
# info@linux-wlan.com
|
|
|
|
# http://www.linux-wlan.com
|
|
|
|
#
|
|
|
|
# -------------------------------------------------------------------------
|
|
|
|
# TODO: Since we're dependent on configured pcmcia source, we should change
|
|
|
|
# this such that it will ask for the pcmcia source dir and then read
|
|
|
|
# all our stuff from pcmcia/config.mk. Would simplify alot of things.
|
|
|
|
# -------------------------------------------------------------------------
|
|
|
|
#
|
|
|
|
# This script adapted from the pcmcia-cs/Configure file, license statement below:
|
|
|
|
#
|
|
|
|
# pcmcia-cs/Configure 1.110 1999/06/24 17:37:36
|
2000-02-07 22:35:44 -05:00
|
|
|
#
|
|
|
|
# The contents of this file are subject to the Mozilla Public License
|
|
|
|
# Version 1.0 (the "License"); you may not use this file except in
|
|
|
|
# compliance with the License. You may obtain a copy of the License at
|
|
|
|
# http://www.mozilla.org/MPL/
|
|
|
|
#
|
|
|
|
# Software distributed under the License is distributed on an "AS IS"
|
|
|
|
# basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
|
|
|
|
# the License for the specific language governing rights and
|
|
|
|
# limitations under the License.
|
|
|
|
#
|
2000-07-05 00:57:04 -04:00
|
|
|
# The initial developer of the Configure code is David A. Hinds
|
2000-02-07 22:35:44 -05:00
|
|
|
# <dhinds@hyper.stanford.edu>. Portions created by David A. Hinds
|
|
|
|
# are Copyright (C) 1998 David A. Hinds. All Rights Reserved.
|
|
|
|
#-------------------------------------------------------------------------
|
2000-01-13 09:44:20 -05:00
|
|
|
|
2000-03-31 11:18:57 -05:00
|
|
|
ECHO="/bin/echo -e "
|
2000-01-13 09:44:20 -05:00
|
|
|
fail ()
|
|
|
|
{
|
2000-03-31 11:18:57 -05:00
|
|
|
$ECHO ""
|
|
|
|
$ECHO "Configuration failed"
|
|
|
|
$ECHO ""
|
2000-01-13 09:44:20 -05:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2000-07-07 14:59:34 -04:00
|
|
|
usage () {
|
2000-07-08 15:48:51 -04:00
|
|
|
$ECHO "usage: Configure [-h|help|-d [filename]|-f <filename>]"
|
2000-07-07 14:59:34 -04:00
|
|
|
$ECHO ""
|
2000-07-08 15:48:51 -04:00
|
|
|
$ECHO " -h|help - display usage info"
|
2000-07-07 14:59:34 -04:00
|
|
|
$ECHO " -d [filename] - automated configuration with option to specify input file"
|
|
|
|
$ECHO " -f <filename> - read configuration data from file and prompt user"
|
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
2003-10-13 09:24:18 -04:00
|
|
|
if [ ! -r config.in ]; then
|
|
|
|
$ECHO "config.in does not exist!"
|
|
|
|
fail
|
|
|
|
fi
|
|
|
|
|
|
|
|
. ./config.in
|
|
|
|
|
2000-01-13 09:44:20 -05:00
|
|
|
if [ -r config.out ]; then
|
2003-10-13 09:24:18 -04:00
|
|
|
. ./config.out 2>/dev/null
|
2000-01-13 09:44:20 -05:00
|
|
|
fi
|
|
|
|
|
|
|
|
PROMPT=y
|
2000-07-03 01:44:54 -04:00
|
|
|
if [ $# -gt 0 ] ; then
|
2000-07-08 15:48:51 -04:00
|
|
|
if [ "$1" = "-h" -o "$1" = "help" ] ; then
|
|
|
|
usage
|
|
|
|
fi
|
2000-07-07 14:59:34 -04:00
|
|
|
if [ "$1" = "-d" -o "$1" = "-f" ] ; then
|
|
|
|
if [ $# -gt 1 ] ; then
|
|
|
|
if [ -r $2 ]; then
|
|
|
|
. $2
|
|
|
|
else
|
|
|
|
$ECHO "$2 does not exist"
|
|
|
|
fail
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
if [ "$1" = "-f" ] ; then
|
|
|
|
usage
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
if [ "$1" = "-d" ] ; then
|
|
|
|
PROMPT=n
|
2000-07-03 01:44:54 -04:00
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
2000-01-13 09:44:20 -05:00
|
|
|
|
|
|
|
#=======================================================================
|
|
|
|
|
|
|
|
CONFIG=config.new
|
|
|
|
CONFIG_MK=config.mk
|
2000-07-03 01:44:54 -04:00
|
|
|
rm -f $CONFIG $CONFIG_MK $MODVER
|
2000-01-13 09:44:20 -05:00
|
|
|
|
|
|
|
cat << 'EOF' > $CONFIG
|
|
|
|
#
|
|
|
|
# Automatically generated by 'make config' -- don't edit!
|
|
|
|
#
|
|
|
|
EOF
|
|
|
|
|
|
|
|
write_bool() {
|
2000-03-31 11:18:57 -05:00
|
|
|
value=`eval $ECHO '$'$1`
|
2000-01-13 09:44:20 -05:00
|
|
|
if [ "$value" = "y" ] ; then
|
2000-03-31 11:18:57 -05:00
|
|
|
$ECHO "$1=y" >> $CONFIG
|
|
|
|
$ECHO "$1=y" >> $CONFIG_MK
|
2000-01-13 09:44:20 -05:00
|
|
|
else
|
2000-03-31 11:18:57 -05:00
|
|
|
$ECHO "# $1 is not defined" >> $CONFIG
|
|
|
|
$ECHO "# $1 is not defined" >> $CONFIG_MK
|
2000-01-13 09:44:20 -05:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
write_str () {
|
2000-03-31 11:18:57 -05:00
|
|
|
value=`eval $ECHO '$'$1`
|
|
|
|
$ECHO "$1"=\"$value\" >> $CONFIG
|
|
|
|
$ECHO "$1=$value" >> $CONFIG_MK
|
2000-01-13 09:44:20 -05:00
|
|
|
}
|
|
|
|
|
2000-04-26 13:40:31 -04:00
|
|
|
|
|
|
|
dump_str () {
|
|
|
|
$ECHO "$1" >> $CONFIG
|
|
|
|
$ECHO "$1" >> $CONFIG_MK
|
|
|
|
}
|
|
|
|
|
2000-01-13 09:44:20 -05:00
|
|
|
prompt () {
|
|
|
|
eval $3=\"$2\"
|
|
|
|
if [ "$PROMPT" = "y" ] ; then
|
2000-03-31 11:18:57 -05:00
|
|
|
$ECHO "$1 [$2]: \c"
|
2000-01-13 09:44:20 -05:00
|
|
|
read tmp
|
|
|
|
if [ -n "$tmp" ] ; then eval $3=\"$tmp\" ; fi
|
|
|
|
else
|
2000-03-31 11:18:57 -05:00
|
|
|
$ECHO "$1 [$2]"
|
2000-01-13 09:44:20 -05:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
ask_bool () {
|
2000-03-31 11:18:57 -05:00
|
|
|
default=`eval $ECHO '$'$2`
|
2000-01-13 09:44:20 -05:00
|
|
|
if [ ! "$default" ] ; then default=n ; fi
|
|
|
|
answer=""
|
|
|
|
while [ "$answer" != "n" -a "$answer" != "y" ] ; do
|
|
|
|
prompt "$1 (y/n)" "$default" answer
|
|
|
|
done
|
|
|
|
eval "$2=$answer"
|
|
|
|
write_bool $2
|
|
|
|
}
|
|
|
|
|
|
|
|
ask_str () {
|
2000-03-31 11:18:57 -05:00
|
|
|
default=`eval $ECHO '$'$2`
|
|
|
|
prompt "$1" "`$ECHO $default`" answer
|
2000-01-13 09:44:20 -05:00
|
|
|
eval $2=\"$answer\"
|
|
|
|
write_str $2
|
|
|
|
}
|
|
|
|
|
2001-03-07 14:56:26 -05:00
|
|
|
mkversionh () {
|
|
|
|
versionh=src/include/wlan/version.h
|
2003-10-13 09:24:18 -04:00
|
|
|
cp src/version.h.in $versionh
|
2002-11-15 15:23:58 -05:00
|
|
|
|
|
|
|
DATE=`date`
|
|
|
|
|
2001-03-12 14:08:27 -05:00
|
|
|
printf '#define WLAN_RELEASE\t"%d.%d.%d%s"\n' \
|
2003-10-13 09:24:18 -04:00
|
|
|
${WLAN_VERSION} \
|
|
|
|
${WLAN_PATCHLEVEL} \
|
|
|
|
${WLAN_SUBLEVEL} \
|
|
|
|
${WLAN_EXTRAVERSION} >> $versionh
|
2001-03-07 14:56:26 -05:00
|
|
|
printf '#define WLAN_RELEASE_CODE 0x%02x%02x%02x\n' \
|
2003-10-13 09:24:18 -04:00
|
|
|
${WLAN_VERSION} \
|
|
|
|
${WLAN_PATCHLEVEL} \
|
|
|
|
${WLAN_SUBLEVEL} >> $versionh
|
|
|
|
echo "#define WLAN_BUILD_DATE \"$DATE\" " >> $versionh
|
2002-11-15 15:23:58 -05:00
|
|
|
|
2001-03-10 14:15:30 -05:00
|
|
|
printf '\n' >> $versionh
|
2002-11-15 15:23:58 -05:00
|
|
|
printf '#endif\n' >> $versionh
|
2001-03-07 14:56:26 -05:00
|
|
|
|
|
|
|
}
|
2000-01-13 09:44:20 -05:00
|
|
|
|
2003-10-13 09:24:18 -04:00
|
|
|
#=======================================================================
|
2001-03-07 14:56:26 -05:00
|
|
|
|
|
|
|
# If the src/include/wlan/version.h file needs a touchup, fix or create it
|
|
|
|
if [ -r src/include/wlan/version.h ]; then
|
|
|
|
WLAN_RELEASE="${WLAN_VERSION}.${WLAN_PATCHLEVEL}.${WLAN_SUBLEVEL}${WLAN_EXTRAVERSION}"
|
|
|
|
OLD_RELEASE=`sed --quiet -e '/#define.*WLAN_RELEASE[^_].*\"\(.*\)\"/s//\1/p' < src/include/wlan/version.h`
|
|
|
|
if [ "${WLAN_RELEASE}" != "${OLD_RELEASE}" ]; then
|
|
|
|
# Overwrite the file
|
|
|
|
mkversionh
|
|
|
|
fi
|
|
|
|
else
|
|
|
|
# File doesn't exist, create it
|
|
|
|
mkversionh
|
|
|
|
fi
|
|
|
|
|
2000-03-31 11:18:57 -05:00
|
|
|
$ECHO ""
|
2000-05-01 13:11:47 -04:00
|
|
|
$ECHO "-------------- Linux WLAN Configuration Script -------------"
|
2000-03-31 11:18:57 -05:00
|
|
|
$ECHO ""
|
|
|
|
$ECHO "The default responses are correct for most users."
|
|
|
|
$ECHO ""
|
2000-01-13 09:44:20 -05:00
|
|
|
|
2001-08-28 08:26:18 -04:00
|
|
|
#=======================================================================
|
|
|
|
# Should we build for PCMCIA Card Services?
|
|
|
|
|
|
|
|
ask_bool "Build Prism2.x PCMCIA Card Services (_cs) driver?" PRISM2_PCMCIA
|
|
|
|
|
|
|
|
#=======================================================================
|
2001-12-11 14:09:59 -05:00
|
|
|
# Should we build for PLX9052 based PCI adapters?
|
2001-08-28 08:26:18 -04:00
|
|
|
|
2001-12-11 14:09:59 -05:00
|
|
|
ask_bool "Build Prism2 PLX9052 based PCI (_plx) adapter driver?" PRISM2_PLX
|
2001-08-28 08:26:18 -04:00
|
|
|
#=======================================================================
|
|
|
|
# Should we build for Prism2 native PCI?
|
|
|
|
|
|
|
|
ask_bool "Build Prism2.5 native PCI (_pci) driver?" PRISM2_PCI
|
|
|
|
|
|
|
|
#=======================================================================
|
2001-09-27 16:54:52 -04:00
|
|
|
# Should we build for Prism2.5 USB?
|
|
|
|
|
|
|
|
ask_bool "Build Prism2.5 USB (_usb) driver?" PRISM2_USB
|
|
|
|
|
|
|
|
$ECHO ""
|
|
|
|
|
|
|
|
#=======================================================================
|
2000-01-13 09:44:20 -05:00
|
|
|
# Collect the kernel source tree and test for sanity
|
|
|
|
|
|
|
|
ask_str "Linux source directory" LINUX_SRC
|
|
|
|
|
2002-07-01 17:12:55 -04:00
|
|
|
if [ ! -f $LINUX_SRC/include/linux/version.h ] ; then
|
2001-08-28 08:26:18 -04:00
|
|
|
$ECHO "Linux source tree $LINUX_SRC is incomplete or missing!"
|
|
|
|
if [ -d $LINUX_SRC/include/linux ] ; then
|
2000-03-31 11:18:57 -05:00
|
|
|
$ECHO " The kernel header files are present, but not " \
|
2001-08-28 08:26:18 -04:00
|
|
|
"the full source code."
|
|
|
|
fi
|
|
|
|
$ECHO " See the HOWTO for a list of FTP sites for current" \
|
2000-01-13 09:44:20 -05:00
|
|
|
"kernel sources."
|
2001-08-28 08:26:18 -04:00
|
|
|
fail
|
2000-01-13 09:44:20 -05:00
|
|
|
fi
|
|
|
|
|
2002-09-03 13:47:11 -04:00
|
|
|
KERNEL_SOURCE=$LINUX_SRC make -Cscripts 2>&1 > /dev/null
|
|
|
|
. scripts/make.opts
|
|
|
|
|
2000-01-13 09:44:20 -05:00
|
|
|
# What kernel are we compiling for?
|
|
|
|
|
|
|
|
version () {
|
2001-08-28 08:26:18 -04:00
|
|
|
expr $1 \* 65536 + $2 \* 256 + $3
|
2000-01-13 09:44:20 -05:00
|
|
|
}
|
|
|
|
|
2000-03-31 11:18:57 -05:00
|
|
|
$ECHO ""
|
2002-07-01 17:12:55 -04:00
|
|
|
|
2002-09-03 13:47:11 -04:00
|
|
|
SRC_RELEASE="$KERNEL_RELEASE"
|
2002-07-01 17:12:55 -04:00
|
|
|
|
|
|
|
VERSION_CODE=`grep LINUX_VERSION_CODE $LINUX_SRC/include/linux/version.h | \
|
|
|
|
sed -e 's/[^0-9]//g'`
|
|
|
|
|
2000-03-31 11:18:57 -05:00
|
|
|
$ECHO "The kernel source tree is version $SRC_RELEASE."
|
2001-08-28 08:26:18 -04:00
|
|
|
if [ $VERSION_CODE -lt `version 2 2 0` ] ; then
|
|
|
|
$ECHO "This package requires at least a 2.2.x series kernel."
|
|
|
|
fail
|
2000-01-13 09:44:20 -05:00
|
|
|
fi
|
2002-09-07 14:09:14 -04:00
|
|
|
|
2003-04-03 09:06:27 -05:00
|
|
|
if [ $VERSION_CODE -gt `version 2 5 0` ] ; then
|
2003-07-27 20:30:51 -04:00
|
|
|
$ECHO "Kernel 2.5/2.6 support is highly experimental."
|
2003-04-03 09:06:27 -05:00
|
|
|
KERN_25=y
|
|
|
|
write_bool KERN_25
|
|
|
|
fi
|
|
|
|
|
2000-01-13 09:44:20 -05:00
|
|
|
CUR_RELEASE=`uname -r`
|
|
|
|
if [ "$SRC_RELEASE" != "$CUR_RELEASE" ] ; then
|
2002-09-07 14:09:14 -04:00
|
|
|
$ECHO "WARNING: the current running kernel is actually version $CUR_RELEASE."
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ ! -f $LINUX_SRC/.config ] ; then
|
2002-09-07 14:13:42 -04:00
|
|
|
$ECHO "WARNING: .config not present in kernel source tree. This will"
|
|
|
|
$ECHO " screw up modversions detection and build optimizations."
|
|
|
|
$ECHO " Is this a RedHat kernel? Workarounds enabled."
|
2002-09-07 14:09:14 -04:00
|
|
|
if [ -f $LINUX_SRC/include/linux/modversions.h ] ; then
|
|
|
|
KERNEL_MODFLAGS="-DMODULE -DMODVERSIONS -include $LINUX_SRC/include/linux/modversions.h"
|
|
|
|
fi
|
|
|
|
$ECHO " For an optimized build, copy over the relevent file from"
|
|
|
|
$ECHO " $LINUX_SRC/configs/ to $LINUX_SRC/.config"
|
2000-01-13 09:44:20 -05:00
|
|
|
fi
|
2000-03-13 14:43:32 -05:00
|
|
|
|
2000-01-13 09:44:20 -05:00
|
|
|
# Check for consistent kernel build dates
|
|
|
|
|
|
|
|
CUR_D=`uname -v | sed -e 's/^#[0-9]* //;s/SMP //'`
|
2000-03-31 11:18:57 -05:00
|
|
|
CUR_D=`$ECHO $CUR_D | sed -e 's/\(:[0-9][0-9]\) .* \([12][90]\)/\1 \2/'`
|
|
|
|
$ECHO "The current kernel build date is $CUR_D."
|
2000-01-13 09:44:20 -05:00
|
|
|
UTS_VERSION="unknown";
|
|
|
|
if [ -f $LINUX_SRC/include/linux/compile.h ] ; then
|
2001-08-28 08:26:18 -04:00
|
|
|
UTS_VERSION=`grep UTS_VERSION $LINUX_SRC/include/linux/compile.h |
|
2000-01-13 09:44:20 -05:00
|
|
|
sed -e 's/.*"\(.*\)"/\1/'`
|
2001-08-28 08:26:18 -04:00
|
|
|
SRC_D=`$ECHO $UTS_VERSION | sed -e 's/^#[0-9]* //;s/SMP //'`
|
|
|
|
SRC_D=`$ECHO $SRC_D | sed -e 's/\(:[0-9][0-9]\) .* \([12][90]\)/\1 \2/'`
|
|
|
|
if [ $SRC_RELEASE = $CUR_RELEASE -a "$SRC_D" != "$CUR_D" ] ; then
|
2000-03-31 11:18:57 -05:00
|
|
|
$ECHO "WARNING: the source tree has a build date of $SRC_D."
|
2000-01-13 09:44:20 -05:00
|
|
|
if [ `date -d "$SRC_D" +%s` -gt `date -d "$CUR_D" +%s` ] ; then
|
2001-08-28 08:26:18 -04:00
|
|
|
$ECHO " Did you forget to install your new kernel?!?"
|
|
|
|
fi
|
2000-01-13 09:44:20 -05:00
|
|
|
fi
|
|
|
|
fi
|
2000-03-31 11:18:57 -05:00
|
|
|
$ECHO ""
|
2000-01-13 09:44:20 -05:00
|
|
|
|
2002-04-06 13:39:32 -05:00
|
|
|
# Test for netlink availability in the kernel
|
|
|
|
if grep -sq "#define.*CONFIG_NETLINK.*1" ${LINUX_SRC}/include/linux/autoconf.h; then
|
|
|
|
CONFIG_NETLINK=y
|
|
|
|
else
|
|
|
|
CONFIG_NETLINK=n
|
|
|
|
fi
|
2003-05-12 09:28:47 -04:00
|
|
|
write_bool CONFIG_NETLINK
|
|
|
|
|
2002-04-06 13:39:32 -05:00
|
|
|
|
|
|
|
# Test for pf_packet availability in the kernel
|
|
|
|
if grep -sq "#define.*CONFIG_PACKET.*1" ${LINUX_SRC}/include/linux/autoconf.h; then
|
|
|
|
CONFIG_PACKET=y
|
|
|
|
else
|
|
|
|
CONFIG_PACKET=n
|
|
|
|
fi
|
2003-05-12 09:28:47 -04:00
|
|
|
write_bool CONFIG_PACKET
|
|
|
|
|
|
|
|
|
|
|
|
# Test for pf_packet availability in the kernel
|
|
|
|
if grep -sq "#define.*CONFIG_HOTPLUG.*1" ${LINUX_SRC}/include/linux/autoconf.h; then
|
|
|
|
CONFIG_HOTPLUG=y
|
|
|
|
else
|
|
|
|
CONFIG_HOTPLUG=n
|
|
|
|
fi
|
|
|
|
write_bool CONFIG_HOTPLUG
|
2002-04-06 13:39:32 -05:00
|
|
|
|
2002-09-03 14:40:23 -04:00
|
|
|
# test to see if __KERNEL__ is defined in KERNEL_CFLAGS
|
|
|
|
# if not, $KERNEL_CFLAGS += __KERNEL__
|
|
|
|
|
|
|
|
grep __KERNEL__ < scripts/make.opts > /dev/null
|
|
|
|
if [ $? = 1 ] ; then
|
|
|
|
KERNEL_CFLAGS="-D__KERNEL__ -I$LINUX_SRC/include $KERNEL_CFLAGS"
|
|
|
|
fi
|
|
|
|
|
2002-09-03 13:47:11 -04:00
|
|
|
dump_str "KERNEL_CFLAGS=$KERNEL_CFLAGS"
|
|
|
|
dump_str "KERNEL_MODFLAGS=$KERNEL_MODFLAGS"
|
2002-09-04 14:36:11 -04:00
|
|
|
|
2001-08-28 08:26:18 -04:00
|
|
|
#=======================================================================
|
|
|
|
# If compiling for pcmcia-cs, find the PCMCIA source tree
|
|
|
|
|
|
|
|
if [ $PRISM2_PCMCIA = "y" ] ; then
|
2002-10-08 11:53:19 -04:00
|
|
|
# Should we build for Kernel based PCMCIA?
|
|
|
|
WLAN_KERN_PCMCIA=y
|
|
|
|
grep 'define CONFIG_PCMCIA' < $LINUX_SRC/include/linux/autoconf.h > /dev/null
|
|
|
|
if [ $? = 1 ] ; then
|
|
|
|
WLAN_KERN_PCMCIA=n
|
|
|
|
fi
|
|
|
|
write_bool WLAN_KERN_PCMCIA
|
|
|
|
|
|
|
|
# We only need the pcmcia source directory if we're NOT building for
|
|
|
|
# kernel PCMCIA.
|
|
|
|
|
|
|
|
if [ $WLAN_KERN_PCMCIA != "y" ] ; then
|
|
|
|
if [ ! "$PCMCIA_SRC" ] ; then
|
2001-08-28 08:26:18 -04:00
|
|
|
if [ -f /sbin/cardctl ] ; then
|
|
|
|
PCMCIA_SRC=`/sbin/cardctl -V 2>&1 | sed -e 's/cardctl version //'`
|
|
|
|
PCMCIA_SRC=/usr/src/pcmcia-cs-$PCMCIA_SRC
|
|
|
|
fi
|
2002-10-08 11:53:19 -04:00
|
|
|
fi
|
|
|
|
ask_str "pcmcia-cs source dir" PCMCIA_SRC
|
2000-01-13 09:44:20 -05:00
|
|
|
|
2002-10-08 11:53:19 -04:00
|
|
|
if [ ! -f $PCMCIA_SRC/Makefile ] ; then
|
2001-08-28 08:26:18 -04:00
|
|
|
$ECHO "pcmcia-cs source tree $PCMCIA_SRC is incomplete or missing!"
|
|
|
|
$ECHO "The wlan driver for pcmcia cannot be built without "
|
2002-09-04 19:30:37 -04:00
|
|
|
$ECHO "the pcmcia-cs source tree present and configured."
|
2001-08-28 08:26:18 -04:00
|
|
|
fail
|
2002-10-08 11:53:19 -04:00
|
|
|
fi
|
|
|
|
if [ ! -f $PCMCIA_SRC/include/pcmcia/config.h ] ; then
|
2001-08-28 08:26:18 -04:00
|
|
|
$ECHO "The pcmcia-cs source tree does not appear to be configured."
|
|
|
|
$ECHO "The wlan driver for pcmcia cannot be built without "\
|
|
|
|
$ECHO "the pcmcia-cs source tree present and configured."
|
|
|
|
fail
|
2002-10-08 11:53:19 -04:00
|
|
|
fi
|
|
|
|
$ECHO ""
|
2001-08-28 08:26:18 -04:00
|
|
|
|
2002-10-08 11:53:19 -04:00
|
|
|
# Now we need to generate the module options flags.
|
2002-09-05 15:01:27 -04:00
|
|
|
# It's only relevant if modversions is turned on.
|
2002-09-04 14:36:11 -04:00
|
|
|
grep CONFIG_MODVERSIONS=y < $PCMCIA_SRC/config.mk > /dev/null
|
|
|
|
if [ $? = 0 ] ; then
|
2002-09-05 15:01:27 -04:00
|
|
|
PCMCIA_MODFLAGS="-DMODULE -DMODVERSIONS -include $PCMCIA_SRC/include/linux/modversions.h"
|
2002-09-23 18:11:44 -04:00
|
|
|
else
|
|
|
|
PCMCIA_MODFLAGS="-DMODULE"
|
2002-09-04 14:36:11 -04:00
|
|
|
fi
|
2002-10-08 11:53:19 -04:00
|
|
|
|
2002-09-23 18:11:44 -04:00
|
|
|
# new versions of pcmcia-cs don't generate their own modversion.h
|
2002-09-05 15:01:27 -04:00
|
|
|
# if they don't have it, use the kernel module flags instead.
|
|
|
|
if [ ! -f $PCMCIA_SRC/include/linux/modversions.h ] ; then
|
|
|
|
PCMCIA_MODFLAGS="$KERNEL_MODFLAGS"
|
|
|
|
fi
|
|
|
|
dump_str "PCMCIA_MODFLAGS=$PCMCIA_MODFLAGS"
|
2002-09-04 14:36:11 -04:00
|
|
|
fi
|
2002-09-04 19:30:37 -04:00
|
|
|
|
2001-08-28 08:26:18 -04:00
|
|
|
fi
|
|
|
|
#=======================================================================
|
2000-04-26 13:40:31 -04:00
|
|
|
# Alternate target install root dir - the value of this variable
|
|
|
|
# will prefix other variables, such as modules and pcmcia directories
|
|
|
|
ask_str "Alternate target install root directory on host" TARGET_ROOT_ON_HOST
|
2000-01-13 09:44:20 -05:00
|
|
|
|
2002-05-14 13:13:51 -04:00
|
|
|
if [ $PRISM2_PCMCIA = "y" ] ; then
|
|
|
|
# PCMCIA script dir
|
|
|
|
ask_str "PCMCIA script directory" PCMCIA_DIR
|
|
|
|
TARGET_PCMCIA_DIR=$TARGET_ROOT_ON_HOST$PCMCIA_DIR
|
|
|
|
write_str TARGET_PCMCIA_DIR
|
|
|
|
fi
|
|
|
|
|
2000-04-26 13:40:31 -04:00
|
|
|
MODDIR=/lib/modules/$SRC_RELEASE
|
2000-01-13 09:44:20 -05:00
|
|
|
ask_str " Module install directory" MODDIR
|
2000-04-26 13:40:31 -04:00
|
|
|
TARGET_MODDIR=$TARGET_ROOT_ON_HOST$MODDIR
|
|
|
|
write_str TARGET_MODDIR
|
2000-07-06 00:40:21 -04:00
|
|
|
$ECHO ""
|
2000-01-13 09:44:20 -05:00
|
|
|
|
|
|
|
|
|
|
|
# Just write some out (we're not prompting right now)
|
|
|
|
write_str INST_EXEDIR
|
2000-04-26 13:40:31 -04:00
|
|
|
TARGET_INST_EXEDIR=$TARGET_ROOT_ON_HOST$INST_EXEDIR
|
|
|
|
write_str TARGET_INST_EXEDIR
|
2000-01-13 09:44:20 -05:00
|
|
|
|
|
|
|
#=======================================================================
|
|
|
|
|
|
|
|
# How should the startup scripts be configured?
|
|
|
|
|
2000-07-03 01:44:54 -04:00
|
|
|
SYSV_INIT=n
|
2000-01-13 09:44:20 -05:00
|
|
|
if [ "$PREFIX" = "" ] ; then
|
2001-08-28 08:26:18 -04:00
|
|
|
if [ -d /etc/rc.d/init.d -o -d /etc/init.d -o -d /sbin/init.d ] ; then
|
2000-03-31 11:18:57 -05:00
|
|
|
$ECHO "It looks like you have a System V init file setup."
|
2001-08-28 08:26:18 -04:00
|
|
|
SYSV_INIT=y
|
2000-01-13 09:44:20 -05:00
|
|
|
if [ -d /etc/rc.d/init.d ] ; then
|
2001-08-28 08:26:18 -04:00
|
|
|
$ECHO "RC_DIR=/etc/rc.d" >> $CONFIG
|
|
|
|
$ECHO "RC_DIR=/etc/rc.d" >> $CONFIG_MK
|
2000-01-13 09:44:20 -05:00
|
|
|
elif [ -d /sbin/init.d ] ; then
|
2001-08-28 08:26:18 -04:00
|
|
|
$ECHO "RC_DIR=/sbin" >> $CONFIG
|
|
|
|
$ECHO "RC_DIR=/sbin" >> $CONFIG_MK
|
2000-01-13 09:44:20 -05:00
|
|
|
else
|
2001-08-28 08:26:18 -04:00
|
|
|
$ECHO "RC_DIR=/etc" >> $CONFIG
|
|
|
|
$ECHO "RC_DIR=/etc" >> $CONFIG_MK
|
2000-01-13 09:44:20 -05:00
|
|
|
fi
|
2001-08-28 08:26:18 -04:00
|
|
|
else
|
2000-03-31 11:18:57 -05:00
|
|
|
$ECHO "It looks like you have a BSD-ish init file setup."
|
2000-01-13 09:44:20 -05:00
|
|
|
if ! grep rc.wlan /etc/rc.d/rc.S >/dev/null ; then
|
2001-08-28 08:26:18 -04:00
|
|
|
$ECHO " You'll need to edit /etc/rc.d/rc.S to invoke" \
|
2000-01-13 09:44:20 -05:00
|
|
|
"/etc/rc.d/rc.wlan (for ISA/PCMCIA cards)"
|
2001-08-28 08:26:18 -04:00
|
|
|
$ECHO " so that wlan cards will be started at boot time."
|
2000-01-13 09:44:20 -05:00
|
|
|
fi
|
2000-07-03 01:44:54 -04:00
|
|
|
SYSV_INIT=n
|
2001-08-28 08:26:18 -04:00
|
|
|
fi
|
|
|
|
write_bool SYSV_INIT
|
2000-01-13 09:44:20 -05:00
|
|
|
else
|
2001-08-28 08:26:18 -04:00
|
|
|
ask_bool "System V init script layout" SYSV_INIT
|
|
|
|
if [ "$SYSV_INIT" = "y" ] ; then
|
2000-01-13 09:44:20 -05:00
|
|
|
ask_str "Top-level directory for RC scripts" RC_DIR
|
2001-08-28 08:26:18 -04:00
|
|
|
fi
|
2000-01-13 09:44:20 -05:00
|
|
|
fi
|
2001-08-28 08:26:18 -04:00
|
|
|
|
2000-04-26 13:40:31 -04:00
|
|
|
if [ ! -x $TARGET_ROOT_ON_HOST/sbin/depmod ] ; then INSTALL_DEPMOD=n ; fi
|
2000-01-13 09:44:20 -05:00
|
|
|
write_bool INSTALL_DEPMOD
|
|
|
|
|
2000-03-31 11:18:57 -05:00
|
|
|
$ECHO ""
|
2000-03-13 14:43:32 -05:00
|
|
|
|
2000-03-13 21:11:09 -05:00
|
|
|
#=======================================================================
|
2000-04-26 13:40:31 -04:00
|
|
|
# Make sure our target architecture is correct
|
2000-03-13 21:11:09 -05:00
|
|
|
|
2000-07-06 00:40:21 -04:00
|
|
|
$ECHO ""
|
|
|
|
|
2000-04-26 13:40:31 -04:00
|
|
|
ask_str "Prefix for build host compiler? (rarely needed)" HOST_COMPILE
|
2002-09-11 14:08:32 -04:00
|
|
|
dump_str "HOST_CFLAGS=$HOST_CFLAGS"
|
2000-04-26 13:40:31 -04:00
|
|
|
|
2000-07-06 00:40:21 -04:00
|
|
|
$ECHO ""
|
|
|
|
|
2000-04-26 13:40:31 -04:00
|
|
|
dump_str 'HOST_AS=$(HOST_COMPILE)as'
|
|
|
|
dump_str 'HOST_LD=$(HOST_COMPILE)ld'
|
|
|
|
dump_str 'HOST_CC=$(HOST_COMPILE)gcc'
|
|
|
|
dump_str 'HOST_CPP=$(HOST_CC) -E'
|
|
|
|
dump_str 'HOST_AR=$(HOST_COMPILE)ar'
|
|
|
|
dump_str 'HOST_NM=$(HOST_COMPILE)nm'
|
|
|
|
dump_str 'HOST_STRIP=$(HOST_COMPILE)strip'
|
|
|
|
dump_str 'HOST_OBJCOPY=$(HOST_COMPILE)objcopy'
|
|
|
|
dump_str 'HOST_OBJDUMP=$(HOST_COMPILE)objdump'
|
2000-07-06 00:40:21 -04:00
|
|
|
dump_str 'HOST_RANLIB=$(HOST_COMPILE)ranlib'
|
2000-04-26 13:40:31 -04:00
|
|
|
dump_str 'HOST_MAKE=make'
|
|
|
|
|
2002-09-11 14:08:32 -04:00
|
|
|
CROSS_COMPILE_ENABLED=y
|
|
|
|
if [ "_$CROSS_COMPILE" = "_" ] ; then
|
|
|
|
CROSS_COMPILE_ENABLED=n
|
2000-07-05 00:57:04 -04:00
|
|
|
fi
|
|
|
|
|
2002-09-11 14:08:32 -04:00
|
|
|
write_str CROSS_COMPILE
|
|
|
|
write_bool CROSS_COMPILE_ENABLED
|
2003-04-03 09:06:27 -05:00
|
|
|
#dump_str 'CFLAGS=-O2 -Wall -Wstrict-prototypes -pipe'
|
2002-09-11 14:08:32 -04:00
|
|
|
|
|
|
|
if [ "_$CROSS_COMPILE" = "_" ] ; then
|
|
|
|
dump_str 'AS=$(HOST_COMPILE)as'
|
|
|
|
dump_str 'LD=$(HOST_COMPILE)ld'
|
|
|
|
dump_str 'CC=$(HOST_COMPILE)gcc'
|
|
|
|
dump_str 'CPP=$(HOST_CC) -E'
|
|
|
|
dump_str 'AR=$(HOST_COMPILE)ar'
|
|
|
|
dump_str 'NM=$(HOST_COMPILE)nm'
|
|
|
|
dump_str 'STRIP=$(HOST_COMPILE)strip'
|
|
|
|
dump_str 'OBJCOPY=$(HOST_COMPILE)objcopy'
|
|
|
|
dump_str 'OBJDUMP=$(HOST_COMPILE)objdump'
|
|
|
|
dump_str 'RANLIB=$(HOST_COMPILE)ranlib'
|
|
|
|
dump_str 'MAKE=make'
|
2000-07-05 00:57:04 -04:00
|
|
|
else
|
2002-09-11 14:16:10 -04:00
|
|
|
dump_str "AS=$CROSS_COMPILE"as
|
|
|
|
dump_str "LD=$CROSS_COMPILE"ld
|
|
|
|
dump_str "CC=$CROSS_COMPILE"gcc
|
|
|
|
CC="$CROSS_COMPILE"gcc
|
|
|
|
dump_str "CPP=$CC -E"
|
|
|
|
dump_str "AR=$CROSS_COMPILE"ar
|
|
|
|
dump_str "NM=$CROSS_COMPILE"nm
|
|
|
|
dump_str "STRIP=$CROSS_COMPILE"strip
|
|
|
|
dump_str "OBJCOPY=$CROSS_COMPILE"objcopy
|
|
|
|
dump_str "OBJDUMP=$CROSS_COMPILE"objdump
|
|
|
|
dump_str "RANLIB=$CROSS_COMPILE"ranlib
|
|
|
|
dump_str "MAKE=make"
|
2000-07-05 00:57:04 -04:00
|
|
|
fi
|
2000-04-26 13:40:31 -04:00
|
|
|
|
2000-03-13 21:40:30 -05:00
|
|
|
#=======================================================================
|
2000-04-26 13:40:31 -04:00
|
|
|
# Should we build for debugging?
|
2000-03-13 21:40:30 -05:00
|
|
|
|
|
|
|
ask_bool "Build for debugging (see doc/config.debug)" WLAN_DEBUG
|
|
|
|
|
2000-07-06 00:40:21 -04:00
|
|
|
$ECHO ""
|
2000-01-13 09:44:20 -05:00
|
|
|
|
2003-05-12 17:31:24 -04:00
|
|
|
FIRMWARE_DIR="/etc/wlan/"
|
|
|
|
write_str FIRMWARE_DIR
|
|
|
|
|
|
|
|
|
2000-01-13 09:44:20 -05:00
|
|
|
mv $CONFIG config.out
|
|
|
|
|
2000-03-31 11:18:57 -05:00
|
|
|
$ECHO ""
|
|
|
|
$ECHO "Configuration successful."
|
|
|
|
$ECHO ""
|