[Mirmince-commits] {mirmince} branch master updated. cedc94f7b201f05b0970173c401fe396f53fb318
tg at freewrt.org
tg at freewrt.org
Thu Jan 10 21:56:15 UTC 2013
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Main git repository for FreeWRT project mirmince".
The branch, master has been updated
via cedc94f7b201f05b0970173c401fe396f53fb318 (commit)
via d32ee0a2412fd75d964a69634c17fc5341237a0f (commit)
via 54f3419eeaa455bba37ee2d0a2b3fb9eaaf149a6 (commit)
via 262e07bf23bf92f8ec5fe6b142949478b583c340 (commit)
from 7ad266b58efe4b5a0e9f8a8337bbe7d1af9cdbf5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit cedc94f7b201f05b0970173c401fe396f53fb318
Author: Thorsten Glaser <tg at freewrt.org>
Date: Thu Jan 10 21:49:30 2013 +0000
keep some env vars, document which, for amd64 → i386 non-cross builds
commit d32ee0a2412fd75d964a69634c17fc5341237a0f
Author: Thorsten Glaser <tg at freewrt.org>
Date: Thu Jan 10 21:40:00 2013 +0000
let this build with pmake on Debian
commit 54f3419eeaa455bba37ee2d0a2b3fb9eaaf149a6
Author: Thorsten Glaser <tg at freewrt.org>
Date: Thu Jan 10 21:37:01 2013 +0000
hack for MirBSD (m)gcc specific flags, in lieu of autoconfiguration
commit 262e07bf23bf92f8ec5fe6b142949478b583c340
Author: Thorsten Glaser <tg at freewrt.org>
Date: Thu Jan 10 21:36:24 2013 +0000
permit multi-word compilers such as 'cc -m32'
-----------------------------------------------------------------------
Summary of changes:
GNUmakefile | 3 +++
BSDmakefile => Makefile | 0
README | 4 ++++
do-install | 21 +++++++++++++++++++++
gcc-wrap | 17 +++++++++++++++--
osdep/mirbsd/Makefile.inc | 8 ++++++--
6 files changed, 49 insertions(+), 4 deletions(-)
create mode 100644 GNUmakefile
rename BSDmakefile => Makefile (100%)
diff --git a/GNUmakefile b/GNUmakefile
new file mode 100644
index 0000000..73c404d
--- /dev/null
+++ b/GNUmakefile
@@ -0,0 +1,3 @@
+help:
+%:
+ @echo Use mirmake or pmake to build MirMinze.
diff --git a/BSDmakefile b/Makefile
similarity index 100%
rename from BSDmakefile
rename to Makefile
diff --git a/README b/README
index 59b4f6e..11bf255 100644
--- a/README
+++ b/README
@@ -14,6 +14,10 @@ You’ll need MirMake: a BSD make that automatically descends
into ./obj/ and reads .depend if possible and supports several
variable expansion manipulation operators like :M :Q :S etc.
+On Debian/amd64 install pmake and expose CC='cc -m32' to both
+pmake includes and pmake install and LDEMULATION=elf_i386 to
+all pmake calls.
+
To use:
$DST/bin/cc [-D_ALL_SOURCE] foo.c
diff --git a/do-install b/do-install
index 33da54c..34cf201 100644
--- a/do-install
+++ b/do-install
@@ -20,6 +20,10 @@
#-
# For now. This will change later (more flexible, etc).
+# Stores and restores the following environment variables, for cross
+# compilation helpers with multi-target toolchains:
+# GNUTARGET LDEMULATION
+
if [[ $1 = includes ]]; then
full=0
elif [[ $1 = install ]]; then
@@ -35,6 +39,13 @@ arch=$3
os=$4
cflags=$5
+set -A defenv
+for x in GNUTARGET LDEMULATION; do
+ eval y=\$$x
+ [[ -n $y ]] || continue
+ defenv[${#defenv[*]}]=$x=$y
+done
+
cd "$(dirname "$0")"
rm -rf "$dst"/{bin,include,lib,libdata}
mkdir -p "$dst"/{bin,include/mirmince/{md,osdep},lib,libdata}
@@ -43,6 +54,16 @@ while IFS= read -r line; do
print -r -- "${line//@@DST@@/"${dst at Q}"}"
done <gcc-spec >"$dst"/libdata/gcc-spec
while IFS= read -r line; do
+ if [[ $line = @@DEFENV@@ ]]; then
+ if (( ${#defenv[*]} )); then
+ line=export
+ for x in "${defenv[@]}"; do
+ line+=" ${x at Q}"
+ done
+ print -r -- "$line"
+ fi
+ continue
+ fi
line=${line//@@CC@@/"${cc at Q}"}
line=${line//@@MD@@/"${arch at Q}"}
line=${line//@@OS@@/"${os at Q}"}
diff --git a/gcc-wrap b/gcc-wrap
index c2fc474..d96afde 100644
--- a/gcc-wrap
+++ b/gcc-wrap
@@ -23,10 +23,23 @@
cc=@@CC@@
defcflags=@@DEFCFLAGS@@
dst=@@DST@@
+@@DEFENV@@
-if [[ $cc != /* ]] && ! cc=$(whence -p "$cc"); then
+# try whole $cc first, then first word
+set -A cc_words -- $cc
+w=0
+for x in "$cc" "${cc_words[0]}" false; do
+ [[ $x = /* ]] || x=$(whence -p "$x") || x=/
+ [[ $x != / && -f $x && -s $x && -x $x ]] && break
+ w=1
+ [[ $x = false ]] || continue
print -u2 Error: could not find C compiler
exit 255
+done
+if (( w )); then
+ cc_words[0]=$x
+else
+ set -A cc_words -- "$x"
fi
if [[ $1 = -v ]]; then
@@ -36,7 +49,7 @@ else
v=0
fi
-set -A cmd -- "$cc" -nostdinc -I"$dst"/include -D__mirmincE__ \
+set -A cmd -- "${cc_words[@]}" -nostdinc -I"$dst"/include -D__mirmincE__ \
-D__mirmincE_arch_@@MD@@ -D__mirmincE_arch__=\"@@MD@@\" \
-D__mirmincE_os_@@OS@@ -D__mirmincE_os__=\"@@OS@@\" \
$defcflags -specs="$dst"/libdata/gcc-spec "$@"
diff --git a/osdep/mirbsd/Makefile.inc b/osdep/mirbsd/Makefile.inc
index 21981dd..57afa49 100644
--- a/osdep/mirbsd/Makefile.inc
+++ b/osdep/mirbsd/Makefile.inc
@@ -13,7 +13,11 @@ TG_CFLAGS+= -mcpu=v8 -mtune=hypersparc
.error Unknown MirBSD architecture "${TG_ARCH}"
.endif
-TG_CFLAGS+= -Wformat -Wstrict-aliasing -Wbounded -Wmissing-declarations
-TG_CFLAGS+= -fwrapv -fhonour-copts
+TG_CFLAGS+= -Wformat -Wstrict-aliasing -Wmissing-declarations
+TG_CFLAGS+= -fwrapv
+#XXX in lieu of a configure script
+.if defined(OStype) && ${OStype} == "MirBSD"
+TG_CFLAGS+= -Wbounded -fhonour-copts
+.endif
SRCS+= cerror.S
hooks/post-receive
--
Main git repository for FreeWRT project mirmince
(FreeWRT project mirmince repository mirmince)
More information about the Mirmince-commits
mailing list