#!/usr/bin/env bash
DIR="$1"
if [ -d "$DIR" ]; then
DIR="$(cd "$DIR"; pwd)"
else
echo "Usage: $0 toolchain-dir"
exit 1
fi
echo -n "Locating cpp ... "
for bin in bin usr/bin usr/local/bin; do
for cmd in "$DIR/$bin/"*-cpp; do
if [ -x "$cmd" ]; then
echo "$cmd"
CPP="$cmd"
break
fi
done
done
if [ ! -x "$CPP" ]; then
echo "Can't locate a cpp executable in '$DIR' !"
exit 1
fi
patch_specs() {
local found=0
for lib in $(STAGING_DIR="$DIR" "$CPP" -x c -v /dev/null 2>&1 | sed -ne 's#:# #g; s#^LIBRARY_PATH=##p'); do
if [ -d "$lib" ]; then
grep -qs "STAGING_DIR" "$lib/specs" && rm -f "$lib/specs"
if [ $found -lt 1 ]; then
echo -n "Patching specs ... "
STAGING_DIR="$DIR" "$CPP" -dumpspecs | awk '
mode ~ "link" {
sub(/(%@?\{L.\})/, "& -L %:getenv(STAGING_DIR /usr/lib) -rpath-link %:getenv(STAGING_DIR /usr/lib)")
}
mode ~ "cpp" {
$0 = $0 " -idirafter %:getenv(STAGING_DIR /usr/include)"
}
{
print $0
mode = ""
}
/^\*cpp:/ {
mode = "cpp"
}
/^\*link.*:/ {
mode = "link"
}
' > "$lib/specs"
echo "ok"
found=1
fi
fi
done
[ $found -gt 0 ]
return $?
}
VERSION="$(STAGING_DIR="$DIR" "$CPP" --version | sed -ne 's/^.* (.*) //; s/ .*$//; 1p')"
VERSION="${VERSION:-unknown}"
case "${VERSION##* }" in
2.*|3.*|4.0.*|4.1.*|4.2.*)
echo "The compiler version does not support getenv() in spec files."
echo -n "Wrapping binaries instead ... "
if "${0%/*}/ext-toolchain.sh" --toolchain "$DIR" --wrap "${CPP%/*}"; then
echo "ok"
exit 0
else
echo "failed"
exit $?
fi
;;
*)
if patch_specs; then
echo "Toolchain successfully patched."
exit 0
else
echo "Failed to locate library directory!"
exit 1
fi
;;
esac
'/cgit/openwrt/upstream/'>summaryrefslogtreecommitdiffstats
blob: 7b1c6635674b6b9fc1de39a4e173bccdc13b3462 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
|
#
# Copyright (C) 2006-2008 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
WIRELESS_MENU:=Wireless Drivers
define KernelPackage/net-prism54
SUBMENU:=$(WIRELESS_MENU)
TITLE:=Intersil Prism54 support
DEPENDS:=@PCI_SUPPORT +@DRIVER_WEXT_SUPPORT +prism54-firmware
KCONFIG:=CONFIG_PRISM54
FILES:= \
$(LINUX_DIR)/drivers/net/wireless/prism54/prism54.ko@lt4.5 \
$(LINUX_DIR)/drivers/net/wireless/intersil/prism54/prism54.ko@ge4.5
AUTOLOAD:=$(call AutoProbe,prism54)
endef
define KernelPackage/net-prism54/description
Kernel modules for Intersil Prism54 support
endef
$(eval $(call KernelPackage,net-prism54))
define KernelPackage/net-rtl8192su
SUBMENU:=$(WIRELESS_MENU)
TITLE:=RTL8192SU support (staging)
DEPENDS:=@USB_SUPPORT +@DRIVER_WEXT_SUPPORT +kmod-usb-core +rtl8192su-firmware
KCONFIG:=\
CONFIG_STAGING=y \
CONFIG_R8712U
FILES:=$(LINUX_DIR)/drivers/staging/rtl8712/r8712u.ko
AUTOLOAD:=$(call AutoProbe,r8712u)
endef
define KernelPackage/net-rtl8192su/description
Kernel modules for RealTek RTL8712 and RTL81XXSU fullmac support.
endef
$(eval $(call KernelPackage,net-rtl8192su))
define KernelPackage/owl-loader
SUBMENU:=$(WIRELESS_MENU)
TITLE:=Owl loader for initializing Atheros PCI(e) Wifi chips
DEPENDS:=@PCI_SUPPORT
KCONFIG:=CONFIG_OWL_LOADER
FILES:=$(LINUX_DIR)/drivers/misc/owl-loader.ko
AUTOLOAD:=$(call AutoProbe,owl-loader)
endef
define KernelPackage/owl-loader/description
Kernel module that helps to initialize certain Qualcomm
Atheros' PCI(e) Wifi chips, which have the init data
(which contains the PCI device ID for example) stored
together with the calibration data in the file system.
This is necessary for devices like the Cisco Meraki Z1.
endef
$(eval $(call KernelPackage,owl-loader))
|