title: How can I configure Dropbear SSH for Android NDK build?
body: <p>I am trying to cross-compile the Dropbear SSH client from my Macintosh OS X Yosemite and the Android NDK v10 and Eclipse so that my Android application is able to SSH to another machine.  I am using the latest version of Dropbear, 2014.66.  I'm stuck on how to properly run <code>configure</code> to generate some files for this Android build.  Thus far, I'm invoking <code>configure</code> like this:</p>
  
  <pre><code>PATH=/Users/me/Development/android-ndk-r10d/toolchains/arm-linux-androideabi-4.8/prebuilt/darwin-x86_64/bin/:$PATH;
  ./configure --host=arm-linux-androideabi --disable-zlib
  </code></pre>
  
  <p>However, it fails with the output:</p>
  
  <pre><code>checking for arm-linux-androideabi-gcc... arm-linux-androideabi-gcc
  checking whether the C compiler works... no
  configure: error: in `/Users/me/sds/flume/android/workspace/jni/dropbear':
  configure: error: C compiler cannot create executables
  See `config.log' for more details
  </code></pre>
  
  <p>So I have not set up the cross-compilation environment correctly.  How can I set up my environment so that the NDK is set up so that <code>gcc</code> and any other build tools required are in my path?</p>
  
  <p>Once I get <code>configure</code> properly run, I will use my <code>Android.mk</code> I have created based upon a v0.52 Android port of Dropbear together with the <code>ndk-build</code> command:</p>
  
  <pre><code># jni/botan/Android.mk:
  LOCAL_PATH:= $(call my-dir)
  
  include $(CLEAR_VARS)
  
  LOCAL_MODULE := dropbear
  LOCAL_EXPORT_C_INCLUDES := $(LOCAL_PATH)
  LOCAL_SRC_FILES:=\
      dbutil.c buffer.c \
      dss.c bignum.c \
      signkey.c rsa.c random.c \
      queue.c \
      atomicio.c compat.c  fake-rfc2553.c
  LOCAL_SRC_FILES+=\
      common-session.c packet.c common-algo.c common-kex.c \
      common-channel.c common-chansession.c termcodes.c \
      tcp-accept.c listener.c process-packet.c \
      common-runopts.c circbuffer.c
  
  # loginrec.c 
  LOCAL_SRC_FILES+=\
      cli-algo.c cli-main.c cli-auth.c cli-authpasswd.c cli-kex.c \
      cli-session.c cli-service.c cli-runopts.c cli-chansession.c \
      cli-authpubkey.c cli-tcpfwd.c cli-channel.c cli-authinteract.c
  LOCAL_SRC_FILES+=netbsd_getpass.c
  
  LOCAL_STATIC_LIBRARIES := libtommath libtomcrypt
  
  LOCAL_MODULE_PATH := $(TARGET_OUT_OPTIONAL_EXECUTABLES)
  LOCAL_MODULE_TAGS := debug
  LOCAL_MODULE := dropbear
  LOCAL_C_INCLUDES += $(LOCAL_PATH)/libtommath 
  LOCAL_C_INCLUDES += $(LOCAL_PATH)/libtomcrypt/src/headers
  LOCAL_CFLAGS += -DDROPBEAR_CLIENT
  
  include $(BUILD_SHARED_LIBRARY)
  
  include $(call all-makefiles-under,$(LOCAL_PATH))
  </code></pre>