Imported Upstream version 1.0.6

parent bdd1ebb4
jp2a is written by Christian Stigen Larsen <csl@sublevel3.org>
This program uses dynamically linked libraries from other authors.
For an overview, see the file LICENSES.
This diff is collapsed.
CHANGES SINCE 1.0.5 (svnversion 452)
- Support for GCC 2.95.4 (old C compilers in general)
CHANGES SINCE 1.0.4 (svnversion 445)
- Fixed problem with --invert / --background=light / --background=dark with HTML output.
- Updated configure script from autoconf 2.59 to 2.60
CHANGES SINCE 1.0.3 (svnversion 440)
- HTML output no longer uses the &apos; entity.
CHANGES SINCE 1.0.2 (svnversion 432)
- Added option --html-no-bold to set non-bold output.
- Added option to --fill ANSI background colors.
- Option --html-fill is now same as --fill and will be phased out.
- Default HTML font changed from courier new to courier.
- HTML output always uses <pre> tag.
CHANGES SINCE 1.0.1 (svnversion 427)
- Using span- instead of b-tags in HTML output.
CHANGES SINCE 1.0.0 (svnversion 421)
- Added option --html-title=...
- Added option --html-raw
CHANGES SINCE 0.9.22
- License changed from "GPL v2 or later" to "GPL v2". This is just because
I want to review the v3 license before deciding to apply it to jp2a, as it
might require me to add things to the program.
- Minor code changes (in image.c)
- Distribution now also contains HTML manual pages for systems that do not support UNIX man.
- Version bumped to 1.0.0 (stable)
CHANGES SINCE 0.9.21 (rev. 412)
- Text color output is a bit more colorful.
- HTML-output is now Firefox-friendly.
- Added --html-fill to enable/disable background colors on HTML output.
- Options --background=light or =dark now affects HTML output background.
CHANGES SINCE 0.9.20
- Added color output for text (ANSI colors) and HTML (CSS colors).
- Changed default HTML fontsize from 4 to 8 pt.
- Fixed a bug that produced incorrect output when using --output and --html.
- Fixed a bug that gave incorret --term-fit when vieweing multiple files.
CHANGES SINCE 0.9.19
- A bash script is used for testing now.
- The tests were updated to use --width=78 (the old default) where appropriate.
- Cygwin support was added.
- term.h is now also sought in ncurses/term.h (for Cygwin support).
- The help text was shrunk.
CHANGES SINCE 0.9.18
- Default running mode is now "jp2a --term-fit" if you have --enable-termlib (which is also default).
- New options --term-fit, --term-width, --term-height to automatically fit image to terminal display.
- New options --background=dark and --background=light so you don't have to bother with --invert.
- Much better output quality as all source pixels are now read.
- Configure now accepts --enable-termlib (default) or --disable-termlib.
- Bugfix: In some cases, the last pixel(s) of the source images were not read.
- Will now gracefully exit if jpeg color precision is other than 8 bits per channels.
CHANGES SINCE 0.9.17
- Bugfix: No more crashes when reading non-JPEG files on Windows.
- New option: --output=file, send output to given file
- New options: -x for shorthand --flipx, and -y for --flipy.
- New options: --red, --green, --blue.
- More natural RGB to Grayscale calculation.
- Updated manuals.
- Cleaner code.
- Faster code (most evident in large images).
CHANGES SINCE 0.9.16
- New feature: Download-support on win32 binary builds.
- Added option to --clear screen before writing each output image.
- Updated tests for win32 cygwin environment (but still incomplete).
CHANGES SINCE 0.9.15 AND 0.9.14
- New feature: Now follow HTTP redirects when downloading.
- Cleaner and faster code.
- Cleaner package organization.
- Improved `make test'.
- Binary is larger becase of debug-symbols; remove with `make install-strip'.
- Added HTML-manual for win32 binary distribution.
CHANGES SINCE 0.9.13
- Minor bugfix: --chars now correctly accepts minimum two chars.
- Changed package layout (added src/ and tests/).
- Added `make test' target.
CHANGES SINCE 0.9.12
- Bugfix: Fixed bug when viewing several files (in clear(), yadds wasn't completely cleared)
- Minor code cleanup.
CHANGES SINCE 0.9.11
- Some Linux build failed on this: curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, NULL);
This has been removed, and works well for the Linux distro tested on.
CHANGES SINCE 0.9.10
- New feature: Can now download images from URLs (requires libcurl)
- New feature: Added --debug (-d) for debug output with libcurl
- configure: Added --enable-curl and --with-curl-config=PATH
CHANGES SINCE 0.9.9
- Using both --width and --height is equivalent to using --size
- Now correctly calculates width and height if one of --width or --height is used
CHANGES SINCE 0.9.8
- New feature: Added --flipx and --flipy options to flip the output image.
- New feature: Added --html and --html-fontsize for XHTML 1.0 output.
- Bugfix: The bugfix from 0.9.6 sneaked back into the 0.9.8 release, and is now removed.
- Code changes: The code is a little bit cleaner, and faster now for big output dimensions
- Added reference to The Independent JPEG Group in the man page, as the libjpeg license requires that.
- The help text now fits inside 80 characters in width.
- Default mode changed from --width=70 to --width=78
CHANGES SINCE 0.9.7
- Minor portability issues resolved (regarding size_t usage)
- Moved some redundant help text to the man page
- Updated and expanded man page
CHANGES SINCE 0.9.6
- Minor bugfix, for some images, the last output line would be a "black" line,
this has been fixed with the use of ROUND in dst_y calculations.
CHANGES SINCE 0.9.5
- Fixed a major bug in the clear() function that overwrote the yadds buffer.
The program should work much better now, especially on multiple input files.
CHANGES SINCE 0.9.4
- The option --border can now be specified simply as -b
- New option --invert or -i to invert output image
CHANGES SINCE 0.9.3
- jp2a now exits with error when no files are specified
- Function signatures changed; added const where applicable
- Reintroduced use of malloc
- Added check for alloca in configure.ac
CHANGES SINCE 0.9.2
- When reading multiple files, malloc complained when freeing memory. Using
alloca now instead, which does not complain (although it may seem a buffer
overrun is lurking somewhere).
- Not using exit(), using return codes. If error occurs, we always stop.
- Using `cat file.jpg | jp2a -' now does not print help message along with
image.
CHANGES SINCE 0.9.1
- Much better output results, due to more accurate normalization and removal of
missing scanlines in output image.
- Default mode is now "--width=70" instead of "--size=80x25", as this preserves
JPEG aspect ratio in output.
- Configure does not check for memset function anymore
- to_dst_x and to_dst_y are now correct
CHANGES SINCE 0.9.0
- Added --border option
- Fixed buffer overrun bug when using big output dimensions
- Minor code cleanup
- Note that to_dst_x and to_dst_y in code might be wrong
$Id: ChangeLog 454 2006-09-25 10:12:03Z csl $
See the README file for building and installation instructions.
WIN32 BINARY VERSION
Copy the files in win32-dist/ to e.g. C:\PROGRAM FILES\JP2A\.
The supplied DLLs must be either in the same directory as jp2a.exe,
or must be in a searchable path, e.g. C:\WINNT\SYSTEM32\.
$Id: INSTALL 384 2006-07-27 13:40:31Z csl $
o jp2a is distributed under the GNU General Public License v2.
See the file COPYING for a copy of that license, and how you can
apply that license to make derivative works.
O Although I do make use of other libraries, the source distribution does
not include any source-code from these. However, the win32 version comes
with precompiled library files, so I copy the licenses here.
o jp2a makes use of the JPEG library by the Independent JPEG Group.
See http://www.ijg.org
o jp2a makes use of libcurl, which has the following license:
COPYRIGHT AND PERMISSION NOTICE
Copyright (c) 1996 - 2006, Daniel Stenberg, <daniel@haxx.se>.
All rights reserved.
Permission to use, copy, modify, and distribute this software for any purpose
with or without fee is hereby granted, provided that the above copyright
notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN
NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
OR OTHER DEALINGS IN THE SOFTWARE.
Except as contained in this notice, the name of a copyright holder shall not
be used in advertising or otherwise to promote the sale, use or other dealings
in this Software without prior written authorization of the copyright holder.
o The jp2a win32 binary distribution comes with zlib1.dll from
http://www.zlib.org. The zlib license is as follows:
/* zlib.h -- interface of the 'zlib' general purpose compression library
version 1.2.3, July 18th, 2005
Copyright (C) 1995-2005 Jean-loup Gailly and Mark Adler
This software is provided 'as-is', without any express or implied
warranty. In no event will the authors be held liable for any damages
arising from the use of this software.
Permission is granted to anyone to use this software for any purpose,
including commercial applications, and to alter it and redistribute it
freely, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
Jean-loup Gailly jloup@gzip.org
Mark Adler madler@alumni.caltech.edu
*/
o The jp2a win32 binary distribution comes with precompiled OpenSSL binaries
from http://www.openssl.org. These have the following license:
LICENSE ISSUES
==============
The OpenSSL toolkit stays under a dual license, i.e. both the conditions of
the OpenSSL License and the original SSLeay license apply to the toolkit.
See below for the actual license texts. Actually both licenses are BSD-style
Open Source licenses. In case of any license issues related to OpenSSL
please contact openssl-core@openssl.org.
OpenSSL License
---------------
/* ====================================================================
* Copyright (c) 1998-2005 The OpenSSL Project. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. All advertising materials mentioning features or use of this
* software must display the following acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
*
* 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
* endorse or promote products derived from this software without
* prior written permission. For written permission, please contact
* openssl-core@openssl.org.
*
* 5. Products derived from this software may not be called "OpenSSL"
* nor may "OpenSSL" appear in their names without prior written
* permission of the OpenSSL Project.
*
* 6. Redistributions of any form whatsoever must retain the following
* acknowledgment:
* "This product includes software developed by the OpenSSL Project
* for use in the OpenSSL Toolkit (http://www.openssl.org/)"
*
* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
* EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
* PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
* NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
* ====================================================================
*
* This product includes cryptographic software written by Eric Young
* (eay@cryptsoft.com). This product includes software written by Tim
* Hudson (tjh@cryptsoft.com).
*
*/
Original SSLeay License
-----------------------
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
* This package is an SSL implementation written
* by Eric Young (eay@cryptsoft.com).
* The implementation was written so as to conform with Netscapes SSL.
*
* This library is free for commercial and non-commercial use as long as
* the following conditions are aheared to. The following conditions
* apply to all code found in this distribution, be it the RC4, RSA,
* lhash, DES, etc., code; not just the SSL code. The SSL documentation
* included with this distribution is covered by the same copyright terms
* except that the holder is Tim Hudson (tjh@cryptsoft.com).
*
* Copyright remains Eric Young's, and as such any Copyright notices in
* the code are not to be removed.
* If this package is used in a product, Eric Young should be given attribution
* as the author of the parts of the library used.
* This can be in the form of a textual message at program startup or
* in documentation (online or textual) provided with the package.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* "This product includes cryptographic software written by
* Eric Young (eay@cryptsoft.com)"
* The word 'cryptographic' can be left out if the rouines from the library
* being used are not cryptographic related :-).
* 4. If you include any Windows specific code (or a derivative thereof) from
* the apps directory (application code) you must include an acknowledgement:
* "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
*
* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* The licence and distribution terms for any publically available version or
* derivative of this code cannot be changed. i.e. this code cannot simply be
* copied and put under another distribution licence
* [including the GNU Public Licence.]
*/
# $Id: Makefile.am 454 2006-09-25 10:12:03Z csl $
VERSION = @VERSION@
SUBDIRS = src
man_MANS = man/jp2a.1
EXTRA_DIST = tests/??*.txt tests/??*.html tests/??*.jpg tests/run-tests.sh tests/Makefile include/??*.h man/jp2a.1 LICENSES man/jp2a.html
test: all
cd tests/; make test
man/jp2a.html: man/jp2a.1
groff -T html -man $< > $@
dist-win32: jp2a-$(VERSION)-win32-bin.zip
jp2a-$(VERSION)-win32-bin.zip: win32-dist/jp2a.exe man/jp2a.html
upx $< || exit 0
rm -f $@
zip $@ AUTHORS COPYING LICENSES ChangeLog INSTALL NEWS README man/jp2a.html win32-dist/*
test-curl: all
cd tests/; make test-curl
test-normal: all
cd tests/; make test-normal
This diff is collapsed.
See ChangeLog
ABOUT JP2A
jp2a is a simple JPEG to ASCII viewer.
COPYRIGHT
jp2a is Copyright (c) 2006 Christian Stigen Larsen
Distributed under the GNU General Public License v2.
You can read the full license in the file COPYING. jp2a also
uses other libraries. These licenses can be found in the file
LICENSES.
The latest version is available from http://jp2a.sf.net
QUICK INSTALL
./configure
make
make test # optional
make install
If configure doesn't find jpeglib.h and you know where
it is, you specify with
./configure --with-jpeg-include=PATH --with-jpeg-lib=PATH
If you want to be able to download images from the net, you
must have libcurl installed (http://curl.haxx.se) and configure
for example like this:
./configure --enable-curl
This will look for `curl-config' in $PATH, but you can specify
it directly with --with-curl-config=PATH if you need to.
PRE-REQUISITES
jp2a requires jpeglib. If you don't have it, the source is
available from http://www.ijg.org/
If you want to be able to download images from the net, you
also need libcurl, from http://curl.haxx.se
BUILDING ON MAC OS X
jp2a is now part of darwin ports, so the easiest installation is:
sudo port install jp2a
If you do not have darwinports installed, go to http://www.opendarwin.org
and install it from there.
To build yourself, do this:
# USING FINK
fink install libjpeg curl
./configure --with-jpeg-prefix=/sw --with-curl-config=/sw/bin
# USING DARWIN PORTS
sudo port install jpeg curl
./configure --with-jpeg-prefix=/opt/local --with-curl-config=/opt/local/bin
BUILDING WITHOUT USING CONFIGURE
You need (at least) jpeglib.h and libjpeg, then you do this:
gcc -g -O2 \
-DPACKAGE_BUGREPORT='"csl@sublevel3.org"' \
-DPACKAGE_STRING='"jp2a 0.9.xx"' \
-I/opt/local/include/ -L/opt/local/lib -l jpeg jp2a.c -o jp2a
BUILDING ON WINDOWS (MS VISUAL STUDIO)
Download a reasonable jpeglib version for Windows, e.g. from
http://www.ece.sunysb.edu/~cvl/e358/f2001/jpeg-windows.html
(Don't use Gnuwin32's version, it completely broke on my system).
Fire up MS Visual Studio, you should select C++ compilation, because
(at least with my MSVC version) the C compiler gave some strange
warnings and errors, probably due to the fact that i use some C99
code.
Since config.h is not generated for MSVC, you need to add some
preprocessor definitions:
WIN32
NDEBUG
_CONSOLE
PACKAGE_STRING=\"jp2a x.x.x-win32\"
PACKAGE_BUGREPORT=\"csl@sublevel3.org\"
HAVE_STRING_H
HAVE_STDLIB_H
FEAT_CURL
HAVE_CURL_CURL_H
CURL_STATICLIB
FEAT_TERMLIB
Add the jpeg.lib file provided by above URL in the search directory
and in the linker input, and then everything should compile without
any errors. If you want CURL support, you can find a good win32
version for development from
http://my.guardpuppy.com/libcurl-7.15.1-msvc-win32-ssl-0.9.8a-zlib-1.2.3.zip
(that is, go to http://curl.haxx.se, select DOWNLOAD and look for the
MSVC SSL libcurl versions.)
BUILDING ON WINDOWS (MINGW32)
Using mingw32 is straight-forward if you have a working (non-MSVC)
jpeglib. On Mac OS X, you do something along these lines to
cross-compile:
./configure --host=i386-mingw32
make test
I currently use MS Visual C++ to compile the Win32 binaries for jp2a,
but I am going to swith to using mingw32.
$Id: README 415 2006-07-31 09:34:41Z csl $
This diff is collapsed.
/* config.h.in. Generated from configure.ac by autoheader. */
/* Found working libcurl environment */
#undef FEAT_CURL
/* Found working term/curses environment */
#undef FEAT_TERMLIB
/* Define to 1 if you have the `atexit' function. */
#undef HAVE_ATEXIT
/* Define to 1 if you have the <curl/curl.h> header file */
#undef HAVE_CURL_CURL_H
/* Define to 1 if you have the <curses.h> header file. */
#undef HAVE_CURSES_H
/* Define to 1 if you have the <fcntl.h> header file. */
#undef HAVE_FCNTL_H
/* Define to 1 if you have the `fork' function. */
#undef HAVE_FORK
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have <jpeglib.h> header file. */
#undef HAVE_JPEGLIB_H
/* Define to 1 if your system has a GNU libc compatible `malloc' function, and
to 0 otherwise. */
#undef HAVE_MALLOC
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
/* Define to 1 if you have the `memset' function. */
#undef HAVE_MEMSET
/* Define to 1 if you have the <ncurses/term.h> header file. */
#undef HAVE_NCURSES_TERM_H
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the <strings.h> header file. */
#undef HAVE_STRINGS_H
/* Define to 1 if you have the <string.h> header file. */
#undef HAVE_STRING_H
/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H
/* Define to 1 if you have the <sys/types.h> header file. */
#undef HAVE_SYS_TYPES_H
/* Define to 1 if you have the <term.h> header file. */
#undef HAVE_TERM_H
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Define to 1 if you have the `vfork' function. */
#undef HAVE_VFORK
/* Define to 1 if you have the <vfork.h> header file. */
#undef HAVE_VFORK_H
/* Define to 1 if `fork' works. */
#undef HAVE_WORKING_FORK
/* Define to 1 if `vfork' works. */
#undef HAVE_WORKING_VFORK
/* Name of package */
#undef PACKAGE
/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT
/* Define to the full name of this package. */
#undef PACKAGE_NAME
/* Define to the full name and version of this package. */
#undef PACKAGE_STRING
/* Define to the one symbol short name of this package. */
#undef PACKAGE_TARNAME
/* Define to the version of this package. */
#undef PACKAGE_VERSION
/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS
/* Version number of package */
#undef VERSION
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif
/* Define to rpl_malloc if the replacement function should be used. */
#undef malloc
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t
/* Define as `fork' if `vfork' does not work. */
#undef vfork
This diff is collapsed.
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.60)
AC_INIT([jp2a], [1.0.6], [csl@sublevel3.org])
AM_INIT_AUTOMAKE(dist-bzip2)
AC_CONFIG_SRCDIR(src/jp2a.c)
AC_CONFIG_HEADER([config.h])
AC_REVISION([$Id: configure.ac 460 2006-09-25 11:08:24Z csl $])
AC_CONFIG_FILES([Makefile src/Makefile])
# Checks for programs.
AC_PROG_CC
# Checks for libraries.
AC_ARG_WITH([jpeg-include],
AC_HELP_STRING([--with-jpeg-include=PATH], [specify path to directory containing jpeglib.h -- http://www.ijg.org/]),
[CPPFLAGS="$CPPFLAGS -I$withval"])
AC_ARG_WITH([jpeg-lib],
AC_HELP_STRING([--with-jpeg-lib=PATH], [specify path to directory containing jpeglib lib file -- http://www.ijg.org/]),
[LDFLAGS="$LDFLAGS -L$withval"])
AC_ARG_WITH([jpeg-prefix],
AC_HELP_STRING([--with-jpeg-prefix=PATH], [this is the same as --with-jpeg-include=PATH/include and --with-jpeg-lib=PATH/lib]),
[CPPFLAGS="$CPPFLAGS -I$withval/include" LDFLAGS="$LDFLAGS -L$withval/lib"])
AC_ARG_WITH([curl-config],
AC_HELP_STRING([--with-curl-config=PATH], [specify path to curl-config]),
[curl_config_path="$withval" enable_curl="yes"],
[curl_config_path="$PATH"])
AC_CHECK_LIB([jpeg], [jpeg_start_decompress], [LIBS="$LIBS -ljpeg"])
if test "x$ac_cv_lib_jpeg_jpeg_start_decompress" != "xyes" ; then
AC_MSG_ERROR([I need a working jpeglib; please specify --with-jpeg-lib=PATH or see --help for more explicit options.
On many systems, this is installed in /usr/local/lib/ so you can try --with-jpeg-prefix=/usr/local/
])
fi
AC_ARG_ENABLE([curl],
AC_HELP_STRING([--enable-curl], [enable to be to use libcurl (http://curl.haxx.se) to download images from the net (default: yes)]),
[enable_curl=$enableval],
[enable_curl="yes"])
AC_ARG_ENABLE([termlib],
AC_HELP_STRING([--enable-termlib], [enable to use term/curses for detecting terminal dimensions (default: yes)]),
[enable_termlib=$enableval],
[enable_termlib="yes"])
AC_MSG_CHECKING([enable-curl])
AC_MSG_RESULT([$enable_curl])
if test "x$enable_curl" = "xyes" ; then
AC_PATH_PROGS([curl_config], [curl-config], [no], [$curl_config_path])
if test "x$curl_config" != "xno" ; then
curl_cflags="`$curl_config --cflags`"
curl_libs="`$curl_config --libs`"
CPPFLAGS="$CPPFLAGS $curl_cflags"
AC_MSG_CHECKING([curl-config --cflags])
AC_MSG_RESULT([$curl_cflags])
AC_MSG_CHECKING([curl-config --libs])
AC_MSG_RESULT([$curl_libs])
fi
if test "x$curl_libs" = "x" ; then
curl_libs="-lcurl"
fi
AC_CHECK_LIB([curl], [curl_easy_init], [LIBS="$LIBS $curl_libs" AC_DEFINE([FEAT_CURL], [1], [Found working libcurl environment])], [
AC_MSG_WARN([I need a working libcurl (use --with-curl-config=PATH); download-support will be disabled])
enable_curl="no"
])
fi
# Checks for header files.
AC_HEADER_STDC
AC_CHECK_HEADER([jpeglib.h],
[ AC_DEFINE([HAVE_JPEGLIB_H], [1], [Define to 1 if you have <jpeglib.h> header file.]) ],
[ AC_MSG_ERROR([required header file jpeglib.h not found, use --with-jpeg-include=PATH or see --help]) ])
if test "x$enable_curl" = "xyes" ; then
AC_CHECK_HEADER([curl/curl.h],
[ AC_DEFINE([HAVE_CURL_CURL_H], [1], [Define to 1 if you have the <curl/curl.h> header file]) ],
[ AC_MSG_WARN([required header file curl/curl.h not found, libcurl will be disabled (see --help)]) ])
fi
AC_CHECK_HEADERS([fcntl.h curses.h term.h ncurses/term.h])
if test "$enable_termlib" = "yes" ; then
# Some GNU/Linux systems (e.g., SuSE 4.3, 1996) don't have curses, but
# rather ncurses. So we check for it.
TERMLIBS=
# Check for termlib before termcap because Solaris termcap needs libucb.
TERMLIB_VARIANTS="ncurses curses termlib termcap terminfo"
for termlib in ${TERMLIB_VARIANTS}; do
AC_CHECK_LIB(${termlib}, tgetent,
[TERMLIBS="${TERMLIBS} -l${termlib}"; break])
done