summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJaromil <jaromil@dyne.org>2013-11-17 13:31:52 (GMT)
committer Jaromil <jaromil@dyne.org>2013-11-17 13:31:52 (GMT)
commitcd92d4be6f86ec800bf04ec488937ac566c10e67 (patch)
tree9fc135afab0301b351cae6f80151d6a31ea28f32
parentdd0e083d4282331e5f5f357b1139ccc9c3a75404 (diff)
many upgrades and cleanups to the SDKv0.8
-rw-r--r--build/conf.zsh11
-rw-r--r--build/config.site19
-rw-r--r--build/lang/Sources2
-rw-r--r--build/lang/conf.zsh8
-rw-r--r--build/network/Sources15
-rw-r--r--build/network/conf.zsh61
-rwxr-xr-xbuild/system/etc/zlogin2
-rw-r--r--build/text/Sources1
-rw-r--r--build/text/conf.zsh1
-rw-r--r--build/toys/Sources3
-rw-r--r--build/toys/conf.zsh13
-rwxr-xr-xwrap/static-cc25
-rw-r--r--wrap/zshaolin.c10
13 files changed, 140 insertions, 31 deletions
diff --git a/build/conf.zsh b/build/conf.zsh
index 5c91f88..0c63d56 100644
--- a/build/conf.zsh
+++ b/build/conf.zsh
@@ -8,10 +8,11 @@
return 1 }
-typeset ZTARGET TOOLCHAIN PREFIX
+typeset ZTARGET TOOLCHAIN PREFIX ZARCH
typeset CC CXX LD AR RANLIB OBJCOPY STRIP
+ZARCH=(-march=armv7-a -mfloat-abi=softfp -Wl,--fix-cortex-a8) # -mfpu=neon) # architecture
init-toolchain-crosstool() {
@@ -38,7 +39,7 @@ export STRIP=${TOOLCHAIN}/bin/${ZTARGET}-strip
# configure the compile flags
OPTIMIZATIONS="-Os -O2"
-CFLAGS=(-static -static-libgcc $OPTIMIZATIONS $ARCH)
+CFLAGS=(-static -static-libgcc $OPTIMIZATIONS $ZARCH)
#CFLAGS="$OPTIMIZATIONS $ARCH -I$TOOLCHAIN/$ZTARGET/sysroot/usr/include -I$PREFIX/include $ANDROID_CFLAGS"
CPPFLAGS=(-I$PREFIX/include -I$TOOLCHAIN/$ZTARGET/sysroot/usr/include -I$PREFIX/include)
CXXFLAGS=$CFLAGS
@@ -89,9 +90,8 @@ export OBJCOPY=${TOOLCHAIN}/bin/${ZTARGET}-objcopy
export STRIP=${TOOLCHAIN}/bin/${ZTARGET}-strip
# configure the compile flags
-CFLAGS=(--sysroot=$SYSROOT)
-CFLAGS+=(-march=armv7-a -mfloat-abi=softfp) # -mfpu=neon) # architecture
-CFLAGS+=(-Os -O2) # optimization
+OPTIMIZATIONS="-O3" # optimization
+CFLAGS=(--sysroot=$SYSROOT $OPTIMIZATIONS $ZARCH)
CPPFLAGS=(-I$TOOLCHAIN/$ZTARGET/sysroot/usr/include -I$PREFIX/include)
# some notes
#ANDROID_CFLAGS="-DANDROID -D__ANDROID__ -DSK_RELEASE -nostdlib -fpic -fno-short-enums -fgcse-after-reload -frename-registers"
@@ -105,7 +105,6 @@ LDFLAGS=(-L$SYSROOT/usr/lib -L$PREFIX/lib -L$PREFIX/usr/lib)
LDFLAGS+=($ZHOME/wrap/libzshaolin.a)
#LDFLAGS+=(-ldl -lm -lc -lgcc)
LDFLAGS+=(--sysroot=$SYSROOT)
-LDFLAGS+=(-Wl,--fix-cortex-a8)
# LDFLAGS="-L$TOOLCHAIN/$ZTARGET/sysroot/lib -L$TOOLCHAIN/$ZTARGET/sysroot/usr/lib -L$PREFIX/lib -L$PREFIX/usr/lib"
# LDFLAGS="$ANDROID_LDFLAGS -L$PREFIX/lib -L$PREFIX/usr/lib"
# PATH="$PATH:$ANDROID_NDK/toolchains/$ANDROID_TOOLCHAIN/bin"
diff --git a/build/config.site b/build/config.site
new file mode 100644
index 0000000..39247af
--- /dev/null
+++ b/build/config.site
@@ -0,0 +1,19 @@
+ac_cv_file__dev_ptmx=no
+ac_cv_file__dev_ptc=no
+ac_cv_c_bigendian=no
+ac_cv_func_gethostbyname=yes
+ac_cv_func_writev=yes
+
+# openssh
+ac_cv_search_getrrsetbyname=no
+ac_cv_header_sys_un_h=yes
+
+
+# vim
+vim_cv_toupper_broken=no
+vim_cv_terminfo=yes
+vim_cv_tty_group=world
+vim_cv_getcwd_broken=no
+vim_cv_stat_ignores_slash=yes
+vim_cv_memmove_handles_overlap=yes
+ac_cv_sizeof_int=4
diff --git a/build/lang/Sources b/build/lang/Sources
index d55d94b..0a4c9de 100644
--- a/build/lang/Sources
+++ b/build/lang/Sources
@@ -1 +1,3 @@
lua -5.2.0 .tar.gz
+
+
diff --git a/build/lang/conf.zsh b/build/lang/conf.zsh
index 13a7c43..8fa2f5c 100644
--- a/build/lang/conf.zsh
+++ b/build/lang/conf.zsh
@@ -13,13 +13,13 @@ prepare_sources
## lua
{ test ! -r lua.done } && {
- act "compiling lua" | tee -a $LOGS
+ act "compiling lua"
pushd lua/src
for s in `find . -name '*.c'`; do
{ test -r ${s%.*}.o } || {
- ${TARGET}-gcc ${=CFLAGS} -DLUA_USE_POSIX -DLUA_COMPAT_ALL -c ${s} }; done
+ ${ZTARGET}-gcc ${=CFLAGS} -DLUA_USE_POSIX -DLUA_COMPAT_ALL -c ${s} }; done
luas=`find . -name '*.o' | grep -v luac.o`
- ${TARGET}-gcc -o lua ${=CFLAGS} ${=luas} ${=LDFLAGS} -lncursesw -lm
+ ${ZTARGET}-gcc -o lua ${=CFLAGS} ${=luas} ${=LDFLAGS} -lncursesw -lm
{ test $? = 0 } && {
touch ../../lua.done
notice "lua compiled"
@@ -27,7 +27,7 @@ prepare_sources
popd
}
{ test -f lua.done } && {
- act "installing lua" | tee -a ../$LOGS
+ act "installing lua"
cp lua/src/lua $PREFIX/bin/
cp lua/doc/lua.1 $PREFIX/share/man/man1
notice "lua installed"
diff --git a/build/network/Sources b/build/network/Sources
index e806c4e..7f33f8b 100644
--- a/build/network/Sources
+++ b/build/network/Sources
@@ -1,7 +1,14 @@
# ZShaoling packages file
-openssl-static -0.9.9 .tar.gz
-android-openssh -6.1 .tar.gz
-rsync -3.1.0 .tar.gz http://rsync.samba.org
-git -1.8.4.3 .tar.gz http://git-scm.com
+openssl-static -0.9.9 .tar.gz
+android-openssh -6.1 .tar.gz
+rsync -3.1.0 .tar.gz http://rsync.samba.org
+git -1.8.4.3 .tar.gz http://git-scm.com
+#glib -2.39.1 .tar.xz
+
+#irssi -0.8.16-rc1 .tar.bz2 http://www.irssi.org
+
+
+# aria2 from android binary build direct
+# aria2 -1.18.1 .tar.bz2 http://aria2.sourceforge.net
diff --git a/build/network/conf.zsh b/build/network/conf.zsh
index 51a0737..df0d362 100644
--- a/build/network/conf.zsh
+++ b/build/network/conf.zsh
@@ -14,25 +14,64 @@ rsync openssl-static/obj/local/armeabi/*.a $PREFIX/lib/
rsync -r openssl-static/include/openssl $PREFIX/include
# make openssh
-zndk-build android-openssh
-rsync android-openssh/libs/armeabi/* $PREFIX/bin
-rsync android-openssh/obj/local/armeabi/libssh.a $PREFIX/lib
-rsync android-openssh/jni/*.1 $PREFIX/share/man/man1/
-mv $PREFIX/bin/client-ssh $PREFIX/bin/ssh
+{ test -r android-openssh.done } || {
+ cp openssh-config.h android-openssh/jni/config.h
+ cp openssh-pathnames.h android-openssh/jni/pathnames.h
+ zndk-build android-openssh
+ { test $? = 0 } && {
+ touch android-openssh.done
+ rm -f android-openssh.installed }
+}
+{ test -r android-openssh.installed } || {
+ rsync android-openssh/libs/armeabi/* $PREFIX/bin
+ rsync android-openssh/obj/local/armeabi/libssh.a $PREFIX/lib
+ rsync android-openssh/jni/*.1 $PREFIX/share/man/man1/
+ rsync android-openssh/jni/*.5 $PREFIX/share/man/man5/
+ rsync android-openssh/jni/*.8 $PREFIX/share/man/man8/
+ mv $PREFIX/bin/client-ssh $PREFIX/bin/ssh
+ mkdir -p $PREFIX/etc/ssh
+ rsync android-openssh/jni/*-config $PREFIX/etc/ssh/
+ touch android-openssh.installed
+}
# make rsync
compile rsync default
zinstall rsync
# make git
+{ test -r git.done } || {
notice "Building git"
+GIT_FLAGS=(prefix=${APKPATH}/files/system NO_INSTALL_HARDLINKS=1 NO_NSEC=1 NO_ICONV=1)
+GIT_FLAGS+=(NO_PERL=1 NO_PYTHON=1)
pushd git
-zconfigure default
+autoconf
+zconfigure default "--without-iconv"
{ test $? = 0 } && {
- make prefix=${APKPATH}/files/system
- make man prefix=${APKPATH}/files/system
- { test $? = 0 } && { touch ../git.done }
+ make git ${GIT_FLAGS}
+# make man prefix=${APKPATH}/files/system
+ { test $? = 0 } && {
+ touch ../git.done
+ rm -f ../git.installed
+ }
}
-make install prefix=${APKPATH}/files/system NO_INSTALL_HARDLINKS=1
-make install-man prefix=${APKPATH}/files/system NO_INSTALL_HARDLINKS=1
popd
+}
+
+{ test -r git.installed } || {
+pushd git
+make install ${GIT_FLAGS}
+{ test $? = 0 } && { touch ../git.installed }
+#make install-man prefix=${APKPATH}/files/system NO_INSTALL_HARDLINKS=1
+
+# now fix all shellbangs in git's scripts. can't do that from config
+# flags because of config checks conflicting with cross-compilation.
+notice "Fixing shell bangs in git scripts"
+gitshellscripts=`find $PREFIX/libexec/git-core -type f`
+for i in ${(f)gitshellscripts}; do
+ func "git: fixing shellbang for $i"
+ file $i | grep -i 'posix shell script' > /dev/null
+ { test $? = 0 } && { sed -i "s@^#!/bin/sh@#!$PREFIX/bin/zsh@" $i }
+done
+popd
+}
+
diff --git a/build/system/etc/zlogin b/build/system/etc/zlogin
index efe364d..254eb83 100755
--- a/build/system/etc/zlogin
+++ b/build/system/etc/zlogin
@@ -11,6 +11,8 @@ export MANPAGER=most
export TERMINFO=$SYS/share/terminfo
export TERM=linux
+alias mc='mc -aX' # correct midnight rendering
+
cd $HOME
echo "Welcome to ZShaolin"
zsh
diff --git a/build/text/Sources b/build/text/Sources
index a624691..5b1e390 100644
--- a/build/text/Sources
+++ b/build/text/Sources
@@ -1,2 +1,3 @@
heirloom-doctools -080407 .tar.bz2
mdocml -1.12.1 .tar.gz
+vim -7.3 .tar.bz2 http://www.vim.org
diff --git a/build/text/conf.zsh b/build/text/conf.zsh
index 906e79f..e084ee3 100644
--- a/build/text/conf.zsh
+++ b/build/text/conf.zsh
@@ -17,6 +17,7 @@ vim_cv_getcwd_broken=no \
vim_cv_stat_ignores_slash=yes \
vim_cv_memmove_handles_overlap=yes \
ac_cv_sizeof_int=4 \
+ac_cv_c_uint32_t=yes \
compile vim default "--with-features=huge --without-x --without-gnome --with-tlib=ncurses --disable-xsmp --disable-sysmouse --disable-gpm --disable-acl --disable-xim --disable-gui"
zinstall vim
diff --git a/build/toys/Sources b/build/toys/Sources
index a142e6d..0a31625 100644
--- a/build/toys/Sources
+++ b/build/toys/Sources
@@ -1,3 +1,6 @@
libcaca -0.99.beta18 .tar.gz
sl -3.03 .tar.gz
matanza -0.13 .tar.gz
+curseofwar -1.2 .tar.gz https://github.com/a-nikolaev/curseofwar
+ctris -0.42 .tar.bz2 http://hackl.dhs.org/ctris
+cryptoslam -1.2 .tar.gz http://sf.net/projects/cryptoslam
diff --git a/build/toys/conf.zsh b/build/toys/conf.zsh
index 9f0a6c3..c2f88c5 100644
--- a/build/toys/conf.zsh
+++ b/build/toys/conf.zsh
@@ -29,3 +29,16 @@ notice "Building steam locomotive"
compile matanza default
zinstall matanza
+
+compile curseofwar default
+zinstall curseofwar
+
+compile ctris default
+{ test $? = 0 } && { pushd ctris
+cp ctris $PREFIX/bin
+mkdir -p $PREFIX/share/man/man6/
+gunzip -d -c ctris.6.gz > $PREFIX/share/man/man6/ctris.6
+popd }
+
+compile cryptoslam default
+{ test $? = 0 } && { cp cryptoslam/cryptoslam $PREFIX/bin }
diff --git a/wrap/static-cc b/wrap/static-cc
index fd4c909..3a0b36f 100755
--- a/wrap/static-cc
+++ b/wrap/static-cc
@@ -31,12 +31,20 @@ typeset -h argc
# QUIET=1 source ${ZHOME}/zmake source
+# save compile settings dir by dir so that we
+# can go there and run make by hand
+if [ "$TOOLCHAIN" = "" ]; then source .zbuild
+else rm -f .zbuild; touch .zbuild
+ print TOOLCHAIN=$TOOLCHAIN >> .zbuild
+ print ZTARGET=$ZTARGET >> .zbuild
+fi
+
case `basename $0`; in
static-cc|cc|gcc) cc=${TOOLCHAIN}/bin/${ZTARGET}-gcc ;;
static-c++|c++|g++) cc=${TOOLCHAIN}/bin/${ZTARGET}-g++ ;;
static-ld|ld) cc=${TOOLCHAIN}/bin/${ZTARGET}-ld ;;
*)
- echo "Error: unknown command to static wrapper: $0"
+ print "Error: unknown command to static wrapper: $0"
exit 1
esac
@@ -119,9 +127,11 @@ linkdep() {
}
# check if we are linking
+action=compile # or link
+
echo $arguments | grep -i ' -l' > /dev/null
{ test $? = 0 } && {
-
+ action=link
argc=0
for i in ${=arguments}; do
argc=$(( $argc + 1 ))
@@ -155,16 +165,19 @@ echo $arguments | grep -i ' -l' > /dev/null
done
# check if full static
- { test -z $isshared } && { cflags+=(-static -static-libgcc) }
- cflags=(${=cflags} ${=ldflags})
+ { test -z $isshared } && { ldflags+=(-static -static-libgcc) }
}
# remove duplicate arguments
typeset -U arguments
# execute
-print "$cc ${=cflags} ${=arguments}"
-$cc ${=cflags} ${=arguments}
+case $action in
+ compile) print "$cc ${=cflags} ${=arguments}"
+ $cc ${=cflags} ${=arguments} ;;
+ link) print "$cc ${=ldflags} ${=arguments}"
+ $cc ${=ldflags} ${=arguments} ;;
+esac
return $?
diff --git a/wrap/zshaolin.c b/wrap/zshaolin.c
new file mode 100644
index 0000000..25636b5
--- /dev/null
+++ b/wrap/zshaolin.c
@@ -0,0 +1,10 @@
+// functions that are missing in Android NDK
+
+#include <stdlib.h>
+
+
+char decimal_point='.';
+
+// infamous wide char
+int wctomb(char *s, wchar_t wc) { return wcrtomb(s,wc,NULL); }
+int mbtowc(wchar_t *pwc, const char *s, size_t n) { return mbrtowc(pwc, s, n, NULL); }