blob: e0fd4fea1b68ac3d61adfbf1959fde419816edd6 [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---
Patrick Williams520786c2023-06-25 16:20:36 -05009Upstream-Status: Pending
10
Brad Bishop316dfdd2018-06-25 12:45:53 -040011 build/make/configure.sh | 20 ++++++++++++++++----
12 1 file changed, 16 insertions(+), 4 deletions(-)
13
14diff --git a/build/make/configure.sh b/build/make/configure.sh
15index 007e020..04d5cbf 100644
16--- a/build/make/configure.sh
17+++ b/build/make/configure.sh
18@@ -581,6 +581,8 @@ process_common_cmdline() {
Patrick Williamsb48b7b42016-08-17 15:04:38 -050019 ;;
Brad Bishop316dfdd2018-06-25 12:45:53 -040020 --prefix=*)
Patrick Williamsb48b7b42016-08-17 15:04:38 -050021 prefix="${optval}"
22+ # Distinguish between "prefix not set" and "prefix set to ''"
23+ prefixset=1
24 ;;
Brad Bishop316dfdd2018-06-25 12:45:53 -040025 --libdir=*)
Patrick Williamsb48b7b42016-08-17 15:04:38 -050026 libdir="${optval}"
Brad Bishop316dfdd2018-06-25 12:45:53 -040027@@ -614,13 +616,23 @@ process_cmdline() {
Patrick Williamsb48b7b42016-08-17 15:04:38 -050028 }
29
30 post_process_common_cmdline() {
31- prefix="${prefix:-/usr/local}"
32+ if [ "$prefixset" != "1" ]
33+ then
34+ prefix=/usr/local
35+ fi
36+
37+ # Strip trailing slash
38 prefix="${prefix%/}"
39+
40 libdir="${libdir:-${prefix}/lib}"
41 libdir="${libdir%/}"
42- if [ "${libdir#${prefix}}" = "${libdir}" ]; then
43- die "Libdir ${libdir} must be a subdirectory of ${prefix}"
44- fi
45+
46+ case "$libdir" in
47+ "${prefix}/"*) ;;
48+ *)
49+ die "Libdir ${libdir} must be a subdirectory of ${prefix}"
50+ ;;
51+ esac
52 }
53
54 post_process_cmdline() {