Archive for April, 2011

Building hello-gl2 sample in NDK: A internal view

Adding “V=1” to the make statement inside ndk-build, it it possible to get a detailed breakdown of all the commands used for build the NDK sample:

rm -f /root/download/android/ndk/samples/hello-gl2/libs/armeabi/lib*.so /root/download/android/ndk/samples/hello-gl2/libs/armeabi-v7a/lib*.so /root/download/android/ndk/samples/hello-gl2/libs/x86/lib*.so
rm -f /root/download/android/ndk/samples/hello-gl2/libs/armeabi/gdbserver /root/download/android/ndk/samples/hello-gl2/libs/armeabi-v7a/gdbserver /root/download/android/ndk/samples/hello-gl2/libs/x86/gdbserver
rm -f /root/download/android/ndk/samples/hello-gl2/libs/armeabi/gdb.setup /root/download/android/ndk/samples/hello-gl2/libs/armeabi-v7a/gdb.setup /root/download/android/ndk/samples/hello-gl2/libs/x86/gdb.setup
Compile++ thumb : gl2jni <= gl_code.cpp
/root/download/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++ -MMD -MP -MF /root/download/android/ndk/samples/hello-gl2/obj/local/armeabi/objs/gl2jni/gl_code.o.d.org -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 -fno-exceptions -fno-rtti -mthumb -Os -fomit-frame-pointer -fno-strict-aliasing -finline-limit=64 -I/root/download/android/ndk/sources/cxx-stl/system/include -I/root/download/android/ndk/samples/hello-gl2/jni -DANDROID -Werror -Wa,–noexecstack -O2 -DNDEBUG -g -I/root/download/android/ndk/platforms/android-5/arch-arm/usr/include -c /root/download/android/ndk/samples/hello-gl2/jni/gl_code.cpp -o /root/download/android/ndk/samples/hello-gl2/obj/local/armeabi/objs/gl2jni/gl_code.o && rm -f /root/download/android/ndk/samples/hello-gl2/obj/local/armeabi/objs/gl2jni/gl_code.o.d && mv /root/download/android/ndk/samples/hello-gl2/obj/local/armeabi/objs/gl2jni/gl_code.o.d.org /root/download/android/ndk/samples/hello-gl2/obj/local/armeabi/objs/gl2jni/gl_code.o.d
StaticLibrary : libstdc++.a
rm -rf /root/download/android/ndk/samples/hello-gl2/obj/local/armeabi/libstdc++.a
/root/download/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-ar crs /root/download/android/ndk/samples/hello-gl2/obj/local/armeabi/libstdc++.a
SharedLibrary : libgl2jni.so
/root/download/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-g++ -Wl,-soname,libgl2jni.so -shared –sysroot=/root/download/android/ndk/platforms/android-5/arch-arm /root/download/android/ndk/samples/hello-gl2/obj/local/armeabi/objs/gl2jni/gl_code.o /root/download/android/ndk/samples/hello-gl2/obj/local/armeabi/libstdc++.a /root/download/android/ndk/platforms/android-5/arch-arm/usr/lib/libc.so /root/download/android/ndk/platforms/android-5/arch-arm/usr/lib/libstdc++.so /root/download/android/ndk/platforms/android-5/arch-arm/usr/lib/libm.so -Wl,–no-undefined -Wl,-z,noexecstack -L/root/download/android/ndk/platforms/android-5/arch-arm/usr/lib -llog -lGLESv2 -lstdc++ -Wl,-rpath-link=/root/download/android/ndk/platforms/android-5/arch-arm/usr/lib -lsupc++ -o /root/download/android/ndk/samples/hello-gl2/obj/local/armeabi/libgl2jni.so
Install : libgl2jni.so => libs/armeabi/libgl2jni.so
mkdir -p /root/download/android/ndk/samples/hello-gl2/libs/armeabi
install -p /root/download/android/ndk/samples/hello-gl2/obj/local/armeabi/libgl2jni.so /root/download/android/ndk/samples/hello-gl2/libs/armeabi/libgl2jni.so
/root/download/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin/arm-linux-androideabi-strip –strip-unneeded

/root/download/android/ndk/samples/hello-gl2/libs/armeabi/libgl2jni.so

%d bloggers like this: