# What sortof target system shall we compile this for?
ARCH:=i386
#ARCH:=arm
+#ARCH:=mipsel
+#ARCH:=mips
#ARCH:=powerpc
#ARCH:=whatever
#OPTIMIZE_FOR_CPU=strongarm
#OPTIMIZE_FOR_CPU=whatever
+# Soft floating point options.
+# Notes:
+# Currently builds with gcc 3.3 for i386, arm, mips, mipsel.
+# Only tested with multilib enabled.
+# For i386, long double is the same as double (64 bits). While this
+# is unusual for x86, it seemed the best approach considering the
+# limitations in the gcc floating point emulation library.
+# For arm, soft float uses the usual libfloat routines.
+# The uClibc built will support _only_ applications compiled with the
+# -msoft-float flag. To avoid CFLAGS problems, you may want to use
+# scripts similar to those in the build*/staging_dir/bin directory.
+# Uncomment the next 2 lines to build a soft-float toolchain and rootfs.
+# SOFT_FLOAT_CONFIG_OPTION=--without-float
+# TARGET_SOFT_FLOAT=-msoft-float
+
+TARGET_OPTIMIZATION=-Os
+TARGET_DEBUGGING= #-g
+TARGET_CFLAGS=$(TARGET_OPTIMIZATION) $(TARGET_DEBUGGING) $(TARGET_SOFT_FLOAT)
+
# Any additional gcc options you may want to include....
EXTRA_GCC_CONFIG_OPTIONS=
-#EXTRA_GCC_CONFIG_OPTIONS=--without-float
# Enable the following if you want locale/gettext/i18n support.
#ENABLE_LOCALE:=true
# what you are doing.
#
#############################################################
+ifeq ("$(strip $(TARGET_SOFT_FLOAT))","")
+ARCH_FPU_SUFFIX:=
+else
+ARCH_FPU_SUFFIX:=_nofpu
+endif
+
+
HOSTCC:=gcc
BASE_DIR:=${shell pwd}
SOURCE_DIR:=$(BASE_DIR)/sources
DL_DIR:=$(SOURCE_DIR)/dl
PATCH_DIR=$(SOURCE_DIR)/patches
-BUILD_DIR:=$(BASE_DIR)/build_$(ARCH)
+BUILD_DIR:=$(BASE_DIR)/build_$(ARCH)$(ARCH_FPU_SUFFIX)
TARGET_DIR:=$(BUILD_DIR)/root
STAGING_DIR=$(BUILD_DIR)/staging_dir
-TOOL_BUILD_DIR=$(BASE_DIR)/toolchain_build_$(ARCH)
+TOOL_BUILD_DIR=$(BASE_DIR)/toolchain_build_$(ARCH)$(ARCH_FPU_SUFFIX)
TARGET_PATH=$(STAGING_DIR)/bin:/bin:/sbin:/usr/bin:/usr/sbin
-TARGET_CROSS=$(STAGING_DIR)/bin/$(ARCH)-uclibc-
-TARGET_CC=$(TARGET_CROSS)gcc
+#TARGET_CROSS=$(STAGING_DIR)/bin/$(ARCH)-uclibc-
+TARGET_CROSS=$(STAGING_DIR)/bin/$(ARCH)-linux-
+TARGET_CC=$(TARGET_CROSS)gcc$(TARGET_SOFT_FLOAT)
STRIP=$(TARGET_CROSS)strip --remove-section=.comment --remove-section=.note
#STRIP:=/bin/true
-IMAGE:=$(BASE_DIR)/root_fs_$(ARCH)
+IMAGE:=$(BASE_DIR)/root_fs_$(ARCH)$(ARCH_FPU_SUFFIX)
GNU_TARGET_NAME=$(OPTIMIZE_FOR_CPU)-linux
-KERNEL_CROSS=$(STAGING_DIR)/bin/$(ARCH)-uclibc-
+#KERNEL_CROSS=$(STAGING_DIR)/bin/$(ARCH)-uclibc-
+KERNEL_CROSS=$(STAGING_DIR)/bin/$(ARCH)-linux-
HOST_ARCH:=$(shell $(HOSTCC) -dumpmachine | sed -e s'/-.*//' \
-e 's/sparc.*/sparc/' \
-e 's/arm.*/arm/g' \
AS=$(TARGET_CROSS)as \
LD=$(TARGET_CROSS)ld \
NM=$(TARGET_CROSS)nm \
- CC=$(TARGET_CROSS)gcc \
- GCC=$(TARGET_CROSS)gcc \
- CXX=$(TARGET_CROSS)g++ \
+ CC=$(TARGET_CROSS)gcc$(TARGET_SOFT_FLOAT) \
+ GCC=$(TARGET_CROSS)gcc$(TARGET_SOFT_FLOAT) \
+ CXX=$(TARGET_CROSS)g++$(TARGET_SOFT_FLOAT) \
RANLIB=$(TARGET_CROSS)ranlib
-#Directory in which to build the toolchain
-TOOL_BUILD_DIR=$(BASE_DIR)/toolchain_build_$(ARCH)
ifeq ($(ENABLE_LOCALE),true)
DISABLE_NLS:=
else
$(AUTOCONF_DIR)/.configured: $(AUTOCONF_DIR)/.unpacked
(cd $(AUTOCONF_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) EMACS="no" \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
$(AUTOMAKE_DIR)/.configured: $(AUTOMAKE_DIR)/.unpacked
(cd $(AUTOMAKE_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
$(BASH_DIR)/.configured: $(BASH_DIR)/.unpacked
(cd $(BASH_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) CC_FOR_BUILD=$(HOSTCC) \
+ CFLAGS="$(TARGET_CFLAGS)" \
ac_cv_func_setvbuf_reversed=no \
bash_cv_have_mbstate_t=yes \
./configure \
--with-sysroot=$(STAGING_DIR) \
--with-lib-path="$(STAGING_DIR)/usr/lib:$(STAGING_DIR)/lib" \
$(MULTILIB) \
- --program-prefix=$(ARCH)-uclibc-);
+ $(SOFT_FLOAT_CONFIG_OPTION) \
+ --program-prefix=$(ARCH)-linux-);
touch $(BINUTILS_DIR1)/.configured
$(BINUTILS_DIR1)/binutils/objdump: $(BINUTILS_DIR1)/.configured
for app in addr2line ar as c++filt gprof ld nm objcopy \
objdump ranlib readelf size strings strip ; \
do \
- if [ -x $(STAGING_DIR)/bin/$(ARCH)-uclibc-$${app} ] ; then \
+ if [ -x $(STAGING_DIR)/bin/$(ARCH)-linux-$${app} ] ; then \
(cd $(STAGING_DIR)/$(GNU_TARGET_NAME)/bin; \
- ln -fs ../../bin/$(ARCH)-uclibc-$${app} $${app}; \
+ ln -fs ../../bin/$(ARCH)-linux-$${app} $${app}; \
); \
(cd $(STAGING_DIR)/usr/bin; \
- ln -fs ../../bin/$(ARCH)-uclibc-$${app} $${app}; \
+ ln -fs ../../bin/$(ARCH)-linux-$${app} $${app}; \
); \
fi; \
done;
mkdir -p $(TARGET_DIR)/usr/$(GNU_TARGET_NAME)/
(cd $(BINUTILS_DIR2); \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
CC_FOR_BUILD=$(HOSTCC) \
CXX_FOR_BUILD=$(HOSTCC) \
AR_FOR_TARGET=$(TARGET_CROSS)ar \
AS_FOR_TARGET=$(TARGET_CROSS)as \
LD_FOR_TARGET=$(TARGET_CROSS)ld \
NM_FOR_TARGET=$(TARGET_CROSS)nm \
- CC_FOR_TARGET=$(TARGET_CROSS)gcc \
- GCC_FOR_TARGET=$(TARGET_CROSS)gcc \
- CXX_FOR_TARGET=$(TARGET_CROSS)g++ \
+ CC_FOR_TARGET=$(TARGET_CROSS)gcc$(TARGET_SOFT_FLOAT) \
+ GCC_FOR_TARGET=$(TARGET_CROSS)gcc$(TARGET_SOFT_FLOAT) \
+ CXX_FOR_TARGET=$(TARGET_CROSS)g++$(TARGET_SOFT_FLOAT) \
RANLIB_FOR_TARGET=$(TARGET_CROSS)ranlib \
$(BINUTILS_DIR)/configure \
--target=$(GNU_TARGET_NAME) \
--mandir=/usr/man \
--infodir=/usr/info \
$(MULTILIB) \
+ $(SOFT_FLOAT_CONFIG_OPTION) \
);
touch $(BINUTILS_DIR2)/.configured
AS_FOR_TARGET=$(TARGET_CROSS)as \
LD_FOR_TARGET=$(TARGET_CROSS)ld \
NM_FOR_TARGET=$(TARGET_CROSS)nm \
- CC_FOR_TARGET=$(TARGET_CROSS)gcc \
- GCC_FOR_TARGET=$(TARGET_CROSS)gcc \
- CXX_FOR_TARGET=$(TARGET_CROSS)g++ \
+ CC_FOR_TARGET=$(TARGET_CROSS)gcc$(TARGET_SOFT_FLOAT) \
+ GCC_FOR_TARGET=$(TARGET_CROSS)gcc$(TARGET_SOFT_FLOAT) \
+ CXX_FOR_TARGET=$(TARGET_CROSS)g++$(TARGET_SOFT_FLOAT) \
RANLIB_FOR_TARGET=$(TARGET_CROSS)ranlib
touch -c $(BINUTILS_DIR2)/binutils/objdump
AS_FOR_TARGET=$(TARGET_CROSS)as \
LD_FOR_TARGET=$(TARGET_CROSS)ld \
NM_FOR_TARGET=$(TARGET_CROSS)nm \
- CC_FOR_TARGET=$(TARGET_CROSS)gcc \
- GCC_FOR_TARGET=$(TARGET_CROSS)gcc \
- CXX_FOR_TARGET=$(TARGET_CROSS)g++ \
+ CC_FOR_TARGET=$(TARGET_CROSS)gcc$(TARGET_SOFT_FLOAT) \
+ GCC_FOR_TARGET=$(TARGET_CROSS)gcc$(TARGET_SOFT_FLOAT) \
+ CXX_FOR_TARGET=$(TARGET_CROSS)g++$(TARGET_SOFT_FLOAT) \
RANLIB_FOR_TARGET=$(TARGET_CROSS)ranlib \
prefix=/usr \
infodir=/usr/info \
$(BISON_DIR)/.configured: $(BISON_DIR)/.unpacked
(cd $(BISON_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
gt_cv_func_gnugettext2_libintl=yes \
./configure \
--target=$(GNU_TARGET_NAME) \
$(BRIDGE_BUILD_DIR)/.configured: $(BRIDGE_BUILD_DIR)/.unpacked
(cd $(BRIDGE_BUILD_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
ifeq ($(strip $(BUILD_WITH_LARGEFILE)),true)
perl -i -p -e "s/^.*DOLFS.*/DOLFS=y/;" $(BUSYBOX_DIR)/.config
endif
- $(MAKE) CROSS="$(TARGET_CROSS)" -C $(BUSYBOX_DIR) oldconfig
+ $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" -C $(BUSYBOX_DIR) oldconfig
else # Not using snapshot
cp $(BUSYBOX_CONFIG) $(BUSYBOX_DIR)/Config.h
perl -i -p -e "s,^CROSS.*,CROSS=$(TARGET_CROSS),;" $(BUSYBOX_DIR)/Makefile
busybox-unpack: $(BUSYBOX_DIR)/.configured
$(BUSYBOX_DIR)/busybox: $(BUSYBOX_DIR)/.configured
- $(MAKE) CROSS="$(TARGET_CROSS)" PREFIX="$(TARGET_DIR)" -C $(BUSYBOX_DIR)
+ $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" PREFIX="$(TARGET_DIR)" \
+ -C $(BUSYBOX_DIR)
$(TARGET_DIR)/bin/busybox: $(BUSYBOX_DIR)/busybox
- $(MAKE) CROSS="$(TARGET_CROSS)" PREFIX="$(TARGET_DIR)" -C $(BUSYBOX_DIR) install
+ $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" PREFIX="$(TARGET_DIR)" \
+ -C $(BUSYBOX_DIR) install
# Just in case
-chmod a+x $(TARGET_DIR)/usr/share/udhcpc/default.script
$(COREUTILS_DIR)/.configured: $(COREUTILS_DIR)/.unpacked
(cd $(COREUTILS_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
ln -fs test $(TARGET_DIR)/usr/bin/[
# gnu thinks chroot is in bin, debian thinks it's in sbin
mv $(TARGET_DIR)/usr/bin/chroot $(TARGET_DIR)/usr/sbin/chroot
+ $(STRIP) $(TARGET_DIR)/usr/sbin/chroot > /dev/null 2>&1
rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
$(DIFFUTILS_DIR)/.configured: $(DIFFUTILS_DIR)/.unpacked
(cd $(DIFFUTILS_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
$(DROPBEAR_SSHD_DIR)/.unpacked: $(DL_DIR)/$(DROPBEAR_SSHD_SOURCE)
$(DROPBEAR_SSHD_CAT) $(DL_DIR)/$(DROPBEAR_SSHD_SOURCE) | tar -C $(BUILD_DIR) -xvf -
+ $(SOURCE_DIR)/patch-kernel.sh $(DROPBEAR_SSHD_DIR) $(SOURCE_DIR) dropbear-*.patch
touch $(DROPBEAR_SSHD_DIR)/.unpacked
$(DROPBEAR_SSHD_DIR)/.configured: $(DROPBEAR_SSHD_DIR)/.unpacked
(cd $(DROPBEAR_SSHD_DIR); rm -rf config.cache; \
autoconf; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
touch $(DROPBEAR_SSHD_DIR)/.configured
$(DROPBEAR_SSHD_DIR)/$(DROPBEAR_SSHD_BINARY): $(DROPBEAR_SSHD_DIR)/.configured
- $(MAKE) CC=$(TARGET_CC) -C $(DROPBEAR_SSHD_DIR)
+ $(MAKE) $(TARGET_CONFIGURE_OPTS) LD=$(TARGET_CC) -C $(DROPBEAR_SSHD_DIR)
$(TARGET_DIR)/$(DROPBEAR_SSHD_TARGET_BINARY): $(DROPBEAR_SSHD_DIR)/$(DROPBEAR_SSHD_BINARY)
- $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(DROPBEAR_SSHD_DIR) install
+ $(MAKE) DESTDIR=$(TARGET_DIR) $(TARGET_CONFIGURE_OPTS) LD=$(TARGET_CC) \
+ -C $(DROPBEAR_SSHD_DIR) install
rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
dropbear_sshd: uclibc zlib $(TARGET_DIR)/$(DROPBEAR_SSHD_TARGET_BINARY)
dropbear_sshd-clean:
- $(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(DROPBEAR_SSHD_DIR) uninstall
+ $(MAKE) DESTDIR=$(TARGET_DIR) $(TARGET_CONFIGURE_OPTS) LD=$(TARGET_CC) \
+ -C $(DROPBEAR_SSHD_DIR) uninstall
-$(MAKE) -C $(DROPBEAR_SSHD_DIR) clean
dropbear_sshd-dirclean:
$(ED_DIR)/.configured: $(ED_DIR)/.unpacked
(cd $(ED_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
$(FILE_DIR)/.configured: $(FILE_DIR)/.unpacked
(cd $(FILE_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
$(TARGET_DIR)/$(FILE_TARGET_BINARY): $(FILE_DIR)/$(FILE_BINARY)
$(MAKE) $(TARGET_CONFIGURE_OPTS) DESTDIR=$(TARGET_DIR) -C $(FILE_DIR) install
+ -($(STRIP) $(TARGET_DIR)/usr/lib/libmagic.so.*.* > /dev/null 2>&1)
rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
$(FINDUTILS_DIR)/.configured: $(FINDUTILS_DIR)/.unpacked
(cd $(FINDUTILS_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
ac_cv_func_setvbuf_reversed=no \
./configure \
--target=$(GNU_TARGET_NAME) \
@if [ $(TARGET_DIR)/$(FINDUTILS_TARGET_BINARY) -ot $(FINDUTILS_DIR)/$(FINDUTILS_BINARY) ] ; then \
set -x; \
$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(FINDUTILS_DIR) install; \
+ $(STRIP) $(TARGET_DIR)/usr/lib/locate/* > /dev/null 2>&1; \
rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc; fi;
$(FLEX_DIR)/.configured: $(FLEX_DIR)/.unpacked
(cd $(FLEX_DIR); autoconf; rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
$(GAWK_DIR)/.configured: $(GAWK_DIR)/.unpacked
(cd $(GAWK_DIR); rm -rf config.cache; autoconf; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
ac_cv_func_getpgrp_void=yes \
./configure \
--target=$(GNU_TARGET_NAME) \
$(MAKE) DESTDIR=$(TARGET_DIR) CC=$(TARGET_CC) -C $(GAWK_DIR) install
rm -f $(TARGET_DIR)/usr/bin/gawk-*
(cd $(TARGET_DIR)/usr/bin; ln -sf gawk awk)
+ $(STRIP) $(TARGET_DIR)/usr/lib/awk/* > /dev/null 2>&1
rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
$(GCC_DIR)/.patched: $(GCC_DIR)/.unpacked
# Apply any files named gcc-*.patch from the source directory to gcc
$(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR) gcc-*.patch
+ifneq ("$(strip $(TARGET_SOFT_FLOAT))","")
+ifeq ("$(strip $(ARCH))","i386")
+ $(SOURCE_DIR)/patch-kernel.sh $(GCC_DIR) $(SOURCE_DIR) i386-gcc-soft-float.patch
+endif
+endif
touch $(GCC_DIR)/.patched
$(GCC_DIR)/.gcc3_3_build_hacks: $(GCC_DIR)/.patched
# # the step or libgcc will not build...
$(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.gcc3_3_build_hacks
mkdir -p $(GCC_BUILD_DIR1)
+ echo -e "#!/bin/sh\nexec $(GCC_BUILD_DIR1)/gcc/xgcc -B$(GCC_BUILD_DIR1)/gcc/ -B$(STAGING_DIR)/arm-linux/bin/ -B$(STAGING_DIR)/arm-linux/lib/ -isystem $(STAGING_DIR)/arm-linux/include $(TARGET_SOFT_FLOAT) \$$@" > $(GCC_BUILD_DIR1)/target_gcc
+ chmod a+x $(GCC_BUILD_DIR1)/target_gcc
(cd $(GCC_BUILD_DIR1); PATH=$(TARGET_PATH) AR=$(TARGET_CROSS)ar \
RANLIB=$(TARGET_CROSS)ranlib CC=$(HOSTCC) \
+ gcc_cv_as_hidden=no \
$(GCC_DIR)/configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_HOST_NAME) \
--oldincludedir=$(STAGING_DIR)/include $(MULTILIB) \
--enable-target-optspace $(DISABLE_NLS) --with-gnu-ld \
--disable-shared --enable-languages=c --disable-__cxa_atexit \
- $(EXTRA_GCC_CONFIG_OPTIONS) --program-prefix=$(ARCH)-uclibc-);
+ $(SOFT_FLOAT_CONFIG_OPTION) \
+ $(EXTRA_GCC_CONFIG_OPTIONS) --program-prefix=$(ARCH)-linux-);
touch $(GCC_BUILD_DIR1)/.configured
$(GCC_BUILD_DIR1)/.compiled: $(GCC_BUILD_DIR1)/.configured
PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR1) \
- AR_FOR_TARGET=$(STAGING_DIR)/bin/$(ARCH)-uclibc-ar \
- RANLIB_FOR_TARGET=$(STAGING_DIR)/bin/$(ARCH)-uclibc-ranlib
+ AR_FOR_TARGET=$(STAGING_DIR)/bin/$(ARCH)-linux-ar \
+ RANLIB_FOR_TARGET=$(STAGING_DIR)/bin/$(ARCH)-linux-ranlib \
+ CC_FOR_TARGET=$(GCC_BUILD_DIR1)/target_gcc \
+ GCC_FOR_TARGET=$(GCC_BUILD_DIR1)/target_gcc
touch $(GCC_BUILD_DIR1)/.compiled
-$(STAGING_DIR)/bin/$(ARCH)-uclibc-gcc: $(GCC_BUILD_DIR1)/.compiled
+$(STAGING_DIR)/bin/$(ARCH)-linux-gcc: $(GCC_BUILD_DIR1)/.compiled
PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR1) install;
#Cleanup then mess when --program-prefix mysteriously fails
- -mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-cpp $(STAGING_DIR)/bin/$(ARCH)-uclibc-cpp
- -mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-gcc $(STAGING_DIR)/bin/$(ARCH)-uclibc-gcc
+ -mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-cpp $(STAGING_DIR)/bin/$(ARCH)-linux-cpp
+ -mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-gcc $(STAGING_DIR)/bin/$(ARCH)-linux-gcc
+ if [ -n "$(strip $(TARGET_SOFT_FLOAT))" ] ; then \
+ for app in gcc c++ g++ ; do \
+ if [ -x $(STAGING_DIR)/bin/$(ARCH)-linux-$${app} ] ; then \
+ (cd $(STAGING_DIR)/bin; \
+ rm -f $(ARCH)-linux-$${app}$(TARGET_SOFT_FLOAT); \
+ echo -e "#!/bin/sh\nexec $(STAGING_DIR)/bin/$(ARCH)-linux-$${app} -msoft-float \$$@" > $(ARCH)-linux-$${app}$(TARGET_SOFT_FLOAT); \
+ chmod a+x $(ARCH)-linux-$${app}$(TARGET_SOFT_FLOAT); \
+ ); \
+ fi; \
+ done; \
+ fi; \
rm -f $(STAGING_DIR)/bin/gccbug $(STAGING_DIR)/bin/gcov
rm -rf $(STAGING_DIR)/info $(STAGING_DIR)/man $(STAGING_DIR)/share/doc \
$(STAGING_DIR)/share/locale
-gcc3_3_initial: binutils uclibc-configured $(STAGING_DIR)/bin/$(ARCH)-uclibc-gcc
+gcc3_3_initial: binutils uclibc-configured $(STAGING_DIR)/bin/$(ARCH)-linux-gcc
gcc3_3_initial-clean:
rm -rf $(GCC_BUILD_DIR1)
gcc3_3_initial-dirclean:
rm -rf $(GCC_BUILD_DIR1)
-
-
#############################################################
#
# second pass compiler build. Build the compiler targeting
$(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.g++_build_hacks
mkdir -p $(GCC_BUILD_DIR2)
+ #echo -e "#!/bin/sh\nexec $(GCC_BUILD_DIR2)/gcc/g++ -B$(GCC_BUILD_DIR2)/gcc/ -B$(STAGING_DIR)/arm-linux/bin/ -B$(STAGING_DIR)/arm-linux/lib/ -isystem $(STAGING_DIR)/arm-linux/include $(TARGET_SOFT_FLOAT) \$$@" > $(GCC_BUILD_DIR2)/target_g++
+ echo -e "#!/bin/sh\nexec $(GCC_BUILD_DIR2)/gcc/xgcc -B$(GCC_BUILD_DIR2)/gcc/ -B$(STAGING_DIR)/arm-linux/bin/ -B$(STAGING_DIR)/arm-linux/lib/ -isystem $(STAGING_DIR)/arm-linux/include $(TARGET_SOFT_FLOAT) \$$@" > $(GCC_BUILD_DIR2)/target_g++
+ chmod a+x $(GCC_BUILD_DIR2)/target_g++
+ echo -e "#!/bin/sh\nexec $(GCC_BUILD_DIR2)/gcc/xgcc -B$(GCC_BUILD_DIR2)/gcc/ -B$(STAGING_DIR)/arm-linux/bin/ -B$(STAGING_DIR)/arm-linux/lib/ -isystem $(STAGING_DIR)/arm-linux/include $(TARGET_SOFT_FLOAT) \$$@" > $(GCC_BUILD_DIR2)/target_gcc
+ chmod a+x $(GCC_BUILD_DIR2)/target_gcc
(cd $(GCC_BUILD_DIR2); PATH=$(TARGET_PATH) AR=$(TARGET_CROSS)ar \
RANLIB=$(TARGET_CROSS)ranlib LD=$(TARGET_CROSS)ld \
NM=$(TARGET_CROSS)nm CC=$(HOSTCC) \
+ gcc_cv_as_hidden=no \
$(GCC_DIR)/configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_HOST_NAME) \
--with-gnu-ld --disable-__cxa_atexit \
--enable-languages=$(TARGET_LANGUAGES) \
$(EXTRA_GCC_CONFIG_OPTIONS) \
- --program-prefix=$(ARCH)-uclibc- \
+ --program-prefix=$(ARCH)-linux- \
);
touch $(GCC_BUILD_DIR2)/.configured
$(GCC_BUILD_DIR2)/.compiled: $(GCC_BUILD_DIR2)/.configured
- PATH=$(TARGET_PATH) CC=$(HOSTCC) \
+ PATH=$(TARGET_PATH) $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR2) \
+ CC=$(HOSTCC) \
AR_FOR_TARGET=$(TARGET_CROSS)ar RANLIB_FOR_TARGET=$(TARGET_CROSS)ranlib \
LD_FOR_TARGET=$(TARGET_CROSS)ld NM_FOR_TARGET=$(TARGET_CROSS)nm \
- CC_FOR_TARGET=$(TARGET_CROSS)gcc $(MAKE) $(JLEVEL) -C $(GCC_BUILD_DIR2)
+ CC_FOR_TARGET=$(GCC_BUILD_DIR2)/target_gcc \
+ GCC_FOR_TARGET=$(GCC_BUILD_DIR2)/target_gcc \
+ CXX_FOR_TARGET=$(GCC_BUILD_DIR2)/target_g++
touch $(GCC_BUILD_DIR2)/.compiled
$(GCC_BUILD_DIR2)/.installed: $(GCC_BUILD_DIR2)/.compiled $(STAGING_DIR)/lib/libc.a
-mv $(STAGING_DIR)/bin/gcc $(STAGING_DIR)/usr/bin;
-mv $(STAGING_DIR)/bin/protoize $(STAGING_DIR)/usr/bin;
-mv $(STAGING_DIR)/bin/unprotoize $(STAGING_DIR)/usr/bin;
- -mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-cpp $(STAGING_DIR)/bin/$(ARCH)-uclibc-cpp
- -mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-gcc $(STAGING_DIR)/bin/$(ARCH)-uclibc-gcc
- -mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-c++ $(STAGING_DIR)/bin/$(ARCH)-uclibc-c++
- -mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-g++ $(STAGING_DIR)/bin/$(ARCH)-uclibc-g++
- -mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-c++filt $(STAGING_DIR)/bin/$(ARCH)-uclibc-c++filt
+ -mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-cpp $(STAGING_DIR)/bin/$(ARCH)-linux-cpp
+ -mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-gcc $(STAGING_DIR)/bin/$(ARCH)-linux-gcc
+ -mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-c++ $(STAGING_DIR)/bin/$(ARCH)-linux-c++
+ -mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-g++ $(STAGING_DIR)/bin/$(ARCH)-linux-g++
+ -mv $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-c++filt $(STAGING_DIR)/bin/$(ARCH)-linux-c++filt
rm -f $(STAGING_DIR)/bin/cpp $(STAGING_DIR)/bin/gcov $(STAGING_DIR)/bin/*gccbug
- rm -f $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-$(ARCH)-uclibc-*
+ rm -f $(STAGING_DIR)/bin/$(GNU_TARGET_NAME)-$(ARCH)-linux-*
rm -rf $(STAGING_DIR)/info $(STAGING_DIR)/man $(STAGING_DIR)/share/doc \
$(STAGING_DIR)/share/locale
# Strip the host binaries
-strip --strip-all -R .note -R .comment $(STAGING_DIR)/bin/*
+ if [ -n "$(strip $(TARGET_SOFT_FLOAT))" ] ; then \
+ for app in gcc c++ g++ ; do \
+ if [ -x $(STAGING_DIR)/bin/$(ARCH)-linux-$${app} ] ; then \
+ (cd $(STAGING_DIR)/bin; \
+ rm -f $(ARCH)-linux-$${app}$(TARGET_SOFT_FLOAT); \
+ echo -e "#!/bin/sh\nexec $(STAGING_DIR)/bin/$(ARCH)-linux-$${app} -msoft-float \$$@" > $(ARCH)-linux-$${app}$(TARGET_SOFT_FLOAT); \
+ chmod a+x $(ARCH)-linux-$${app}$(TARGET_SOFT_FLOAT); \
+ ); \
+ fi; \
+ done; \
+ fi; \
set -e; \
for app in cc gcc c89 cpp c++ g++ ; do \
- if [ -x $(STAGING_DIR)/bin/$(ARCH)-uclibc-$${app} ] ; then \
+ if [ -x $(STAGING_DIR)/bin/$(ARCH)-linux-$${app} ] ; then \
(cd $(STAGING_DIR)/usr/bin; \
- ln -fs ../../bin/$(ARCH)-uclibc-$${app} $${app}; \
+ ln -fs ../../bin/$(ARCH)-linux-$${app} $${app}; \
); \
fi; \
done;
$(TARGET_DIR)/lib/libgcc_s.so.0.9.9: $(GCC_BUILD_DIR2)/.installed
cp -a $(STAGING_DIR)/lib/libgcc_s.so* $(TARGET_DIR)/lib/
+ # Enable applications to link with the shared ligbcc.
+ ln -sf $(STAGING_DIR)/lib/libgcc_s.so $(STAGING_DIR)/usr/lib/gcc-lib/$(ARCH)-linux/$(GCC_VERSION)/libgcc.so
ifeq ($(INSTALL_LIBSTDCPP),true)
GCC_TARGETS= $(TARGET_DIR)/lib/libgcc_s.so.0.9.9 $(TARGET_DIR)/lib/libstdc++.so.5.0.5
endif
-gcc3_3: binutils uclibc-configured gcc3_3_initial uclibc \
+gcc3_3: binutils uclibc-configured gcc3_3_initial $(LIBFLOAT_TARGET) uclibc \
$(GCC_BUILD_DIR2)/.installed $(GCC_TARGETS)
gcc3_3-clean:
gcc3_3-dirclean:
rm -rf $(GCC_BUILD_DIR2)
-
-
-
-
-
#############################################################
#
# Next build target gcc compiler
#############################################################
GCC_BUILD_DIR3:=$(BUILD_DIR)/gcc-3.3-target
-ifeq ($(HOST_ARCH),$(ARCH))
-TARGET_GCC_ARGS=$(TARGET_CONFIGURE_OPTS) \
- AR_FOR_BUILD=ar \
- AS_FOR_BUILD=as \
- LD_FOR_BUILD=ld \
- NM_FOR_BUILD=nm \
- RANLIB_FOR_BUILD=ranlib \
- HOST_CC=$(HOSTCC) \
- CC_FOR_BUILD=$(HOSTCC) \
- GCC_FOR_BUILD=$(HOSTCC) \
- CXX_FOR_BUILD=$(HOSTCC) \
- AR_FOR_TARGET=$(TARGET_CROSS)ar \
- AS_FOR_TARGET=$(TARGET_CROSS)as \
- LD_FOR_TARGET=$(TARGET_CROSS)ld \
- NM_FOR_TARGET=$(TARGET_CROSS)nm \
- CC_FOR_TARGET=$(TARGET_CROSS)gcc \
- GCC_FOR_TARGET=$(TARGET_CROSS)gcc \
- CXX_FOR_TARGET=$(TARGET_CROSS)g++ \
- RANLIB_FOR_TARGET=$(TARGET_CROSS)ranlib
-else
-TARGET_GCC_ARGS=\
+TARGET_GCC_ARGS= $(TARGET_CONFIGURE_OPTS) \
AR_FOR_BUILD=ar \
AS_FOR_BUILD=as \
LD_FOR_BUILD=ld \
AS_FOR_TARGET=$(TARGET_CROSS)as \
LD_FOR_TARGET=$(TARGET_CROSS)ld \
NM_FOR_TARGET=$(TARGET_CROSS)nm \
- CC_FOR_TARGET=$(TARGET_CROSS)gcc \
- GCC_FOR_TARGET=$(TARGET_CROSS)gcc \
- CXX_FOR_TARGET=$(TARGET_CROSS)g++ \
+ CC="$(TARGET_CROSS)gcc$(TARGET_SOFT_FLOAT) -isystem $(STAGING_DIR)/include" \
+ GCC="$(TARGET_CROSS)gcc$(TARGET_SOFT_FLOAT) -isystem $(STAGING_DIR)/include" \
+ CXX="$(TARGET_CROSS)g++$(TARGET_SOFT_FLOAT) -isystem $(STAGING_DIR)/include" \
+ CC_FOR_TARGET="$(TARGET_CROSS)gcc$(TARGET_SOFT_FLOAT) -isystem $(STAGING_DIR)/include" \
+ GCC_FOR_TARGET="$(TARGET_CROSS)gcc$(TARGET_SOFT_FLOAT) -isystem $(STAGING_DIR)/include" \
+ CXX_FOR_TARGET="$(TARGET_CROSS)g++$(TARGET_SOFT_FLOAT) -isystem $(STAGING_DIR)/include" \
RANLIB_FOR_TARGET=$(TARGET_CROSS)ranlib
-endif
# We need to unpack a pristine source tree to avoid some of
# the previously applied hacks, which do not apply here...
$(GCC_BUILD_DIR3)/.patched: $(GCC_BUILD_DIR3)/.unpacked
# Apply any files named gcc-*.patch from the source directory to gcc
$(SOURCE_DIR)/patch-kernel.sh $(GCC_BUILD_DIR3) $(SOURCE_DIR) gcc-*.patch
+ifeq ("$(strip $(ARCH))","i386")
+ $(SOURCE_DIR)/patch-kernel.sh $(GCC_BUILD_DIR3) $(SOURCE_DIR) i386-gcc-*.patch
+endif
touch $(GCC_BUILD_DIR3)/.patched
$(GCC_BUILD_DIR3)/.gcc3_3_build_hacks: $(GCC_BUILD_DIR3)/.patched
$(GCC_BUILD_DIR3)/.configured: $(GCC_BUILD_DIR3)/.gcc3_3_build_hacks
mkdir -p $(GCC_BUILD_DIR3)
- (cd $(GCC_BUILD_DIR3); ln -fs $(ARCH)-linux build-$(GNU_TARGET_NAME))
+ #(cd $(GCC_BUILD_DIR3); ln -fs $(ARCH)-linux build-$(GNU_TARGET_NAME))
(cd $(GCC_BUILD_DIR3); \
$(TARGET_GCC_ARGS) \
+ gcc_cv_as_hidden=no \
./configure \
+ --verbose \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
- --build=$(ARCH)-linux \
+ --build=`./config.guess` \
--prefix=/usr \
--mandir=/usr/man \
--infodir=/usr/info \
--with-gxx-include-dir=/usr/include/c++/3.3 \
+ --enable-target-optspace \
--enable-shared \
$(MULTILIB) \
- --enable-target-optspace $(DISABLE_NLS) \
+ $(DISABLE_NLS) \
--with-gnu-ld --disable-__cxa_atexit \
--enable-languages=$(TARGET_LANGUAGES) \
$(EXTRA_GCC_CONFIG_OPTIONS) \
#-cp -a $(STAGING_DIR)/include/c++ $(TARGET_DIR)/usr/include/
-mv $(TARGET_DIR)/lib/*.a $(TARGET_DIR)/usr/lib/
-mv $(TARGET_DIR)/lib/*.la $(TARGET_DIR)/usr/lib/
- rm -f $(TARGET_DIR)/lib/libstdc++.so
- -(cd $(TARGET_DIR)/usr/lib; ln -fs /lib/libstdc++.so.5.0.5 libstdc++.so)
+ rm -f $(TARGET_DIR)/lib/libstdc++.so*
# A nasty hack to work around g++ adding -lgcc_eh to the link
-(cd $(TARGET_DIR)/usr/lib/gcc-lib/$(ARCH)-linux/$(GCC_VERSION)/ ; ln -s libgcc.a libgcc_eh.a)
# Make sure gcc does not think we are cross compiling
perl -i -p -e "s/^1/0/;" $(TARGET_DIR)/usr/lib/gcc-lib/$(ARCH)-linux/$(GCC_VERSION)/specs
-(cd $(TARGET_DIR)/bin; find -type f | xargs $(STRIP) > /dev/null 2>&1)
-(cd $(TARGET_DIR)/usr/bin; find -type f | xargs $(STRIP) > /dev/null 2>&1)
+ -(cd $(TARGET_DIR)/usr/lib/gcc-lib/$(ARCH)-linux/$(GCC_VERSION); $(STRIP) cc1 cc1plus collect2 > /dev/null 2>&1)
+ -(cd $(TARGET_DIR)/usr/lib; $(STRIP) libstdc++.so.*.*.* > /dev/null 2>&1)
+ -(cd $(TARGET_DIR)/lib; $(STRIP) libgcc_s.so.*.*.* > /dev/null 2>&1)
+ #
rm -f $(TARGET_DIR)/usr/lib/*.la*
rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
+ # Work around problem of missing syslimits.h
+ cp -f $(STAGING_DIR)/usr/lib/gcc-lib/$(ARCH)-linux/$(GCC_VERSION)/include/syslimits.h $(TARGET_DIR)/usr/lib/gcc-lib/$(ARCH)-linux/$(GCC_VERSION)/include/
+ # Enable applications to find the shared libgcc when linking (on target).
+ ln -sf $(TARGET_DIR)/lib/libgcc_s.so $(TARGET_DIR)/usr/lib/gcc-lib/$(ARCH)-linux/$(GCC_VERSION)/libgcc.so
+ (cd $(TARGET_DIR)/usr/lib/gcc-lib/$(ARCH)-linux/$(GCC_VERSION) ; ln -sf /lib/libgcc_s.so libgcc.so)
+ # These are in /lib, so...
+ rm -rf $(TARGET_DIR)/usr/lib/libgcc_s.so*
touch -c $(TARGET_DIR)/usr/bin/gcc
gcc3_3_target: uclibc_target binutils_target $(TARGET_DIR)/usr/bin/gcc
$(GDB_DIR)/.configured: $(GDB_DIR)/.unpacked
(cd $(GDB_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
ac_cv_type_uintptr_t=yes \
gt_cv_func_gettext_libintl=yes \
ac_cv_func_dcgettext=yes \
$(GNUGREP_DIR)/.configured: $(GNUGREP_DIR)/.unpacked
(cd $(GNUGREP_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
--- /dev/null
+#############################################################
+#
+# libfloat
+#
+#############################################################
+LIBFLOAT_SOURCE:=libfloat_990616.orig.tar.gz
+LIBFLOAT_PATCH:=libfloat_990616-3.diff.gz
+LIBFLOAT_SITE:=http://ftp.debian.org/debian/pool/main/libf/libfloat
+LIBFLOAT_CAT:=zcat
+LIBFLOAT_DIR:=$(BUILD_DIR)/libfloat
+
+LIBFLOAT_TARGET=
+ifneq ("$(strip $(TARGET_SOFT_FLOAT))","")
+ifeq ("$(strip $(ARCH))","arm")
+LIBFLOAT_TARGET+=$(STAGING_DIR)/lib/libfloat.so
+endif
+endif
+
+$(DL_DIR)/$(LIBFLOAT_SOURCE):
+ $(WGET) -P $(DL_DIR) $(LIBFLOAT_SITE)/$(LIBFLOAT_SOURCE)
+
+$(DL_DIR)/$(LIBFLOAT_PATCH):
+ $(WGET) -P $(DL_DIR) $(LIBFLOAT_SITE)/$(LIBFLOAT_PATCH)
+
+libfloat-source: $(DL_DIR)/$(LIBFLOAT_SOURCE) $(DL_DIR)/$(LIBFLOAT_PATCH)
+
+$(LIBFLOAT_DIR)/.unpacked: $(DL_DIR)/$(LIBFLOAT_SOURCE) $(DL_DIR)/$(LIBFLOAT_PATCH)
+ $(LIBFLOAT_CAT) $(DL_DIR)/$(LIBFLOAT_SOURCE) | tar -C $(BUILD_DIR) -xvf -
+ # Remove the binary files distributed with the the package.
+ make -C $(LIBFLOAT_DIR) clean
+ $(SOURCE_DIR)/patch-kernel.sh $(LIBFLOAT_DIR) $(DL_DIR) $(LIBFLOAT_PATCH)
+ $(SOURCE_DIR)/patch-kernel.sh $(LIBFLOAT_DIR) $(SOURCE_DIR) libfloat.patch
+ touch $(LIBFLOAT_DIR)/.unpacked
+
+$(LIBFLOAT_DIR)/libfloat.so.1: $(LIBFLOAT_DIR)/.unpacked \
+ $(STAGING_DIR)/bin/$(ARCH)-linux-gcc
+ $(MAKE) CC=$(TARGET_CC) LD=$(TARGET_CROSS)ld -C $(LIBFLOAT_DIR)
+
+$(STAGING_DIR)/lib/libfloat.so: $(LIBFLOAT_DIR)/libfloat.so.1
+ cp -a $(LIBFLOAT_DIR)/libfloat.a $(STAGING_DIR)/lib/libfloat.a
+ cp -a $(LIBFLOAT_DIR)/libfloat.so.1 $(STAGING_DIR)/lib/libfloat.so.1
+ (cd $(STAGING_DIR)/lib ; ln -sf libfloat.so.1 libfloat.so)
+ cp -a $(LIBFLOAT_DIR)/libfloat.a $(TARGET_DIR)/usr/lib/libfloat.a
+ cp -a $(LIBFLOAT_DIR)/libfloat.so.1 $(TARGET_DIR)/lib/libfloat.so.1
+ $(STRIP) $(TARGET_DIR)/lib/libfloat.so.1 > /dev/null 2>&1
+ (cd $(TARGET_DIR)/lib ; ln -sf libfloat.so.1 libfloat.so)
+ (cd $(TARGET_DIR)/usr/lib ; ln -sf /lib/libfloat.so libfloat.so)
+
+libfloat: $(STAGING_DIR)/lib/libfloat.so
+
+libfloat-clean:
+ -$(MAKE) -C $(LIBFLOAT_DIR) clean
+
+libfloat-dirclean:
+ rm -rf $(LIBFLOAT_DIR)
+
$(LIBTOOL_DIR)/.configured: $(LIBTOOL_DIR)/.unpacked
(cd $(LIBTOOL_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
mandir=$(TARGET_DIR)/usr/man \
includedir=$(TARGET_DIR)/usr/include \
-C $(LIBTOOL_DIR) install;
+ $(STRIP) $(TARGET_DIR)//usr/lib/libltdl.so.*.*.* > /dev/null 2>&1
perl -pi -e "s,^CC.*,CC=\"/usr/bin/gcc\"," $(TARGET_DIR)/usr/bin/libtool
perl -pi -e "s,^LD.*,LD=\"/usr/bin/ld\"," $(TARGET_DIR)/usr/bin/libtool
rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
$(M4_DIR)/.configured: $(M4_DIR)/.unpacked
(cd $(M4_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
mandir=$(TARGET_DIR)/usr/man \
includedir=$(TARGET_DIR)/usr/include \
-C $(M4_DIR) install;
+ $(STRIP) $(TARGET_DIR)/$(M4_TARGET_BINARY) > /dev/null 2>&1
rm -rf $(TARGET_DIR)/share/locale $(TARGET_DIR)/usr/info \
$(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc
$(GNUMAKE_DIR)/.configured: $(GNUMAKE_DIR)/.unpacked
(cd $(GNUMAKE_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
#
#############################################################
# Copyright (C) 2002 by Ken Restivo <ken@246gt.com>
-# $Id: ncurses.mk,v 1.27 2003/09/03 07:18:14 mjn3 Exp $
+# $Id: ncurses.mk,v 1.28 2003/11/01 05:34:39 mjn3 Exp $
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Library General Public License as
(cd $(NCURSES_DIR); rm -rf config.cache; \
BUILD_CC=$(TARGET_CC) HOSTCC=$(HOSTCC) \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
(cd $(OPENSSH_DIR); rm -rf config.cache; autoconf; \
$(TARGET_CONFIGURE_OPTS) \
LD=$(TARGET_CROSS)gcc \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
$(OPENSSL_DIR)/.unpacked: $(DL_DIR)/$(OPENSSL_SOURCE) $(OPENSSL_PATCH)
gunzip -c $(DL_DIR)/$(OPENSSL_SOURCE) | tar -C $(BUILD_DIR) -xvf -
cat $(OPENSSL_PATCH) | patch -p1 -d $(OPENSSL_DIR)
+ # sigh... we have to resort to this just to set a gcc flag.
+ perl -i -p -e 's,/CFLAG=,/CFLAG= $(TARGET_SOFT_FLOAT) ,g' \
+ $(OPENSSL_DIR)/Configure
touch $(OPENSSL_DIR)/.unpacked
$(OPENSSL_DIR)/Makefile: $(OPENSSL_DIR)/.unpacked
$(OPENSSL_DIR)/apps/openssl: $(OPENSSL_DIR)/Makefile
$(MAKE) CC=$(TARGET_CC) -C $(OPENSSL_DIR) all build-shared
+ # Work around openssl build bug to link libssl.so with libcrypto.so.
+ -rm $(OPENSSL_DIR)/libssl.so.*.*.*
+ $(MAKE) CC=$(TARGET_CC) -C $(OPENSSL_DIR) do_linux-shared
$(STAGING_DIR)/lib/libcrypto.a: $(OPENSSL_DIR)/apps/openssl
$(MAKE) CC=$(TARGET_CC) INSTALL_PREFIX=$(STAGING_DIR) -C $(OPENSSL_DIR) install
(cd $(STAGING_DIR)/lib; ln -fs libssl.so.0.9.7 libssl.so)
(cd $(STAGING_DIR)/lib; ln -fs libssl.so.0.9.7 libssl.so.0)
-$(TARGET_DIR)/lib/libcrypto.so.0.9.7: $(STAGING_DIR)/lib/libcrypto.a
- cp -fa $(STAGING_DIR)/lib/libcrypto.so* $(TARGET_DIR)/lib/
- cp -fa $(STAGING_DIR)/lib/libssl.so* $(TARGET_DIR)/lib/
+$(TARGET_DIR)/usr/lib/libcrypto.so.0.9.7: $(STAGING_DIR)/lib/libcrypto.a
+ cp -fa $(STAGING_DIR)/lib/libcrypto.so* $(TARGET_DIR)/usr/lib/
+ cp -fa $(STAGING_DIR)/lib/libssl.so* $(TARGET_DIR)/usr/lib/
#cp -fa $(STAGING_DIR)/bin/openssl $(TARGET_DIR)/bin/
+ -$(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/libssl.so.0.9.7
+ -$(STRIP) --strip-unneeded $(TARGET_DIR)/usr/lib/libcrypto.so.0.9.7
$(TARGET_DIR)/usr/lib/libssl.a: $(STAGING_DIR)/lib/libcrypto.a
mkdir -p $(TARGET_DIR)/usr/include
cp -a $(STAGING_DIR)/include/openssl $(TARGET_DIR)/usr/include/
cp -dpf $(STAGING_DIR)/lib/libssl.a $(TARGET_DIR)/usr/lib/
cp -dpf $(STAGING_DIR)/lib/libcrypto.a $(TARGET_DIR)/usr/lib/
- rm -f $(TARGET_DIR)/lib/libcrypto.so
- rm -f $(TARGET_DIR)/lib/libssl.so
- (cd $(TARGET_DIR)/usr/lib; \
- ln -fs /lib/libssl.so.0.9.7 libssl.so; \
- ln -fs /lib/libcrypto.so.0.9.7 libcrypto.so; \
- )
- -$(STRIP) --strip-unneeded $(TARGET_DIR)/lib/libssl.so.0.9.7
- -$(STRIP) --strip-unneeded $(TARGET_DIR)/lib/libcrypto.so.0.9.7
touch -c $(TARGET_DIR)/usr/lib/libssl.a
openssl-headers: $(TARGET_DIR)/usr/lib/libssl.a
openssl-dirclean:
rm -rf $(OPENSSL_DIR)
-openssl: uclibc $(TARGET_DIR)/lib/libcrypto.so.0.9.7
+openssl: uclibc $(TARGET_DIR)/usr/lib/libcrypto.so.0.9.7
$(GNUPATCH_DIR)/.configured: $(GNUPATCH_DIR)/.unpacked
(cd $(GNUPATCH_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
$(SED_DIR)/.configured: $(SED_DIR)/.unpacked
(cd $(SED_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
$(STRACE_DIR)/.configured: $(STRACE_DIR)/.unpacked
(cd $(STRACE_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
$(TARGET_DIR)/usr/bin/strace: $(STRACE_DIR)/strace
install -c $(STRACE_DIR)/strace $(TARGET_DIR)/usr/bin/strace
+ $(STRIP) $(TARGET_DIR)/usr/bin/strace > /dev/null 2>&1
strace: uclibc $(TARGET_DIR)/usr/bin/strace
$(GNUTAR_DIR)/.configured: $(GNUTAR_DIR)/.unpacked
(cd $(GNUTAR_DIR); rm -rf config.cache; \
$(TARGET_CONFIGURE_OPTS) \
+ CFLAGS="$(TARGET_CFLAGS)" \
./configure \
--target=$(GNU_TARGET_NAME) \
--host=$(GNU_TARGET_NAME) \
touch $(TINYLOGIN_DIR)/Config.h
$(TINYLOGIN_DIR)/tinylogin: $(TINYLOGIN_DIR)/Config.h
- $(MAKE) CROSS="$(TARGET_CROSS)" -C $(TINYLOGIN_DIR)
+ $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" -C $(TINYLOGIN_DIR)
$(TARGET_DIR)/bin/tinylogin: $(TINYLOGIN_DIR)/tinylogin
- $(MAKE) CROSS="$(TARGET_CROSS)" PREFIX="$(TARGET_DIR)" -C $(TINYLOGIN_DIR) install
+ $(MAKE) CC=$(TARGET_CC) CROSS="$(TARGET_CROSS)" \
+ PREFIX="$(TARGET_DIR)" -C $(TINYLOGIN_DIR) install
tinylogin: uclibc $(TARGET_DIR)/bin/tinylogin
perl -i -p -e 's,^SHARED_LIB_LOADER_PATH=.*,SHARED_LIB_LOADER_PATH=\"/lib\",g' \
$(UCLIBC_DIR)/.config
perl -i -p -e 's,.*UCLIBC_HAS_WCHAR.*,UCLIBC_HAS_WCHAR=y\nUCLIBC_HAS_LOCALE=n,g' \
- $(UCLIBC_DIR)/.config
- perl -i -p -e 's,^GCC_BIN.*,GCC_BIN=$(STAGING_DIR)/bin/$(ARCH)-uclibc-gcc,g' \
+ $(UCLIBC_DIR)/.conf
+ if [ -n "$(strip $(TARGET_SOFT_FLOAT))" ] ; then \
+ perl -i -p -e 's,.*HAS_FPU.*,# HAS_FPU is not set\nUCLIBC_HAS_SOFT_FLOAT=y,g' \
+ $(UCLIBC_DIR)/.config; \
+ fi
+ perl -i -p -e 's,^GCC_BIN.*,GCC_BIN=$(STAGING_DIR)/bin/$(ARCH)-linux-gcc,g' \
$(UCLIBC_DIR)/extra/gcc-uClibc/Makefile
- perl -i -p -e 's,^LD_BIN.*,LD_BIN=$(STAGING_DIR)/bin/$(ARCH)-uclibc-ld,g' \
+ perl -i -p -e 's,^LD_BIN.*,LD_BIN=$(STAGING_DIR)/bin/$(ARCH)-linux-ld,g' \
$(UCLIBC_DIR)/extra/gcc-uClibc/Makefile
$(MAKE) -C $(UCLIBC_DIR) oldconfig
$(MAKE) -C $(UCLIBC_DIR) pregen
$(MAKE) -C $(UCLIBC_DIR) install_dev;
touch $(UCLIBC_DIR)/.configured
-$(UCLIBC_DIR)/lib/libc.a: $(UCLIBC_DIR)/.configured
+$(UCLIBC_DIR)/lib/libc.a: $(UCLIBC_DIR)/.configured $(LIBFLOAT_TARGET)
$(MAKE) -C $(UCLIBC_DIR)
$(STAGING_DIR)/lib/libc.a: $(UCLIBC_DIR)/lib/libc.a
uclibc-configured: $(UCLIBC_DIR)/.configured
-uclibc: $(STAGING_DIR)/bin/$(ARCH)-uclibc-gcc $(STAGING_DIR)/lib/libc.a \
+uclibc: $(STAGING_DIR)/bin/$(ARCH)-linux-gcc $(STAGING_DIR)/lib/libc.a \
$(UCLIBC_TARGETS)
uclibc-clean:
ln -fs /lib/libm.so.0 libm.so; \
ln -fs /lib/libpthread.so.0 libpthread.so; \
ln -fs /lib/libnsl.so.0 libnsl.so; \
+ \
+ ln -fs /lib/libthread_db.so.1 libthread_db.so; \
+ rm -f ld-uClibc-0.9.21.so; \
+ rm -f libcrypt-0.9.21.so; \
+ rm -f libdl-0.9.21.so; \
+ rm -f libm-0.9.21.so; \
+ rm -f libnsl-0.9.21.so; \
+ rm -f libpthread-0.9.21.so; \
+ rm -f libresolv-0.9.21.so; \
+ rm -f libuClibc-0.9.21.so; \
+ rm -f libutil-0.9.21.so; \
+ rm -f libthread_db-0.9.21.so; \
)
ifeq ($(USE_UCLIBC_TOOLCHAIN),true)
ZLIB_SOURCE=zlib-1.1.4.tar.bz2
ZLIB_SITE=http://aleron.dl.sourceforge.net/sourceforge/libpng
ZLIB_DIR=$(BUILD_DIR)/zlib-1.1.4
+ZLIB_CFLAGS= $(TARGET_CFLAGS) -fPIC
ifeq ($(strip $(BUILD_WITH_LARGEFILE)),true)
-ZLIB_CFLAGS=-Os -g -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
-else
-ZLIB_CFLAGS=-Os -g
+ZLIB_CFLAGS+= -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64
endif
-ZLIB_CFLAGS+=-fPIC
$(DL_DIR)/$(ZLIB_SOURCE):
$(WGET) -P $(DL_DIR) $(ZLIB_SITE)/$(ZLIB_SOURCE)
--- /dev/null
+diff -urN dropbear-0.38/libtomcrypt/makefile dropbear-0.38-new/libtomcrypt/makefile
+--- dropbear-0.38/libtomcrypt/makefile 2003-09-24 05:22:44.000000000 -0500
++++ dropbear-0.38-new/libtomcrypt/makefile 2003-10-29 23:39:57.000000000 -0600
+@@ -103,7 +103,7 @@
+
+ $(LIBNAME): $(OBJECTS)
+ $(AR) $(ARFLAGS) $@ $(OBJECTS)
+- ranlib $(LIBNAME)
++ $(RANLIB) $(LIBNAME)
+
+ #This rule makes the test program included with libtomcrypt
+ test: library $(TESTOBJECTS)
+diff -urN dropbear-0.38/libtommath/makefile dropbear-0.38-new/libtommath/makefile
+--- dropbear-0.38/libtommath/makefile 2003-09-24 03:55:34.000000000 -0500
++++ dropbear-0.38-new/libtommath/makefile 2003-10-29 23:40:18.000000000 -0600
+@@ -48,7 +48,7 @@
+
+ libtommath.a: $(OBJECTS)
+ $(AR) $(ARFLAGS) libtommath.a $(OBJECTS)
+- ranlib libtommath.a
++ $(RANLIB) libtommath.a
+
+ install: libtommath.a
+ install -d -g root -o root $(DESTDIR)$(LIBPATH)
--- /dev/null
+diff -urN gcc-3.3.2-orig/gcc/mklibgcc.in gcc-3.3.2/gcc/mklibgcc.in
+--- gcc-3.3.2-orig/gcc/mklibgcc.in 2003-09-08 19:37:34.000000000 -0500
++++ gcc-3.3.2/gcc/mklibgcc.in 2003-10-22 02:27:34.000000000 -0500
+@@ -296,7 +296,9 @@
+
+ libgcc_a_objs="$libgcc_objs $libgcc_st_objs"
+
+- if [ "@libgcc_visibility@" = yes -a "$SHLIB_LINK" ]; then
++ #if [ "@libgcc_visibility@" = yes -a "$SHLIB_LINK" ]; then
++ if [ "@libgcc_visibility@" = I_AM_DISABLED -a "$SHLIB_LINK" ]; then
++ echo "OUCH!!!!! : @libgcc_visibility@ : $SHLIB_LINK : OUCH!!!!!"
+ libgcc_a_objs=
+ echo ""
+ for o in $libgcc_objs $libgcc_st_objs; do
--- /dev/null
+--- gcc-3.3.2/libstdc++-v3/testsuite/Makefile.in.dist 2003-10-26 00:07:43.000000000 -0500
++++ gcc-3.3.2/libstdc++-v3/testsuite/Makefile.in 2003-10-26 00:06:35.000000000 -0500
+@@ -204,9 +204,9 @@
+ PROGRAMS = $(noinst_PROGRAMS)
+
+ abi_check_OBJECTS = abi_check.$(OBJEXT)
+-abi_check_LDADD = $(LDADD)
++abi_check_LDADD = -lstdc++ $(LDADD)
+ abi_check_DEPENDENCIES =
+-abi_check_LDFLAGS =
++abi_check_LDFLAGS = -L../src
+ CXXFLAGS = @CXXFLAGS@
+ CXXCOMPILE = $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
+ LTCXXCOMPILE = $(LIBTOOL) --mode=compile $(CXX) $(DEFS) $(INCLUDES) $(AM_CPPFLAGS) $(CPPFLAGS) $(AM_CXXFLAGS) $(CXXFLAGS)
--- /dev/null
+diff -urN gcc-3.3.2-orig/gcc/config/i386/i386.h gcc-3.3.2/gcc/config/i386/i386.h
+--- gcc-3.3.2-orig/gcc/config/i386/i386.h 2003-06-25 16:18:31.000000000 -0500
++++ gcc-3.3.2/gcc/config/i386/i386.h 2003-10-22 01:46:57.000000000 -0500
+@@ -653,6 +653,7 @@
+ /* Define for XFmode or TFmode extended real floating point support.
+ The XFmode is specified by i386 ABI, while TFmode may be faster
+ due to alignment and simplifications in the address calculations. */
++#if 0
+ #define LONG_DOUBLE_TYPE_SIZE (TARGET_128BIT_LONG_DOUBLE ? 128 : 96)
+ #define MAX_LONG_DOUBLE_TYPE_SIZE 128
+ #ifdef __x86_64__
+@@ -660,6 +661,17 @@
+ #else
+ #define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 96
+ #endif
++#else
++ /* Set up for x86 soft float with 64-bit long doubles, since that's
++ * all the soft float emulation supports. */
++#define LONG_DOUBLE_TYPE_SIZE (TARGET_128BIT_LONG_DOUBLE ? 128 : (TARGET_80387 ? 96 : 64))
++#define MAX_LONG_DOUBLE_TYPE_SIZE 128
++#ifdef __x86_64__
++#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE 128
++#else
++#define LIBGCC2_LONG_DOUBLE_TYPE_SIZE (TARGET_80387 ? 96 : 64)
++#endif
++#endif
+
+ /* Set the value of FLT_EVAL_METHOD in float.h. When using only the
+ FPU, assume that the fpcw is set to extended precision; when using
+diff -urN gcc-3.3.2-orig/gcc/config/t-linux gcc-3.3.2/gcc/config/t-linux
+--- gcc-3.3.2-orig/gcc/config/t-linux 2003-06-04 11:56:11.000000000 -0500
++++ gcc-3.3.2/gcc/config/t-linux 2003-10-22 01:46:39.000000000 -0500
+@@ -14,3 +14,28 @@
+ LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde-glibc.c \
+ $(srcdir)/unwind-sjlj.c $(srcdir)/unwind-c.c
+ LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h unwind-dw2-fde.c
++
++##############################################
++# We want fine grained libraries, so use the new code to build the
++# floating point emulation libraries.
++FPBIT = fp-bit.c
++DPBIT = dp-bit.c
++
++#LIB2FUNCS_EXTRA = xp-bit.c
++
++dp-bit.c: $(srcdir)/config/fp-bit.c
++ echo '#ifdef __LITTLE_ENDIAN__' > dp-bit.c
++ echo '#define FLOAT_BIT_ORDER_MISMATCH' >>dp-bit.c
++ echo '#endif' >> dp-bit.c
++ cat $(srcdir)/config/fp-bit.c >> dp-bit.c
++
++fp-bit.c: $(srcdir)/config/fp-bit.c
++ echo '#define FLOAT' > fp-bit.c
++ echo '#ifdef __LITTLE_ENDIAN__' >> fp-bit.c
++ echo '#define FLOAT_BIT_ORDER_MISMATCH' >>fp-bit.c
++ echo '#endif' >> fp-bit.c
++ cat $(srcdir)/config/fp-bit.c >> fp-bit.c
++
++#MULTILIB_OPTIONS = msoft-float
++#MULTILIB_DIRNAMES = soft-float
++
--- /dev/null
+diff -urN libfloat-dist/Makefile libfloat/Makefile
+--- libfloat-dist/Makefile 2003-10-26 00:33:45.000000000 -0500
++++ libfloat/Makefile 2003-10-26 01:07:26.000000000 -0500
+@@ -1,7 +1,6 @@
+ # Makefile for the Linux soft-float library
+
+-CC=gcc -O2 -freg-struct-return -fomit-frame-pointer -D__LIBFLOAT__
+-#CC=gcc -g -O2 -freg-struct-return -D__LIBFLOAT__
++CFLAGS= -O2 -freg-struct-return -fomit-frame-pointer -D__LIBFLOAT__
+ AR=ar
+
+ all: libfloat.a libfloat.so.1
+@@ -12,24 +11,24 @@
+
+ libfloat.so.1: softfloat.os fplib_glue.os
+ rm -f libfloat.so.1
+- gcc -shared -Wl,-soname,libfloat.so.1 softfloat.os fplib_glue.os -o libfloat.so.1
++ $(LD) -shared -soname=libfloat.so.1 softfloat.os fplib_glue.os -o libfloat.so.1
+
+ softfloat.o: softfloat/bits64/softfloat.c
+- $(CC) -c -o softfloat.o -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
++ $(CC) $(CFLAGS) -c -o softfloat.o -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
+
+ fplib_glue.o: fplib_glue.S
+- $(CC) -c -o fplib_glue.o fplib_glue.S
++ $(CC) $(CFLAGS) -c -o fplib_glue.o fplib_glue.S
+
+ softfloat.os: softfloat/bits64/softfloat.c
+- $(CC) -fpic -c -o softfloat.os -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
++ $(CC) $(CFLAGS) -fpic -c -o softfloat.os -Isoftfloat/bits64/ARM-gcc softfloat/bits64/softfloat.c
+
+ fplib_glue.os: fplib_glue.S
+- $(CC) -fpic -c -o fplib_glue.os fplib_glue.S
++ $(CC) $(CFLAGS) -fpic -c -o fplib_glue.os fplib_glue.S
+
+ install: libfloat.a libfloat.so.1
+ cp -a libfloat.a $(DESTDIR)/usr/lib
+- cp -a libfloat.so.1 $(DESTDIR)/usr/lib
+- cd $(DESTDIR)/usr/lib; ln -s libfloat.so.1 libfloat.so
++ cp -a libfloat.so.1 $(DESTDIR)/lib
++ cd $(DESTDIR)/lib; ln -s libfloat.so.1 libfloat.so
+ #ldconfig
+
+ clean: