summaryrefslogtreecommitdiffstats
path: root/patches/01_replace-non-portable-echo-options.patch
blob: 5b24ae2f88ccabd802f69fb4466d7ae8b6921513 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
Author: "P. J. McDermott" <pj@pehjota.net>
Subject: Replace non-portable echo options

The "echo -e" in the Make.config target causes the following error:

    Make.config written, edit if needed
    
    Make.config:1: *** empty variable name.  Stop.
    make[1]: Leaving directory '/pkg/fbida/tmp/src'
    ../build:9: recipe for target 'build' failed
    make: *** [build] Error 2

The "echo -n" in ac_init causes unattractive output like the following:

    -n checking for linux/fb.h ... 
    yes

The "echo -e" in ac_jpeg_ver causes the following error:

    Make.config written, edit if needed
    
    Need files from libjpeg JPEG_LIB_VERSION in jpeg/
    GNUmakefile:196: recipe for target 'check-libjpeg' failed
    make[1]: *** [check-libjpeg] Error 1
    make[1]: Leaving directory '/pkg/fbida/tmp/src'
    ../build:9: recipe for target 'build' failed
    make: *** [build] Error 2

diff -Naur src.orig/mk/Autoconf.mk src/mk/Autoconf.mk
--- src.orig/mk/Autoconf.mk	2012-02-22 12:13:36.000000000 -0500
+++ src/mk/Autoconf.mk	2014-07-26 00:10:29.787011930 -0400
@@ -24,7 +24,7 @@
   ac_fini	= echo "... result is $${rc}" >&2; echo >&2; echo "$${rc}"
 else
   # normal
-  ac_init	= echo -n "checking $(1) ... " >&2; rc=no
+  ac_init	= printf "checking %s ... " "$(1)" >&2; rc=no
   ac_b_cmd	= $(1) >/dev/null 2>&1 && rc=yes
   ac_s_cmd	= rc=`$(1) 2>/dev/null`
   ac_fini	= echo "$${rc}" >&2; echo "$${rc}"
@@ -162,7 +162,7 @@
 	@true
 
 Make.config: $(srcdir)/GNUmakefile
-	@echo -e "$(make-config-q)" > $@
+	@echo "$(make-config-q)" > $@
 	@echo
 	@echo "Make.config written, edit if needed"
 	@echo
diff -Naur src.orig/GNUmakefile src/GNUmakefile
--- src.orig/GNUmakefile	2012-02-22 12:13:36.000000000 -0500
+++ src/GNUmakefile	2014-07-26 00:07:56.882490841 -0400
@@ -30,7 +30,7 @@
 
 ac_jpeg_ver = $(shell \
 	$(call ac_init,for libjpeg version);\
-	$(call ac_s_cmd,echo -e '\#include <jpeglib.h>\nJPEG_LIB_VERSION' \
+	$(call ac_s_cmd,printf '\#include <jpeglib.h>\nJPEG_LIB_VERSION\n' \
 		| cpp | tail -n 1);\
 	$(call ac_fini))