blob: 6ad7f2b4787b42643a7dae220146cd65e4aab264 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From dc0a5c3d2dd4e79d12a150a246a95c4dc88326f1 Mon Sep 17 00:00:00 2001
2From: Koen Kooi <koen@dominion.thruhere.net>
3Date: Tue, 16 Aug 2011 16:04:35 +0200
4Subject: [PATCH] Upstream: not yet
Patrick Williamsb48b7b42016-08-17 15:04:38 -05005
6Fix configure to accept "--prefix=" (a blank prefix).
7
Brad Bishop316dfdd2018-06-25 12:45:53 -04008---
9 build/make/configure.sh | 20 ++++++++++++++++----
10 1 file changed, 16 insertions(+), 4 deletions(-)
11
12diff --git a/build/make/configure.sh b/build/make/configure.sh
13index 007e020..04d5cbf 100644
14--- a/build/make/configure.sh
15+++ b/build/make/configure.sh
16@@ -581,6 +581,8 @@ process_common_cmdline() {
Patrick Williamsb48b7b42016-08-17 15:04:38 -050017 ;;
Brad Bishop316dfdd2018-06-25 12:45:53 -040018 --prefix=*)
Patrick Williamsb48b7b42016-08-17 15:04:38 -050019 prefix="${optval}"
20+ # Distinguish between "prefix not set" and "prefix set to ''"
21+ prefixset=1
22 ;;
Brad Bishop316dfdd2018-06-25 12:45:53 -040023 --libdir=*)
Patrick Williamsb48b7b42016-08-17 15:04:38 -050024 libdir="${optval}"
Brad Bishop316dfdd2018-06-25 12:45:53 -040025@@ -614,13 +616,23 @@ process_cmdline() {
Patrick Williamsb48b7b42016-08-17 15:04:38 -050026 }
27
28 post_process_common_cmdline() {
29- prefix="${prefix:-/usr/local}"
30+ if [ "$prefixset" != "1" ]
31+ then
32+ prefix=/usr/local
33+ fi
34+
35+ # Strip trailing slash
36 prefix="${prefix%/}"
37+
38 libdir="${libdir:-${prefix}/lib}"
39 libdir="${libdir%/}"
40- if [ "${libdir#${prefix}}" = "${libdir}" ]; then
41- die "Libdir ${libdir} must be a subdirectory of ${prefix}"
42- fi
43+
44+ case "$libdir" in
45+ "${prefix}/"*) ;;
46+ *)
47+ die "Libdir ${libdir} must be a subdirectory of ${prefix}"
48+ ;;
49+ esac
50 }
51
52 post_process_cmdline() {