Skip to content

Commit bd5c025

Browse files
committed
Auto merge of #24704 - brson:installer, r=alexcrichton
r? @alexcrichton
2 parents 2a62242 + 0c196fd commit bd5c025

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

configure

+10-1
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,15 @@ to_gnu_triple() {
337337
esac
338338
}
339339

340+
# Prints the absolute path of a directory to stdout
341+
abs_path() {
342+
local _path="$1"
343+
# Unset CDPATH because it causes havok: it makes the destination unpredictable
344+
# and triggers 'cd' to print the path to stdout. Route `cd`'s output to /dev/null
345+
# for good measure.
346+
(unset CDPATH && cd "$_path" > /dev/null && pwd)
347+
}
348+
340349
msg "looking for configure programs"
341350
need_cmd cmp
342351
need_cmd mkdir
@@ -509,7 +518,7 @@ fi
509518

510519
DEFAULT_BUILD="${CFG_CPUTYPE}-${CFG_OSTYPE}"
511520

512-
CFG_SRC_DIR="$(cd $(dirname $0) && pwd)/"
521+
CFG_SRC_DIR="$(abs_path $(dirname $0))/"
513522
CFG_BUILD_DIR="$(pwd)/"
514523
CFG_SELF="$0"
515524
CFG_CONFIGURE_ARGS="$@"

0 commit comments

Comments
 (0)