aboutsummaryrefslogtreecommitdiff
path: root/configure
diff options
context:
space:
mode:
authorOmar Polo <op@omarpolo.com>2023-08-13 09:53:12 +0000
committerOmar Polo <op@omarpolo.com>2023-08-13 09:53:12 +0000
commitf5dc7eddd7ac6cf06d7092e9526691b566850b50 (patch)
tree4022fd93a849495262d1e55cabd1569f6a10c4f4 /configure
parent81634643dbb99f7270cbb5ba5f84adc28991018d (diff)
fix INSTALL handling
Set a sane default for INSTALL, allow it to be changed either as environment variable or configure argument, and propagate it correctly to the generated config.mk. Issue reported by xavi, thanks!
Diffstat (limited to 'configure')
-rwxr-xr-xconfigure21
1 files changed, 9 insertions, 12 deletions
diff --git a/configure b/configure
index 7ae1d5a..c7bdc53 100755
--- a/configure
+++ b/configure
@@ -48,6 +48,7 @@ else
CFLAGS=${CFLAGS:--O2 -pipe}
fi
+INSTALL=${INSTALL-install}
PREFIX=${PREFIX-/usr/local}
CDIAGFLAGS=
@@ -102,6 +103,7 @@ while [ $# -gt 0 ]; do
CFLAGS) CFLAGS="$val" ;;
CDIAGFLAGS) CDIAGFLAGS="$val" ;;
DISABLE_SANDBOX) DISABLE_SANDBOX="$val" ;;
+ INSTALL) INSTALL="$val" ;;
LDFLAGS) LDFLAGS="$val" ;;
PKG_CONFIG) PKG_CONFIG="$val" ;;
PREFIX) PREFIX="$val" ;;
@@ -488,13 +490,8 @@ echo "file config.h: written" 1>&3
exec > config.mk
-[ -z "${BINDIR}" ] && BINDIR="\${PREFIX}/bin"
-[ -z "${MANDIR}" ] && MANDIR="\${PREFIX}/man"
-
-[ -z "${INSTALL_PROGRAM}" ] && INSTALL_PROGRAM="${INSTALL} -m 0555"
-[ -z "${INSTALL_LIB}" ] && INSTALL_LIB="${INSTALL} -m 0444"
-[ -z "${INSTALL_MAN}" ] && INSTALL_MAN="${INSTALL} -m 0444"
-[ -z "${INSTALL_DATA}" ] && INSTALL_DATA="${INSTALL} -m 0444"
+[ -z "${BINDIR}" ] && BINDIR="\${PREFIX}/bin"
+[ -z "${MANDIR}" ] && MANDIR="\${PREFIX}/man"
cat << __HEREDOC__
CC = ${CC}
@@ -507,11 +504,11 @@ PREFIX = ${PREFIX}
BINDIR = ${BINDIR}
MANDIR = ${MANDIR}
-INSTALL = install
-INSTALL_PROGRAM = ${INSTALL} -m 0555
-INSTALL_LIB = ${INSTALL} -m 0444
-INSTALL_MAN = ${INSTALL} -m 0444
-INSTALL_DATA = ${INSTALL} -m 0444
+INSTALL = ${INSTALL}
+INSTALL_PROGRAM = \${INSTALL} -m 0555
+INSTALL_LIB = \${INSTALL} -m 0444
+INSTALL_MAN = \${INSTALL} -m 0444
+INSTALL_DATA = \${INSTALL} -m 0444
COMPATS= ${COMPATS}