build-scripts/androidbuild.sh
changeset 7907 24b4e98c6010
parent 7793 6463a850229d
child 7974 8af2b2344e9e
equal deleted inserted replaced
7906:19f5760dc1a7 7907:24b4e98c6010
    22 fi
    22 fi
    23 
    23 
    24 if [ -z "$1" ] || [ -z "$SOURCES" ]; then
    24 if [ -z "$1" ] || [ -z "$SOURCES" ]; then
    25     echo "Usage: androidbuild.sh com.yourcompany.yourapp < sources.list"
    25     echo "Usage: androidbuild.sh com.yourcompany.yourapp < sources.list"
    26     echo "Usage: androidbuild.sh com.yourcompany.yourapp source1.c source2.c ...sourceN.c"
    26     echo "Usage: androidbuild.sh com.yourcompany.yourapp source1.c source2.c ...sourceN.c"
       
    27     echo "To copy SDL source instead of symlinking: COPYSOURCE=1 androidbuild.sh ... "
    27     exit 1
    28     exit 1
    28 fi
    29 fi
    29 
    30 
    30 
    31 
    31 
    32 
    61 
    62 
    62 cp -r $SDLPATH/android-project/* $BUILDPATH
    63 cp -r $SDLPATH/android-project/* $BUILDPATH
    63 
    64 
    64 # Copy SDL sources
    65 # Copy SDL sources
    65 mkdir -p $BUILDPATH/jni/SDL
    66 mkdir -p $BUILDPATH/jni/SDL
    66 cp -r $SDLPATH/src $BUILDPATH/jni/SDL
    67 if [ -z "$COPYSOURCE" ]; then
    67 cp -r $SDLPATH/include $BUILDPATH/jni/SDL
    68     ln -s $SDLPATH/src $BUILDPATH/jni/SDL
    68 cp $SDLPATH/Android.mk $BUILDPATH/jni/SDL
    69     ln -s $SDLPATH/include $BUILDPATH/jni/SDL
       
    70 else
       
    71     cp -r $SDLPATH/src $BUILDPATH/jni/SDL
       
    72     cp -r $SDLPATH/include $BUILDPATH/jni/SDL
       
    73 fi
       
    74 
       
    75 cp -r $SDLPATH/Android.mk $BUILDPATH/jni/SDL
    69 sed -i "s|YourSourceHere.c|$MKSOURCES|g" $BUILDPATH/jni/src/Android.mk
    76 sed -i "s|YourSourceHere.c|$MKSOURCES|g" $BUILDPATH/jni/src/Android.mk
    70 sed -i "s|org\.libsdl\.app|$APP|g" $BUILDPATH/AndroidManifest.xml
    77 sed -i "s|org\.libsdl\.app|$APP|g" $BUILDPATH/AndroidManifest.xml
    71 
    78 
    72 # Copy user sources
    79 # Copy user sources
    73 for src in "${SOURCES[@]}"
    80 for src in "${SOURCES[@]}"