Monday, November 13, 2017

Easiest, powerful and safe method to save animals from maggots etc


Note:

- To know method without reading story how i discovered this method go to near bottom of article with BOLD text.

- The article was written after 2 days of my medicine test and when many maggots died and healing skin started appearing on the skin holes. I forgot to capture photos of dog during the tests. But pic of healed stage is there at end of page.



How i found this method?


Incident 1: "Biggest & hardest task is to save life"


In August 2017 two puppies used to live near my home but one day i saw a hole in one puppy's right side of chest and lots of white maggots were eating the flesh of the puppy. Like a bowl with blood + tissues with bugs swimming in it. It was such a terrible view most people cannot watch it more. However i was more sad than disgusted and wanted to do something. The medicines of animals are not available in pharma stores near my home. The dog already reached severe stage and all i could do was keep him to a safe place in my home and try some cures i have heard. From anti-septic liquids to other methods i tried all i could do. I was forced to use the methods people should not randomly use. I mean using kerosene, petrol, phenol etc on wounds. These chemicals can be only used 1 or two times and only when problem is on skin and there is no alternative present. But when wound is deep inside skin these chemicals must not be used as they destroy the good cells more than the maggots do. The destroyed cells become food for maggots after chemicals evaporate.


I tried anti-septic liquids like Dettol which irritated the bugs and some of them started to come out but there were many inside the hole and it was not possible to take them out without surgical tools. (I also called a NGO JeevAsharay in my city Lucknow and they said they will come in 1-2 hours. They never came even after i contacted them via phone, facebook and sms repeatedly. I will pay for all the costs even if they are charity with free service. Most NGO's just want money and charity is their Elephant's trunk i.e. fake teeth.)


