From 9902a435cd73463dc1cbe5dd77f7c41bb748c9a5 Mon Sep 17 00:00:00 2001 From: Arun Thomas Date: Tue, 28 Jun 2011 17:19:10 +0200 Subject: [PATCH] Simplify ELF library build logic -Remove obsolete clang-libraries and gnu-libraries targets -Buildworld now builds elf-libraries as well --- Makefile | 37 +------------------------------------ docs/UPDATING | 5 +++++ lib/Makefile | 12 ++---------- lib/clang_build.sh | 9 --------- lib/elf_build.sh | 18 +++++++----------- lib/elf_build_base.sh | 12 ------------ lib/gnu_build.sh | 9 --------- share/mk/bsd.own.mk | 2 +- share/mk/sys.mk | 5 ----- 9 files changed, 16 insertions(+), 93 deletions(-) delete mode 100755 lib/clang_build.sh delete mode 100755 lib/elf_build_base.sh delete mode 100755 lib/gnu_build.sh diff --git a/Makefile b/Makefile index 7d0754233..663660e94 100644 --- a/Makefile +++ b/Makefile @@ -13,17 +13,11 @@ usage: @echo " make world # Compile everything (libraries & commands)" @echo " make includes # Install include files from src/" @echo " make libraries # Compile and install libraries (ack)" -.ifdef MINIX_GENERATE_ELF @echo " make elf-libraries # Compile and install gcc/clang elf libs" -.endif @echo " make commands # Compile all, commands, but don't install" @echo " make install # Compile and install commands" @echo " make depend # Generate required .depend files" @echo " make gnu-includes # Install include files for GCC" -.ifndef MINIX_GENERATE_ELF - @echo " make gnu-libraries # Compile and install libraries for GCC" - @echo " make clang-libraries # Compile and install libraries for GCC with clang" -.endif @echo " make clean # Remove all compiler results" @echo "" @echo "Run 'make' in tools/ to create a new MINIX configuration." @@ -37,19 +31,7 @@ usage: # 'make install' target. # # etcfiles has to be done first. -.ifdef MINIX_GENERATE_ELF -world: mkfiles includes depend libraries elf-libraries install etcforce -.else -.if ${COMPILER_TYPE} == "ack" -world: mkfiles includes depend libraries install etcforce -.elif ${COMPILER_TYPE} == "gnu" -.if ${OBJECT_FMT} == "a.out" -world: mkfiles includes depend gnu-libraries install etcforce -.elif ${OBJECT_FMT} == "ELF" -world: mkfiles elf-includes depend elf-libraries install etcforce -.endif -.endif -.endif +world: mkfiles includes depend libraries elf-libraries install etcforce mkfiles: make -C share/mk install @@ -63,29 +45,12 @@ includes: libraries: includes $(MAKE) -C lib build_ack -MKHEADERS411=/usr/gnu/libexec/gcc/i386-pc-minix/4.1.1/install-tools/mkheaders -MKHEADERS443=/usr/gnu/libexec/gcc/i686-pc-minix/4.4.3/install-tools/mkheaders MKHEADERS443_PKGSRC=/usr/pkg/gcc44/libexec/gcc/i686-pc-minix/4.4.3/install-tools/mkheaders gnu-includes: includes - SHELL=/bin/sh; if [ -f $(MKHEADERS411) ] ; then sh -e $(MKHEADERS411) ; fi - SHELL=/bin/sh; if [ -f $(MKHEADERS443) ] ; then sh -e $(MKHEADERS443) ; fi SHELL=/bin/sh; if [ -f $(MKHEADERS443_PKGSRC) ] ; then sh -e $(MKHEADERS443_PKGSRC) ; fi -.ifndef MINIX_GENERATE_ELF -gnu-libraries: includes #gnu-includes - $(MAKE) -C lib build_gnu - -clang-libraries: includes - $(MAKE) -C lib build_clang -.endif - -.ifdef MINIX_GENERATE_ELF elf-libraries: includes - $(MAKE) -C lib build_elf_base -.else -elf-libraries: elf-includes $(MAKE) -C lib build_elf -.endif commands: includes libraries $(MAKE) -C commands all diff --git a/docs/UPDATING b/docs/UPDATING index c883adcd2..81a5b95d0 100644 --- a/docs/UPDATING +++ b/docs/UPDATING @@ -1,3 +1,8 @@ +20110628: + Since buildworld will also build the elf-libraries, you + must follow the process in + http://wiki.minix3.org/en/UsersGuide/ELFSwitch + 20110624: (Next release bumped to MINIX 3.2.0.) ELF support in the base system. /usr/lib libraries diff --git a/lib/Makefile b/lib/Makefile index 9a1ff4488..2f174de35 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -33,18 +33,10 @@ SUBDIR+= libend build_ack: sh ack_build.sh obj depend all install -.if defined(MINIX_GENERATE_ELF) -build_elf_base: - sh elf_build_base.sh obj depend all install -.else -build_gnu: - sh gnu_build.sh obj depend all install -.endif +build_elf: + sh elf_build.sh obj depend all install clean_all: sh ack_build.sh clean - sh clang_build.sh clean - sh gnu_build.sh clean - sh elf_build_base.sh clean sh elf_build.sh clean diff --git a/lib/clang_build.sh b/lib/clang_build.sh deleted file mode 100755 index 25594d710..000000000 --- a/lib/clang_build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -export CC=clang -export COMPILER_TYPE=gnu -export PATH=$PATH:/usr/pkg/bin:/usr/gnu_cross/bin -export MAKEOBJDIR=obj-elf-clang -export NBSD_LIBC=${NBSD_LIBC} - -make $@ diff --git a/lib/elf_build.sh b/lib/elf_build.sh index 9ced7036a..b0cf857ee 100755 --- a/lib/elf_build.sh +++ b/lib/elf_build.sh @@ -1,16 +1,12 @@ #!/bin/sh -# This file is obsolete and is only useful to 'clean' its objects. +set -e -export CC=i386-pc-minix3-gcc +export CC=clang export COMPILER_TYPE=gnu -export MAKEOBJDIR=obj-elf -export PATH=$PATH:/usr/gnu_cross/bin -export NBSD_LIBC=${NBSD_LIBC} +export PATH=$PATH:/usr/pkg/bin -if [ "$@" != clean ] -then echo "$0: Unexpected arguments $@" - exit 1 -fi - -make $@ +export MAKEOBJDIR=obj-elfbase-nbsd +make $@ NBSD_LIBC=yes +export MAKEOBJDIR=obj-elfbase +make $@ NBSD_LIBC=no diff --git a/lib/elf_build_base.sh b/lib/elf_build_base.sh deleted file mode 100755 index b0cf857ee..000000000 --- a/lib/elf_build_base.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -set -e - -export CC=clang -export COMPILER_TYPE=gnu -export PATH=$PATH:/usr/pkg/bin - -export MAKEOBJDIR=obj-elfbase-nbsd -make $@ NBSD_LIBC=yes -export MAKEOBJDIR=obj-elfbase -make $@ NBSD_LIBC=no diff --git a/lib/gnu_build.sh b/lib/gnu_build.sh deleted file mode 100755 index 6a70cefa5..000000000 --- a/lib/gnu_build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh - -export CC=gcc -export PATH=$PATH:/usr/pkg/bin - -export MAKEOBJDIR=obj-gnu-nbsd -make $@ NBSD_LIBC=yes -export MAKEOBJDIR=obj-gnu -make $@ NBSD_LIBC=no diff --git a/share/mk/bsd.own.mk b/share/mk/bsd.own.mk index 198eddfe5..f90077df1 100644 --- a/share/mk/bsd.own.mk +++ b/share/mk/bsd.own.mk @@ -535,7 +535,7 @@ DEBUGMODE?= ${NONBINMODE} # All platforms are ELF. # #OBJECT_FMT= ELF -.if defined(MINIX_GENERATE_ELF) && ${COMPILER_TYPE} == "gnu" +.if ${COMPILER_TYPE} == "gnu" OBJECT_FMT= ELF .else OBJECT_FMT= a.out diff --git a/share/mk/sys.mk b/share/mk/sys.mk index 3bdb57821..e935aca12 100644 --- a/share/mk/sys.mk +++ b/share/mk/sys.mk @@ -238,11 +238,6 @@ COMPILER_TYPE=gnu AR?= ar .endif -.if exists(/usr/pkg/i386-pc-minix/lib/ldscripts/elf_i386_minix.x) \ - && exists(/usr/pkg/lib/clang/2.9) -MINIX_GENERATE_ELF=yes -.endif - # Set NBSD_LIBC to either "yes" or "no". .if !defined(NBSD) || (${NBSD} == "no") \ || !defined(COMPILER_TYPE) || (${COMPILER_TYPE} == "ack") -- 2.44.0