47 Commits

Author SHA1 Message Date
Erik Auerswald 1fe392c772 use latest release date as man page date
The latest release date is extracted from the NEWS file,
i.e., it depends only on the sources, not the build date.
This is intended to help in creating reproducible builds
by avoiding timestamps.  It is also closer to the date of
the contents of the man page than using just the latest
copyright year.

I do not have a perfect solution that works for both a git
clone and a downloaded tar ball.  This solution works well
for released tar balls of the ssocr sources.
2023-05-14 17:37:48 +02:00
Erik Auerswald 2ff3d882b9 Makefile: remove quotes from inside VERSION variable 2023-05-14 17:21:37 +02:00
Erik Auerswald f06f8441fd Makefile: use single quote when possible 2023-05-14 17:01:26 +02:00
Erik Auerswald a5c550b72b Makefile: man page also depends on help.c 2023-05-14 16:26:34 +02:00
Erik Auerswald 050830a709 man page: use latest copyright year, not build date
In order to help creating reproducible builds of ssocr,
do not use the build day of the man page as the date
inside the man page.  Instead, use the latest copyright
year of ssocr.

Using the man page build date has always been problematic,
because it is misleading.  But I do not have a general
automatic way to maintain the last change date for the
man page that works for both git clones and tar balls.
This seems like an improvement to me.  It provides some
idea of how old the man page is, and this date depends
only on the ssocr source code, not the build date.

This should help with one of the two problems reported
in GitHub issue #22.
2023-05-09 18:11:53 +02:00
Erik Auerswald 145c9f74cb Makefile: man page depends on defines.h for version number 2022-01-25 18:55:31 +01:00
Erik Auerswald 9709e55683 Makefile: use pkg-config without imlib2-config
Since I have used imlib2-config since "the beginning," I prefer
to keep it as long as it is available.  But for systems with a
newer Imlib2 version, a fallback to pkg-config is required.
2022-01-24 21:01:37 +01:00
Erik Auerswald c4491d1f98 add a NEWS file
I have taken the contents from the web page, adding dates from
"git log".
2021-11-01 13:51:18 +01:00
Erik Auerswald df0f1e35b7 fix compilation on Debian GNU/Linux Buster (11)
GCC has become too aggressive with its warnings, complaining about more
and more perfectly valid code.

In August 2020 I received a report of GCC 10.1 generating a warning
about strncat:

--------8<--------
cc -D_FORTIFY_SOURCE=2 -Wall -W -Wextra -pedantic -Werror -pedantic-errors -fstack-protector-all  -O3    -c -o ssocr.o ssocr.c
In file included from /usr/include/string.h:495,
                 from ssocr.c:29:
In function ‘strncat’,
    inlined from ‘tmp_imgfile’ at ssocr.c:79:12,
    inlined from ‘main’ at ssocr.c:454:15:
/usr/include/bits/string_fortified.h:136:10: error: ‘__builtin_strncat’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
  136 |   return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
      | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ssocr.c: In function ‘main’:
ssocr.c:67:19: note: length computed here
   67 |     pattern_len = strlen(dir) + strlen(DIR_SEP TMP_FILE_PATTERN) + 1;
      |                   ^~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: ssocr.o] Error 1
-------->8--------

Basically the same problem has been reported in GitHub issue #15,
"Fails to build on Arm":

--------8<--------
cc -D_FORTIFY_SOURCE=2 -Wall -W -Wextra -pedantic -Werror -pedantic-errors -fstack-protector-all  -O3   -c -o ssocr.o ssocr.c
In file included from /usr/include/string.h:495,
                 from ssocr.c:29:
In function ‘strncat’,
    inlined from ‘tmp_imgfile’ at ssocr.c:79:12,
    inlined from ‘main’ at ssocr.c:529:15:
