Made modifications to Makefiles to handle the cross compile of the driver source and the compile of the "mkmeta" executables to use the host compiler. Changed a few intalls (soft link in particular of prism2_cs) and a few minor changes to the Configure script and config.in.

This commit is contained in:
joellen 2000-04-26 17:40:31 +00:00
parent eadf0ade3a
commit cd03cb5650
16 changed files with 239 additions and 68 deletions

View File

@ -87,6 +87,12 @@ write_str () {
$ECHO "$1=$value" >> $CONFIG_MK
}
dump_str () {
$ECHO "$1" >> $CONFIG
$ECHO "$1" >> $CONFIG_MK
}
prompt () {
eval $3=\"$2\"
if [ "$PROMPT" = "y" ] ; then
@ -119,7 +125,7 @@ ask_str () {
#=======================================================================
$ECHO ""
$ECHO "---------------- Linux WLAN Configuration Script -------------"
$ECHO "-------------- Linux WLAN NG Configuration Script -------------"
$ECHO ""
$ECHO "The default responses are correct for most users."
$ECHO ""
@ -161,7 +167,11 @@ if [ "$SRC_RELEASE" != "$CUR_RELEASE" ] ; then
$ECHO "WARNING: the current kernel is actually version $CUR_RELEASE."
fi
BUILD_ARCH=`uname -m | sed -e 's/i.86/i386/'`
if [ ! "$WLAN_TARGET_ARCH" ] ; then
BUILD_ARCH=`uname -m | sed -e 's/i.86/i386/'`
else
BUILD_ARCH=$WLAN_TARGET_ARCH
fi
# Check for consistent kernel build dates
@ -184,36 +194,43 @@ fi
$ECHO ""
# PCMCIA Source dir
PCMCIA_SRC=`/sbin/cardctl -V 2>&1 | sed -e 's/cardctl version //'`
PCMCIA_SRC=/usr/src/pcmcia-cs-$PCMCIA_SRC
if [ ! "$PCMCIA_SRC" ] ; then
PCMCIA_SRC=`/sbin/cardctl -V 2>&1 | sed -e 's/cardctl version //'`
PCMCIA_SRC=/usr/src/pcmcia-cs-$PCMCIA_SRC
fi
ask_str "pcmcia-cs source dir" PCMCIA_SRC
# Alternate install dir
ask_str "Alternate target install directory" PREFIX
DESTDIR=$PREFIX
write_str DESTDIR
# 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
# Start looking for the destination module dir
MODDIR=$MODULES_DIR
if [ ! "$MODDIR" ] ; then
if [ -d /lib/modules/preferred ] ; then
MODDIR=/lib/modules/preferred
else
MODDIR=/lib/modules/$SRC_RELEASE
fi
else
MODDIR=`$ECHO $MODDIR | \
sed -e "s/[0-9]\.[0-9]\.[0-9]*\(-[A-Za-z0-9]*\)*.*/$SRC_RELEASE/"`
fi
#MODDIR=$MODULES_DIR
#if [ ! "$MODDIR" ] ; then
# if [ -d /lib/modules/preferred ] ; then
# MODDIR=/lib/modules/preferred
# else
# MODDIR=/lib/modules/$SRC_RELEASE
# fi
#else
# MODDIR=`$ECHO $MODDIR | \
# sed -e "s/[0-9]\.[0-9]\.[0-9]*\(-[A-Za-z0-9]*\)*.*/$SRC_RELEASE/"`
#fi
MODDIR=/lib/modules/$SRC_RELEASE
ask_str " Module install directory" MODDIR
MODULES_DIR=$MODDIR
write_str MODULES_DIR
TARGET_MODDIR=$TARGET_ROOT_ON_HOST$MODDIR
write_str TARGET_MODDIR
# PCMCIA script dir
ask_str "PCMCIA script directory" PCMCIA_DIR
TARGET_PCMCIA_DIR=$TARGET_ROOT_ON_HOST$PCMCIA_DIR
write_str TARGET_PCMCIA_DIR
# Just write some out (we're not prompting right now)
write_str INST_EXEDIR
TARGET_INST_EXEDIR=$TARGET_ROOT_ON_HOST$INST_EXEDIR
write_str TARGET_INST_EXEDIR
#=======================================================================
@ -251,7 +268,7 @@ else
ask_str "Top-level directory for RC scripts" RC_DIR
fi
fi
if [ ! -x /sbin/depmod ] ; then INSTALL_DEPMOD=n ; fi
if [ ! -x $TARGET_ROOT_ON_HOST/sbin/depmod ] ; then INSTALL_DEPMOD=n ; fi
write_bool INSTALL_DEPMOD
$ECHO ""
@ -263,13 +280,40 @@ WLAN_INSTALL_TYPE=sta
ask_str "Install drivers as (sta or ap)" WLAN_INSTALL_TYPE
#=======================================================================
# Make sure our target architecture is the same as our build architecture.
# Make sure our target architecture is correct
WLAN_TARGET_ARCH=$BUILD_ARCH
ask_str "Target Architecture?(only change if cross-compiling)" WLAN_TARGET_ARCH
ask_str "Prefix for build host compiler? (rarely needed)" HOST_COMPILE
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'
dump_str 'HOST_MAKE=make'
ask_str "Prefix for cross compiler? (change if cross-compiling)" CROSS_COMPILE
dump_str 'CROSS_AS=$(CROSS_COMPILE)as'
dump_str 'CROSS_LD=$(CROSS_COMPILE)ld'
dump_str 'CROSS_CC=$(CROSS_COMPILE)gcc'
dump_str 'CROSS_CPP=$(CROSS_CC) -E'
dump_str 'CROSS_AR=$(CROSS_COMPILE)ar'
dump_str 'CROSS_NM=$(CROSS_COMPILE)nm'
dump_str 'CROSS_STRIP=$(CROSS_COMPILE)strip'
dump_str 'CROSS_OBJCOPY=$(CROSS_COMPILE)objcopy'
dump_str 'CROSS_OBJDUMP=$(CROSS_COMPILE)objdump'
dump_str 'CROSS_MAKE=make'
#=======================================================================
# Make sure our target architecture is the same as our build architecture.
# Should we build for debugging?
ask_bool "Build for debugging (see doc/config.debug)" WLAN_DEBUG
@ -282,3 +326,5 @@ touch .prereq.ok
$ECHO ""
$ECHO "Configuration successful."
$ECHO ""

View File

@ -1,12 +1,14 @@
LINUX_SRC=/usr/src/linux
WLAN_TARGET_ARCH=
PCMCIA_SRC=
MODULES_DIR=
INST_EXEDIR=/sbin
DESTDIR=
PREFIX=
INST_EXEDIR=/sbin
TARGET_ROOT_ON_HOST=
RC_DIR=/etc/rc.d
PCMCIA_DIR=/etc/pcmcia
SYSV_INIT=y
INSTALL_DEPMOD=y
WLAN_INSTALL_TYPE=sta
WLAN_DEBUG=n
CROSS_COMPILE=/opt/hardhat/devkit/ppc/8xx/bin/powerpc-linux-
HOST_COMPILE=

View File

@ -51,23 +51,23 @@ clean:
echo "Nothing to do"
install:
if [ -f $(PCMCIA_DIR)/wlan-ng ]; then \
mv -f $(PCMCIA_DIR)/wlan-ng $(PCMCIA_DIR)/wlan-ng.O ; \
if [ -f $(TARGET_PCMCIA_DIR)/wlan-ng ]; then \
mv -f $(TARGET_PCMCIA_DIR)/wlan-ng $(TARGET_PCMCIA_DIR)/wlan-ng.O ; \
fi ; \
cp -p wlan-ng $(PCMCIA_DIR) ; \
chmod +x $(PCMCIA_DIR)/wlan-ng ; \
if [ -f $(PCMCIA_DIR)/wlan-ng.opts ]; then \
mv -f $(PCMCIA_DIR)/wlan-ng.opts $(PCMCIA_DIR)/wlan-ng.opts.O ; \
cp -p wlan-ng $(TARGET_PCMCIA_DIR) ; \
chmod +x $(TARGET_PCMCIA_DIR)/wlan-ng ; \
if [ -f $(TARGET_PCMCIA_DIR)/wlan-ng.opts ]; then \
mv -f $(TARGET_PCMCIA_DIR)/wlan-ng.opts $(TARGET_PCMCIA_DIR)/wlan-ng.opts.O ; \
fi ; \
cp -p wlan-ng.opts $(PCMCIA_DIR) ; \
chmod +x $(PCMCIA_DIR)/wlan-ng ; \
if [ -f $(PCMCIA_DIR)/wlan-ng.conf ]; then \
mv -f $(PCMCIA_DIR)/wlan-ng.conf $(PCMCIA_DIR)/wlan-ng.conf.O ; \
cp -p wlan-ng.opts $(TARGET_PCMCIA_DIR) ; \
chmod +x $(TARGET_PCMCIA_DIR)/wlan-ng ; \
if [ -f $(TARGET_PCMCIA_DIR)/wlan-ng.conf ]; then \
mv -f $(TARGET_PCMCIA_DIR)/wlan-ng.conf $(TARGET_PCMCIA_DIR)/wlan-ng.conf.O ; \
fi ; \
cp -p wlan-ng.conf $(PCMCIA_DIR) ; \
if ! grep -sq 'source.*\.\/\*\.conf$$' $(PCMCIA_DIR)/config ; then \
if ! grep -sq 'source \.\/wlan-ng.conf' $(PCMCIA_DIR)/config ; then \
mv -f $(PCMCIA_DIR)/config $(PCMCIA_DIR)/config.O ; \
( echo "source ./wlan-ng.conf"; cat $(PCMCIA_DIR)/config.O) > $(PCMCIA_DIR)/config ; \
cp -p wlan-ng.conf $(TARGET_PCMCIA_DIR) ; \
if ! grep -sq 'source.*\.\/\*\.conf$$' $(TARGET_PCMCIA_DIR)/config ; then \
if ! grep -sq 'source \.\/wlan-ng.conf' $(TARGET_PCMCIA_DIR)/config ; then \
mv -f $(TARGET_PCMCIA_DIR)/config $(TARGET_PCMCIA_DIR)/config.O ; \
( echo "source ./wlan-ng.conf"; cat $(TARGET_PCMCIA_DIR)/config.O) > $(TARGET_PCMCIA_DIR)/config ; \
fi ; \
fi

View File

@ -50,6 +50,6 @@ clean:
echo "Nothing to do"
install:
mkdir -p /etc/wlan
cp -p shared /etc/wlan/shared
mkdir -p $(TARGET_ROOT_ON_HOST)/etc/wlan
cp -p shared $(TARGET_ROOT_ON_HOST)/etc/wlan/shared

View File

@ -43,6 +43,17 @@
include ../../config.mk
AS =$(CROSS_AS)
LD =$(CROSS_LD)
CC =$(CROSS_CC)
CPP =$(CROSS_CPP)
AR =$(CROSS_AR)
NM =$(CROSS_NM)
STRIP =$(CROSS_STRIP)
OBJCOPY =$(CROSS_OBJCOPY)
OBJDUMP =$(CROSS_OBJDUMP)
MAKE =make
all:
@echo "Nothing to do..."

View File

@ -44,6 +44,17 @@
include ../../config.mk
AS =$(HOST_AS)
LD =$(HOST_LD)
CC =$(HOST_CC)
CPP =$(HOST_CPP)
AR =$(HOST_AR)
NM =$(HOST_NM)
STRIP =$(HOST_STRIP)
OBJCOPY =$(HOST_OBJCOPY)
OBJDUMP =$(HOST_OBJDUMP)
MAKE =make
# Implicit rules to handle the separate obj dirs
OBJ_DIR=obj

View File

@ -43,6 +43,17 @@
include ../../config.mk
AS =$(CROSS_AS)
LD =$(CROSS_LD)
CC =$(CROSS_CC)
CPP =$(CROSS_CPP)
AR =$(CROSS_AR)
NM =$(CROSS_NM)
STRIP =$(CROSS_STRIP)
OBJCOPY =$(CROSS_OBJCOPY)
OBJDUMP =$(CROSS_OBJDUMP)
MAKE =make
ifndef CFLAGS
CFLAGS = -O2 -Wall -Wstrict-prototypes -Winline -pipe
endif
@ -64,10 +75,10 @@ endif
nwepgen: nwepgen.o
cc -o nwepgen nwepgen.o
$(CC) -o nwepgen nwepgen.o
install:
cp -p nwepgen $(INST_EXEDIR)
cp -p nwepgen $(TARGET_INST_EXEDIR)
clean:
rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ nwepgen

View File

@ -43,6 +43,17 @@
include ../../config.mk
AS =$(CROSS_AS)
LD =$(CROSS_LD)
CC =$(CROSS_CC)
CPP =$(CROSS_CPP)
AR =$(CROSS_AR)
NM =$(CROSS_NM)
STRIP =$(CROSS_STRIP)
OBJCOPY =$(CROSS_OBJCOPY)
OBJDUMP =$(CROSS_OBJDUMP)
MAKE =make
# -E outputs preprocessed, just noted here because I forget
# Build options (just comment out the ones you don't want)
@ -67,9 +78,6 @@ P80211_OBJ= p80211conv.o \
MODULES=
MODULES+=$(P80211_MODULE)
# Install dir
MODDIR = $(DESTDIR)$(MODULES_DIR)
# Implicit rules to handle the separate obj dirs
OBJ_DIR=obj
@ -107,8 +115,8 @@ $(P80211_MODULE) : $(P80211_OBJ)
chmod -x $@
install : $(MODULES)
mkdir -p $(MODDIR)/net
cp -p $(P80211_MODULE) $(MODDIR)/net
mkdir -p $(TARGET_MODDIR)/net
cp -p $(P80211_MODULE) $(TARGET_MODDIR)/net
clean:
rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ tags

View File

@ -43,6 +43,17 @@
include ../../config.mk
AS =$(CROSS_AS)
LD =$(CROSS_LD)
CC =$(CROSS_CC)
CPP =$(CROSS_CPP)
AR =$(CROSS_AR)
NM =$(CROSS_NM)
STRIP =$(CROSS_STRIP)
OBJCOPY =$(CROSS_OBJCOPY)
OBJDUMP =$(CROSS_OBJDUMP)
MAKE =make
DIRS=driver download ridlist
ifneq ($(wildcard *.addon),)

View File

@ -43,6 +43,17 @@
include ../../../config.mk
AS =$(CROSS_AS)
LD =$(CROSS_LD)
CC =$(CROSS_CC)
CPP =$(CROSS_CPP)
AR =$(CROSS_AR)
NM =$(CROSS_NM)
STRIP =$(CROSS_STRIP)
OBJCOPY =$(CROSS_OBJCOPY)
OBJDUMP =$(CROSS_OBJDUMP)
MAKE =make
ifndef CFLAGS
CFLAGS = -g -O2 -Wall -Wstrict-prototypes -Winline -pipe
endif
@ -68,10 +79,10 @@ OBJS = prism2dl.o
prism2dl: $(OBJS)
cc -g -o prism2dl $(OBJS)
$(CC) -g -o prism2dl $(OBJS)
install:
cp -p prism2dl $(INST_EXEDIR)
cp -p prism2dl $(TARGET_INST_EXEDIR)
clean:
rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ tags

View File

@ -43,6 +43,17 @@
include ../../../config.mk
AS =$(CROSS_AS)
LD =$(CROSS_LD)
CC =$(CROSS_CC)
CPP =$(CROSS_CPP)
AR =$(CROSS_AR)
NM =$(CROSS_NM)
STRIP =$(CROSS_STRIP)
OBJCOPY =$(CROSS_OBJCOPY)
OBJDUMP =$(CROSS_OBJDUMP)
MAKE =make
# -E outputs preprocessed, just noted here because I forget
# Build options (just comment out the ones you don't want)
@ -74,9 +85,6 @@ MODULES=
MODULES+=$(STA_CS_MODULE)
MODULES+=$(AP_CS_MODULE)
# Install dir
MODDIR = $(DESTDIR)$(MODULES_DIR)
# Implicit rules to handle the separate obj dirs
$(OBJ_DIR)/%.o : ../shared/%.c
$(CC) -c $(CFLAGS) $(CPPFLAGS) $< -o $@
@ -123,11 +131,11 @@ $(AP_CS_MODULE) : $(AP_CS_OBJ)
chmod -x $@
install : $(MODULES)
cp -p $(MODULES) $(MODDIR)/pcmcia
cp -p $(MODULES) $(TARGET_MODDIR)/pcmcia
ifeq ($(WLAN_INSTALL_TYPE), ap)
ln -sf $(MODDIR)/pcmcia/$(AP_CS_MODULE) $(MODDIR)/pcmcia/prism2_cs.o
ln -sf $(MODDIR)/pcmcia/$(AP_CS_MODULE) $(TARGET_MODDIR)/pcmcia/prism2_cs.o
else
ln -sf $(MODDIR)/pcmcia/$(STA_CS_MODULE) $(MODDIR)/pcmcia/prism2_cs.o
ln -sf $(MODDIR)/pcmcia/$(STA_CS_MODULE) $(TARGET_MODDIR)/pcmcia/prism2_cs.o
endif
clean:

View File

@ -44,6 +44,17 @@
include ../../../config.mk
AS =$(CROSS_AS)
LD =$(CROSS_LD)
CC =$(CROSS_CC)
CPP =$(CROSS_CPP)
AR =$(CROSS_AR)
NM =$(CROSS_NM)
STRIP =$(CROSS_STRIP)
OBJCOPY =$(CROSS_OBJCOPY)
OBJDUMP =$(CROSS_OBJDUMP)
MAKE =make
# Implicit rules to handle the separate obj dirs
OBJ_DIR=obj

View File

@ -43,6 +43,17 @@
include ../../config.mk
AS =$(CROSS_AS)
LD =$(CROSS_LD)
CC =$(CROSS_CC)
CPP =$(CROSS_CPP)
AR =$(CROSS_AR)
NM =$(CROSS_NM)
STRIP =$(CROSS_STRIP)
OBJCOPY =$(CROSS_OBJCOPY)
OBJDUMP =$(CROSS_OBJDUMP)
MAKE =make
all:
@echo "Nothing to do..."

View File

@ -43,6 +43,17 @@
include ../../config.mk
AS =$(CROSS_AS)
LD =$(CROSS_LD)
CC =$(CROSS_CC)
CPP =$(CROSS_CPP)
AR =$(CROSS_AR)
NM =$(CROSS_NM)
STRIP =$(CROSS_STRIP)
OBJCOPY =$(CROSS_OBJCOPY)
OBJDUMP =$(CROSS_OBJDUMP)
MAKE =make
# -E outputs preprocessed, just noted here because I forget
# Build options (just comment out the ones you don't want)
@ -59,9 +70,6 @@ SKEL_OBJ= skeleton.o
MODULES=
MODULES+=$(SKEL_MODULE)
# Install dir
MODDIR = $(DESTDIR)$(MODULES_DIR)
# Implicit rules to handle the separate obj dirs
OBJ_DIR=obj
@ -99,8 +107,8 @@ $(SKEL_MODULE) : $(SKEL_OBJ)
chmod -x $@
install : $(MODULES)
mkdir -p $(MODDIR)/net
cp -p $(SKEL_MODULE) $(MODDIR)/pcmcia
mkdir -p $(TARGET_MODDIR)/net
cp -p $(SKEL_MODULE) $(TARGET_MODDIR)/pcmcia
clean:
touch .depend

View File

@ -46,6 +46,17 @@
include ../../config.mk
AS =$(CROSS_AS)
LD =$(CROSS_LD)
CC =$(CROSS_CC)
CPP =$(CROSS_CPP)
AR =$(CROSS_AR)
NM =$(CROSS_NM)
STRIP =$(CROSS_STRIP)
OBJCOPY =$(CROSS_OBJCOPY)
OBJDUMP =$(CROSS_OBJDUMP)
MAKE =make
ifndef CFLAGS
CFLAGS = -O2 -Wall -Wstrict-prototypes -Winline -pipe
endif
@ -82,10 +93,10 @@ OBJS = wlanctl.o \
wlanctl: $(OBJS)
cc -o wlanctl $(OBJS)
$(CC) -o wlanctl $(OBJS)
install:
cp -p wlanctl $(INST_EXEDIR)/wlanctl-ng
cp -p wlanctl $(TARGET_INST_EXEDIR)/wlanctl-ng
clean:
rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ tags

View File

@ -46,6 +46,17 @@
include ../../config.mk
AS =$(CROSS_AS)
LD =$(CROSS_LD)
CC =$(CROSS_CC)
CPP =$(CROSS_CPP)
AR =$(CROSS_AR)
NM =$(CROSS_NM)
STRIP =$(CROSS_STRIP)
OBJCOPY =$(CROSS_OBJCOPY)
OBJDUMP =$(CROSS_OBJDUMP)
MAKE =make
ifndef CFLAGS
CFLAGS = -O2 -Wall -Wstrict-prototypes -Winline -pipe
endif
@ -80,10 +91,10 @@ OBJS = wland.o \
wland: $(OBJS)
cc -o wland $(OBJS)
$(CC) -o wland $(OBJS)
install:
cp -p wland $(INST_EXEDIR)/wland
cp -p wland $(TARGET_INST_EXEDIR)/wland
clean:
rm -f core core.* *.o .*.o *.s *.a .depend tmp_make *~ tags