[sane-devel] cross-compile SANE for Android NDK - libtool can't create shared library

Anton Tonkov tavuser at gmail.com
Tue Jan 28 13:36:37 UTC 2014


Hi,
there is a problem when cross compiling SANE with Android NDK toolchain.
Only  ".a" static libraries are created, and I don't
know how to compile ".so" shared libraries from sane-backends 1.0.23
sources.
Here's my compiling script

#---------------------------------------------------
#path to toolchain
PLATFORM_PREFIX=/home/anton/my_tools/forsane
INSTALL_DIR="/data/data/tav.dyn/files"
SRC_DIR="`pwd`/backends_source"

PLATFORM_LIBS="$PLATFORM_PREFIX/lib"
PLATFORM_INCLUDES="$PLATFORM_PREFIX/sysroot/usr/include"
CC_COMPILER=$PLATFORM_PREFIX/bin/arm-linux-androideabi-gcc

cd $SRC_DIR

export PATH=$PLATFORM_PREFIX/bin:$PLATFORM_PREFIX/sysroot/usr/lib:$PATH
export CC=$CC_COMPILER
export CFLAGS="--sysroot=$PLATFORM_PREFIX/sysroot -fPIC"
export BACKENDS='dll test epson epson2 net'

./configure --prefix=$INSTALL_DIR --libdir=$INSTALL_DIR/libs
--build=arm-linux-androideabi --host=arm-android-eabi\
 --enable-shared=yes --enable-dynamic=yes --enable-static=no
--disable-preload --enable-avahi --disable-libusb_1_0\
 --disable-libusb --enable-pthread --enable-local-backends --without-gphoto2
make
make install
#------------------------------------------------------------------------

My operating system is Ubuntu 13.04.
When I tried to set parameter "-shared" for compiler in "CFLAGS", libtool
error occurs "libtool: compile: can not build a shared library".

Regards,
  Anton.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.alioth.debian.org/pipermail/sane-devel/attachments/20140128/69391458/attachment.html>


More information about the sane-devel mailing list