/usr/include/arm-linux-gnueabihf/bits/string_fortified.h:136:10: error: ‘__builtin_strncat’ specified bound depends on the length of the source argument [-Werror=stringop-overflow=]
  136 |   return __builtin___strncat_chk (__dest, __src, __len, __bos (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ssocr.c: In function ‘main’:
ssocr.c:67:19: note: length computed here
   67 |     pattern_len = strlen(dir) + strlen(DIR_SEP TMP_FILE_PATTERN) + 1;
      |                   ^~~~~~~~~~~
cc1: all warnings being treated as errors
make: *** [<builtin>: ssocr.o] Error 1
-------->8--------

As described in a Red Hat blog post[1], this warning cannot be avoided
without rewriting the code to not use strncat.  I do not intend to do so,
instead I just accept that GCC will generate warnings.  Thus this commit
removes -Werror and -pedantic-errors from the CFLAGS.

This fixes compilation on a x86_64 Debian Buster (11) GNU/Linux test
system with gcc (Debian 10.2.1-6) 10.2.1 20210110.

This strncat warning is the only warning generated by that gcc version.

[1] I do not link to that blog post here, because it requires JavaScript
    to display textual information, which I find unacceptable.
2021-10-25 19:40:20 +02:00
Erik Auerswald 00846d5dd3 Makefile: use man to convert man page to HTML 2021-06-29 20:01:29 +02:00
Erik Auerswald efded91c1d replace "rman" with "mandoc" for man->html conversion
"rman" does not support the URL macros ".UR" and ".UE", but I use
those already.  "mandoc" does support these macros.
2021-06-24 20:33:51 +02:00
Erik Auerswald 3699b42d2a add a copyright section to the man page 2021-05-01 19:11:48 +02:00
Erik Auerswald 08a628ff04 how to work around some compilation failures
C compilers are getting more aggressive with warnings and are producing
more false positives.  While I intend to keep ssocr compiling without
warnings (as in the last 15 years), I do not use the newest C compilers,
but rather the GCC version included in a stable GNU/Linux distribution,
it may take some time for me to encounter those problems myself, and thus
it may take some time for me to work around them.

A user reported a compilation failure due to new warnings in GCC 10.1.
Since I currently use GCC 7.5.0 from Ubuntu 18.04 LTS, I do not see
those warnings yet, and thus cannot test any workarounds yet.

A first investigation into the issue hints at a need to replace valid code
with code invalid for GCC's default C standard version (necessitating
the specification of a newer C standard in the CFLAGS) to work around
said problem.  I have no idea if there are additional warnings with GCC
10.1 after working around that one.  Since Google blocks my emails to
the reporting user, I cannot even communicate to find this out.  Thus any
code changes will have to wait for either a GCC version with additional
warnings arriving in my GNU/Linux distribution, or establishment of a
different communication channel, e.g., a GitHub issue.
2020-08-03 23:12:08 +02:00
Erik Auerswald 8a98e381e5 Makefile: cosmetics 2020-08-02 23:24:20 +02:00
Erik Auerswald f39237cc43 ensure pristine ssocr dir after "make selfdeb" 2018-10-14 14:19:16 +02:00
Erik Auerswald 0c2599510f Makefile maintenance
- rename target "nodeb" to "selfdeb"
- document new Makefile targets in INSTALL
2018-10-14 14:14:55 +02:00
Erik Auerswald a8ac8d7557 move building a .deb file out of the way
This is intended to interfere less (not at all?) with Debian
packaging efforts.

The Debian Upstream Guide says:

   "Some projects include a rough /debian directory among source files
    to ease bleeding-edge package compilation and installation on Debian
    (and derived) systems. While this is a good effort, it is better to
    leave it out of the final tarball as it can interfere with debian's
    own packaging effort."

I have renamed the directory to "notdebian" to clearly show that this
is not official. Since the Debian packaging system needs the exact name
"debian" for this directory, "notdebian" does not interfere with this.
2018-10-14 14:03:24 +02:00
Erik Auerswald 1c27cdb1dd fix white space damage from pull request 2018-10-14 13:52:39 +02:00
Alex Myczko c2cd9a502e drop all debian things from Makefile
the original source code should not ship debian/* or related things in the build system
2018-10-08 11:08:38 +02:00
Erik Auerswald d6a957e6d3 move character printing to a separate function
This is the first step towards support of different character sets.
Different character sets are intended to be used to e.g. select
between '6' and 'b', but also to receive an error if e.g. a decimal
display is recognized as a hexadecimal digit.
2018-08-05 05:24:38 +02:00
Erik Auerswald 6db731f44f added README to Makefile (as a documentation file) 2017-06-03 17:12:55 +02:00
Erik Auerswald 227fa378ab Makefile: add -fstack-protector-all compiler option 2016-09-09 17:47:22 +02:00
Erik Auerswald 83f424343f Added -lm to LDLIBS.
The ssocr code itself uses math.h and thus libm. This library has been
linked to via recursive linking or the requirements of Imlib2 before
this commit. According to a report from Arne Wichmann this does not work
in all environments. While I do not know the exact circumstances under
which this problem occurs, adding -lm to the linker step is correct,
because ssocr uses it. It is incorrect to rely on Imlib2 to pull this in.
2014-03-16 17:31:35 +00:00
Erik Auerswald 5a4e0ef5e0 Added some more Mac OS X compatibility stuff:
- use optimization level -O3, which is supported by both gcc and clang
- removed a set of unnecessary parenthesis
- added info about 'brew' on Mac OS X to INSTALL file

bumped version number to 2.13.3
2013-01-11 10:26:57 +00:00
Erik Auerswald 3357afec00 Makefile: use imlib2-config --libs for LDLIBS.
This should improve compatibility for systems with Imlib2 installed
in non-standard places, e.g. Mac OS X.

On Debian GNU/Linux this results in some warnings when building a .deb:

dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/ssocr/usr/bin/ssocr was not linked against libdl.so.2 (it uses none of the library's symbols)
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/ssocr/usr/bin/ssocr was not linked against libz.so.1 (it uses none of the library's symbols)
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/ssocr/usr/bin/ssocr was not linked against libX11.so.6 (it uses none of the library's symbols)
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/ssocr/usr/bin/ssocr was not linked against libfreetype.so.6 (it uses none of the library's symbols)
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/ssocr/usr/bin/ssocr was not linked against libXext.so.6 (it uses none of the library's symbols)

I'm ignoring this. Special local adaptations like this have no place in
a general build system. A dedicated Debian package might apply a local patch
to strip these dependencies. This could result in a non-working ssocr as
at least libdl is actually needed by Imlib2 to load images.
2013-01-11 04:23:07 +00:00
Erik Auerswald d51eb5494d Replaced 'date -I' by 'date +%Y-%m-%d' to improve portability.
FreeBSD and Mac OS X don't know 'date -I', but do know 'date +%F' with
'%F' equivalent to '%Y-%m-%d'. POSIX knows neither '-I' nor '%F', but
just '%Y-%m-%d', so use the latter.

Problem reported by Alan Bates <abates@johncabot.edu>.
2013-01-11 04:03:45 +00:00
Erik Auerswald 35b5389b63 Makefile: add dependency on Makefile for basic components.
This way changing somethin in the Makefile, e.g. LDFLAGS, results
in a rebuild without the need for a previous 'make clean'.
2013-01-08 16:52:43 +00:00
Erik Auerswald 62b881988d Makefile: debian/rules needs to be executable. 2013-01-08 16:28:51 +00:00
Erik Auerswald a0a6adb809 Makefile: do not set execute permission on files in tar archive. 2012-11-11 20:16:49 +00:00
Erik Auerswald f43e3e2aaa Added _FORTIFY_SOURCE checks (affects just strcat() currently). 2012-07-15 18:11:35 +00:00
Erik Auerswald f66d25f978 Bumped version number to 2.10.0.
The new feature in this version is the INSTALL file.
I'm releasing this version in a moment.
2012-07-10 17:48:56 +00:00
Erik Auerswald 4caf2faf18 Added INSTALL file, installed to documentation directory. 2012-07-10 17:43:50 +00:00
Erik Auerswald 5a06da1133 Build fix for Ubuntu 11.10 and newer.
Build on recent Ubuntu systems would fail, because the --as-needed linker
option (enabled by default on these systems) needs a special argument
order for ld to work correctly.

(see http://www.gentoo.org/proj/en/qa/asneeded.xml)

Use LDLIBS instead of LDFLAGS to list needed libraries. See GNU Make docs
and http://www.roland-illig.de/articles/article-1.html for rationale.

Bumped version number to 2.9.8, so I can tell the users having build
problems to upgrade to this version.
2012-05-15 17:47:42 +00:00
Erik Auerswald 51933261bf Added ATUTHORS, COPYING and THANKS files to .tar.bz2 and .deb archives.
Bumped version number to 2.9.5.
2010-06-08 19:13:51 +00:00
Erik Auerswald 175e05a29b Correction of .PHONY entry in Makefile. 2009-08-17 11:57:48 +00:00
Erik Auerswald 6aeb2d1cb4 Create debian/changelog dynamically from current version number. 2009-08-10 10:51:46 +00:00
Erik Auerswald 4580506ff8 Activate some more compiler warnings. 2009-08-07 11:01:51 +00:00
Erik Auerswald b8827046d6 Improve creation of .tar.bz2 (source) and .deb (binary) packages. 2009-08-07 04:23:08 +00:00
Erik Auerswald 4e114d39d3 Link only against needed libraries. 2009-08-07 04:13:04 +00:00
Erik Auerswald 8dd3062395 Improve Makefile target "clean". 2009-08-07 01:14:37 +00:00
Erik Auerswald dcb2913e2c * Add deb target to Makefile to build a debian binary package.
* Add tar target to Makefile to create tar.bz2 archive of sources.
* Bump version number to 2.8.4.
2009-08-06 09:19:36 +00:00
Erik Auerswald 8ac9cf5f73 Add Makefile target "ssocr-manpage.html". The HTML file is created with "rman". 2009-08-06 08:22:34 +00:00
Erik Auerswald ff384fad23 Create missing directories when installing files. 2009-08-06 07:24:35 +00:00
Erik Auerswald 807ff6ac40 Add DESTDIR variable to install target of Makefile.
This is in preparation for making a debian package.
2009-08-05 04:13:05 +00:00
Erik Auerswald 577761918a generate man page and include ssocr version and build date 2009-05-20 14:20:04 +00:00
Erik Auerswald a1a060b416 - refactor image processing and online help in seperate files
- no functional changes
- this is another step towards refactoring the recognition algorithm
- this is another step towards factoring out the image access routines to
  ultimately replace Imlib2 by something else (e.g. gd)
2009-01-06 11:22:10 +00:00
Erik Auerswald 8926c8c2a8 initial import, ssocr version 2.6.3 2008-03-02 15:03:51 +00:00