Changeset 2374


Ignore:
Timestamp:
Sep 17, 2014, 8:02:55 PM (4 years ago)
Author:
matthijs
Message:

build-system: Fix build using make 4.0

Make 4.0 silently changed the handling of the SHELL variable - any
shell special characters in it are now escaped instead of passed as-is.
Since the build system used some shell magic to include shell.sh inside
the SHELL variable, this completely breaks the build.

See also https://dev.openwrt.org/ticket/12860 and
https://savannah.gnu.org/bugs/?23922

This is now fixed by moving the magic inside shell.sh, so the SHELL
variable only has to point to that file.

Location:
trunk/openwrt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/openwrt/include/shell.sh

    • Property svn:executable set to *
    r1 r2374  
     1#!/usr/bin/env bash
     2
    13getvar() {
    24        eval "echo \"\${$1}\""
     
    3335        which md5sum 2>&1 >/dev/null && md5sum "$@" | awk '{print $1}' || md5 "$@"
    3436}
     37
     38# This script is inteded to be set as the SHELL in a Makefile, so it
     39# expects to be called as shell.sh -c "command"
     40if [ "$1" != "-c" ]; then
     41        echo Invalid call to $0
     42        exit 1;
     43fi
     44
     45eval "$2"
  • trunk/openwrt/rules.mk

    r2262 r2374  
    1717TMP_DIR:=$(TOPDIR)/tmp
    1818
    19 export SHELL=/usr/bin/env bash -c '. $(TOPDIR)/include/shell.sh; eval "$$2"' --
     19export SHELL=$(TOPDIR)/include/shell.sh
    2020
    2121define qstrip
Note: See TracChangeset for help on using the changeset viewer.