summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-04-29 19:22:48 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-04-29 19:22:48 -0700
commitc7888220b30e5933b76c0d5359c6f56874859fee (patch)
tree3b55b9177725ed26f5f8b3b90e8f2bc116aeaa3d /configure
parent06d0ada8a9ff7078f8ab89d5b4ce36f04587dc62 (diff)
downloadtxr-c7888220b30e5933b76c0d5359c6f56874859fee.tar.gz
txr-c7888220b30e5933b76c0d5359c6f56874859fee.tar.bz2
txr-c7888220b30e5933b76c0d5359c6f56874859fee.zip
build: allow $(pwd)/configure to work.
When the build is being done in the source directory, allow the configure script to be executed via path names other than just ./configure, such as an absolute path. Some distros use this. * configure (build_in_srcdir): New variable. (inode): New function. Rather than checking whether "$source_dir" is ".", we test whether they are the same inode. If they are the same, we now also set the build_in_srcdir variable in addition to generating the usual warning. (gen_config_make): Propagate the build_in_srcdir into config.make. * Makefile: use the build_in_srcdir variable from config.make to determine whether we are building in the source directory, rather than relying on top_srcdir being blank.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure13
1 files changed, 12 insertions, 1 deletions
diff --git a/configure b/configure
index f1adb919..d4869452 100755
--- a/configure
+++ b/configure
@@ -84,6 +84,7 @@ help=
#
# config
#
+build_in_srcdir=
prefix='/usr/local'
install_prefix=
bindir='bin'
@@ -629,6 +630,12 @@ lndir()
done
}
+inode()
+{
+ set -- $(ls -idL "$1")
+ printf "%s\n" "$1"
+}
+
case "$top_srcdir" in
" "* | *" "* | *" " )
printf " bad (contains spaces)\n"
@@ -639,7 +646,7 @@ case "$top_srcdir" in
;;
esac
-if [ "$source_dir" != "." ] ; then
+if [ $(inode "$source_dir") != $(inode ".") ] ; then
for x in Makefile ; do
printf "Symlinking %s -> $source_dir/%s\n" $x $x
ln -sf "$source_dir/$x" .
@@ -650,6 +657,7 @@ if [ "$source_dir" != "." ] ; then
done
else
printf "** Note: it's recommended to build in a separate directory\n"
+ build_in_srcdir=y
fi
gen_config_make()
@@ -670,6 +678,9 @@ txr_ver := $txr_ver
# absolute path to source code directory
top_srcdir := $top_srcdir
+# build directory is top_srcdir
+build_in_srcdir = $build_in_srcdir
+
# ultimate installation prefix, where the
# application will be run.
prefix := $prefix