Repository: kivy/python-for-android

Issue:
Libffi recipe fails with "unrecognized options: --enable-shared"
I'm trying to use the packaged `cryptography` recipe, which includes the `Libffi` recipe as a dependency.  I'm getting the following errors with `Libffi` while trying to build the apk:

```
configure: WARNING: unrecognized options: --enable-shared
configure: error: cannot find install-sh, install.sh, or shtool in "." "./.." "./../.."
```

I'm using recent versions of the toolchain: p4a (checked out from github a week ago), most recent Android SDK & NDK (25.1.3 and r11c, respectively).  I'm invoking p4a as follows:

```
p4a apk --sdk_dir ~/AndroidUpstream/android-sdk-linux \
    --ndk_dir ~/AndroidUpstream/android-ndk-r11c \
    --android_api 16 --ndk_ver r11c \
    --private ~/src/TestCrypto \
    --package=org.example.testcrypto \
    --name=TestCrypto --version=0.5 \
    --bootstrap=sdl2 \
    --requirements=sdl2,python2,kivy,cryptography \
    --dist_name=remotepython \
    --permission=INTERNET
```

I've looked around (on web, and here on github issue tracker), but can't find explanations for this error message.  Thanks in advance for any suggestions.



Discussion:
Please post a complete log.

Complete log below.  Please let me know if there's any other info I should provide.

