gocr-ruby 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +22 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +49 -0
- data/ext/gocr/Makefile +141 -0
- data/ext/gocr/Makefile.in +140 -0
- data/ext/gocr/amiga.h +31 -0
- data/ext/gocr/barcode.c +2108 -0
- data/ext/gocr/barcode.h +11 -0
- data/ext/gocr/box.c +496 -0
- data/ext/gocr/config.h +37 -0
- data/ext/gocr/config.h.in +36 -0
- data/ext/gocr/database.c +468 -0
- data/ext/gocr/detect.c +1003 -0
- data/ext/gocr/extconf.rb +6 -0
- data/ext/gocr/gocr.c +436 -0
- data/ext/gocr/gocr.h +290 -0
- data/ext/gocr/jconv.c +168 -0
- data/ext/gocr/job.c +92 -0
- data/ext/gocr/lines.c +364 -0
- data/ext/gocr/list.c +334 -0
- data/ext/gocr/list.h +91 -0
- data/ext/gocr/ocr0.c +7312 -0
- data/ext/gocr/ocr0.h +63 -0
- data/ext/gocr/ocr0n.c +1527 -0
- data/ext/gocr/ocr1.c +85 -0
- data/ext/gocr/ocr1.h +3 -0
- data/ext/gocr/otsu.c +310 -0
- data/ext/gocr/otsu.h +23 -0
- data/ext/gocr/output.c +291 -0
- data/ext/gocr/output.h +37 -0
- data/ext/gocr/pcx.c +153 -0
- data/ext/gocr/pcx.h +9 -0
- data/ext/gocr/pgm2asc.c +3259 -0
- data/ext/gocr/pgm2asc.h +105 -0
- data/ext/gocr/pixel.c +538 -0
- data/ext/gocr/pnm.c +538 -0
- data/ext/gocr/pnm.h +35 -0
- data/ext/gocr/progress.c +87 -0
- data/ext/gocr/progress.h +42 -0
- data/ext/gocr/remove.c +715 -0
- data/ext/gocr/tga.c +87 -0
- data/ext/gocr/tga.h +6 -0
- data/ext/gocr/unicode.c +1318 -0
- data/ext/gocr/unicode.h +62 -0
- data/ext/gocr/unicode_defs.h +1245 -0
- data/ext/gocr/version.h +2 -0
- data/gocr-ruby.gemspec +28 -0
- data/image.png +0 -0
- data/lib/gocr.rb +6 -0
- data/lib/gocr/image.rb +8 -0
- data/lib/gocr/version.rb +3 -0
- metadata +156 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 18b9142ede00b0c09bc41a71caa18a5090ad44e2
|
4
|
+
data.tar.gz: b72f4aed15d04583f8330f0f3bccebc0a9649f9e
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 8ae9ddb96adb3ddf550e59347f597927df70e17df633e9bbb24e0d45b534bdd43bb5075dd3ada115fea4343cefe0f67ccdb53c209a5dd94d925a537ffd03b004
|
7
|
+
data.tar.gz: 260c67406fb4af5240939c6b16aea210667c907c0ee36ed13a7b94b691485c2ddfada467eb82ea73a4b3779a68e82213f035f0df40ef293177921f08e634771a
|
data/.gitignore
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
*.gem
|
2
|
+
*.rbc
|
3
|
+
.bundle
|
4
|
+
.config
|
5
|
+
.yardoc
|
6
|
+
Gemfile.lock
|
7
|
+
InstalledFiles
|
8
|
+
_yardoc
|
9
|
+
coverage
|
10
|
+
doc/
|
11
|
+
lib/bundler/man
|
12
|
+
pkg
|
13
|
+
rdoc
|
14
|
+
spec/reports
|
15
|
+
test/tmp
|
16
|
+
test/version_tmp
|
17
|
+
tmp
|
18
|
+
*.gem
|
19
|
+
*.so
|
20
|
+
.rvmrc
|
21
|
+
.idea/
|
22
|
+
*.log
|
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Copyright (c) 2014 Vladimir Zyablitskiy
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2014 Vladimir Zyablitskiy
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# gocr-ruby is a gocr binding for ruby
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'gocr-ruby'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install gocr-ruby
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1,49 @@
|
|
1
|
+
#require "bundler/gem_tasks"
|
2
|
+
|
3
|
+
require 'rake/extensiontask'
|
4
|
+
require 'rubygems/package_task'
|
5
|
+
|
6
|
+
##
|
7
|
+
# Rake::ExtensionTask comes from the rake-compiler and understands how to
|
8
|
+
# build and cross-compile extensions.
|
9
|
+
#
|
10
|
+
# See https://github.com/luislavena/rake-compiler for details
|
11
|
+
|
12
|
+
Rake::ExtensionTask.new 'gocr-ruby' do |ext|
|
13
|
+
|
14
|
+
# This causes the shared object to be placed in lib/my_malloc/my_malloc.so
|
15
|
+
#
|
16
|
+
# It allows lib/my_malloc.rb to load different versions if you ship a
|
17
|
+
# precompiled extension that supports multiple ruby versions.
|
18
|
+
|
19
|
+
ext.lib_dir = 'lib/gocr'
|
20
|
+
end
|
21
|
+
|
22
|
+
s = Gem::Specification.new 'gocr-ruby', '0.0.1' do |s|
|
23
|
+
s.summary = 'simple gocr wrapper'
|
24
|
+
s.authors = %w[zyablitskiy@gmail.com]
|
25
|
+
|
26
|
+
# this tells RubyGems to build an extension upon install
|
27
|
+
|
28
|
+
s.extensions = %w[ext/gocr/extconf.rb]
|
29
|
+
|
30
|
+
# naturally you must include the extension source in the gem
|
31
|
+
|
32
|
+
s.files = `git ls-files`.split($/)
|
33
|
+
end
|
34
|
+
|
35
|
+
# The package task builds the gem in pkg/my_malloc-1.0.gem so you can test
|
36
|
+
# installing it.
|
37
|
+
|
38
|
+
Gem::PackageTask.new s do end
|
39
|
+
|
40
|
+
# This isn't a good test, but does provide a sanity check
|
41
|
+
|
42
|
+
task test: %w[compile] do
|
43
|
+
ruby '-Ilib', '-rgocr', '-e', 'p GOCR::Image.recognize("image.png")'
|
44
|
+
# ruby '-Ilib', '-rgocr', '-e', 'p 3'
|
45
|
+
end
|
46
|
+
|
47
|
+
task default: :test
|
48
|
+
|
49
|
+
|
data/ext/gocr/Makefile
ADDED
@@ -0,0 +1,141 @@
|
|
1
|
+
#
|
2
|
+
# Makefile for ./src path, used by configure
|
3
|
+
#
|
4
|
+
|
5
|
+
EXEEXT =
|
6
|
+
PROGRAM = gocr$(EXEEXT)
|
7
|
+
# lib removed for simplification (v0.46)
|
8
|
+
# but Igor from OSRA an optical chemical structure recognition software
|
9
|
+
# wants it (v0.47 Mar09)
|
10
|
+
PGMASCLIB = Pgm2asc
|
11
|
+
#LIBPGMASCLIB = lib$(PGMASCLIB).a
|
12
|
+
# ToDo: need a better pgm2asc.h for lib users
|
13
|
+
#INCLUDEFILES = gocr.h
|
14
|
+
# avoid german compiler messages
|
15
|
+
LANG=C
|
16
|
+
|
17
|
+
LIBOBJS=pgm2asc.o \
|
18
|
+
box.o \
|
19
|
+
database.o \
|
20
|
+
detect.o \
|
21
|
+
barcode.o \
|
22
|
+
lines.o \
|
23
|
+
list.o \
|
24
|
+
ocr0.o \
|
25
|
+
ocr0n.o \
|
26
|
+
ocr1.o \
|
27
|
+
otsu.o \
|
28
|
+
output.o \
|
29
|
+
pixel.o \
|
30
|
+
unicode.o \
|
31
|
+
remove.o \
|
32
|
+
pnm.o \
|
33
|
+
pcx.o \
|
34
|
+
progress.o \
|
35
|
+
job.o
|
36
|
+
|
37
|
+
# these two lines are for cross-compiling, not tested
|
38
|
+
#srcdir = .
|
39
|
+
#VPATH = .
|
40
|
+
bindir = ${exec_prefix}/bin
|
41
|
+
# lib removed for simplification
|
42
|
+
#libdir = ${exec_prefix}/lib
|
43
|
+
#includedir = ${prefix}/include
|
44
|
+
includedir = ./
|
45
|
+
|
46
|
+
CC=gcc
|
47
|
+
# lib removed for simplification
|
48
|
+
# ar,ranlib detection removed from configure (simplicity)
|
49
|
+
# but needed by some developpers (linux only) for for (make libs)
|
50
|
+
# RANLIB = @RANLIB@
|
51
|
+
# AR = @AR@
|
52
|
+
RANLIB = ranlib
|
53
|
+
AR = ar
|
54
|
+
INSTALL=/usr/bin/install -c
|
55
|
+
# shell is needed for OS/2 to let if test -r $(PROGRAM) ... work
|
56
|
+
SHELL=/bin/bash
|
57
|
+
|
58
|
+
DEFS=-DHAVE_CONFIG_H
|
59
|
+
CPPFLAGS=
|
60
|
+
# to see the config.h
|
61
|
+
CFLAGS=-g -O2 $(CPPFLAGS) -I./ $(DEFS)
|
62
|
+
LDFLAGS=-lm
|
63
|
+
LIBS=
|
64
|
+
DESTDIR=/usr/local
|
65
|
+
|
66
|
+
.SUFFIXES: .s .o .c .h
|
67
|
+
# do not look for files if help (etc) is given
|
68
|
+
.PHONY : doc clean install libs default
|
69
|
+
|
70
|
+
.c.o: gocr.h pgm2asc.h ./config.h
|
71
|
+
$(CC) $(CFLAGS) -c -o $*.o $<
|
72
|
+
|
73
|
+
default: all
|
74
|
+
|
75
|
+
# all: $(PROGRAM) lib$(PGMASCLIB).a
|
76
|
+
all: $(PROGRAM)
|
77
|
+
|
78
|
+
gocr.o: gocr.h Makefile ./version.h
|
79
|
+
|
80
|
+
.c.h:
|
81
|
+
|
82
|
+
# Aug2010
|
83
|
+
unicode.o: unicode_defs.h
|
84
|
+
list.o pgm2asc.o: list.h
|
85
|
+
|
86
|
+
#$(PROGRAM): lib$(PGMASCLIB).a gocr.o
|
87
|
+
$(PROGRAM): $(LIBOBJS) gocr.o
|
88
|
+
# make it conform to ld --as-needed
|
89
|
+
#$(CC) -o $@ $(LDFLAGS) gocr.o ./lib$(PGMASCLIB).a $(LIBS)
|
90
|
+
$(CC) -o $@ $(LDFLAGS) gocr.o $(LIBOBJS) $(LIBS)
|
91
|
+
# if test -r $(PROGRAM); then cp $@ ../bin; fi
|
92
|
+
|
93
|
+
libs: lib$(PGMASCLIB).a lib$(PGMASCLIB).0.50.so
|
94
|
+
|
95
|
+
#lib$(PGMASCLIB).0.50.so: $(LIBOBJS)
|
96
|
+
# $(CC) -fPIC -shared -Wl,-h$@ -o $@ $(LIBOBJS)
|
97
|
+
lib$(PGMASCLIB).0.50.so: $(LIBOBJS:%.o=%.c) Makefile
|
98
|
+
# .o must be build with -fPIC too (Aug2010 JS)
|
99
|
+
$(CC) $(CFLAGS) -fPIC -shared -Wl,-h$@ -o $@ $(LIBOBJS:%.o=%.c)
|
100
|
+
-rm -f lib$(PGMASCLIB).so # set new link
|
101
|
+
-ln -s $@ lib$(PGMASCLIB).so
|
102
|
+
|
103
|
+
lib$(PGMASCLIB).a: $(LIBOBJS)
|
104
|
+
# -rm -f $@
|
105
|
+
$(AR) cru $@ $(LIBOBJS)
|
106
|
+
$(RANLIB) $@
|
107
|
+
|
108
|
+
$(LIBOBJS): Makefile
|
109
|
+
|
110
|
+
# PHONY = don't look at file clean, -rm = start rm and ignore errors
|
111
|
+
.PHONY : clean proper install uninstall
|
112
|
+
install: all
|
113
|
+
#$(INSTALL) -d $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
|
114
|
+
$(INSTALL) -d $(DESTDIR)$(bindir)
|
115
|
+
$(INSTALL) $(PROGRAM) $(DESTDIR)$(bindir)
|
116
|
+
$(INSTALL) ../bin/gocr.tcl $(DESTDIR)$(bindir) # better X11/bin?
|
117
|
+
if test -f lib$(PGMASCLIB).a; then\
|
118
|
+
$(INSTALL) lib$(PGMASCLIB).a $(DESTDIR)$(libdir);\
|
119
|
+
$(INSTALL) lib$(PGMASCLIB).0.50.so $(DESTDIR)$(libdir);\
|
120
|
+
$(INSTALL) lib$(PGMASCLIB).so $(DESTDIR)$(libdir);\
|
121
|
+
fi
|
122
|
+
# ToDo: not sure that the link will be installed correctly
|
123
|
+
#$(INSTALL) $(INCLUDEFILES) $(DESTDIR)$(includedir)
|
124
|
+
|
125
|
+
# directories are not removed
|
126
|
+
uninstall:
|
127
|
+
-rm -f $(DESTDIR)$(bindir)/$(PROGRAM)
|
128
|
+
-rm -f $(DESTDIR)$(bindir)/gocr.tcl
|
129
|
+
-rm -f $(DESTDIR)$(libdir)/lib$(PGMASCLIB).a
|
130
|
+
-rm -f $(DESTDIR)$(libdir)/lib$(PGMASCLIB).0.50.so
|
131
|
+
-rm -f $(DESTDIR)$(libdir)/lib$(PGMASCLIB).so
|
132
|
+
# ToDo: set to old version.so ?
|
133
|
+
#for X in $(INCLUDEFILES); do rm -f $(DESTDIR)$(includedir)/$$X; done
|
134
|
+
|
135
|
+
clean:
|
136
|
+
-rm -f *.o *~
|
137
|
+
|
138
|
+
proper: clean
|
139
|
+
-rm -f gocr libPgm2asc.*
|
140
|
+
-rm -f gocr
|
141
|
+
|
@@ -0,0 +1,140 @@
|
|
1
|
+
#
|
2
|
+
# Makefile for ./src path, used by configure
|
3
|
+
#
|
4
|
+
|
5
|
+
EXEEXT = @EXEEXT@
|
6
|
+
PROGRAM = gocr$(EXEEXT)
|
7
|
+
# lib removed for simplification (v0.46)
|
8
|
+
# but Igor from OSRA an optical chemical structure recognition software
|
9
|
+
# wants it (v0.47 Mar09)
|
10
|
+
PGMASCLIB = Pgm2asc
|
11
|
+
#LIBPGMASCLIB = lib$(PGMASCLIB).a
|
12
|
+
# ToDo: need a better pgm2asc.h for lib users
|
13
|
+
#INCLUDEFILES = gocr.h
|
14
|
+
# avoid german compiler messages
|
15
|
+
LANG=C
|
16
|
+
|
17
|
+
LIBOBJS=pgm2asc.o \
|
18
|
+
box.o \
|
19
|
+
database.o \
|
20
|
+
detect.o \
|
21
|
+
barcode.o \
|
22
|
+
lines.o \
|
23
|
+
list.o \
|
24
|
+
ocr0.o \
|
25
|
+
ocr0n.o \
|
26
|
+
ocr1.o \
|
27
|
+
otsu.o \
|
28
|
+
output.o \
|
29
|
+
pixel.o \
|
30
|
+
unicode.o \
|
31
|
+
remove.o \
|
32
|
+
pnm.o \
|
33
|
+
pcx.o \
|
34
|
+
progress.o \
|
35
|
+
job.o
|
36
|
+
|
37
|
+
# these two lines are for cross-compiling, not tested
|
38
|
+
#srcdir = @srcdir@
|
39
|
+
#VPATH = @srcdir@
|
40
|
+
bindir = @bindir@
|
41
|
+
# lib removed for simplification
|
42
|
+
#libdir = @libdir@
|
43
|
+
#includedir = @includedir@
|
44
|
+
|
45
|
+
CC=@CC@
|
46
|
+
# lib removed for simplification
|
47
|
+
# ar,ranlib detection removed from configure (simplicity)
|
48
|
+
# but needed by some developpers (linux only) for for (make libs)
|
49
|
+
# RANLIB = @RANLIB@
|
50
|
+
# AR = @AR@
|
51
|
+
RANLIB = ranlib
|
52
|
+
AR = ar
|
53
|
+
INSTALL=@INSTALL@
|
54
|
+
# shell is needed for OS/2 to let if test -r $(PROGRAM) ... work
|
55
|
+
SHELL=@SHELL@
|
56
|
+
|
57
|
+
DEFS=@DEFS@
|
58
|
+
CPPFLAGS=@CPPFLAGS@
|
59
|
+
# to see the config.h
|
60
|
+
CFLAGS=@CFLAGS@ $(CPPFLAGS) -I../include $(DEFS)
|
61
|
+
LDFLAGS=@LDFLAGS@
|
62
|
+
LIBS=@LIBS@
|
63
|
+
DESTDIR=@prefix@
|
64
|
+
|
65
|
+
.SUFFIXES: .s .o .c .h
|
66
|
+
# do not look for files if help (etc) is given
|
67
|
+
.PHONY : doc clean install libs default
|
68
|
+
|
69
|
+
.c.o: gocr.h pgm2asc.h ../include/config.h
|
70
|
+
$(CC) $(CFLAGS) -c -o $*.o $<
|
71
|
+
|
72
|
+
default: all
|
73
|
+
|
74
|
+
# all: $(PROGRAM) lib$(PGMASCLIB).a
|
75
|
+
all: $(PROGRAM)
|
76
|
+
|
77
|
+
gocr.o: gocr.h Makefile ../include/version.h
|
78
|
+
|
79
|
+
.c.h:
|
80
|
+
|
81
|
+
# Aug2010
|
82
|
+
unicode.o: unicode_defs.h
|
83
|
+
list.o pgm2asc.o: list.h
|
84
|
+
|
85
|
+
#$(PROGRAM): lib$(PGMASCLIB).a gocr.o
|
86
|
+
$(PROGRAM): $(LIBOBJS) gocr.o
|
87
|
+
# make it conform to ld --as-needed
|
88
|
+
#$(CC) -o $@ $(LDFLAGS) gocr.o ./lib$(PGMASCLIB).a $(LIBS)
|
89
|
+
$(CC) -o $@ $(LDFLAGS) gocr.o $(LIBOBJS) $(LIBS)
|
90
|
+
# if test -r $(PROGRAM); then cp $@ ../bin; fi
|
91
|
+
|
92
|
+
libs: lib$(PGMASCLIB).a lib$(PGMASCLIB).@PACKAGE_VERSION@.so
|
93
|
+
|
94
|
+
#lib$(PGMASCLIB).@PACKAGE_VERSION@.so: $(LIBOBJS)
|
95
|
+
# $(CC) -fPIC -shared -Wl,-h$@ -o $@ $(LIBOBJS)
|
96
|
+
lib$(PGMASCLIB).@PACKAGE_VERSION@.so: $(LIBOBJS:%.o=%.c) Makefile
|
97
|
+
# .o must be build with -fPIC too (Aug2010 JS)
|
98
|
+
$(CC) $(CFLAGS) -fPIC -shared -Wl,-h$@ -o $@ $(LIBOBJS:%.o=%.c)
|
99
|
+
-rm -f lib$(PGMASCLIB).so # set new link
|
100
|
+
-ln -s $@ lib$(PGMASCLIB).so
|
101
|
+
|
102
|
+
lib$(PGMASCLIB).a: $(LIBOBJS)
|
103
|
+
# -rm -f $@
|
104
|
+
$(AR) cru $@ $(LIBOBJS)
|
105
|
+
$(RANLIB) $@
|
106
|
+
|
107
|
+
$(LIBOBJS): Makefile
|
108
|
+
|
109
|
+
# PHONY = don't look at file clean, -rm = start rm and ignore errors
|
110
|
+
.PHONY : clean proper install uninstall
|
111
|
+
install: all
|
112
|
+
#$(INSTALL) -d $(DESTDIR)$(bindir) $(DESTDIR)$(libdir) $(DESTDIR)$(includedir)
|
113
|
+
$(INSTALL) -d $(DESTDIR)$(bindir)
|
114
|
+
$(INSTALL) $(PROGRAM) $(DESTDIR)$(bindir)
|
115
|
+
$(INSTALL) ../bin/gocr.tcl $(DESTDIR)$(bindir) # better X11/bin?
|
116
|
+
if test -f lib$(PGMASCLIB).a; then\
|
117
|
+
$(INSTALL) lib$(PGMASCLIB).a $(DESTDIR)$(libdir);\
|
118
|
+
$(INSTALL) lib$(PGMASCLIB).@PACKAGE_VERSION@.so $(DESTDIR)$(libdir);\
|
119
|
+
$(INSTALL) lib$(PGMASCLIB).so $(DESTDIR)$(libdir);\
|
120
|
+
fi
|
121
|
+
# ToDo: not sure that the link will be installed correctly
|
122
|
+
#$(INSTALL) $(INCLUDEFILES) $(DESTDIR)$(includedir)
|
123
|
+
|
124
|
+
# directories are not removed
|
125
|
+
uninstall:
|
126
|
+
-rm -f $(DESTDIR)$(bindir)/$(PROGRAM)
|
127
|
+
-rm -f $(DESTDIR)$(bindir)/gocr.tcl
|
128
|
+
-rm -f $(DESTDIR)$(libdir)/lib$(PGMASCLIB).a
|
129
|
+
-rm -f $(DESTDIR)$(libdir)/lib$(PGMASCLIB).@PACKAGE_VERSION@.so
|
130
|
+
-rm -f $(DESTDIR)$(libdir)/lib$(PGMASCLIB).so
|
131
|
+
# ToDo: set to old version.so ?
|
132
|
+
#for X in $(INCLUDEFILES); do rm -f $(DESTDIR)$(includedir)/$$X; done
|
133
|
+
|
134
|
+
clean:
|
135
|
+
-rm -f *.o *~
|
136
|
+
|
137
|
+
proper: clean
|
138
|
+
-rm -f gocr libPgm2asc.*
|
139
|
+
-rm -f gocr
|
140
|
+
|
data/ext/gocr/amiga.h
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
/*
|
2
|
+
this file was suggested by Uffe Holst Jun05,2000
|
3
|
+
to compile gocr using SAS/C under AmigaOS
|
4
|
+
|
5
|
+
uhc@post6.tele.dk
|
6
|
+
|
7
|
+
SAS/C propably does not support ANSI C++, therefore this changes
|
8
|
+
|
9
|
+
I am a little bit confused about using declaration and
|
10
|
+
macro definition of abs(). I think that should not be necessary.
|
11
|
+
Tell me, if you have an Amiga and you can give answer
|
12
|
+
to the following questions.
|
13
|
+
|
14
|
+
Joerg Schulenburg, see README for EMAIL-address
|
15
|
+
|
16
|
+
*/
|
17
|
+
|
18
|
+
#ifdef _AMIGA
|
19
|
+
#ifdef __SASC
|
20
|
+
#if 0
|
21
|
+
#include <string.h> /* may be this can be removed ??? */
|
22
|
+
#include <stdlib.h> /* may be this can be removed ??? */
|
23
|
+
extern int abs(int); /* may be this can be removed ??? */
|
24
|
+
#endif
|
25
|
+
#ifndef abs
|
26
|
+
#define abs(i) ((i) < 0 ? -(i) : (i))
|
27
|
+
#endif
|
28
|
+
#endif
|
29
|
+
#endif
|
30
|
+
|
31
|
+
|