Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 1 | From dc0a5c3d2dd4e79d12a150a246a95c4dc88326f1 Mon Sep 17 00:00:00 2001 |
| 2 | From: Koen Kooi <koen@dominion.thruhere.net> |
| 3 | Date: Tue, 16 Aug 2011 16:04:35 +0200 |
| 4 | Subject: [PATCH] Upstream: not yet |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 5 | |
| 6 | Fix configure to accept "--prefix=" (a blank prefix). |
| 7 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 8 | --- |
Patrick Williams | 520786c | 2023-06-25 16:20:36 -0500 | [diff] [blame] | 9 | Upstream-Status: Pending |
| 10 | |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 11 | build/make/configure.sh | 20 ++++++++++++++++---- |
| 12 | 1 file changed, 16 insertions(+), 4 deletions(-) |
| 13 | |
| 14 | diff --git a/build/make/configure.sh b/build/make/configure.sh |
| 15 | index 007e020..04d5cbf 100644 |
| 16 | --- a/build/make/configure.sh |
| 17 | +++ b/build/make/configure.sh |
| 18 | @@ -581,6 +581,8 @@ process_common_cmdline() { |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 19 | ;; |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 20 | --prefix=*) |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 21 | prefix="${optval}" |
| 22 | + # Distinguish between "prefix not set" and "prefix set to ''" |
| 23 | + prefixset=1 |
| 24 | ;; |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 25 | --libdir=*) |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 26 | libdir="${optval}" |
Brad Bishop | 316dfdd | 2018-06-25 12:45:53 -0400 | [diff] [blame] | 27 | @@ -614,13 +616,23 @@ process_cmdline() { |
Patrick Williams | b48b7b4 | 2016-08-17 15:04:38 -0500 | [diff] [blame] | 28 | } |
| 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() { |