Skip to content

Commit

Permalink
tools/quilt: fix build error during kernel_menuconfig on a cleaned env
Browse files Browse the repository at this point in the history
When running "make kernel_menuconfig" right after "make clean", we error
out with the following message:

Makefile:22: recipe for target '.../build_dir/target-arm_cortex-a7_musl-1.1.10_eabi/linux-.../linux-3.18.18/.quilt_checked' failed
make[2]: [.../build_dir/target-arm_cortex-a7_musl-1.1.10_eabi/linux-.../linux-3.18.18/.quilt_checked]
Error 127 (ignored)

The root cause of the problem is located in the OpenWrt specific quilt
patch, which sets the quilt install directory to $STAGING_DIR/../host.
However, on a clean environment (right after running "make clean"),
$STAGING_DIR doesn't exist. The "quilt" executable doesn't find its
different commands, errors out, and creates this message.

We're fixing it by using $STAGING_DIR_HOST rather than $STAGING_DIR,
which is absolute. It will work even if there is no target directory
yet.

Signed-off-by: Mathieu Olivari <[email protected]>
Signed-off-by: Felix Fietkau <[email protected]>

SVN-Revision: 47410
  • Loading branch information
Felix Fietkau committed Nov 7, 2015
1 parent 279c8be commit bdbd0dc
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions tools/quilt/patches/000-relocatable.patch
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
-export TEXTDOMAINDIR=@LOCALEDIR@

-: ${QUILT_DIR=@QUILT_DIR@}
+if test -n "$STAGING_DIR"; then
+ export TEXTDOMAINDIR="$STAGING_DIR/../host/share/locale"
+ : ${QUILT_DIR=$STAGING_DIR/../host/share/quilt} ${QUILT_LIB=$STAGING_DIR/../host/lib/quilt}
+ : ${QUILT_ETC=$STAGING_DIR/../host/etc}
+if test -n "$STAGING_DIR_HOST"; then
+ export TEXTDOMAINDIR="$STAGING_DIR_HOST/share/locale"
+ : ${QUILT_DIR=$STAGING_DIR_HOST/share/quilt} ${QUILT_LIB=$STAGING_DIR_HOST/lib/quilt}
+ : ${QUILT_ETC=$STAGING_DIR_HOST/etc}
+else
+ export TEXTDOMAINDIR=@LOCALEDIR@
+ : ${QUILT_DIR=@QUILT_DIR@}
Expand Down Expand Up @@ -41,7 +41,7 @@

setlocale(LC_MESSAGES, "");
-bindtextdomain("quilt", "@LOCALEDIR@");
+bindtextdomain("quilt", $ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/locale' : "@LOCALEDIR@");
+bindtextdomain("quilt", $ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/locale' : "@LOCALEDIR@");
textdomain("quilt");

sub _($) {
Expand All @@ -52,8 +52,8 @@

export TEXTDOMAIN=quilt
-export TEXTDOMAINDIR=@LOCALEDIR@
+if [ -n "$STAGING_DIR" ]; then
+ export TEXTDOMAINDIR="$STAGING_DIR/../host/share/locale"
+if [ -n "$STAGING_DIR_HOST" ]; then
+ export TEXTDOMAINDIR="$STAGING_DIR_HOST/share/locale"
+else
+ export TEXTDOMAINDIR=@LOCALEDIR@
+fi
Expand All @@ -75,7 +75,7 @@

setlocale(LC_MESSAGES, "");
-bindtextdomain("quilt", "@LOCALEDIR@");
+bindtextdomain("quilt", $ENV{'STAGING_DIR'} ? $ENV{'STAGING_DIR'} . '/../host/share/locale' : "@LOCALEDIR@");
+bindtextdomain("quilt", $ENV{'STAGING_DIR_HOST'} ? $ENV{'STAGING_DIR_HOST'} . '/share/locale' : "@LOCALEDIR@");
textdomain("quilt");

sub _($) {
Expand Down Expand Up @@ -119,8 +119,8 @@
}

-: ${QUILT_DIR=@QUILT_DIR@}
+if test -n "$STAGING_DIR"; then
+ : ${QUILT_DIR="$STAGING_DIR/../host/share/quilt"}
+if test -n "$STAGING_DIR_HOST"; then
+ : ${QUILT_DIR="$STAGING_DIR_HOST/share/quilt"}
+else
+ : ${QUILT_DIR=@QUILT_DIR@}
+fi
Expand Down

0 comments on commit bdbd0dc

Please sign in to comment.