What you will need to do this is the android Native Development Kit (NDK) http://developer.android.com/sdk/ndk/index.html and a GCC compiler.
You can then create a Makefile with the parameters as shown below (thanks ViTo Brothers Apoyan) and create your shared library.
GCC := C:\Tools\ndk-toolchain\ndk-standalone\bin\arm-linux-androideabi-gcc.exe
GPP := C:\Tools\ndk-toolchain\ndk-standalone\bin\arm-linux-androideabi-g++.exe
AR := C:\Tools\ndk-toolchain\ndk-standalone\bin\arm-linux-androideabi-ar.exe
OPTIONS :=\
-fpic \
-ffunction-sections \
-funwind-tables \
-fstack-protector \
-D__ARM_ARCH_5__ \
-D__ARM_ARCH_5T__ \
-D__ARM_ARCH_5E__ \
-D__ARM_ARCH_5TE__ \
-Wno-psabi \
-march=armv5te \
-mtune=xscale \
-msoft-float \
-mthumb \
-Os \
-fomit-frame-pointer \
-fno-strict-aliasing \
-finline-limit=64 \
-DANDROID \
-Wa, \
-O2 \
-DNDEBUG \
-g \
default: all
all: obj
$(AR) r mysharedlibrary.so *.o
obj:
$(GCC) $(OPTIONS) -c *.c