Initial import

git-svn-id: http://moon:8086/svn/software/trunk/libsrc/libtiff@1 b431acfa-c32f-4a4a-93f1-934dc6c82436
This commit is contained in:
2014-07-19 07:44:42 +00:00
commit 6e95530335
410 changed files with 80036 additions and 0 deletions
+165
View File
@@ -0,0 +1,165 @@
# Project: LibTIFF
# Toolflags:
CCflags = -c -zo -ffah -depend !Depend -IC:
C++flags = -c -depend !Depend -IC: -throwback
Linkflags = -aif -c++ -o $@
DrLinkflags = -nounused -aif -c++ -o $@
ObjAsmflags = -throwback -NoCache -depend !Depend
CMHGflags =
LibFileflags = -c -o $@
Squeezeflags = -o $@
# Final targets:
@.o.LIBTIFF: \
@.o.tif_acorn \
@.o.tif_aux \
@.o.tif_close \
@.o.tif_codec \
@.o.tif_compress \
@.o.tif_dir \
@.o.tif_dirinfo \
@.o.tif_dirread \
@.o.tif_dirwrite \
@.o.tif_dumpmode \
@.o.tif_error \
@.o.tif_fax3 \
@.o.tif_flush \
@.o.tif_getimage \
@.o.tif_jpeg \
@.o.tif_lzw \
@.o.tif_next \
@.o.tif_open \
@.o.tif_packbits \
@.o.tif_predict \
@.o.tif_print \
@.o.tif_read \
@.o.tif_strip \
@.o.tif_swab \
@.o.tif_thunder \
@.o.tif_tile \
@.o.tif_version \
@.o.tif_warning \
@.o.tif_write \
@.o.tif_zip \
@.o.tif_fax3sm \
@.h.version
LibFile $(LibFileflags) \
@.o.tif_acorn \
@.o.tif_aux \
@.o.tif_close \
@.o.tif_codec \
@.o.tif_compress \
@.o.tif_dir \
@.o.tif_dirinfo \
@.o.tif_dirread \
@.o.tif_dirwrite \
@.o.tif_dumpmode \
@.o.tif_error \
@.o.tif_fax3 \
@.o.tif_flush \
@.o.tif_getimage \
@.o.tif_jpeg \
@.o.tif_lzw \
@.o.tif_next \
@.o.tif_open \
@.o.tif_packbits \
@.o.tif_predict \
@.o.tif_print \
@.o.tif_read \
@.o.tif_strip \
@.o.tif_swab \
@.o.tif_thunder \
@.o.tif_tile \
@.o.tif_version \
@.o.tif_warning \
@.o.tif_write \
@.o.tif_zip \
@.o.tif_fax3sm
# User-editable dependencies:
@.mkversion: @.o.mkversion C:o.Stubs
Link $(linkflags) @.o.mkversion C:o.Stubs
@.h.version: @.VERSION @.mkversion
<Prefix$Dir>.mkversion -v @.VERSION -a @.tiff/alpha @.h.version
@.mkg3states: @.o.mkg3states @.o.getopt C:o.Stubs
link $(linkflags) @.o.mkg3states C:o.Stubs @.o.getopt
@.c.tif_fax3sm: @.mkg3states
<Prefix$Dir>.mkg3states -c const @.c.tif_fax3sm
# Static dependencies:
@.o.tif_acorn: @.c.tif_acorn
cc $(ccflags) -o @.o.tif_acorn @.c.tif_acorn
@.o.tif_aux: @.c.tif_aux
cc $(ccflags) -o @.o.tif_aux @.c.tif_aux
@.o.tif_close: @.c.tif_close
cc $(ccflags) -o @.o.tif_close @.c.tif_close
@.o.tif_codec: @.c.tif_codec
cc $(ccflags) -o @.o.tif_codec @.c.tif_codec
@.o.tif_compress: @.c.tif_compress
cc $(ccflags) -o @.o.tif_compress @.c.tif_compress
@.o.tif_dir: @.c.tif_dir
cc $(ccflags) -o @.o.tif_dir @.c.tif_dir
@.o.tif_dirinfo: @.c.tif_dirinfo
cc $(ccflags) -o @.o.tif_dirinfo @.c.tif_dirinfo
@.o.tif_dirread: @.c.tif_dirread
cc $(ccflags) -o @.o.tif_dirread @.c.tif_dirread
@.o.tif_dirwrite: @.c.tif_dirwrite
cc $(ccflags) -o @.o.tif_dirwrite @.c.tif_dirwrite
@.o.tif_dumpmode: @.c.tif_dumpmode
cc $(ccflags) -o @.o.tif_dumpmode @.c.tif_dumpmode
@.o.tif_error: @.c.tif_error
cc $(ccflags) -o @.o.tif_error @.c.tif_error
@.o.tif_fax3: @.c.tif_fax3
cc $(ccflags) -o @.o.tif_fax3 @.c.tif_fax3
@.o.tif_flush: @.c.tif_flush
cc $(ccflags) -o @.o.tif_flush @.c.tif_flush
@.o.tif_getimage: @.c.tif_getimage
cc $(ccflags) -o @.o.tif_getimage @.c.tif_getimage
@.o.tif_jpeg: @.c.tif_jpeg
cc $(ccflags) -o @.o.tif_jpeg @.c.tif_jpeg
@.o.tif_lzw: @.c.tif_lzw
cc $(ccflags) -o @.o.tif_lzw @.c.tif_lzw
@.o.tif_next: @.c.tif_next
cc $(ccflags) -o @.o.tif_next @.c.tif_next
@.o.tif_open: @.c.tif_open
cc $(ccflags) -o @.o.tif_open @.c.tif_open
@.o.tif_packbits: @.c.tif_packbits
cc $(ccflags) -o @.o.tif_packbits @.c.tif_packbits
@.o.tif_predict: @.c.tif_predict
cc $(ccflags) -o @.o.tif_predict @.c.tif_predict
@.o.tif_print: @.c.tif_print
cc $(ccflags) -o @.o.tif_print @.c.tif_print
@.o.tif_read: @.c.tif_read
cc $(ccflags) -o @.o.tif_read @.c.tif_read
@.o.tif_strip: @.c.tif_strip
cc $(ccflags) -o @.o.tif_strip @.c.tif_strip
@.o.tif_swab: @.c.tif_swab
cc $(ccflags) -o @.o.tif_swab @.c.tif_swab
@.o.tif_thunder: @.c.tif_thunder
cc $(ccflags) -o @.o.tif_thunder @.c.tif_thunder
@.o.tif_tile: @.c.tif_tile
cc $(ccflags) -o @.o.tif_tile @.c.tif_tile
@.o.tif_version: @.c.tif_version
cc $(ccflags) -o @.o.tif_version @.c.tif_version
@.o.tif_warning: @.c.tif_warning
cc $(ccflags) -o @.o.tif_warning @.c.tif_warning
@.o.tif_write: @.c.tif_write
cc $(ccflags) -o @.o.tif_write @.c.tif_write
@.o.tif_zip: @.c.tif_zip
cc $(ccflags) -o @.o.tif_zip @.c.tif_zip
@.o.mkg3states: @.c.mkg3states
cc $(ccflags) -o @.o.mkg3states @.c.mkg3states
@.o.getopt: @.c.getopt
cc $(ccflags) -o @.o.getopt @.c.getopt
@.o.mkspans: @.c.mkspans
cc $(ccflags) -o @.o.mkspans @.c.mkspans
@.o.tif_fax3sm: @.c.tif_fax3sm
cc $(ccflags) -o @.o.tif_fax3sm @.c.tif_fax3sm
@.o.mkversion: @.c.mkversion
cc $(ccflags) -o @.o.mkversion @.c.mkversion
# Dynamic dependencies:
+79
View File
@@ -0,0 +1,79 @@
Building the Software on an Acorn RISC OS system
The directory contrib/acorn contains support for compiling the library under
Acorn C/C++ under Acorn's RISC OS 3.10 or above. Subsequent pathnames will
use the Acorn format: The full-stop or period character is a pathname
delimeter, and the slash character is not interpreted; the reverse position
from Unix. Thus "libtiff/tif_acorn.c" becomes "libtiff.tif_acorn/c".
This support was contributed by Peter Greenham.
(peterg@angmulti.demon.co.uk).
Installing LibTIFF:
LIBTIFF uses several files which have names longer than the normal RISC OS
maximum of ten characters. This complicates matters. Maybe one day Acorn will
address the problem and implement long filenames properly. Until then this
gets messy, especially as I'm trying to do this with obeyfiles and not have
to include binaries in this distribution.
First of all, ensure you have Truncate configured on (type *Configure
Truncate On) Although it is, of course, preferable to have long filenames,
LIBTIFF can be installed with short filenames, and it will compile and link
without problems. However, getting it there is more problematic.
contrib.acorn.install is an installation obeyfile which will create a normal
Acorn-style library from the source (ie: with c, h and o folders etc.), but
needs the distribution library to have been unpacked into a location which is
capable of supporting long filenames, even if only temporarily.
My recommendation, until Acorn address this problem properly, is to use Jason
Tribbeck's LongFilenames , or any other working system that gives you long
filenames, like a nearby NFS server for instance.
If you are using Longfilenames, even if only temporarily to install LIBTIFF,
unpack the TAR into a RAMDisc which has been longfilenamed (ie: *addlongfs
ram) and then install from there to the hard disk. Unfortunately
Longfilenames seems a bit unhappy about copying a bunch of long-named files
across the same filing system, but is happy going between systems. You'll
need to create a ramdisk of about 2Mb.
Now you can run the installation script I've supplied (in contrib.acorn),
which will automate the process of installing LIBTIFF as an Acorn-style
library. The syntax is as follows:
install <source_dir> <dest_dir>
Install will then create <dest_dir> and put the library in there. For
example, having used LongFilenames on the RAMDisk and unpacked the library
into there, you can then type:
Obey RAM::RamDisc0.$.contrib.acorn.install RAM::RamDisc0.$ ADFS::4.$.LIBTIFF
It doesn't matter if the destination location can cope with long filenames or
not. The filenames will be truncated if necessary (*Configure Truncate On if
you get errors) and all will be well.
Compiling LibTIFF:
Once the LibTIFF folder has been created and the files put inside, making the
library should be just a matter of running 'SetVars' to set the appropriate
system variables, then running 'Makefile'.
OSLib
OSLib is a comprehensive API for RISC OS machines, written by Jonathan
Coxhead of Acorn Computers (although OSLib is not an official Acorn product).
Using the OSLib SWI veneers produces code which is more compact and more
efficient than code written using _kernel_swi or _swi. The Acorn port of
LibTIFF can take advantage of this if present. Edit the Makefile and go to
the Static dependencies section. The first entry is:
# Static dependencies:
@.o.tif_acorn: @.c.tif_acorn
cc $(ccflags) -o @.o.tif_acorn @.c.tif_acorn
Change the cc line to:
cc $(ccflags) -DINCLUDE_OSLIB -o @.o.tif_acorn @.c.tif_acorn
Remember, however, that OSLib is only recommended for efficiency's sake. It
is not required.
+3
View File
@@ -0,0 +1,3 @@
Set LibTIFF$Dir <Obey$Dir>
Set LibTIFF$Path <LibTIFF$Dir>.
Set C$Path <C$Path>,LibTIFF:
+5
View File
@@ -0,0 +1,5 @@
IfThere LibTIFF:o.* THEN Wipe LibTIFF:o.* ~CFR~V
IfThere LibTIFF:c.tif_fax3sm THEN Delete LibTIFF:c.tif_fax3sm
IfThere LibTIFF:mkg3states THEN Delete LibTIFF:mkg3states
IfThere LibTIFF:h.version THEN Delete LibTIFF:h.version
IfThere LibTIFF:mkversion THEN Delete LibTIFF:mkversion
+175
View File
@@ -0,0 +1,175 @@
RISC OS Conversion log
======================
mkversion.c
~~~~~~~~~~~
The RISC OS command-line does not allow the direct creation of the version.h
file in the proper manner. To remedy this in such a way that the version
header is made at compiletime, I wrote this small program. It is fully
portable, so should work quite happily for any other platform that might need
it.
msg3states.c
~~~~~~~~~~~~
Needed getopt.c from the port folder, then compiled and worked fine.
tiff.h
~~~~~~
====1====
The symbol _MIPS_SZLONG, if not defined, causes a compiler error. Fixed by
ensuring it does exist. This looks to me like this wouldn't be an
Acorn-specific problem. The new code fragment is as follows:
#ifndef _MIPS_SZLONG
#define _MIPS_SZLONG 32
#endif
#if defined(__alpha) || _MIPS_SZLONG == 64
tiffcomp.h
~~~~~~~~~~
====1====
#if !defined(__MWERKS__) && !defined(THINK_C)
#include <sys/types.h>
#endif
Acorn also doesn't have this header so:
#if !defined(__MWERKS__) && !defined(THINK_C) && !defined(__acorn)
#include <sys/types.h>
#endif
====2====
#ifdef VMS
#include <file.h>
#include <unixio.h>
#else
#include <fcntl.h>
#endif
This seems to indicate that fcntl.h is included on all systems except
VMS. Odd, because I've never heard of it before. Sure it's in the ANSI
definition? Anyway, following change:
#ifdef VMS
#include <file.h>
#include <unixio.h>
#else
#ifndef __acorn
#include <fcntl.h>
#endif
#endif
This will probably change when I find out what it wants from fcntl.h!
====3====
#if defined(__MWERKS__) || defined(THINK_C) || defined(applec)
#include <stdlib.h>
#define BSDTYPES
#endif
Added RISC OS to above thus:
#if defined(__MWERKS__) || defined(THINK_C) || defined(applec) || defined(__acorn)
#include <stdlib.h>
#define BSDTYPES
#endif
====4====
/*
* The library uses the ANSI C/POSIX SEEK_*
* definitions that should be defined in unistd.h
* (except on VMS where they are in stdio.h and
* there is no unistd.h).
*/
#ifndef SEEK_SET
#if !defined(VMS) && !defined (applec) && !defined(THINK_C) && !defined(__MWERKS__)
#include <unistd.h>
#endif
RISC OS is like VMS and Mac in this regard. So changed to:
/*
* The library uses the ANSI C/POSIX SEEK_*
* definitions that should be defined in unistd.h
* (except on VMS or the Mac or RISC OS, where they are in stdio.h and
* there is no unistd.h).
*/
#ifndef SEEK_SET
#if !defined(VMS) && !defined (applec) && !defined(THINK_C) && !defined(__MWERKS__) && !defined(__acorn)
#include <unistd.h>
#endif
#endif
====5====
NB: HAVE_IEEEFP is defined in tiffconf.h, not tiffcomp.h as mentioned
in libtiff.README. (Note written on original port from 3.4beta004)
Acorn C/C++ claims to accord with IEEE 754, so no change (yet) to
tiffconf.h.
====6====
Unsure about whether this compiler supports inline functions. Will
leave it on for the time being and see if it works! (Likely if
everything else does.)
... Seems to be OK ...
====7====
Added to the end:
/*
* osfcn.h is part of C++Lib on Acorn C/C++, and as such can't be used
* on C alone. For that reason, the relevant functions have been
* implemented by myself in tif_acorn.c, and the elements from the header
* included here.
*/
#ifdef __acorn
#ifdef __cplusplus
#include <osfcn.h>
#else
#include "kernel.h"
#define O_RDONLY 0
#define O_WRONLY 1
#define O_RDWR 2
#define O_APPEND 8
#define O_CREAT 0x200
#define O_TRUNC 0x400
typedef long off_t;
extern int open(const char *name, int flags, int mode);
extern int close(int fd);
extern int write(int fd, const char *buf, int nbytes);
extern int read(int fd, char *buf, int nbytes);
extern off_t lseek(int fd, off_t offset, int whence);
#endif
#endif
===============================================================================
tif_acorn.c
~~~~~~~~~~~
Created file tif_acorn.c, copied initially from tif_unix.c
Documented internally where necessary.
Note that I have implemented the low-level file-handling functions normally
found in osfcn.h in here, and put the header info at the bottom of
tiffcomp.h. This is further documented from a RISC OS perspective inside the
file.
===============================================================================
+128
View File
@@ -0,0 +1,128 @@
If "%0" = "" Then Error Syntax: install |<source_dir> |<dest_dir>
If "%1" = "" Then Error Syntax: install |<source_dir> |<dest_dir>
Set LibTiffInstall$Dir %0
Set LibTiff$Dir %1
Set Alias$CPY Copy <LibTiffInstall$Dir>.%%0 <LibTiff$Dir>.%%1 ~C~DF~NRV
CDir <LibTiff$Dir>
CDir <LibTiff$Dir>.c
CDir <LibTiff$Dir>.h
CDir <LibTiff$Dir>.o
CPY COPYRIGHT COPYRIGHT
CPY README README
CPY VERSION VERSION
CPY dist.tiff/alpha tiff/alpha
CPY contrib.acorn.SetVars SetVars
CPY contrib.acorn.Makefile Makefile
CPY contrib.acorn.cleanlib cleanlib
CPY port.getopt/c c.getopt
CPY libtiff.mkg3states/c c.mkg3states
CPY libtiff.mkspans/c c.mkspans
CPY libtiff.mkversion/c c.mkversion
CPY libtiff.tif_acorn/c c.tif_acorn
CPY libtiff.tif_aux/c c.tif_aux
CPY libtiff.tif_close/c c.tif_close
CPY libtiff.tif_codec/c c.tif_codec
CPY libtiff.tif_compress/c c.tif_compre
CPY libtiff.tif_dir/c c.tif_dir
CPY libtiff.tif_dirinfo/c c.tif_dirinf
CPY libtiff.tif_dirread/c c.tif_dirrea
CPY libtiff.tif_dirwrite/c c.tif_dirwri
CPY libtiff.tif_dumpmode/c c.tif_dumpmo
CPY libtiff.tif_error/c c.tif_error
CPY libtiff.tif_fax3/c c.tif_fax3
CPY libtiff.tif_flush/c c.tif_flush
CPY libtiff.tif_getimage/c c.tif_getima
CPY libtiff.tif_jpeg/c c.tif_jpeg
CPY libtiff.tif_lzw/c c.tif_lzw
CPY libtiff.tif_next/c c.tif_next
CPY libtiff.tif_open/c c.tif_open
CPY libtiff.tif_packbits/c c.tif_packbi
CPY libtiff.tif_predict/c c.tif_predic
CPY libtiff.tif_print/c c.tif_print
CPY libtiff.tif_read/c c.tif_read
CPY libtiff.tif_strip/c c.tif_strip
CPY libtiff.tif_swab/c c.tif_swab
CPY libtiff.tif_thunder/c c.tif_thunde
CPY libtiff.tif_tile/c c.tif_tile
CPY libtiff.tif_version/c c.tif_versio
CPY libtiff.tif_warning/c c.tif_warnin
CPY libtiff.tif_write/c c.tif_write
CPY libtiff.tif_zip/c c.tif_zip
CPY libtiff.t4/h h.t4
CPY libtiff.tiff/h h.tiff
CPY libtiff.tiffcomp/h h.tiffcomp
CPY libtiff.tiffconf/h h.tiffconf
CPY libtiff.tiffio/h h.tiffio
CPY libtiff.tiffiop/h h.tiffiop
CPY libtiff.tif_dir/h h.tif_dir
CPY libtiff.tif_fax3/h h.tif_fax3
CPY libtiff.tif_predict/h h.tif_predic
SetType <LibTiff$Dir>.COPYRIGHT Text
SetType <LibTiff$Dir>.README Text
SetType <LibTiff$Dir>.VERSION Text
SetType <LibTiff$Dir>.tiff/alpha Text
SetType <LibTiff$Dir>.SetVars Obey
SetType <LibTiff$Dir>.Makefile fe1
SetType <LibTiff$Dir>.cleanlib Obey
SetType <LibTiff$Dir>.c.getopt Text
SetType <LibTiff$Dir>.c.mkg3states Text
SetType <LibTiff$Dir>.c.mkspans Text
SetType <LibTiff$Dir>.c.mkversion Text
SetType <LibTiff$Dir>.c.tif_acorn Text
SetType <LibTiff$Dir>.c.tif_aux Text
SetType <LibTiff$Dir>.c.tif_close Text
SetType <LibTiff$Dir>.c.tif_codec Text
SetType <LibTiff$Dir>.c.tif_compre Text
SetType <LibTiff$Dir>.c.tif_dir Text
SetType <LibTiff$Dir>.c.tif_dirinf Text
SetType <LibTiff$Dir>.c.tif_dirrea Text
SetType <LibTiff$Dir>.c.tif_dirwri Text
SetType <LibTiff$Dir>.c.tif_dumpmo Text
SetType <LibTiff$Dir>.c.tif_error Text
SetType <LibTiff$Dir>.c.tif_fax3 Text
SetType <LibTiff$Dir>.c.tif_flush Text
SetType <LibTiff$Dir>.c.tif_getima Text
SetType <LibTiff$Dir>.c.tif_jpeg Text
SetType <LibTiff$Dir>.c.tif_lzw Text
SetType <LibTiff$Dir>.c.tif_next Text
SetType <LibTiff$Dir>.c.tif_open Text
SetType <LibTiff$Dir>.c.tif_packbi Text
SetType <LibTiff$Dir>.c.tif_predic Text
SetType <LibTiff$Dir>.c.tif_print Text
SetType <LibTiff$Dir>.c.tif_read Text
SetType <LibTiff$Dir>.c.tif_strip Text
SetType <LibTiff$Dir>.c.tif_swab Text
SetType <LibTiff$Dir>.c.tif_thunde Text
SetType <LibTiff$Dir>.c.tif_tile Text
SetType <LibTiff$Dir>.c.tif_versio Text
SetType <LibTiff$Dir>.c.tif_warnin Text
SetType <LibTiff$Dir>.c.tif_write Text
SetType <LibTiff$Dir>.c.tif_zip Text
SetType <LibTiff$Dir>.h.t4 Text
SetType <LibTiff$Dir>.h.tiff Text
SetType <LibTiff$Dir>.h.tiffcomp Text
SetType <LibTiff$Dir>.h.tiffconf Text
SetType <LibTiff$Dir>.h.tiffio Text
SetType <LibTiff$Dir>.h.tiffiop Text
SetType <LibTiff$Dir>.h.tif_dir Text
SetType <LibTiff$Dir>.h.tif_fax3 Text
SetType <LibTiff$Dir>.h.tif_predic Text
Unset Alias$CPY
Unset LibTiffInstall$Dir
| Now attempt to restore longfilename status. If it causes an error, OK.
Set Alias$RN Rename <LibTiff$Dir>.%%0 <LibTiff$Dir>.%%1
Unset LibTiff$Dir
RN c.tif_compre c.tif_compress
RN c.tif_dirinf c.tif_dirinfo
RN c.tif_dirrea c.tif_dirread
RN c.tif_dirwri c.tif_dirwrite
RN c.tif_dumpmo c.tif_dumpmode
RN c.tif_getima c.tif_getimage
RN c.tif_packbi c.tif_packbits
RN c.tif_predic c.tif_predict
RN c.tif_thunde c.tif_thunder
RN c.tif_versio c.tif_version
RN c.tif_warnin c.tif_warning
RN h.tif_predic h.tif_predict
Unset Alias$RN
Echo All done!