The smell of flesh kept getting bad. I kept the dog for many hours but when i cleaned the hole some maggots always appeared after some time. And also putting anti-septic water in hole used to go inside his stomach i guess. Because water kept disappearing. The dog finally died after some hours. I realised how tough is to save life :(.



Incident 2: "Maggots can be destroyed by natural things!"


After 2.5 months near my home a doggy gave birth to 5 puppies. All were good and people around give little food to them. But one day a kid shown me one of the puppies which were now 20 days old had same hole in his right side of stomach!. He said he has no medicine to apply. I checked the hole and it was deep just like previous case. I was sad to see the same thing. I decided to apply home remedies this time which humans also use. I kept applying Povidone-Iodine solution on hole to keep it safe from further infections.


From website http://www.jaagruti.org info i applied Neem Oil + Kapoor (camphor) in the hole. However nothing came out of hole and i thought there are no maggots. This method works but due to lack of pure neem oil i instead used povidone-iodine to clean he hole. However after 2 days i saw 1 maggot eating flesh. Now i had to kill these parasites anyhow. After trying many methods i had to use my own knowledge and my last weapon against the maggots. I always keep Phitkiri (Potash Alum) in home. I avoid chemicals like after-shave etc. Phitkiri is an extremely useful first aid stuff. It cleans water, kills bad microbes etc. Its a blood coagulation accelerator / booster!. If your skin gets cut or damaged by anything applying potash alum coagulates blood in seconds.


I made a semisolid paste of fitkiri/potash alum with water and filled in the maggot infested hole. (if you CLOSE THE HOLE maggots cannot come out which is not good). After 24 hours i saw maggots trying to come out of hole and ants attacking on the maggots!. I applied more potash alum with water with Povidone-Iodine above on it & on surrounding skin. After 12 Hours i saw died maggots over the hole. Many maggots finally died. The hole looked like filled with pus but it was potash alum texture with flesh. There also appeared a healing skin on the hole. This is the current situation of the wound and the dog can walk around to eat food, poo etc.


How phitkiri destroyed maggots?

When i was trying to find a solution my idea was to use some method other than i used i.e. trying to kill maggots. Instead of killing those maggots i thought to use potash alum to block all the possible ways maggots can live. It works like this -

- Maggots as soon as hurt the tissues blood is discharged.
- Exposed blood is mixed with potash alum which makes a clot there and tissues become a harder mass lacking blood.
- Maggots do not get flesh and blood to eat and start loosing energy. They by their own actions block their ways!. Now the monsters who can kill 1000s times bigger creature than them live a pathetic disastrous life.
- Other than coming out of the hole there is nothing much they can do.
- Potash alum boosts blood coagulation, saves from many microbes, blocks the flesh and more benefits.


This method i tested for 2 days gave the results rest of past 4-5 days could not. It means this solution is applicable to many infections where parasite has to die of hunger.


Update: a user asked how many times potash alum can be applied. It depends upon severity of wound and maggots. If blood is clearly visible and doesn't coagulate then potash alum must be used again because whole idea is to stop bleeding.



Solution:

Make a semi-solid paste of Phitkiri i.e. Potash alum + water and apply over the wound or fill in the maggot infested holes on tissues. How it works is described above. Anyone without any medical skills can use this method to save animals or humans from such infections when there is no hospital service present around.




Wednesday, April 5, 2017

Disable/Change default Nubia UI 4.0 Launcher

If you have updated your Nubia device to to Nubia UI 4.0 and cannot remove its default Nubia launcher then this post will help you.

I just updated my Nubia Z9 Mini to Nubia UI 4.0 and will say this update is awesome!. But i always hate the launchers which contain all icons on desktop in unsorted order. I am very irritated by this because i know if i have to launch Twitter or WhatsApp the letter comes at end and icon will be at end of launcher. To get rid of this i installed Nova launcher (holo launcher is my favorite). Follow the below steps to set default launcher or other default apps in Nubia UI 4.0.

- Install your favorite luncher.
- Go to settings -> Apps -> at top right there is  drop down list. Press it. -> Select your launcher.

You are done setting default launcher in Nubia 4.0.

Saturday, April 1, 2017

HTML5 canvas in a blogger.com page

I have been doing html5 for basic canvas graphics tests before building native code. With HTML5 we can build highly customized contents on a webpage. Example we can build a slideshow or some texts which cannot be copied. We can even build small apps on one blogpost. Below is a very simple example of adding html5 canvas on a blogger.com post.


Start with a new post on blogger.com and go to html edit mode. Its next to compose button. In html add the code mentioned below in post. The script which handles canvas resides in the canvas tag for easier management. After putting the code get back to compose mode and preview the page. The preview page will show the output as seen in this page.


Once happy publish it!. However there are limitations to this. Blogger.com posts don't give access to top level tag on html. As per the layout and template it offers editing in div tag in body. If we don't need exclusive access to screen and other similar things canvas inside blogger can do many multimedia work.


Copy the below script and add to your post in HTML edit mode.

Script:

<canvas height="200" id="canvas1" width="200">
Your browser does not supports canvas.

<script>
var canvas1 = document.getElementById("canvas1");
var context1 = canvas1.getContext("2d");
context1.fillRect(0, 0, 200, 200);
function loop() {
    context1.fillStyle = 'hsl(' + 360 * Math.random() + ', 50%, 50%)';
    context1.fillText("HTML5 Text!", 50, 50);
    // call loop again after 1000/5 milliseconds
    setTimeout( loop, 1000/6 );
}
loop();
</script>
</canvas>


Output of above script:
Your browser does not supports canvas.

Tuesday, March 14, 2017

Non GPL libsndfile alternative to read wav files. tinysndfile with Apache License, Version 2.0

A lot of people avoid using GPL in non-free software due to its imposed restrictions. I decided to use libsndfile which is GPL. But many people claim different restrictions as per GPL and i decided to avoid using this library because there were so many conflicting statements that i ended up with no conclusion. I still fear if someone claims for my GPL based projects on PlayStore to provide full source code!. I am not even maintaining many of them. If i am using GPL to process a wav file and i provide enough methods to enhance that GPL part of code why i am forced to provide rest of code?. This way one can even claim whole operating system to become GPL!!!. That's why Android Project decided to go with Apache License.


With above case in mind many developers built software with simpler licenses not imposing loads of terms and conditions. tinysndfile is such alternative to libsndfile. This library is available here https://android.googlesource.com/platform/system/media/+/master/audio_utils. tinysndfile is Android only and requires some editing to make it work on *NIX. I have done that work and stripped audio_utils to extract out tinysndfile. Using this library wav file can be read to get PCM data. It supports common wav files. Whether its a commercial project or a free software use it without fear of any legal issues.



Why tinysndfile?


Look at libsndfile page http://www.mega-nerd.com/libsndfile/ . Below text is read from the same -


"Licensing

libsndfile is released under the terms of the GNU Lesser General Public License, of which there are two versions; version 2.1 and version 3. To maximise the compatibility of libsndfile, the user may choose to use libsndfile under either of the above two licenses. You can also read a simple explanation of the ideas behind the GPL and the LGPL here.

You can use libsndfile with Free Software, Open Source, proprietary, shareware or other closed source applications as long as libsndfile is used as a dynamically loaded library and you abide by a small number of other conditions (read the LGPL for more info). With applications released under the GNU GPL you can also use libsndfile statically linked to your application.

I would like to see libsndfile used as widely as possible but I would prefer it if you released software that uses libsndfile as Free Software or Open Source. However, if you put in a great deal of effort building a significant application which simply uses libsndfile for file I/O, then I have no problem with you releasing that as closed source and charging as much money as you want for it as long as you abide by the license."



Small number of other terms are so much that i avoided using it. Such a great software i decide not to use :(. Example of such other terms are -


https://www.gnu.org/licenses/why-not-lgpl.en.html


https://source.android.com/source/licenses.html#why-apache-software-license



Don't forget to read the GPL section -

http://www.cgal.org/license.html




Download links:

You can download my non-Android version of tinysndfile from here https://github.com/bindeshkumarsingh/android-native-libs/blob/master/tinysndfile-src-nix.7z

Compiling libjpeg-turbo 1.5.1 on Android

I tried to build Turbo JPEG libary using cmake and then encountered "Platform not supported by this build system.  Use autotools instead.". This is because the author has hard-coded cmake script for windows platform only. I tried to modify cmake and build turbo-jpeg but before that i built it using configure script.


I created below script to build turbo-jpeg. The configure script automatically enabled NEON support after checking ARM environment. Anyone can use this script by changing variables like NDK, ARCH, PLATFORM etc.

This script will not work without some editing. There may be other ways to compile successfully but i was getting SIZE_MAX undefined error so i simply added #include in jmemmgr.c and completed building the binaries. File BUILDING.md has instructions to build Android version.


AndroidBuild.sh :
#!/bin/sh
# http://www.ourinnovativemind.in
# http://www.gamesgreh.in

export CONFIGURATION_OPTIONS="--disable-shared --enable-static"


# use custom build environment

# installation directory
export PREFIX=`pwd`/prefix

# Path of NDK. For simplicity make symlinks in home directories
export NDK=/home/bindesh/bin/ndk/

# processor specific libraries and includes.
# Suffix for arch-???. arch-arm  arch-arm64  arch-mips  arch-mips64  arch-x86  arch-x86_64
export ARCH=arm

# compiler for processor
export CROSS_COMPILE=arm-linux-androideabi

# Android platform version
export PLATFORM=android-9

# GCC compiler version
export GCC_VERSION=4.9


# Getting toolchain directory inside NDK from variables set above
# Hardcoded for linux running on x86 cpu 64-Bit
export ANDROID_PREFIX=${NDK}/toolchains/$CROSS_COMPILE-$GCC_VERSION/prebuilt/linux-x86_64

# SYSROOT. usr dir i.e. usr/include, usr/lib
export SYSROOT=${NDK}/platforms/$PLATFORM/arch-$ARCH
export CROSS_PATH=${ANDROID_PREFIX}/bin/${CROSS_COMPILE}

# Some compiler and binutils. More might be needed depending on source. 
export CPP=${CROSS_PATH}-cpp
export AR=${CROSS_PATH}-ar
export AS=${CROSS_PATH}-as
export NM=${CROSS_PATH}-nm
export CC=${CROSS_PATH}-gcc
export CXX=${CROSS_PATH}-g++
export LD=${CROSS_PATH}-ld
export RANLIB=${CROSS_PATH}-ranlib


# package configuration file save location
export PKG_CONFIG_PATH=${PREFIX}/lib/pkgconfig

# Flags for compiler
export CFLAGS="${CFLAGS} --sysroot=${SYSROOT} -I${SYSROOT}/usr/include -I${ANDROID_PREFIX}/include"
export CPPFLAGS="${CFLAGS}"
export LDFLAGS="${LDFLAGS} -L${SYSROOT}/usr/lib -L${ANDROID_PREFIX}/lib"

./configure --host=${CROSS_COMPILE} --with-sysroot=${SYSROOT} --prefix=${PREFIX} "$@" $CONFIGURATION_OPTIONS
make
make install



Below is the log file dumped after running this script. The resulting binaries can be downloaded from https://github.com/bindeshkumarsingh/android-native-libs/blob/master/libjpeg-turbo-1.5.1_Android.7z.

I haven't used this build for making a libjpeg client app. I expect it will work.


log :
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-androideabi-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for arm-linux-androideabi-gcc... /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc accepts -g... yes
checking for /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc option to accept ISO C89... none needed
checking whether /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc understands -c and -o together... yes
checking dependency style of /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc... gcc3
checking how to run the C preprocessor... /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-cpp
checking for arm-linux-androideabi-gcc... (cached) /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc accepts -g... (cached) yes
checking for /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc option to accept ISO C89... (cached) none needed
checking whether /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc understands -c and -o together... (cached) yes
checking dependency style of /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc... (cached) gcc3
checking for arm-linux-androideabi-ar... /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar
checking the archiver (/home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar) interface... ar
checking dependency style of /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-linux-androideabi
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc... /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld
checking if the linker (/home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-nm
checking the name lister (/home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-unknown-linux-gnu file names to arm-unknown-linux-androideabi format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld option to reload object files... -r
checking for arm-linux-androideabi-objdump... no
checking for objdump... objdump
configure: WARNING: using cross tools not prefixed with host triplet
checking how to recognize dependent libraries... pass_all
checking for arm-linux-androideabi-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for arm-linux-androideabi-ar... (cached) /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar
checking for archiver @FILE support... @
checking for arm-linux-androideabi-strip... strip
checking for arm-linux-androideabi-ranlib... /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ranlib
checking command to parse /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-nm output from /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc object... ok
checking for sysroot... /home/bindesh/bin/ndk//platforms/android-9/arch-arm
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for arm-linux-androideabi-mt... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc supports -fno-rtti -fno-exceptions... no
checking for /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc option to produce PIC... -fPIC -DPIC
checking if /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc PIC flag -fPIC -DPIC works... yes
checking if /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc static flag -static works... yes
checking if /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc supports -c -o file.o... yes
checking if /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc supports -c -o file.o... (cached) yes
checking whether the /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc linker (/home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld) supports shared libraries... yes
checking dynamic linker characteristics... Android linker
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking whether ln -s works... yes
checking for arm-linux-androideabi-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking size of size_t... 4
checking whether compiler supports pointers to undefined structures... yes
checking whether __SUNPRO_C is declared... no
checking for ANSI C header files... (cached) yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for string.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether char is unsigned... yes
checking for inline... inline
checking for size_t... yes
checking for unsigned char... yes
checking for unsigned short... yes
checking if right shift is signed... Assuming that right shift is signed on target machine.
checking for memset... yes
checking for memcpy... yes
checking libjpeg API version... 6.2
checking whether to include in-memory source/destination managers... yes
checking libjpeg shared library version... 62.2.0
checking whether the linker supports version scripts... yes (GNU style)
checking whether to use version script when building libjpeg-turbo... yes
checking for inline... inline __attribute__((always_inline))
checking whether to include arithmetic encoding support... yes
checking whether to include arithmetic decoding support... yes
checking whether to use 12-bit samples... no
checking whether to build TurboJPEG C wrapper... yes
checking whether to build TurboJPEG Java wrapper... no
checking if we have SIMD optimisations for cpu type... yes (arm)
checking if the assembler is GNU-compatible and can be used... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating pkgscripts/libjpeg-turbo.spec.tmpl
config.status: creating pkgscripts/makecygwinpkg.tmpl
config.status: creating pkgscripts/makedpkg.tmpl
config.status: creating pkgscripts/makemacpkg.tmpl
config.status: creating pkgscripts/uninstall.tmpl
config.status: creating pkgscripts/libjpeg.pc
config.status: creating pkgscripts/libturbojpeg.pc
config.status: creating tjbenchtest
config.status: creating libjpeg.map
config.status: creating Makefile
config.status: creating simd/Makefile
config.status: creating java/Makefile
config.status: creating md5/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: creating jconfig.h
config.status: jconfig.h is unchanged
config.status: creating jconfigint.h
config.status: jconfigint.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
make  all-recursive
make[1]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1'
Making all in java
make[2]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/java'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/java'
Making all in simd
make[2]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
make  all-am
make[3]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
make[2]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
Making all in md5
make[2]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/md5'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/md5'
make[2]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1'
  CC       jmemmgr.lo
jmemmgr.c: In function 'realize_virt_arrays':
jmemmgr.c:659:11: error: 'SIZE_MAX' undeclared (first use in this function)
       if (SIZE_MAX - maximum_space < new_space)
           ^
jmemmgr.c:659:11: note: each undeclared identifier is reported only once for each function it appears in
Makefile:1170: recipe for target 'jmemmgr.lo' failed
make[2]: *** [jmemmgr.lo] Error 1
make[2]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1'
Makefile:2031: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1'
Makefile:790: recipe for target 'all' failed
make: *** [all] Error 2
Making install in java
make[1]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/java'
make[2]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/java'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/java'
make[1]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/java'
Making install in simd
make[1]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
make  install-am
make[2]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
make[3]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
make[2]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
make[1]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
Making install in md5
make[1]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/md5'
make[2]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/md5'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/md5'
make[1]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/md5'
make[1]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1'
  CC       jmemmgr.lo
jmemmgr.c: In function 'realize_virt_arrays':
jmemmgr.c:659:11: error: 'SIZE_MAX' undeclared (first use in this function)
       if (SIZE_MAX - maximum_space < new_space)
           ^
jmemmgr.c:659:11: note: each undeclared identifier is reported only once for each function it appears in
Makefile:1170: recipe for target 'jmemmgr.lo' failed
make[1]: *** [jmemmgr.lo] Error 1
make[1]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1'
Makefile:2031: recipe for target 'install-recursive' failed
make: *** [install-recursive] Error 1
bindesh@bindesh-Satellite-C650D:/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1$ sh AndroidBuild.sh 
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for arm-linux-androideabi-strip... no
checking for strip... strip
checking for a thread-safe mkdir -p... /bin/mkdir -p
checking for gawk... gawk
checking whether make sets $(MAKE)... yes
checking whether make supports nested variables... yes
checking whether make supports nested variables... (cached) yes
checking for style of include used by make... GNU
checking for arm-linux-androideabi-gcc... /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
checking whether the C compiler works... yes
checking for C compiler default output file name... a.out
checking for suffix of executables... 
checking whether we are cross compiling... yes
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc accepts -g... yes
checking for /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc option to accept ISO C89... none needed
checking whether /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc understands -c and -o together... yes
checking dependency style of /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc... gcc3
checking how to run the C preprocessor... /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-cpp
checking for arm-linux-androideabi-gcc... (cached) /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc accepts -g... (cached) yes
checking for /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc option to accept ISO C89... (cached) none needed
checking whether /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc understands -c and -o together... (cached) yes
checking dependency style of /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc... (cached) gcc3
checking for arm-linux-androideabi-ar... /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar
checking the archiver (/home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar) interface... ar
checking dependency style of /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc... gcc3
checking build system type... x86_64-unknown-linux-gnu
checking host system type... arm-unknown-linux-androideabi
checking how to print strings... printf
checking for a sed that does not truncate output... /bin/sed
checking for grep that handles long lines and -e... /bin/grep
checking for egrep... /bin/grep -E
checking for fgrep... /bin/grep -F
checking for ld used by /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc... /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld
checking if the linker (/home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld) is GNU ld... yes
checking for BSD- or MS-compatible name lister (nm)... /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-nm
checking the name lister (/home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-nm) interface... BSD nm
checking whether ln -s works... yes
checking the maximum length of command line arguments... 1572864
checking how to convert x86_64-unknown-linux-gnu file names to arm-unknown-linux-androideabi format... func_convert_file_noop
checking how to convert x86_64-unknown-linux-gnu file names to toolchain format... func_convert_file_noop
checking for /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld option to reload object files... -r
checking for arm-linux-androideabi-objdump... no
checking for objdump... objdump
configure: WARNING: using cross tools not prefixed with host triplet
checking how to recognize dependent libraries... pass_all
checking for arm-linux-androideabi-dlltool... no
checking for dlltool... no
checking how to associate runtime and link libraries... printf %s\n
checking for arm-linux-androideabi-ar... (cached) /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ar
checking for archiver @FILE support... @
checking for arm-linux-androideabi-strip... strip
checking for arm-linux-androideabi-ranlib... /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ranlib
checking command to parse /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-nm output from /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc object... ok
checking for sysroot... /home/bindesh/bin/ndk//platforms/android-9/arch-arm
checking for a working dd... /bin/dd
checking how to truncate binary pipes... /bin/dd bs=4096 count=1
checking for arm-linux-androideabi-mt... no
checking for mt... mt
checking if mt is a manifest tool... no
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for dlfcn.h... yes
checking for objdir... .libs
checking if /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc supports -fno-rtti -fno-exceptions... no
checking for /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc option to produce PIC... -fPIC -DPIC
checking if /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc PIC flag -fPIC -DPIC works... yes
checking if /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc static flag -static works... yes
checking if /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc supports -c -o file.o... yes
checking if /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc supports -c -o file.o... (cached) yes
checking whether the /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc linker (/home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ld) supports shared libraries... yes
checking dynamic linker characteristics... Android linker
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... no
checking whether to build static libraries... yes
checking whether ln -s works... yes
checking for arm-linux-androideabi-pkg-config... no
checking for pkg-config... /usr/bin/pkg-config
checking pkg-config is at least version 0.9.0... yes
checking size of size_t... 4
checking whether compiler supports pointers to undefined structures... yes
checking whether __SUNPRO_C is declared... no
checking for ANSI C header files... (cached) yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdlib.h... (cached) yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking for string.h... (cached) yes
checking for sys/types.h... (cached) yes
checking for an ANSI C-conforming const... yes
checking whether char is unsigned... yes
checking for inline... inline
checking for size_t... yes
checking for unsigned char... yes
checking for unsigned short... yes
checking if right shift is signed... Assuming that right shift is signed on target machine.
checking for memset... yes
checking for memcpy... yes
checking libjpeg API version... 6.2
checking whether to include in-memory source/destination managers... yes
checking libjpeg shared library version... 62.2.0
checking whether the linker supports version scripts... yes (GNU style)
checking whether to use version script when building libjpeg-turbo... yes
checking for inline... inline __attribute__((always_inline))
checking whether to include arithmetic encoding support... yes
checking whether to include arithmetic decoding support... yes
checking whether to use 12-bit samples... no
checking whether to build TurboJPEG C wrapper... yes
checking whether to build TurboJPEG Java wrapper... no
checking if we have SIMD optimisations for cpu type... yes (arm)
checking if the assembler is GNU-compatible and can be used... yes
checking that generated files are newer than configure... done
configure: creating ./config.status
config.status: creating pkgscripts/libjpeg-turbo.spec.tmpl
config.status: creating pkgscripts/makecygwinpkg.tmpl
config.status: creating pkgscripts/makedpkg.tmpl
config.status: creating pkgscripts/makemacpkg.tmpl
config.status: creating pkgscripts/uninstall.tmpl
config.status: creating pkgscripts/libjpeg.pc
config.status: creating pkgscripts/libturbojpeg.pc
config.status: creating tjbenchtest
config.status: creating libjpeg.map
config.status: creating Makefile
config.status: creating simd/Makefile
config.status: creating java/Makefile
config.status: creating md5/Makefile
config.status: creating config.h
config.status: config.h is unchanged
config.status: creating jconfig.h
config.status: jconfig.h is unchanged
config.status: creating jconfigint.h
config.status: jconfigint.h is unchanged
config.status: executing depfiles commands
config.status: executing libtool commands
make  all-recursive
make[1]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1'
Making all in java
make[2]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/java'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/java'
Making all in simd
make[2]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
make  all-am
make[3]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
make[3]: Nothing to be done for 'all-am'.
make[3]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
make[2]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
Making all in md5
make[2]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/md5'
make[2]: Nothing to be done for 'all'.
make[2]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/md5'
make[2]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1'
  CC       jmemmgr.lo
  CC       jmemnobs.lo
  CC       jaricom.lo
  CC       jcarith.lo
  CC       jdarith.lo
  CCLD     libjpeg.la
  CC       libturbojpeg_la-jcapimin.lo
  CC       libturbojpeg_la-jcapistd.lo
  CC       libturbojpeg_la-jccoefct.lo
  CC       libturbojpeg_la-jccolor.lo
  CC       libturbojpeg_la-jcdctmgr.lo
  CC       libturbojpeg_la-jchuff.lo
  CC       libturbojpeg_la-jcinit.lo
  CC       libturbojpeg_la-jcmainct.lo
  CC       libturbojpeg_la-jcmarker.lo
  CC       libturbojpeg_la-jcmaster.lo
  CC       libturbojpeg_la-jcomapi.lo
  CC       libturbojpeg_la-jcparam.lo
  CC       libturbojpeg_la-jcphuff.lo
  CC       libturbojpeg_la-jcprepct.lo
  CC       libturbojpeg_la-jcsample.lo
  CC       libturbojpeg_la-jctrans.lo
  CC       libturbojpeg_la-jdapimin.lo
  CC       libturbojpeg_la-jdapistd.lo
  CC       libturbojpeg_la-jdatadst.lo
  CC       libturbojpeg_la-jdatasrc.lo
  CC       libturbojpeg_la-jdcoefct.lo
  CC       libturbojpeg_la-jdcolor.lo
  CC       libturbojpeg_la-jddctmgr.lo
  CC       libturbojpeg_la-jdhuff.lo
  CC       libturbojpeg_la-jdinput.lo
  CC       libturbojpeg_la-jdmainct.lo
  CC       libturbojpeg_la-jdmarker.lo
  CC       libturbojpeg_la-jdmaster.lo
  CC       libturbojpeg_la-jdmerge.lo
  CC       libturbojpeg_la-jdphuff.lo
  CC       libturbojpeg_la-jdpostct.lo
  CC       libturbojpeg_la-jdsample.lo
  CC       libturbojpeg_la-jdtrans.lo
  CC       libturbojpeg_la-jerror.lo
  CC       libturbojpeg_la-jfdctflt.lo
  CC       libturbojpeg_la-jfdctfst.lo
  CC       libturbojpeg_la-jfdctint.lo
  CC       libturbojpeg_la-jidctflt.lo
  CC       libturbojpeg_la-jidctfst.lo
  CC       libturbojpeg_la-jidctint.lo
  CC       libturbojpeg_la-jidctred.lo
  CC       libturbojpeg_la-jquant1.lo
  CC       libturbojpeg_la-jquant2.lo
  CC       libturbojpeg_la-jutils.lo
  CC       libturbojpeg_la-jmemmgr.lo
  CC       libturbojpeg_la-jmemnobs.lo
  CC       libturbojpeg_la-jaricom.lo
  CC       libturbojpeg_la-jcarith.lo
  CC       libturbojpeg_la-jdarith.lo
  CC       libturbojpeg_la-turbojpeg.lo
  CC       libturbojpeg_la-transupp.lo
  CC       libturbojpeg_la-jdatadst-tj.lo
  CC       libturbojpeg_la-jdatasrc-tj.lo
  CCLD     libturbojpeg.la
  CC       cjpeg-cdjpeg.o
  CC       cjpeg-cjpeg.o
  CC       cjpeg-rdgif.o
  CC       cjpeg-rdppm.o
  CC       cjpeg-rdswitch.o
  CC       cjpeg-rdbmp.o
  CC       cjpeg-rdtarga.o
  CCLD     cjpeg
  CC       djpeg-cdjpeg.o
  CC       djpeg-djpeg.o
  CC       djpeg-rdcolmap.o
  CC       djpeg-rdswitch.o
  CC       djpeg-wrgif.o
  CC       djpeg-wrppm.o
  CC       djpeg-wrbmp.o
  CC       djpeg-wrtarga.o
  CCLD     djpeg
  CC       jpegtran.o
  CC       rdswitch.o
  CC       cdjpeg.o
  CC       transupp.o
  CCLD     jpegtran
  CC       rdjpgcom.o
  CCLD     rdjpgcom
  CC       wrjpgcom.o
  CCLD     wrjpgcom
  CC       tjbench-tjbench.o
  CC       tjbench-bmp.o
  CC       tjbench-tjutil.o
  CC       tjbench-rdbmp.o
  CC       tjbench-rdppm.o
  CC       tjbench-wrbmp.o
  CC       tjbench-wrppm.o
  CCLD     tjbench
  CC       jcstest.o
  CCLD     jcstest
  CC       tjunittest.o
  CC       tjutil.o
  CCLD     tjunittest
make[2]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1'
make[1]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1'
Making install in java
make[1]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/java'
make[2]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/java'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/java'
make[1]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/java'
Making install in simd
make[1]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
make  install-am
make[2]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
make[3]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
make[3]: Nothing to be done for 'install-exec-am'.
make[3]: Nothing to be done for 'install-data-am'.
make[3]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
make[2]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
make[1]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/simd'
Making install in md5
make[1]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/md5'
make[2]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/md5'
make[2]: Nothing to be done for 'install-exec-am'.
make[2]: Nothing to be done for 'install-data-am'.
make[2]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/md5'
make[1]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/md5'
make[1]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1'
make[2]: Entering directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1'
 /bin/mkdir -p '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/lib'
 /bin/bash ./libtool   --mode=install /usr/bin/install -c   libjpeg.la libturbojpeg.la '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/lib'
libtool: install: /usr/bin/install -c .libs/libjpeg.lai /media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/lib/libjpeg.la
libtool: install: /usr/bin/install -c .libs/libturbojpeg.lai /media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/lib/libturbojpeg.la
libtool: install: /usr/bin/install -c .libs/libjpeg.a /media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/lib/libjpeg.a
libtool: install: chmod 644 /media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/lib/libjpeg.a
libtool: install: /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ranlib /media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/lib/libjpeg.a
libtool: install: /usr/bin/install -c .libs/libturbojpeg.a /media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/lib/libturbojpeg.a
libtool: install: chmod 644 /media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/lib/libturbojpeg.a
libtool: install: /home/bindesh/bin/ndk//toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-ranlib /media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/lib/libturbojpeg.a
 /bin/mkdir -p '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/bin'
  /bin/bash ./libtool   --mode=install /usr/bin/install -c cjpeg djpeg jpegtran rdjpgcom wrjpgcom tjbench '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/bin'
libtool: install: /usr/bin/install -c cjpeg /media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/bin/cjpeg
libtool: install: /usr/bin/install -c djpeg /media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/bin/djpeg
libtool: install: /usr/bin/install -c jpegtran /media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/bin/jpegtran
libtool: install: /usr/bin/install -c rdjpgcom /media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/bin/rdjpgcom
libtool: install: /usr/bin/install -c wrjpgcom /media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/bin/wrjpgcom
libtool: install: /usr/bin/install -c tjbench /media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/bin/tjbench
 /bin/mkdir -p '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/share/doc/libjpeg-turbo'
 /usr/bin/install -c -m 644 README.ijg README.md libjpeg.txt structure.txt usage.txt wizard.txt LICENSE.md '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/share/doc/libjpeg-turbo'
 /bin/mkdir -p '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/share/doc/libjpeg-turbo'
 /usr/bin/install -c -m 644 example.c '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/share/doc/libjpeg-turbo'
 /bin/mkdir -p '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/include'
 /usr/bin/install -c -m 644 jerror.h jmorecfg.h jpeglib.h turbojpeg.h '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/include'
 /bin/mkdir -p '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/share/man/man1'
 /usr/bin/install -c -m 644 cjpeg.1 djpeg.1 jpegtran.1 rdjpgcom.1 wrjpgcom.1 '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/share/man/man1'
 /bin/mkdir -p '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/include'
 /usr/bin/install -c -m 644 jconfig.h '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/include'
 /bin/mkdir -p '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/lib/pkgconfig'
 /usr/bin/install -c -m 644 pkgscripts/libjpeg.pc pkgscripts/libturbojpeg.pc '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1/prefix/lib/pkgconfig'
make[2]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1'
make[1]: Leaving directory '/media/bindesh/WORK/Software/libraries/libjpeg-turbo-1.5.1'





Thursday, March 9, 2017

JPG Image size reducer. How to reduce jpg to desired size without changing resolution on PC and Android?

When we click a photo it contains lot of colors which our eyes cannot differentiate. Higher colors means higher image size and with evolving camera chips images are getting bigger and bigger in size. There are many methods to reduce photo size. Lets look at some methods of reducing image size.


I recently backup my images on Google drive. The images were bigger in size and were in GBs in size which i reduced to ~700MB (deleted few repeated images). Among size reduction methods most of us reduce the image resolution i.e. number of pixels are reduced. For example Full HD images are reduced to qHD or 720p. But i didn't reduced the number of pixels but number of colors!


This is already a reduced image of size ~900KB. I captured this image in my garden in 2016 summer using my Nubia Z9 mini phone. Its already reduced in size to load faster on website.



Original: 942KB


 Half resolution: 711KB





Reduced Colors: 268KB



Looking at images its clear that reducing number of colors has greater size reduction than reducing resolution only. Do check the images by downloading them and zoom. Decide yourself which one is better!


Now coming to the tools used for size reduction. Without taking much time below are some tools to reduce size of jpg.

  • ImageMagick's convert tool. This s a commandline tool which can reduce jpg size to desired size. Example: convert -define jpeg:extent=500kb nubia_bks_camera.jpg out.jpg. This will reduce original image to ~500KB without changing resolution.
  • jpegoptim: this tool is same as imagemagick with desired jpg size.
  • IrfanView. This is a windows only GUI software which can reduce jpg files to desired size.

I have created my own Android app which can do above size reduction and is very easy to work with. Here is the link to my app Jpg Image Size Reducer: https://play.google.com/store/apps/details?id=org.greh.imagesizereducer. A quick usage example of this app is you share your selfie which is 2MB and want to reduce size quickly without editing the image. Share it with any image app and select jpg image size reducer and reduce to whatever % or KB and then share the copy to wherever you want!. It can also reduce many files in batch. Its also an image converter and can convert non-jpg files to jpg and reduce its size.



The software above reduce number of colors which reduces size of image even more than reducing size does. However Using both methods can give very small size images. Reducing total colors to few thousand or hundreds can be noticed easily by zooming. Another method to reduce image size is to change image mode to INDEXED from RGB. Indexed mode means all colors are collected at a place/table and index/position of a color from table is used. This can reduce size. However this is not always better.

Tuesday, February 28, 2017

WildMidi for Android: Compiling WildMidi using Android NDK rev 13

Android had no standard midi protocol before Marshmallow. Even after a standard MIDI event API for a developer to build android app which does midi synthesis by itself is a great feature!. In 2016 i compiled FluidSynth 1.6 for Android and created a SoundFont Midi Player with USB keyboard support. This app can play midi, rmi files and can send midi events via USB MIDI Keyboard, Normal USB keyboard to fluidsynth to synthesize sound. Due to latency and high CPU consumption issues i decided to look at other options. One good option was WildMidi.


WildMidi - https://www.mindwerks.net/projects/wildmidi/


It says -

"The WildMIDI library uses Gravis Ultrasound patch files to convert MIDI files into audio which is then passed back to the calling application for further processing or output

Library Features

  • RIFF MIDI file support
  • MIDI format 0, 1 and 2 support
  • MIDI-like formats: KAR, HMI, HMP, MUS and XMI
  • Cross Platform: Linux, Windows, OSX, FreeBSD and etc.
  • Thread safe
  • host-Endian native streaming
  • WAV file output
  • Linear and gauss re-sampling
  • Final output reverb engine
  • Timidity.cfg compatibility
Player Features

  • OSS and Alsa Output (Linux/FreeBSD)
  • Windows Sound System support (Windows)
  • OpenAL (OSX/Others)
  • SoundBlaster 16 (DOS)"


In Player features Android sound system is not mentioned and that doesn't mean it cannot be used in Android. I compiled WildMidi for Android and the link to download the binary package is mentioned later in this page. I tested WildMidi on Ubuntu-Studio which had inbuilt "FreePats". The Gravis Ultrasound Patch files are used by WildMidi to synthesize sound. We can use WildMidi player to play midi files on Android by modifying its player code by sending PCM buffer to Android OpenSLES or AudioTrack.

Can wildmidi be used for sending MIDI events to build piano like app with fast response? Currently NO as per wildmidi source!


Looking at source code of wildmidi inside wildmidi_lib.h. It says "Not Yet Implemented". That "latency" thing! everywhere.

Preview:
/* NOTE: Not Yet Implemented Or Tested Properly */
/* Due to delay in audio output in the player, this is not being developed
   futher at the moment. Further Development will occur when output latency
   has been reduced enough to "appear" instant.
WM_SYMBOL int WildMidi_Live (midi * handle, uint32_t midi_event);
 */

/* reserved for future coding
 * need to change these to use a time for cmd_pos and new_cmd_pos

WM_SYMBOL int WildMidi_InsertMidiEvent (midi * handle, uint8_t char midi_cmd, *char midi_cmd_data, unsigned long int midi_cmd_data_size, unsigned long int *cmd_pos);
WM_SYMBOL int WildMidi_DeleteMidiEvent (midi * handle, uint8_t char midi_cmd, unsigned long int *cmd_pos);
WM_SYMBOL int WildMidi_MoveMidiEvent (midi * handle, , uint8_t char midi_cmd, unsigned long int *cmd_pos, unsigned long int *new_cmd_pos);
 */



This can be used to build a midi player for android using wildmidi synthesizer. The build script is same as libpng build script mentioned on my other article.



Download wildmidi arm binary from here:
https://github.com/bindeshkumarsingh/android-native-libs




Saturday, February 25, 2017

NEW: Building libpng 1.6.28 using Android NDK r13 CMake based build system

I recently updated to NDK revision 13 and also found ndk samples are now cmake + ninja based. Today 3-4 hours were consumed while trying to compile libpng but finally done it after editing CMakeLists.txt of libpng.

I tried to build libpng using Androud Studio's Gradle plugin from IDE but that was more problematic as it too required CMakeLists.txt editing and kept throwing bad link to libpng.so error. I decided to use shell which is my 1st and last choice to work in most cases. Before putting the scripts/code lets setup our work directory and data and also look at how cmake based build system compiles libpng.


Before starting ensure below tools are installed and working correctly on your system.

  • Android NDK revision 12+ is installed. If you have Android SDK installed but NDK is at some other location then you can move NDK inside SDK and rename it to ndk-bundle Or create a sym-link "ndk-bundle" in SDK pointing to actual NDK. After this NDK will start showing in the Android Studio 2.2+ SDK manager.
  • Install cmake from SDK manager. It will get extracted in Android SDK directory.
  • A good command shell. I use Ubuntu-Studio Linux with bash shell(s). Windows users can use cmd.exe or bash shell through UnixUtils.


Build process:

  1. Dowload libpng 1.6.28 from here http://ftp.osuosl.org/pub/blfs/conglomeration/libpng/libpng-1.6.28.tar.xz and extract to some location with shorter path without spaces. e.g. /home/username/projects/libpng in Linux or c:\work\libpng in windows. This is for convenience and avoid space related issues while compiling.
  2. Copy full path of android.toolchain.cmake present in NDK. Example /media/bindesh/WORK/SDK_IDE/android-ndk-r13b/build/cmake/android.toolchain.cmake. There is same named file present in ANDROID_SDK/cmake/ like this /media/bindesh/WORK/SDK_IDE/android-sdk-linux-windows/cmake/3.6.3155560/android.toolchain.cmake but we must use toolchain file present in NDK. If toolchain present in sdk/cmake is used incompatibility issues like "Invalid Android NDK revision (should be 12" can occur.
  3. Open libpng/CMakeLists.txt file in text editor and add include("/home/bindesh/bin/ndk/build/cmake/android.toolchain.cmake") line after project(libpng C). Change the NDK path to yours.

Copy below bash script to create a file build.sh in libpng folder. Change the cmake, ninja, toolchain, sdk, ndk paths in script and run to build libpng. Replace the toolchain path copied through above steps. I have not tested this on Windows but using UnixUtils's sh.exe it should work.


build script:
#!/bin/sh

# run this script after changing the paths of ndk, sdk, cmake, ninja etc to build libpng or other cmake based library.
# Don't forget to add below line in main CMakeLists.txt after project() line of code.
# include("PATH_TO_NDK/build/cmake/android.toolchain.cmake")

clear
reset

# clean previous files
rm CMakeCache.txt


# Change these paths and run this script to build libpng
ANDROID_NDK_PATH=/home/bindesh/bin/ndk
ANDROID_SDK_PATH=/home/bindesh/bin/android-sdk
ANDROID_NDK=${ANDROID_NDK_PATH}

ANDROID_CMAKE_PATH=${ANDROID_SDK_PATH}/cmake/3.6.3155560/bin
ANDROID_CMAKE_TOOLCHAIN=${ANDROID_NDK_PATH}/build/cmake/android.toolchain.cmake

# Don't use toolchain from cmake
#ANDROID_CMAKE_TOOLCHAIN=/media/bindesh/WORK/SDK_IDE/android-sdk-linux-windows/cmake/3.6.3155560/android.toolchain.cmake


ANDROID_API=9
ANDROID_ARCH=arm
ANDROID_ABI=armeabi-v7a
ANDROID_PLATFORM=android-${ANDROID_API}
ANDROID_ARCH=arch-${ANDROID_ARCH}

${ANDROID_CMAKE_PATH}/cmake -DCMAKE_TOOLCHAIN_FILE=${ANDROID_CMAKE_TOOLCHAIN} -DANDROID_ABI=${ANDROID_ABI} -DANDROID_TOOLCHAIN=gcc -DANDROID_NATIVE_API_LEVEL=${ANDROID_API} -DANDROID_PLATFORM=${ANDROID_PLATFORM} -DCMAKE_MAKE_PROGRAM=${ANDROID_CMAKE_PATH}/ninja -G"Android Gradle - Ninja" 
#-DCMAKE_BUILD_TYPE=Release

#${ANDROID_CMAKE_PATH}/cmake -DCMAKE_TOOLCHAIN_FILE=${ANDROID_CMAKE_TOOLCHAIN} -DCMAKE_MAKE_PROGRAM=${ANDROID_CMAKE_PATH}/ninja -G"Android Gradle - Ninja" -DANDROID_NDK=${ANDROID_NDK}
${ANDROID_CMAKE_PATH}/ninja
#make 
 

mv ./libpng16.a ./libpng16-${ANDROID_ABI}.a


 


Below is the CMakeOutput.log to check details of build environment.

Preview:
The target system is: Android - 9 - armv7-a
The host system is: Linux - 4.8.0-22-lowlatency - x86_64
Compiling the C compiler identification source file "CMakeCCompilerId.c" succeeded.
Compiler: /home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc 
Build flags: -g;-DANDROID;-ffunction-sections;-funwind-tables;-fstack-protector-strong;-no-canonical-prefixes;-march=armv7-a;-mfloat-abi=softfp;-mfpu=vfpv3-d16;-mthumb;-Wa,--noexecstack;-Wformat;-Werror=format-security;-g;-DANDROID;-ffunction-sections;-funwind-tables;-fstack-protector-strong;-no-canonical-prefixes;-march=armv7-a;-mfloat-abi=softfp;-mfpu=vfpv3-d16;-mthumb;-Wa,--noexecstack;-Wformat;-Werror=format-security;
Id flags: -c

The output was:
0


Compilation of the C compiler identification source "CMakeCCompilerId.c" produced "CMakeCCompilerId.o"

The C compiler identification is GNU, found in "/media/bindesh/WORK/00_write/libpng-1.6.28/CMakeFiles/3.6.0-rc2/CompilerIdC/CMakeCCompilerId.o"

Determining if the C compiler works passed with the following output:
Change Dir: /media/bindesh/WORK/00_write/libpng-1.6.28/CMakeFiles/CMakeTmp

Run Build Command:"/home/bindesh/bin/android-sdk/cmake/3.6.3155560/bin/ninja" "cmTC_76f0a"
[1/2] Building C object CMakeFiles/cmTC_76f0a.dir/testCCompiler.c.o
[2/2] Linking C executable cmTC_76f0a


Detecting C compiler ABI info compiled with the following output:
Change Dir: /media/bindesh/WORK/00_write/libpng-1.6.28/CMakeFiles/CMakeTmp

Run Build Command:"/home/bindesh/bin/android-sdk/cmake/3.6.3155560/bin/ninja" "cmTC_7ad81"
[1/2] Building C object CMakeFiles/cmTC_7ad81.dir/CMakeCCompilerABI.c.o
[2/2] Linking C executable cmTC_7ad81
Using built-in specs.
COLLECT_GCC=/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc
COLLECT_LTO_WRAPPER=/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.9.x/lto-wrapper
Target: arm-linux-androideabi
Configured with: /usr/local/google/buildbot/src/android/gcc/toolchain/build/../gcc/gcc-4.9/configure --prefix=/tmp/59719db9ae19ff43aef46bbcb79596b6 --target=arm-linux-androideabi --host=x86_64-linux-gnu --build=x86_64-linux-gnu --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --with-gmp=/buildbot/tmp/build/toolchain/temp-install --with-mpfr=/buildbot/tmp/build/toolchain/temp-install --with-mpc=/buildbot/tmp/build/toolchain/temp-install --with-cloog=/buildbot/tmp/build/toolchain/temp-install --with-isl=/buildbot/tmp/build/toolchain/temp-install --with-ppl=/buildbot/tmp/build/toolchain/temp-install --disable-ppl-version-check --disable-cloog-version-check --disable-isl-version-check --enable-cloog-backend=isl --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --disable-libssp --enable-threads --disable-nls --disable-libmudflap --disable-libgomp --disable-libstdc__-v3 --disable-sjlj-exceptions --disable-shared --disable-tls --disable-libitm --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --enable-bionic-libs --enable-libatomic-ifuncs=no --enable-initfini-array --disable-nls --prefix=/tmp/59719db9ae19ff43aef46bbcb79596b6 --with-sysroot=/tmp/59719db9ae19ff43aef46bbcb79596b6/sysroot --with-binutils-version=2.25 --with-mpfr-version=3.1.1 --with-mpc-version=1.0.1 --with-gmp-version=5.0.5 --with-gcc-version=4.9 --with-gdb-version=none --with-gxx-include-dir=/tmp/59719db9ae19ff43aef46bbcb79596b6/include/c++/4.9.x --with-bugurl=http://source.android.com/source/report-bugs.html --enable-languages=c,c++ --disable-bootstrap --enable-plugins --enable-libgomp --enable-gnu-indirect-function --disable-libsanitizer --enable-gold --enable-threads --enable-eh-frame-hdr-for-static --enable-graphite=yes --with-isl-version=0.11.1 --with-cloog-version=0.18.0 --with-arch=armv5te --program-transform-name='s&^&arm-linux-androideabi-&' --enable-gold=default
Thread model: posix
gcc version 4.9.x 20150123 (prerelease) (GCC) 
COMPILER_PATH=/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.9.x/:/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../libexec/gcc/:/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/
LIBRARY_PATH=/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/armv7-a/thumb/:/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/lib/armv7-a/thumb/:/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/:/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/:/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/lib/:/home/bindesh/bin/ndk/platforms/android-9/arch-arm/usr/lib/
COLLECT_GCC_OPTIONS='-g' '-D' 'ANDROID' '-fstack-protector-strong' '-march=armv7-a' '-mfloat-abi=softfp' '-mfpu=vfpv3-d16' '-mthumb' '-Wformat=1' '-Werror=format-security' '-g' '-D' 'ANDROID' '-ffunction-sections' '-funwind-tables' '-fstack-protector-strong' '-march=armv7-a' '-mfloat-abi=softfp' '-mfpu=vfpv3-d16' '-mthumb' '-Wformat=1' '-Werror=format-security' '-v' '-o' 'cmTC_7ad81' '-mtls-dialect=gnu'
 /home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.9.x/collect2 -plugin /home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.9.x/liblto_plugin.so -plugin-opt=/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.9.x/lto-wrapper -plugin-opt=-fresolution=/tmp/ccNet1nu.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-ldl -plugin-opt=-pass-through=-lgcc --sysroot=/home/bindesh/bin/ndk/platforms/android-9/arch-arm --eh-frame-hdr -dynamic-linker /system/bin/linker -X -m armelf_linux_eabi -z noexecstack -z relro -z now -o cmTC_7ad81 /home/bindesh/bin/ndk/platforms/android-9/arch-arm/usr/lib/crtbegin_dynamic.o -L/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/armv7-a/thumb -L/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/lib/armv7-a/thumb -L/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x -L/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc -L/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/lib -L/home/bindesh/bin/ndk/platforms/android-9/arch-arm/usr/lib --build-id --warn-shared-textrel --fatal-warnings --fix-cortex-a8 --no-undefined -z noexecstack -z relro -z now --gc-sections -z nocopyreloc CMakeFiles/cmTC_7ad81.dir/CMakeCCompilerABI.c.o -lgcc -lc -ldl -lgcc /home/bindesh/bin/ndk/platforms/android-9/arch-arm/usr/lib/crtend_android.o


Parsed C implicit link information from above output:
  link line regex: [^( *|.*[/\])(arm-linux-androideabi-ld|([^/\]+-)?ld|collect2)[^/\]*( |$)]
  ignore line: [Change Dir: /media/bindesh/WORK/00_write/libpng-1.6.28/CMakeFiles/CMakeTmp]
  ignore line: []
  ignore line: [Run Build Command:"/home/bindesh/bin/android-sdk/cmake/3.6.3155560/bin/ninja" "cmTC_7ad81"]
  ignore line: [[1/2] Building C object CMakeFiles/cmTC_7ad81.dir/CMakeCCompilerABI.c.o]
  ignore line: [[2/2] Linking C executable cmTC_7ad81]
  ignore line: [Using built-in specs.]
  ignore line: [COLLECT_GCC=/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/arm-linux-androideabi-gcc]
  ignore line: [COLLECT_LTO_WRAPPER=/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.9.x/lto-wrapper]
  ignore line: [Target: arm-linux-androideabi]
  ignore line: [Configured with: /usr/local/google/buildbot/src/android/gcc/toolchain/build/../gcc/gcc-4.9/configure --prefix=/tmp/59719db9ae19ff43aef46bbcb79596b6 --target=arm-linux-androideabi --host=x86_64-linux-gnu --build=x86_64-linux-gnu --with-gnu-as --with-gnu-ld --enable-languages=c,c++ --with-gmp=/buildbot/tmp/build/toolchain/temp-install --with-mpfr=/buildbot/tmp/build/toolchain/temp-install --with-mpc=/buildbot/tmp/build/toolchain/temp-install --with-cloog=/buildbot/tmp/build/toolchain/temp-install --with-isl=/buildbot/tmp/build/toolchain/temp-install --with-ppl=/buildbot/tmp/build/toolchain/temp-install --disable-ppl-version-check --disable-cloog-version-check --disable-isl-version-check --enable-cloog-backend=isl --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++,-Bdynamic -lm' --disable-libssp --enable-threads --disable-nls --disable-libmudflap --disable-libgomp --disable-libstdc__-v3 --disable-sjlj-exceptions --disable-shared --disable-tls --disable-libitm --with-float=soft --with-fpu=vfp --with-arch=armv5te --enable-target-optspace --enable-bionic-libs --enable-libatomic-ifuncs=no --enable-initfini-array --disable-nls --prefix=/tmp/59719db9ae19ff43aef46bbcb79596b6 --with-sysroot=/tmp/59719db9ae19ff43aef46bbcb79596b6/sysroot --with-binutils-version=2.25 --with-mpfr-version=3.1.1 --with-mpc-version=1.0.1 --with-gmp-version=5.0.5 --with-gcc-version=4.9 --with-gdb-version=none --with-gxx-include-dir=/tmp/59719db9ae19ff43aef46bbcb79596b6/include/c++/4.9.x --with-bugurl=http://source.android.com/source/report-bugs.html --enable-languages=c,c++ --disable-bootstrap --enable-plugins --enable-libgomp --enable-gnu-indirect-function --disable-libsanitizer --enable-gold --enable-threads --enable-eh-frame-hdr-for-static --enable-graphite=yes --with-isl-version=0.11.1 --with-cloog-version=0.18.0 --with-arch=armv5te --program-transform-name='s&^&arm-linux-androideabi-&' --enable-gold=default]
  ignore line: [Thread model: posix]
  ignore line: [gcc version 4.9.x 20150123 (prerelease) (GCC) ]
  ignore line: [COMPILER_PATH=/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.9.x/:/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../libexec/gcc/:/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/bin/]
  ignore line: [LIBRARY_PATH=/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/armv7-a/thumb/:/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/lib/armv7-a/thumb/:/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/:/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/:/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/lib/:/home/bindesh/bin/ndk/platforms/android-9/arch-arm/usr/lib/]
  ignore line: [COLLECT_GCC_OPTIONS='-g' '-D' 'ANDROID' '-fstack-protector-strong' '-march=armv7-a' '-mfloat-abi=softfp' '-mfpu=vfpv3-d16' '-mthumb' '-Wformat=1' '-Werror=format-security' '-g' '-D' 'ANDROID' '-ffunction-sections' '-funwind-tables' '-fstack-protector-strong' '-march=armv7-a' '-mfloat-abi=softfp' '-mfpu=vfpv3-d16' '-mthumb' '-Wformat=1' '-Werror=format-security' '-v' '-o' 'cmTC_7ad81' '-mtls-dialect=gnu']
  link line: [ /home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.9.x/collect2 -plugin /home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.9.x/liblto_plugin.so -plugin-opt=/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.9.x/lto-wrapper -plugin-opt=-fresolution=/tmp/ccNet1nu.res -plugin-opt=-pass-through=-lgcc -plugin-opt=-pass-through=-lc -plugin-opt=-pass-through=-ldl -plugin-opt=-pass-through=-lgcc --sysroot=/home/bindesh/bin/ndk/platforms/android-9/arch-arm --eh-frame-hdr -dynamic-linker /system/bin/linker -X -m armelf_linux_eabi -z noexecstack -z relro -z now -o cmTC_7ad81 /home/bindesh/bin/ndk/platforms/android-9/arch-arm/usr/lib/crtbegin_dynamic.o -L/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/armv7-a/thumb -L/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/lib/armv7-a/thumb -L/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x -L/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc -L/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/lib -L/home/bindesh/bin/ndk/platforms/android-9/arch-arm/usr/lib --build-id --warn-shared-textrel --fatal-warnings --fix-cortex-a8 --no-undefined -z noexecstack -z relro -z now --gc-sections -z nocopyreloc CMakeFiles/cmTC_7ad81.dir/CMakeCCompilerABI.c.o -lgcc -lc -ldl -lgcc /home/bindesh/bin/ndk/platforms/android-9/arch-arm/usr/lib/crtend_android.o]
    arg [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.9.x/collect2] ==> ignore
    arg [-plugin] ==> ignore
    arg [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.9.x/liblto_plugin.so] ==> ignore
    arg [-plugin-opt=/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../libexec/gcc/arm-linux-androideabi/4.9.x/lto-wrapper] ==> ignore
    arg [-plugin-opt=-fresolution=/tmp/ccNet1nu.res] ==> ignore
    arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
    arg [-plugin-opt=-pass-through=-lc] ==> ignore
    arg [-plugin-opt=-pass-through=-ldl] ==> ignore
    arg [-plugin-opt=-pass-through=-lgcc] ==> ignore
    arg [--sysroot=/home/bindesh/bin/ndk/platforms/android-9/arch-arm] ==> ignore
    arg [--eh-frame-hdr] ==> ignore
    arg [-dynamic-linker] ==> ignore
    arg [/system/bin/linker] ==> ignore
    arg [-X] ==> ignore
    arg [-m] ==> ignore
    arg [armelf_linux_eabi] ==> ignore
    arg [-znoexecstack] ==> ignore
    arg [-zrelro] ==> ignore
    arg [-znow] ==> ignore
    arg [-o] ==> ignore
    arg [cmTC_7ad81] ==> ignore
    arg [/home/bindesh/bin/ndk/platforms/android-9/arch-arm/usr/lib/crtbegin_dynamic.o] ==> ignore
    arg [-L/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/armv7-a/thumb] ==> dir [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/armv7-a/thumb]
    arg [-L/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/lib/armv7-a/thumb] ==> dir [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/lib/armv7-a/thumb]
    arg [-L/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x] ==> dir [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x]
    arg [-L/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc] ==> dir [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc]
    arg [-L/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/lib] ==> dir [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/lib]
    arg [-L/home/bindesh/bin/ndk/platforms/android-9/arch-arm/usr/lib] ==> dir [/home/bindesh/bin/ndk/platforms/android-9/arch-arm/usr/lib]
    arg [--build-id] ==> ignore
    arg [--warn-shared-textrel] ==> ignore
    arg [--fatal-warnings] ==> ignore
    arg [--fix-cortex-a8] ==> ignore
    arg [--no-undefined] ==> ignore
    arg [-znoexecstack] ==> ignore
    arg [-zrelro] ==> ignore
    arg [-znow] ==> ignore
    arg [--gc-sections] ==> ignore
    arg [-znocopyreloc] ==> ignore
    arg [CMakeFiles/cmTC_7ad81.dir/CMakeCCompilerABI.c.o] ==> ignore
    arg [-lgcc] ==> lib [gcc]
    arg [-lc] ==> lib [c]
    arg [-ldl] ==> lib [dl]
    arg [-lgcc] ==> lib [gcc]
    arg [/home/bindesh/bin/ndk/platforms/android-9/arch-arm/usr/lib/crtend_android.o] ==> ignore
  remove lib [gcc]
  remove lib [gcc]
  collapse library dir [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/armv7-a/thumb] ==> [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/armv7-a/thumb]
  collapse library dir [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/lib/armv7-a/thumb] ==> [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/arm-linux-androideabi/lib/armv7-a/thumb]
  collapse library dir [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x] ==> [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x]
  collapse library dir [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc] ==> [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc]
  collapse library dir [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/../lib/gcc/arm-linux-androideabi/4.9.x/../../../../arm-linux-androideabi/lib] ==> [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/arm-linux-androideabi/lib]
  collapse library dir [/home/bindesh/bin/ndk/platforms/android-9/arch-arm/usr/lib] ==> [/home/bindesh/bin/ndk/platforms/android-9/arch-arm/usr/lib]
  implicit libs: [c;dl]
  implicit dirs: [/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x/armv7-a/thumb;/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/arm-linux-androideabi/lib/armv7-a/thumb;/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc/arm-linux-androideabi/4.9.x;/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/lib/gcc;/home/bindesh/bin/ndk/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/arm-linux-androideabi/lib;/home/bindesh/bin/ndk/platforms/android-9/arch-arm/usr/lib]
  implicit fwks: []




Detecting C [-std=c11] compiler features compiled with the following output:
Change Dir: /media/bindesh/WORK/00_write/libpng-1.6.28/CMakeFiles/CMakeTmp

Run Build Command:"/home/bindesh/bin/android-sdk/cmake/3.6.3155560/bin/ninja" "cmTC_5d10b"
[1/2] Building C object CMakeFiles/cmTC_5d10b.dir/feature_tests.c.o
[2/2] Linking C executable cmTC_5d10b


    Feature record: C_FEATURE:1c_function_prototypes
    Feature record: C_FEATURE:1c_restrict
    Feature record: C_FEATURE:1c_static_assert
    Feature record: C_FEATURE:1c_variadic_macros


Detecting C [-std=c99] compiler features compiled with the following output:
Change Dir: /media/bindesh/WORK/00_write/libpng-1.6.28/CMakeFiles/CMakeTmp

Run Build Command:"/home/bindesh/bin/android-sdk/cmake/3.6.3155560/bin/ninja" "cmTC_bb98c"
[1/2] Building C object CMakeFiles/cmTC_bb98c.dir/feature_tests.c.o
[2/2] Linking C executable cmTC_bb98c


    Feature record: C_FEATURE:1c_function_prototypes
    Feature record: C_FEATURE:1c_restrict
    Feature record: C_FEATURE:0c_static_assert
    Feature record: C_FEATURE:1c_variadic_macros


Detecting C [-std=c90] compiler features compiled with the following output:
Change Dir: /media/bindesh/WORK/00_write/libpng-1.6.28/CMakeFiles/CMakeTmp

Run Build Command:"/home/bindesh/bin/android-sdk/cmake/3.6.3155560/bin/ninja" "cmTC_f387f"
[1/2] Building C object CMakeFiles/cmTC_f387f.dir/feature_tests.c.o
[2/2] Linking C executable cmTC_f387f


    Feature record: C_FEATURE:1c_function_prototypes
    Feature record: C_FEATURE:0c_restrict
    Feature record: C_FEATURE:0c_static_assert
    Feature record: C_FEATURE:0c_variadic_macros
Performing C SOURCE FILE Test HAVE_LD_VERSION_SCRIPT succeeded with the following output:
Change Dir: /media/bindesh/WORK/00_write/libpng-1.6.28/CMakeFiles/CMakeTmp

Run Build Command:"/home/bindesh/bin/android-sdk/cmake/3.6.3155560/bin/ninja" "cmTC_d0d1b"
[1/2] Building C object CMakeFiles/cmTC_d0d1b.dir/src.c.o
[2/2] Linking C executable cmTC_d0d1b

Source file was:
void sym(void) {}
void sym2(void) {}
int main(void) {return 0;}



Head of CMakeLists.txt file for reference

# CMakeLists.txt

# Copyright (C) 2007,2009-2016 Glenn Randers-Pehrson
# Written by Christian Ehrlicher, 2007
# Revised by Roger Lowman, 2009-2010
# Revised by Clifford Yapp, 2011-2012
# Revised by Roger Leigh, 2016
# Revised by Andreas Franek, 2016

# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h

cmake_minimum_required(VERSION 2.8.3)
cmake_policy(VERSION 2.8.3)

# Set MacOSX @rpath usage globally.
if (POLICY CMP0020)
  cmake_policy(SET CMP0020 NEW)
endif(POLICY CMP0020)
if (POLICY CMP0042)
  cmake_policy(SET CMP0042 NEW)
endif(POLICY CMP0042)
# Use new variable expansion policy.
if (POLICY CMP0053)
  cmake_policy(SET CMP0053 NEW)
endif(POLICY CMP0053)
if (POLICY CMP0054)
  cmake_policy(SET CMP0054 NEW)
endif(POLICY CMP0054)

set(CMAKE_CONFIGURATION_TYPES "Release;Debug;MinSizeRel;RelWithDebInfo")

project(libpng C)
enable_testing()

set(PNGLIB_MAJOR 1)
set(PNGLIB_MINOR 6)
set(PNGLIB_RELEASE 28)
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})


include("/home/bindesh/bin/ndk/build/cmake/android.toolchain.cmake")


# needed packages

#Allow users to specify location of Zlib, 
# Useful if zlib is being built alongside this as a sub-project
option(PNG_BUILD_ZLIB "Custom zlib Location, else find_package is used" OFF) 




This script will build libpng for specified ABI. Change the ABI to build x86, MIPS etc binaries. Sample output binary for above script can be downloaded from here:

 
https://github.com/bindeshkumarsingh/android-native-libs/blob/master/armeabi-v7a_libpng-1.6.28.7z