summaryrefslogtreecommitdiffstats
path: root/configure
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2014-06-10 07:08:27 -0700
committerKaz Kylheku <kaz@kylheku.com>2014-06-10 07:08:27 -0700
commit06e308526e9c612eaf6e36c36f2213bb915038e4 (patch)
treed9075680fcc21d9d1dc236eb51ad9c5e9133b885 /configure
parenta0ac30ccbf3acb38be1aa65ab2aa780239c4a123 (diff)
downloadtxr-06e308526e9c612eaf6e36c36f2213bb915038e4.tar.gz
txr-06e308526e9c612eaf6e36c36f2213bb915038e4.tar.bz2
txr-06e308526e9c612eaf6e36c36f2213bb915038e4.zip
2014-06-10 Kaz Kylheku <kaz@kylheku.com>
* Makefile (PROG): Removing ./ prefix from variable name; adding it to invocations of $(PROG) in some rules. (txr.o): Pass several strings as macros on the command line: TXR_REL_PATH, EXE_SUFF and PROG_NAME. * configure (bindir, datadir, mandir): These variables become just relative paths from the prefix. * txr.c (sysroot): Use the TXR_REL_PATH, EXE_SUFF and PROG_NAME preprocessor symbols defined on the command line to avoid hard-coding strings like "bin/txr" and "bin/txr.exe" which actually should reflect the value of the bindir variable.
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure32
1 files changed, 19 insertions, 13 deletions
diff --git a/configure b/configure
index d5afb432..86e17c26 100755
--- a/configure
+++ b/configure
@@ -76,11 +76,11 @@ help=
#
# config
#
-prefix=/usr/local
+prefix='/usr/local'
install_prefix=
-bindir='$(prefix)/bin'
-datadir='$(prefix)/share/txr'
-mandir='$(prefix)/share/man'
+bindir='bin'
+datadir='share/txr'
+mandir='share/man'
make=
cross=
compiler_prefix=
@@ -244,15 +244,18 @@ install-prefix [$install_prefix]
bindir [$bindir]
- Specifies where the program executable will be installed.
+ Specifies where the program executable will be installed, as a relative
+ path from the prefix.
datadir [$datadir]
- Specifies where read-only program data is to be stored.
+ Specifies where read-only program data is to be stored, as a relative
+ path from the prefix.
mandir [$mandir]
- Specifies the directory where to install man pages.
+ Specifies the directory where to install man pages, as a relative
+ path from the prefix.
cross [$cross]
@@ -467,9 +470,9 @@ fi
printf "Checking installation paths:\n"
-for name in prefix bindir datadir mandir; do
- eval path="\$install_prefix\${$name}"
- printf "\$(install_prefix)\$(%s)=%s ... " $name "$path"
+for name in bindir datadir mandir; do
+ eval path="\$install_prefix\$prefix/\${$name}"
+ printf "\$(install_prefix)\$(prefix)/\$%s=%s ... " $name "$path"
test_access=y
case "$path" in
" "* | *" "* | *" " )
@@ -574,14 +577,17 @@ prefix := $prefix
# e.g. for an operating system distro.
DESTDIR := $install_prefix
+# relative path from prefix to datadir
+bindir_rel := $bindir
+
# executable directory
-bindir := $bindir
+bindir := \$(prefix)/\$(bindir_rel)
# read-only data directory
-datadir := $datadir
+datadir := \$(prefix)/$datadir
# man page directory
-mandir := $mandir
+mandir := \$(prefix)/$mandir
# cross compiler toolchain root directory
cross := $cross