From 47690b8802f378f5615d17f9638b759794c65cb8 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Mon, 19 Nov 2012 20:38:35 +0100 Subject: [PATCH] Noux: make install target configurable With this patch the make install target for Noux applications gets defined in the 'NOUX_INSTALL_TARGET' make variable with 'install-strip' as default. Fixes #503. --- ports/mk/noux.mk | 4 ++- ports/ports/binutils.mk | 2 +- ports/src/noux-pkg/bash/build.patch | 23 ++++++++++-- ports/src/noux-pkg/binutils/build.patch | 48 +++++++++++++++++++++++++ ports/src/noux-pkg/gdb/target.inc | 2 ++ ports/src/noux-pkg/lynx/target.mk | 1 + ports/src/noux-pkg/vim/target.mk | 2 ++ 7 files changed, 77 insertions(+), 5 deletions(-) create mode 100644 ports/src/noux-pkg/binutils/build.patch diff --git a/ports/mk/noux.mk b/ports/mk/noux.mk index 234f92414c..9d022c3006 100644 --- a/ports/mk/noux.mk +++ b/ports/mk/noux.mk @@ -174,9 +174,11 @@ noux_built.tag: noux_env.sh Makefile $(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)$(MAKE) $(NOUX_MAKE_VERBOSE) install DESTDIR=$(PWD)/install MAN= >> stdout.log 2>> stderr.log + $(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 $@ diff --git a/ports/ports/binutils.mk b/ports/ports/binutils.mk index 3706cee4c4..7cfbac3153 100644 --- a/ports/ports/binutils.mk +++ b/ports/ports/binutils.mk @@ -17,4 +17,4 @@ $(DOWNLOAD_DIR)/$(BINUTILS_TBZ2): $(CONTRIB_DIR)/$(BINUTILS): $(DOWNLOAD_DIR)/$(BINUTILS_TBZ2) $(VERBOSE)tar xfj $< -C $(CONTRIB_DIR) && touch $@ - + $(VERBOSE)patch -d $(CONTRIB_DIR)/$(BINUTILS) -N -p1 < src/noux-pkg/binutils/build.patch diff --git a/ports/src/noux-pkg/bash/build.patch b/ports/src/noux-pkg/bash/build.patch index 6d377e2da2..c234feaf52 100644 --- a/ports/src/noux-pkg/bash/build.patch +++ b/ports/src/noux-pkg/bash/build.patch @@ -1,7 +1,21 @@ +diff --git a/Makefile.in b/Makefile.in +index f01d49c..4f20534 100644 +--- a/Makefile.in ++++ b/Makefile.in +@@ -753,7 +753,7 @@ install: .made installdirs + -( cd $(PO_DIR) ; $(MAKE) $(MFLAGS) DESTDIR=$(DESTDIR) $@ ) + + install-strip: +- $(MAKE) $(MFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s' \ ++ $(MAKE) $(MFLAGS) INSTALL_PROGRAM='$(INSTALL_PROGRAM) -s --strip-program=$(STRIP)' \ + prefix=${prefix} exec_prefix=${exec_prefix} \ + DESTDIR=$(DESTDIR) install + diff --git a/builtins/Makefile.in b/builtins/Makefile.in +index 42f8cb8..ba7d855 100644 --- a/builtins/Makefile.in +++ b/builtins/Makefile.in -@@ -68,7 +68,7 @@ +@@ -68,7 +68,7 @@ LDFLAGS = @LDFLAGS@ $(LOCAL_LDFLAGS) $(CFLAGS) LDFLAGS_FOR_BUILD = @LDFLAGS_FOR_BUILD@ $(LOCAL_LDFLAGS) $(CFLAGS_FOR_BUILD) LOCAL_LDFLAGS = @LOCAL_LDFLAGS@ #LIBS_FOR_BUILD = @LIBS_FOR_BUILD@ @@ -11,9 +25,10 @@ diff --git a/builtins/Makefile.in b/builtins/Makefile.in BASHINCDIR = ${topdir}/include diff --git a/configure b/configure +index 875bbbf..19ce633 100755 --- a/configure +++ b/configure -@@ -28398,8 +28398,8 @@ +@@ -28398,8 +28398,8 @@ if test "${bash_cv_getcwd_malloc+set}" = set; then else if test "$cross_compiling" = yes; then { $as_echo "$as_me:$LINENO: WARNING: cannot check whether getcwd allocates memory when cross-compiling -- defaulting to no" >&5 @@ -25,6 +40,7 @@ diff --git a/configure b/configure else cat >conftest.$ac_ext <<_ACEOF diff --git a/lib/intl/l10nflist.c b/lib/intl/l10nflist.c +index 9f02487..8b0e94e 100644 --- a/lib/intl/l10nflist.c +++ b/lib/intl/l10nflist.c @@ -33,7 +33,7 @@ @@ -37,9 +53,10 @@ diff --git a/lib/intl/l10nflist.c b/lib/intl/l10nflist.c #include #include diff --git a/shell.c b/shell.c +index 8dadb0b..1cadd61 100644 --- a/shell.c +++ b/shell.c -@@ -364,6 +364,12 @@ +@@ -364,6 +364,12 @@ main (argc, argv, env) env = environ; #endif /* __OPENNT */ diff --git a/ports/src/noux-pkg/binutils/build.patch b/ports/src/noux-pkg/binutils/build.patch new file mode 100644 index 0000000000..cbfb02a5e4 --- /dev/null +++ b/ports/src/noux-pkg/binutils/build.patch @@ -0,0 +1,48 @@ +diff --git a/binutils/Makefile.in b/binutils/Makefile.in +index 9f10781..5e05d56 100644 +--- a/binutils/Makefile.in ++++ b/binutils/Makefile.in +@@ -1418,8 +1418,8 @@ mostlyclean-local: + install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS) + @list='$(RENAMED_PROGS)'; for p in $$list; do \ + if test -f $$p$(EXEEXT); then \ +- echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p$(EXEEXT) $(bindir)/`echo $$p|sed -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ +- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p$(EXEEXT) $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ ++ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p$(EXEEXT) $(bindir)/`echo $$p|sed -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ ++ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p$(EXEEXT) $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/-new//' -e 's/cxxfilt/$(DEMANGLER_NAME)/'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ + done + $(mkinstalldirs) $(DESTDIR)$(tooldir)/bin +@@ -1430,7 +1430,7 @@ install-exec-local: install-binPROGRAMS $(bin_PROGRAMS) $(noinst_PROGRAMS) + if [ "$(bindir)/$$k" != "$(tooldir)/bin/$$j" ]; then \ + rm -f $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT); \ + ln $(DESTDIR)$(bindir)/$$k$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT) >/dev/null 2>/dev/null \ +- || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$i$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT); \ ++ || $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$i$(EXEEXT) $(DESTDIR)$(tooldir)/bin/$$j$(EXEEXT); \ + fi; \ + else true; \ + fi; \ +diff --git a/gas/Makefile.in b/gas/Makefile.in +index ddd42d7..0c7e4f3 100644 +--- a/gas/Makefile.in ++++ b/gas/Makefile.in +@@ -2483,8 +2483,8 @@ install-exec-bindir: $(noinst_PROGRAMS) + $(mkinstalldirs) $(DESTDIR)$(bindir) + @list='$(noinst_PROGRAMS)'; for p in $$list; do \ + if test -f $$p; then \ +- echo " $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ +- $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ ++ echo " $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`"; \ ++ $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) $$p $(DESTDIR)$(bindir)/`echo $$p|sed -e 's/$(EXEEXT)$$//' -e 's/-new//'|sed '$(transform)'|sed 's/$$/$(EXEEXT)/'`; \ + else :; fi; \ + done + +@@ -2494,7 +2494,7 @@ install-exec-tooldir: install-exec-bindir $(noinst_PROGRAMS) + if [ "$(bindir)/$$n$(EXEEXT)" != "$(tooldir)/bin/as$(EXEEXT)" ]; then \ + rm -f $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \ + ln $(DESTDIR)$(bindir)/$$n$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT) >/dev/null 2>/dev/null \ +- || $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) as-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \ ++ || $(INSTALL_PROGRAM_ENV) $(LIBTOOL) --mode=install $(INSTALL_PROGRAM) as-new$(EXEEXT) $(DESTDIR)$(tooldir)/bin/as$(EXEEXT); \ + else \ + true ; \ + fi diff --git a/ports/src/noux-pkg/gdb/target.inc b/ports/src/noux-pkg/gdb/target.inc index df48362e03..614637aad6 100644 --- a/ports/src/noux-pkg/gdb/target.inc +++ b/ports/src/noux-pkg/gdb/target.inc @@ -9,4 +9,6 @@ LIBS += ncurses expat NOUX_PKG_DIR = $(wildcard $(REP_DIR)/contrib/gdb-*) +NOUX_INSTALL_TARGET = install + include $(REP_DIR)/mk/noux.mk diff --git a/ports/src/noux-pkg/lynx/target.mk b/ports/src/noux-pkg/lynx/target.mk index ceb5aa5cc4..02f180963a 100644 --- a/ports/src/noux-pkg/lynx/target.mk +++ b/ports/src/noux-pkg/lynx/target.mk @@ -31,5 +31,6 @@ libssl.a: libz.a: $(VERBOSE)$(AR) -rc $@ +NOUX_INSTALL_TARGET = install include $(REP_DIR)/mk/noux.mk diff --git a/ports/src/noux-pkg/vim/target.mk b/ports/src/noux-pkg/vim/target.mk index c00ce264a4..2fb7871756 100644 --- a/ports/src/noux-pkg/vim/target.mk +++ b/ports/src/noux-pkg/vim/target.mk @@ -25,6 +25,8 @@ 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 +NOUX_INSTALL_TARGET = install + LIBS += ncurses include $(REP_DIR)/mk/noux.mk