From 5fc5d37330d3535a0f421632694d1e7918fc22d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Tue, 8 Apr 2014 11:38:09 +0200 Subject: Compiles correctly: app/build-native + gradle. --- app/lzo/B/generic/build.sh | 69 +++++++++++++++++++++++++++++++++ app/lzo/B/generic/build_freestanding.sh | 8 ++++ app/lzo/B/generic/build_gcc.sh | 25 ++++++++++++ app/lzo/B/generic/clean.sh | 7 ++++ 4 files changed, 109 insertions(+) create mode 100755 app/lzo/B/generic/build.sh create mode 100755 app/lzo/B/generic/build_freestanding.sh create mode 100755 app/lzo/B/generic/build_gcc.sh create mode 100755 app/lzo/B/generic/clean.sh (limited to 'app/lzo/B/generic') diff --git a/app/lzo/B/generic/build.sh b/app/lzo/B/generic/build.sh new file mode 100755 index 00000000..1bf5585b --- /dev/null +++ b/app/lzo/B/generic/build.sh @@ -0,0 +1,69 @@ +#! /bin/sh +# vi:ts=4:et +set -e +echo "// Copyright (C) 1996-2011 Markus F.X.J. Oberhumer" +echo "//" +echo "// Generic Posix/Unix system" +echo "// Generic C compiler" + +test "X${top_srcdir}" = X && top_srcdir=`echo "$0" | sed 's,[^/]*$,,'`../.. + +test "X${AR}" = X && AR="ar" +test "X${CC}" = X && CC="cc" +test "X${CFLAGS+set}" = Xset || CFLAGS="-O" +# CPPFLAGS, LDFLAGS, LIBS +# LZO_EXTRA_CPPFLAGS, LZO_EXTRA_CFLAGS, LZO_EXTRA_LDFLAGS +# LZO_EXTRA_SOURCES, LZO_EXTRA_OBJECTS, LZO_EXTRA_LIBS + +CFI="-I${top_srcdir}/include -I${top_srcdir} -I${top_srcdir}/src" +BNAME=lzo2 +BLIB=lib${BNAME}.a + +CF="$CPPFLAGS $CFI $CFLAGS" +# info: we restrict ourselves to pure ANSI C library functions for the examples +CF="-DLZO_LIBC_ISOC90=1 $CF" +# info: we do not use _any_ external functions in freestanding mode +test -z "$LZO_CFG_FREESTANDING" || CF="-DLZO_CFG_FREESTANDING=1 $CF" +LF="$LDFLAGS $LZO_EXTRA_LDFLAGS" +LL="$BLIB $LIBS $LZO_EXTRA_LIBS" + +. $top_srcdir/B/generic/clean.sh + +for f in $top_srcdir/src/*.c $LZO_EXTRA_SOURCES; do + echo $CC $CF $LZO_EXTRA_CPPFLAGS $LZO_EXTRA_CFLAGS -c $f + $CC $CF $LZO_EXTRA_CPPFLAGS $LZO_EXTRA_CFLAGS -c $f +done + +echo $AR rcs $BLIB *.o $LZO_EXTRA_OBJECTS + $AR rcs $BLIB *.o $LZO_EXTRA_OBJECTS + + +if test -n "$LZO_CFG_FREESTANDING"; then + +echo "//" +echo "// Building $BLIB in freestanding mode was successful. All done." +echo "// Now try 'nm --extern-only $BLIB'" + +else + +for f in dict lzopack precomp precomp2 simple; do + echo $CC $CF $LF -o $f.out $top_srcdir/examples/$f.c $LL + $CC $CF $LF -o $f.out $top_srcdir/examples/$f.c $LL +done +echo $CC $CF $LF -o lzotest.out $top_srcdir/lzotest/lzotest.c $LL + $CC $CF $LF -o lzotest.out $top_srcdir/lzotest/lzotest.c $LL + +for f in minilzo.c testmini.c; do + XF="-I$top_srcdir/include/lzo $CF $LZO_EXTRA_CPPFLAGS $LZO_EXTRA_CFLAGS" + echo $CC $XF -c $top_srcdir/minilzo/$f + $CC $XF -c $top_srcdir/minilzo/$f +done +echo $CC $CF $LF -o testmini.out testmini.o minilzo.o $LIBS $LZO_EXTRA_LIBS + $CC $CF $LF -o testmini.out testmini.o minilzo.o $LIBS $LZO_EXTRA_LIBS + + +echo "//" +echo "// Building LZO was successful. All done." + +fi +true diff --git a/app/lzo/B/generic/build_freestanding.sh b/app/lzo/B/generic/build_freestanding.sh new file mode 100755 index 00000000..9473dd6d --- /dev/null +++ b/app/lzo/B/generic/build_freestanding.sh @@ -0,0 +1,8 @@ +#! /bin/sh +# vi:ts=4:et + +test "X${top_srcdir}" = X && top_srcdir=`echo "$0" | sed 's,[^/]*$,,'`../.. + +LZO_CFG_FREESTANDING=1 + +. $top_srcdir/B/generic/build.sh diff --git a/app/lzo/B/generic/build_gcc.sh b/app/lzo/B/generic/build_gcc.sh new file mode 100755 index 00000000..179d8c0f --- /dev/null +++ b/app/lzo/B/generic/build_gcc.sh @@ -0,0 +1,25 @@ +#! /bin/sh +# vi:ts=4:et +set -e +echo "// Using GNU C compiler." +echo "//" + +test "X${top_srcdir}" = X && top_srcdir=`echo "$0" | sed 's,[^/]*$,,'`../.. +UNAME_MACHINE=unknown + +CC="gcc -fPIC" +CC="gcc -static" +CC="gcc" +CFLAGS="-Wall -O2 -fomit-frame-pointer" + +# delete the next line to disable assembler support +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +case $UNAME_MACHINE in + i[34567]86) + CC="$CC -m32" + CPPFLAGS="-DLZO_USE_ASM" + LZO_EXTRA_SOURCES=$top_srcdir/asm/i386/src_gas/*.S + ;; +esac + +. $top_srcdir/B/generic/build.sh diff --git a/app/lzo/B/generic/clean.sh b/app/lzo/B/generic/clean.sh new file mode 100755 index 00000000..11c23951 --- /dev/null +++ b/app/lzo/B/generic/clean.sh @@ -0,0 +1,7 @@ +#! /bin/sh +# vi:ts=4:et +# Copyright (C) 1996-2011 Markus F.X.J. Oberhumer + +rm -f *.o liblzo2.a dict.out lzopack.out precomp.out precomp2.out simple.out lzotest.out testmini.out + +true -- cgit v1.2.3 From 3c3421afd8f74a3aa8d1011de07a8c18f9549210 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Tue, 8 Apr 2014 12:04:17 +0200 Subject: Rename app->bitmask_android This way, gradle commands generate apks correctly named. --- app/lzo/B/generic/build.sh | 69 --------------------------------- app/lzo/B/generic/build_freestanding.sh | 8 ---- app/lzo/B/generic/build_gcc.sh | 25 ------------ app/lzo/B/generic/clean.sh | 7 ---- 4 files changed, 109 deletions(-) delete mode 100755 app/lzo/B/generic/build.sh delete mode 100755 app/lzo/B/generic/build_freestanding.sh delete mode 100755 app/lzo/B/generic/build_gcc.sh delete mode 100755 app/lzo/B/generic/clean.sh (limited to 'app/lzo/B/generic') diff --git a/app/lzo/B/generic/build.sh b/app/lzo/B/generic/build.sh deleted file mode 100755 index 1bf5585b..00000000 --- a/app/lzo/B/generic/build.sh +++ /dev/null @@ -1,69 +0,0 @@ -#! /bin/sh -# vi:ts=4:et -set -e -echo "// Copyright (C) 1996-2011 Markus F.X.J. Oberhumer" -echo "//" -echo "// Generic Posix/Unix system" -echo "// Generic C compiler" - -test "X${top_srcdir}" = X && top_srcdir=`echo "$0" | sed 's,[^/]*$,,'`../.. - -test "X${AR}" = X && AR="ar" -test "X${CC}" = X && CC="cc" -test "X${CFLAGS+set}" = Xset || CFLAGS="-O" -# CPPFLAGS, LDFLAGS, LIBS -# LZO_EXTRA_CPPFLAGS, LZO_EXTRA_CFLAGS, LZO_EXTRA_LDFLAGS -# LZO_EXTRA_SOURCES, LZO_EXTRA_OBJECTS, LZO_EXTRA_LIBS - -CFI="-I${top_srcdir}/include -I${top_srcdir} -I${top_srcdir}/src" -BNAME=lzo2 -BLIB=lib${BNAME}.a - -CF="$CPPFLAGS $CFI $CFLAGS" -# info: we restrict ourselves to pure ANSI C library functions for the examples -CF="-DLZO_LIBC_ISOC90=1 $CF" -# info: we do not use _any_ external functions in freestanding mode -test -z "$LZO_CFG_FREESTANDING" || CF="-DLZO_CFG_FREESTANDING=1 $CF" -LF="$LDFLAGS $LZO_EXTRA_LDFLAGS" -LL="$BLIB $LIBS $LZO_EXTRA_LIBS" - -. $top_srcdir/B/generic/clean.sh - -for f in $top_srcdir/src/*.c $LZO_EXTRA_SOURCES; do - echo $CC $CF $LZO_EXTRA_CPPFLAGS $LZO_EXTRA_CFLAGS -c $f - $CC $CF $LZO_EXTRA_CPPFLAGS $LZO_EXTRA_CFLAGS -c $f -done - -echo $AR rcs $BLIB *.o $LZO_EXTRA_OBJECTS - $AR rcs $BLIB *.o $LZO_EXTRA_OBJECTS - - -if test -n "$LZO_CFG_FREESTANDING"; then - -echo "//" -echo "// Building $BLIB in freestanding mode was successful. All done." -echo "// Now try 'nm --extern-only $BLIB'" - -else - -for f in dict lzopack precomp precomp2 simple; do - echo $CC $CF $LF -o $f.out $top_srcdir/examples/$f.c $LL - $CC $CF $LF -o $f.out $top_srcdir/examples/$f.c $LL -done -echo $CC $CF $LF -o lzotest.out $top_srcdir/lzotest/lzotest.c $LL - $CC $CF $LF -o lzotest.out $top_srcdir/lzotest/lzotest.c $LL - -for f in minilzo.c testmini.c; do - XF="-I$top_srcdir/include/lzo $CF $LZO_EXTRA_CPPFLAGS $LZO_EXTRA_CFLAGS" - echo $CC $XF -c $top_srcdir/minilzo/$f - $CC $XF -c $top_srcdir/minilzo/$f -done -echo $CC $CF $LF -o testmini.out testmini.o minilzo.o $LIBS $LZO_EXTRA_LIBS - $CC $CF $LF -o testmini.out testmini.o minilzo.o $LIBS $LZO_EXTRA_LIBS - - -echo "//" -echo "// Building LZO was successful. All done." - -fi -true diff --git a/app/lzo/B/generic/build_freestanding.sh b/app/lzo/B/generic/build_freestanding.sh deleted file mode 100755 index 9473dd6d..00000000 --- a/app/lzo/B/generic/build_freestanding.sh +++ /dev/null @@ -1,8 +0,0 @@ -#! /bin/sh -# vi:ts=4:et - -test "X${top_srcdir}" = X && top_srcdir=`echo "$0" | sed 's,[^/]*$,,'`../.. - -LZO_CFG_FREESTANDING=1 - -. $top_srcdir/B/generic/build.sh diff --git a/app/lzo/B/generic/build_gcc.sh b/app/lzo/B/generic/build_gcc.sh deleted file mode 100755 index 179d8c0f..00000000 --- a/app/lzo/B/generic/build_gcc.sh +++ /dev/null @@ -1,25 +0,0 @@ -#! /bin/sh -# vi:ts=4:et -set -e -echo "// Using GNU C compiler." -echo "//" - -test "X${top_srcdir}" = X && top_srcdir=`echo "$0" | sed 's,[^/]*$,,'`../.. -UNAME_MACHINE=unknown - -CC="gcc -fPIC" -CC="gcc -static" -CC="gcc" -CFLAGS="-Wall -O2 -fomit-frame-pointer" - -# delete the next line to disable assembler support -UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown -case $UNAME_MACHINE in - i[34567]86) - CC="$CC -m32" - CPPFLAGS="-DLZO_USE_ASM" - LZO_EXTRA_SOURCES=$top_srcdir/asm/i386/src_gas/*.S - ;; -esac - -. $top_srcdir/B/generic/build.sh diff --git a/app/lzo/B/generic/clean.sh b/app/lzo/B/generic/clean.sh deleted file mode 100755 index 11c23951..00000000 --- a/app/lzo/B/generic/clean.sh +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/sh -# vi:ts=4:et -# Copyright (C) 1996-2011 Markus F.X.J. Oberhumer - -rm -f *.o liblzo2.a dict.out lzopack.out precomp.out precomp2.out simple.out lzotest.out testmini.out - -true -- cgit v1.2.3 From 1684c8f398922065a97e7da4dac4ac6a33cc5218 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Wed, 9 Apr 2014 16:03:55 +0200 Subject: Back to the standard "app" module. This return to "app" instead of "bitmask_android" is due to this reading: https://developer.android.com/sdk/installing/studio-build.html#projectStructure I'll have to tweak the final apk name in build.gradle. --- app/lzo/B/generic/build.sh | 69 +++++++++++++++++++++++++++++++++ app/lzo/B/generic/build_freestanding.sh | 8 ++++ app/lzo/B/generic/build_gcc.sh | 25 ++++++++++++ app/lzo/B/generic/clean.sh | 7 ++++ 4 files changed, 109 insertions(+) create mode 100755 app/lzo/B/generic/build.sh create mode 100755 app/lzo/B/generic/build_freestanding.sh create mode 100755 app/lzo/B/generic/build_gcc.sh create mode 100755 app/lzo/B/generic/clean.sh (limited to 'app/lzo/B/generic') diff --git a/app/lzo/B/generic/build.sh b/app/lzo/B/generic/build.sh new file mode 100755 index 00000000..1bf5585b --- /dev/null +++ b/app/lzo/B/generic/build.sh @@ -0,0 +1,69 @@ +#! /bin/sh +# vi:ts=4:et +set -e +echo "// Copyright (C) 1996-2011 Markus F.X.J. Oberhumer" +echo "//" +echo "// Generic Posix/Unix system" +echo "// Generic C compiler" + +test "X${top_srcdir}" = X && top_srcdir=`echo "$0" | sed 's,[^/]*$,,'`../.. + +test "X${AR}" = X && AR="ar" +test "X${CC}" = X && CC="cc" +test "X${CFLAGS+set}" = Xset || CFLAGS="-O" +# CPPFLAGS, LDFLAGS, LIBS +# LZO_EXTRA_CPPFLAGS, LZO_EXTRA_CFLAGS, LZO_EXTRA_LDFLAGS +# LZO_EXTRA_SOURCES, LZO_EXTRA_OBJECTS, LZO_EXTRA_LIBS + +CFI="-I${top_srcdir}/include -I${top_srcdir} -I${top_srcdir}/src" +BNAME=lzo2 +BLIB=lib${BNAME}.a + +CF="$CPPFLAGS $CFI $CFLAGS" +# info: we restrict ourselves to pure ANSI C library functions for the examples +CF="-DLZO_LIBC_ISOC90=1 $CF" +# info: we do not use _any_ external functions in freestanding mode +test -z "$LZO_CFG_FREESTANDING" || CF="-DLZO_CFG_FREESTANDING=1 $CF" +LF="$LDFLAGS $LZO_EXTRA_LDFLAGS" +LL="$BLIB $LIBS $LZO_EXTRA_LIBS" + +. $top_srcdir/B/generic/clean.sh + +for f in $top_srcdir/src/*.c $LZO_EXTRA_SOURCES; do + echo $CC $CF $LZO_EXTRA_CPPFLAGS $LZO_EXTRA_CFLAGS -c $f + $CC $CF $LZO_EXTRA_CPPFLAGS $LZO_EXTRA_CFLAGS -c $f +done + +echo $AR rcs $BLIB *.o $LZO_EXTRA_OBJECTS + $AR rcs $BLIB *.o $LZO_EXTRA_OBJECTS + + +if test -n "$LZO_CFG_FREESTANDING"; then + +echo "//" +echo "// Building $BLIB in freestanding mode was successful. All done." +echo "// Now try 'nm --extern-only $BLIB'" + +else + +for f in dict lzopack precomp precomp2 simple; do + echo $CC $CF $LF -o $f.out $top_srcdir/examples/$f.c $LL + $CC $CF $LF -o $f.out $top_srcdir/examples/$f.c $LL +done +echo $CC $CF $LF -o lzotest.out $top_srcdir/lzotest/lzotest.c $LL + $CC $CF $LF -o lzotest.out $top_srcdir/lzotest/lzotest.c $LL + +for f in minilzo.c testmini.c; do + XF="-I$top_srcdir/include/lzo $CF $LZO_EXTRA_CPPFLAGS $LZO_EXTRA_CFLAGS" + echo $CC $XF -c $top_srcdir/minilzo/$f + $CC $XF -c $top_srcdir/minilzo/$f +done +echo $CC $CF $LF -o testmini.out testmini.o minilzo.o $LIBS $LZO_EXTRA_LIBS + $CC $CF $LF -o testmini.out testmini.o minilzo.o $LIBS $LZO_EXTRA_LIBS + + +echo "//" +echo "// Building LZO was successful. All done." + +fi +true diff --git a/app/lzo/B/generic/build_freestanding.sh b/app/lzo/B/generic/build_freestanding.sh new file mode 100755 index 00000000..9473dd6d --- /dev/null +++ b/app/lzo/B/generic/build_freestanding.sh @@ -0,0 +1,8 @@ +#! /bin/sh +# vi:ts=4:et + +test "X${top_srcdir}" = X && top_srcdir=`echo "$0" | sed 's,[^/]*$,,'`../.. + +LZO_CFG_FREESTANDING=1 + +. $top_srcdir/B/generic/build.sh diff --git a/app/lzo/B/generic/build_gcc.sh b/app/lzo/B/generic/build_gcc.sh new file mode 100755 index 00000000..179d8c0f --- /dev/null +++ b/app/lzo/B/generic/build_gcc.sh @@ -0,0 +1,25 @@ +#! /bin/sh +# vi:ts=4:et +set -e +echo "// Using GNU C compiler." +echo "//" + +test "X${top_srcdir}" = X && top_srcdir=`echo "$0" | sed 's,[^/]*$,,'`../.. +UNAME_MACHINE=unknown + +CC="gcc -fPIC" +CC="gcc -static" +CC="gcc" +CFLAGS="-Wall -O2 -fomit-frame-pointer" + +# delete the next line to disable assembler support +UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown +case $UNAME_MACHINE in + i[34567]86) + CC="$CC -m32" + CPPFLAGS="-DLZO_USE_ASM" + LZO_EXTRA_SOURCES=$top_srcdir/asm/i386/src_gas/*.S + ;; +esac + +. $top_srcdir/B/generic/build.sh diff --git a/app/lzo/B/generic/clean.sh b/app/lzo/B/generic/clean.sh new file mode 100755 index 00000000..11c23951 --- /dev/null +++ b/app/lzo/B/generic/clean.sh @@ -0,0 +1,7 @@ +#! /bin/sh +# vi:ts=4:et +# Copyright (C) 1996-2011 Markus F.X.J. Oberhumer + +rm -f *.o liblzo2.a dict.out lzopack.out precomp.out precomp2.out simple.out lzotest.out testmini.out + +true -- cgit v1.2.3