```
[INFO]:    This python-for-android revamp is an experimental alpha release!
[INFO]:    It should work (mostly), but you may experience missing features or bugs.
[INFO]:    Will compile for the following archs: armeabi
[INFO]:    Getting Android API version from user argument
[INFO]:    Available Android APIs are (15, 16, 21)
[INFO]:    Requested API target 16 is available, continuing.
[INFO]:    Getting NDK dir from from user argument
[INFO]:    Got NDK version from from user argument
[INFO]:    Using Google NDK r11c
[INFO]:    Found virtualenv at /usr/bin/virtualenv
[INFO]:    Found the following toolchain versions: ['4.9']
[INFO]:    Picking the latest gcc toolchain, here 4.9
[INFO]:    No existing dists meet the given requirements!
[INFO]:    No dist exists that meets your requirements, so one will be built.
[INFO]:    Bootstrap requires recipes ['sdl2', ('python2', 'python3crystax')]
[INFO]:    Loaded recipe sdl2 (depends on [('python2', 'python3crystax'), 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf'], conflicts ['sdl', 'pygame', 'pygame_bootstrap_components'])
[INFO]:    Loaded recipe boto (depends on ['python2', 'requests', 'cryptography'])
[INFO]:    Loaded recipe python2 (depends on ['hostpython2'], conflicts ['python3crystax', 'python3'])
[INFO]:    Loaded recipe sdl2_image (depends on [])
[INFO]:    Loaded recipe sdl2_mixer (depends on [])
[INFO]:    Loaded recipe sdl2_ttf (depends on [])
[INFO]:    Loaded recipe requests (depends on ['hostpython2', 'setuptools'])
[INFO]:    Loaded recipe cryptography (depends on [('python2', 'python3crystax'), 'cffi', 'enum34', 'openssl', 'ipaddress', 'idna'])
[INFO]:    Loaded recipe hostpython2 (depends on [], conflicts ['hostpython3'])
[INFO]:    Loaded recipe setuptools (depends on ['python2'])
[INFO]:    Loaded recipe cffi (depends on [('python2', 'python3crystax'), 'setuptools', 'pycparser', 'libffi'])
[INFO]:    Loaded recipe enum34 (depends on ['python2'])
[INFO]:    Loaded recipe openssl (depends on [])
[INFO]:    Loaded recipe ipaddress (depends on ['python2'])
[INFO]:    Loaded recipe idna (depends on [('python2', 'python3crystax'), 'setuptools'])
[INFO]:    Loaded recipe pycparser (depends on [('python2', 'python3crystax'), 'setuptools'])
[INFO]:    Loaded recipe libffi (depends on [])
[INFO]:    Found a single valid recipe set (this is good)
[INFO]:    The selected bootstrap is sdl2
[INFO]:    # Creating dist with sdl2 bootstrap
[INFO]:    Dist will have name testcrypto and recipes (sdl2, python2, boto)
[INFO]:    -> running cp -r /usr/local/lib/python2.7/dist-pack...(and 126 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/bootstrap_builds/sdl2-python2
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Recipe build order is ['hostpython2', 'libffi', 'openssl', 'sdl2_image', 'sdl2_mixer', 'sdl2_ttf', 'python2', 'enum34', 'ipaddress', u'sdl2', 'setuptools', 'idna', 'pycparser', 'requests', 'cffi', 'cryptography', u'boto']
[INFO]:    # Downloading recipes 
[INFO]:    Downloading hostpython2
[INFO]:    -> running mkdir -p /home/bidafiwoc/.local/share/pyth...(and 35 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/packages/hostpython2
[INFO]:    -> running basename http://python.org/ftp/python/2.7...(and 23 more)
[INFO]:    hostpython2 download already cached, skipping                                 
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Downloading libffi
[INFO]:    -> running mkdir -p /home/bidafiwoc/.local/share/pyth...(and 30 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/packages/libffi
[INFO]:    -> running basename https://github.com/atgreen/libff...(and 20 more)
[INFO]:    libffi download already cached, skipping                                      
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Downloading openssl
[INFO]:    -> running mkdir -p /home/bidafiwoc/.local/share/pyth...(and 31 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/packages/openssl
[INFO]:    -> running basename https://www.openssl.org/source/o...(and 20 more)
[INFO]:    openssl download already cached, skipping                                     
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Downloading sdl2_image
[INFO]:    -> running mkdir -p /home/bidafiwoc/.local/share/pyth...(and 34 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/packages/sdl2_image
[INFO]:    -> running basename https://www.libsdl.org/projects...(and 42 more)
[INFO]:    sdl2_image download already cached, skipping                                  
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Downloading sdl2_mixer
[INFO]:    -> running mkdir -p /home/bidafiwoc/.local/share/pyth...(and 34 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/packages/sdl2_mixer
[INFO]:    -> running basename https://www.libsdl.org/projects...(and 42 more)
[INFO]:    sdl2_mixer download already cached, skipping                                  
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Downloading sdl2_ttf
[INFO]:    -> running mkdir -p /home/bidafiwoc/.local/share/pyth...(and 32 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/packages/sdl2_ttf
[INFO]:    -> running basename https://www.libsdl.org/projects/...(and 38 more)
[INFO]:    sdl2_ttf download already cached, skipping                                    
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Downloading python2
[INFO]:    -> running mkdir -p /home/bidafiwoc/.local/share/pyth...(and 31 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/packages/python2
[INFO]:    -> running basename http://python.org/ftp/python/2.7...(and 23 more)
[INFO]:    python2 download already cached, skipping                                     
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Downloading enum34
[INFO]:    -> running mkdir -p /home/bidafiwoc/.local/share/pyth...(and 30 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/packages/enum34
[INFO]:    -> running basename https://pypi.python.org/packages...(and 36 more)
[INFO]:    enum34 download already cached, skipping                                      
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Downloading ipaddress
[INFO]:    -> running mkdir -p /home/bidafiwoc/.local/share/pyth...(and 33 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/packages/ipaddress
[INFO]:    -> running basename https://pypi.python.org/package...(and 44 more)
[INFO]:    ipaddress download already cached, skipping                                   
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Downloading sdl2
[INFO]:    -> running mkdir -p /home/bidafiwoc/.local/share/pyth...(and 28 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/packages/sdl2
[INFO]:    -> running basename https://www.libsdl.org/release/SDL2-2.0.3.tar.gz
[INFO]:    sdl2 download already cached, skipping                                        
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Downloading setuptools
[INFO]:    -> running mkdir -p /home/bidafiwoc/.local/share/pyth...(and 34 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/packages/setuptools
[INFO]:    -> running basename https://pypi.python.org/package...(and 46 more)
[INFO]:    setuptools download already cached, skipping                                  
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Downloading idna
[INFO]:    -> running mkdir -p /home/bidafiwoc/.local/share/pyth...(and 28 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/packages/idna
[INFO]:    -> running basename https://pypi.python.org/packages...(and 30 more)
[INFO]:    idna download already cached, skipping                                        
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Downloading pycparser
[INFO]:    -> running mkdir -p /home/bidafiwoc/.local/share/pyth...(and 33 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/packages/pycparser
[INFO]:    -> running basename https://pypi.python.org/package...(and 42 more)
[INFO]:    pycparser download already cached, skipping                                   
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Downloading requests
[INFO]:    -> running mkdir -p /home/bidafiwoc/.local/share/pyth...(and 32 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/packages/requests
[INFO]:    -> running basename https://github.com/kennethreitz/...(and 31 more)
[INFO]:    requests download already cached, skipping                                    
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Downloading cffi
[INFO]:    -> running mkdir -p /home/bidafiwoc/.local/share/pyth...(and 28 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/packages/cffi
[INFO]:    -> running basename https://pypi.python.org/packages...(and 32 more)
[INFO]:    cffi download already cached, skipping                                        
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Downloading cryptography
[INFO]:    -> running mkdir -p /home/bidafiwoc/.local/share/pyth...(and 36 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/packages/cryptography
[INFO]:    -> running basename https://pypi.python.org/package...(and 49 more)
[INFO]:    cryptography download already cached, skipping                                
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Downloading boto
[INFO]:    -> running mkdir -p /home/bidafiwoc/.local/share/pyth...(and 28 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/packages/boto
[INFO]:    -> running basename https://github.com/boto/boto/arc...(and 18 more)
[INFO]:    boto download already cached, skipping                                        
[WARNING]: Should check headers here! Skipping for now.
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    # Building all recipes for arch armeabi
[INFO]:    # Unpacking recipes
[INFO]:    Unpacking hostpython2 for armeabi
[INFO]:    -> running basename http://python.org/ftp/python/2.7...(and 23 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/other_builds/hostpython2/desktop
[INFO]:    hostpython2 is already unpacked, skipping
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Unpacking libffi for armeabi
[INFO]:    -> running basename https://github.com/atgreen/libff...(and 20 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/other_builds/libffi/armeabi
[INFO]:    libffi is already unpacked, skipping
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Unpacking openssl for armeabi
[INFO]:    -> running basename https://www.openssl.org/source/o...(and 20 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/other_builds/openssl/armeabi
[INFO]:    openssl is already unpacked, skipping
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Unpacking sdl2_image for armeabi
[INFO]:    -> running basename https://www.libsdl.org/projects...(and 42 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/bootstrap_builds/sdl2-python2/jni
[INFO]:    sdl2_image is already unpacked, skipping
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Unpacking sdl2_mixer for armeabi
[INFO]:    -> running basename https://www.libsdl.org/projects...(and 42 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/bootstrap_builds/sdl2-python2/jni
[INFO]:    sdl2_mixer is already unpacked, skipping
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Unpacking sdl2_ttf for armeabi
[INFO]:    -> running basename https://www.libsdl.org/projects/...(and 38 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/bootstrap_builds/sdl2-python2/jni
[INFO]:    sdl2_ttf is already unpacked, skipping
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Unpacking python2 for armeabi
[INFO]:    -> running basename http://python.org/ftp/python/2.7...(and 23 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/other_builds/python2-openssl/armeabi
[INFO]:    python2 is already unpacked, skipping
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Unpacking enum34 for armeabi
[INFO]:    -> running basename https://pypi.python.org/packages...(and 36 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/other_builds/enum34/armeabi
[INFO]:    enum34 is already unpacked, skipping
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Unpacking ipaddress for armeabi
[INFO]:    -> running basename https://pypi.python.org/package...(and 44 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/other_builds/ipaddress/armeabi
[INFO]:    ipaddress is already unpacked, skipping
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Unpacking sdl2 for armeabi
[INFO]:    -> running basename https://www.libsdl.org/release/SDL2-2.0.3.tar.gz
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/bootstrap_builds/sdl2-python2/jni
[INFO]:    sdl2 is already unpacked, skipping
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Unpacking setuptools for armeabi
[INFO]:    -> running basename https://pypi.python.org/package...(and 46 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/other_builds/setuptools/armeabi
[INFO]:    setuptools is already unpacked, skipping
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Unpacking idna for armeabi
[INFO]:    -> running basename https://pypi.python.org/packages...(and 30 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/other_builds/idna-python2/armeabi
[INFO]:    idna is already unpacked, skipping
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Unpacking pycparser for armeabi
[INFO]:    -> running basename https://pypi.python.org/package...(and 42 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/other_builds/pycparser-python2/armeabi
[INFO]:    pycparser is already unpacked, skipping
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Unpacking requests for armeabi
[INFO]:    -> running basename https://github.com/kennethreitz/...(and 31 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/other_builds/requests/armeabi
[INFO]:    requests is already unpacked, skipping
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Unpacking cffi for armeabi
[INFO]:    -> running basename https://pypi.python.org/packages...(and 32 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/other_builds/cffi-python2/armeabi
[INFO]:    cffi is already unpacked, skipping
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Unpacking cryptography for armeabi
[INFO]:    -> running basename https://pypi.python.org/package...(and 49 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/other_builds/cryptography-python2/armeabi
[INFO]:    cryptography is already unpacked, skipping
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Unpacking boto for armeabi
[INFO]:    -> running basename https://github.com/boto/boto/arc...(and 18 more)
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/other_builds/boto/armeabi
[INFO]:    boto is already unpacked, skipping
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    # Prebuilding recipes
[INFO]:    Prebuilding hostpython2 for armeabi
[INFO]:    -> running cp /usr/local/lib/python2.7/dist-package...(and 156 more)
[INFO]:    Prebuilding libffi for armeabi
[INFO]:    libffi has no prebuild_armeabi, skipping
[INFO]:    Applying patches for libffi[armeabi]
[INFO]:    libffi already patched, skipping
[INFO]:    Prebuilding openssl for armeabi
[INFO]:    openssl has no prebuild_armeabi, skipping
[INFO]:    Prebuilding sdl2_image for armeabi
[INFO]:    sdl2_image has no prebuild_armeabi, skipping
[INFO]:    Applying patches for sdl2_image[armeabi]
[INFO]:    sdl2_image already patched, skipping
[INFO]:    Prebuilding sdl2_mixer for armeabi
[INFO]:    sdl2_mixer has no prebuild_armeabi, skipping
[INFO]:    Applying patches for sdl2_mixer[armeabi]
[INFO]:    sdl2_mixer already patched, skipping
[INFO]:    Prebuilding sdl2_ttf for armeabi
[INFO]:    sdl2_ttf has no prebuild_armeabi, skipping
[INFO]:    Prebuilding python2 for armeabi
[INFO]:    python2 has no prebuild_armeabi, skipping
[INFO]:    Applying patches for python2[armeabi]
[INFO]:    python2 already patched, skipping
[INFO]:    Prebuilding enum34 for armeabi
[INFO]:    enum34 has no prebuild_armeabi, skipping
[INFO]:    Prebuilding ipaddress for armeabi
[INFO]:    ipaddress has no prebuild_armeabi, skipping
[INFO]:    Prebuilding sdl2 for armeabi
[INFO]:    sdl2 has no prebuild_armeabi, skipping
[INFO]:    Applying patches for sdl2[armeabi]
[INFO]:    sdl2 already patched, skipping
[INFO]:    Prebuilding setuptools for armeabi
[INFO]:    setuptools has no prebuild_armeabi, skipping
[INFO]:    Prebuilding idna for armeabi
[INFO]:    idna has no prebuild_armeabi, skipping
[INFO]:    Prebuilding pycparser for armeabi
[INFO]:    pycparser has no prebuild_armeabi, skipping
[INFO]:    Prebuilding requests for armeabi
[INFO]:    requests has no prebuild_armeabi, skipping
[INFO]:    Prebuilding cffi for armeabi
[INFO]:    cffi has no prebuild_armeabi, skipping
[INFO]:    Applying patches for cffi[armeabi]
[INFO]:    cffi already patched, skipping
[INFO]:    Prebuilding cryptography for armeabi
[INFO]:    cryptography has no prebuild_armeabi, skipping
[INFO]:    Applying patches for cryptography[armeabi]
[INFO]:    cryptography already patched, skipping
[INFO]:    Prebuilding boto for armeabi
[INFO]:    boto has no prebuild_armeabi, skipping
[INFO]:    # Building recipes
[INFO]:    Building hostpython2 for armeabi
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/other_builds/hostpython2/desktop/hostpython2
[INFO]:    hostpython already exists, skipping build
[INFO]:    <- directory context /home/bidafiwoc/src/TestCrypto
[INFO]:    Building libffi for armeabi
ccache found, will optimize builds
('path is', '/home/bidafiwoc/AndroidUpstream/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86/bin/:/home/bidafiwoc/AndroidUpstream/android-ndk-r11c/toolchains/arm-linux-androideabi-4.9/prebuilt/linux-x86_64/bin/:/home/bidafiwoc/AndroidUpstream/android-ndk-r11c:/home/bidafiwoc/AndroidUpstream/android-sdk-linux/tools:/home/bidafiwoc/.bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games')
[INFO]:    -> directory context /home/bidafiwoc/.local/share/python-for-android/build/other_builds/libffi/armeabi/libffi
[INFO]:    -> running configure --host=arm-linux-androideabi -...(and 109 more)
Traceback (most recent call last):                                                       
  File "/usr/local/bin/p4a", line 9, in <module>
    load_entry_point('python-for-android==0.3', 'console_scripts', 'p4a')()
  File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 752, in main
    ToolchainCL()
  File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 330, in __init__
    getattr(self, args.command)(unknown)
  File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 105, in wrapper_func
    build_dist_from_args(ctx, dist, dist_args)
  File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/toolchain.py", line 142, in build_dist_from_args
    build_recipes(build_order, python_modules, ctx)
  File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/build.py", line 559, in build_recipes
    recipe.build_arch(arch)
  File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/recipes/libffi/__init__.py", line 45, in build_arch
    '--enable-shared', _env=env)
  File "/usr/local/lib/python2.7/dist-packages/pythonforandroid/logger.py", line 165, in shprint
    for line in output:
  File "/usr/lib/python2.7/dist-packages/sh.py", line 565, in next
    self.wait()
  File "/usr/lib/python2.7/dist-packages/sh.py", line 500, in wait
    self.handle_command_exit_code(exit_code)
  File "/usr/lib/python2.7/dist-packages/sh.py", line 516, in handle_command_exit_code
    raise exc(self.ran, self.process.stdout, self.process.stderr)
sh.ErrorReturnCode_1: 

  RAN: './configure --host=arm-linux-androideabi --prefix=/home/bidafiwoc/.local/share/python-for-android/build/python-installs/testcrypto --enable-shared'

  STDOUT:
configure: WARNING: unrecognized options: --enable-shared
configure: error: cannot find install-sh, install.sh, or shtool in "." "./.." "./../.."


  STDERR:

```


Resolving patch:
diff --git a/pythonforandroid/recipes/libffi/__init__.py b/pythonforandroid/recipes/libffi/__init__.py
--- a/pythonforandroid/recipes/libffi/__init__.py
+++ b/pythonforandroid/recipes/libffi/__init__.py
@@ -40,6 +40,7 @@ def build_arch(self, arch):
 		with current_directory(self.get_build_dir(arch.arch)):
 			if not exists('configure'):
 				shprint(sh.Command('./autogen.sh'), _env=env)
+			shprint(sh.Command('autoreconf -vif'), _env=env)
 			shprint(sh.Command('./configure'), '--host=' + arch.toolchain_prefix,
 			        '--prefix=' + self.ctx.get_python_install_dir(),
 			        '--enable-shared', _env=env)


Test patch: