Skip to content

Commit

Permalink
* Avoid versioning of Leptonica libraries, which breaks Tesseract on…
Browse files Browse the repository at this point in the history
… Android (issue #38)
  • Loading branch information
saudet committed Feb 23, 2015
1 parent 778d34b commit 986de96
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 1 deletion.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@

* Add x265 in the `cppbuild.sh` script for FFmpeg, thanks to Mark Bolstad
* Avoid versioning of Leptonica libraries, which breaks Tesseract on Android ([issue #38](https://github.com/bytedeco/javacpp-presets/issues/38))
* Add x265 in the `cppbuild.sh` script for FFmpeg, thanks to Mark Bolstad ([issue bytedeco/javacv#41](https://github.com/bytedeco/javacv/issues/41))
* Upgrade presets for FFmpeg 2.5.4, OpenSSL 1.0.2
* Switch from `IntPointer` to `BoolPointer` for the `BOOL*` pointer type of Leptonica ([issue #36](https://github.com/bytedeco/javacpp-presets/issues/36))
* Add `preload` for `gif`, `jpeg`, `png`, `tiff`, and `webp` libraries in presets for Leptonica ([issue #36](https://github.com/bytedeco/javacpp-presets/issues/36))
Expand Down
2 changes: 2 additions & 0 deletions leptonica/cppbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ fi

case $PLATFORM in
android-arm)
patch -Np1 < ../../../leptonica-$LEPTONICA_VERSION-android.patch
./configure --prefix=$INSTALL_PATH --host="arm-linux-androideabi" --with-sysroot="$ANDROID_ROOT" CC="$ANDROID_BIN-gcc" STRIP="$ANDROID_BIN-strip" CFLAGS="--sysroot=$ANDROID_ROOT -DANDROID -fPIC -ffunction-sections -funwind-tables -fstack-protector -march=armv7-a -mfloat-abi=softfp -mfpu=vfpv3-d16 -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300" LDFLAGS="-nostdlib -Wl,--fix-cortex-a8" LIBS="-lgcc -ldl -lz -lm -lc"
make -j4
make install-strip
;;
android-x86)
patch -Np1 < ../../../leptonica-$LEPTONICA_VERSION-android.patch
./configure --prefix=$INSTALL_PATH --host="i686-linux-android" --with-sysroot="$ANDROID_ROOT" CC="$ANDROID_BIN-gcc" STRIP="$ANDROID_BIN-strip" CFLAGS="--sysroot=$ANDROID_ROOT -DANDROID -fPIC -ffunction-sections -funwind-tables -mssse3 -mfpmath=sse -fomit-frame-pointer -fstrict-aliasing -funswitch-loops -finline-limit=300" LDFLAGS="-nostdlib" LIBS="-lgcc -ldl -lz -lm -lc"
make -j4
make install-strip
Expand Down
24 changes: 24 additions & 0 deletions leptonica/leptonica-1.71-android.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
diff -ruN leptonica-1.71/src/Makefile.am leptonica-1.71-android/src/Makefile.am
--- leptonica-1.71/src/Makefile.am 2014-07-06 04:49:22.000000000 +0900
+++ leptonica-1.71-android/src/Makefile.am 2015-02-23 19:30:38.862615705 +0900
@@ -3,7 +3,7 @@
lib_LTLIBRARIES = liblept.la
liblept_la_LIBADD = $(LIBM) $(ZLIB_LIBS) $(LIBPNG_LIBS) $(JPEG_LIBS) $(GIFLIB_LIBS) $(LIBTIFF_LIBS) $(LIBWEBP_LIBS) $(LIBJP2K_LIBS) $(GDI_LIBS)

-liblept_la_LDFLAGS = -no-undefined -version-info 4:2:0
+liblept_la_LDFLAGS = -no-undefined -avoid-version

liblept_la_SOURCES = adaptmap.c affine.c \
affinecompose.c arrayaccess.c \
diff -ruN leptonica-1.71/src/Makefile.in leptonica-1.71-android/src/Makefile.in
--- leptonica-1.71/src/Makefile.in 2014-07-09 00:54:38.000000000 +0900
+++ leptonica-1.71-android/src/Makefile.in 2015-02-23 19:30:46.867809124 +0900
@@ -290,7 +290,7 @@
AM_CFLAGS = $(DEBUG_FLAGS)
lib_LTLIBRARIES = liblept.la
liblept_la_LIBADD = $(LIBM) $(ZLIB_LIBS) $(LIBPNG_LIBS) $(JPEG_LIBS) $(GIFLIB_LIBS) $(LIBTIFF_LIBS) $(LIBWEBP_LIBS) $(LIBJP2K_LIBS) $(GDI_LIBS)
-liblept_la_LDFLAGS = -no-undefined -version-info 4:2:0
+liblept_la_LDFLAGS = -no-undefined -avoid-version
liblept_la_SOURCES = adaptmap.c affine.c \
affinecompose.c arrayaccess.c \
bardecode.c baseline.c bbuffer.c \

0 comments on commit 986de96

Please sign in to comment.