leptonica: enable gcc2 support

This commit is contained in:
Sergei Reznikov
2015-03-31 15:31:18 +03:00
parent 4058b538eb
commit 7e2f14e2c7
2 changed files with 77 additions and 11 deletions

View File

@@ -13,13 +13,8 @@ CHECKSUM_SHA256="cc5d736e81496eb25e195f380f553537e0410c3f7151a778b2a546e35c7eb84
LICENSE="BSD (2-clause)"
COPYRIGHT="2001-2012 Dan Bloomberg"
REVISION="1"
ARCHITECTURES="x86 x86_64"
SECONDARY_ARCHITECTURES="x86"
if [ $effectiveTargetArchitecture != x86_gcc2 ]; then
# x86_gcc2 is fine as primary target architecture as long as we're building
# for a different secondary architecture.
ARCHITECTURES="$ARCHITECTURES x86_gcc2"
fi
ARCHITECTURES="x86_gcc2 x86 x86_64"
SECONDARY_ARCHITECTURES="x86_gcc2 x86"
PROVIDES="
leptonica$secondaryArchSuffix = $portVersion
@@ -62,7 +57,8 @@ BUILD()
aclocal
autoconf
automake -a
runConfigure ./configure
# override CFLAGS to make gcc2 happy by not passing the -g option
CFLAGS=-O2 runConfigure ./configure
make $jobArgs
}

View File

@@ -1,6 +1,6 @@
From e392263aabf5f9ce7098a4f9d7969be8eab9b32e Mon Sep 17 00:00:00 2001
From f18777c47edebf65bbe85d7e6723c8a4df050be0 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 20 Aug 2014 21:12:42 +0000
Date: Tue, 31 Mar 2015 10:55:28 +0300
Subject: Haiku patch
@@ -48,5 +48,75 @@ index 32ff12f..531bb9d 100644
#endif
--
1.8.3.4
2.2.2
From c9cc0e51cd0ba40ba342b79ed78e2bc39d4ec180 Mon Sep 17 00:00:00 2001
From: Sergei Reznikov <diver@gelios.net>
Date: Tue, 31 Mar 2015 10:56:57 +0300
Subject: gcc2 fixes
diff --git a/src/boxfunc1.c b/src/boxfunc1.c
index 9b4705d..eb3813f 100644
--- a/src/boxfunc1.c
+++ b/src/boxfunc1.c
@@ -77,6 +77,7 @@
* box1, and 0 otherwise)
* Return: 0 if OK, 1 on error
*/
+l_int32 x1, y1, w1, h1, x2, y2, w2, h2;
l_int32
boxContains(BOX *box1,
BOX *box2,
@@ -87,7 +88,6 @@ boxContains(BOX *box1,
if (!box1 || !box2)
return ERROR_INT("box1 and box2 not both defined", procName, 1);
-l_int32 x1, y1, w1, h1, x2, y2, w2, h2;
boxGetGeometry(box1, &x1, &y1, &w1, &h1);
boxGetGeometry(box2, &x2, &y2, &w2, &h2);
diff --git a/src/compare.c b/src/compare.c
index c51c607..ce587ba 100644
--- a/src/compare.c
+++ b/src/compare.c
@@ -1908,6 +1908,7 @@ l_int32 *tab;
l_float32 maxscore, score;
FPIX *fpix;
PIX *pix3, *pix4;
+char buf[128];
PROCNAME("pixBestCorrelation");
@@ -1954,7 +1955,6 @@ PIX *pix3, *pix4;
if (debugflag > 0) {
lept_mkdir("lept");
- char buf[128];
pix3 = fpixDisplayMaxDynamicRange(fpix);
pix4 = pixExpandReplicate(pix3, 20);
snprintf(buf, sizeof(buf), "/tmp/lept/correl_%d.png", debugflag);
diff --git a/src/recogident.c b/src/recogident.c
index 9fe2f3e..12726dc 100644
--- a/src/recogident.c
+++ b/src/recogident.c
@@ -784,6 +784,7 @@ l_float32 maxscore, score;
l_float32 *ycent1;
FPIX *fpix;
PIX *pixt, *pixt1, *pixt2;
+char buf[128];
PROCNAME("pixCorrelationBestShift");
@@ -872,7 +873,6 @@ PIX *pixt, *pixt1, *pixt2;
if (debugflag > 0) {
lept_mkdir("recog");
- char buf[128];
pixt1 = fpixDisplayMaxDynamicRange(fpix);
pixt2 = pixExpandReplicate(pixt1, 5);
snprintf(buf, sizeof(buf), "/tmp/recog/junkbs_%d.png", debugflag);
--
2.2.2