build-scripts/androidbuild.sh
changeset 7907 24b4e98c6010
parent 7793 6463a850229d
child 7974 8af2b2344e9e
--- a/build-scripts/androidbuild.sh	Sun Nov 03 11:34:03 2013 -0800
+++ b/build-scripts/androidbuild.sh	Tue Nov 05 20:07:39 2013 -0300
@@ -24,6 +24,7 @@
 if [ -z "$1" ] || [ -z "$SOURCES" ]; then
     echo "Usage: androidbuild.sh com.yourcompany.yourapp < sources.list"
     echo "Usage: androidbuild.sh com.yourcompany.yourapp source1.c source2.c ...sourceN.c"
+    echo "To copy SDL source instead of symlinking: COPYSOURCE=1 androidbuild.sh ... "
     exit 1
 fi
 
@@ -63,9 +64,15 @@
 
 # Copy SDL sources
 mkdir -p $BUILDPATH/jni/SDL
-cp -r $SDLPATH/src $BUILDPATH/jni/SDL
-cp -r $SDLPATH/include $BUILDPATH/jni/SDL
-cp $SDLPATH/Android.mk $BUILDPATH/jni/SDL
+if [ -z "$COPYSOURCE" ]; then
+    ln -s $SDLPATH/src $BUILDPATH/jni/SDL
+    ln -s $SDLPATH/include $BUILDPATH/jni/SDL
+else
+    cp -r $SDLPATH/src $BUILDPATH/jni/SDL
+    cp -r $SDLPATH/include $BUILDPATH/jni/SDL
+fi
+
+cp -r $SDLPATH/Android.mk $BUILDPATH/jni/SDL
 sed -i "s|YourSourceHere.c|$MKSOURCES|g" $BUILDPATH/jni/src/Android.mk
 sed -i "s|org\.libsdl\.app|$APP|g" $BUILDPATH/AndroidManifest.xml