首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 操作系统 > UNIXLINUX >

帮忙看一上这个configure有什么有关问题

2012-09-14 
帮忙看一下这个configure有什么问题,Python code#!/bin/sh#Fconfigure-androidif test $* --help

帮忙看一下这个configure有什么问题,

Python code
#!/bin/sh#F="configure-android"if test "$*" = "--help" -o "$*" = "-h"; then  echo "$F [--use-ndk-cflags] [OPTIONS]"  echo ""  echo "where:"  echo "  --use-ndk-cflags"  echo "              Optional parameter to use the same compilation flags"  echo "              as the one used by ndk-build"  echo "  OPTIONS     Other options that will be passed directly to"  echo "              ./aconfigure script. Run ./aconfigure --help"  echo "              for more info."  exit 0fiif test "x${ANDROID_NDK}" = "x"; then  echo "$F error: ANDROID_NDK must be specified"  exit 0fi#if test "$1" = "--simulator"; thenif test "1" = "0"; then  shift  TARGET_HOST="i686-android-linux"  TC_DIR="x86"else  TARGET_HOST="arm-linux-androideabi"  TC_DIR=${TARGET_HOST}fiif test "$1" = "--use-ndk-cflags"; then  shift  for i in `${ANDROID_NDK}/ndk-build --dry-run --directory=${ANDROID_NDK}/samples/hello-jni`; do    if test "$i" = "-c"; then break; fi    if test "x${NDK_CC}" != "x" -a "$i" != "-MF" -a "x`echo $i|grep '\.o\.d'`" = "x" -a "x`echo $i|grep 'include'`" = "x"; then      NDK_CFLAGS="${NDK_CFLAGS} $i"    fi    if test "x`echo $i | grep 'gcc'`" != "x"; then      NDK_CC=$i    fi  done  export CFLAGS+="${NDK_CFLAGS}"fiHOST_OS=$(uname -s)case $HOST_OS in  Darwin) BUILD_MACHINE="darwin-x86";;  Linux) BUILD_MACHINE="linux-x86";;  CYGWIN*|*_NT-*) BUILD_MACHINE="windows";;esacif test "x$API_LEVEL" = "x"; then  API_LEVEL=`ls ${ANDROID_NDK}/platforms/ | sed 's/android-//' | sort -gr | head -1`  echo "$F: API_LEVEL not specified, using android-${API_LEVEL}"fiANDROID_TC="${ANDROID_NDK}/toolchains/${TC_DIR}-4.4.3/prebuilt/${BUILD_MACHINE}"if test ! -d ${ANDROID_TC}; then  echo "$F error: unable to find directory ${ANDROID_TC} in Android NDK"  exit 1fiexport ANDROID_SYSROOT="${ANDROID_NDK}/platforms/android-${API_LEVEL}/arch-arm"if test ! -d ${ANDROID_SYSROOT}; then  echo "$F error: unable to find sysroot dir ${ANDROID_SYSROOT} in Android NDK"  exit 1fiexport CC="${ANDROID_TC}/bin/${TARGET_HOST}-gcc"export CXX="${ANDROID_TC}/bin/${TARGET_HOST}-g++"export LDFLAGS+=" -nostdlib -L${ANDROID_SYSROOT}/usr/lib/"export LIBS+=" -lc -lgcc"export CFLAGS+=" -I${ANDROID_SYSROOT}/usr/include"export CPPFLAGS="${CFLAGS}"export CXXFLAGS+=" -shared --sysroot=${ANDROID_SYSROOT}"# Print settingsif test "1" = "1"; then  echo "$F: calling ./configure with env vars:"  echo " CC = ${CC}"  echo " CXX = ${CXX}"  echo " CFLAGS = ${CFLAGS}"  echo " CXXFLAGS = ${CXXFLAGS}"  echo " LDFLAGS = ${LDFLAGS}"  echo " LIBS = ${LIBS}"fi./configure --host=${TARGET_HOST} --disable-video $*


需要事先export ANDROID_NDK=/path_ndk 和API_LEVEL=14

每次运行到75行就报错, 
./configure-android: 75: export: LDFLAGS+: bad variable name

感觉像是shell语法出错了,但是看不出来啊


[解决办法]
export LDFLAGS+=" -nostdlib -L${ANDROID_SYSROOT}/usr/lib/"
export LIBS+=" -lc -lgcc"
export CFLAGS+=" -I${ANDROID_SYSROOT}/usr/include"
export CPPFLAGS="${CFLAGS}"
export CXXFLAGS+=" -shared --sysroot=${ANDROID_SYSROOT}"

似乎bash shell当中没有这种赋值格式。+=




export LDFLAGS="$LDFLAGS -nostdlib -L${ANDROID_SYSROOT}/usr/lib/"
export LIBS="LIBS -lc -lgcc"
export CFLAGS="CFLAGS -I${ANDROID_SYSROOT}/usr/include"
export CPPFLAGS="${CFLAGS}"
export CXXFLAGS="CXXFLAGS -shared --sysroot=${ANDROID_SYSROOT}"

热点排行