Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorAllan McRae <allan@archlinux.org>2009-04-26 20:58:04 +1000
committerDan McGee <dan@archlinux.org>2009-04-26 09:22:23 -0500
commitc27904661ef96cb2e7c729ce82b527146529c768 (patch)
tree41c3d407ecab07f9dffd477ab133dd18fcf66456 /configure.ac
parent10584ec8eab873ffb4b03dd8e4a4703dabed8955 (diff)
makepkg: make in-place sed portable
Do a sed replacement in-place is not very portable. On Mac OSX and BSDs, the syntax is "sed -i ''" where as with GNU sed the command is "sed -i''" or just "sed -i". This patch detects which command should be used during configure. Credit to Kevin Barry who researched this issue and provided a patch to work around this using temporary backup files. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac5
1 files changed, 5 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 5dcbe795..a83d5e4d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -180,9 +180,11 @@ GCC_GNU89_INLINE_CC
# Host-dependant definitions
SIZECMD="stat -c %s"
+SEDINPLACE="sed -i"
case "${host_os}" in
*bsd*)
SIZECMD="stat -f %z"
+ SEDINPLACE="sed -i ''"
;;
cygwin*)
host_os_cygwin=yes
@@ -191,12 +193,14 @@ case "${host_os}" in
darwin*)
host_os_darwin=yes
SIZECMD="/usr/bin/stat -f %z"
+ SEDINPLACE="sed -i ''"
;;
esac
AM_CONDITIONAL([CYGWIN], test "x$host_os_cygwin" = "xyes")
AM_CONDITIONAL([DARWIN], test "x$host_os_darwin" = "xyes")
AC_SUBST(SIZECMD)
+AC_SUBST(SEDINPLACE)
# Check for architecture, used in default makepkg.conf
# (Note single space left after CARCHFLAGS)
@@ -356,6 +360,7 @@ ${PACKAGE_NAME}:
Architecture flags : ${CARCHFLAGS}
Host Type : ${CHOST}
Filesize command : ${SIZECMD}
+ In-place sed command : ${SEDINPLACE}
libalpm version : ${LIB_VERSION}
libalpm version info : ${LIB_VERSION_INFO}