title: embed python in android NDK
body: <p>I have a android program that has main logic written in NDK. But now I want to evaluate some python codes as part of main logic. So I tried to use this embed python in c <a href="http://docs.python.org/2/extending/embedding.html" rel="nofollow noreferrer">http://docs.python.org/2/extending/embedding.html</a></p>
  <p>I created a simple android project, with native.c like this (all I did was just adding python header)</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;Python.h&gt;
  #include &lt;jni.h&gt;
  #include &lt;string.h&gt;
  #include &lt;android/log.h&gt;
  #include &lt;pthread.h&gt;
  #define DEBUG_TAG &quot;NDK_AndroidNDK1SampleActivity&quot;
  
  void Java_com_example_com_test_mytest_MainActivity_helloLog(JNIEnv * env, jobject this, jstring logThis)
  {
      jboolean isCopy;
      const char * szLogThis = (*env)-&gt;GetStringUTFChars(env, logThis, &amp;isCopy);
      __android_log_print(ANDROID_LOG_DEBUG, DEBUG_TAG, &quot;NDK:LC: [%s]&quot;, szLogThis);
      (*env)-&gt;ReleaseStringUTFChars(env, logThis, szLogThis);
  }
  </code></pre>
  <p>Here is my Android.mk</p>
  <pre><code>LOCAL_PATH := $(call my-dir)  
  include $(CLEAR_VARS)  
  LOCAL_LDLIBS := -llog `python2.7-config --ldflags`
  LOCAL_MODULE    := ndk1  
  LOCAL_SRC_FILES := native.c  
  LOCAL_CFLAGS := `python2.7-config --cflags`
  #LOCAL_SHARED_LIBRARIES := -lpthread
  include $(BUILD_SHARED_LIBRARY) 
  </code></pre>
  <p>I got following error when compiling (using Mac)</p>
  <pre><code>Compile thumb  : ndk1 &lt;= native.c
  arm-linux-androideabi-gcc: error: i386: No such file or directory
  arm-linux-androideabi-gcc: error: x86_64: No such file or directory
  arm-linux-androideabi-gcc: error: unrecognized option '-arch'
  arm-linux-androideabi-gcc: error: unrecognized option '-arch'
  make: *** [obj/local/armeabi/objs/ndk1/native.o] Error 1
  </code></pre>
  <p>Anyone could help please? :D</p>