From 3a70952d991368609d9bd7e3b4532a3434a091de Mon Sep 17 00:00:00 2001 From: Eric Andersen Date: Tue, 7 Jan 2003 21:00:41 +0000 Subject: [PATCH] more build updates --- make/ext2root.mk | 4 -- make/gawk.mk | 18 ++++++- make/gcc_target.mk | 105 ++++++++++++++++++++++++++++++++------- make/linux.mk | 8 +-- make/openssh.mk | 14 +++++- make/uclibc_toolchain.mk | 20 ++++---- 6 files changed, 130 insertions(+), 39 deletions(-) diff --git a/make/ext2root.mk b/make/ext2root.mk index 1a4f79be5e..564c45b8fe 100644 --- a/make/ext2root.mk +++ b/make/ext2root.mk @@ -48,10 +48,6 @@ GENEXT2_SIZE=$(shell expr $(GENEXT2_REALSIZE) + $(GENEXT2_ADDTOROOTSIZE)) # We currently add about 400 device nodes, so add that into the total GENEXT2_INODES=$(shell expr $(shell find $(TARGET_DIR) | wc -l) + 400) -#ifeq (1,$(shell expr $(GENEXT2_SIZE) \> $(GENEXT2_MAXROOTSIZE))) -# $(error "Filesystem size, $(GENEXT2_SIZE) KB is greater than the maximum $(GENEXT2_MAXROOTSIZE) KB") -#endif - ext2root: genext2fs -@find $(TARGET_DIR)/lib -type f -name \*.so\* | xargs $(STRIP) --strip-unneeded 2>/dev/null || true; -@find $(TARGET_DIR) -type f -perm +111 | xargs $(STRIP) 2>/dev/null || true; diff --git a/make/gawk.mk b/make/gawk.mk index 0994ef80d9..84671a6fe5 100644 --- a/make/gawk.mk +++ b/make/gawk.mk @@ -21,8 +21,22 @@ $(GAWK_DIR)/.unpacked: $(DL_DIR)/$(GAWK_SOURCE) $(GAWK_DIR)/.configured: $(GAWK_DIR)/.unpacked (cd $(GAWK_DIR); rm -f config.cache; CC=$(TARGET_CC1) \ - CFLAGS=-D_POSIX_SOURCE ./configure --prefix=/usr --disable-nls \ - --mandir=/junk --infodir=/junk \ + CFLAGS=-D_POSIX_SOURCE ./configure \ + --target=$(GNU_TARGET_NAME) \ + --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --sbindir=/usr/sbin \ + --sysconfdir=/etc \ + --libexecdir=/usr/lib \ + --datadir=/usr/share \ + --libdir=/usr/lib \ + --localstatedir=/var \ + --mandir=/junk \ + --infodir=/junk \ + --includedir=$(STAGING_DIR)/include \ + --oldincludedir=$(STAGING_DIR)/usr/include \ + --disable-nls \ ); touch $(GAWK_DIR)/.configured diff --git a/make/gcc_target.mk b/make/gcc_target.mk index 956a9b0df4..0e466bdc53 100644 --- a/make/gcc_target.mk +++ b/make/gcc_target.mk @@ -49,19 +49,46 @@ $(BINUTILS_DIR2)/.configured: #(cd $(TARGET_DIR)/usr/$(GNU_TARGET_NAME); ln -fs ../lib) #(cd $(TARGET_DIR)/usr/$(GNU_TARGET_NAME); ln -fs ../include) (cd $(TARGET_DIR)/usr/$(GNU_TARGET_NAME); ln -fs ../include sys-include) - (cd $(BINUTILS_DIR2); PATH=$$PATH:$(STAGING_DIR)/bin CC=$(TARGET_CROSS)gcc \ - $(BINUTILS_DIR)/configure --enable-shared \ - --target=$(GNU_TARGET_NAME) --prefix=/usr \ - --enable-targets=$(GNU_TARGET_NAME) \ - --program-prefix=""); + (cd $(BINUTILS_DIR2); PATH=$(STAGING_DIR)/bin:$$PATH CC=$(TARGET_CROSS)gcc \ + $(BINUTILS_DIR)/configure \ + --target=$(GNU_TARGET_NAME) \ + --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --sbindir=/usr/sbin \ + --sysconfdir=/etc \ + --datadir=/usr/share \ + --includedir=/usr/include \ + --libdir=/usr/lib \ + --localstatedir=/var \ + --mandir=/usr/man \ + --infodir=/usr/info \ + --with-gxx-include-dir=/usr/include/c++ \ + --disable-shared --enable-multilib \ + --enable-targets=$(GNU_TARGET_NAME) ); touch $(BINUTILS_DIR2)/.configured $(BINUTILS_DIR2)/binutils/objdump: $(BINUTILS_DIR2)/.configured - $(MAKE) tooldir=$(TARGET_DIR) -C $(BINUTILS_DIR2); + $(MAKE) -C $(BINUTILS_DIR2); $(TARGET_DIR)/usr/bin/ld: $(BINUTILS_DIR2)/binutils/objdump - $(MAKE) DESTDIR=$(TARGET_DIR) prefix=$(TARGET_DIR)/usr \ - bindir=$(TARGET_DIR)/usr/bin -C $(BINUTILS_DIR2) install + PATH=$(STAGING_DIR)/bin:$$PATH $(MAKE) \ + prefix=$(TARGET_DIR)/usr \ + exec_prefix=$(TARGET_DIR)/usr \ + bindir=$(TARGET_DIR)/usr/bin \ + sbindir=$(TARGET_DIR)/usr/sbin \ + libexecdir=$(TARGET_DIR)/usr/libexec \ + datadir=$(TARGET_DIR)/usr/share \ + sysconfdir=$(TARGET_DIR)/etc \ + sharedstatedir=$(TARGET_DIR)/usr/com \ + localstatedir=$(TARGET_DIR)/var \ + libdir=$(TARGET_DIR)/usr/lib \ + infodir=$(TARGET_DIR)/usr/info \ + mandir=$(TARGET_DIR)/usr/man \ + includedir=$(TARGET_DIR)/usr/include \ + gxx_include_dir=$(TARGET_DIR)/usr/include/c++ \ + toolexecdir=$(TARGET_DIR)/lib/gcc-lib/$(GNU_TARGET_NAME) \ + -C $(BINUTILS_DIR2) install; rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc -$(STRIP) $(TARGET_DIR)/usr/$(GNU_TARGET_NAME)/bin/* -$(STRIP) $(TARGET_DIR)/usr/bin/* @@ -117,29 +144,69 @@ uclibc_target-dirclean: # Next build target gcc compiler # ############################################################# -$(GCC_BUILD_DIR3)/.configured: +$(GCC_BUILD_DIR3)/.gcc_build_hacks: + # + # Make certain the uClibc start files are found + # + perl -i -p -e "s,standard_startfile_prefix_1 = \".*,standard_startfile_prefix_1=\ + \"/lib/\";,;" $(GCC_DIR)/gcc/gcc.c; + perl -i -p -e "s,standard_startfile_prefix_2 = \".*,standard_startfile_prefix_2=\ + \"/usr/lib/\";,;" $(GCC_DIR)/gcc/gcc.c; + # + # Make certain the uClibc include files are found + # + perl -i -p -e "s,^NATIVE_SYSTEM_HEADER_DIR.*,NATIVE_SYSTEM_HEADER_DIR=\ + $(STAGING_DIR)/usr/include,;" $(GCC_DIR)/gcc/Makefile.in; + perl -i -p -e "s,^CROSS_SYSTEM_HEADER_DIR.*,CROSS_SYSTEM_HEADER_DIR=\ + $(STAGING_DIR)/usr/include,;" $(GCC_DIR)/gcc/Makefile.in; + perl -i -p -e "s,^#define.*STANDARD_INCLUDE_DIR.*,#define STANDARD_INCLUDE_DIR \ + \"/usr/include\",;" $(GCC_DIR)/gcc/cppdefault.h; + +$(GCC_BUILD_DIR3)/.configured: $(GCC_BUILD_DIR3)/.gcc_build_hacks mkdir -p $(GCC_BUILD_DIR3) - (cd $(GCC_BUILD_DIR3); PATH=$$PATH:$(STAGING_DIR)/bin AR=$(TARGET_CROSS)ar \ + (cd $(GCC_BUILD_DIR3); PATH=$(STAGING_DIR)/bin:$$PATH AR=$(TARGET_CROSS)ar \ RANLIB=$(TARGET_CROSS)ranlib LD=$(TARGET_CROSS)ld CC=$(TARGET_CROSS)gcc \ $(GCC_DIR)/configure \ - --host=$(GNU_TARGET_NAME) --target=$(GNU_TARGET_NAME) --prefix=/usr \ - --with-local-prefix=$(STAGING_DIR)/usr \ + --host=$(GNU_TARGET_NAME) \ + --target=$(GNU_TARGET_NAME) \ + --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --sbindir=/usr/sbin \ + --sysconfdir=/etc \ + --datadir=/usr/share \ + --libdir=/usr/lib \ + --localstatedir=/var \ + --mandir=/usr/man \ + --infodir=/usr/info \ + --disable-shared --enable-multilib \ --enable-target-optspace --disable-nls --with-gnu-ld \ - --enable-shared --enable-languages=c,c++ ); - perl -i -p -e "s,ac_cv_prog_cc_cross=no,ac_cv_prog_cc_cross=yes,g;" $(GCC_BUILD_DIR3)/config.cache - perl -i -p -e "s,^SYSTEM_HEADER_DIR.*,SYSTEM_HEADER_DIR=$(TARGET_DIR)/include,g;" $(GCC_BUILD_DIR3)/gcc/Makefile + --enable-languages=c,c++ --disable-__cxa_atexit ); touch $(GCC_BUILD_DIR3)/.configured $(GCC_BUILD_DIR3)/.compiled: $(GCC_BUILD_DIR3)/.configured - PATH=$$PATH:$(STAGING_DIR)/bin $(MAKE) -C $(GCC_BUILD_DIR3) + PATH=$(STAGING_DIR)/bin:$$PATH $(MAKE) -C $(GCC_BUILD_DIR3) touch $(GCC_BUILD_DIR3)/.compiled $(TARGET_DIR)/usr/bin/gcc: $(GCC_BUILD_DIR3)/.compiled - PATH=$$PATH:$(STAGING_DIR)/bin $(MAKE) DESTDIR=$(TARGET_DIR) prefix=$(TARGET_DIR)/usr \ - -C $(GCC_BUILD_DIR3) install; + PATH=$(STAGING_DIR)/bin:$$PATH $(MAKE) \ + prefix=$(TARGET_DIR)/usr \ + exec_prefix=$(TARGET_DIR)/usr \ + bindir=$(TARGET_DIR)/usr/bin \ + sbindir=$(TARGET_DIR)/usr/sbin \ + libexecdir=$(TARGET_DIR)/usr/libexec \ + datadir=$(TARGET_DIR)/usr/share \ + sysconfdir=$(TARGET_DIR)/etc \ + sharedstatedir=$(TARGET_DIR)/usr/com \ + localstatedir=$(TARGET_DIR)/var \ + libdir=$(TARGET_DIR)/usr/lib \ + infodir=$(TARGET_DIR)/usr/info \ + mandir=$(TARGET_DIR)/usr/man \ + toolexecdir=$(TARGET_DIR)/lib/gcc-lib/$(GNU_TARGET_NAME) \ + -C $(GCC_BUILD_DIR3) install; rm -rf $(TARGET_DIR)/usr/info $(TARGET_DIR)/usr/man $(TARGET_DIR)/usr/share/doc \ $(TARGET_DIR)/usr/share/locale - (cd $(TARGET_DIR)/usr/bin; ln -s gcc cc) + (cd $(TARGET_DIR)/usr/bin; ln -fs gcc cc) -$(STRIP) $(TARGET_DIR)/bin/* -$(STRIP) $(TARGET_DIR)/usr/bin/* diff --git a/make/linux.mk b/make/linux.mk index 5fe7bddc16..8d70ca213d 100644 --- a/make/linux.mk +++ b/make/linux.mk @@ -22,10 +22,10 @@ ifneq ($(filter $(TARGETS),linux),) LINUX_VERSION=2.4.20 LINUX_DIR=$(BUILD_DIR)/linux-$(LINUX_VERSION) -#LINUX_FORMAT=bzImage -LINUX_FORMAT=zImage -#LINUX_BINLOC=arch/$(ARCH)/boot/$(LINUX_FORMAT) -LINUX_BINLOC=arch/ppc/boot/images/zImage.prep +LINUX_FORMAT=bzImage +LINUX_BINLOC=arch/$(ARCH)/boot/$(LINUX_FORMAT) +#LINUX_FORMAT=zImage +#LINUX_BINLOC=arch/ppc/boot/images/zImage.prep LINUX_SOURCE=linux-$(LINUX_VERSION).tar.bz2 LINUX_SITE=http://ftp.us.kernel.org/pub/linux/kernel/v2.4 LINUX_KCONFIG=$(SOURCE_DIR)/linux.config diff --git a/make/openssh.mk b/make/openssh.mk index 5898577bec..024c8b0731 100644 --- a/make/openssh.mk +++ b/make/openssh.mk @@ -22,7 +22,19 @@ $(OPENSSH_DIR)/.patched: $(OPENSSH_DIR)/.unpacked $(OPENSSH_DIR)/.configured: $(OPENSSH_DIR)/.patched (cd $(OPENSSH_DIR); rm -rf config.cache; CC=$(TARGET_CC1) \ - ./configure --prefix=/usr \ + ./configure \ + --prefix=/usr \ + --exec-prefix=/usr \ + --bindir=/usr/bin \ + --sbindir=/usr/sbin \ + --sysconfdir=/etc \ + --libexecdir=/usr/lib \ + --datadir=/usr/share \ + --includedir=/usr/include \ + --libdir=/usr/lib \ + --localstatedir=/var \ + --mandir=/usr/man \ + --infodir=/usr/info \ --includedir=$(STAGING_DIR)/include \ --disable-lastlog --disable-utmp --disable-utmpx --disable-wtmp --disable-wtmpx \ --disable-nls --without-x); diff --git a/make/uclibc_toolchain.mk b/make/uclibc_toolchain.mk index 279a099e5c..afb61633af 100644 --- a/make/uclibc_toolchain.mk +++ b/make/uclibc_toolchain.mk @@ -133,7 +133,7 @@ $(BINUTILS_DIR1)/.configured: $(BINUTILS_DIR)/.patched --datadir=$(STAGING_DIR)/share --includedir=$(STAGING_DIR)/include \ --libdir=$(STAGING_DIR)/lib --localstatedir=$(STAGING_DIR)/var \ --mandir=$(STAGING_DIR)/man --infodir=$(STAGING_DIR)/info \ - --enable-targets=$(GNU_TARGET_NAME) \ + --enable-targets=$(GNU_TARGET_NAME) --enable-multilib \ --program-prefix=$(ARCH)-uclibc-); touch $(BINUTILS_DIR1)/.configured @@ -188,17 +188,19 @@ $(GCC_DIR)/.gcc_build_hacks: $(GCC_DIR)/.patched # # Prevent system glibc start files from leaking in uninvited... # - perl -i -p -e "s,standard_startfile_prefix_1 = \".*,standard_startfile_prefix_1=\ + perl -i -p -e "s,standard_startfile_prefix_1 = \".*,standard_startfile_prefix_1 =\ \"$(STAGING_DIR)/lib/\";,;" $(GCC_DIR)/gcc/gcc.c; - perl -i -p -e "s,standard_startfile_prefix_2 = \".*,standard_startfile_prefix_2=\ + perl -i -p -e "s,standard_startfile_prefix_2 = \".*,standard_startfile_prefix_2 =\ \"$(STAGING_DIR)/usr/lib/\";,;" $(GCC_DIR)/gcc/gcc.c; # # Prevent system glibc include files from leaking in uninvited... # - perl -i -p -e "s,^NATIVE_SYSTEM_HEADER_DIR.*,\ - NATIVE_SYSTEM_HEADER_DIR=$(STAGING_DIR)/usr/include,;" $(GCC_DIR)/gcc/Makefile.in; - perl -i -p -e "s,^CROSS_SYSTEM_HEADER_DIR.*,\ - CROSS_SYSTEM_HEADER_DIR=$(STAGING_DIR)/usr/include,;" $(GCC_DIR)/gcc/Makefile.in; + perl -i -p -e "s,^NATIVE_SYSTEM_HEADER_DIR.*,NATIVE_SYSTEM_HEADER_DIR=\ + $(STAGING_DIR)/usr/include,;" $(GCC_DIR)/gcc/Makefile.in; + perl -i -p -e "s,^CROSS_SYSTEM_HEADER_DIR.*,CROSS_SYSTEM_HEADER_DIR=\ + $(STAGING_DIR)/usr/include,;" $(GCC_DIR)/gcc/Makefile.in; + perl -i -p -e "s,^#define.*STANDARD_INCLUDE_DIR.*,#define STANDARD_INCLUDE_DIR \ + \"$(STAGING_DIR)/usr/include\",;" $(GCC_DIR)/gcc/cppdefault.h; # # Prevent gcc from using the unwind-dw2-fde-glibc code # @@ -220,7 +222,7 @@ $(GCC_BUILD_DIR1)/.configured: $(GCC_DIR)/.gcc_build_hacks --libdir=$(STAGING_DIR)/lib --localstatedir=$(STAGING_DIR)/var \ --mandir=$(STAGING_DIR)/man --infodir=$(STAGING_DIR)/info \ --with-local-prefix=$(STAGING_DIR)/usr/local \ - --oldincludedir=$(STAGING_DIR)/usr/include \ + --oldincludedir=$(STAGING_DIR)/usr/include --enable-multilib \ --enable-target-optspace --disable-nls --with-gnu-ld \ --disable-shared --enable-languages=c --disable-__cxa_atexit \ --program-prefix=$(ARCH)-uclibc-); @@ -363,7 +365,7 @@ $(GCC_BUILD_DIR2)/.configured: $(GCC_DIR)/.g++_build_hacks --libdir=$(STAGING_DIR)/lib --localstatedir=$(STAGING_DIR)/var \ --mandir=$(STAGING_DIR)/man --infodir=$(STAGING_DIR)/info \ --with-local-prefix=$(STAGING_DIR)/usr/local \ - --oldincludedir=$(STAGING_DIR)/usr/include \ + --oldincludedir=$(STAGING_DIR)/usr/include --enable-multilib \ --enable-target-optspace --disable-nls --with-gnu-ld \ --disable-shared --enable-languages=$(TARGET_LANGUAGES) --disable-__cxa_atexit \ --program-prefix=$(ARCH)-uclibc-); -- 2.30.2