aboutsummaryrefslogtreecommitdiffstats
path: root/meta-oe/recipes-multimedia/webm/libvpx/libvpx-configure-support-blank-prefix.patch
blob: 6ad7f2b4787b42643a7dae220146cd65e4aab264 (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
From dc0a5c3d2dd4e79d12a150a246a95c4dc88326f1 Mon Sep 17 00:00:00 2001
From: Koen Kooi <koen@dominion.thruhere.net>
Date: Tue, 16 Aug 2011 16:04:35 +0200
Subject: [PATCH] Upstream: not yet

Fix configure to accept "--prefix=" (a blank prefix).

---
 build/make/configure.sh | 20 ++++++++++++++++----
 1 file changed, 16 insertions(+), 4 deletions(-)

diff --git a/build/make/configure.sh b/build/make/configure.sh
index 007e020..04d5cbf 100644
--- a/build/make/configure.sh
+++ b/build/make/configure.sh
@@ -581,6 +581,8 @@ process_common_cmdline() {
         ;;
       --prefix=*)
         prefix="${optval}"
+        # Distinguish between "prefix not set" and "prefix set to ''"
+        prefixset=1
         ;;
       --libdir=*)
         libdir="${optval}"
@@ -614,13 +616,23 @@ process_cmdline() {
 }
 
 post_process_common_cmdline() {
-  prefix="${prefix:-/usr/local}"
+  if [ "$prefixset" != "1" ]
+  then
+      prefix=/usr/local
+  fi
+
+  # Strip trailing slash
   prefix="${prefix%/}"
+
   libdir="${libdir:-${prefix}/lib}"
   libdir="${libdir%/}"
-  if [ "${libdir#${prefix}}" = "${libdir}" ]; then
-    die "Libdir ${libdir} must be a subdirectory of ${prefix}"
-  fi
+
+  case "$libdir" in
+      "${prefix}/"*) ;;
+      *)
+          die "Libdir ${libdir} must be a subdirectory of ${prefix}"
+          ;;
+  esac
 }
 
 post_process_cmdline() {