diff --git a/doc/porting_guide.txt b/doc/porting_guide.txt index 08ee16c13..97eff96be 100644 --- a/doc/porting_guide.txt +++ b/doc/porting_guide.txt @@ -826,12 +826,12 @@ Build rules for Noux packages are located in _/ports/src/noux-pkgs_. The _tar/target.mk_ corresponding to GNU tar looks like this: -! NOUX_CONFIGURE_ARGS = --bindir=/bin \ -! --libexecdir=/libexec +! CONFIGURE_ARGS = --bindir=/bin \ +! --libexecdir=/libexec ! ! include $(REP_DIR)/mk/noux.mk -The variable 'NOUX_CONFIGURE_ARGS' contains the options that are +The variable 'CONFIGURE_ARGS' contains the options that are passed on to Autoconf's configure script. The Noux specific build rules in _noux.mk_ always have to be included last. @@ -1051,24 +1051,24 @@ porting a program to Noux: ! # while compiling (e.g. -DSSH_PATH) and in the end the $prefix and ! # $exec_prefix path differ. ! -! NOUX_CONFIGURE_ARGS += --disable-ip6 \ -! […] -! --exec-prefix= \ -! --bindir=/bin \ -! --sbindir=/bin \ -! --libexecdir=/bin +! CONFIGURE_ARGS += --disable-ip6 \ +! […] +! --exec-prefix= \ +! --bindir=/bin \ +! --sbindir=/bin \ +! --libexecdir=/bin In addition to the normal configure options, we have to also define the path prefixes. The OpenSSH build system embeds certain paths in the ssh binary, which need to be changed for Noux. -! NOUX_INSTALL_TARGET = install +! INSTALL_TARGET = install Normally the Noux build rules (_noux.mk_) execute 'make install-strip' to explicitly install binaries that are stripped of their debug symbols. The generated Makefile of OpenSSH does not use this target. It automatically strips the binaries when executing 'make install'. Therefore, we set the -variable 'NOUX_INSTALL_TARGET' to override the default behaviour of the +variable 'INSTALL_TARGET' to override the default behaviour of the Noux build rules. ! LIBS += libcrypto libssl zlib libc_resolv @@ -1118,7 +1118,7 @@ script by providing dummy libraries: ! # ! Makefile: dummy_libs ! -! NOUX_LDFLAGS += -L$(PWD) +! LDFLAGS += -L$(PWD) ! ! dummy_libs: libz.a libcrypto.a libssl.a ! diff --git a/repos/ports/mk/gnu_build.mk b/repos/ports/mk/gnu_build.mk new file mode 100644 index 000000000..2185590ec --- /dev/null +++ b/repos/ports/mk/gnu_build.mk @@ -0,0 +1,190 @@ +# +# \brief Rules for building software that uses the GNU build tools +# \author Norman Feske +# \date 2011-02-02 +# +# This file is meant to be included by 'target.mk' files. Instead of building +# a normal Genode target, the 'target.mk' file will then trigger the build +# of the contrib package specified with the 'PKG' variable. The build +# consists to the following steps +# +# 1. Configuring the package by invoking the package's 'configure' script +# with the arguments required for cross compiling the package for +# Genode. +# 2. Building the package by invoking the 'Makefile' generated by the +# 'configure' script. +# +# Limitations +# ----------- +# +# In contrast to the Genode build system, library dependencies are not covered. +# So if a library used by a package is changed, the package gets not relinked +# automatically. In this case, 'make clean' must be invoked manually within the +# build subdirectory of the package. +# + +# +# Use name of the directory hosting the 'target.mk' file as 'TARGET' +# and 'PKG' by default. +# +TARGET ?= $(lastword $(subst /, ,$(PRG_DIR))) +PKG ?= $(TARGET) + +LIBS += libc libm + +PWD = $(shell pwd) + +# +# Detect missing preparation ofpackage +# +ifeq ($(PKG_DIR),) +REQUIRES += prepare_$(PKG) +endif + +# +# Verbose build +# +ifeq ($(VERBOSE),) +MAKE_VERBOSE = V=1 +CONFIGURE_VERBOSE = + +# +# Non-verbose build +# +else +MAKE_VERBOSE = -s +CONFIGURE_VERBOSE = --quiet + +# filter for configure output of package +CONFIGURE_OUTPUT_FILTER = > stdout.log 2> stderr.log ||\ + (echo "Error: configure script of $(PKG) failed" && \ + cat stderr.log && false) + +# filter for make output of package +BUILD_OUTPUT_FILTER = 2>&1 | sed "s/^/ [$(PKG)] /" + +endif + +ifeq ($(findstring arm, $(SPECS)), arm) +CONFIGURE_ARGS += --host arm-none-eabi +else +ifeq ($(findstring x86, $(SPECS)), x86) +CONFIGURE_ARGS += --host x86_64-pc-elf +endif +endif + +CONFIGURE_ARGS += --srcdir=$(PKG_DIR) +CONFIGURE_ARGS += --prefix / + +CONFIG_GUESS_SCRIPT = $(PKG_DIR)/config.guess +ifneq ($(wildcard $(CONFIG_GUESS_SCRIPT)),) +CONFIGURE_ARGS += --build $(shell $(CONFIG_GUESS_SCRIPT)) +else +CONFIGURE_ARGS += --build x86-linux +endif + +CONFIGURE_ARGS += $(CONFIGURE_VERBOSE) + +LDFLAGS += -nostdlib $(CXX_LINK_OPT) $(CC_MARCH) -Wl,-T$(LD_SCRIPT_DYN) \ + -Wl,--dynamic-linker=$(DYNAMIC_LINKER).lib.so \ + -Wl,--eh-frame-hdr +LIBTOOLFLAGS = --preserve-dup-deps + +LIBGCC = $(shell $(CC) $(CC_MARCH) -print-libgcc-file-name) + +CPPFLAGS += -nostdinc $(INCLUDES) +CPPFLAGS += -D_GNU_SOURCE=1 + +# flags to be used in both CFLAGS and CXXFLAGS +COMMON_CFLAGS_CXXFLAGS += -ffunction-sections $(CC_OLEVEL) $(CC_MARCH) +COMMON_CFLAGS_CXXFLAGS += -g + +CFLAGS += $(COMMON_CFLAGS_CXXFLAGS) +CXXFLAGS += $(COMMON_CFLAGS_CXXFLAGS) + +# +# We have to specify 'LINK_ITEMS' twice to resolve inter-library dependencies. +# Unfortunately, the use of '--start-group' and '--end-group' does not suffice +# in all cases because 'libtool' strips those arguments from the 'LIBS' variable. +# +# Furthermore, 'libtool' reorders library names on the command line in a way that +# shared libraries appear before static libraries. This has the unfortunate effect +# that the program's entry symbol 'Genode::component_entry_point' in the static +# library 'component_entry_point.lib.a' is not found anymore. Passing the static +# library names as linker arguments (-Wl,...) works around this problem, because +# 'libtool' keeps command line arguments before the shared library names. +# + +LDLIBS_A = $(filter %.a, $(sort $(LINK_ITEMS)) $(EXT_OBJECTS) $(LIBGCC)) +LDLIBS_SO = $(filter %.so,$(sort $(LINK_ITEMS)) $(EXT_OBJECTS) $(LIBGCC)) +comma := , +LDLIBS += $(addprefix -Wl$(comma),$(LDLIBS_A)) $(LDLIBS_SO) $(LDLIBS_A) + +# +# Re-configure the Makefile if the Genode build environment changes +# +Makefile reconfigure: $(MAKEFILE_LIST) + +# +# Invoke configure script with the Genode environment +# +Makefile reconfigure: env.sh + @$(MSG_CONFIG)$(TARGET) + $(VERBOSE)source env.sh && $(PKG_DIR)/configure $(ENV) $(CONFIGURE_ARGS) $(CONFIGURE_OUTPUT_FILTER) + +env.sh: + $(VERBOSE)rm -f $@ + $(VERBOSE)echo "export CC='$(CC)'" >> $@ + $(VERBOSE)echo "export CXX='$(CXX)'" >> $@ + $(VERBOSE)echo "export LD='$(LD)'" >> $@ + $(VERBOSE)echo "export AR='$(AR)'" >> $@ + $(VERBOSE)echo "export NM='$(NM)'" >> $@ + $(VERBOSE)echo "export RANLIB='$(RANLIB)'" >> $@ + $(VERBOSE)echo "export STRIP='$(STRIP)'" >> $@ + $(VERBOSE)echo "export CPPFLAGS='$(CPPFLAGS)'" >> $@ + $(VERBOSE)echo "export CFLAGS='$(CFLAGS)'" >> $@ + $(VERBOSE)echo "export CXXFLAGS='$(CXXFLAGS)'" >> $@ + $(VERBOSE)echo "export LDFLAGS='$(LDFLAGS)'" >> $@ + $(VERBOSE)echo "export LIBS='$(LDLIBS)'" >> $@ + $(VERBOSE)echo "export LIBTOOLFLAGS='$(LIBTOOLFLAGS)'" >> $@ + $(VERBOSE)echo "export PS1=''" >> $@ + +# +# Invoke the 'Makefile' generated by the configure script +# +# The 'MAN=' argument prevent manual pages from being created. This would +# produce an error when the package uses the 'help2man' tool. This tool +# tries to extract the man page of a program by executing it with the +# '--help' argument on the host. However, we cannot run Genode binaries +# this way. +# +built.tag: env.sh Makefile + @$(MSG_BUILD)$(TARGET) + $(VERBOSE)source env.sh && $(MAKE) $(MAKE_ENV) $(MAKE_VERBOSE) MAN= $(BUILD_OUTPUT_FILTER) + @touch $@ + +INSTALL_TARGET ?= install-strip + +installed.tag: built.tag + @$(MSG_INST)$(TARGET) + $(VERBOSE)source env.sh && $(MAKE) $(MAKE_ENV) $(MAKE_VERBOSE) $(INSTALL_TARGET) DESTDIR=$(PWD)/install MAN= >> stdout.log 2>> stderr.log + $(VERBOSE)rm -f $(INSTALL_DIR)/$(TARGET) + $(VERBOSE)ln -sf $(PWD)/install $(INSTALL_DIR)/$(TARGET) + @touch $@ + +$(TARGET): installed.tag + @touch $@ + +# +# The clean rule is expected to be executed within the 3rd-party build +# directory. The check should prevent serious damage if this condition +# is violated (e.g., while working on the build system). +# +ifeq ($(notdir $(PWD)),$(notdir $(PRG_DIR))) +clean_dir: + $(VERBOSE)rm -rf $(PWD)/* $(PWD)/.* + +clean_prg_objects: clean_dir +endif + + diff --git a/repos/ports/mk/noux.mk b/repos/ports/mk/noux.mk index f3f669274..e3114fddb 100644 --- a/repos/ports/mk/noux.mk +++ b/repos/ports/mk/noux.mk @@ -1,193 +1,8 @@ -# -# \brief Rules for building software that uses the GNU build tools -# \author Norman Feske -# \date 2011-02-02 -# -# This file is meant to be included by 'target.mk' files. Instead of building -# a normal Genode target, the 'target.mk' file will then trigger the build -# of the contrib package specified with the 'NOUX_PKG' variable. The build -# consists to the following steps -# -# 1. Configuring the package by invoking the package's 'configure' script -# with the arguments required for cross compiling the package for -# Genode. -# 2. Building the package by invoking the 'Makefile' generated by the -# 'configure' script. -# -# Limitations -# ----------- -# -# In contrast to the Genode build system, library dependencies are not covered. -# So if a library used by a noux package is changed, the noux package gets not -# relinked automatically. In this case, 'make clean' must be invoked manually -# within the build subdirectory of the noux package. -# +GNU_BUILD_MK := $(call select_from_repositories,mk/gnu_build.mk) -# -# Use name of the directory hosting the 'target.mk' file as 'TARGET' -# and 'NOUX_PKG' by default. -# -TARGET ?= $(lastword $(subst /, ,$(PRG_DIR))) +LIBS += libc_noux -NOUX_PKG ?= $(TARGET) - -LIBS += libc libm libc_noux - -NOUX_PKG_DIR ?= $(call select_from_ports,$(NOUX_PKG))/src/noux-pkg/$(NOUX_PKG) - -PWD = $(shell pwd) - -# -# Detect missing preparation of noux package -# -ifeq ($(NOUX_PKG_DIR),) -REQUIRES += prepare_$(NOUX_PKG) -endif - -# -# Verbose build -# -ifeq ($(VERBOSE),) -NOUX_MAKE_VERBOSE = V=1 -NOUX_CONFIGURE_VERBOSE = - -# -# Non-verbose build -# -else -NOUX_MAKE_VERBOSE = -s -NOUX_CONFIGURE_VERBOSE = --quiet - -# filter for configure output of noux package -NOUX_CONFIGURE_OUTPUT_FILTER = > stdout.log 2> stderr.log ||\ - (echo "Error: configure script of $(NOUX_PKG) failed" && \ - cat stderr.log && false) - -# filter for make output of noux package -NOUX_BUILD_OUTPUT_FILTER = 2>&1 | sed "s/^/ [$(NOUX_PKG)] /" - -endif - -ifeq ($(findstring arm, $(SPECS)), arm) -NOUX_CONFIGURE_ARGS += --host arm-none-eabi -else -ifeq ($(findstring x86, $(SPECS)), x86) -NOUX_CONFIGURE_ARGS += --host x86_64-pc-elf -endif -endif - -NOUX_CONFIGURE_ARGS += --srcdir=$(NOUX_PKG_DIR) -NOUX_CONFIGURE_ARGS += --prefix / - -CONFIG_GUESS_SCRIPT = $(NOUX_PKG_DIR)/config.guess -ifneq ($(wildcard $(CONFIG_GUESS_SCRIPT)),) -NOUX_CONFIGURE_ARGS += --build $(shell $(CONFIG_GUESS_SCRIPT)) -else -NOUX_CONFIGURE_ARGS += --build x86-linux -endif - -NOUX_CONFIGURE_ARGS += $(NOUX_CONFIGURE_VERBOSE) - -NOUX_LDFLAGS += -nostdlib $(CXX_LINK_OPT) $(CC_MARCH) -Wl,-T$(LD_SCRIPT_DYN) \ - -Wl,--dynamic-linker=$(DYNAMIC_LINKER).lib.so \ - -Wl,--eh-frame-hdr -NOUX_LIBTOOLFLAGS = --preserve-dup-deps - -LIBGCC = $(shell $(CC) $(CC_MARCH) -print-libgcc-file-name) - -NOUX_CPPFLAGS += -nostdinc $(INCLUDES) -NOUX_CPPFLAGS += -D_GNU_SOURCE=1 - -# flags to be used in both CFLAGS and CXXFLAGS -NOUX_COMMON_CFLAGS_CXXFLAGS += -ffunction-sections $(CC_OLEVEL) $(CC_MARCH) -NOUX_COMMON_CFLAGS_CXXFLAGS += -g - -NOUX_CFLAGS += $(NOUX_COMMON_CFLAGS_CXXFLAGS) -NOUX_CXXFLAGS += $(NOUX_COMMON_CFLAGS_CXXFLAGS) - -# -# We have to specify 'LINK_ITEMS' twice to resolve inter-library dependencies. -# Unfortunately, the use of '--start-group' and '--end-group' does not suffice -# in all cases because 'libtool' strips those arguments from the 'LIBS' variable. -# -# Furthermore, 'libtool' reorders library names on the command line in a way that -# shared libraries appear before static libraries. This has the unfortunate effect -# that the program's entry symbol 'Genode::component_entry_point' in the static -# library 'component_entry_point.lib.a' is not found anymore. Passing the static -# library names as linker arguments (-Wl,...) works around this problem, because -# 'libtool' keeps command line arguments before the shared library names. -# - -NOUX_LIBS_A = $(filter %.a, $(sort $(LINK_ITEMS)) $(EXT_OBJECTS) $(LIBGCC)) -NOUX_LIBS_SO = $(filter %.so,$(sort $(LINK_ITEMS)) $(EXT_OBJECTS) $(LIBGCC)) -comma := , -NOUX_LIBS += $(addprefix -Wl$(comma),$(NOUX_LIBS_A)) $(NOUX_LIBS_SO) $(NOUX_LIBS_A) - -# -# Re-configure the Makefile if the Genode build environment changes -# -Makefile reconfigure: $(MAKEFILE_LIST) - -# -# Invoke configure script with the Genode environment -# -Makefile reconfigure: noux_env.sh - @$(MSG_CONFIG)$(TARGET) - $(VERBOSE)source noux_env.sh && $(NOUX_PKG_DIR)/configure $(NOUX_ENV) $(NOUX_CONFIGURE_ARGS) $(NOUX_CONFIGURE_OUTPUT_FILTER) - -noux_env.sh: - $(VERBOSE)rm -f $@ - $(VERBOSE)echo "export CC='$(CC)'" >> $@ - $(VERBOSE)echo "export CXX='$(CXX)'" >> $@ - $(VERBOSE)echo "export LD='$(LD)'" >> $@ - $(VERBOSE)echo "export AR='$(AR)'" >> $@ - $(VERBOSE)echo "export NM='$(NM)'" >> $@ - $(VERBOSE)echo "export RANLIB='$(RANLIB)'" >> $@ - $(VERBOSE)echo "export STRIP='$(STRIP)'" >> $@ - $(VERBOSE)echo "export CPPFLAGS='$(NOUX_CPPFLAGS)'" >> $@ - $(VERBOSE)echo "export CFLAGS='$(NOUX_CFLAGS)'" >> $@ - $(VERBOSE)echo "export CXXFLAGS='$(NOUX_CXXFLAGS)'" >> $@ - $(VERBOSE)echo "export LDFLAGS='$(NOUX_LDFLAGS)'" >> $@ - $(VERBOSE)echo "export LIBS='$(NOUX_LIBS)'" >> $@ - $(VERBOSE)echo "export LIBTOOLFLAGS='$(NOUX_LIBTOOLFLAGS)'" >> $@ - $(VERBOSE)echo "export PS1=''" >> $@ - -# -# Invoke the 'Makefile' generated by the configure script -# -# The 'MAN=' argument prevent manual pages from being created. This would -# produce an error when the package uses the 'help2man' tool. This tool -# tries to extract the man page of a program by executing it with the -# '--help' argument on the host. However, we cannot run Genode binaries -# this way. -# -noux_built.tag: noux_env.sh Makefile - @$(MSG_BUILD)$(TARGET) - $(VERBOSE)source noux_env.sh && $(MAKE) $(NOUX_MAKE_ENV) $(NOUX_MAKE_VERBOSE) MAN= $(NOUX_BUILD_OUTPUT_FILTER) - @touch $@ - -NOUX_INSTALL_TARGET ?= install-strip - -noux_installed.tag: noux_built.tag - @$(MSG_INST)$(TARGET) - $(VERBOSE)source noux_env.sh && $(MAKE) $(NOUX_MAKE_ENV) $(NOUX_MAKE_VERBOSE) $(NOUX_INSTALL_TARGET) DESTDIR=$(PWD)/install MAN= >> stdout.log 2>> stderr.log - $(VERBOSE)rm -f $(INSTALL_DIR)/$(TARGET) - $(VERBOSE)ln -sf $(PWD)/install $(INSTALL_DIR)/$(TARGET) - @touch $@ - -$(TARGET): noux_installed.tag - @touch $@ - -# -# The clean rule is expected to be executed within the 3rd-party build -# directory. The check should prevent serious damage if this condition -# is violated (e.g., while working on the build system). -# -ifeq ($(notdir $(PWD)),$(notdir $(PRG_DIR))) -clean_noux_build_dir: - $(VERBOSE)rm -rf $(PWD) - -clean_prg_objects: clean_noux_build_dir -endif +PKG_DIR ?= $(call select_from_ports,$(PKG))/src/noux-pkg/$(PKG) +include $(GNU_BUILD_MK) diff --git a/repos/ports/src/noux-pkg/bash/target.mk b/repos/ports/src/noux-pkg/bash/target.mk index e84e1b7e9..e667d55a8 100644 --- a/repos/ports/src/noux-pkg/bash/target.mk +++ b/repos/ports/src/noux-pkg/bash/target.mk @@ -1,14 +1,14 @@ -NOUX_CONFIGURE_ARGS = --without-bash-malloc -NOUX_CFLAGS += -Dsh_xfree=free +CONFIGURE_ARGS = --without-bash-malloc +CFLAGS += -Dsh_xfree=free # # Do not expect the environment to be passed as third argument # to the main function. The Genode startup code does only # deliver 'argc' and 'argv'. # -NOUX_CFLAGS += -DNO_MAIN_ENV_ARG=1 +CFLAGS += -DNO_MAIN_ENV_ARG=1 # Prevent interactions with nonexisting tty driver -NOUX_CFLAGS += -DNO_TTY_DRIVER +CFLAGS += -DNO_TTY_DRIVER include $(REP_DIR)/mk/noux.mk diff --git a/repos/ports/src/noux-pkg/binutils/target.inc b/repos/ports/src/noux-pkg/binutils/target.inc index e946f0284..5f15c3617 100644 --- a/repos/ports/src/noux-pkg/binutils/target.inc +++ b/repos/ports/src/noux-pkg/binutils/target.inc @@ -1,15 +1,15 @@ -NOUX_CFLAGS += -std=c99 -NOUX_CONFIGURE_ARGS = --disable-werror \ - --program-prefix=$(PROGRAM_PREFIX) \ - --target=$(BINUTILS_TARGET) +CFLAGS += -std=c99 +CONFIGURE_ARGS = --disable-werror \ + --program-prefix=$(PROGRAM_PREFIX) \ + --target=$(BINUTILS_TARGET) # # Pass CFLAGS and friends to the invokation of 'make' because # binutils execute 2nd-level configure scripts, which need -# the 'NOUX_ENV' as well. +# the 'ENV' as well. # -NOUX_MAKE_ENV = $(NOUX_ENV) +MAKE_ENV = $(ENV) -NOUX_PKG_DIR = $(call select_from_ports,binutils)/src/noux-pkg/binutils +PKG_DIR = $(call select_from_ports,binutils)/src/noux-pkg/binutils include $(REP_DIR)/mk/noux.mk diff --git a/repos/ports/src/noux-pkg/coreutils/target.mk b/repos/ports/src/noux-pkg/coreutils/target.mk index a57d3e876..8263f2b45 100644 --- a/repos/ports/src/noux-pkg/coreutils/target.mk +++ b/repos/ports/src/noux-pkg/coreutils/target.mk @@ -1,11 +1,11 @@ -NOUX_CONFIGURE_ARGS = --disable-acl --disable-largefile --disable-xattr \ - --disable-libcap --disable-nls +CONFIGURE_ARGS = --disable-acl --disable-largefile --disable-xattr \ + --disable-libcap --disable-nls # # Prevent building stdbuf because this involves the linkage of a shared # libary, which is not supported by Noux, yet. # -NOUX_CPPFLAGS += -U__ELF__ -NOUX_MAKE_ENV += "MAKEINFO=true" +CPPFLAGS += -U__ELF__ +MAKE_ENV += "MAKEINFO=true" include $(REP_DIR)/mk/noux.mk diff --git a/repos/ports/src/noux-pkg/dash/target.mk b/repos/ports/src/noux-pkg/dash/target.mk index 4887ee8e6..83d2569ca 100644 --- a/repos/ports/src/noux-pkg/dash/target.mk +++ b/repos/ports/src/noux-pkg/dash/target.mk @@ -3,6 +3,6 @@ # compiler command line, but also in the 'sys/param.h' header of the FreeBSD # libc. # -NOUX_CFLAGS = -UBSD +CFLAGS = -UBSD include $(REP_DIR)/mk/noux.mk diff --git a/repos/ports/src/noux-pkg/e2fsprogs/target.mk b/repos/ports/src/noux-pkg/e2fsprogs/target.mk index 832e1db91..8be1a36a9 100644 --- a/repos/ports/src/noux-pkg/e2fsprogs/target.mk +++ b/repos/ports/src/noux-pkg/e2fsprogs/target.mk @@ -1,4 +1,4 @@ -NOUX_CONFIGURE_FLAGS = --disable-tls --enable-fsck +CONFIGURE_FLAGS = --disable-tls --enable-fsck # NOTE: --sbindir=/bin is broken and the easist fix is patching configure # directly and therefore is not used. @@ -6,6 +6,6 @@ NOUX_CONFIGURE_FLAGS = --disable-tls --enable-fsck # # Needed for # -NOUX_CFLAGS += -D__BSD_VISIBLE +CFLAGS += -D__BSD_VISIBLE include $(REP_DIR)/mk/noux.mk diff --git a/repos/ports/src/noux-pkg/gcc/target.inc b/repos/ports/src/noux-pkg/gcc/target.inc index 52fe51bd2..dae99f9b7 100644 --- a/repos/ports/src/noux-pkg/gcc/target.inc +++ b/repos/ports/src/noux-pkg/gcc/target.inc @@ -1,37 +1,37 @@ PWD = $(shell pwd) -NOUX_PKG_DIR = $(call select_from_ports,gcc)/src/noux-pkg/gcc +PKG_DIR = $(call select_from_ports,gcc)/src/noux-pkg/gcc -NOUX_CONFIGURE_ARGS = --program-prefix=$(PROGRAM_PREFIX) \ - --target=$(GCC_TARGET) \ - --enable-languages=c,c++ \ - --disable-libgo \ - --disable-libssp \ - --disable-libquadmath \ - --disable-libffi \ - --enable-targets=all \ - --with-gnu-as \ - --with-gnu-ld \ - --disable-tls \ - --disable-threads \ - --disable-hosted-libstdcxx \ - --enable-shared \ - --enable-multiarch \ - --disable-sjlj-exceptions +CONFIGURE_ARGS = --program-prefix=$(PROGRAM_PREFIX) \ + --target=$(GCC_TARGET) \ + --enable-languages=c,c++ \ + --disable-libgo \ + --disable-libssp \ + --disable-libquadmath \ + --disable-libffi \ + --enable-targets=all \ + --with-gnu-as \ + --with-gnu-ld \ + --disable-tls \ + --disable-threads \ + --disable-hosted-libstdcxx \ + --enable-shared \ + --enable-multiarch \ + --disable-sjlj-exceptions -NOUX_ENV += host_configargs="$(HOST_CONFIG_ARGS)" \ - target_configargs="$(TARGET_CONFIG_ARGS)" +ENV += host_configargs="$(HOST_CONFIG_ARGS)" \ + target_configargs="$(TARGET_CONFIG_ARGS)" -NOUX_ENV += CC_FOR_TARGET=$(CC) CXX_FOR_TARGET=$(CXX) GCC_FOR_TARGET=$(CC) CPP_FOR_TARGET="$(CC) -E" \ - LD_FOR_TARGET=$(LD) AS_FOR_TARGET=$(AS) AR_FOR_TARGET=$(AR) +ENV += CC_FOR_TARGET=$(CC) CXX_FOR_TARGET=$(CXX) GCC_FOR_TARGET=$(CC) CPP_FOR_TARGET="$(CC) -E" \ + LD_FOR_TARGET=$(LD) AS_FOR_TARGET=$(AS) AR_FOR_TARGET=$(AR) # libgcc does not evaluate CPPFLAGS_FOR_TARGET, so everything is put into CFLAGS_FOR_TARGET here -NOUX_ENV += CFLAGS_FOR_TARGET='-I$(BASE_DIR)/../../tool -DUSE_PT_GNU_EH_FRAME -Dinhibit_libc -fPIC' +ENV += CFLAGS_FOR_TARGET='-I$(BASE_DIR)/../../tool -DUSE_PT_GNU_EH_FRAME -Dinhibit_libc -fPIC' # libsupc++ -NOUX_ENV += CXXFLAGS_FOR_TARGET='-fPIC' +ENV += CXXFLAGS_FOR_TARGET='-fPIC' -NOUX_MAKE_ENV += MULTILIB_OPTIONS="m64/m32" MULTILIB_DIRNAMES="64 32" +MAKE_ENV += MULTILIB_OPTIONS="m64/m32" MULTILIB_DIRNAMES="64 32" # # We link libraries to the final binaries using the 'LIBS' variable. But @@ -41,7 +41,7 @@ NOUX_MAKE_ENV += MULTILIB_OPTIONS="m64/m32" MULTILIB_DIRNAMES="64 32" LIBS = gmp mpfr mpc -NOUX_LDFLAGS += -L$(PWD) +LDFLAGS += -L$(PWD) .SECONDARY: dummy_libs dummy_libs: libgmp.a libmpfr.a libmpc.a libc.a @@ -60,4 +60,4 @@ include $(REP_DIR)/mk/noux.mk # Unfortunately, the use of '--start-group' and '--end-group' does not suffice # in all cases because 'libtool' strips those arguments from the 'LIBS' variable. # -NOUX_LIBS += -Wl,--start-group $(sort $(LINK_ITEMS)) $(sort $(LINK_ITEMS)) $(LIBGCC) -Wl,--end-group +LDLIBS += -Wl,--start-group $(sort $(LINK_ITEMS)) $(sort $(LINK_ITEMS)) $(LIBGCC) -Wl,--end-group diff --git a/repos/ports/src/noux-pkg/gdb/target.inc b/repos/ports/src/noux-pkg/gdb/target.inc index a72a3e3d2..1bf1cd6c2 100644 --- a/repos/ports/src/noux-pkg/gdb/target.inc +++ b/repos/ports/src/noux-pkg/gdb/target.inc @@ -1,18 +1,18 @@ -NOUX_PKG_DIR = $(call select_from_ports,gdb)/src/noux-pkg/gdb +PKG_DIR = $(call select_from_ports,gdb)/src/noux-pkg/gdb -NOUX_CONFIGURE_ARGS += --program-prefix=$(PROGRAM_PREFIX) \ - --target=$(GDB_TARGET) +CONFIGURE_ARGS += --program-prefix=$(PROGRAM_PREFIX) \ + --target=$(GDB_TARGET) # the configure script calls the linker with "-lexpat", which fails -NOUX_CONFIGURE_ARGS += --without-expat -NOUX_CPPFLAGS += -DHAVE_LIBEXPAT=1 -NOUX_CFLAGS += -Wno-error=sizeof-pointer-memaccess -Wno-error=unused-value +CONFIGURE_ARGS += --without-expat +CPPFLAGS += -DHAVE_LIBEXPAT=1 +CFLAGS += -Wno-error=sizeof-pointer-memaccess -Wno-error=unused-value LIBS += ncurses expat # workaround for problems with makeinfo version 5 -NOUX_MAKE_ENV += "MAKEINFO=true" +MAKE_ENV += "MAKEINFO=true" -NOUX_INSTALL_TARGET = install +INSTALL_TARGET = install include $(REP_DIR)/mk/noux.mk diff --git a/repos/ports/src/noux-pkg/grep/target.mk b/repos/ports/src/noux-pkg/grep/target.mk index 9bd2469dc..6badbbc0c 100644 --- a/repos/ports/src/noux-pkg/grep/target.mk +++ b/repos/ports/src/noux-pkg/grep/target.mk @@ -1,12 +1,5 @@ -NOUX_CONFIGURE_FLAGS = --without-included-regex - -#NOUX_INSTALL_TARGET = +CONFIGURE_FLAGS = --without-included-regex LIBS += pcre -# -# Prevent double definition of '__size_t' in 'glob/glob.h' -# -#NOUX_CPPFLAGS += -D__FreeBSD__ - include $(REP_DIR)/mk/noux.mk diff --git a/repos/ports/src/noux-pkg/less/target.mk b/repos/ports/src/noux-pkg/less/target.mk index f94bd1dea..3a46fb238 100644 --- a/repos/ports/src/noux-pkg/less/target.mk +++ b/repos/ports/src/noux-pkg/less/target.mk @@ -7,7 +7,7 @@ LIBS = ncurses # Makefile: dummy_libs -NOUX_LDFLAGS += -L$(PWD) +LDFLAGS += -L$(PWD) dummy_libs: libncursesw.a diff --git a/repos/ports/src/noux-pkg/lynx/target.mk b/repos/ports/src/noux-pkg/lynx/target.mk index f9ef65e9b..edb1d380c 100644 --- a/repos/ports/src/noux-pkg/lynx/target.mk +++ b/repos/ports/src/noux-pkg/lynx/target.mk @@ -1,21 +1,21 @@ -NOUX_CONFIGURE_ARGS = --with-ssl \ - --with-zlib \ - --disable-nls \ - --disable-ipv6 \ - --disable-rpath-hack \ - --with-cfg-file=/etc/lynx.cfg \ - --with-lss-file=/etc/lynx.lss +CONFIGURE_ARGS = --with-ssl \ + --with-zlib \ + --disable-nls \ + --disable-ipv6 \ + --disable-rpath-hack \ + --with-cfg-file=/etc/lynx.cfg \ + --with-lss-file=/etc/lynx.lss # # Rather than dealing with autoconf force usage of # by defining it explicitly # -NOUX_CFLAGS += -DUSE_OPENSSL_INCL +CFLAGS += -DUSE_OPENSSL_INCL # # Needed for # -NOUX_CFLAGS += -D__BSD_VISIBLE +CFLAGS += -D__BSD_VISIBLE LIBS += ncurses zlib libssl libcrypto libc_resolv @@ -24,7 +24,7 @@ LIBS += ncurses zlib libssl libcrypto libc_resolv # Makefile: dummy_libs -NOUX_LDFLAGS += -L$(PWD) +LDFLAGS += -L$(PWD) dummy_libs: libcrypto.a libssl.a libz.a @@ -37,6 +37,6 @@ libssl.a: libz.a: $(VERBOSE)$(AR) -rc $@ -NOUX_INSTALL_TARGET = install +INSTALL_TARGET = install include $(REP_DIR)/mk/noux.mk diff --git a/repos/ports/src/noux-pkg/make/target.mk b/repos/ports/src/noux-pkg/make/target.mk index b365e4414..9c6b57154 100644 --- a/repos/ports/src/noux-pkg/make/target.mk +++ b/repos/ports/src/noux-pkg/make/target.mk @@ -1,6 +1,6 @@ # # Prevent double definition of '__size_t' in 'glob/glob.h' # -NOUX_CPPFLAGS += -D__FreeBSD__ +CPPFLAGS += -D__FreeBSD__ include $(REP_DIR)/mk/noux.mk diff --git a/repos/ports/src/noux-pkg/openssh/target.mk b/repos/ports/src/noux-pkg/openssh/target.mk index fe0b974bb..63dfb33ca 100644 --- a/repos/ports/src/noux-pkg/openssh/target.mk +++ b/repos/ports/src/noux-pkg/openssh/target.mk @@ -5,27 +5,27 @@ TARGET = openssh # while compiling (e.g. -DSSH_PATH) and in the end the $prefix and # $exec_prefix path differ. # -NOUX_CONFIGURE_ARGS += --disable-ip6 \ - --with-md5-passwords \ - --without-zlib-version-check \ - --with-ssl-engine \ - --disable-finger \ - --disable-gopher \ - --disable-news \ - --disable-ftp \ - --disable-rpath-hack \ - --disable-utmpx \ - --disable-strip \ - --exec-prefix= \ - --bindir=/bin \ - --sbindir=/bin \ - --libexecdir=/bin +CONFIGURE_ARGS += --disable-ip6 \ + --with-md5-passwords \ + --without-zlib-version-check \ + --with-ssl-engine \ + --disable-finger \ + --disable-gopher \ + --disable-news \ + --disable-ftp \ + --disable-rpath-hack \ + --disable-utmpx \ + --disable-strip \ + --exec-prefix= \ + --bindir=/bin \ + --sbindir=/bin \ + --libexecdir=/bin -NOUX_INSTALL_TARGET = install +INSTALL_TARGET = install LIBS += libcrypto libssl zlib libc_resolv -noux_built.tag: Makefile Makefile_patch +built.tag: Makefile Makefile_patch Makefile_patch: Makefile @# @@ -52,7 +52,7 @@ Makefile_patch: Makefile # Makefile: dummy_libs -NOUX_LDFLAGS += -L$(PWD) +LDFLAGS += -L$(PWD) dummy_libs: libz.a libcrypto.a libssl.a diff --git a/repos/ports/src/noux-pkg/sed/target.mk b/repos/ports/src/noux-pkg/sed/target.mk index a62b75264..23cca0058 100644 --- a/repos/ports/src/noux-pkg/sed/target.mk +++ b/repos/ports/src/noux-pkg/sed/target.mk @@ -1,10 +1,10 @@ -NOUX_CONFIGURE_FLAGS = --without-included-regex +CONFIGURE_FLAGS = --without-included-regex LIBS += pcre # # Prevent double definition of '__size_t' in 'glob/glob.h' # -#NOUX_CPPFLAGS += -D__FreeBSD__ +#CPPFLAGS += -D__FreeBSD__ include $(REP_DIR)/mk/noux.mk diff --git a/repos/ports/src/noux-pkg/vim/target.mk b/repos/ports/src/noux-pkg/vim/target.mk index 2fb787175..b974e3542 100644 --- a/repos/ports/src/noux-pkg/vim/target.mk +++ b/repos/ports/src/noux-pkg/vim/target.mk @@ -1,43 +1,43 @@ -NOUX_CONFIGURE_ARGS = --disable-selinux --disable-xsmp --disable-xsmp-interact \ - --disable-netbeans --disable-gtktest --disable-largefile \ - --disable-acl --disable-gpm --disable-sysmouse \ - --disable-nls +CONFIGURE_ARGS = --disable-selinux --disable-xsmp --disable-xsmp-interact \ + --disable-netbeans --disable-gtktest --disable-largefile \ + --disable-acl --disable-gpm --disable-sysmouse \ + --disable-nls # # configure: error: cross-compiling: please set 'vim_cv_toupper_broken' # -NOUX_CONFIGURE_ARGS += vim_cv_toupper_broken=yes +CONFIGURE_ARGS += vim_cv_toupper_broken=yes # # configure: error: NOT FOUND! # You need to install a terminal library; for example ncurses. # Or specify the name of the library with --with-tlib. # -NOUX_CONFIGURE_ARGS += --with-tlib=ncurses +CONFIGURE_ARGS += --with-tlib=ncurses # # configure: error: cross-compiling: please set ... # -NOUX_CONFIGURE_ARGS += vim_cv_terminfo=linux -NOUX_CONFIGURE_ARGS += vim_cv_tty_group=world -NOUX_CONFIGURE_ARGS += vim_cv_tty_mode=0620 -NOUX_CONFIGURE_ARGS += vim_cv_getcwd_broken=no -NOUX_CONFIGURE_ARGS += vim_cv_stat_ignores_slash=no -NOUX_CONFIGURE_ARGS += vim_cv_memmove_handles_overlap=yes +CONFIGURE_ARGS += vim_cv_terminfo=linux +CONFIGURE_ARGS += vim_cv_tty_group=world +CONFIGURE_ARGS += vim_cv_tty_mode=0620 +CONFIGURE_ARGS += vim_cv_getcwd_broken=no +CONFIGURE_ARGS += vim_cv_stat_ignores_slash=no +CONFIGURE_ARGS += vim_cv_memmove_handles_overlap=yes -NOUX_INSTALL_TARGET = install +INSTALL_TARGET = install LIBS += ncurses include $(REP_DIR)/mk/noux.mk -noux_env.sh: mirror_vim_src.tag flush_config_cache.tag +env.sh: mirror_vim_src.tag flush_config_cache.tag mirror_vim_src.tag: - $(VERBOSE)cp -af $(NOUX_PKG_DIR)/src $(PWD) - $(VERBOSE)cp -af $(NOUX_PKG_DIR)/Makefile $(PWD) - $(VERBOSE)ln -sf $(NOUX_PKG_DIR)/Filelist $(PWD) - $(VERBOSE)ln -sf $(NOUX_PKG_DIR)/runtime $(PWD) + $(VERBOSE)cp -af $(PKG_DIR)/src $(PWD) + $(VERBOSE)cp -af $(PKG_DIR)/Makefile $(PWD) + $(VERBOSE)ln -sf $(PKG_DIR)/Filelist $(PWD) + $(VERBOSE)ln -sf $(PKG_DIR)/runtime $(PWD) # let the configure script update the Makefile time stamp $(VERBOSE)sed -i "/exit/s/^/touch ..\/Makefile\n/" src/configure @touch $@ @@ -51,7 +51,7 @@ flush_config_cache.tag: # Makefile: dummy_libs -NOUX_LDFLAGS += -L$(PWD) +LDFLAGS += -L$(PWD) .SECONDARY: dummy_libs dummy_libs: libncurses.a