Commit 8c3145ba authored by Ryan Jackson's avatar Ryan Jackson
Browse files

Add toolchain Makefile

Added a makefile to build the toolchain via buildroot.  Everything now
depends on the toolchain having been built, so a simple 'make' should
build everything.

Added patches to change getline() to _getline() in Linux's and uClibc's
unifdef build utility.  This fixes compile errors on recent glibc
versions that define their own getline() function.
parent e118b507
......@@ -16,9 +16,9 @@ FAKEROOT_BIN = fakeroot
MODULES := busybox zlib linux dropbear testbed hdparm target_template sudo e2fsprogs openssl wget perl portmap file
#MODULES := busybox zlib linux dropbear testbed hdparm target_template sudo e2fsprogs openssl wget portmap file
INSTALL_MODULES := $(addsuffix -install,$(MODULES))
EXTRACT_MODULES := $(addsuffix -extract,$(MODULES))
PATCH_MODULES := $(addsuffix -patch,$(MODULES))
CLEAN_MODULES := $(addsuffix -clean,$(MODULES))
EXTRACT_MODULES := $(addsuffix -extract,$(MODULES) toolchain)
PATCH_MODULES := $(addsuffix -patch,$(MODULES) toolchain)
CLEAN_MODULES := $(addsuffix -clean,$(MODULES) toolchain)
.PHONY: all clean install root-template-install devices \
root-base root-install $(MODULES) $(INSTALL_MODULES) \
......@@ -37,7 +37,12 @@ clean:
rm -rf $(TARGET_BUILD_PATH)
rm -rf $(BOOT_PATH)
$(MODULES):
toolchain:
$(MAKE) -C $(SOURCE_PATH)/$@ all
$(MAKE) -C $(SOURCE_PATH)/zlib install-sysroot
$(MAKE) -C $(SOURCE_PATH)/openssl install
$(MODULES): toolchain
$(MAKE) -C $(SOURCE_PATH)/$@ all
$(CLEAN_MODULES):
......
include ../../variables.mk
BUILDROOT_CONFIG = $(SOURCE_PATH)/buildroot/buildroot.config.$(MFS_ARCH)
BUILDROOT_VERSION = 20081211
.PHONY: extract patch config toolchain
.PHONY: all clean
all: toolchain
clean:
rm -rf $(BUILDROOT_PATH)
extract: $(BUILDROOT_PATH)/.extract-stamp
patch: $(BUILDROOT_PATH)/.patch-stamp
config: $(BUILDROOT_PATH)/.config-stamp
toolchain: $(BUILDROOT_PATH)/.build-stamp
menuconfig:
$(MAKE) -C $(BUILDROOT_PATH) menuconfig
$(BUILDROOT_PATH)/.extract-stamp:
cd $(TOPDIR); tar xjf $(TARBALL_PATH)/buildroot-$(BUILDROOT_VERSION).tar.bz2
touch $@
$(BUILDROOT_PATH)/.patch-stamp: $(BUILDROOT_PATH)/.extract-stamp
$(SCRIPTS_PATH)/patch-kernel.sh $(BUILDROOT_PATH) $(SOURCE_PATH)/buildroot '*.patch'
cp $(SOURCE_PATH)/toolchain/linux*.patch $(BUILDROOT_PATH)/toolchain/kernel-headers
cp $(SOURCE_PATH)/toolchain/uClibc*.patch $(BUILDROOT_PATH)/toolchain/uClibc
touch $@
$(BUILDROOT_PATH)/.config-stamp: $(BUILDROOT_PATH)/.patch-stamp
cp $(BUILDROOT_CONFIG) $(BUILDROOT_PATH)/.config
$(MAKE) -C $(BUILDROOT_PATH) oldconfig
rmdir $(BUILDROOT_PATH)/dl || true
ln -s $(TARBALL_PATH) $(BUILDROOT_PATH)/dl
PATH=$(STAGING_DIR)/usr/bin:$(PATH) $(MAKE) -C $(BUILDROOT_PATH) oldconfig
touch $@
$(BUILDROOT_PATH)/.build-stamp: $(BUILDROOT_PATH)/.config-stamp
$(MAKE) -C $(BUILDROOT_PATH)
touch $@
--- linux-2.6.27.8/scripts/unifdef.c.orig 2010-02-25 11:13:25.000000000 -0700
+++ linux-2.6.27.8/scripts/unifdef.c 2010-02-25 11:13:46.000000000 -0700
@@ -206,7 +206,7 @@
static void error(const char *);
static int findsym(const char *);
static void flushline(bool);
-static Linetype getline(void);
+static Linetype _getline(void);
static Linetype ifeval(const char **);
static void ignoreoff(void);
static void ignoreon(void);
@@ -512,7 +512,7 @@
for (;;) {
linenum++;
- lineval = getline();
+ lineval = _getline();
trans_table[ifstate[depth]][lineval]();
debug("process %s -> %s depth %d",
linetype_name[lineval],
@@ -526,7 +526,7 @@
* help from skipcomment().
*/
static Linetype
-getline(void)
+_getline(void)
{
const char *cp;
int cursym;
--- uClibc-0.9.30/extra/scripts/unifdef.c.orig 2010-02-25 11:13:25.000000000 -0700
+++ uClibc-0.9.30/extra/scripts/unifdef.c 2010-02-25 11:13:46.000000000 -0700
@@ -206,7 +206,7 @@
static void error(const char *);
static int findsym(const char *);
static void flushline(bool);
-static Linetype getline(void);
+static Linetype _getline(void);
static Linetype ifeval(const char **);
static void ignoreoff(void);
static void ignoreon(void);
@@ -512,7 +512,7 @@
for (;;) {
linenum++;
- lineval = getline();
+ lineval = _getline();
trans_table[ifstate[depth]][lineval]();
debug("process %s -> %s depth %d",
linetype_name[lineval],
@@ -526,7 +526,7 @@
* help from skipcomment().
*/
static Linetype
-getline(void)
+_getline(void)
{
const char *cp;
int cursym;
......@@ -2,7 +2,7 @@ MFS_ARCH = i386
TOPDIR = $(PWD)
SOURCE_PATH = $(TOPDIR)/source
SCRIPTS_PATH = $(TOPDIR)/scripts
TOOLCHAIN_BUILD_PATH = $(TOPDIR)/toolchain_build
BUILDROOT_PATH = $(TOPDIR)/buildroot
TARBALL_PATH = $(TOPDIR)/tarballs
TARGET_BUILD_PATH = $(TOPDIR)/build
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment