From 696d51043ce93d463d08f42edd99aad86117e7f2 Mon Sep 17 00:00:00 2001 From: mark Date: Tue, 28 Aug 2001 12:26:18 +0000 Subject: [PATCH] Updates for handling pcmcia/pci/plx builds. We no longer require the presence of pcmcia-cs source when building for pci/plx. Additionally, if pcmcia isn't selected in Configure, the pcmcia source won't be looked for or prompted for. --- Configure | 192 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 98 insertions(+), 94 deletions(-) diff --git a/Configure b/Configure index 7327bd1..63a5107 100755 --- a/Configure +++ b/Configure @@ -91,11 +91,6 @@ if [ $# -gt 0 ] ; then fi fi -arg () { - VALUE="`$ECHO X"$2" | sed -e 's/^X--[a-zA-Z_]*=//'`" - eval $1=\"$VALUE\" -} - #======================================================================= CONFIG=config.new @@ -225,10 +220,10 @@ printf '\n' >> $versionh #======================================================================= # Dump the version variables -dump_str "WLAN_VERSION=$WLAN_VERSION" -dump_str "WLAN_PATCHLEVEL=$WLAN_PATCHLEVEL" -dump_str "WLAN_SUBLEVEL=$WLAN_SUBLEVEL" -dump_str "WLAN_EXTRAVERSION=$WLAN_EXTRAVERSION" +write_str WLAN_VERSION +write_str WLAN_PATCHLEVEL +write_str WLAN_SUBLEVEL +write_str WLAN_EXTRAVERSION # If the src/include/wlan/version.h file needs a touchup, fix or create it if [ -r src/include/wlan/version.h ]; then @@ -249,47 +244,67 @@ $ECHO "" $ECHO "The default responses are correct for most users." $ECHO "" +#======================================================================= +# Should we build for PCMCIA Card Services? + +ask_bool "Build Prism2.x PCMCIA Card Services (_cs) driver?" PRISM2_PCMCIA + +$ECHO "" +#======================================================================= +# Should we build for PLX??? based PCI adapters? + +ask_bool "Build Prism2 PLX???? based PCI (_plx) adapter driver?" PRISM2_PLX + +$ECHO "" +#======================================================================= +# Should we build for Prism2 native PCI? + +ask_bool "Build Prism2.5 native PCI (_pci) driver?" PRISM2_PCI + +$ECHO "" + +#======================================================================= # Collect the kernel source tree and test for sanity ask_str "Linux source directory" LINUX_SRC if [ ! -f $LINUX_SRC/Makefile ] ; then - $ECHO "Linux source tree $LINUX_SRC is incomplete or missing!" - if [ -d $LINUX_SRC/include/linux ] ; then + $ECHO "Linux source tree $LINUX_SRC is incomplete or missing!" + if [ -d $LINUX_SRC/include/linux ] ; then $ECHO " The kernel header files are present, but not " \ - "the full source code." - fi - $ECHO " See the HOWTO for a list of FTP sites for current" \ + "the full source code." + fi + $ECHO " See the HOWTO for a list of FTP sites for current" \ "kernel sources." - fail + fail fi # What kernel are we compiling for? version () { - expr $1 \* 65536 + $2 \* 256 + $3 + expr $1 \* 65536 + $2 \* 256 + $3 } $ECHO "" for TAG in VERSION PATCHLEVEL SUBLEVEL EXTRAVERSION ; do - eval `sed -ne "/^$TAG/s/[ ]//gp" $LINUX_SRC/Makefile` + eval `sed -ne "/^$TAG/s/[ ]//gp" $LINUX_SRC/Makefile` done SRC_RELEASE=$VERSION.$PATCHLEVEL.$SUBLEVEL$EXTRAVERSION VERSION_CODE=`version $VERSION $PATCHLEVEL $SUBLEVEL` $ECHO "The kernel source tree is version $SRC_RELEASE." -if [ $VERSION_CODE -lt `version 2 0 0` ] ; then - $ECHO "This package requires at least a 2.0 series kernel." - fail +if [ $VERSION_CODE -lt `version 2 2 0` ] ; then + $ECHO "This package requires at least a 2.2.x series kernel." + fail fi CUR_RELEASE=`uname -r` if [ "$SRC_RELEASE" != "$CUR_RELEASE" ] ; then - $ECHO "WARNING: the current kernel is actually version $CUR_RELEASE." + $ECHO "WARNING: the current kernel is actually version $CUR_RELEASE." fi if [ ! "$WLAN_TARGET_ARCH" ] ; then - BUILD_ARCH=`uname -m | sed -e 's/i.86/i386/'` + BUILD_ARCH=`uname -m | sed -e 's/i.86/i386/'` else - BUILD_ARCH=$WLAN_TARGET_ARCH + BUILD_ARCH=$WLAN_TARGET_ARCH fi # Check for consistent kernel build dates @@ -299,29 +314,57 @@ 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." UTS_VERSION="unknown"; if [ -f $LINUX_SRC/include/linux/compile.h ] ; then - UTS_VERSION=`grep UTS_VERSION $LINUX_SRC/include/linux/compile.h | + UTS_VERSION=`grep UTS_VERSION $LINUX_SRC/include/linux/compile.h | sed -e 's/.*"\(.*\)"/\1/'` - 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 + 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 $ECHO "WARNING: the source tree has a build date of $SRC_D." if [ `date -d "$SRC_D" +%s` -gt `date -d "$CUR_D" +%s` ] ; then - $ECHO " Did you forget to install your new kernel?!?" + $ECHO " Did you forget to install your new kernel?!?" + fi fi - fi fi $ECHO "" -# PCMCIA Source dir -if [ ! "$PCMCIA_SRC" ] ; then - 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 -fi -ask_str "pcmcia-cs source dir" PCMCIA_SRC +#======================================================================= +# If compiling for pcmcia-cs, find the PCMCIA source tree -$ECHO "" +if [ $PRISM2_PCMCIA = "y" ] ; then + if [ ! "$PCMCIA_SRC" ] ; then + 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 + fi + ask_str "pcmcia-cs source dir" PCMCIA_SRC + + if [ ! -f $PCMCIA_SRC/Makefile ] ; then + $ECHO "pcmcia-cs source tree $PCMCIA_SRC is incomplete or missing!" + $ECHO "The wlan driver for pcmcia cannot be built without " + #ECHO "the pcmcia-cs source tree present and configured." + fail + fi + if [ ! -f $PCMCIA_SRC/include/pcmcia/config.h ] ; then + $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 + fi + $ECHO "" + + # Should we build for Kernel based PCMCIA? + + ask_bool "Build for Kernel PCMCIA?" WLAN_KERN_PCMCIA + $ECHO "" + + # PCMCIA script dir + ask_str "PCMCIA script directory" PCMCIA_DIR + TARGET_PCMCIA_DIR=$TARGET_ROOT_ON_HOST$PCMCIA_DIR + write_str TARGET_PCMCIA_DIR + $ECHO "" +fi +#======================================================================= # 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 @@ -345,11 +388,6 @@ TARGET_MODDIR=$TARGET_ROOT_ON_HOST$MODDIR write_str TARGET_MODDIR $ECHO "" -# PCMCIA script dir -ask_str "PCMCIA script directory" PCMCIA_DIR -TARGET_PCMCIA_DIR=$TARGET_ROOT_ON_HOST$PCMCIA_DIR -write_str TARGET_PCMCIA_DIR -$ECHO "" # Just write some out (we're not prompting right now) write_str INST_EXEDIR @@ -362,50 +400,41 @@ write_str TARGET_INST_EXEDIR SYSV_INIT=n if [ "$PREFIX" = "" ] ; then - if [ -d /etc/rc.d/init.d -o -d /etc/init.d -o -d /sbin/init.d ] ; then + if [ -d /etc/rc.d/init.d -o -d /etc/init.d -o -d /sbin/init.d ] ; then $ECHO "It looks like you have a System V init file setup." - SYSV_INIT=n + SYSV_INIT=y if [ -d /etc/rc.d/init.d ] ; then - $ECHO "RC_DIR=/etc/rc.d" >> $CONFIG - $ECHO "RC_DIR=/etc/rc.d" >> $CONFIG_MK + $ECHO "RC_DIR=/etc/rc.d" >> $CONFIG + $ECHO "RC_DIR=/etc/rc.d" >> $CONFIG_MK elif [ -d /sbin/init.d ] ; then - $ECHO "RC_DIR=/sbin" >> $CONFIG - $ECHO "RC_DIR=/sbin" >> $CONFIG_MK + $ECHO "RC_DIR=/sbin" >> $CONFIG + $ECHO "RC_DIR=/sbin" >> $CONFIG_MK else - $ECHO "RC_DIR=/etc" >> $CONFIG - $ECHO "RC_DIR=/etc" >> $CONFIG_MK + $ECHO "RC_DIR=/etc" >> $CONFIG + $ECHO "RC_DIR=/etc" >> $CONFIG_MK fi - else + else $ECHO "It looks like you have a BSD-ish init file setup." if ! grep rc.wlan /etc/rc.d/rc.S >/dev/null ; then - $ECHO " You'll need to edit /etc/rc.d/rc.S to invoke" \ + $ECHO " You'll need to edit /etc/rc.d/rc.S to invoke" \ "/etc/rc.d/rc.wlan (for ISA/PCMCIA cards)" - $ECHO " so that wlan cards will be started at boot time." + $ECHO " so that wlan cards will be started at boot time." fi SYSV_INIT=n - fi - write_bool SYSV_INIT + fi + write_bool SYSV_INIT else - ask_bool "System V init script layout" SYSV_INIT - if [ "$SYSV_INIT" = "y" ] ; then + ask_bool "System V init script layout" SYSV_INIT + if [ "$SYSV_INIT" = "y" ] ; then ask_str "Top-level directory for RC scripts" RC_DIR - fi + fi fi + if [ ! -x $TARGET_ROOT_ON_HOST/sbin/depmod ] ; then INSTALL_DEPMOD=n ; fi write_bool INSTALL_DEPMOD $ECHO "" -#======================================================================= -# Make sure our target architecture is the same as our build architecture. -# -#if [ ! WLAN_INSTALL_TYPE ] ; then -# WLAN_INSTALL_TYPE=sta -#fi -#ask_str "Install drivers as station (sta) or access point (ap)?" WLAN_INSTALL_TYPE -# -#$ECHO "" - #======================================================================= # Make sure our target architecture is correct @@ -464,31 +493,6 @@ dump_str 'CROSS_MAKE=make' ask_bool "Build for debugging (see doc/config.debug)" WLAN_DEBUG $ECHO "" -#======================================================================= -# Should we build for Kernel based PCMCIA - -ask_bool "Build for Kernel PCMCIA?" WLAN_KERN_PCMCIA - -$ECHO "" -#======================================================================= -# Should we build for PLX??? based PCI adapters? - -ask_bool "Build Prism2 PLX???? based PCI (_plx) adapter drivers?" PRISM2_PLX - -$ECHO "" -#======================================================================= -# Should we build for PCMCIA Card Services? - -ask_bool "Build Prism2 PCMCIA Card Services (_cs) drivers?" PRISM2_PCMCIA - -$ECHO "" -#======================================================================= -# Should we build for Prism2 native PCI? - -ask_bool "Build Prism2 PCI (_pci) drivers?" PRISM2_PCI - -$ECHO "" -#======================================================================= mv $CONFIG config.out