aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/ext-toolchain.sh
Commit message (Collapse)AuthorAgeFilesLines
* ext-toolchain.sh: rework generated gcc wrapper Only append -L and ↵Jo-Philipp Wich2012-01-291-13/+44
| | | | | | -Wl,-rpath-link flags if the command line contains -l, -L, -shared or -static flags; this is needed to suppress "-rpath-link: linker input file unused because linking not done" on each cc invocation. SVN-Revision: 29946
* ext-toolchain.sh: support --wrap with src == destJo-Philipp Wich2012-01-291-3/+9
| | | | SVN-Revision: 29944
* ext-toolchain.sh: CONFIG_NLS -> CONFIG_BUILD_NLSJo-Philipp Wich2012-01-191-2/+2
| | | | SVN-Revision: 29782
* ext-toolchain.sh: fix typoJo-Philipp Wich2012-01-191-2/+1
| | | | SVN-Revision: 29781
* ext-toolchain.sh: add option to write .config Add a new --config option to ↵Jo-Philipp Wich2012-01-181-3/+137
| | | | | | | | | | generate a .config from a given toolchain, this allows for easy integration of external toolchains, e.g. ./scripts/ext-toolchain.sh --toolchain /opt/mips-2011.03 --cflags "-muclibc" --config atheros to setup a ready-to-compile atheros target using the external CodeSourcery toolchain. SVN-Revision: 29780
* ext-toolchain.sh: properly handle toolchains without sysroot supportJo-Philipp Wich2012-01-181-9/+6
| | | | SVN-Revision: 29772
* ext-toolchain.sh: - use GCC's own idea of the target name (-dumpmachine) - ↵Jo-Philipp Wich2012-01-181-21/+21
| | | | | | display help if called without args - add copyright foo - remove some leftover flag handling code SVN-Revision: 29769
* add ext-toolchain.sh, a utility for external toolchains The ext-toolchain.sh ↵Jo-Philipp Wich2012-01-181-0/+410
utility script implements various external toolchain tasks: * Testing of available features, like c++, soft-float or ipv6 support * Finding the libc implementation (uclibc or eglibc/glibc) * Inferring the GNU target name * Finding shared objects for packaging (libc, libpthread, ...) * Finding executables for packaging (ldd, gdbserver, ...) * Generating wrapper scripts for toolchain commands SVN-Revision: 29765
0DD; font-weight: bold } /* Literal.Number.Float */ .highlight .mh { color: #0000DD; font-weight: bold } /* Literal.Number.Hex */ .highlight .mi { color: #0000DD; font-weight: bold } /* Literal.Number.Integer */ .highlight .mo { color: #0000DD; font-weight: bold } /* Literal.Number.Oct */ .highlight .sa { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Affix */ .highlight .sb { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Backtick */ .highlight .sc { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Char */ .highlight .dl { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Delimiter */ .highlight .sd { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Doc */ .highlight .s2 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Double */ .highlight .se { color: #0044dd; background-color: #fff0f0 } /* Literal.String.Escape */ .highlight .sh { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Heredoc */ .highlight .si { color: #3333bb; background-color: #fff0f0 } /* Literal.String.Interpol */ .highlight .sx { color: #22bb22; background-color: #f0fff0 } /* Literal.String.Other */ .highlight .sr { color: #008800; background-color: #fff0ff } /* Literal.String.Regex */ .highlight .s1 { color: #dd2200; background-color: #fff0f0 } /* Literal.String.Single */ .highlight .ss { color: #aa6600; background-color: #fff0f0 } /* Literal.String.Symbol */ .highlight .bp { color: #003388 } /* Name.Builtin.Pseudo */ .highlight .fm { color: #0066bb; font-weight: bold } /* Name.Function.Magic */ .highlight .vc { color: #336699 } /* Name.Variable.Class */ .highlight .vg { color: #dd7700 } /* Name.Variable.Global */ .highlight .vi { color: #3333bb } /* Name.Variable.Instance */ .highlight .vm { color: #336699 } /* Name.Variable.Magic */ .highlight .il { color: #0000DD; font-weight: bold } /* Literal.Number.Integer.Long */
#
# Copyright (C) 2006-2010 OpenWrt.org
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
include $(INCLUDE_DIR)/image.mk

LOADER_MAKE := $(NO_TRACE_MAKE) -C lzma-loader KDIR=$(KDIR)
JFFS2BLOCK := $(KDIR)/jffs2.block
JFFS2MARK := $(KDIR)/jffs2.mark

define imgname
$(BIN_DIR)/$(IMG_PREFIX)-$(2)-$(patsubst jffs2-%,jffs2,$(1))
endef

VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux
fs_squash:=squashfs-only
fs_all:=all
fs_4k:=4k
fs_64k:=64k
fs_128k:=128k
ifeq ($(CONFIG_TARGET_ROOTFS_INITRAMFS),y)
	fs_squash:=initramfs
	fs_all:=initramfs
	fs_4k:=initramfs
	fs_64k:=initramfs
	fs_128k:=initramfs
	VMLINUX:=$(BIN_DIR)/$(IMG_PREFIX)-vmlinux-initramfs
endif

define Build/Clean
	$(LOADER_MAKE) clean
endef

define Image/Prepare
	cat $(KDIR)/vmlinux | $(STAGING_DIR_HOST)/bin/lzma e -si -so -eos -lc1 -lp2 -pb2 > $(KDIR)/vmlinux.lzma
	rm -f $(JFFS2BLOCK)
	touch $(JFFS2BLOCK)
	$(call prepare_generic_squashfs,$(JFFS2BLOCK))
	rm -f $(JFFS2MARK)
	touch $(JFFS2MARK)
	$(call add_jffs2_mark,$(JFFS2MARK))
endef

define Image/Build/Loader
	$(LOADER_MAKE) LOADER=loader-$(1).$(2) LOADER_DATA="" \
		LZMA_TEXT_START=$(3) LZMA_STARTUP_ORG=$(4) \
		CONFIG_PASS_KARGS=$(5) CONFIG_BOARD=$(6) \
		compile loader.$(2)
endef

define Image/Build/LZMAKernel
	$(LOADER_MAKE) TARGET_DIR=$(BIN_DIR) \
		LOADER=$(BIN_DIR)/$(IMG_PREFIX)-$(1)-ramfs.$(2) \
		LOADER_DATA=$(KDIR)/vmlinux.lzma \
		LZMA_TEXT_START=$(3) LZMA_STARTUP_ORG=$(4) \
		CONFIG_PASS_KARGS=$(5) CONFIG_BOARD=$(6) \
		compile loader.$(2)
endef

define Image/Build/LZMAKernel/Generic
	$(call Image/Build/LZMAKernel,$(1),$(2),0x80500000,0)
endef

define Image/Build/LZMAKernel/Admboot
	$(call Image/Build/LZMAKernel,$(1),$(2),0x80500000,0x6D8,y,$(1))
endef

define Image/Build/LZMAKernel/Cellvision
	$(call Image/Build/LZMAKernel,$(1),$(3),0x80500000,0x6D8,y,$(2))
endef

define Image/Build/LZMAKernel/KArgs
	$(call Image/Build/LZMAKernel,$(1),$(2),0x80500000,0,y,$(1))
endef

define trxalign/jffs2-128k
-a 0x20000 -f $(KDIR)/root.jffs2-128k
endef

define trxalign/jffs2-64k
-a 0x10000 -f $(KDIR)/root.jffs2-64k
endef

define trxalign/squashfs
-a 1024 -f $(KDIR)/root.squashfs -a 0x10000 -A $(JFFS2BLOCK)
endef

define Image/Build/TRX
	$(STAGING_DIR_HOST)/bin/trx -o $(1) -f $(3) -f $(KDIR)/vmlinux.lzma \
		$(call trxalign/$(2))
endef

define Image/Build/TRXNoloader
	$(STAGING_DIR_HOST)/bin/trx -o $(1) -f $(KDIR)/vmlinux.lzma \
		$(call trxalign/$(2))
endef

include $(SUBTARGET).mk

define Image/Build
	$(call Image/Build/Profile/$(PROFILE),$(1))
endef

define Image/Build/Initramfs
	$(call Image/Build/Profile/$(PROFILE),Initramfs)
endef

define Image/BuildKernel
	cp $(KDIR)/vmlinux.elf $(VMLINUX).elf
	cp $(KDIR)/vmlinux $(VMLINUX).bin
endef

$(eval $(call BuildImage))