Hello again,
|Ypnose <[email protected]> wrote:
|| /bin/strip: Unable to recognise the format of the input file \
|| `/destdir/arm-linux-gnueabihf/s-nail-14.5.1/usr/bin/mail'
[.]
|Cross-compilation wasn't on the list.
|I have reworked that part again and with the attached patch it is
[.]
|This is yet on [crawl].
After some more fixes , this has been placed on [master]. We
can't help for rm(1) and sed(1) (except from command line) since
we need them when dealing with `conf.rc', but besides and
afterwards any override should now be possible, always and anyway
from the command line.
I hope it is acceptable for you that i won't release v14.5.2
because of that; i think your distributions' package manager
should provide a completely sane ((fake)chroot) environment if it
even offers support for cross-compilation(!). I'm however sorry
that you need to apply a patch to make S-nail integrate nicely on
Void. :( It'll get better...
--steffen
--- Begin Message ---
Hello, well, it seems i haven't listened too attentive -- sorry..
Ypnose <[email protected]> wrote:
| /bin/strip: Unable to recognise the format of the input file \
| `/destdir/arm-linux-gnueabihf/s-nail-14.5.1/usr/bin/mail'
|
|As we talked about with main dev from Void, we could define STRIP
|to "/bin/strip", only when it's empty / not defined. Something like
Cross-compilation wasn't on the list.
I have reworked that part again and with the attached patch it is
possible to overwrite all tools as necessary -- all that we do is
to check (with type(1)) wether the resulting value is accessible.
This is yet on [crawl].
How has that been fixed on Void Linux? I see your pull request
has been integrated already? Would a small patch like that would
help you in the meanwhile, too?
diff --git a/mk-conf.sh b/mk-conf.sh
index a1ffec3..dbbae24 100644
--- a/mk-conf.sh
+++ b/mk-conf.sh
@@ -17,8 +17,11 @@ rm=`command -pv rm`
sed=`command -pv sed`
tee=`command -pv tee`
-STRIP=`command -pv strip`
-[ ${?} -eq 0 ] && HAVE_STRIP=1 || HAVE_STRIP=0
+HAVE_STRIP=1
+if [ -z "${STRIP}" ]; then
+ STRIP=`command -pv strip`
+ [ ${?} -ne 0 ] && HAVE_STRIP=0
+fi
# Predefined CONFIG= urations take precedence over anything else
if [ -n "${CONFIG}" ]; then
|An IRC chan would be also awesome! :)
Uh, no, that protocol doesn't track anything i sing under the
shower.. thus in practice it'll be quite v o i d ;)
Ciao,
|Best regards!
|Y.
--steffen
--- Begin Message ---
Hi guys,
When I compile s-nail on Void Linux, for armv6hf using xbps-src[1],
there is a tiny issue[2] with "/bin/strip" defined "STRIP=/bin/strip"
in mk.mk. It tries to strip s-nail binary, using host strip and I have
the following message:
/bin/strip: Unable to recognise the format of the input file
`/destdir/arm-linux-gnueabihf/s-nail-14.5.1/usr/bin/mail'
As we talked about with main dev from Void, we could define STRIP
to "/bin/strip", only when it's empty / not defined. Something like
this ${STRIP:=/bin/strip}. So we would be able to use the "good"
binary with "make STRIP=foo".
[1] https://github.com/voidlinux/xbps-src
[2] https://github.com/voidlinux/xbps-packages/pull/238
An IRC chan would be also awesome! :)
Best regards!
Y.
--- End Message ---
Date: 2013-12-28 15:56:26 +0100
Allow overwriting of STRIP= (and all other tools) (Ypnose)..
Ypnose reported a cross-compilation issue on Void Linux [1],
/bin/strip: Unable to recognise the format of the input file
`/destdir/arm-linux-gnueabihf/s-nail-14.5.1/usr/bin/mail'
[1] <https://github.com/voidlinux/xbps-packages/pull/238>
So introduce a check_tool() function instead of blindly using
command(1), and allow users to overwrite each and every tool we
need.
Also noted is that calling 'command -pv NAME' is an addition of
POSIX 2008 (Issue 7), though usable on all tested systems.
---
conf.rc | 6 ++++++
mk-conf.sh | 51 +++++++++++++++++++++++++++++++++------------------
2 files changed, 39 insertions(+), 18 deletions(-)
diff --git a/conf.rc b/conf.rc
index e43bbd8..c2d475d 100644
--- a/conf.rc
+++ b/conf.rc
@@ -187,6 +187,12 @@ XLISTER=ls
# $PAGER, which would effectively cause this setting to be ignored)
XPAGER=more
+# The following tools may be provided a.k.a. overwritten (also from the command
+# line); `command -pv NAME` is used to query the utility otherwise.
+# For cross-compilation setting MAKE= and STRIP= may be necessary
+# MAKE=, STRIP=, awk=, cat=, chmod=, cp=, cmp=, grep=, mkdir=, mv=, rm=, sed=
+# and tee=
+
## -- >8 -- 8< -- ##
## Normal users should not need to read any further
diff --git a/mk-conf.sh b/mk-conf.sh
index a1ffec3..2a302a3 100644
--- a/mk-conf.sh
+++ b/mk-conf.sh
@@ -4,22 +4,6 @@
LC_ALL=C
export LC_ALL
-awk=`command -pv awk`
-cat=`command -pv cat`
-chmod=`command -pv chmod`
-cp=`command -pv cp`
-cmp=`command -pv cmp`
-grep=`command -pv grep`
-make="${MAKE:-`command -pv make`}"
-mkdir=`command -pv mkdir`
-mv=`command -pv mv`
-rm=`command -pv rm`
-sed=`command -pv sed`
-tee=`command -pv tee`
-
-STRIP=`command -pv strip`
-[ ${?} -eq 0 ] && HAVE_STRIP=1 || HAVE_STRIP=0
-
# Predefined CONFIG= urations take precedence over anything else
if [ -n "${CONFIG}" ]; then
case ${CONFIG} in
@@ -176,6 +160,37 @@ newh=./config.h-new
tmp0=___tmp
tmp=./${tmp0}1$$
+# We need some standard utilities
+unset -f command
+check_tool() {
+ n=$1 i=$2 opt=${3:-0}
+ if type "${i}" >/dev/null 2>&1; then
+ eval ${n}=${i}
+ return 1
+ fi
+ if [ ${opt} -eq 0 ]; then
+ echo >&2 "ERROR: no trace of the utility \`${n}'"
+ exit 1
+ fi
+ return 0
+}
+
+check_tool make "${MAKE:-`command -pv make`}"
+check_tool strip "${STRIP:-`command -pv strip`}" 1
+HAVE_STRIP=${?}
+
+check_tool awk "${awk:-`command -pv awk`}"
+check_tool cat "${cat:-`command -pv cat`}"
+check_tool chmod "${chmod:-`command -pv chmod`}"
+check_tool cp "${cp:-`command -pv cp`}"
+check_tool cmp "${cmp:-`command -pv cmp`}"
+check_tool grep "${grep:-`command -pv grep`}"
+check_tool mkdir "${mkdir:-`command -pv mkdir`}"
+check_tool mv "${mv:-`command -pv mv`}"
+check_tool rm "${rm:-`command -pv rm`}"
+check_tool sed "${sed:-`command -pv sed`}"
+check_tool tee "${tee:-`command -pv tee`}"
+
# Only incorporate what wasn't overwritten from command line / CONFIG
trap "${rm} -f ${tmp}; exit" 1 2 15
trap "${rm} -f ${tmp}" 0
@@ -234,14 +249,14 @@ printf "_CFLAGS = ${_CFLAGS}\nCFLAGS = ${CFLAGS}\n" >> ${newmk}
printf "_LDFLAGS = ${_LDFLAGS}\nLDFLAGS = ${LDFLAGS}\n" >> ${newmk}
printf "CMP=${cmp}\nCHMOD=${chmod}\nCP=${cp}\nMKDIR=${mkdir}\nRM=${rm}\n"\
>> ${newmk}
-printf "STRIP=${STRIP}\nHAVE_STRIP=${HAVE_STRIP}\n" >> ${newmk}
+printf "STRIP=${strip}\nHAVE_STRIP=${HAVE_STRIP}\n" >> ${newmk}
# (We include the cc(1)/ld(1) environment only for update detection..)
printf "CC=\"${CC}\"\n" >> ${newlst}
printf "_CFLAGS=\"${_CFLAGS}\"\nCFLAGS=\"${CFLAGS}\"\n" >> ${newlst}
printf "_LDFLAGS=\"${_LDFLAGS}\"\nLDFLAGS=\"${LDFLAGS}\"\n" >> ${newlst}
printf "CMP=${cmp}\nCHMOD=${chmod}\nCP=${cp}\nMKDIR=${mkdir}\nRM=${rm}\n"\
>> ${newlst}
-printf "STRIP=${STRIP}\nHAVE_STRIP=${HAVE_STRIP}\n" >> ${newlst}
+printf "STRIP=${strip}\nHAVE_STRIP=${HAVE_STRIP}\n" >> ${newlst}
if [ -f ${lst} ] && ${cmp} ${newlst} ${lst} >/dev/null 2>&1; then
exit 0
--- End Message ---
------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT
organizations don't have a clear picture of how application performance
affects their revenue. With AppDynamics, you get 100% visibility into your
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
S-nail-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/s-nail-users