mac平台下LuaJIT-2.1.0-beta2 編譯android i686-linux-android-clang: Command not found

來源:互聯網
上載者:User

標籤:

今天更新luajit2.1beta2時,編譯android一直報錯。
/Applications/Xcode.app/Contents/Developer/usr/bin/make -C srcmake[1]: /Users/apple/android/android-ndk-r10c//toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-clang: Command not foundmake[1]: /Users/apple/android/android-ndk-r10c//toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-clang: Command not foundmake[1]: /Users/apple/android/android-ndk-r10c//toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-clang: Command not foundmake[1]: /Users/apple/android/android-ndk-r10c//toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-clang: Command not foundmake[1]: /Users/apple/android/android-ndk-r10c//toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-clang: Command not foundmake[1]: /Users/apple/android/android-ndk-r10c//toolchains/x86-4.9/prebuilt/darwin-x86_64/bin/i686-linux-android-clang: Command not foundMakefile:264: *** Unsupported target architecture.  Stop.make: *** [default] Error 2

閱讀最src/Makefile發現增加了這麼一句
ifeq (Windows,$(findstring Windows,$(OS))$(MSYSTEM)$(TERM))  HOST_SYS= Windows  HOST_RM= delelse  HOST_SYS:= $(shell uname -s)  ifneq (,$(findstring MINGW,$(HOST_SYS)))    HOST_SYS= Windows    HOST_MSYS= mingw  endif  ifneq (,$(findstring CYGWIN,$(HOST_SYS)))    HOST_SYS= Windows    HOST_MSYS= cygwin  endif  # Use Clang for OSX host.  ifeq (Darwin,$(HOST_SYS))    DEFAULT_CC= clang  endifendif


在mac下編譯預設用的clang, NDK是沒有i686-linux-android-clang,

修改成預設gcc做了一個判斷

  # Use Clang for OSX host.  ifeq (Darwin,$(HOST_SYS))    ifneq (Linux, $(TARGET_SYS))      DEFAULT_CC= clang    endif  endif

貼上 luajit 編譯代碼




#!/bin/shDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"host_os=`uname -s | tr "[:upper:]" "[:lower:]"`SRCDIR=$DIR/srccd "$SRCDIR"NDK=$NDK_ROOTNDKABI=8NDKVER=$NDK/toolchains/arm-linux-androideabi-4.9NDKP=$NDKVER/prebuilt/${host_os}-x86_64/bin/arm-linux-androideabi-NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-arm"# Android/ARM, armeabi (ARMv5TE soft-float), Android 2.2+ (Froyo)DESTDIR=$DIR/prebuilt/android/armeabirm "$DESTDIR"/*.amake cleanmake HOST_CC="gcc -m32" CROSS=$NDKP TARGET_SYS=Linux TARGET_FLAGS="$NDKF"if [ -f $SRCDIR/src/libluajit.a ]; then    mv $SRCDIR/src/libluajit.a $DESTDIR/libluajit.afi;# Android/ARM, armeabi-v7a (ARMv7 VFP), Android 4.0+ (ICS)NDKARCH="-march=armv7-a -mfloat-abi=softfp -Wl,--fix-cortex-a8"DESTDIR=$DIR/prebuilt/android/armeabi-v7arm "$DESTDIR"/*.amake cleanmake HOST_CC="gcc -m32" CROSS=$NDKP TARGET_SYS=Linux TARGET_FLAGS="$NDKF $NDKARCH"if [ -f $SRCDIR/src/libluajit.a ]; then    mv $SRCDIR/src/libluajit.a $DESTDIR/libluajit.afi;# Android/x86, x86 (i686 SSE3), Android 4.0+ (ICS)NDKABI=18DESTDIR=$DIR/prebuilt/android/x86NDKVER=$NDK/toolchains/x86-4.9NDKP=$NDKVER/prebuilt/${host_os}-x86_64/bin/i686-linux-android-NDKF="--sysroot $NDK/platforms/android-$NDKABI/arch-x86"rm "$DESTDIR"/*.amake cleanmake HOST_CC="gcc -m32" CROSS=$NDKP TARGET_SYS=Linux TARGET_FLAGS="$NDKF"if [ -f $SRCDIR/src/libluajit.a ]; then    mv $SRCDIR/src/libluajit.a $DESTDIR/libluajit.afi;make clean



mac平台下LuaJIT-2.1.0-beta2 編譯android i686-linux-android-clang: Command not found

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.