adds native toolchain
authorJohn Crispin <john@openwrt.org>
Mon, 9 Jun 2008 21:29:40 +0000 (21:29 +0000)
committerJohn Crispin <john@openwrt.org>
Mon, 9 Jun 2008 21:29:40 +0000 (21:29 +0000)
SVN-Revision: 11421

devel/binutils/Makefile [new file with mode: 0644]
devel/build-essential/Makefile [new file with mode: 0644]
devel/build-essential/files/usr/src/hello/hello.c [new file with mode: 0644]
devel/gcc/Makefile [new file with mode: 0644]
devel/make/Makefile [new file with mode: 0644]
utils/binutils/Makefile [deleted file]
utils/make/Makefile [deleted file]

diff --git a/devel/binutils/Makefile b/devel/binutils/Makefile
new file mode 100644 (file)
index 0000000..99af8a3
--- /dev/null
@@ -0,0 +1,61 @@
+# 
+# Copyright (C) 2006 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=binutils
+PKG_VERSION:=$(strip $(subst ",, $(CONFIG_BINUTILS_VERSION)))
+#"))
+PKG_RELEASE:=1
+PKG_SOURCE_URL:=http://ftp.gnu.org/gnu/binutils/ \
+       ftp://gatekeeper.dec.com/pub/GNU/ \
+        ftp://ftp.uu.net/archive/systems/gnu/ \
+        ftp://ftp.eu.uu.net/pub/gnu/ \
+        ftp://ftp.funet.fi/pub/gnu/prep/ \
+        ftp://ftp.leo.org/pub/comp/os/unix/gnu/
+
+PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2
+PATCH_DIR:=$(TOPDIR)/toolchain/binutils/patches/$(PKG_VERSION)
+
+include $(INCLUDE_DIR)/package.mk
+
+CONFIGURE_ARGS_XTRA+=--disable-werror \
+               --disable-nls
+
+define Package/binutils
+  SECTION:=devel
+  CATEGORY:=Development
+  TITLE:=binutils
+  DEPENDS:=@TARGET_x86
+endef
+
+define Package/binutils/description
+  The Binutils package contains a linker, an assembler, and other tools for handling object files
+endef
+
+define Build/Configure
+       (cd  $(PKG_BUILD_DIR)/; \
+               $(TARGET_CONFIGURE_OPTS) \
+               $(CONFIGURE_VARS) \
+               $(CONFIGURE_CMD) \
+               $(CONFIGURE_ARGS_XTRA) \
+               $(CONFIGURE_ARGS) \
+       );
+endef
+
+define Build/Compile
+       make -C $(PKG_BUILD_DIR)/bfd/doc/ CFLAGS="-I$(PKG_BUILD_DIR)/include" chew
+       $(MAKE) -C $(PKG_BUILD_DIR) all
+       $(MAKE) -C $(PKG_BUILD_DIR) install DESTDIR=$(PKG_INSTALL_DIR)
+endef
+
+define Package/binutils/install
+       $(INSTALL_DIR) $(1)/usr
+       $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
+       $(CP) $(PKG_INSTALL_DIR)/usr/*-linux $(1)/usr
+endef
+
+$(eval $(call BuildPackage,binutils))
diff --git a/devel/build-essential/Makefile b/devel/build-essential/Makefile
new file mode 100644 (file)
index 0000000..f2b64d0
--- /dev/null
@@ -0,0 +1,32 @@
+# 
+# Copyright (C) 2008 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+# blogic@openwrt.org
+
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=build-essential
+PKG_RELEASE:=1
+PKG_VERSION:=1
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/build-essential
+  SECTION:=devel
+  CATEGORY:=Development
+  TITLE:=Build essentials 
+  DEPENDS=+gcc +make +binutils
+endef
+
+define Build/Compile
+
+endef
+
+define Package/build-essential/install
+    cp -r ./files/* $(1)
+endef
+
+$(eval $(call BuildPackage,build-essential))
diff --git a/devel/build-essential/files/usr/src/hello/hello.c b/devel/build-essential/files/usr/src/hello/hello.c
new file mode 100644 (file)
index 0000000..e693fd8
--- /dev/null
@@ -0,0 +1,8 @@
+#include <stdio.h>
+
+int main(int argc, char **argv)
+{
+       printf("Hello OpenWrt\n");
+
+       return 0;
+}
diff --git a/devel/gcc/Makefile b/devel/gcc/Makefile
new file mode 100644 (file)
index 0000000..95759fd
--- /dev/null
@@ -0,0 +1,90 @@
+# 
+# Copyright (C) 2008 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+PKG_NAME:=gcc
+PKG_VERSION:=$(strip $(subst ",, $(CONFIG_GCC_VERSION)))#"))
+PKG_RELEASE:=1
+PATCH_DIR=$(TOPDIR)/toolchain/gcc/patches/$(PKG_VERSION)
+PKG_SOURCE_URL:=ftp://ftp.fu-berlin.de/unix/languages/gcc/releases/gcc-$(PKG_VERSION) \
+    http://mirrors.rcn.net/pub/sourceware/gcc/releases/gcc-$(PKG_VERSION) \
+           ftp://ftp.gnu.org/gnu/gcc/releases/gcc-$(PKG_VERSION)
+
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MD5SUM:=354853e0b2da90c527e35aabb8d6f1e6
+
+include $(INCLUDE_DIR)/package.mk
+
+SEP:=,
+TARGET_LANGUAGES:="c$(if $(CONFIG_INSTALL_LIBSTDCPP),$(SEP)c++)$(if $(CONFIG_INSTALL_LIBGCJ),$(SEP)java)"
+EXTRA_TARGET=$(if $(CONFIG_EXTRA_TARGET_ARCH),--enable-biarch --enable-targets=$(call qstrip,$(CONFIG_EXTRA_TARGET_ARCH_NAME))-linux-uclibc)
+
+define Package/gcc
+  SECTION:=devel
+  CATEGORY:=Development
+  TITLE:=gcc
+  DEPENDS:=@TARGET_x86
+endef
+
+define Package/gcc/description
+       build a native toolchain for compiling on target
+endef
+
+define Build/Prepare
+       $(call Build/Prepare/Default)
+       $(SED) 's,\(version_string.. = "[0-9\.]*\).*\(";\),\1 (OpenWrt-2.0)\2,' $(PKG_BUILD_DIR)/gcc/version.c
+       $(SED) 's,\(bug_report_url.. = "\).*\(";\),\1<URL:https://dev.openwrt.org/>\2,' $(PKG_BUILD_DIR)/gcc/version.c
+       (cd $(PKG_BUILD_DIR)/libstdc++-v3; autoconf;);
+       $(SED) 's,gcc_no_link=yes,gcc_no_link=no,' $(PKG_BUILD_DIR)/libstdc++-v3/configure
+endef
+
+define Build/Configure
+       (cd $(PKG_BUILD_DIR); rm -f config.cache; \
+               SHELL="$(BASH)" \
+               $(TARGET_CONFIGURE_OPTS) \
+               $(PKG_BUILD_DIR)/configure \
+                       $(TARGET_CONFIGURE_ARGS) \
+                       --build=$(GNU_HOST_NAME) \
+                       --host=$(REAL_GNU_TARGET_NAME) \
+                       --target=$(REAL_GNU_TARGET_NAME) \
+                       --enable-languages=$(TARGET_LANGUAGES) \
+                       --enable-shared \
+                       --disable-__cxa_atexit \
+                       --enable-target-optspace \
+                       --with-gnu-ld \
+                       --disable-nls \
+                       --disable-libmudflap \
+                       --disable-multilib \
+                       $(EXTRA_TARGET) \
+                       $(SOFT_FLOAT_CONFIG_OPTION) \
+                       $(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \
+       );
+endef
+
+define Build/Compile
+       export SHELL="$(BASH)"; $(MAKE_VARS) $(MAKE) -C $(PKG_BUILD_DIR) \
+                       DESTDIR="$(PKG_INSTALL_DIR)" $(MAKE_ARGS) all install
+       # Set up the symlinks to enable lying about target name.
+       set -e; \
+       (cd $(TOOLCHAIN_DIR); \
+               ln -sf $(REAL_GNU_TARGET_NAME) $(GNU_TARGET_NAME); \
+               cd bin; \
+               for app in $(REAL_GNU_TARGET_NAME)-* ; do \
+                       ln -sf $$$${app} \
+                       $(GNU_TARGET_NAME)$$$${app##$(REAL_GNU_TARGET_NAME)}; \
+               done; \
+       );
+endef
+
+define Package/gcc/install
+       $(INSTALL_DIR) $(1)/usr/lib/
+       cp -r $(PKG_INSTALL_DIR)/* $(1)
+       cp -r $(TOOLCHAIN_DIR)/include $(1)/usr/
+       cp $(TOOLCHAIN_DIR)/lib/crt* $(1)/usr/lib/
+       cp $(TOOLCHAIN_DIR)/lib/libc.so $(1)/usr/lib/
+endef
+
+$(eval $(call BuildPackage,gcc))
diff --git a/devel/make/Makefile b/devel/make/Makefile
new file mode 100644 (file)
index 0000000..57dd155
--- /dev/null
@@ -0,0 +1,48 @@
+# 
+# Copyright (C) 2007 OpenWrt.org
+#
+# This is free software, licensed under the GNU General Public License v2.
+# See /LICENSE for more information.
+#
+include $(TOPDIR)/rules.mk
+
+PKG_NAME:=make
+PKG_VERSION:=3.81
+PKG_RELEASE:=1
+PKG_SOURCE_URL:=http://ftp.gnu.org/gnu/make/
+PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
+PKG_MD5SUM:=354853e0b2da90c527e35aabb8d6f1e6
+
+include $(INCLUDE_DIR)/package.mk
+
+define Package/make
+  SECTION:=devel
+  CATEGORY:=Development
+  TITLE:=make
+endef
+
+define Package/make/description
+       The Make package contains a program for compiling packages
+endef
+
+define Build/Configure
+       (cd  $(PKG_BUILD_DIR)/; \
+               $(TARGET_CONFIGURE_OPTS) \
+               $(CONFIGURE_VARS) \
+               $(CONFIGURE_CMD) \
+               $(CONFIGURE_ARGS_XTRA) \
+               $(CONFIGURE_ARGS) \
+       );
+endef
+
+define Build/Compile
+       $(MAKE) -C $(PKG_BUILD_DIR) all
+       $(MAKE) -C $(PKG_BUILD_DIR) install DESTDIR=$(PKG_INSTALL_DIR)
+endef
+
+define Package/make/install
+       $(INSTALL_DIR) $(1)/usr/bin
+       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/make $(1)/usr/bin/
+endef
+
+$(eval $(call BuildPackage,make))
diff --git a/utils/binutils/Makefile b/utils/binutils/Makefile
deleted file mode 100644 (file)
index ab9201e..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-# 
-# Copyright (C) 2006 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=binutils
-PKG_VERSION:=$(strip $(subst ",, $(CONFIG_BINUTILS_VERSION)))
-#"))
-PKG_RELEASE:=1
-PKG_SOURCE_URL:=http://ftp.gnu.org/gnu/binutils/ \
-       ftp://gatekeeper.dec.com/pub/GNU/ \
-        ftp://ftp.uu.net/archive/systems/gnu/ \
-        ftp://ftp.eu.uu.net/pub/gnu/ \
-        ftp://ftp.funet.fi/pub/gnu/prep/ \
-        ftp://ftp.leo.org/pub/comp/os/unix/gnu/ 
-
-PKG_SOURCE:=binutils-$(PKG_VERSION).tar.bz2
-PATCH_DIR:=$(TOPDIR)/toolchain/binutils/patches/$(PKG_VERSION)
-
-include $(INCLUDE_DIR)/package.mk
-
-CONFIGURE_ARGS_XTRA+=--disable-werror \
-               --disable-nls 
-
-define Package/binutils
-  SECTION:=utils
-  CATEGORY:=Utilities
-  TITLE:=binutils
-endef
-
-define Package/binutils/description
-  The Binutils package contains a linker, an assembler, and other tools for handling object files
-endef
-
-define Build/Configure
-       (cd  $(PKG_BUILD_DIR)/; \
-               $(TARGET_CONFIGURE_OPTS) \
-               $(CONFIGURE_VARS) \
-               $(CONFIGURE_CMD) \
-               $(CONFIGURE_ARGS_XTRA) \
-               $(CONFIGURE_ARGS) \
-       );
-endef
-
-define Build/Compile
-       make -C $(PKG_BUILD_DIR)/bfd/doc/ CFLAGS="-I$(PKG_BUILD_DIR)/include" chew
-       $(MAKE) -C $(PKG_BUILD_DIR) all
-       $(MAKE) -C $(PKG_BUILD_DIR) install DESTDIR=$(PKG_INSTALL_DIR)
-endef
-
-define Package/binutils/install
-       $(INSTALL_DIR) $(1)/usr
-       $(CP) $(PKG_INSTALL_DIR)/usr/bin/ $(1)/usr/
-       $(CP) $(PKG_INSTALL_DIR)/usr/*-linux $(1)/usr
-endef
-
-$(eval $(call BuildPackage,binutils))
diff --git a/utils/make/Makefile b/utils/make/Makefile
deleted file mode 100644 (file)
index 06153f1..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-# 
-# Copyright (C) 2007 OpenWrt.org
-#
-# This is free software, licensed under the GNU General Public License v2.
-# See /LICENSE for more information.
-#
-include $(TOPDIR)/rules.mk
-
-PKG_NAME:=make
-PKG_VERSION:=3.81
-PKG_RELEASE:=1
-PKG_SOURCE_URL:=http://ftp.gnu.org/gnu/make/
-PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.bz2
-PKG_MD5SUM:=354853e0b2da90c527e35aabb8d6f1e6
-
-include $(INCLUDE_DIR)/package.mk
-
-define Package/make
-  SECTION:=utils
-  CATEGORY:=Utilities
-  TITLE:=make
-endef
-
-define Package/make/description
-       The Make package contains a program for compiling packages
-endef
-
-define Build/Configure
-       (cd  $(PKG_BUILD_DIR)/; \
-               $(TARGET_CONFIGURE_OPTS) \
-               $(CONFIGURE_VARS) \
-               $(CONFIGURE_CMD) \
-               $(CONFIGURE_ARGS_XTRA) \
-               $(CONFIGURE_ARGS) \
-       );
-endef
-
-define Build/Compile
-       $(MAKE) -C $(PKG_BUILD_DIR) all
-       $(MAKE) -C $(PKG_BUILD_DIR) install DESTDIR=$(PKG_INSTALL_DIR)
-endef
-
-define Package/make/install
-       $(INSTALL_DIR) $(1)/usr/bin
-       $(INSTALL_BIN) $(PKG_INSTALL_DIR)/usr/bin/make $(1)/usr/bin/
-endef
-
-$(eval $(call BuildPackage,make))